@verdocs/web-sdk 1.9.31 → 1.9.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{Envelopes-752bdc31.js → Envelopes-019e8a9f.js} +2 -2
- package/dist/cjs/{Envelopes-752bdc31.js.map → Envelopes-019e8a9f.js.map} +1 -1
- package/dist/cjs/Files-4bdc0c0f.js +49 -0
- package/dist/cjs/Files-4bdc0c0f.js.map +1 -0
- package/dist/cjs/Primitives-be5088cb.js +25 -0
- package/dist/cjs/Primitives-be5088cb.js.map +1 -0
- package/dist/cjs/{Templates-a4370308.js → Templates-358eaee4.js} +2 -2
- package/dist/cjs/{Templates-a4370308.js.map → Templates-358eaee4.js.map} +1 -1
- package/dist/cjs/{templateStore-8c8dc4c1.js → templateStore-eed1f161.js} +3 -4
- package/dist/cjs/templateStore-eed1f161.js.map +1 -0
- package/dist/cjs/{utils-91d249b4.js → utils-787b2115.js} +5 -29
- package/dist/cjs/utils-787b2115.js.map +1 -0
- package/dist/cjs/verdocs-build.cjs.entry.js +3 -3
- package/dist/cjs/verdocs-document-page_2.cjs.entry.js +2 -1
- package/dist/cjs/verdocs-document-page_2.cjs.entry.js.map +1 -1
- package/dist/cjs/verdocs-dropdown_2.cjs.entry.js +3 -2
- package/dist/cjs/verdocs-dropdown_2.cjs.entry.js.map +1 -1
- package/dist/cjs/verdocs-field-checkbox.cjs.entry.js +2 -1
- package/dist/cjs/verdocs-field-checkbox.cjs.entry.js.map +1 -1
- package/dist/cjs/verdocs-field-date.cjs.entry.js +2 -1
- package/dist/cjs/verdocs-field-date.cjs.entry.js.map +1 -1
- package/dist/cjs/verdocs-field-dropdown.cjs.entry.js +2 -1
- package/dist/cjs/verdocs-field-dropdown.cjs.entry.js.map +1 -1
- package/dist/cjs/verdocs-field-initial.cjs.entry.js +2 -1
- package/dist/cjs/verdocs-field-initial.cjs.entry.js.map +1 -1
- package/dist/cjs/verdocs-field-payment.cjs.entry.js +2 -1
- package/dist/cjs/verdocs-field-payment.cjs.entry.js.map +1 -1
- package/dist/cjs/verdocs-field-radio-button.cjs.entry.js +2 -1
- package/dist/cjs/verdocs-field-radio-button.cjs.entry.js.map +1 -1
- package/dist/cjs/verdocs-field-signature_3.cjs.entry.js +2 -1
- package/dist/cjs/verdocs-field-signature_3.cjs.entry.js.map +1 -1
- package/dist/cjs/verdocs-field-textarea.cjs.entry.js +2 -1
- package/dist/cjs/verdocs-field-textarea.cjs.entry.js.map +1 -1
- package/dist/cjs/verdocs-field-textbox.cjs.entry.js +4 -2
- package/dist/cjs/verdocs-field-textbox.cjs.entry.js.map +1 -1
- package/dist/cjs/verdocs-field-timestamp.cjs.entry.js +2 -1
- package/dist/cjs/verdocs-field-timestamp.cjs.entry.js.map +1 -1
- package/dist/cjs/verdocs-preview.cjs.entry.js +5 -3
- package/dist/cjs/verdocs-preview.cjs.entry.js.map +1 -1
- package/dist/cjs/verdocs-send.cjs.entry.js +2 -1
- package/dist/cjs/verdocs-send.cjs.entry.js.map +1 -1
- package/dist/cjs/verdocs-sign.cjs.entry.js +9 -5
- package/dist/cjs/verdocs-sign.cjs.entry.js.map +1 -1
- package/dist/cjs/verdocs-template-create_4.cjs.entry.js +5 -3
- package/dist/cjs/verdocs-template-create_4.cjs.entry.js.map +1 -1
- package/dist/cjs/verdocs-upload-dialog.cjs.entry.js +3 -28
- package/dist/cjs/verdocs-upload-dialog.cjs.entry.js.map +1 -1
- package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.js +7 -4
- package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.js.map +1 -1
- package/dist/collection/utils/templateStore.js +1 -4
- package/dist/collection/utils/templateStore.js.map +1 -1
- package/dist/collection/utils/utils.js +3 -23
- package/dist/collection/utils/utils.js.map +1 -1
- package/dist/components/Files.js +46 -0
- package/dist/components/Files.js.map +1 -0
- package/dist/components/Primitives.js +22 -0
- package/dist/components/Primitives.js.map +1 -0
- package/dist/components/templateStore.js +1 -2
- package/dist/components/templateStore.js.map +1 -1
- package/dist/components/utils.js +5 -27
- package/dist/components/utils.js.map +1 -1
- package/dist/components/verdocs-sign.js +6 -3
- package/dist/components/verdocs-sign.js.map +1 -1
- package/dist/components/verdocs-template-create2.js.map +1 -1
- package/dist/components/verdocs-template-fields2.js +1 -1
- package/dist/components/verdocs-upload-dialog2.js +1 -26
- package/dist/components/verdocs-upload-dialog2.js.map +1 -1
- package/dist/components/verdocs-view2.js +1 -1
- package/dist/custom-elements.json +1123 -0
- package/dist/docs.json +1 -1
- package/dist/esm/{Envelopes-83934981.js → Envelopes-c2545a20.js} +2 -2
- package/dist/esm/{Envelopes-83934981.js.map → Envelopes-c2545a20.js.map} +1 -1
- package/dist/esm/Files-70a192df.js +46 -0
- package/dist/esm/Files-70a192df.js.map +1 -0
- package/dist/esm/Primitives-054bc6e5.js +22 -0
- package/dist/esm/Primitives-054bc6e5.js.map +1 -0
- package/dist/esm/{Templates-41762101.js → Templates-ad0e1ebe.js} +2 -2
- package/dist/esm/{Templates-41762101.js.map → Templates-ad0e1ebe.js.map} +1 -1
- package/dist/esm/{templateStore-103a54ab.js → templateStore-7b50460b.js} +2 -3
- package/dist/esm/templateStore-7b50460b.js.map +1 -0
- package/dist/esm/{utils-36d44309.js → utils-6e8bd73f.js} +6 -28
- package/dist/esm/utils-6e8bd73f.js.map +1 -0
- package/dist/esm/verdocs-build.entry.js +3 -3
- package/dist/esm/verdocs-document-page_2.entry.js +2 -1
- package/dist/esm/verdocs-document-page_2.entry.js.map +1 -1
- package/dist/esm/verdocs-dropdown_2.entry.js +3 -2
- package/dist/esm/verdocs-dropdown_2.entry.js.map +1 -1
- package/dist/esm/verdocs-field-checkbox.entry.js +2 -1
- package/dist/esm/verdocs-field-checkbox.entry.js.map +1 -1
- package/dist/esm/verdocs-field-date.entry.js +2 -1
- package/dist/esm/verdocs-field-date.entry.js.map +1 -1
- package/dist/esm/verdocs-field-dropdown.entry.js +2 -1
- package/dist/esm/verdocs-field-dropdown.entry.js.map +1 -1
- package/dist/esm/verdocs-field-initial.entry.js +2 -1
- package/dist/esm/verdocs-field-initial.entry.js.map +1 -1
- package/dist/esm/verdocs-field-payment.entry.js +2 -1
- package/dist/esm/verdocs-field-payment.entry.js.map +1 -1
- package/dist/esm/verdocs-field-radio-button.entry.js +2 -1
- package/dist/esm/verdocs-field-radio-button.entry.js.map +1 -1
- package/dist/esm/verdocs-field-signature_3.entry.js +2 -1
- package/dist/esm/verdocs-field-signature_3.entry.js.map +1 -1
- package/dist/esm/verdocs-field-textarea.entry.js +2 -1
- package/dist/esm/verdocs-field-textarea.entry.js.map +1 -1
- package/dist/esm/verdocs-field-textbox.entry.js +4 -2
- package/dist/esm/verdocs-field-textbox.entry.js.map +1 -1
- package/dist/esm/verdocs-field-timestamp.entry.js +2 -1
- package/dist/esm/verdocs-field-timestamp.entry.js.map +1 -1
- package/dist/esm/verdocs-preview.entry.js +5 -3
- package/dist/esm/verdocs-preview.entry.js.map +1 -1
- package/dist/esm/verdocs-send.entry.js +2 -1
- package/dist/esm/verdocs-send.entry.js.map +1 -1
- package/dist/esm/verdocs-sign.entry.js +8 -4
- package/dist/esm/verdocs-sign.entry.js.map +1 -1
- package/dist/esm/verdocs-template-create_4.entry.js +5 -3
- package/dist/esm/verdocs-template-create_4.entry.js.map +1 -1
- package/dist/esm/verdocs-upload-dialog.entry.js +1 -26
- package/dist/esm/verdocs-upload-dialog.entry.js.map +1 -1
- package/dist/esm-es5/{Envelopes-83934981.js → Envelopes-c2545a20.js} +2 -2
- package/dist/esm-es5/{Envelopes-83934981.js.map → Envelopes-c2545a20.js.map} +0 -0
- package/dist/esm-es5/Files-70a192df.js +2 -0
- package/dist/esm-es5/Files-70a192df.js.map +1 -0
- package/dist/esm-es5/Primitives-054bc6e5.js +2 -0
- package/dist/esm-es5/Primitives-054bc6e5.js.map +1 -0
- package/dist/esm-es5/{Templates-41762101.js → Templates-ad0e1ebe.js} +2 -2
- package/dist/esm-es5/{Templates-41762101.js.map → Templates-ad0e1ebe.js.map} +0 -0
- package/dist/esm-es5/templateStore-7b50460b.js +2 -0
- package/dist/esm-es5/templateStore-7b50460b.js.map +1 -0
- package/dist/esm-es5/utils-6e8bd73f.js +2 -0
- package/dist/esm-es5/utils-6e8bd73f.js.map +1 -0
- package/dist/esm-es5/verdocs-build.entry.js +1 -1
- package/dist/esm-es5/verdocs-build.entry.js.map +1 -1
- package/dist/esm-es5/verdocs-document-page_2.entry.js +1 -1
- package/dist/esm-es5/verdocs-document-page_2.entry.js.map +1 -1
- package/dist/esm-es5/verdocs-dropdown_2.entry.js +1 -1
- package/dist/esm-es5/verdocs-dropdown_2.entry.js.map +1 -1
- package/dist/esm-es5/verdocs-field-checkbox.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-checkbox.entry.js.map +1 -1
- package/dist/esm-es5/verdocs-field-date.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-date.entry.js.map +1 -1
- package/dist/esm-es5/verdocs-field-dropdown.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-dropdown.entry.js.map +1 -1
- package/dist/esm-es5/verdocs-field-initial.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-initial.entry.js.map +1 -1
- package/dist/esm-es5/verdocs-field-payment.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-payment.entry.js.map +1 -1
- package/dist/esm-es5/verdocs-field-radio-button.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-radio-button.entry.js.map +1 -1
- package/dist/esm-es5/verdocs-field-signature_3.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-signature_3.entry.js.map +1 -1
- package/dist/esm-es5/verdocs-field-textarea.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-textarea.entry.js.map +1 -1
- package/dist/esm-es5/verdocs-field-textbox.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-textbox.entry.js.map +1 -1
- package/dist/esm-es5/verdocs-field-timestamp.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-timestamp.entry.js.map +1 -1
- package/dist/esm-es5/verdocs-preview.entry.js +1 -1
- package/dist/esm-es5/verdocs-preview.entry.js.map +1 -1
- package/dist/esm-es5/verdocs-send.entry.js +1 -1
- package/dist/esm-es5/verdocs-send.entry.js.map +1 -1
- package/dist/esm-es5/verdocs-sign.entry.js +1 -1
- package/dist/esm-es5/verdocs-sign.entry.js.map +1 -1
- package/dist/esm-es5/verdocs-template-create_4.entry.js +1 -1
- package/dist/esm-es5/verdocs-template-create_4.entry.js.map +1 -1
- package/dist/esm-es5/verdocs-upload-dialog.entry.js +1 -1
- package/dist/esm-es5/verdocs-upload-dialog.entry.js.map +1 -1
- package/dist/types/utils/utils.d.ts +0 -2
- package/dist/verdocs-web-sdk/p-008f67ce.entry.js +2 -0
- package/dist/verdocs-web-sdk/p-008f67ce.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/p-016521f8.system.entry.js +2 -0
- package/dist/verdocs-web-sdk/{p-6896b64c.system.entry.js.map → p-016521f8.system.entry.js.map} +1 -1
- package/dist/verdocs-web-sdk/p-08800f26.entry.js +2 -0
- package/dist/verdocs-web-sdk/{p-8c2cdcc4.entry.js.map → p-08800f26.entry.js.map} +1 -1
- package/dist/verdocs-web-sdk/{p-458b639d.js → p-11ab1bd0.js} +2 -2
- package/dist/verdocs-web-sdk/{p-458b639d.js.map → p-11ab1bd0.js.map} +0 -0
- package/dist/verdocs-web-sdk/{p-6d858f25.entry.js → p-12fd1696.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-6d858f25.entry.js.map → p-12fd1696.entry.js.map} +0 -0
- package/dist/verdocs-web-sdk/p-14513fd8.system.entry.js +2 -0
- package/dist/verdocs-web-sdk/{p-bd6175d9.system.entry.js.map → p-14513fd8.system.entry.js.map} +1 -1
- package/dist/verdocs-web-sdk/{p-7d1a5bc5.system.entry.js → p-14c69e28.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-7d1a5bc5.system.entry.js.map → p-14c69e28.system.entry.js.map} +0 -0
- package/dist/verdocs-web-sdk/p-194a9ea7.entry.js +2 -0
- package/dist/verdocs-web-sdk/{p-455c2dd9.entry.js.map → p-194a9ea7.entry.js.map} +1 -1
- package/dist/verdocs-web-sdk/p-210606ed.entry.js +2 -0
- package/dist/verdocs-web-sdk/{p-cc30f8c8.entry.js.map → p-210606ed.entry.js.map} +1 -1
- package/dist/verdocs-web-sdk/{p-57fad02b.system.js → p-252d594a.system.js} +2 -2
- package/dist/verdocs-web-sdk/{p-57fad02b.system.js.map → p-252d594a.system.js.map} +0 -0
- package/dist/verdocs-web-sdk/p-327858f0.system.js +2 -0
- package/dist/verdocs-web-sdk/p-327858f0.system.js.map +1 -0
- package/dist/verdocs-web-sdk/p-3cafb2e3.entry.js +2 -0
- package/dist/verdocs-web-sdk/{p-29044b5b.entry.js.map → p-3cafb2e3.entry.js.map} +1 -1
- package/dist/verdocs-web-sdk/p-3e33cd27.system.entry.js +2 -0
- package/dist/verdocs-web-sdk/{p-d9413770.system.entry.js.map → p-3e33cd27.system.entry.js.map} +1 -1
- package/dist/verdocs-web-sdk/p-417ee5e0.js +2 -0
- package/dist/verdocs-web-sdk/p-417ee5e0.js.map +1 -0
- package/dist/verdocs-web-sdk/p-46e776de.system.entry.js +2 -0
- package/dist/verdocs-web-sdk/{p-26e0caa5.system.entry.js.map → p-46e776de.system.entry.js.map} +1 -1
- package/dist/verdocs-web-sdk/p-553176fa.system.entry.js +2 -0
- package/dist/verdocs-web-sdk/{p-2d1b5389.system.entry.js.map → p-553176fa.system.entry.js.map} +1 -1
- package/dist/verdocs-web-sdk/p-5c895ce6.system.entry.js +2 -0
- package/dist/verdocs-web-sdk/{p-b5cf7ddc.system.entry.js.map → p-5c895ce6.system.entry.js.map} +1 -1
- package/dist/verdocs-web-sdk/p-6f177552.system.entry.js +2 -0
- package/dist/verdocs-web-sdk/{p-206bbfe3.system.entry.js.map → p-6f177552.system.entry.js.map} +1 -1
- package/dist/verdocs-web-sdk/p-7291906c.js +2 -0
- package/dist/verdocs-web-sdk/p-7291906c.js.map +1 -0
- package/dist/verdocs-web-sdk/p-763b1dd8.entry.js +2 -0
- package/dist/verdocs-web-sdk/{p-9f381d10.entry.js.map → p-763b1dd8.entry.js.map} +1 -1
- package/dist/verdocs-web-sdk/p-78989f41.entry.js +2 -0
- package/dist/verdocs-web-sdk/{p-c8fb8a55.entry.js.map → p-78989f41.entry.js.map} +1 -1
- package/dist/verdocs-web-sdk/p-831ee1b6.system.js +2 -0
- package/dist/verdocs-web-sdk/p-831ee1b6.system.js.map +1 -0
- package/dist/verdocs-web-sdk/p-851f5c2b.system.entry.js +2 -0
- package/dist/verdocs-web-sdk/p-851f5c2b.system.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/p-87776dc1.system.entry.js +2 -0
- package/dist/verdocs-web-sdk/{p-c35a211a.system.entry.js.map → p-87776dc1.system.entry.js.map} +1 -1
- package/dist/verdocs-web-sdk/p-893d6bfb.entry.js +2 -0
- package/dist/verdocs-web-sdk/{p-2e8a3d90.entry.js.map → p-893d6bfb.entry.js.map} +1 -1
- package/dist/verdocs-web-sdk/{p-6baf87ba.js → p-8c0aa0e9.js} +2 -2
- package/dist/verdocs-web-sdk/{p-6baf87ba.js.map → p-8c0aa0e9.js.map} +0 -0
- package/dist/verdocs-web-sdk/p-977ccc81.entry.js +2 -0
- package/dist/verdocs-web-sdk/p-977ccc81.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/p-9c208c1d.entry.js +2 -0
- package/dist/verdocs-web-sdk/{p-a45632ec.entry.js.map → p-9c208c1d.entry.js.map} +1 -1
- package/dist/verdocs-web-sdk/p-9f1225bf.entry.js +2 -0
- package/dist/verdocs-web-sdk/{p-49227301.entry.js.map → p-9f1225bf.entry.js.map} +1 -1
- package/dist/verdocs-web-sdk/p-a3820c7f.entry.js +2 -0
- package/dist/verdocs-web-sdk/{p-19a634b9.entry.js.map → p-a3820c7f.entry.js.map} +1 -1
- package/dist/verdocs-web-sdk/{p-30fcf18d.system.js → p-a74a9c6b.system.js} +2 -2
- package/dist/verdocs-web-sdk/p-a74a9c6b.system.js.map +1 -0
- package/dist/verdocs-web-sdk/p-a8b91e3f.entry.js +2 -0
- package/dist/verdocs-web-sdk/{p-78c6b2b1.entry.js.map → p-a8b91e3f.entry.js.map} +1 -1
- package/dist/verdocs-web-sdk/p-a8cc5e31.entry.js +2 -0
- package/dist/verdocs-web-sdk/{p-102bc4bc.entry.js.map → p-a8cc5e31.entry.js.map} +1 -1
- package/dist/verdocs-web-sdk/p-aa124212.js +2 -0
- package/dist/verdocs-web-sdk/p-aa124212.js.map +1 -0
- package/dist/verdocs-web-sdk/p-b122f5c7.system.entry.js +2 -0
- package/dist/verdocs-web-sdk/{p-d1c6b0f4.system.entry.js.map → p-b122f5c7.system.entry.js.map} +1 -1
- package/dist/verdocs-web-sdk/p-b94cdaea.system.entry.js +2 -0
- package/dist/verdocs-web-sdk/{p-0398fe67.system.entry.js.map → p-b94cdaea.system.entry.js.map} +1 -1
- package/dist/verdocs-web-sdk/p-b988a40a.entry.js +2 -0
- package/dist/verdocs-web-sdk/{p-de207098.entry.js.map → p-b988a40a.entry.js.map} +1 -1
- package/dist/verdocs-web-sdk/p-b9a1a471.system.entry.js +2 -0
- package/dist/verdocs-web-sdk/{p-729db0b6.system.entry.js.map → p-b9a1a471.system.entry.js.map} +1 -1
- package/dist/verdocs-web-sdk/p-bd503b85.entry.js +2 -0
- package/dist/verdocs-web-sdk/{p-515f3ab2.entry.js.map → p-bd503b85.entry.js.map} +1 -1
- package/dist/verdocs-web-sdk/p-c0cc2b8e.system.entry.js +2 -0
- package/dist/verdocs-web-sdk/{p-5e693763.system.entry.js.map → p-c0cc2b8e.system.entry.js.map} +1 -1
- package/dist/verdocs-web-sdk/p-c0f5116c.system.entry.js +2 -0
- package/dist/verdocs-web-sdk/{p-99495fbb.system.entry.js.map → p-c0f5116c.system.entry.js.map} +1 -1
- package/dist/verdocs-web-sdk/p-c16b6ca4.system.js +1 -1
- package/dist/verdocs-web-sdk/{p-6d8b9e75.system.js → p-c8e8732b.system.js} +2 -2
- package/dist/verdocs-web-sdk/{p-6d8b9e75.system.js.map → p-c8e8732b.system.js.map} +0 -0
- package/dist/verdocs-web-sdk/p-d50523fd.system.js +2 -0
- package/dist/verdocs-web-sdk/p-d50523fd.system.js.map +1 -0
- package/dist/verdocs-web-sdk/p-d85e61ee.system.entry.js +2 -0
- package/dist/verdocs-web-sdk/p-d85e61ee.system.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/p-d954919a.entry.js +2 -0
- package/dist/verdocs-web-sdk/{p-c3d5596a.entry.js.map → p-d954919a.entry.js.map} +1 -1
- package/dist/verdocs-web-sdk/{p-3ce35714.js → p-e53f969c.js} +2 -2
- package/dist/verdocs-web-sdk/p-e53f969c.js.map +1 -0
- package/dist/verdocs-web-sdk/p-f36c6695.system.entry.js +2 -0
- package/dist/verdocs-web-sdk/{p-1b3be2ae.system.entry.js.map → p-f36c6695.system.entry.js.map} +1 -1
- package/dist/verdocs-web-sdk/p-f4a3bc08.system.entry.js +2 -0
- package/dist/verdocs-web-sdk/{p-cf6cfa4f.system.entry.js.map → p-f4a3bc08.system.entry.js.map} +1 -1
- package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
- package/package.json +2 -2
- package/dist/cjs/templateStore-8c8dc4c1.js.map +0 -1
- package/dist/cjs/utils-91d249b4.js.map +0 -1
- package/dist/esm/templateStore-103a54ab.js.map +0 -1
- package/dist/esm/utils-36d44309.js.map +0 -1
- package/dist/esm-es5/templateStore-103a54ab.js +0 -2
- package/dist/esm-es5/templateStore-103a54ab.js.map +0 -1
- package/dist/esm-es5/utils-36d44309.js +0 -2
- package/dist/esm-es5/utils-36d44309.js.map +0 -1
- package/dist/verdocs-web-sdk/p-0225575c.system.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-0225575c.system.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-0398fe67.system.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-102bc4bc.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-19a634b9.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-1b3be2ae.system.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-206bbfe3.system.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-26e0caa5.system.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-29044b5b.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-2d1b5389.system.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-2e8a3d90.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-30fcf18d.system.js.map +0 -1
- package/dist/verdocs-web-sdk/p-3ce35714.js.map +0 -1
- package/dist/verdocs-web-sdk/p-455c2dd9.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-49227301.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-515f3ab2.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-58c4b767.system.js +0 -2
- package/dist/verdocs-web-sdk/p-58c4b767.system.js.map +0 -1
- package/dist/verdocs-web-sdk/p-5e693763.system.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-6896b64c.system.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-71f1e3c9.system.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-71f1e3c9.system.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-729db0b6.system.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-78c6b2b1.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-8c2cdcc4.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-99495fbb.system.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-9f381d10.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-a45632ec.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-b5cf7ddc.system.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-b76c949d.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-b76c949d.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-bd6175d9.system.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-c35a211a.system.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-c3d5596a.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-c8fb8a55.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-cc30f8c8.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-cf6cfa4f.system.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-d1c6b0f4.system.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-d5f48c21.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-d5f48c21.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-d9413770.system.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-de207098.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-ff3b285c.js +0 -2
- package/dist/verdocs-web-sdk/p-ff3b285c.js.map +0 -1
|
@@ -1,30 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host } from './index-f78d163d.js';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Given a File, extract the file's content as a base64 encoded data URL. The response will have a prefix that
|
|
5
|
-
* includes the MIME type of the file, e.g. "data:image/jpeg;base64,iVBORw0K......"
|
|
6
|
-
*/
|
|
7
|
-
var fileToDataUrl = function (file) {
|
|
8
|
-
return new Promise(function (resolve, reject) {
|
|
9
|
-
var reader = new FileReader();
|
|
10
|
-
reader.onload = function () {
|
|
11
|
-
return resolve({
|
|
12
|
-
lastModified: file.lastModified,
|
|
13
|
-
size: file.size,
|
|
14
|
-
type: file.type,
|
|
15
|
-
name: file.name,
|
|
16
|
-
data: reader.result,
|
|
17
|
-
});
|
|
18
|
-
};
|
|
19
|
-
reader.onerror = reject;
|
|
20
|
-
if (file) {
|
|
21
|
-
reader.readAsDataURL(file);
|
|
22
|
-
}
|
|
23
|
-
else {
|
|
24
|
-
reject(new Error('Invalid file'));
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
|
-
};
|
|
2
|
+
import { f as fileToDataUrl } from './Files-70a192df.js';
|
|
28
3
|
|
|
29
4
|
const verdocsUploadDialogCss = "verdocs-upload-dialog{font-family:\"Barlow\", sans-serif;-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-upload-dialog div{-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-upload-dialog .background-overlay{position:absolute;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:#0000007f}verdocs-upload-dialog .dialog{width:300px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;border-radius:4px;overflow:hidden;background:#ffffff;padding:16px;-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-upload-dialog .heading{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;font-size:20px;font-weight:500}verdocs-upload-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-upload-dialog .buttons verdocs-button{margin-left:16px}verdocs-upload-dialog .drop-target{padding:30px 15px;width:100%;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;background-color:#f5f5f5;border:2px dashed #979797;min-height:260px;text-align:center;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;color:rgba(0, 0, 0, 0.54);opacity:1;margin:20px 0}verdocs-upload-dialog .drop-target p{margin:12px 0}verdocs-upload-dialog .drop-target.dragging-over{border:5px solid #4c56cb}verdocs-upload-dialog .drop-target>verdocs-button{margin:12px 0;display:inline-block}verdocs-upload-dialog .attachments{height:56px;font-size:0;margin:20px 0;padding:0 16px;line-height:56px;white-space:normal;-webkit-box-shadow:0 1px 3px 0 rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.12), 0 0 2px 0 rgba(0, 0, 0, 0.14);box-shadow:0 1px 3px 0 rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.12), 0 0 2px 0 rgba(0, 0, 0, 0.14)}verdocs-upload-dialog .attachments .attachment{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-upload-dialog .attachments .attachment .icon{width:18px;height:18px;line-height:18px}verdocs-upload-dialog .attachments .attachment .icon.trash{cursor:pointer}verdocs-upload-dialog .attachments .attachment .name{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex;padding:0 8px;font-size:14px;font-weight:400}";
|
|
30
5
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"verdocs-upload-dialog.entry.js","mappings":";;AAAA;AACA;AACA;AACA;AACO,IAAI,aAAa,GAAG,UAAU,IAAI,EAAE;AAC3C,IAAI,OAAO,IAAI,OAAO,CAAC,UAAU,OAAO,EAAE,MAAM,EAAE;AAClD,QAAQ,IAAI,MAAM,GAAG,IAAI,UAAU,EAAE,CAAC;AACtC,QAAQ,MAAM,CAAC,MAAM,GAAG,YAAY;AACpC,YAAY,OAAO,OAAO,CAAC;AAC3B,gBAAgB,YAAY,EAAE,IAAI,CAAC,YAAY;AAC/C,gBAAgB,IAAI,EAAE,IAAI,CAAC,IAAI;AAC/B,gBAAgB,IAAI,EAAE,IAAI,CAAC,IAAI;AAC/B,gBAAgB,IAAI,EAAE,IAAI,CAAC,IAAI;AAC/B,gBAAgB,IAAI,EAAE,MAAM,CAAC,MAAM;AACnC,aAAa,CAAC,CAAC;AACf,SAAS,CAAC;AACV,QAAQ,MAAM,CAAC,OAAO,GAAG,MAAM,CAAC;AAChC,QAAQ,IAAI,IAAI,EAAE;AAClB,YAAY,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;AACvC,SAAS;AACT,aAAa;AACb,YAAY,MAAM,CAAC,IAAI,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC;AAC9C,SAAS;AACT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Y,CAAC,MAAM,GAAG,CAAC,GAAI,CACrG,CACF,CACF,CACD,EACP;GACH;;;;;;","names":[],"sources":["./node_modules/@verdocs/js-sdk/Utils/Files.js","./src/components/dialogs/verdocs-upload-dialog/verdocs-upload-dialog.scss?tag=verdocs-upload-dialog","./src/components/dialogs/verdocs-upload-dialog/verdocs-upload-dialog.tsx"],"sourcesContent":["/**\n * Given a File, extract the file's content as a base64 encoded data URL. The response will have a prefix that\n * includes the MIME type of the file, e.g. \"data:image/jpeg;base64,iVBORw0K......\"\n */\nexport var fileToDataUrl = function (file) {\n return new Promise(function (resolve, reject) {\n var reader = new FileReader();\n reader.onload = function () {\n return resolve({\n lastModified: file.lastModified,\n size: file.size,\n type: file.type,\n name: file.name,\n data: reader.result,\n });\n };\n reader.onerror = reject;\n if (file) {\n reader.readAsDataURL(file);\n }\n else {\n reject(new Error('Invalid file'));\n }\n });\n};\n","@import '../../../theme.scss';\n\nverdocs-upload-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: absolute;\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: 300px;\n display: flex;\n flex-direction: column;\n border-radius: 4px;\n overflow: hidden;\n background: $verdocs-grey-4;\n padding: 16px;\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 .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 .drop-target {\n padding: 30px 15px;\n width: 100%;\n display: flex;\n flex-direction: column;\n background-color: #f5f5f5;\n border: 2px dashed #979797;\n min-height: 260px;\n text-align: center;\n justify-content: center;\n align-items: center;\n color: rgba(0, 0, 0, 0.54);\n opacity: 1;\n margin: 20px 0;\n\n p {\n margin: 12px 0;\n }\n\n &.dragging-over {\n border: 5px solid $verdocs-deep-blue;\n }\n\n > verdocs-button {\n margin: 12px 0;\n display: inline-block;\n }\n }\n\n .attachments {\n height: 56px;\n font-size: 0;\n margin: 20px 0;\n padding: 0 16px;\n line-height: 56px;\n white-space: normal;\n box-shadow: 0 1px 3px 0 rgb(0 0 0 / 20%), 0 2px 2px 0 rgb(0 0 0 / 12%), 0 0 2px 0 rgb(0 0 0 / 14%);\n\n .attachment {\n display: flex;\n align-items: center;\n flex-direction: row;\n\n .icon {\n width: 18px;\n height: 18px;\n line-height: 18px;\n\n &.trash {\n cursor: pointer;\n }\n }\n\n .name {\n flex: 1;\n display: flex;\n padding: 0 8px;\n font-size: 14px;\n font-weight: 400;\n }\n }\n }\n}\n","import {Component, h, Event, EventEmitter, Host, State} from '@stencil/core';\nimport {fileToDataUrl, FileWithData} from '@verdocs/js-sdk/Utils/Files';\n\nconst TrashIcon = `<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\"><path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16\" /></svg>`;\n\nconst PaperclipIcon = `<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\"><path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M15.172 7l-6.586 6.586a2 2 0 102.828 2.828l6.414-6.586a4 4 0 00-5.656-5.656l-6.415 6.585a6 6 0 108.486 8.486L20.5 13\" /></svg>`;\n\n/**\n * Display a file upload tool. Note that the file is not actually transmitted, so it may be used by\n * callers with a variety of workflows. Instead, data about the chosen file will be passed to the\n * caller via the onNext event handler.\n */\n@Component({\n tag: 'verdocs-upload-dialog',\n styleUrl: 'verdocs-upload-dialog.scss',\n})\nexport class VerdocsUploadDialog {\n private fileInput?: HTMLInputElement;\n\n /**\n * Event fired when the dialog is cancelled.\n */\n @Event({composed: true}) cancel: EventEmitter;\n\n /**\n * Event fired when the dialog is closed. The event data will contain the file selected.\n */\n @Event({composed: true}) next: EventEmitter<FileWithData[]>;\n\n @State() draggingOver = false;\n\n @State() decodedFiles = [] as FileWithData[];\n\n handleCancel() {\n this.cancel.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.className === 'background-overlay') {\n e.preventDefault();\n this.handleCancel();\n }\n }\n\n handleDone() {\n this.next.emit(this.decodedFiles);\n }\n\n handleDragOver(e) {\n e.preventDefault();\n this.draggingOver = true;\n }\n\n handleDragLeave(e) {\n e.preventDefault();\n this.draggingOver = false;\n }\n\n async handleDrop(e) {\n e.preventDefault();\n this.draggingOver = false;\n\n // Required for cross-browser support. Note that dataTransfer.items is of type DataTransferItemList and is not an array.\n let droppedFiles = [] as File[];\n if (e.dataTransfer.items) {\n for (let i = 0; i < e.dataTransfer.items.length; i++) {\n if (e.dataTransfer.items[i].kind === 'file') {\n const file = e.dataTransfer.items[i].getAsFile();\n droppedFiles.push(file);\n }\n }\n } else {\n droppedFiles = e.dataTransfer.files;\n }\n\n this.decodedFiles = await Promise.all(droppedFiles.map(fileToDataUrl));\n }\n\n handleRemoveAttachment(index: number) {\n const newFiles = [...this.decodedFiles];\n newFiles.splice(index, 1);\n this.decodedFiles = newFiles;\n }\n\n handleSelectFile() {\n this.fileInput?.click();\n }\n\n async handleFileChange() {\n let droppedFiles = [] as File[];\n for (let i = 0; i < this.fileInput?.files.length; i++) {\n droppedFiles.push(this.fileInput?.files[i]);\n }\n this.decodedFiles = await Promise.all(droppedFiles.map(fileToDataUrl));\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\">Upload attachment</div>\n\n {this.decodedFiles.length < 1 ? (\n <div\n class={{'drop-target': true, 'dragging-over': this.draggingOver}}\n onDragOver={e => this.handleDragOver(e)}\n onDragLeave={e => this.handleDragLeave(e)}\n onDrop={e => this.handleDrop(e)}\n >\n <p>Drag and drop a file here...</p>\n <p>- or -</p>\n\n <verdocs-button label=\"Select a file...\" onClick={() => this.handleSelectFile()} />\n <input type=\"file\" ref={el => (this.fileInput = el as HTMLInputElement)} style={{display: 'none'}} onChange={() => this.handleFileChange()} />\n </div>\n ) : (\n <div class=\"attachments\">\n {this.decodedFiles.map((file, index) => (\n <div class=\"attachment\">\n <div class=\"icon\" innerHTML={PaperclipIcon} />\n <div class=\"name\">{file.name}</div>\n <div class=\"icon trash\" innerHTML={TrashIcon} onClick={() => this.handleRemoveAttachment(index)} />\n </div>\n ))}\n </div>\n )}\n\n <div class=\"buttons\">\n <verdocs-button label=\"Cancel\" variant=\"outline\" onClick={() => this.handleCancel()} />\n <verdocs-button label=\"Done\" onClick={() => this.handleDone()} disabled={this.decodedFiles.length < 1} />\n </div>\n </div>\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
|
|
1
|
+
{"file":"verdocs-upload-dialog.entry.js","mappings":";;;AAAA,MAAM,sBAAsB,GAAG,o9EAAo9E;;ACGn/E,MAAM,SAAS,GAAG,+SAA+S,CAAC;AAElU,MAAM,aAAa,GAAG,uSAAuS,CAAC;MAWjT,mBAAmB;;;;;wBAaN,KAAK;wBAEL,EAAoB;;EAE5C,YAAY;IACV,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;GACpB;;EAGD,aAAa,CAAC,CAAM;IAClB,IAAI,CAAC,CAAC,MAAM,CAAC,SAAS,KAAK,oBAAoB,EAAE;MAC/C,CAAC,CAAC,cAAc,EAAE,CAAC;MACnB,IAAI,CAAC,YAAY,EAAE,CAAC;KACrB;GACF;EAED,UAAU;IACR,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,C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AE,MAAM,EAAC,EAAE,QAAQ,EAAE,MAAM,IAAI,CAAC,gBAAgB,EAAE,GAAI,CAC1I,KAEN,WAAK,KAAK,EAAC,aAAa,IACrB,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,MACjC,WAAK,KAAK,EAAC,YAAY,IACrB,WAAK,KAAK,EAAC,MAAM,EAAC,SAAS,EAAE,aAAa,GAAI,EAC9C,WAAK,KAAK,EAAC,MAAM,IAAE,IAAI,CAAC,IAAI,CAAO,EACnC,WAAK,KAAK,EAAC,YAAY,EAAC,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC,sBAAsB,CAAC,KAAK,CAAC,GAAI,CAC/F,CACP,CAAC,CACE,CACP,EAED,WAAK,KAAK,EAAC,SAAS,IAClB,sBAAgB,KAAK,EAAC,QAAQ,EAAC,OAAO,EAAC,SAAS,EAAC,OAAO,EAAE,MAAM,IAAI,CAAC,YAAY,EAAE,GAAI,EACvF,sBAAgB,KAAK,EAAC,MAAM,EAAC,OAAO,EAAE,MAAM,IAAI,CAAC,UAAU,EAAE,EAAE,QAAQ,EAAE,IAAI,CAAC,YAAY,CAAC,MAAM,GAAG,CAAC,GAAI,CACrG,CACF,CACF,CACD,EACP;GACH;;;;;;","names":[],"sources":["./src/components/dialogs/verdocs-upload-dialog/verdocs-upload-dialog.scss?tag=verdocs-upload-dialog","./src/components/dialogs/verdocs-upload-dialog/verdocs-upload-dialog.tsx"],"sourcesContent":["@import '../../../theme.scss';\n\nverdocs-upload-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: absolute;\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: 300px;\n display: flex;\n flex-direction: column;\n border-radius: 4px;\n overflow: hidden;\n background: $verdocs-grey-4;\n padding: 16px;\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 .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 .drop-target {\n padding: 30px 15px;\n width: 100%;\n display: flex;\n flex-direction: column;\n background-color: #f5f5f5;\n border: 2px dashed #979797;\n min-height: 260px;\n text-align: center;\n justify-content: center;\n align-items: center;\n color: rgba(0, 0, 0, 0.54);\n opacity: 1;\n margin: 20px 0;\n\n p {\n margin: 12px 0;\n }\n\n &.dragging-over {\n border: 5px solid $verdocs-deep-blue;\n }\n\n > verdocs-button {\n margin: 12px 0;\n display: inline-block;\n }\n }\n\n .attachments {\n height: 56px;\n font-size: 0;\n margin: 20px 0;\n padding: 0 16px;\n line-height: 56px;\n white-space: normal;\n box-shadow: 0 1px 3px 0 rgb(0 0 0 / 20%), 0 2px 2px 0 rgb(0 0 0 / 12%), 0 0 2px 0 rgb(0 0 0 / 14%);\n\n .attachment {\n display: flex;\n align-items: center;\n flex-direction: row;\n\n .icon {\n width: 18px;\n height: 18px;\n line-height: 18px;\n\n &.trash {\n cursor: pointer;\n }\n }\n\n .name {\n flex: 1;\n display: flex;\n padding: 0 8px;\n font-size: 14px;\n font-weight: 400;\n }\n }\n }\n}\n","import {Component, h, Event, EventEmitter, Host, State} from '@stencil/core';\nimport {fileToDataUrl, FileWithData} from '@verdocs/js-sdk/Utils/Files';\n\nconst TrashIcon = `<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\"><path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16\" /></svg>`;\n\nconst PaperclipIcon = `<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\"><path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M15.172 7l-6.586 6.586a2 2 0 102.828 2.828l6.414-6.586a4 4 0 00-5.656-5.656l-6.415 6.585a6 6 0 108.486 8.486L20.5 13\" /></svg>`;\n\n/**\n * Display a file upload tool. Note that the file is not actually transmitted, so it may be used by\n * callers with a variety of workflows. Instead, data about the chosen file will be passed to the\n * caller via the onNext event handler.\n */\n@Component({\n tag: 'verdocs-upload-dialog',\n styleUrl: 'verdocs-upload-dialog.scss',\n})\nexport class VerdocsUploadDialog {\n private fileInput?: HTMLInputElement;\n\n /**\n * Event fired when the dialog is cancelled.\n */\n @Event({composed: true}) cancel: EventEmitter;\n\n /**\n * Event fired when the dialog is closed. The event data will contain the file selected.\n */\n @Event({composed: true}) next: EventEmitter<FileWithData[]>;\n\n @State() draggingOver = false;\n\n @State() decodedFiles = [] as FileWithData[];\n\n handleCancel() {\n this.cancel.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.className === 'background-overlay') {\n e.preventDefault();\n this.handleCancel();\n }\n }\n\n handleDone() {\n this.next.emit(this.decodedFiles);\n }\n\n handleDragOver(e) {\n e.preventDefault();\n this.draggingOver = true;\n }\n\n handleDragLeave(e) {\n e.preventDefault();\n this.draggingOver = false;\n }\n\n async handleDrop(e) {\n e.preventDefault();\n this.draggingOver = false;\n\n // Required for cross-browser support. Note that dataTransfer.items is of type DataTransferItemList and is not an array.\n let droppedFiles = [] as File[];\n if (e.dataTransfer.items) {\n for (let i = 0; i < e.dataTransfer.items.length; i++) {\n if (e.dataTransfer.items[i].kind === 'file') {\n const file = e.dataTransfer.items[i].getAsFile();\n droppedFiles.push(file);\n }\n }\n } else {\n droppedFiles = e.dataTransfer.files;\n }\n\n this.decodedFiles = await Promise.all(droppedFiles.map(fileToDataUrl));\n }\n\n handleRemoveAttachment(index: number) {\n const newFiles = [...this.decodedFiles];\n newFiles.splice(index, 1);\n this.decodedFiles = newFiles;\n }\n\n handleSelectFile() {\n this.fileInput?.click();\n }\n\n async handleFileChange() {\n let droppedFiles = [] as File[];\n for (let i = 0; i < this.fileInput?.files.length; i++) {\n droppedFiles.push(this.fileInput?.files[i]);\n }\n this.decodedFiles = await Promise.all(droppedFiles.map(fileToDataUrl));\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\">Upload attachment</div>\n\n {this.decodedFiles.length < 1 ? (\n <div\n class={{'drop-target': true, 'dragging-over': this.draggingOver}}\n onDragOver={e => this.handleDragOver(e)}\n onDragLeave={e => this.handleDragLeave(e)}\n onDrop={e => this.handleDrop(e)}\n >\n <p>Drag and drop a file here...</p>\n <p>- or -</p>\n\n <verdocs-button label=\"Select a file...\" onClick={() => this.handleSelectFile()} />\n <input type=\"file\" ref={el => (this.fileInput = el as HTMLInputElement)} style={{display: 'none'}} onChange={() => this.handleFileChange()} />\n </div>\n ) : (\n <div class=\"attachments\">\n {this.decodedFiles.map((file, index) => (\n <div class=\"attachment\">\n <div class=\"icon\" innerHTML={PaperclipIcon} />\n <div class=\"name\">{file.name}</div>\n <div class=\"icon trash\" innerHTML={TrashIcon} onClick={() => this.handleRemoveAttachment(index)} />\n </div>\n ))}\n </div>\n )}\n\n <div class=\"buttons\">\n <verdocs-button label=\"Cancel\" variant=\"outline\" onClick={() => this.handleCancel()} />\n <verdocs-button label=\"Done\" onClick={() => this.handleDone()} disabled={this.decodedFiles.length < 1} />\n </div>\n </div>\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(e,t,n,o){function r(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,a){function l(e){try{i(o.next(e))}catch(e){a(e)}}function s(e){try{i(o["throw"](e))}catch(e){a(e)}}function i(e){e.done?n(e.value):r(e.value).then(l,s)}i((o=o.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},o,r,a,l;return l={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(l[Symbol.iterator]=function(){return this}),l;function s(e){return function(t){return i([e,t])}}function i(l){if(o)throw new TypeError("Generator is already executing.");while(n)try{if(o=1,r&&(a=l[0]&2?r["return"]:l[0]?r["throw"]||((a=r["return"])&&a.call(r),0):r.next)&&!(a=a.call(r,l[1])).done)return a;if(r=0,a)l=[l[0]&2,a.value];switch(l[0]){case 0:case 1:a=l;break;case 4:n.label++;return{value:l[1],done:false};case 5:n.label++;r=l[1];l=[0];continue;case 7:l=n.ops.pop();n.trys.pop();continue;default:if(!(a=n.trys,a=a.length>0&&a[a.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!a||l[1]>a[0]&&l[1]<a[3])){n.label=l[1];break}if(l[0]===6&&n.label<a[1]){n.label=a[1];a=l;break}if(a&&n.label<a[2]){n.label=a[2];n.ops.push(l);break}if(a[2])n.ops.pop();n.trys.pop();continue}l=t.call(e,n)}catch(e){l=[6,e];r=0}finally{o=a=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:true}}};import{
|
|
2
|
-
//# sourceMappingURL=Envelopes-
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(e,t,n,o){function r(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,a){function l(e){try{i(o.next(e))}catch(e){a(e)}}function s(e){try{i(o["throw"](e))}catch(e){a(e)}}function i(e){e.done?n(e.value):r(e.value).then(l,s)}i((o=o.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},o,r,a,l;return l={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(l[Symbol.iterator]=function(){return this}),l;function s(e){return function(t){return i([e,t])}}function i(l){if(o)throw new TypeError("Generator is already executing.");while(n)try{if(o=1,r&&(a=l[0]&2?r["return"]:l[0]?r["throw"]||((a=r["return"])&&a.call(r),0):r.next)&&!(a=a.call(r,l[1])).done)return a;if(r=0,a)l=[l[0]&2,a.value];switch(l[0]){case 0:case 1:a=l;break;case 4:n.label++;return{value:l[1],done:false};case 5:n.label++;r=l[1];l=[0];continue;case 7:l=n.ops.pop();n.trys.pop();continue;default:if(!(a=n.trys,a=a.length>0&&a[a.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!a||l[1]>a[0]&&l[1]<a[3])){n.label=l[1];break}if(l[0]===6&&n.label<a[1]){n.label=a[1];a=l;break}if(a&&n.label<a[2]){n.label=a[2];n.ops.push(l);break}if(a[2])n.ops.pop();n.trys.pop();continue}l=t.call(e,n)}catch(e){l=[6,e];r=0}finally{o=a=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:true}}};import{h as getEnvelope}from"./utils-6e8bd73f.js";import{c as createStore}from"./index-fd7b8a34.js";import{g as getTemplate}from"./Templates-0638b1e4.js";var _c=createStore({envelope:null,template:null,loadProgress:0,loading:true,error:"",roleNames:[],dirty:false}),state=_c.state,onChange=_c.onChange;onChange("envelope",(function(e){return __awaiter(void 0,void 0,void 0,(function(){return __generator(this,(function(t){if(!e){console.log("[ENVELOPESTORE] Clearing envelope");state.roleNames=[];state.dirty=false;state.loading=false;state.error="";state.loadProgress=0;return[2]}console.log("[ENVELOPESTORE] Loaded envelope",e);state.roleNames=e.recipients.map((function(e){return e.role_name}));console.log("[ENVELOPESTORE] Loaded roles",state.roleNames);return[2]}))}))}));var getEnvelopeById=function(e,t){return __awaiter(void 0,void 0,void 0,(function(){var n,o,r,a,l;return __generator(this,(function(s){switch(s.label){case 0:if(!t){console.log("[ENVELOPES] Missing required envelope ID");return[2]}if(((n=state.envelope)===null||n===void 0?void 0:n.id)===t){console.log("[ENVELOPES] Skipping load for already-loaded envelope ID");return[2]}state.error="";state.loading=true;state.envelope=null;s.label=1;case 1:s.trys.push([1,4,,5]);console.log("[ENVELOPES] Loading envelope ".concat(t));return[4,getEnvelope(e,t,true)];case 2:r=s.sent();if(!r){console.log("[ENVELOPES] Unable to load envelope");return[2]}state.envelope=r;return[4,getTemplate(e,r.template_id,true)];case 3:a=s.sent();if(!r){console.log("[ENVELOPES] Unable to load template");return[2]}state.template=a;state.loading=false;return[3,5];case 4:l=s.sent();state.loading=false;state.error=((o=l===null||l===void 0?void 0:l.response)===null||o===void 0?void 0:o.status)===401?"Authentication required":l.message;console.log("[ENVELOPES] Error loading envelope",l);throw l;case 5:return[2]}}))}))};export{getEnvelopeById as g,state as s};
|
|
2
|
+
//# sourceMappingURL=Envelopes-c2545a20.js.map
|
|
File without changes
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var fileToDataUrl=function(e){return new Promise((function(a,o){var n=new FileReader;n.onload=function(){return a({lastModified:e.lastModified,size:e.size,type:e.type,name:e.name,data:n.result})};n.onerror=o;if(e){n.readAsDataURL(e)}else{o(new Error("Invalid file"))}}))};var downloadBlob=function(e,a){if(a===void 0){a="file.pdf"}var o=URL.createObjectURL(e);var n=document.createElement("a");n.href=o;n.download=a;document.body.appendChild(n);n.dispatchEvent(new MouseEvent("click",{bubbles:true,cancelable:true,view:window}));document.body.removeChild(n)};export{downloadBlob as d,fileToDataUrl as f};
|
|
2
|
+
//# sourceMappingURL=Files-70a192df.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["node_modules/@verdocs/js-sdk/Utils/Files.js"],"names":["fileToDataUrl","file","Promise","resolve","reject","reader","FileReader","onload","lastModified","size","type","name","data","result","onerror","readAsDataURL","Error","downloadBlob","blob","blobUrl","URL","createObjectURL","link","document","createElement","href","download","body","appendChild","dispatchEvent","MouseEvent","bubbles","cancelable","view","window","removeChild"],"mappings":"AAIU,IAACA,cAAgB,SAAUC,GACjC,OAAO,IAAIC,SAAQ,SAAUC,EAASC,GAClC,IAAIC,EAAS,IAAIC,WACjBD,EAAOE,OAAS,WACZ,OAAOJ,EAAQ,CACXK,aAAcP,EAAKO,aACnBC,KAAMR,EAAKQ,KACXC,KAAMT,EAAKS,KACXC,KAAMV,EAAKU,KACXC,KAAMP,EAAOQ,UAGrBR,EAAOS,QAAUV,EACjB,GAAIH,EAAM,CACNI,EAAOU,cAAcd,OAEpB,CACDG,EAAO,IAAIY,MAAM,sBAOnB,IAACC,aAAe,SAAUC,EAAMP,GACtC,GAAIA,SAAc,EAAG,CAAEA,EAAO,WAC9B,IAAIQ,EAAUC,IAAIC,gBAAgBH,GAClC,IAAII,EAAOC,SAASC,cAAc,KAClCF,EAAKG,KAAON,EACZG,EAAKI,SAAWf,EAChBY,SAASI,KAAKC,YAAYN,GAC1BA,EAAKO,cAAc,IAAIC,WAAW,QAAS,CACvCC,QAAS,KACTC,WAAY,KACZC,KAAMC,UAEVX,SAASI,KAAKQ,YAAYb","sourcesContent":["/**\n * Given a File, extract the file's content as a base64 encoded data URL. The response will have a prefix that\n * includes the MIME type of the file, e.g. \"data:image/jpeg;base64,iVBORw0K......\"\n */\nexport var fileToDataUrl = function (file) {\n return new Promise(function (resolve, reject) {\n var reader = new FileReader();\n reader.onload = function () {\n return resolve({\n lastModified: file.lastModified,\n size: file.size,\n type: file.type,\n name: file.name,\n data: reader.result,\n });\n };\n reader.onerror = reject;\n if (file) {\n reader.readAsDataURL(file);\n }\n else {\n reject(new Error('Invalid file'));\n }\n });\n};\n/**\n * Trigger a download dialog to save a blob as a file on disk.\n */\nexport var downloadBlob = function (blob, name) {\n if (name === void 0) { name = 'file.pdf'; }\n var blobUrl = URL.createObjectURL(blob);\n var link = document.createElement('a');\n link.href = blobUrl;\n link.download = name;\n document.body.appendChild(link);\n link.dispatchEvent(new MouseEvent('click', {\n bubbles: true,\n cancelable: true,\n view: window,\n }));\n document.body.removeChild(link);\n};\n"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var integerSequence=function(n,e){return Array(e).fill(1).map((function(e,r){return r+n}))};var fullNameToInitials=function(n){return n.split(" ").map((function(n){return n[0]})).join("")};export{fullNameToInitials as f,integerSequence as i};
|
|
2
|
+
//# sourceMappingURL=Primitives-054bc6e5.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["node_modules/@verdocs/js-sdk/Utils/Primitives.js"],"names":["integerSequence","start","count","Array","fill","map","_","index","fullNameToInitials","name","split","word","join"],"mappings":"AAIU,IAACA,gBAAkB,SAAUC,EAAOC,GAC1C,OAAOC,MAAMD,GACRE,KAAK,GACLC,KAAI,SAAUC,EAAGC,GAAS,OAAOA,EAAQN,MAKxC,IAACO,mBAAqB,SAAUC,GACtC,OAAOA,EACFC,MAAM,KACNL,KAAI,SAAUM,GAAQ,OAAOA,EAAK,MAClCC,KAAK","sourcesContent":["/**\n * Create an array containing a sequence of integers, e.g. [START, START+1, START+2, ...] This is frequently useful\n * in rendering operations when there is no source array to .map() across.\n */\nexport var integerSequence = function (start, count) {\n return Array(count)\n .fill(1)\n .map(function (_, index) { return index + start; });\n};\n/**\n * Generate suggested initials for a full name, e.g. \"John Doe\" will yield \"JD\".\n */\nexport var fullNameToInitials = function (name) {\n return name\n .split(' ')\n .map(function (word) { return word[0]; })\n .join('');\n};\n"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(e,t,n,r){function a(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,o){function l(e){try{s(r.next(e))}catch(e){o(e)}}function i(e){try{s(r["throw"](e))}catch(e){o(e)}}function s(e){e.done?n(e.value):a(e.value).then(l,i)}s((r=r.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,a,o,l;return l={next:i(0),throw:i(1),return:i(2)},typeof Symbol==="function"&&(l[Symbol.iterator]=function(){return this}),l;function i(e){return function(t){return s([e,t])}}function s(l){if(r)throw new TypeError("Generator is already executing.");while(n)try{if(r=1,a&&(o=l[0]&2?a["return"]:l[0]?a["throw"]||((o=a["return"])&&o.call(a),0):a.next)&&!(o=o.call(a,l[1])).done)return o;if(a=0,o)l=[l[0]&2,o.value];switch(l[0]){case 0:case 1:o=l;break;case 4:n.label++;return{value:l[1],done:false};case 5:n.label++;a=l[1];l=[0];continue;case 7:l=n.ops.pop();n.trys.pop();continue;default:if(!(o=n.trys,o=o.length>0&&o[o.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!o||l[1]>o[0]&&l[1]<o[3])){n.label=l[1];break}if(l[0]===6&&n.label<o[1]){n.label=o[1];o=l;break}if(o&&n.label<o[2]){n.label=o[2];n.ops.push(l);break}if(o[2])n.ops.pop();n.trys.pop();continue}l=t.call(e,n)}catch(e){l=[6,e];a=0}finally{r=o=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:true}}};import{g as getTemplate}from"./Templates-0638b1e4.js";import{s as state}from"./templateStore-
|
|
2
|
-
//# sourceMappingURL=Templates-
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(e,t,n,r){function a(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,o){function l(e){try{s(r.next(e))}catch(e){o(e)}}function i(e){try{s(r["throw"](e))}catch(e){o(e)}}function s(e){e.done?n(e.value):a(e.value).then(l,i)}s((r=r.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,a,o,l;return l={next:i(0),throw:i(1),return:i(2)},typeof Symbol==="function"&&(l[Symbol.iterator]=function(){return this}),l;function i(e){return function(t){return s([e,t])}}function s(l){if(r)throw new TypeError("Generator is already executing.");while(n)try{if(r=1,a&&(o=l[0]&2?a["return"]:l[0]?a["throw"]||((o=a["return"])&&o.call(a),0):a.next)&&!(o=o.call(a,l[1])).done)return o;if(a=0,o)l=[l[0]&2,o.value];switch(l[0]){case 0:case 1:o=l;break;case 4:n.label++;return{value:l[1],done:false};case 5:n.label++;a=l[1];l=[0];continue;case 7:l=n.ops.pop();n.trys.pop();continue;default:if(!(o=n.trys,o=o.length>0&&o[o.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!o||l[1]>o[0]&&l[1]<o[3])){n.label=l[1];break}if(l[0]===6&&n.label<o[1]){n.label=o[1];o=l;break}if(o&&n.label<o[2]){n.label=o[2];n.ops.push(l);break}if(o[2])n.ops.pop();n.trys.pop();continue}l=t.call(e,n)}catch(e){l=[6,e];a=0}finally{r=o=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:true}}};import{g as getTemplate}from"./Templates-0638b1e4.js";import{s as state}from"./templateStore-7b50460b.js";var loadTemplate=function(e,t){return __awaiter(void 0,void 0,void 0,(function(){var n,r;return __generator(this,(function(a){switch(a.label){case 0:state.template=null;if(!t){console.log("[TEMPLATES] Missing required template ID");return[2]}state.loading=true;a.label=1;case 1:a.trys.push([1,3,,4]);console.log("[TEMPLATES] Loading template ".concat(t));return[4,getTemplate(e,t,true)];case 2:n=a.sent();if(!n){console.log("[TEMPLATES] Unable to load template");return[2]}state.template=n;state.loading=false;return[3,4];case 3:r=a.sent();console.log("[TEMPLATES] Error loading template",r);throw r;case 4:return[2]}}))}))};export{loadTemplate as l};
|
|
2
|
+
//# sourceMappingURL=Templates-ad0e1ebe.js.map
|
|
File without changes
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(e,t,n,r){function a(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function i(e){try{l(r["throw"](e))}catch(e){o(e)}}function l(e){e.done?n(e.value):a(e.value).then(s,i)}l((r=r.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,a,o,s;return s={next:i(0),throw:i(1),return:i(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function i(e){return function(t){return l([e,t])}}function l(s){if(r)throw new TypeError("Generator is already executing.");while(n)try{if(r=1,a&&(o=s[0]&2?a["return"]:s[0]?a["throw"]||((o=a["return"])&&o.call(a),0):a.next)&&!(o=o.call(a,s[1])).done)return o;if(a=0,o)s=[s[0]&2,o.value];switch(s[0]){case 0:case 1:o=s;break;case 4:n.label++;return{value:s[1],done:false};case 5:n.label++;a=s[1];s=[0];continue;case 7:s=n.ops.pop();n.trys.pop();continue;default:if(!(o=n.trys,o=o.length>0&&o[o.length-1])&&(s[0]===6||s[0]===2)){n=0;continue}if(s[0]===3&&(!o||s[1]>o[0]&&s[1]<o[3])){n.label=s[1];break}if(s[0]===6&&n.label<o[1]){n.label=o[1];o=s;break}if(o&&n.label<o[2]){n.label=o[2];n.ops.push(s);break}if(o[2])n.ops.pop();n.trys.pop();continue}s=t.call(e,n)}catch(e){s=[6,e];a=0}finally{r=o=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};import{c as createStore}from"./index-fd7b8a34.js";import{i as integerSequence}from"./Primitives-054bc6e5.js";var _a=createStore({template:null,loadProgress:0,loading:true,pageNumbers:[],pageUris:{},roleNames:[],fields:[],dirty:false}),state=_a.state,onChange=_a.onChange;onChange("template",(function(e){return __awaiter(void 0,void 0,void 0,(function(){return __generator(this,(function(t){if(!e){console.log("[TEMPLATESTORE] Clearing template");state.fields=[];state.roleNames=[];state.pageNumbers=[];state.dirty=false;state.loading=false;state.loadProgress=0;return[2]}console.log("[TEMPLATESTORE] Template loaded",e);state.roleNames=e.roles.map((function(e){return e.name}));console.log("[TEMPLATESTORE] Loaded roles",state.roleNames);state.fields=[];e.roles.forEach((function(e){var t;(t=state.fields).push.apply(t,e.fields)}));console.log("[TEMPLATESTORE] Loaded fields",state.fields);state.pageNumbers=integerSequence(1,e.pages.length);return[2]}))}))}));onChange("fields",(function(e){console.log("[TEMPLATESTORE] Field changed",e);state.dirty=true}));export{state as s};
|
|
2
|
+
//# sourceMappingURL=templateStore-7b50460b.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["src/utils/templateStore.ts"],"names":["_a","createStore","template","loadProgress","loading","pageNumbers","pageUris","roleNames","fields","dirty","state","onChange","newTemplate","__awaiter","console","log","roles","map","role","name","forEach","push","apply","integerSequence","pages","length","newField"],"mappings":"siDAOM,IAAAA,GAAoBC,YAAY,CACpCC,SAAU,KACVC,aAAc,EACdC,QAAS,KAETC,YAAa,GACbC,SAAU,GACVC,UAAW,GACXC,OAAQ,GACRC,MAAO,QATFC,MAAKV,GAAAU,MAAEC,SAAQX,GAAAW,SAYtBA,SAAS,YAAY,SAAMC,GAAW,OAAAC,eAAA,OAAA,OAAA,GAAA,gDACpC,IAAKD,EAAa,CAChBE,QAAQC,IAAI,qCACZL,MAAMF,OAAS,GACfE,MAAMH,UAAY,GAClBG,MAAML,YAAc,GACpBK,MAAMD,MAAQ,MACdC,MAAMN,QAAU,MAChBM,MAAMP,aAAe,EACrB,MAAA,CAAA,GAGFW,QAAQC,IAAI,kCAAmCH,GAE/CF,MAAMH,UAAYK,EAAYI,MAAMC,KAAI,SAAAC,GAAQ,OAAAA,EAAKC,QACrDL,QAAQC,IAAI,+BAAgCL,MAAMH,WAElDG,MAAMF,OAAS,GACfI,EAAYI,MAAMI,SAAQ,SAAAF,UACxBlB,EAAAU,MAAMF,QAAOa,KAAIC,MAAAtB,EAAIkB,EAAKV,WAG5BM,QAAQC,IAAI,gCAAiCL,MAAMF,QAEnDE,MAAML,YAAckB,gBAAgB,EAAGX,EAAYY,MAAMC,2BAG3Dd,SAAS,UAAU,SAAAe,GACjBZ,QAAQC,IAAI,gCAAiCW,GAC7ChB,MAAMD,MAAQ","sourcesContent":["// NOTE: Do not attempt to convert this to a named-export module. It triggers compilation issues in Rollup that I spent days trying to\n// resolve. This needs to export a single default value of the store's state. Any helper functions should go in Templates.ts here.\n\nimport {createStore} from '@stencil/store';\nimport {integerSequence} from '@verdocs/js-sdk/Utils/Primitives';\nimport {ITemplate, ITemplateField} from '@verdocs/js-sdk/Templates/Types';\n\nconst {state, onChange} = createStore({\n template: null as ITemplate | null,\n loadProgress: 0,\n loading: true,\n\n pageNumbers: [] as number[],\n pageUris: {} as Record<number, string>,\n roleNames: [] as string[],\n fields: [] as ITemplateField[],\n dirty: false,\n});\n\nonChange('template', async newTemplate => {\n if (!newTemplate) {\n console.log('[TEMPLATESTORE] Clearing template');\n state.fields = [];\n state.roleNames = [];\n state.pageNumbers = [];\n state.dirty = false;\n state.loading = false;\n state.loadProgress = 0;\n return;\n }\n\n console.log('[TEMPLATESTORE] Template loaded', newTemplate);\n\n state.roleNames = newTemplate.roles.map(role => role.name);\n console.log('[TEMPLATESTORE] Loaded roles', state.roleNames);\n\n state.fields = [];\n newTemplate.roles.forEach(role => {\n state.fields.push(...role.fields);\n });\n\n console.log('[TEMPLATESTORE] Loaded fields', state.fields);\n\n state.pageNumbers = integerSequence(1, newTemplate.pages.length);\n});\n\nonChange('fields', newField => {\n console.log('[TEMPLATESTORE] Field changed', newField);\n state.dirty = true;\n});\n\nexport default state;\n"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,o){function a(e){try{c(r.next(e))}catch(e){o(e)}}function u(e){try{c(r["throw"](e))}catch(e){o(e)}}function c(e){e.done?n(e.value):i(e.value).then(a,u)}c((r=r.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,a;return a={next:u(0),throw:u(1),return:u(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function u(e){return function(t){return c([e,t])}}function c(a){if(r)throw new TypeError("Generator is already executing.");while(n)try{if(r=1,i&&(o=a[0]&2?i["return"]:a[0]?i["throw"]||((o=i["return"])&&o.call(i),0):i.next)&&!(o=o.call(i,a[1])).done)return o;if(i=0,o)a=[a[0]&2,o.value];switch(a[0]){case 0:case 1:o=a;break;case 4:n.label++;return{value:a[1],done:false};case 5:n.label++;i=a[1];a=[0];continue;case 7:a=n.ops.pop();n.trys.pop();continue;default:if(!(o=n.trys,o=o.length>0&&o[o.length-1])&&(a[0]===6||a[0]===2)){n=0;continue}if(a[0]===3&&(!o||a[1]>o[0]&&a[1]<o[3])){n.label=a[1];break}if(a[0]===6&&n.label<o[1]){n.label=o[1];o=a;break}if(o&&n.label<o[2]){n.label=o[2];n.ops.push(a);break}if(o[2])n.ops.pop();n.trys.pop();continue}a=t.call(e,n)}catch(e){a=[6,e];i=0}finally{r=o=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++){if(o||!(r in t)){if(!o)o=Array.prototype.slice.call(t,0,r);o[r]=t[r]}}return e.concat(o||Array.prototype.slice.call(t))};import{d as decodeAccessTokenBody}from"./Token-54690789.js";import{d as downloadBlob}from"./Files-70a192df.js";var __awaiter=undefined&&undefined.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,o){function a(e){try{c(r.next(e))}catch(e){o(e)}}function u(e){try{c(r["throw"](e))}catch(e){o(e)}}function c(e){e.done?n(e.value):i(e.value).then(a,u)}c((r=r.apply(e,t||[])).next())}))};var __generator=undefined&&undefined.__generator||function(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,a;return a={next:u(0),throw:u(1),return:u(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function u(e){return function(t){return c([e,t])}}function c(a){if(r)throw new TypeError("Generator is already executing.");while(n)try{if(r=1,i&&(o=a[0]&2?i["return"]:a[0]?i["throw"]||((o=i["return"])&&o.call(i),0):i.next)&&!(o=o.call(i,a[1])).done)return o;if(i=0,o)a=[a[0]&2,o.value];switch(a[0]){case 0:case 1:o=a;break;case 4:n.label++;return{value:a[1],done:false};case 5:n.label++;i=a[1];a=[0];continue;case 7:a=n.ops.pop();n.trys.pop();continue;default:if(!(o=n.trys,o=o.length>0&&o[o.length-1])&&(a[0]===6||a[0]===2)){n=0;continue}if(a[0]===3&&(!o||a[1]>o[0]&&a[1]<o[3])){n.label=a[1];break}if(a[0]===6&&n.label<o[1]){n.label=o[1];o=a;break}if(o&&n.label<o[2]){n.label=o[2];n.ops.push(a);break}if(o[2])n.ops.pop();n.trys.pop();continue}a=t.call(e,n)}catch(e){a=[6,e];i=0}finally{r=o=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};var getSigningSession=function(e,t){return __awaiter(void 0,void 0,void 0,(function(){return __generator(this,(function(n){return[2,e.api.get("/envelopes/".concat(t.envelopeId,"/recipients/").concat(encodeURIComponent(t.roleId),"/invitation/").concat(t.inviteCode)).then((function(t){var n;var r=((n=t.headers)===null||n===void 0?void 0:n.signer_token)||"";var i=decodeAccessTokenBody(r);e.setToken(r);return{recipient:t.data,session:i,signerToken:r}}))]}))}))};var getEnvelope=function(e,t,n){return __awaiter(void 0,void 0,void 0,(function(){return __generator(this,(function(r){return[2,e.api.get("/envelopes/".concat(t)+(n?"?ssr=true":"")).then((function(e){return e.data}))]}))}))};var getEnvelopeFile=function(e,t,n){return __awaiter(void 0,void 0,void 0,(function(){return __generator(this,(function(r){return[2,e.api.get("/envelopes/".concat(t,"/envelope_documents/").concat(n,"?file=true"),{responseType:"blob"}).then((function(e){return e.data}))]}))}))};var updateEnvelopeField=function(e,t,n,r){return __awaiter(void 0,void 0,void 0,(function(){return __generator(this,(function(i){return[2,e.api.put("/envelopes/".concat(t,"/fields/").concat(n),r).then((function(e){return e.data}))]}))}))};var updateEnvelopeFieldSignature=function(e,t,n,r){return __awaiter(void 0,void 0,void 0,(function(){return __generator(this,(function(i){return[2,e.api.put("/envelopes/".concat(t,"/fields/").concat(n,"/signature/").concat(r)).then((function(e){return e.data}))]}))}))};var updateEnvelopeFieldInitials=function(e,t,n,r){return __awaiter(void 0,void 0,void 0,(function(){return __generator(this,(function(i){return[2,e.api.put("/envelopes/".concat(t,"/fields/").concat(n,"/initial/").concat(r)).then((function(e){return e.data}))]}))}))};function rescale(e,t){return e*t}var defaultWidth=function(e){switch(e.type){case"attachment":case"payment":return 24;case"checkbox":case"checkbox_group":case"radio_button_group":return 14;case"signature":case"initial":return 82}return 150};var defaultHeight=function(e){switch(e.type){case"attachment":case"payment":return 24;case"checkbox":case"checkbox_group":case"radio_button_group":return 14;case"signature":case"initial":return 41}return 50};var setControlStyles=function(e,t,n,r,i){var o,a,u,c;var l=t.setting||t.settings;var s=l.x,d=s===void 0?0:s,f=l.y,p=f===void 0?0:f,v=l.width,g=v===void 0?defaultWidth(t):v,h=l.height,b=h===void 0?defaultHeight(t):h;var y=i!==undefined&&l.options[i]?l.options[i]:null;if(y){d=(o=y.x)!==null&&o!==void 0?o:d;p=(a=y.y)!==null&&a!==void 0?a:p;g=(u=y.width)!==null&&u!==void 0?u:g;b=(c=y.height)!==null&&c!==void 0?c:b}e.style.width="".concat(g,"px");e.style.height="".concat(b,"px");e.style.position="absolute";e.style.left="".concat(rescale(n,d),"px");e.style.bottom="".concat(rescale(r,p),"px");e.style.transform="scale(".concat(n,", ").concat(r,")")};var getFieldId=function(e){return"verdocs-doc-fld-".concat(e.name)};var getFieldOptionId=function(e,t){return"verdocs-doc-fld-".concat(e.name,"-").concat(t)};var updateDocumentFieldValue=function(e){var t=getFieldId(e);var n=document.getElementById(t);if(n){n.field=e;n.setAttribute("id",t);n.setAttribute("disabled",true);n.setAttribute("disabled",false)}};var renderDocumentField=function(e,t,n,r){var i=r.disabled,o=i===void 0?false:i,a=r.editable,u=a===void 0?false:a,c=r.draggable,l=c===void 0?false:c,s=r.done,d=s===void 0?false:s;var f=document.getElementById(t.containerId+"-controls");if(!f){console.log("[renderDocumentField] No controls DIV found",t.containerId+"-controls",t);return}switch(e.type){case"attachment":case"date":case"dropdown":case"initial":case"payment":case"signature":case"timestamp":case"textarea":case"textbox":{var p=getFieldId(e);var v=document.getElementById(p);if(v){setControlStyles(v,e,t.xScale,t.yScale);return v}var g=document.createElement("verdocs-field-".concat(e.type));g.field=e;g.setAttribute("id",p);g.setAttribute("roleIndex",n);if(o){g.setAttribute("tabindex",-1);g.setAttribute("disabled",true)}else{g.setAttribute("tabIndex",1)}if(u){g.setAttribute("editable",true)}if(l){g.setAttribute("draggable",true)}if(d){g.setAttribute("done",true)}setControlStyles(g,e,t.xScale,t.yScale);f.appendChild(g);return g}case"checkbox_group":return(e.settings||e.setting||{}).options.map((function(r,i){var a=getFieldOptionId(e,i);var u=document.getElementById(a);if(u){setControlStyles(u,e,t.xScale,t.yScale);return u}var c=document.createElement("verdocs-field-checkbox");c.field=e;c.setAttribute("id",a);c.setAttribute("roleIndex",n);c.setAttribute("option",i);if(o){c.setAttribute("disabled",true)}if(d){c.setAttribute("done",true)}setControlStyles(c,e,t.xScale,t.yScale,i);f.appendChild(c);return c}));case"radio_button_group":return(e.settings||e.setting||{}).options.map((function(r,i){var a=getFieldOptionId(e,i);var u=document.getElementById(a);if(u){setControlStyles(u,e,t.xScale,t.yScale);return u}var c=document.createElement("verdocs-field-radio-button");c.field=e;c.setAttribute("id",a);c.setAttribute("roleIndex",n);c.setAttribute("option",i);if(o){c.setAttribute("disabled",true)}if(d){c.setAttribute("done",true)}setControlStyles(c,e,t.xScale,t.yScale,i);f.appendChild(c);return c}));default:console.log("[PREVIEW] Skipping unsupported field type",e);return null}};var getRoleIndex=function(e,t){return e.indexOf(t)||0};var getFieldSettings=function(e){if(e.setting){return e.setting}if(e.settings){return e.settings}return{x:0,y:0,required:false,disabled:false,result:"",value:""}};var updateCssTransform=function(e,t,n){var r=e.style.transform;var i=__spreadArray([],r.matchAll(/(\w+)\(([^)]*)\)/gi),true);e.style.transform=[i.filter((function(e){return e[1]!==t})).map((function(e){return e[0]})),"".concat(t,"(").concat(n,")")].join(" ")};var savePDF=function(e,t,n){return __awaiter(void 0,void 0,void 0,(function(){var r,i;return __generator(this,(function(o){switch(o.label){case 0:r="".concat(t.name," - ").concat(t.updated_at.split("T")[0],".pdf");return[4,getEnvelopeFile(e,t.id,n)];case 1:i=o.sent();downloadBlob(i,r);return[2]}}))}))};var throttle=function(e,t){var n=0;return function(){var r=this;var i=[];for(var o=0;o<arguments.length;o++){i[o]=arguments[o]}clearTimeout(n);n=setTimeout((function(){return e.apply(r,i)}),t)}};export{getRoleIndex as a,getSigningSession as b,updateEnvelopeField as c,updateEnvelopeFieldSignature as d,updateEnvelopeFieldInitials as e,getFieldId as f,getFieldSettings as g,getEnvelope as h,updateCssTransform as i,renderDocumentField as r,savePDF as s,throttle as t,updateDocumentFieldValue as u};
|
|
2
|
+
//# sourceMappingURL=utils-6e8bd73f.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["node_modules/@verdocs/js-sdk/Envelopes/Envelopes.js","node_modules/@verdocs/js-sdk/Utils/Fields.js","src/utils/utils.ts"],"names":["__awaiter","this","thisArg","_arguments","P","generator","adopt","value","resolve","Promise","reject","fulfilled","step","next","e","rejected","result","done","then","apply","__generator","body","_","label","sent","t","trys","ops","f","y","g","verb","throw","return","Symbol","iterator","n","v","op","TypeError","call","pop","length","push","getSigningSession","endpoint","params","_a","api","get","concat","envelopeId","encodeURIComponent","roleId","inviteCode","r","signerToken","headers","signer_token","session","decodeAccessTokenBody","setToken","recipient","data","getEnvelope","ssr","getEnvelopeFile","documentId","responseType","updateEnvelopeField","fieldName","put","updateEnvelopeFieldSignature","signatureId","updateEnvelopeFieldInitials","initialId","rescale","defaultWidth","field","type","defaultHeight","setControlStyles","el","xScale","yScale","option","settings","setting","_e","x","_f","_g","width","_h","height","optionSettings","undefined","options","_b","_c","_d","style","position","left","bottom","transform","getFieldId","name","getFieldOptionId","index","updateDocumentFieldValue","id","existingField","document","getElementById","setAttribute","renderDocumentField","docPage","roleIndex","fieldOptions","disabled","editable","draggable","controlsDiv","containerId","console","log","createElement","appendChild","map","checkboxIndex","cbEl","buttonIndex","radioEl","getRoleIndex","roles","role","indexOf","getFieldSettings","required","updateCssTransform","key","currentTransform","components","__spreadArray","matchAll","filter","component","join","savePDF","envelope","fileName","updated_at","split","Envelopes.getEnvelopeFile","downloadBlob","throttle","delay","timer","_this","args","_i","arguments","clearTimeout","setTimeout"],"mappings":"0xDAAA,IAAIA,UAAaC,WAAQA,UAAKD,WAAc,SAAUE,EAASC,EAAYC,EAAGC,GAC1E,SAASC,EAAMC,GAAS,OAAOA,aAAiBH,EAAIG,EAAQ,IAAIH,GAAE,SAAUI,GAAWA,EAAQD,MAC/F,OAAO,IAAKH,IAAMA,EAAIK,WAAU,SAAUD,EAASE,GAC/C,SAASC,EAAUJ,GAAS,IAAMK,EAAKP,EAAUQ,KAAKN,IAAW,MAAOO,GAAKJ,EAAOI,IACpF,SAASC,EAASR,GAAS,IAAMK,EAAKP,EAAU,SAASE,IAAW,MAAOO,GAAKJ,EAAOI,IACvF,SAASF,EAAKI,GAAUA,EAAOC,KAAOT,EAAQQ,EAAOT,OAASD,EAAMU,EAAOT,OAAOW,KAAKP,EAAWI,GAClGH,GAAMP,EAAYA,EAAUc,MAAMjB,EAASC,GAAc,KAAKU,YAGtE,IAAIO,YAAenB,WAAQA,UAAKmB,aAAgB,SAAUlB,EAASmB,GAC/D,IAAIC,EAAI,CAAEC,MAAO,EAAGC,KAAM,WAAa,GAAIC,EAAE,GAAK,EAAG,MAAMA,EAAE,GAAI,OAAOA,EAAE,IAAOC,KAAM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E,eAAA,OAAA,OAAA,GAAA,+EACxFuJ,EAAW,GAAArG,OAAGoG,EAAS3C,KAAI,OAAAzD,OAAMoG,EAASE,WAAWC,MAAM,KAAK,GAAE,QAC3D,MAAA,CAAA,EAAMC,gBAA0B7G,EAAUyG,EAASvC,GAAI5C,WAA9DJ,EAAOyB,EAAAhE,OACbmI,aAAa5F,EAAMwF,yBAMRK,SAAW,SAAChI,EAAGiI,GAC1B,IAAIC,EAAa,EACjB,OAAO,WAAA,IAAAC,EAAA9J,KAAU,IAAA+J,EAAA,OAAA,IAAAC,EAAA,EAAAA,EAAAC,UAAAxH,OAAAuH,IAAO,CAAPD,EAAAC,GAAAC,UAAAD,GACfE,aAAaL,GACbA,EAAQM,YAAW,WAAM,OAAAxI,EAAET,MAAM4I,EAAMC,KAAOH","sourcesContent":["var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nimport { decodeAccessTokenBody } from '../Utils/Token';\n/**\n * Create an envelope\n *\n * ```typescript\n * import {Envelopes, ICreateEnvelopeRole, ICreateEnvelopeRequest} from '@verdocs/js-sdk/Envelopes';\n *\n * const role1: ICreateEnvelopeRole = {\n * type: 'signer',\n * name: 'Seller',\n * full_name: 'Paige Turner',\n * email: 'paige.turner@nomail.com',\n * phone: '',\n * sequence: 1,\n * delegator: false,\n * message: '',\n * };\n *\n * const role2: ICreateEnvelopeRole = {\n * type: 'signer',\n * name: 'Buyer',\n * full_name: 'Will Power',\n * email: 'will.power@nomail.com',\n * phone: '',\n * sequence: 2,\n * delegator: false,\n * message: '',\n * };\n *\n * const request: ICreateEnvelopeRequest = {template_id: 'd2338742-f3a1-465b-8592-806587413cc1', name: 'Bill of Sale', roles: [role1, role2]};\n * const {id, recipients} = await Envelopes.createEnvelope(VerdocsEndpoint.getDefault(), request);\n * ```\n */\nexport var createEnvelope = function (endpoint, request) { return __awaiter(void 0, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, endpoint.api //\n .post('/envelopes', request)\n .then(function (r) { return r.data; })];\n });\n}); };\n/**\n * Get a summary of currently active envelopes.\n *\n * ```typescript\n * import {Envelopes} from '@verdocs/js-sdk/Envelopes';\n *\n * const {action_required, completed, waiting_on_others} = await Envelopes.getSummary(VerdocsEndpoint.getDefault());\n * ```\n */\nexport var getSummary = function (endpoint, page) { return __awaiter(void 0, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, endpoint.api //\n .post('/envelopes/summary', { page: page })\n .then(function (r) { return r.data; })];\n });\n}); };\n/**\n * Search for envelopes matching various criteria.\n *\n * ```typescript\n * import {Envelopes} from '@verdocs/js-sdk/Envelopes';\n *\n * const {result, page, total} = await Envelopes.search(VerdocsEndpoint.getDefault(), { ... });\n * ```\n */\nexport var searchEnvelopes = function (endpoint, params) { return __awaiter(void 0, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, endpoint.api //\n .post('/envelopes/search', params)\n .then(function (r) { return r.data; })];\n });\n}); };\n/**\n * Get a signing session for an Envelope.\n */\nexport var getSigningSession = function (endpoint, params) { return __awaiter(void 0, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, endpoint.api //\n .get(\"/envelopes/\".concat(params.envelopeId, \"/recipients/\").concat(encodeURIComponent(params.roleId), \"/invitation/\").concat(params.inviteCode))\n .then(function (r) {\n var _a;\n // Avoiding a jsonwebtoken dependency here - we don't actually need the whole library\n var signerToken = ((_a = r.headers) === null || _a === void 0 ? void 0 : _a.signer_token) || '';\n var session = decodeAccessTokenBody(signerToken);\n endpoint.setToken(signerToken);\n return { recipient: r.data, session: session, signerToken: signerToken };\n })];\n });\n}); };\n/**\n * Get the list of recipients for an Envelope.\n */\nexport var getEnvelopeRecipients = function (endpoint, envelopeId) { return __awaiter(void 0, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, endpoint.api //\n .get(\"/envelopes/\".concat(envelopeId, \"/recipients\"))\n .then(function (r) { return r.data; })];\n });\n}); };\n/**\n * Get all metadata for an Envelope.\n */\nexport var getEnvelope = function (endpoint, envelopeId, ssr) { return __awaiter(void 0, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, endpoint.api //\n .get(\"/envelopes/\".concat(envelopeId) + (ssr ? '?ssr=true' : ''))\n .then(function (r) { return r.data; })];\n });\n}); };\n/**\n * Get all metadata for an Envelope.\n */\nexport var getEnvelopeDocument = function (endpoint, envelopeId, documentId) { return __awaiter(void 0, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, endpoint.api //\n .get(\"/envelopes/\".concat(envelopeId, \"/envelope_documents/\").concat(documentId))\n .then(function (r) { return r.data; })];\n });\n}); };\n/**\n * Cancel an Envelope.\n */\nexport var cancelEnvelope = function (endpoint, envelopeId) { return __awaiter(void 0, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, endpoint.api //\n .put(\"/envelopes/\".concat(envelopeId), { action: 'cancel' })\n .then(function (r) { return r.data; })];\n });\n}); };\n/**\n * Returns true if the recipient has a pending action. Note that this does not necessarily mean the recipient can act (yet).\n */\nexport var recipientHasAction = function (recipient) { return !['submitted', 'canceled', 'declined'].includes(recipient.status); };\n/**\n * Returns the recipients who still have a pending action. Note that not all of these recipients may be able to act (yet).\n */\nexport var getRecipientsWithActions = function (envelope) { return ((envelope === null || envelope === void 0 ? void 0 : envelope.recipients) || []).filter(recipientHasAction); };\n/**\n * Returns true if the recipient can act.\n */\nexport var recipientCanAct = function (recipient, recipientsWithActions) { var _a; return recipient.sequence === ((_a = recipientsWithActions === null || recipientsWithActions === void 0 ? void 0 : recipientsWithActions[0]) === null || _a === void 0 ? void 0 : _a.sequence); };\n/**\n * Returns true if the user can act.\n */\nexport var userCanAct = function (email, recipientsWithActions) {\n var _a;\n var recipient = recipientsWithActions.find(function (r) { return r.email === email; });\n return recipient && recipient.sequence === ((_a = recipientsWithActions === null || recipientsWithActions === void 0 ? void 0 : recipientsWithActions[0]) === null || _a === void 0 ? void 0 : _a.sequence);\n};\n/**\n * Get (binary download) a file attached to an Envelope. It is important to use this method\n * rather than a direct A HREF or similar link to set the authorization headers for the\n * request.\n */\nexport var getEnvelopeFile = function (endpoint, envelopeId, documentId) { return __awaiter(void 0, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, endpoint.api //\n .get(\"/envelopes/\".concat(envelopeId, \"/envelope_documents/\").concat(documentId, \"?file=true\"), { responseType: 'blob' })\n .then(function (r) { return r.data; })];\n });\n}); };\n/**\n * Update a Document field. Typically called during the signing process as a Recipient fills in fields.\n */\nexport var updateEnvelopeField = function (endpoint, envelopeId, fieldName, value) { return __awaiter(void 0, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, endpoint.api //\n .put(\"/envelopes/\".concat(envelopeId, \"/fields/\").concat(fieldName), value)\n .then(function (r) { return r.data; })];\n });\n}); };\n/**\n * Update a Document signature field. Signature fields are ID-driven. Call `Document.createSignature()` first to create a\n * signature for a Recipient, then call `Documents.updateDocumentFieldSignature()` to attach it to a field.\n */\nexport var updateEnvelopeFieldSignature = function (endpoint, envelopeId, fieldName, signatureId) { return __awaiter(void 0, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, endpoint.api //\n .put(\"/envelopes/\".concat(envelopeId, \"/fields/\").concat(fieldName, \"/signature/\").concat(signatureId))\n .then(function (r) { return r.data; })];\n });\n}); };\n/**\n * Update a Document signature field. Signature fields are ID-driven. Call `Document.createSignature()` first to create a\n * signature for a Recipient, then call `Documents.updateDocumentFieldSignature()` to attach it to a field.\n */\nexport var updateEnvelopeFieldInitials = function (endpoint, envelopeId, fieldName, initialId) { return __awaiter(void 0, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, endpoint.api //\n .put(\"/envelopes/\".concat(envelopeId, \"/fields/\").concat(fieldName, \"/initial/\").concat(initialId))\n .then(function (r) { return r.data; })];\n });\n}); };\n","export function getRTop(y, fieldHeight, iTextHeight, yRatio) {\n return iTextHeight - (y + fieldHeight) * yRatio;\n}\nexport function getRLeft(x, ratio) {\n return x * ratio;\n}\nexport function getRValue(y, ratio) {\n return y * ratio;\n}\nexport function blobToBase64(image) {\n var fileReader = new FileReader();\n return new Promise(function (resolve, reject) {\n fileReader.onerror = function () {\n reject(new DOMException('Problem reading blob.'));\n };\n fileReader.onload = function () {\n resolve(fileReader.result);\n };\n fileReader.readAsDataURL(image);\n });\n}\nexport function rescale(r, n) {\n return r * n;\n}\n","import {VerdocsEndpoint} from '@verdocs/js-sdk';\nimport {rescale} from '@verdocs/js-sdk/Utils/Fields';\nimport {ITemplateField} from '@verdocs/js-sdk/Templates/Types';\nimport {IDocumentField, IEnvelope} from '@verdocs/js-sdk/Envelopes/Types';\nimport {IDocumentPageInfo} from './Types';\nimport {Envelopes} from '@verdocs/js-sdk/Envelopes';\nimport {downloadBlob} from '@verdocs/js-sdk/Utils/Files';\n\nexport const defaultWidth = (field: ITemplateField | IDocumentField) => {\n switch (field.type) {\n case 'attachment':\n case 'payment':\n return 24;\n case 'checkbox':\n case 'checkbox_group':\n case 'radio_button_group':\n return 14;\n case 'signature':\n case 'initial':\n return 82;\n }\n\n return 150;\n};\n\nexport const defaultHeight = (field: ITemplateField | IDocumentField) => {\n switch (field.type) {\n case 'attachment':\n case 'payment':\n return 24;\n case 'checkbox':\n case 'checkbox_group':\n case 'radio_button_group':\n return 14;\n case 'signature':\n case 'initial':\n return 41;\n }\n\n return 50;\n};\n\nexport const setControlStyles = (el: HTMLElement, field: ITemplateField | IDocumentField, xScale: number, yScale: number, option?: number) => {\n const settings = (field as ITemplateField).setting || (field as IDocumentField).settings;\n let {x = 0, y = 0, width = defaultWidth(field), height = defaultHeight(field)} = settings;\n\n const optionSettings = option !== undefined && settings.options[option] ? settings.options[option] : null;\n if (optionSettings) {\n x = optionSettings.x ?? x;\n y = optionSettings.y ?? y;\n width = optionSettings.width ?? width;\n height = optionSettings.height ?? height;\n }\n\n el.style.width = `${width}px`;\n el.style.height = `${height}px`;\n el.style.position = 'absolute';\n el.style.left = `${rescale(xScale, x)}px`;\n el.style.bottom = `${rescale(yScale, y)}px`;\n el.style.transform = `scale(${xScale}, ${yScale})`;\n // el.style.backgroundColor = field['rgba'] || getRGBA(roleIndex);\n};\n\nexport const getFieldId = (field: ITemplateField | IDocumentField) => {\n return `verdocs-doc-fld-${field.name}`;\n};\n\nexport const getFieldOptionId = (field: ITemplateField | IDocumentField, index: number) => {\n return `verdocs-doc-fld-${field.name}-${index}`;\n};\n\ninterface IFieldOptions {\n disabled?: boolean;\n editable?: boolean;\n draggable?: boolean;\n done?: boolean;\n}\n\nexport const updateDocumentFieldValue = (field: ITemplateField | IDocumentField) => {\n const id = getFieldId(field);\n const existingField = document.getElementById(id) as any;\n if (existingField) {\n existingField.field = field;\n existingField.setAttribute('id', id); // We need this to trigger a re-render\n existingField.setAttribute('disabled', true); // We need this to trigger a re-render\n existingField.setAttribute('disabled', false); // We need this to trigger a re-render\n }\n};\n\nexport const renderDocumentField = (field: ITemplateField | IDocumentField, docPage: IDocumentPageInfo, roleIndex: number, fieldOptions: IFieldOptions) => {\n const {disabled = false, editable = false, draggable = false, done = false} = fieldOptions;\n const controlsDiv = document.getElementById(docPage.containerId + '-controls');\n if (!controlsDiv) {\n console.log('[renderDocumentField] No controls DIV found', docPage.containerId + '-controls', docPage);\n return;\n }\n\n switch (field.type) {\n case 'attachment':\n case 'date':\n case 'dropdown':\n case 'initial':\n case 'payment':\n case 'signature':\n case 'timestamp':\n case 'textarea':\n case 'textbox': {\n const id = getFieldId(field);\n const existingField = document.getElementById(id);\n if (existingField) {\n setControlStyles(existingField, field, docPage.xScale, docPage.yScale);\n return existingField;\n }\n\n const el: any = document.createElement(`verdocs-field-${field.type}`);\n el.field = field;\n el.setAttribute('id', id);\n el.setAttribute('roleIndex', roleIndex);\n\n if (disabled) {\n el.setAttribute('tabindex', -1);\n el.setAttribute('disabled', true);\n } else {\n el.setAttribute('tabIndex', 1);\n }\n\n if (editable) {\n el.setAttribute('editable', true);\n }\n\n if (draggable) {\n el.setAttribute('draggable', true);\n }\n\n if (done) {\n el.setAttribute('done', true);\n }\n\n setControlStyles(el, field, docPage.xScale, docPage.yScale);\n controlsDiv.appendChild(el);\n\n return el;\n }\n\n case 'checkbox_group':\n return ((field as any).settings || (field as any).setting || {}).options.map((_, checkboxIndex) => {\n const id = getFieldOptionId(field, checkboxIndex);\n const existingField = document.getElementById(id);\n if (existingField) {\n setControlStyles(existingField, field, docPage.xScale, docPage.yScale);\n return existingField;\n }\n\n const cbEl: any = document.createElement(`verdocs-field-checkbox`);\n cbEl.field = field;\n cbEl.setAttribute('id', id);\n cbEl.setAttribute('roleIndex', roleIndex);\n cbEl.setAttribute('option', checkboxIndex);\n if (disabled) {\n cbEl.setAttribute('disabled', true);\n }\n if (done) {\n cbEl.setAttribute('done', true);\n }\n setControlStyles(cbEl, field, docPage.xScale, docPage.yScale, checkboxIndex);\n controlsDiv.appendChild(cbEl);\n\n return cbEl;\n });\n\n case 'radio_button_group':\n return ((field as any).settings || (field as any).setting || {}).options.map((_, buttonIndex) => {\n const id = getFieldOptionId(field, buttonIndex);\n const existingField = document.getElementById(id);\n if (existingField) {\n setControlStyles(existingField, field, docPage.xScale, docPage.yScale);\n return existingField;\n }\n\n const radioEl: any = document.createElement(`verdocs-field-radio-button`);\n radioEl.field = field;\n radioEl.setAttribute('id', id);\n radioEl.setAttribute('roleIndex', roleIndex);\n radioEl.setAttribute('option', buttonIndex);\n if (disabled) {\n radioEl.setAttribute('disabled', true);\n }\n if (done) {\n radioEl.setAttribute('done', true);\n }\n setControlStyles(radioEl, field, docPage.xScale, docPage.yScale, buttonIndex);\n controlsDiv.appendChild(radioEl);\n\n return radioEl;\n });\n\n // case 'attachment':\n // el = document.createElement('verdocs-field-attachment');\n // el.setAttribute('value', result || '');\n // break;\n // case 'payment':\n // el = document.createElement('verdocs-field-payment');\n // break;\n default:\n console.log('[PREVIEW] Skipping unsupported field type', field);\n return null;\n }\n};\n\nexport const getRoleIndex = (roles: string[], role: string) => roles.indexOf(role) || 0;\n\n// TODO: We can clean this up a lot if we alter the API to emit both setting and settings regardless of the source type,\n// but then merge the SDK types to encourage developers to use just `settings`.\nexport const getFieldSettings = (field: ITemplateField | IDocumentField) => {\n if ((field as ITemplateField).setting) {\n return (field as ITemplateField).setting;\n }\n\n if ((field as IDocumentField).settings) {\n return (field as IDocumentField).settings;\n }\n\n return {x: 0, y: 0, required: false, disabled: false, result: '', value: ''};\n};\n\n/**\n * Helper function to safely set/update components in a CSS transform attribute. Transform is normally set as a string of\n * `operation1(param) operation2(param) ...` components, which makes updating them a bit of a pain. This will remove the\n * specified component if it's already set and replace it with the new value, without touching the other components that\n * may already be set. Note that this operation moves the component to the end of the transform chain so it's not meant\n * to be used for order-sensitive components e.g. translate-then-rotate.\n */\nexport const updateCssTransform = (el: HTMLElement, key: string, value: string) => {\n // e.g. 'scale(1.87908, 1.87908) translate(0px, 0px);'\n const currentTransform = el.style.transform;\n // e.g. ['scale(1.87908, 1.87908)', 'scale', '1.87908, 1.87908', ...], [ 'translate(0px, 0px)', 'translate', '0px, 0px']]\n const components = [...currentTransform.matchAll(/(\\w+)\\(([^)]*)\\)/gi)];\n el.style.transform = [\n components //\n .filter(component => component[1] !== key) // Remove the entry if it's already set\n .map(component => component[0]), // Convert back the remaining entries\n `${key}(${value})`,\n ].join(' ');\n};\n\nexport const savePDF = async (endpoint: VerdocsEndpoint, envelope: IEnvelope, documentId: string) => {\n const fileName = `${envelope.name} - ${envelope.updated_at.split('T')[0]}.pdf`;\n const data = await Envelopes.getEnvelopeFile(endpoint, envelope.id, documentId);\n downloadBlob(data, fileName);\n};\n\n/**\n * Throttle a given function by a delay value. Useful for things like resizeObserver.\n */\nexport const throttle = (f, delay) => {\n let timer: any = 0;\n return function (...args) {\n clearTimeout(timer);\n timer = setTimeout(() => f.apply(this, args), delay);\n };\n};\n"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(e,t,n,r){function o(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(e,t,n,r){function o(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,i){function s(e){try{l(r.next(e))}catch(e){i(e)}}function a(e){try{l(r["throw"](e))}catch(e){i(e)}}function l(e){e.done?n(e.value):o(e.value).then(s,a)}l((r=r.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var n={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},r,o,i,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(e){return function(t){return l([e,t])}}function l(s){if(r)throw new TypeError("Generator is already executing.");while(n)try{if(r=1,o&&(i=s[0]&2?o["return"]:s[0]?o["throw"]||((i=o["return"])&&i.call(o),0):o.next)&&!(i=i.call(o,s[1])).done)return i;if(o=0,i)s=[s[0]&2,i.value];switch(s[0]){case 0:case 1:i=s;break;case 4:n.label++;return{value:s[1],done:false};case 5:n.label++;o=s[1];s=[0];continue;case 7:s=n.ops.pop();n.trys.pop();continue;default:if(!(i=n.trys,i=i.length>0&&i[i.length-1])&&(s[0]===6||s[0]===2)){n=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){n.label=s[1];break}if(s[0]===6&&n.label<i[1]){n.label=i[1];i=s;break}if(i&&n.label<i[2]){n.label=i[2];n.ops.push(s);break}if(i[2])n.ops.pop();n.trys.pop();continue}s=t.call(e,n)}catch(e){s=[6,e];o=0}finally{r=i=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};import{r as registerInstance,c as createEvent,h,H as Host}from"./index-f78d163d.js";import"./Types-ab9f6af8.js";import{V as VerdocsEndpoint}from"./VerdocsEndpoint-28ba21cc.js";import{l as loadTemplate}from"./Templates-ad0e1ebe.js";import{S as SDKError}from"./errors-9b5498c8.js";import"./Token-54690789.js";import"./Templates-0638b1e4.js";import"./templateStore-7b50460b.js";import"./index-fd7b8a34.js";import"./Primitives-054bc6e5.js";var verdocsBuildCss='verdocs-build{display:-ms-flexbox;display:flex;font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center}';var VerdocsBuild=function(){function e(e){registerInstance(this,e);this.sdkError=createEvent(this,"sdkError",7);this.fields=[];this.endpoint=VerdocsEndpoint.getDefault();this.templateId=null;this.step="create";this.pdfUrl=null;this.template=null}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,n,r;return __generator(this,(function(o){switch(o.label){case 0:this.endpoint.loadSession();if(!this.endpoint.session){console.log("[BUILD] Unable to start builder session, must be authenticated");return[2]}if(!this.templateId){console.log("[BUILD] No template ID specified, showing upload option");this.step="create";return[2]}o.label=1;case 1:o.trys.push([1,3,,4]);console.log("[BUILD] Loading template ".concat(this.templateId));return[4,loadTemplate(this.endpoint,this.templateId)];case 2:o.sent();this.step="fields";return[3,4];case 3:r=o.sent();console.log("[BUILD] Error loading template",r);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new SDKError(r.message,(t=r.response)===null||t===void 0?void 0:t.status,(n=r.response)===null||n===void 0?void 0:n.data));return[3,4];case 4:return[2]}}))}))};e.prototype.handleCancel=function(e){console.log("Cancel",e.detail);this.step=""};e.prototype.handleTemplateCreated=function(e){console.log("Created",e.detail);this.step="properties"};e.prototype.handlePropertiesUpdated=function(e){console.log("updated",e.detail);this.step="recipients"};e.prototype.handleRecipientsUpdated=function(e){console.log("updated",e.detail);this.step="fields"};e.prototype.render=function(){var e=this;return h(Host,null,this.step==="create"&&h("verdocs-template-create",{onCancel:function(t){return e.handleCancel(t)},onNext:function(t){return e.handleTemplateCreated(t)}}),this.step==="properties"&&h("verdocs-template-properties",{onCancel:function(t){return e.handleCancel(t)},onNext:function(t){return e.handlePropertiesUpdated(t)}}),this.step==="recipients"&&h("verdocs-template-recipients",{onCancel:function(t){return e.handleCancel(t)},onNext:function(t){return e.handleRecipientsUpdated(t)}}),this.step==="fields"&&h("verdocs-template-fields",{onCancel:function(t){return e.handleCancel(t)},onNext:function(t){return e.handleCancel(t)}}))};return e}();VerdocsBuild.style=verdocsBuildCss;export{VerdocsBuild as verdocs_build};
|
|
2
2
|
//# sourceMappingURL=verdocs-build.entry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["src/components/embeds/verdocs-build/verdocs-build.scss?tag=verdocs-build","src/components/embeds/verdocs-build/verdocs-build.tsx"],"names":["verdocsBuildCss","VerdocsBuild","this","fields","VerdocsEndpoint","getDefault","class_1","prototype","componentWillLoad","endpoint","loadSession","session","console","log","templateId","step","concat","loadTemplate","_d","sent","e_1","_a","sdkError","emit","SDKError","message","_b","response","status","_c","data","handleCancel","e","detail","handleTemplateCreated","handlePropertiesUpdated","handleRecipientsUpdated","render","_this","h","Host","onCancel","onNext"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["src/components/embeds/verdocs-build/verdocs-build.scss?tag=verdocs-build","src/components/embeds/verdocs-build/verdocs-build.tsx"],"names":["verdocsBuildCss","VerdocsBuild","this","fields","VerdocsEndpoint","getDefault","class_1","prototype","componentWillLoad","endpoint","loadSession","session","console","log","templateId","step","concat","loadTemplate","_d","sent","e_1","_a","sdkError","emit","SDKError","message","_b","response","status","_c","data","handleCancel","e","detail","handleTemplateCreated","handlePropertiesUpdated","handleRecipientsUpdated","render","_this","h","Host","onCancel","onNext"],"mappings":"62DAAA,IAAMA,gBAAkB,kOCcXC,aAAY,+FAqBvBC,KAAAC,OAA2B,iBAjBSC,gBAAgBC,6BAKhB,eAQpB,qBACE,mBACoB,KAIhCC,EAAAC,UAAAC,kBAAN,mIACEN,KAAKO,SAASC,cACd,IAAKR,KAAKO,SAASE,QAAS,CAC1BC,QAAQC,IAAI,kEACZ,MAAA,CAAA,GAGF,IAAKX,KAAKY,WA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gBwB,EAAA,8BAAA,CAA6BE,SAAU,SAAAT,GAAK,OAAAM,EAAKP,aAAaC,IAAIU,OAAQ,SAAAV,GAAK,OAAAM,EAAKF,wBAAwBJ,MAC1I9B,KAAKa,OAAS,UAAYwB,EAAA,0BAAA,CAAyBE,SAAU,SAAAT,GAAK,OAAAM,EAAKP,aAAaC,IAAIU,OAAQ,SAAAV,GAAK,OAAAM,EAAKP,aAAaC,iBAxEvG","sourcesContent":["@import '../../../theme.scss';\n\nverdocs-build {\n display: flex;\n font-family: $verdocs-primary-font;\n justify-content: center;\n align-items: center;\n}\n","import {VerdocsEndpoint} from '@verdocs/js-sdk';\nimport {ITemplate, ITemplateField} from '@verdocs/js-sdk/Templates/Types';\nimport {Component, Prop, State, h, Event, EventEmitter, Host} from '@stencil/core';\nimport {loadTemplate} from '../../../utils/Templates';\nimport {SDKError} from '../../../utils/errors';\n\n/**\n * Display a template building experience.\n */\n@Component({\n tag: 'verdocs-build',\n styleUrl: 'verdocs-build.scss',\n shadow: false,\n})\nexport class VerdocsBuild {\n /**\n * The endpoint to use to communicate with Verdocs. If not set, the default endpoint will be used.\n */\n @Prop() endpoint: VerdocsEndpoint = VerdocsEndpoint.getDefault();\n\n /**\n * The ID of the template to create the document from.\n */\n @Prop() templateId: string | null = null;\n\n /**\n * Event fired if an error occurs. The event details will contain information about the error. Most errors will\n * terminate the process, and the calling application should correct the condition and re-render the component.\n */\n @Event({composed: true}) sdkError: EventEmitter<SDKError>;\n\n @State() step = 'create';\n @State() pdfUrl = null;\n @State() template: ITemplate | null = null;\n\n fields: ITemplateField[] = [];\n\n async componentWillLoad() {\n this.endpoint.loadSession();\n if (!this.endpoint.session) {\n console.log('[BUILD] Unable to start builder session, must be authenticated');\n return;\n }\n\n if (!this.templateId) {\n console.log(`[BUILD] No template ID specified, showing upload option`);\n this.step = 'create';\n return;\n }\n\n try {\n console.log(`[BUILD] Loading template ${this.templateId}`);\n await loadTemplate(this.endpoint, this.templateId);\n this.step = 'fields';\n } catch (e) {\n console.log('[BUILD] Error loading template', e);\n this.sdkError?.emit(new SDKError(e.message, e.response?.status, e.response?.data));\n }\n }\n\n handleCancel(e: any) {\n console.log('Cancel', e.detail);\n this.step = '';\n }\n\n handleTemplateCreated(e: any) {\n console.log('Created', e.detail);\n this.step = 'properties';\n }\n\n handlePropertiesUpdated(e: any) {\n console.log('updated', e.detail);\n this.step = 'recipients';\n }\n\n handleRecipientsUpdated(e: any) {\n console.log('updated', e.detail);\n this.step = 'fields';\n }\n\n render() {\n return (\n <Host>\n {this.step === 'create' && <verdocs-template-create onCancel={e => this.handleCancel(e)} onNext={e => this.handleTemplateCreated(e)} />}\n {this.step === 'properties' && <verdocs-template-properties onCancel={e => this.handleCancel(e)} onNext={e => this.handlePropertiesUpdated(e)} />}\n {this.step === 'recipients' && <verdocs-template-recipients onCancel={e => this.handleCancel(e)} onNext={e => this.handleRecipientsUpdated(e)} />}\n {this.step === 'fields' && <verdocs-template-fields onCancel={e => this.handleCancel(e)} onNext={e => this.handleCancel(e)} />}\n </Host>\n );\n }\n}\n"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as registerInstance,c as createEvent,h,H as Host,a as getElement}from"./index-f78d163d.js";import{t as throttle}from"./utils-36d44309.js";import"./Token-54690789.js";var verdocsDocumentPageCss="verdocs-document-page{width:100%;position:relative}verdocs-document-page .verdocs-document-page-layer{position:absolute;top:0;left:0;right:0;bottom:0;-webkit-box-shadow:0 0 10px 5px #0000000f;box-shadow:0 0 10px 5px #0000000f}verdocs-document-page .verdocs-document-page-layer.img{width:100%}";var VerdocsDocumentPage=function(){function e(e){registerInstance(this,e);this.pageRendered=createEvent(this,"pageRendered",7);this.pageImageUri="";this.pageNumber=1;this.virtualWidth=612;this.virtualHeight=792;this.layers=[{name:"page",type:"canvas"}];this.containerId="verdocs-document-page-".concat(Math.random().toString(36).substring(2,11));this.renderedWidth=this.virtualWidth;this.renderedHeight=this.virtualHeight;this.naturalWidth=this.virtualWidth;this.naturalHeight=this.virtualHeight;this.aspectRatio=this.virtualWidth/this.virtualHeight;this.skipFirstNotification=true}e.prototype.componentDidLoad=function(){var e=this;this.resizeObserver=new ResizeObserver(throttle((function(m){for(var a=0,r=m;a<r.length;a++){var t=r[a];var b=t.contentRect.width;e.renderedWidth=b;e.renderedHeight=e.virtualHeight*(b/e.virtualWidth)}e.notifyRenderedSize()}),100));this.resizeObserver.observe(this.container)};e.prototype.disconnectedCallback=function(){var e;(e=this.resizeObserver)===null||e===void 0?void 0:e.disconnect()};e.prototype.notifyRenderedSize=function(){if(this.skipFirstNotification){this.skipFirstNotification=false;return}this.pageRendered.emit({container:this.container,containerId:this.containerId,pageNumber:this.pageNumber,virtualWidth:this.virtualWidth,virtualHeight:this.virtualHeight,renderedWidth:this.renderedWidth,renderedHeight:this.renderedHeight,naturalWidth:this.naturalWidth,naturalHeight:this.naturalHeight,aspectRatio:this.aspectRatio,xScale:this.renderedWidth/this.virtualWidth,yScale:this.renderedHeight/this.virtualHeight})};e.prototype.render=function(){var e=this;var m="".concat(this.renderedHeight,"px");return h(Host,{id:"".concat(this.containerId),style:{height:m}},this.layers.map((function(a){return a.type==="div"?h("div",{class:"verdocs-document-page-layer",id:"".concat(e.containerId,"-").concat(a.name),style:{height:m}}):h("img",{class:"verdocs-document-page-layer img",id:"".concat(e.containerId,"-").concat(a.name),src:e.pageImageUri,alt:"Page ".concat(e.pageNumber),"aria-hidden":true,onLoad:function(m){e.naturalWidth=m.target.naturalWidth;e.naturalHeight=m.target.naturalHeight;e.aspectRatio=e.naturalWidth/e.naturalHeight;e.virtualHeight=e.virtualWidth/e.aspectRatio}})})))};Object.defineProperty(e.prototype,"container",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();VerdocsDocumentPage.style=verdocsDocumentPageCss;var verdocsLoaderCss="verdocs-loader{display:block;position:absolute;top:50%;left:50%;margin-left:-20px;margin-top:-20px;font-size:24px;width:24px;height:24px;border-radius:50%;text-indent:-9999em;-webkit-animation:load5 1.1s infinite ease;animation:verdocs-loader-kf 1.1s infinite ease;-webkit-transform:translateZ(0);-ms-transform:translateZ(0);transform:translateZ(0)}@-webkit-keyframes verdocs-loader-kf{0%,100%{-webkit-box-shadow:0em -2.6em 0em 0em #aaaaaa, 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.3), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.4);box-shadow:0em -2.6em 0em 0em #aaaaaa, 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.3), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.4)}12.5%{-webkit-box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.4), 1.8em -1.8em 0 0em #aaaaaa, 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.3);box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.4), 1.8em -1.8em 0 0em #aaaaaa, 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.3)}25%{-webkit-box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.3), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.4), 2.5em 0em 0 0em #aaaaaa, 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2);box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.3), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.4), 2.5em 0em 0 0em #aaaaaa, 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2)}37.5%{-webkit-box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.3), 2.5em 0em 0 0em rgba(0, 0, 0, 0.4), 1.75em 1.75em 0 0em #aaaaaa, 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2);box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.3), 2.5em 0em 0 0em rgba(0, 0, 0, 0.4), 1.75em 1.75em 0 0em #aaaaaa, 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2)}50%{-webkit-box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.3), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.4), 0em 2.5em 0 0em #aaaaaa, -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2);box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.3), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.4), 0em 2.5em 0 0em #aaaaaa, -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2)}62.5%{-webkit-box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.3), 0em 2.5em 0 0em rgba(0, 0, 0, 0.4), -1.8em 1.8em 0 0em #aaaaaa, -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2);box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.3), 0em 2.5em 0 0em rgba(0, 0, 0, 0.4), -1.8em 1.8em 0 0em #aaaaaa, -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2)}75%{-webkit-box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.3), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.4), -2.6em 0em 0 0em #aaaaaa, -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2);box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.3), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.4), -2.6em 0em 0 0em #aaaaaa, -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2)}87.5%{-webkit-box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.3), -2.6em 0em 0 0em rgba(0, 0, 0, 0.4), -1.8em -1.8em 0 0em #aaaaaa;box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.3), -2.6em 0em 0 0em rgba(0, 0, 0, 0.4), -1.8em -1.8em 0 0em #aaaaaa}}@keyframes verdocs-loader-kf{0%,100%{-webkit-box-shadow:0em -2.6em 0em 0em #aaaaaa, 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.3), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.4);box-shadow:0em -2.6em 0em 0em #aaaaaa, 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.3), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.4)}12.5%{-webkit-box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.4), 1.8em -1.8em 0 0em #aaaaaa, 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.3);box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.4), 1.8em -1.8em 0 0em #aaaaaa, 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.3)}25%{-webkit-box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.3), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.4), 2.5em 0em 0 0em #aaaaaa, 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2);box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.3), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.4), 2.5em 0em 0 0em #aaaaaa, 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2)}37.5%{-webkit-box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.3), 2.5em 0em 0 0em rgba(0, 0, 0, 0.4), 1.75em 1.75em 0 0em #aaaaaa, 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2);box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.3), 2.5em 0em 0 0em rgba(0, 0, 0, 0.4), 1.75em 1.75em 0 0em #aaaaaa, 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2)}50%{-webkit-box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.3), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.4), 0em 2.5em 0 0em #aaaaaa, -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2);box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.3), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.4), 0em 2.5em 0 0em #aaaaaa, -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2)}62.5%{-webkit-box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.3), 0em 2.5em 0 0em rgba(0, 0, 0, 0.4), -1.8em 1.8em 0 0em #aaaaaa, -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2);box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.3), 0em 2.5em 0 0em rgba(0, 0, 0, 0.4), -1.8em 1.8em 0 0em #aaaaaa, -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2)}75%{-webkit-box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.3), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.4), -2.6em 0em 0 0em #aaaaaa, -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2);box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.3), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.4), -2.6em 0em 0 0em #aaaaaa, -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2)}87.5%{-webkit-box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.3), -2.6em 0em 0 0em rgba(0, 0, 0, 0.4), -1.8em -1.8em 0 0em #aaaaaa;box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.3), -2.6em 0em 0 0em rgba(0, 0, 0, 0.4), -1.8em -1.8em 0 0em #aaaaaa}}";var VerdocsLoader=function(){function e(e){registerInstance(this,e)}e.prototype.render=function(){return h(Host,null)};return e}();VerdocsLoader.style=verdocsLoaderCss;export{VerdocsDocumentPage as verdocs_document_page,VerdocsLoader as verdocs_loader};
|
|
1
|
+
import{r as registerInstance,c as createEvent,h,H as Host,a as getElement}from"./index-f78d163d.js";import{t as throttle}from"./utils-6e8bd73f.js";import"./Token-54690789.js";import"./Files-70a192df.js";var verdocsDocumentPageCss="verdocs-document-page{width:100%;position:relative}verdocs-document-page .verdocs-document-page-layer{position:absolute;top:0;left:0;right:0;bottom:0;-webkit-box-shadow:0 0 10px 5px #0000000f;box-shadow:0 0 10px 5px #0000000f}verdocs-document-page .verdocs-document-page-layer.img{width:100%}";var VerdocsDocumentPage=function(){function e(e){registerInstance(this,e);this.pageRendered=createEvent(this,"pageRendered",7);this.pageImageUri="";this.pageNumber=1;this.virtualWidth=612;this.virtualHeight=792;this.layers=[{name:"page",type:"canvas"}];this.containerId="verdocs-document-page-".concat(Math.random().toString(36).substring(2,11));this.renderedWidth=this.virtualWidth;this.renderedHeight=this.virtualHeight;this.naturalWidth=this.virtualWidth;this.naturalHeight=this.virtualHeight;this.aspectRatio=this.virtualWidth/this.virtualHeight;this.skipFirstNotification=true}e.prototype.componentDidLoad=function(){var e=this;this.resizeObserver=new ResizeObserver(throttle((function(m){for(var a=0,r=m;a<r.length;a++){var t=r[a];var b=t.contentRect.width;e.renderedWidth=b;e.renderedHeight=e.virtualHeight*(b/e.virtualWidth)}e.notifyRenderedSize()}),100));this.resizeObserver.observe(this.container)};e.prototype.disconnectedCallback=function(){var e;(e=this.resizeObserver)===null||e===void 0?void 0:e.disconnect()};e.prototype.notifyRenderedSize=function(){if(this.skipFirstNotification){this.skipFirstNotification=false;return}this.pageRendered.emit({container:this.container,containerId:this.containerId,pageNumber:this.pageNumber,virtualWidth:this.virtualWidth,virtualHeight:this.virtualHeight,renderedWidth:this.renderedWidth,renderedHeight:this.renderedHeight,naturalWidth:this.naturalWidth,naturalHeight:this.naturalHeight,aspectRatio:this.aspectRatio,xScale:this.renderedWidth/this.virtualWidth,yScale:this.renderedHeight/this.virtualHeight})};e.prototype.render=function(){var e=this;var m="".concat(this.renderedHeight,"px");return h(Host,{id:"".concat(this.containerId),style:{height:m}},this.layers.map((function(a){return a.type==="div"?h("div",{class:"verdocs-document-page-layer",id:"".concat(e.containerId,"-").concat(a.name),style:{height:m}}):h("img",{class:"verdocs-document-page-layer img",id:"".concat(e.containerId,"-").concat(a.name),src:e.pageImageUri,alt:"Page ".concat(e.pageNumber),"aria-hidden":true,onLoad:function(m){e.naturalWidth=m.target.naturalWidth;e.naturalHeight=m.target.naturalHeight;e.aspectRatio=e.naturalWidth/e.naturalHeight;e.virtualHeight=e.virtualWidth/e.aspectRatio}})})))};Object.defineProperty(e.prototype,"container",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();VerdocsDocumentPage.style=verdocsDocumentPageCss;var verdocsLoaderCss="verdocs-loader{display:block;position:absolute;top:50%;left:50%;margin-left:-20px;margin-top:-20px;font-size:24px;width:24px;height:24px;border-radius:50%;text-indent:-9999em;-webkit-animation:load5 1.1s infinite ease;animation:verdocs-loader-kf 1.1s infinite ease;-webkit-transform:translateZ(0);-ms-transform:translateZ(0);transform:translateZ(0)}@-webkit-keyframes verdocs-loader-kf{0%,100%{-webkit-box-shadow:0em -2.6em 0em 0em #aaaaaa, 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.3), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.4);box-shadow:0em -2.6em 0em 0em #aaaaaa, 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.3), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.4)}12.5%{-webkit-box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.4), 1.8em -1.8em 0 0em #aaaaaa, 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.3);box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.4), 1.8em -1.8em 0 0em #aaaaaa, 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.3)}25%{-webkit-box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.3), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.4), 2.5em 0em 0 0em #aaaaaa, 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2);box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.3), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.4), 2.5em 0em 0 0em #aaaaaa, 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2)}37.5%{-webkit-box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.3), 2.5em 0em 0 0em rgba(0, 0, 0, 0.4), 1.75em 1.75em 0 0em #aaaaaa, 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2);box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.3), 2.5em 0em 0 0em rgba(0, 0, 0, 0.4), 1.75em 1.75em 0 0em #aaaaaa, 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2)}50%{-webkit-box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.3), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.4), 0em 2.5em 0 0em #aaaaaa, -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2);box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.3), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.4), 0em 2.5em 0 0em #aaaaaa, -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2)}62.5%{-webkit-box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.3), 0em 2.5em 0 0em rgba(0, 0, 0, 0.4), -1.8em 1.8em 0 0em #aaaaaa, -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2);box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.3), 0em 2.5em 0 0em rgba(0, 0, 0, 0.4), -1.8em 1.8em 0 0em #aaaaaa, -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2)}75%{-webkit-box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.3), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.4), -2.6em 0em 0 0em #aaaaaa, -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2);box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.3), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.4), -2.6em 0em 0 0em #aaaaaa, -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2)}87.5%{-webkit-box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.3), -2.6em 0em 0 0em rgba(0, 0, 0, 0.4), -1.8em -1.8em 0 0em #aaaaaa;box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.3), -2.6em 0em 0 0em rgba(0, 0, 0, 0.4), -1.8em -1.8em 0 0em #aaaaaa}}@keyframes verdocs-loader-kf{0%,100%{-webkit-box-shadow:0em -2.6em 0em 0em #aaaaaa, 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.3), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.4);box-shadow:0em -2.6em 0em 0em #aaaaaa, 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.3), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.4)}12.5%{-webkit-box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.4), 1.8em -1.8em 0 0em #aaaaaa, 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.3);box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.4), 1.8em -1.8em 0 0em #aaaaaa, 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.3)}25%{-webkit-box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.3), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.4), 2.5em 0em 0 0em #aaaaaa, 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2);box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.3), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.4), 2.5em 0em 0 0em #aaaaaa, 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2)}37.5%{-webkit-box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.3), 2.5em 0em 0 0em rgba(0, 0, 0, 0.4), 1.75em 1.75em 0 0em #aaaaaa, 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2);box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.3), 2.5em 0em 0 0em rgba(0, 0, 0, 0.4), 1.75em 1.75em 0 0em #aaaaaa, 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2)}50%{-webkit-box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.3), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.4), 0em 2.5em 0 0em #aaaaaa, -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2);box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.3), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.4), 0em 2.5em 0 0em #aaaaaa, -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2)}62.5%{-webkit-box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.3), 0em 2.5em 0 0em rgba(0, 0, 0, 0.4), -1.8em 1.8em 0 0em #aaaaaa, -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2);box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.3), 0em 2.5em 0 0em rgba(0, 0, 0, 0.4), -1.8em 1.8em 0 0em #aaaaaa, -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2)}75%{-webkit-box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.3), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.4), -2.6em 0em 0 0em #aaaaaa, -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2);box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.3), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.4), -2.6em 0em 0 0em #aaaaaa, -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2)}87.5%{-webkit-box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.3), -2.6em 0em 0 0em rgba(0, 0, 0, 0.4), -1.8em -1.8em 0 0em #aaaaaa;box-shadow:0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2), 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.3), -2.6em 0em 0 0em rgba(0, 0, 0, 0.4), -1.8em -1.8em 0 0em #aaaaaa}}";var VerdocsLoader=function(){function e(e){registerInstance(this,e)}e.prototype.render=function(){return h(Host,null)};return e}();VerdocsLoader.style=verdocsLoaderCss;export{VerdocsDocumentPage as verdocs_document_page,VerdocsLoader as verdocs_loader};
|
|
2
2
|
//# sourceMappingURL=verdocs-document-page_2.entry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["src/components/elements/verdocs-document-page/verdocs-document-page.scss?tag=verdocs-document-page","src/components/elements/verdocs-document-page/verdocs-document-page.tsx","src/components/controls/verdocs-loader/verdocs-loader.scss?tag=verdocs-loader","src/components/controls/verdocs-loader/verdocs-loader.tsx"],"names":["verdocsDocumentPageCss","VerdocsDocumentPage","name","type","concat","Math","random","toString","substring","this","virtualWidth","virtualHeight","prototype","componentDidLoad","_this","resizeObserver","ResizeObserver","throttle","entries","_i","entries_1","length","entry","renderedWidth","contentRect","width","renderedHeight","notifyRenderedSize","observe","container","disconnectedCallback","_a","disconnect","skipFirstNotification","pageRendered","emit","containerId","pageNumber","naturalWidth","naturalHeight","aspectRatio","xScale","yScale","render","height","h","Host","id","style","layers","map","layer","class","src","pageImageUri","alt","aria-hid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BAIvCV,EAAAW,UAAA+B,OAAA,WAAA,IAAA7B,EAAAL,KACE,IAAMmC,EAAS,GAAAxC,OAAGK,KAAKiB,eAAc,MAErC,OACEmB,EAACC,KAAI,CAACC,GAAI,GAAA3C,OAAGK,KAAK2B,aAAeY,MAAO,CAACJ,OAAMA,IAC5CnC,KAAKwC,OAAOC,KAAI,SAAAC,GACf,OAAAA,EAAMhD,OAAS,MACb0C,EAAA,MAAA,CAAKO,MAAM,8BAA8BL,GAAI,GAAA3C,OAAGU,EAAKsB,YAAW,KAAAhC,OAAI+C,EAAMjD,MAAQ8C,MAAO,CAACJ,OAAMA,KAEhGC,EAAA,MAAA,CACEO,MAAM,kCACNL,GAAI,GAAA3C,OAAGU,EAAKsB,YAAW,KAAAhC,OAAI+C,EAAMjD,MACjCmD,IAAKvC,EAAKwC,aACVC,IAAK,QAAAnD,OAAQU,EAAKuB,YAAYmB,cACjB,KACbC,OAAQ,SAACC,GAQP5C,EAAKwB,aAAeoB,EAAEC,OAAOrB,aAC7BxB,EAAKyB,cAAgBmB,EAAEC,OAAOpB,cAC9BzB,EAAK0B,YAAc1B,EAAKwB,aAAexB,EAAKyB,cAC5CzB,EAAKH,cAAgBG,EAAKJ,aAAeI,EAAK0B,yJApI9B,oDChBhC,IAAMoB,iBAAmB,gqUCUZC,cAAa,kDACxBA,EAAAjD,UAAA+B,OAAA,WACE,OAAOE,EAACC,KAAI,gBAFU","sourcesContent":["@import '../../../theme.scss';\n\nverdocs-document-page {\n width: 100%;\n position: relative;\n\n .verdocs-document-page-layer {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n box-shadow: 0 0 10px 5px #0000000f;\n\n &.img {\n width: 100%;\n }\n }\n}\n","// NOTE: This component does not have a story because it's not intended for external use.\n\nimport {Component, h, Host, Prop, Event, EventEmitter, State, Element} from '@stencil/core';\nimport {IDocumentPageInfo, IPageLayer} from '../../../utils/Types';\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-document-page',\n styleUrl: 'verdocs-document-page.scss',\n shadow: false,\n})\nexport class VerdocsDocumentPage {\n @Element() container: HTMLElement;\n private resizeObserver: ResizeObserver;\n\n /**\n * The URL of the image to render as the page background.\n */\n @Prop() pageImageUri: string = '';\n\n /**\n * The page number being rendered. Not used internally, but included in callbacks/events beacuse page numbers\n * are used everywhere in document handling. (Reminder: page numbers are 1-based.)\n */\n @Prop() pageNumber: number = 1;\n\n /**\n * The \"virtual\" width of the page canvas. Defaults to 612 which at 72dpi is 8.5\" wide. This is used to compute\n * the aspect ratio of the final rendered element when scaling up/down.\n */\n @Prop() virtualWidth: number = 612;\n\n /**\n * The \"virtual\" height of the page canvas. Defaults to 792 which at 72dpi is 11\" tall. This is used to compute\n * the aspect ratio of the final rendered element when scaling up/down.\n */\n @Prop({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\n @State() renderedWidth: number = this.virtualWidth;\n @State() renderedHeight: number = this.virtualHeight;\n @State() naturalWidth: number = this.virtualWidth;\n @State() naturalHeight: number = this.virtualHeight;\n @State() aspectRatio: number = this.virtualWidth / this.virtualHeight;\n\n @State() skipFirstNotification = true;\n\n componentDidLoad(): void {\n this.resizeObserver = new ResizeObserver(\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 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}}>\n {this.layers.map(layer =>\n layer.type === 'div' ? (\n <div class=\"verdocs-document-page-layer\" id={`${this.containerId}-${layer.name}`} style={{height}} />\n ) : (\n <img\n class=\"verdocs-document-page-layer img\"\n id={`${this.containerId}-${layer.name}`}\n src={this.pageImageUri}\n alt={`Page ${this.pageNumber}`}\n aria-hidden={true}\n onLoad={(e: any) => {\n // 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 }}\n />\n ),\n )}\n </Host>\n );\n }\n}\n","@import '../../../theme.scss';\n\nverdocs-loader {\n display: block;\n position: absolute;\n top: 50%;\n left: 50%;\n margin-left: -20px;\n margin-top: -20px;\n font-size: 24px;\n width: 24px;\n height: 24px;\n border-radius: 50%;\n text-indent: -9999em;\n -webkit-animation: load5 1.1s infinite ease;\n animation: verdocs-loader-kf 1.1s infinite ease;\n -webkit-transform: translateZ(0);\n -ms-transform: translateZ(0);\n transform: translateZ(0);\n}\n\n@keyframes verdocs-loader-kf {\n 0%,\n 100% {\n box-shadow: 0em -2.6em 0em 0em $verdocs-bg-2, 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2),\n 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.3), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.4);\n }\n 12.5% {\n box-shadow: 0em -2.6em 0em 0em rgba(0, 0, 0, 0.4), 1.8em -1.8em 0 0em $verdocs-bg-2, 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2),\n 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.3);\n }\n 25% {\n box-shadow: 0em -2.6em 0em 0em rgba(0, 0, 0, 0.3), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.4), 2.5em 0em 0 0em $verdocs-bg-2, 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2),\n 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2);\n }\n 37.5% {\n box-shadow: 0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.3), 2.5em 0em 0 0em rgba(0, 0, 0, 0.4), 1.75em 1.75em 0 0em $verdocs-bg-2,\n 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2);\n }\n 50% {\n box-shadow: 0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.3), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.4),\n 0em 2.5em 0 0em $verdocs-bg-2, -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2);\n }\n 62.5% {\n box-shadow: 0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.3),\n 0em 2.5em 0 0em rgba(0, 0, 0, 0.4), -1.8em 1.8em 0 0em $verdocs-bg-2, -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2);\n }\n 75% {\n box-shadow: 0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2),\n 0em 2.5em 0 0em rgba(0, 0, 0, 0.3), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.4), -2.6em 0em 0 0em $verdocs-bg-2, -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2);\n }\n 87.5% {\n box-shadow: 0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2),\n 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.3), -2.6em 0em 0 0em rgba(0, 0, 0, 0.4), -1.8em -1.8em 0 0em $verdocs-bg-2;\n }\n}\n","import {Component, h, Host} from '@stencil/core';\n\n/**\n * Animated loader placeholder. There are currently no configuration options for this control.\n */\n@Component({\n tag: 'verdocs-loader',\n styleUrl: 'verdocs-loader.scss',\n shadow: false,\n})\nexport class VerdocsLoader {\n render() {\n return <Host />;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["src/components/elements/verdocs-document-page/verdocs-document-page.scss?tag=verdocs-document-page","src/components/elements/verdocs-document-page/verdocs-document-page.tsx","src/components/controls/verdocs-loader/verdocs-loader.scss?tag=verdocs-loader","src/components/controls/verdocs-loader/verdocs-loader.tsx"],"names":["verdocsDocumentPageCss","VerdocsDocumentPage","name","type","concat","Math","random","toString","substring","this","virtualWidth","virtualHeight","prototype","componentDidLoad","_this","resizeObserver","ResizeObserver","throttle","entries","_i","entries_1","length","entry","renderedWidth","contentRect","width","renderedHeight","notifyRenderedSize","observe","container","disconnectedCallback","_a","disconnect","skipFirstNotification","pageRendered","emit","containerId","pageNumber","naturalWidth","naturalHeight","aspectRatio","xScale","yScale","render","height","h","Host","id","style","layers","map","layer","class","src","pageImageUri","alt","aria-hidden","onLoad","e","target","verdocsLoaderCss","VerdocsLoader"],"mappings":"2MAAA,IAAMA,uBAAyB,2SCgBlBC,oBAAmB,yHAOC,mBAMF,oBAME,uBAMgB,gBAchB,CAAC,CAACC,KAAM,OAAQC,KAAM,4BAO9B,yBAAAC,OAAyBC,KAAKC,SAASC,SAAS,IAAIC,UAAU,EAAG,wBAEvDC,KAAKC,iCACJD,KAAKE,gCACPF,KAAKC,gCACJD,KAAKE,+BACPF,KAAKC,aAAeD,KAAKE,yCAEvB,KAEjCV,EAAAW,UAAAC,iBAAA,WAAA,IAAAC,EAAAL,KACEA,KAAKM,eAAiB,IAAIC,eACxBC,UAAS,SAAAC,GACP,IAAoB,IAAAC,EAAA,EAAAC,EAAAF,EAAAC,EAAAC,EAAAC,OAAAF,IAAS,CAAxB,IAAMG,EAAKF,EAAAD,GACd,IAAMI,EAAgBD,EAAME,YAAYC,MACxCX,EAAKS,cAAgBA,EACrBT,EAAKY,eAAiBZ,EAAKH,eAAiBY,EAAgBT,EAAKJ,cAGnEI,EAAKa,uBACJ,MAGLlB,KAAKM,eAAea,QAAQnB,KAAKoB,YAGnC5B,EAAAW,UAAAkB,qBAAA,kBACEC,EAAAtB,KAAKM,kBAAc,MAAAgB,SAAA,OAAA,EAAAA,EAAEC,cASvB/B,EAAAW,UAAAe,mBAAA,WAGE,GAAIlB,KAAKwB,sBAAuB,CAC9BxB,KAAKwB,sBAAwB,MAC7B,OAGFxB,KAAKyB,aAAaC,KAAK,CACrBN,UAAWpB,KAAKoB,UAChBO,YAAa3B,KAAK2B,YAClBC,WAAY5B,KAAK4B,WACjB3B,aAAcD,KAAKC,aACnBC,cAAeF,KAAKE,cACpBY,cAAed,KAAKc,cACpBG,eAAgBjB,KAAKiB,eACrBY,aAAc7B,KAAK6B,aACnBC,cAAe9B,KAAK8B,cACpBC,YAAa/B,KAAK+B,YAClBC,OAAQhC,KAAKc,cAAgBd,KAAKC,aAClCgC,OAAQjC,KAAKiB,eAAiBjB,KAAKE,iBAIvCV,EAAAW,UAAA+B,OAAA,WAAA,IAAA7B,EAAAL,KACE,IAAMmC,EAAS,GAAAxC,OAAGK,KAAKiB,eAAc,MAErC,OACEmB,EAACC,KAAI,CAACC,GAAI,GAAA3C,OAAGK,KAAK2B,aAAeY,MAAO,CAACJ,OAAMA,IAC5CnC,KAAKwC,OAAOC,KAAI,SAAAC,GACf,OAAAA,EAAMhD,OAAS,MACb0C,EAAA,MAAA,CAAKO,MAAM,8BAA8BL,GAAI,GAAA3C,OAAGU,EAAKsB,YAAW,KAAAhC,OAAI+C,EAAMjD,MAAQ8C,MAAO,CAACJ,OAAMA,KAEhGC,EAAA,MAAA,CACEO,MAAM,kCACNL,GAAI,GAAA3C,OAAGU,EAAKsB,YAAW,KAAAhC,OAAI+C,EAAMjD,MACjCmD,IAAKvC,EAAKwC,aACVC,IAAK,QAAAnD,OAAQU,EAAKuB,YAAYmB,cACjB,KACbC,OAAQ,SAACC,GAQP5C,EAAKwB,aAAeoB,EAAEC,OAAOrB,aAC7BxB,EAAKyB,cAAgBmB,EAAEC,OAAOpB,cAC9BzB,EAAK0B,YAAc1B,EAAKwB,aAAexB,EAAKyB,cAC5CzB,EAAKH,cAAgBG,EAAKJ,aAAeI,EAAK0B,yJApI9B,oDChBhC,IAAMoB,iBAAmB,gqUCUZC,cAAa,kDACxBA,EAAAjD,UAAA+B,OAAA,WACE,OAAOE,EAACC,KAAI,gBAFU","sourcesContent":["@import '../../../theme.scss';\n\nverdocs-document-page {\n width: 100%;\n position: relative;\n\n .verdocs-document-page-layer {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n box-shadow: 0 0 10px 5px #0000000f;\n\n &.img {\n width: 100%;\n }\n }\n}\n","// NOTE: This component does not have a story because it's not intended for external use.\n\nimport {Component, h, Host, Prop, Event, EventEmitter, State, Element} from '@stencil/core';\nimport {IDocumentPageInfo, IPageLayer} from '../../../utils/Types';\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-document-page',\n styleUrl: 'verdocs-document-page.scss',\n shadow: false,\n})\nexport class VerdocsDocumentPage {\n @Element() container: HTMLElement;\n private resizeObserver: ResizeObserver;\n\n /**\n * The URL of the image to render as the page background.\n */\n @Prop() pageImageUri: string = '';\n\n /**\n * The page number being rendered. Not used internally, but included in callbacks/events beacuse page numbers\n * are used everywhere in document handling. (Reminder: page numbers are 1-based.)\n */\n @Prop() pageNumber: number = 1;\n\n /**\n * The \"virtual\" width of the page canvas. Defaults to 612 which at 72dpi is 8.5\" wide. This is used to compute\n * the aspect ratio of the final rendered element when scaling up/down.\n */\n @Prop() virtualWidth: number = 612;\n\n /**\n * The \"virtual\" height of the page canvas. Defaults to 792 which at 72dpi is 11\" tall. This is used to compute\n * the aspect ratio of the final rendered element when scaling up/down.\n */\n @Prop({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\n @State() renderedWidth: number = this.virtualWidth;\n @State() renderedHeight: number = this.virtualHeight;\n @State() naturalWidth: number = this.virtualWidth;\n @State() naturalHeight: number = this.virtualHeight;\n @State() aspectRatio: number = this.virtualWidth / this.virtualHeight;\n\n @State() skipFirstNotification = true;\n\n componentDidLoad(): void {\n this.resizeObserver = new ResizeObserver(\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 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}}>\n {this.layers.map(layer =>\n layer.type === 'div' ? (\n <div class=\"verdocs-document-page-layer\" id={`${this.containerId}-${layer.name}`} style={{height}} />\n ) : (\n <img\n class=\"verdocs-document-page-layer img\"\n id={`${this.containerId}-${layer.name}`}\n src={this.pageImageUri}\n alt={`Page ${this.pageNumber}`}\n aria-hidden={true}\n onLoad={(e: any) => {\n // 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 }}\n />\n ),\n )}\n </Host>\n );\n }\n}\n","@import '../../../theme.scss';\n\nverdocs-loader {\n display: block;\n position: absolute;\n top: 50%;\n left: 50%;\n margin-left: -20px;\n margin-top: -20px;\n font-size: 24px;\n width: 24px;\n height: 24px;\n border-radius: 50%;\n text-indent: -9999em;\n -webkit-animation: load5 1.1s infinite ease;\n animation: verdocs-loader-kf 1.1s infinite ease;\n -webkit-transform: translateZ(0);\n -ms-transform: translateZ(0);\n transform: translateZ(0);\n}\n\n@keyframes verdocs-loader-kf {\n 0%,\n 100% {\n box-shadow: 0em -2.6em 0em 0em $verdocs-bg-2, 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2),\n 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.3), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.4);\n }\n 12.5% {\n box-shadow: 0em -2.6em 0em 0em rgba(0, 0, 0, 0.4), 1.8em -1.8em 0 0em $verdocs-bg-2, 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2),\n 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.3);\n }\n 25% {\n box-shadow: 0em -2.6em 0em 0em rgba(0, 0, 0, 0.3), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.4), 2.5em 0em 0 0em $verdocs-bg-2, 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2),\n 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2);\n }\n 37.5% {\n box-shadow: 0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.3), 2.5em 0em 0 0em rgba(0, 0, 0, 0.4), 1.75em 1.75em 0 0em $verdocs-bg-2,\n 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2);\n }\n 50% {\n box-shadow: 0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.3), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.4),\n 0em 2.5em 0 0em $verdocs-bg-2, -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2);\n }\n 62.5% {\n box-shadow: 0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.3),\n 0em 2.5em 0 0em rgba(0, 0, 0, 0.4), -1.8em 1.8em 0 0em $verdocs-bg-2, -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2);\n }\n 75% {\n box-shadow: 0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2),\n 0em 2.5em 0 0em rgba(0, 0, 0, 0.3), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.4), -2.6em 0em 0 0em $verdocs-bg-2, -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2);\n }\n 87.5% {\n box-shadow: 0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2),\n 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.3), -2.6em 0em 0 0em rgba(0, 0, 0, 0.4), -1.8em -1.8em 0 0em $verdocs-bg-2;\n }\n}\n","import {Component, h, Host} from '@stencil/core';\n\n/**\n * Animated loader placeholder. There are currently no configuration options for this control.\n */\n@Component({\n tag: 'verdocs-loader',\n styleUrl: 'verdocs-loader.scss',\n shadow: false,\n})\nexport class VerdocsLoader {\n render() {\n return <Host />;\n }\n}\n"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var __assign=this&&this.__assign||function(){__assign=Object.assign||function(e){for(var o,t=1,n=arguments.length;t<n;t++){o=arguments[t];for(var r in o)if(Object.prototype.hasOwnProperty.call(o,r))e[r]=o[r]}return e};return __assign.apply(this,arguments)};var __awaiter=this&&this.__awaiter||function(e,o,t,n){function r(e){return e instanceof t?e:new t((function(o){o(e)}))}return new(t||(t=Promise))((function(t,i){function s(e){try{d(n.next(e))}catch(e){i(e)}}function a(e){try{d(n["throw"](e))}catch(e){i(e)}}function d(e){e.done?t(e.value):r(e.value).then(s,a)}d((n=n.apply(e,o||[])).next())}))};var __generator=this&&this.__generator||function(e,o){var t={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,r,i,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(e){return function(o){return d([e,o])}}function d(s){if(n)throw new TypeError("Generator is already executing.");while(t)try{if(n=1,r&&(i=s[0]&2?r["return"]:s[0]?r["throw"]||((i=r["return"])&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;if(r=0,i)s=[s[0]&2,i.value];switch(s[0]){case 0:case 1:i=s;break;case 4:t.label++;return{value:s[1],done:false};case 5:t.label++;r=s[1];s=[0];continue;case 7:s=t.ops.pop();t.trys.pop();continue;default:if(!(i=t.trys,i=i.length>0&&i[i.length-1])&&(s[0]===6||s[0]===2)){t=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){t.label=s[1];break}if(s[0]===6&&t.label<i[1]){t.label=i[1];i=s;break}if(i&&t.label<i[2]){t.label=i[2];t.ops.push(s);break}if(i[2])t.ops.pop();t.trys.pop();continue}s=o.call(e,t)}catch(e){s=[6,e];r=0}finally{n=i=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(e,o,t){if(t||arguments.length===2)for(var n=0,r=o.length,i;n<r;n++){if(i||!(n in o)){if(!i)i=Array.prototype.slice.call(o,0,n);i[n]=o[n]}}return e.concat(i||Array.prototype.slice.call(o))};import{r as registerInstance,c as createEvent,h,H as Host,a as getElement,F as Fragment}from"./index-f78d163d.js";import{c as createPopper}from"./popper-f860750c.js";import"./Types-ab9f6af8.js";import{V as VerdocsEndpoint}from"./VerdocsEndpoint-28ba21cc.js";import{g as getEnvelopeById,s as state}from"./Envelopes-83934981.js";import{S as SDKError}from"./errors-9b5498c8.js";import{s as savePDF}from"./utils-36d44309.js";import"./Token-54690789.js";import"./index-fd7b8a34.js";import"./Templates-0638b1e4.js";var SortDown='<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#50BE80"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M7 10l5 5 5-5H7z"/></svg>\n';var verdocsDropdownCss='verdocs-dropdown{font-family:"Barlow", sans-serif;display:block}verdocs-dropdown .arrow{width:32px;height:26px;background:#fff;cursor:pointer;border-radius:4px;-ms-flex-align:center;align-items:center;display:-ms-inline-flexbox;display:inline-flex;border:1px solid #cccccc;-ms-flex-pack:center;justify-content:center}verdocs-dropdown .arrow svg{fill:#55bc81;-webkit-transition:0.3s;transition:0.3s}verdocs-dropdown .items{width:200px;display:none;z-index:10000;border-radius:5px;background:#33354c;border:1px solid #654dcb}verdocs-dropdown .items[data-show]{display:block}verdocs-dropdown .option{width:100%;color:#fff;border:none;display:block;text-align:left;background:none;padding:10px 20px}verdocs-dropdown .option:hover{cursor:pointer;background:#55bc81}verdocs-dropdown .option[disabled]{color:#aaaaaa}verdocs-dropdown .option[disabled]:hover{color:#aaaaaa;cursor:inherit;background:transparent}verdocs-dropdown.open .items{display:block}verdocs-dropdown.open .arrow{background:#4c56cb;border:1px solid #707ae5}verdocs-dropdown.open .arrow svg{-webkit-transform:scaleY(-1);transform:scaleY(-1);fill:#fff}';var VerdocsDropdown=function(){function e(e){registerInstance(this,e);this.optionSelected=createEvent(this,"optionSelected",7);this.clickListenerSymbol=new AbortController;this.options=[];this.open=undefined}e.prototype.componentDidLoad=function(){this.popper=createPopper(this.dropdownButton,this.dropdownMenu,{placement:"bottom-start",modifiers:[{name:"offset",options:{offset:[0,6]}}]});window.addEventListener("click",this.clickListener.bind(this),{signal:this.clickListenerSymbol.signal})};e.prototype.disconnectedCallback=function(){this.clickListenerSymbol.abort()};e.prototype.clickListener=function(e){var o=!(e.target==this.el||this.el.contains(e.target));if(o){this.hide()}};e.prototype.handleSelectOption=function(e,o){e.stopPropagation();this.optionSelected.emit(o);this.hide()};e.prototype.showDropdown=function(){var e,o;this.dropdownMenu.setAttribute("data-show","");this.dropdownMenu.removeAttribute("aria-hidden");(e=this.popper)===null||e===void 0?void 0:e.setOptions((function(e){return __assign(__assign({},e),{modifiers:__spreadArray(__spreadArray([],e.modifiers,true),[{name:"eventListeners",enabled:true}],false)})})).catch((function(){}));(o=this.popper)===null||o===void 0?void 0:o.update().catch((function(){}))};e.prototype.handleHideDropdown=function(e){var o,t;if(((o=e===null||e===void 0?void 0:e.target)===null||o===void 0?void 0:o.localName)==="button"&&((t=e===null||e===void 0?void 0:e.target)===null||t===void 0?void 0:t.className)==="arrow"){return}this.hide()};e.prototype.toggleDropdown=function(e){e.stopPropagation();if(this.open){this.hide()}else{this.showDropdown()}};e.prototype.hide=function(){var e;this.open=false;this.dropdownMenu.removeAttribute("data-show");this.dropdownMenu.setAttribute("aria-hidden","true");(e=this.popper)===null||e===void 0?void 0:e.setOptions((function(e){return __assign(__assign({},e),{modifiers:__spreadArray(__spreadArray([],e.modifiers,true),[{name:"eventListeners",enabled:false}],false)})})).catch((function(){}))};e.prototype.render=function(){var e=this;var o;return h(Host,{class:{open:!!this.open}},h("button",{class:"arrow",innerHTML:SortDown,"aria-label":"Open Menu",onClick:function(o){return e.toggleDropdown(o)},onBlur:function(o){return e.handleHideDropdown(o)},ref:function(o){return e.dropdownButton=o}}),h("div",{class:"items","aria-hidden":!this.open,ref:function(o){return e.dropdownMenu=o}},(o=this.options)===null||o===void 0?void 0:o.map((function(o){return h("button",{onClick:function(t){return e.handleSelectOption(t,o)},class:"option",disabled:o.disabled},o.label)}))))};Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();VerdocsDropdown.style=verdocsDropdownCss;var verdocsViewCss='verdocs-view{display:-ms-flexbox;display:flex;overflow:hidden;position:relative;min-height:600px;-ms-flex-direction:column;flex-direction:column;-webkit-box-sizing:border-box;box-sizing:border-box;font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-view div,verdocs-view canvas{-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-view .header{-ms-flex:0;flex:0;display:-ms-flexbox;display:flex;z-index:1000;-ms-flex-align:center;align-items:center;-webkit-transition:all 0.25s;transition:all 0.25s;-ms-flex-pack:center;justify-content:center;background-color:#33354c;-webkit-box-shadow:0 4px 4px 0 rgba(0, 0, 0, 0.24), 0 0 4px 0 rgba(0, 0, 0, 0.12);box-shadow:0 4px 4px 0 rgba(0, 0, 0, 0.24), 0 0 4px 0 rgba(0, 0, 0, 0.12)}verdocs-view .header .inner{width:100%;max-width:1028px}verdocs-view .toolbar{width:100%;margin:0 auto;padding:0 14px;position:relative}verdocs-view .tools{width:100%;color:#fff;height:56px;display:-ms-flexbox;display:flex;font-size:12px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;background-color:#33354c}verdocs-view .tools .logo{width:77.5px;margin:-6px 0 0 5px}verdocs-view .tools .title{padding-left:16px;font-size:18px;font-weight:500;text-overflow:ellipsis;white-space:nowrap}verdocs-view .document{-ms-flex:1;flex:1;height:100%;display:-ms-flexbox;display:flex;padding:15px;row-gap:15px;min-height:200px;position:relative;overflow-y:scroll;-ms-flex-align:center;align-items:center;-webkit-box-sizing:border-box;box-sizing:border-box;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center}verdocs-view .document .inner{width:100%;max-width:1028px}';var PrintIcon='<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24"><path d="M19 8H5c-1.66 0-3 1.34-3 3v6h4v4h12v-4h4v-6c0-1.66-1.34-3-3-3zm-3 11H8v-5h8v5zm3-7c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1zm-1-9H6v4h12V3z"></path></svg>';var DownloadIcon='<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24"><path d="M5 20h14v-2H5v2zM19 9h-4V3H9v6H5l7 7 7-7z"></path></svg>';var VerdocsView=function(){function e(e){registerInstance(this,e);this.sdkError=createEvent(this,"sdkError",7);this.endpoint=VerdocsEndpoint.getDefault();this.envelopeId=""}e.prototype.componentWillLoad=function(){this.endpoint.loadSession()};e.prototype.componentDidLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,o,t,n;return __generator(this,(function(r){switch(r.label){case 0:if(!this.envelopeId){console.error("[VIEW] Missing required envelopeId");return[2]}r.label=1;case 1:r.trys.push([1,3,,4]);return[4,getEnvelopeById(this.endpoint,this.envelopeId)];case 2:r.sent();return[3,4];case 3:n=r.sent();(e=this.sdkError)===null||e===void 0?void 0:e.emit(new SDKError(n.message,(o=n.response)===null||o===void 0?void 0:o.status,(t=n.response)===null||t===void 0?void 0:t.data));return[3,4];case 4:return[2]}}))}))};e.prototype.handlePageRendered=function(e){var o=e.detail;console.log("[SIGN] Page rendered",o)};e.prototype.render=function(){var e=this;var o;console.log("[VIEW] Rendering",state.error,state.loading,state.envelope);if(state.loading||!state.envelope){return h(Host,null,h("verdocs-loader",null))}if(state.error){return h(Host,null,h("div",null,state.error))}return h(Host,null,h("div",{class:"header"},h("div",{class:"inner"},h("div",{class:"toolbar"},h("div",{class:"tools"},h(Fragment,null,h("img",{src:"https://verdocs.com/assets/white-logo.svg",alt:"Verdocs Logo",class:"logo"}),h("div",{class:"title"},state.envelope.name),h("div",{style:{flex:"1"}}),h("div",{innerHTML:PrintIcon,style:{width:"24px",height:"24px",fill:"#ffffff",cursor:"pointer"},onClick:function(){return window.print()}}),h("div",{innerHTML:DownloadIcon,style:{width:"24px",height:"24px",fill:"#ffffff",cursor:"pointer",marginLeft:"16px",maginRight:"30px"},onClick:function(){return savePDF(e.endpoint,state.envelope,state.envelope.envelope_document_id).catch((function(){}))}})))))),h("div",{class:"document"},(((o=state.envelope)===null||o===void 0?void 0:o.documents)||[]).map((function(o){var t=__spreadArray([],(o===null||o===void 0?void 0:o.pages)||[],true);t.sort((function(e,o){return e.sequence-o.sequence}));return h(Fragment,null,t.map((function(o){return h("verdocs-document-page",{pageImageUri:o.display_uri,virtualWidth:612,virtualHeight:792,pageNumber:o.sequence,onPageRendered:function(o){return e.handlePageRendered(o)},layers:[{name:"page",type:"canvas"},{name:"controls",type:"div"}]})})))}))))};Object.defineProperty(e.prototype,"component",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();VerdocsView.style=verdocsViewCss;export{VerdocsDropdown as verdocs_dropdown,VerdocsView as verdocs_view};
|
|
1
|
+
var __assign=this&&this.__assign||function(){__assign=Object.assign||function(e){for(var o,t=1,n=arguments.length;t<n;t++){o=arguments[t];for(var r in o)if(Object.prototype.hasOwnProperty.call(o,r))e[r]=o[r]}return e};return __assign.apply(this,arguments)};var __awaiter=this&&this.__awaiter||function(e,o,t,n){function r(e){return e instanceof t?e:new t((function(o){o(e)}))}return new(t||(t=Promise))((function(t,i){function s(e){try{d(n.next(e))}catch(e){i(e)}}function a(e){try{d(n["throw"](e))}catch(e){i(e)}}function d(e){e.done?t(e.value):r(e.value).then(s,a)}d((n=n.apply(e,o||[])).next())}))};var __generator=this&&this.__generator||function(e,o){var t={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,r,i,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(e){return function(o){return d([e,o])}}function d(s){if(n)throw new TypeError("Generator is already executing.");while(t)try{if(n=1,r&&(i=s[0]&2?r["return"]:s[0]?r["throw"]||((i=r["return"])&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;if(r=0,i)s=[s[0]&2,i.value];switch(s[0]){case 0:case 1:i=s;break;case 4:t.label++;return{value:s[1],done:false};case 5:t.label++;r=s[1];s=[0];continue;case 7:s=t.ops.pop();t.trys.pop();continue;default:if(!(i=t.trys,i=i.length>0&&i[i.length-1])&&(s[0]===6||s[0]===2)){t=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){t.label=s[1];break}if(s[0]===6&&t.label<i[1]){t.label=i[1];i=s;break}if(i&&t.label<i[2]){t.label=i[2];t.ops.push(s);break}if(i[2])t.ops.pop();t.trys.pop();continue}s=o.call(e,t)}catch(e){s=[6,e];r=0}finally{n=i=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(e,o,t){if(t||arguments.length===2)for(var n=0,r=o.length,i;n<r;n++){if(i||!(n in o)){if(!i)i=Array.prototype.slice.call(o,0,n);i[n]=o[n]}}return e.concat(i||Array.prototype.slice.call(o))};import{r as registerInstance,c as createEvent,h,H as Host,a as getElement,F as Fragment}from"./index-f78d163d.js";import{c as createPopper}from"./popper-f860750c.js";import"./Types-ab9f6af8.js";import{V as VerdocsEndpoint}from"./VerdocsEndpoint-28ba21cc.js";import{g as getEnvelopeById,s as state}from"./Envelopes-c2545a20.js";import{S as SDKError}from"./errors-9b5498c8.js";import{s as savePDF}from"./utils-6e8bd73f.js";import"./Token-54690789.js";import"./index-fd7b8a34.js";import"./Templates-0638b1e4.js";import"./Files-70a192df.js";var SortDown='<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#50BE80"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M7 10l5 5 5-5H7z"/></svg>\n';var verdocsDropdownCss='verdocs-dropdown{font-family:"Barlow", sans-serif;display:block}verdocs-dropdown .arrow{width:32px;height:26px;background:#fff;cursor:pointer;border-radius:4px;-ms-flex-align:center;align-items:center;display:-ms-inline-flexbox;display:inline-flex;border:1px solid #cccccc;-ms-flex-pack:center;justify-content:center}verdocs-dropdown .arrow svg{fill:#55bc81;-webkit-transition:0.3s;transition:0.3s}verdocs-dropdown .items{width:200px;display:none;z-index:10000;border-radius:5px;background:#33354c;border:1px solid #654dcb}verdocs-dropdown .items[data-show]{display:block}verdocs-dropdown .option{width:100%;color:#fff;border:none;display:block;text-align:left;background:none;padding:10px 20px}verdocs-dropdown .option:hover{cursor:pointer;background:#55bc81}verdocs-dropdown .option[disabled]{color:#aaaaaa}verdocs-dropdown .option[disabled]:hover{color:#aaaaaa;cursor:inherit;background:transparent}verdocs-dropdown.open .items{display:block}verdocs-dropdown.open .arrow{background:#4c56cb;border:1px solid #707ae5}verdocs-dropdown.open .arrow svg{-webkit-transform:scaleY(-1);transform:scaleY(-1);fill:#fff}';var VerdocsDropdown=function(){function e(e){registerInstance(this,e);this.optionSelected=createEvent(this,"optionSelected",7);this.clickListenerSymbol=new AbortController;this.options=[];this.open=undefined}e.prototype.componentDidLoad=function(){this.popper=createPopper(this.dropdownButton,this.dropdownMenu,{placement:"bottom-start",modifiers:[{name:"offset",options:{offset:[0,6]}}]});window.addEventListener("click",this.clickListener.bind(this),{signal:this.clickListenerSymbol.signal})};e.prototype.disconnectedCallback=function(){this.clickListenerSymbol.abort()};e.prototype.clickListener=function(e){var o=!(e.target==this.el||this.el.contains(e.target));if(o){this.hide()}};e.prototype.handleSelectOption=function(e,o){e.stopPropagation();this.optionSelected.emit(o);this.hide()};e.prototype.showDropdown=function(){var e,o;this.dropdownMenu.setAttribute("data-show","");this.dropdownMenu.removeAttribute("aria-hidden");(e=this.popper)===null||e===void 0?void 0:e.setOptions((function(e){return __assign(__assign({},e),{modifiers:__spreadArray(__spreadArray([],e.modifiers,true),[{name:"eventListeners",enabled:true}],false)})})).catch((function(){}));(o=this.popper)===null||o===void 0?void 0:o.update().catch((function(){}))};e.prototype.handleHideDropdown=function(e){var o,t;if(((o=e===null||e===void 0?void 0:e.target)===null||o===void 0?void 0:o.localName)==="button"&&((t=e===null||e===void 0?void 0:e.target)===null||t===void 0?void 0:t.className)==="arrow"){return}this.hide()};e.prototype.toggleDropdown=function(e){e.stopPropagation();if(this.open){this.hide()}else{this.showDropdown()}};e.prototype.hide=function(){var e;this.open=false;this.dropdownMenu.removeAttribute("data-show");this.dropdownMenu.setAttribute("aria-hidden","true");(e=this.popper)===null||e===void 0?void 0:e.setOptions((function(e){return __assign(__assign({},e),{modifiers:__spreadArray(__spreadArray([],e.modifiers,true),[{name:"eventListeners",enabled:false}],false)})})).catch((function(){}))};e.prototype.render=function(){var e=this;var o;return h(Host,{class:{open:!!this.open}},h("button",{class:"arrow",innerHTML:SortDown,"aria-label":"Open Menu",onClick:function(o){return e.toggleDropdown(o)},onBlur:function(o){return e.handleHideDropdown(o)},ref:function(o){return e.dropdownButton=o}}),h("div",{class:"items","aria-hidden":!this.open,ref:function(o){return e.dropdownMenu=o}},(o=this.options)===null||o===void 0?void 0:o.map((function(o){return h("button",{onClick:function(t){return e.handleSelectOption(t,o)},class:"option",disabled:o.disabled},o.label)}))))};Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();VerdocsDropdown.style=verdocsDropdownCss;var verdocsViewCss='verdocs-view{display:-ms-flexbox;display:flex;overflow:hidden;position:relative;min-height:600px;-ms-flex-direction:column;flex-direction:column;-webkit-box-sizing:border-box;box-sizing:border-box;font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-view div,verdocs-view canvas{-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-view .header{-ms-flex:0;flex:0;display:-ms-flexbox;display:flex;z-index:1000;-ms-flex-align:center;align-items:center;-webkit-transition:all 0.25s;transition:all 0.25s;-ms-flex-pack:center;justify-content:center;background-color:#33354c;-webkit-box-shadow:0 4px 4px 0 rgba(0, 0, 0, 0.24), 0 0 4px 0 rgba(0, 0, 0, 0.12);box-shadow:0 4px 4px 0 rgba(0, 0, 0, 0.24), 0 0 4px 0 rgba(0, 0, 0, 0.12)}verdocs-view .header .inner{width:100%;max-width:1028px}verdocs-view .toolbar{width:100%;margin:0 auto;padding:0 14px;position:relative}verdocs-view .tools{width:100%;color:#fff;height:56px;display:-ms-flexbox;display:flex;font-size:12px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;background-color:#33354c}verdocs-view .tools .logo{width:77.5px;margin:-6px 0 0 5px}verdocs-view .tools .title{padding-left:16px;font-size:18px;font-weight:500;text-overflow:ellipsis;white-space:nowrap}verdocs-view .document{-ms-flex:1;flex:1;height:100%;display:-ms-flexbox;display:flex;padding:15px;row-gap:15px;min-height:200px;position:relative;overflow-y:scroll;-ms-flex-align:center;align-items:center;-webkit-box-sizing:border-box;box-sizing:border-box;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center}verdocs-view .document .inner{width:100%;max-width:1028px}';var PrintIcon='<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24"><path d="M19 8H5c-1.66 0-3 1.34-3 3v6h4v4h12v-4h4v-6c0-1.66-1.34-3-3-3zm-3 11H8v-5h8v5zm3-7c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1zm-1-9H6v4h12V3z"></path></svg>';var DownloadIcon='<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24"><path d="M5 20h14v-2H5v2zM19 9h-4V3H9v6H5l7 7 7-7z"></path></svg>';var VerdocsView=function(){function e(e){registerInstance(this,e);this.sdkError=createEvent(this,"sdkError",7);this.endpoint=VerdocsEndpoint.getDefault();this.envelopeId=""}e.prototype.componentWillLoad=function(){this.endpoint.loadSession()};e.prototype.componentDidLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,o,t,n;return __generator(this,(function(r){switch(r.label){case 0:if(!this.envelopeId){console.error("[VIEW] Missing required envelopeId");return[2]}r.label=1;case 1:r.trys.push([1,3,,4]);return[4,getEnvelopeById(this.endpoint,this.envelopeId)];case 2:r.sent();return[3,4];case 3:n=r.sent();(e=this.sdkError)===null||e===void 0?void 0:e.emit(new SDKError(n.message,(o=n.response)===null||o===void 0?void 0:o.status,(t=n.response)===null||t===void 0?void 0:t.data));return[3,4];case 4:return[2]}}))}))};e.prototype.handlePageRendered=function(e){var o=e.detail;console.log("[SIGN] Page rendered",o)};e.prototype.render=function(){var e=this;var o;console.log("[VIEW] Rendering",state.error,state.loading,state.envelope);if(state.loading||!state.envelope){return h(Host,null,h("verdocs-loader",null))}if(state.error){return h(Host,null,h("div",null,state.error))}return h(Host,null,h("div",{class:"header"},h("div",{class:"inner"},h("div",{class:"toolbar"},h("div",{class:"tools"},h(Fragment,null,h("img",{src:"https://verdocs.com/assets/white-logo.svg",alt:"Verdocs Logo",class:"logo"}),h("div",{class:"title"},state.envelope.name),h("div",{style:{flex:"1"}}),h("div",{innerHTML:PrintIcon,style:{width:"24px",height:"24px",fill:"#ffffff",cursor:"pointer"},onClick:function(){return window.print()}}),h("div",{innerHTML:DownloadIcon,style:{width:"24px",height:"24px",fill:"#ffffff",cursor:"pointer",marginLeft:"16px",maginRight:"30px"},onClick:function(){return savePDF(e.endpoint,state.envelope,state.envelope.envelope_document_id).catch((function(){}))}})))))),h("div",{class:"document"},(((o=state.envelope)===null||o===void 0?void 0:o.documents)||[]).map((function(o){var t=__spreadArray([],(o===null||o===void 0?void 0:o.pages)||[],true);t.sort((function(e,o){return e.sequence-o.sequence}));return h(Fragment,null,t.map((function(o){return h("verdocs-document-page",{pageImageUri:o.display_uri,virtualWidth:612,virtualHeight:792,pageNumber:o.sequence,onPageRendered:function(o){return e.handlePageRendered(o)},layers:[{name:"page",type:"canvas"},{name:"controls",type:"div"}]})})))}))))};Object.defineProperty(e.prototype,"component",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();VerdocsView.style=verdocsViewCss;export{VerdocsDropdown as verdocs_dropdown,VerdocsView as verdocs_view};
|
|
2
2
|
//# sourceMappingURL=verdocs-dropdown_2.entry.js.map
|