@verdocs/web-sdk 1.11.2 → 1.11.3
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/{Roles-927719de.js → Roles-9b593b95.js} +1 -1
- package/dist/cjs/TemplateDocuments-6b395b32.js +78 -0
- package/dist/cjs/{Templates-2f2ea153.js → Templates-16615cb0.js} +1 -1
- package/dist/cjs/{VerdocsEndpoint-25056c73.js → VerdocsEndpoint-26bb7607.js} +8 -4
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{templateStore-81ad25a7.js → templateStore-198752d5.js} +1 -0
- package/dist/cjs/verdocs-auth.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-build.cjs.entry.js +3 -3
- package/dist/cjs/verdocs-button-panel_3.cjs.entry.js +3 -3
- package/dist/cjs/verdocs-contact-picker.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-document-page_2.cjs.entry.js +74 -5
- package/dist/cjs/verdocs-envelope-sidebar.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-field-attachment.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-field-checkbox.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-field-date.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-field-dropdown.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-field-initial.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-field-payment.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-field-radio-button.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-field-signature.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-field-textarea.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-field-textbox.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-field-timestamp.cjs.entry.js +1 -1
- package/dist/cjs/{verdocs-floating-menu_2.cjs.entry.js → verdocs-floating-menu_3.cjs.entry.js} +97 -0
- package/dist/cjs/verdocs-loader.cjs.entry.js +19 -0
- package/dist/cjs/verdocs-preview.cjs.entry.js +4 -7
- package/dist/cjs/verdocs-quick-functions_3.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-search.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-send.cjs.entry.js +3 -3
- package/dist/cjs/verdocs-sign.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-template-attachments.cjs.entry.js +3 -3
- package/dist/cjs/verdocs-template-create_2.cjs.entry.js +7 -35
- package/dist/cjs/verdocs-template-name.cjs.entry.js +3 -3
- package/dist/cjs/verdocs-template-properties.cjs.entry.js +2 -2
- package/dist/cjs/verdocs-template-recipients.cjs.entry.js +21 -14
- package/dist/cjs/verdocs-template-reminders.cjs.entry.js +3 -3
- package/dist/cjs/verdocs-template-role-properties_2.cjs.entry.js +4 -4
- package/dist/cjs/verdocs-template-visibility.cjs.entry.js +3 -3
- package/dist/cjs/verdocs-view.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-web-sdk.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/elements/verdocs-template-document-page/verdocs-template-document-page.css +15 -0
- package/dist/collection/components/elements/verdocs-template-document-page/verdocs-template-document-page.js +275 -0
- package/dist/collection/components/embeds/verdocs-preview/verdocs-preview.js +1 -4
- package/dist/collection/components/templates/verdocs-template-create/verdocs-template-create.css +1 -1
- package/dist/collection/components/templates/verdocs-template-fields/verdocs-template-fields.js +1 -1
- package/dist/collection/components/templates/verdocs-template-recipients/verdocs-template-recipients.js +17 -10
- package/dist/collection/components/templates/verdocs-template-recipients/verdocs-template-recipients.stories.js +1 -1
- package/dist/collection/utils/templateStore.js +1 -0
- package/dist/components/TemplateDocuments.js +75 -0
- package/dist/components/VerdocsEndpoint.js +8 -4
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +1 -0
- package/dist/components/templateStore.js +1 -0
- package/dist/components/verdocs-build.js +9 -9
- package/dist/components/verdocs-preview.js +6 -9
- package/dist/components/verdocs-template-create2.js +2 -30
- package/dist/components/verdocs-template-document-page.d.ts +11 -0
- package/dist/components/verdocs-template-document-page.js +6 -0
- package/dist/components/verdocs-template-document-page2.js +126 -0
- package/dist/components/verdocs-template-fields2.js +8 -8
- package/dist/components/verdocs-template-recipients.js +31 -18
- package/dist/components/verdocs-template-role-properties2.js +1 -1
- package/dist/custom-elements.json +1390 -0
- package/dist/docs.json +168 -14
- package/dist/esm/{Roles-2488d047.js → Roles-6eb459df.js} +1 -1
- package/dist/esm/TemplateDocuments-1214b04d.js +75 -0
- package/dist/esm/{Templates-a7530314.js → Templates-2528dad5.js} +1 -1
- package/dist/esm/{VerdocsEndpoint-7f17b088.js → VerdocsEndpoint-d50a8d28.js} +8 -4
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{templateStore-fd4beaae.js → templateStore-a7a5149a.js} +1 -0
- package/dist/esm/verdocs-auth.entry.js +1 -1
- package/dist/esm/verdocs-build.entry.js +3 -3
- package/dist/esm/verdocs-button-panel_3.entry.js +3 -3
- package/dist/esm/verdocs-contact-picker.entry.js +1 -1
- package/dist/esm/verdocs-document-page_2.entry.js +74 -5
- package/dist/esm/verdocs-envelope-sidebar.entry.js +1 -1
- package/dist/esm/verdocs-field-attachment.entry.js +1 -1
- package/dist/esm/verdocs-field-checkbox.entry.js +1 -1
- package/dist/esm/verdocs-field-date.entry.js +1 -1
- package/dist/esm/verdocs-field-dropdown.entry.js +1 -1
- package/dist/esm/verdocs-field-initial.entry.js +1 -1
- package/dist/esm/verdocs-field-payment.entry.js +1 -1
- package/dist/esm/verdocs-field-radio-button.entry.js +1 -1
- package/dist/esm/verdocs-field-signature.entry.js +1 -1
- package/dist/esm/verdocs-field-textarea.entry.js +1 -1
- package/dist/esm/verdocs-field-textbox.entry.js +1 -1
- package/dist/esm/verdocs-field-timestamp.entry.js +1 -1
- package/dist/esm/{verdocs-floating-menu_2.entry.js → verdocs-floating-menu_3.entry.js} +97 -1
- package/dist/esm/verdocs-loader.entry.js +15 -0
- package/dist/esm/verdocs-preview.entry.js +4 -7
- package/dist/esm/verdocs-quick-functions_3.entry.js +1 -1
- package/dist/esm/verdocs-search.entry.js +1 -1
- package/dist/esm/verdocs-send.entry.js +3 -3
- package/dist/esm/verdocs-sign.entry.js +1 -1
- package/dist/esm/verdocs-template-attachments.entry.js +3 -3
- package/dist/esm/verdocs-template-create_2.entry.js +6 -34
- package/dist/esm/verdocs-template-name.entry.js +3 -3
- package/dist/esm/verdocs-template-properties.entry.js +2 -2
- package/dist/esm/verdocs-template-recipients.entry.js +21 -14
- package/dist/esm/verdocs-template-reminders.entry.js +3 -3
- package/dist/esm/verdocs-template-role-properties_2.entry.js +4 -4
- package/dist/esm/verdocs-template-visibility.entry.js +3 -3
- package/dist/esm/verdocs-view.entry.js +1 -1
- package/dist/esm/verdocs-web-sdk.js +1 -1
- package/dist/esm-es5/Roles-6eb459df.js +1 -0
- package/dist/esm-es5/TemplateDocuments-1214b04d.js +1 -0
- package/dist/esm-es5/{Templates-a7530314.js → Templates-2528dad5.js} +1 -1
- package/dist/esm-es5/VerdocsEndpoint-d50a8d28.js +1 -0
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/templateStore-a7a5149a.js +1 -0
- package/dist/esm-es5/verdocs-auth.entry.js +1 -1
- package/dist/esm-es5/verdocs-build.entry.js +1 -1
- package/dist/esm-es5/verdocs-button-panel_3.entry.js +1 -1
- package/dist/esm-es5/verdocs-contact-picker.entry.js +1 -1
- package/dist/esm-es5/verdocs-document-page_2.entry.js +1 -1
- package/dist/esm-es5/verdocs-envelope-sidebar.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-attachment.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-checkbox.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-date.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-dropdown.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-initial.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-payment.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-radio-button.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-signature.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-textarea.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-textbox.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-timestamp.entry.js +1 -1
- package/dist/esm-es5/verdocs-floating-menu_3.entry.js +1 -0
- package/dist/esm-es5/verdocs-loader.entry.js +1 -0
- package/dist/esm-es5/verdocs-preview.entry.js +1 -1
- package/dist/esm-es5/verdocs-quick-functions_3.entry.js +1 -1
- package/dist/esm-es5/verdocs-search.entry.js +1 -1
- package/dist/esm-es5/verdocs-send.entry.js +1 -1
- package/dist/esm-es5/verdocs-sign.entry.js +1 -1
- package/dist/esm-es5/verdocs-template-attachments.entry.js +1 -1
- package/dist/esm-es5/verdocs-template-create_2.entry.js +1 -1
- package/dist/esm-es5/verdocs-template-name.entry.js +1 -1
- package/dist/esm-es5/verdocs-template-properties.entry.js +1 -1
- package/dist/esm-es5/verdocs-template-recipients.entry.js +1 -1
- package/dist/esm-es5/verdocs-template-reminders.entry.js +1 -1
- package/dist/esm-es5/verdocs-template-role-properties_2.entry.js +1 -1
- package/dist/esm-es5/verdocs-template-visibility.entry.js +1 -1
- package/dist/esm-es5/verdocs-view.entry.js +1 -1
- package/dist/esm-es5/verdocs-web-sdk.js +1 -1
- package/dist/types/components/elements/verdocs-template-document-page/verdocs-template-document-page.d.ts +68 -0
- package/dist/types/components/embeds/verdocs-preview/verdocs-preview.d.ts +0 -2
- package/dist/types/components.d.ts +77 -0
- package/dist/verdocs-web-sdk/{p-ec913a97.entry.js → p-0049ecc7.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-0522edd2.system.js +1 -0
- package/dist/verdocs-web-sdk/{p-127a569c.system.entry.js → p-05f3c7bb.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-5a4b4373.entry.js → p-06512901.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-1e710eb7.system.entry.js → p-0aaa85ed.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-0ef66c28.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/{p-ccaa35ac.system.entry.js → p-11967343.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-6c231fe6.system.entry.js → p-1654be9f.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-85336769.system.entry.js → p-18bb4152.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-1c02faba.js +1 -0
- package/dist/verdocs-web-sdk/{p-37a493a6.entry.js → p-1d787be7.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-0fc8ae0a.entry.js → p-27396fa8.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-68eb0ad8.entry.js → p-2c3aecb8.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-bde3d383.system.entry.js → p-3019014e.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-8e5065af.entry.js → p-3379e220.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-36fe1557.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/{p-41122f38.system.entry.js → p-37e93857.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-3d4b187a.js +1 -0
- package/dist/verdocs-web-sdk/{p-cd70bb21.system.entry.js → p-3f01debd.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-4a17efd7.entry.js +1 -0
- package/dist/verdocs-web-sdk/{p-83adc0f7.system.entry.js → p-4c7a531c.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-4e49fb12.js +1 -0
- package/dist/verdocs-web-sdk/p-4e9b66b1.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-4f63fae0.system.js +1 -0
- package/dist/verdocs-web-sdk/{p-5dc58d34.entry.js → p-4fc181bd.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-e079768b.entry.js → p-53261332.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-5fda1fe8.system.entry.js → p-58dda3d1.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-f4f44d6f.system.entry.js → p-5a63da92.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-b537b400.entry.js → p-5d6c8737.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-e53a7969.entry.js → p-64a6448f.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-d5836d39.entry.js → p-66bf5e70.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-ad6cc9f4.js → p-671036fb.js} +1 -1
- package/dist/verdocs-web-sdk/{p-c317702e.system.entry.js → p-673304f6.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-ac3a9c3c.entry.js → p-686608f0.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-4086a15a.entry.js → p-6a736c6a.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-45a4da16.system.js → p-6e3daf5a.system.js} +1 -1
- package/dist/verdocs-web-sdk/{p-0d7db907.system.entry.js → p-72bc8464.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-085d66a2.entry.js → p-741a34fc.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-cf27d3ce.system.entry.js → p-760262f3.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-0e5274d0.system.entry.js → p-7c2ce3ba.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-8027431e.js +1 -0
- package/dist/verdocs-web-sdk/{p-8b20b903.system.entry.js → p-817e6569.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-8229e6df.system.js +1 -0
- package/dist/verdocs-web-sdk/{p-b225dcfb.entry.js → p-823bf074.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-e91b174d.system.entry.js → p-82452c9b.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-70ad917b.entry.js → p-84b3f146.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-79514d21.system.entry.js → p-87e67bc6.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-285eaf3c.system.entry.js → p-8b3cf06c.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-91df3bb9.entry.js +1 -0
- package/dist/verdocs-web-sdk/{p-19d13aca.system.entry.js → p-93e8443f.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-7d8de5d6.system.entry.js → p-93f0d41c.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-95ed895f.entry.js +1 -0
- package/dist/verdocs-web-sdk/{p-0c393c2b.system.entry.js → p-9b7d218c.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-9576a08f.system.entry.js → p-9b9ecf94.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-8644dd0f.system.entry.js → p-9ccdb9a9.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-93b857b6.system.entry.js → p-9f6e7b4a.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-011eedf8.entry.js → p-a4b4ce45.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-e65ec569.system.entry.js → p-bac9ba46.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-c16b6ca4.system.js +1 -1
- package/dist/verdocs-web-sdk/p-c30fa791.entry.js +1 -0
- package/dist/verdocs-web-sdk/{p-cf8522b5.entry.js → p-c37913b6.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-c3922dbb.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/{p-d27a02b5.entry.js → p-c6e0cc16.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-ca0a2a00.entry.js +1 -0
- package/dist/verdocs-web-sdk/{p-d78594bb.entry.js → p-cb4d8942.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-8ff15619.entry.js → p-d1cb1151.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-34db97b7.entry.js → p-dcd59898.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-fc208e71.entry.js → p-deed17c8.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-08270eb7.system.entry.js → p-e29f375d.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-63c55bc3.entry.js → p-e79aabb3.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-e7b7bd2b.entry.js +1 -0
- package/dist/verdocs-web-sdk/{p-af657dd3.entry.js → p-edcd7d44.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-433a7bb3.entry.js → p-f0022cf0.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-42a82518.entry.js → p-f5c1ceb0.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-c08b737c.system.entry.js → p-f6aa16f3.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-5b62f239.system.js → p-f9f0d3b4.system.js} +1 -1
- package/dist/verdocs-web-sdk/{p-1fe9560f.system.entry.js → p-ffdcc57f.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
- package/package.json +3 -3
- package/dist/cjs/verdocs-dropdown.cjs.entry.js +0 -88
- package/dist/esm/verdocs-dropdown.entry.js +0 -84
- package/dist/esm-es5/Roles-2488d047.js +0 -1
- package/dist/esm-es5/VerdocsEndpoint-7f17b088.js +0 -1
- package/dist/esm-es5/templateStore-fd4beaae.js +0 -1
- package/dist/esm-es5/verdocs-dropdown.entry.js +0 -1
- package/dist/esm-es5/verdocs-floating-menu_2.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-1be43032.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-261dcea1.system.js +0 -1
- package/dist/verdocs-web-sdk/p-2d4712ea.js +0 -1
- package/dist/verdocs-web-sdk/p-3cb8a7f4.js +0 -1
- package/dist/verdocs-web-sdk/p-56196fad.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-6c4d28a2.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-6e15a51e.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-76bdb162.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-80d98971.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-b7740fe7.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-c95c8e1f.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-d3e25ad3.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-d946b1b6.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-fbc81799.system.js +0 -1
- package/dist/verdocs-web-sdk/p-ffe60abd.js +0 -1
|
@@ -31,6 +31,7 @@
|
|
|
31
31
|
"./components/elements/verdocs-quick-functions/verdocs-quick-functions.js",
|
|
32
32
|
"./components/elements/verdocs-search-activity/verdocs-search-activity.js",
|
|
33
33
|
"./components/elements/verdocs-search-tabs/verdocs-search-tabs.js",
|
|
34
|
+
"./components/elements/verdocs-template-document-page/verdocs-template-document-page.js",
|
|
34
35
|
"./components/embeds/verdocs-build/verdocs-build.js",
|
|
35
36
|
"./components/embeds/verdocs-preview/verdocs-preview.js",
|
|
36
37
|
"./components/embeds/verdocs-search/verdocs-search.js",
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
verdocs-template-document-page {
|
|
2
|
+
width: 100%;
|
|
3
|
+
position: relative;
|
|
4
|
+
}
|
|
5
|
+
verdocs-template-document-page .verdocs-template-document-page-layer {
|
|
6
|
+
position: absolute;
|
|
7
|
+
top: 0;
|
|
8
|
+
left: 0;
|
|
9
|
+
right: 0;
|
|
10
|
+
bottom: 0;
|
|
11
|
+
box-shadow: 0 0 10px 5px #0000000f;
|
|
12
|
+
}
|
|
13
|
+
verdocs-template-document-page .verdocs-template-document-page-layer.img {
|
|
14
|
+
width: 100%;
|
|
15
|
+
}
|
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
// NOTE: This component does not have a story because it's not intended for external use.
|
|
2
|
+
import { VerdocsEndpoint } from '@verdocs/js-sdk';
|
|
3
|
+
import { h, Host } from '@stencil/core';
|
|
4
|
+
import { getTemplateDocumentPageDisplayUri } from '@verdocs/js-sdk/Templates/TemplateDocuments';
|
|
5
|
+
import { throttle } from '../../../utils/utils';
|
|
6
|
+
/**
|
|
7
|
+
* Represents one document page. This is primarily a layout container used to coordinate positions of
|
|
8
|
+
* page-related layers such as the page itself, signature fields, etc. It is not intended to be used
|
|
9
|
+
* on its own as an individual component.
|
|
10
|
+
*/
|
|
11
|
+
export class VerdocsTemplateDocumentPage {
|
|
12
|
+
constructor() {
|
|
13
|
+
this.endpoint = VerdocsEndpoint.getDefault();
|
|
14
|
+
this.templateId = '';
|
|
15
|
+
this.documentId = '';
|
|
16
|
+
this.pageNumber = 1;
|
|
17
|
+
this.virtualWidth = 612;
|
|
18
|
+
this.virtualHeight = 792;
|
|
19
|
+
this.layers = [{ name: 'page', type: 'canvas' }];
|
|
20
|
+
this.containerId = `verdocs-document-page-${Math.random().toString(36).substring(2, 11)}`;
|
|
21
|
+
this.renderedWidth = this.virtualWidth;
|
|
22
|
+
this.renderedHeight = this.virtualHeight;
|
|
23
|
+
this.naturalWidth = this.virtualWidth;
|
|
24
|
+
this.naturalHeight = this.virtualHeight;
|
|
25
|
+
this.aspectRatio = this.virtualWidth / this.virtualHeight;
|
|
26
|
+
this.skipFirstNotification = true;
|
|
27
|
+
this.pageDisplayUri = '';
|
|
28
|
+
}
|
|
29
|
+
async componentWillLoad() {
|
|
30
|
+
const uri = await getTemplateDocumentPageDisplayUri(this.endpoint, this.templateId, this.documentId, this.pageNumber);
|
|
31
|
+
console.log('pd', uri);
|
|
32
|
+
this.pageDisplayUri = uri;
|
|
33
|
+
}
|
|
34
|
+
componentDidLoad() {
|
|
35
|
+
this.resizeObserver = new ResizeObserver(throttle(entries => {
|
|
36
|
+
for (const entry of entries) {
|
|
37
|
+
const renderedWidth = entry.contentRect.width;
|
|
38
|
+
this.renderedWidth = renderedWidth;
|
|
39
|
+
this.renderedHeight = this.virtualHeight * (renderedWidth / this.virtualWidth);
|
|
40
|
+
}
|
|
41
|
+
this.notifyRenderedSize();
|
|
42
|
+
}, 100));
|
|
43
|
+
this.resizeObserver.observe(this.container);
|
|
44
|
+
}
|
|
45
|
+
disconnectedCallback() {
|
|
46
|
+
var _a;
|
|
47
|
+
(_a = this.resizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
48
|
+
}
|
|
49
|
+
// Left here for documentation purposes in case we find an edge case where this isn't true. But we apparently don't need this.
|
|
50
|
+
// When we add the resize observer it will always be triggered at least once so notifying here as well is just a dupe.
|
|
51
|
+
// componentDidRender() {
|
|
52
|
+
// this.notifyRenderedSize();
|
|
53
|
+
// }
|
|
54
|
+
notifyRenderedSize() {
|
|
55
|
+
// We skip one notification because by default we will always get at least two, one when rendering the initial size
|
|
56
|
+
// and a second once we're able to compute the scale size, when the resizeObserver sets renderedWidth/renderedHeight.
|
|
57
|
+
if (this.skipFirstNotification) {
|
|
58
|
+
this.skipFirstNotification = false;
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
this.pageRendered.emit({
|
|
62
|
+
// container: this.container,
|
|
63
|
+
containerId: this.containerId,
|
|
64
|
+
pageNumber: this.pageNumber,
|
|
65
|
+
virtualWidth: this.virtualWidth,
|
|
66
|
+
virtualHeight: this.virtualHeight,
|
|
67
|
+
renderedWidth: this.renderedWidth,
|
|
68
|
+
renderedHeight: this.renderedHeight,
|
|
69
|
+
naturalWidth: this.naturalWidth,
|
|
70
|
+
naturalHeight: this.naturalHeight,
|
|
71
|
+
aspectRatio: this.aspectRatio,
|
|
72
|
+
xScale: this.renderedWidth / this.virtualWidth,
|
|
73
|
+
yScale: this.renderedHeight / this.virtualHeight,
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
render() {
|
|
77
|
+
const height = `${this.renderedHeight}px`;
|
|
78
|
+
return (h(Host, { id: `${this.containerId}`, style: { height } }, this.layers.map(layer => layer.type === 'div' ? (h("div", { class: "verdocs-template-document-page-layer", id: `${this.containerId}-${layer.name}`, style: { height } })) : this.pageDisplayUri ? (h("img", { class: "verdocs-template-document-page-layer img", id: `${this.containerId}-${layer.name}`, src: this.pageDisplayUri, alt: `Page ${this.pageNumber}`, "aria-hidden": true, onLoad: (e) => {
|
|
79
|
+
// Note that all we really care about is the aspect ratio. We track the natural Width and Height but they aren't really that
|
|
80
|
+
// useful as individual values. The image will already have been scaled down to fit a DIV for display (100%, auto height).
|
|
81
|
+
// Builder places fields offset into the rendered display area, not the original document's dimensions. So its X/Y values
|
|
82
|
+
// for a field are based on the responsive Web view the Template editor was seeing. The IMG was scaled down there in the
|
|
83
|
+
// exact same way, so we just honor it. We capture the natural width and height here more as information. Then we use the
|
|
84
|
+
// aspect ratio to adjust the "virtual" height in case the page is not 8.5"x11".
|
|
85
|
+
// TODO: Store this in the DB with each page.
|
|
86
|
+
this.naturalWidth = e.target.naturalWidth;
|
|
87
|
+
this.naturalHeight = e.target.naturalHeight;
|
|
88
|
+
this.aspectRatio = this.naturalWidth / this.naturalHeight;
|
|
89
|
+
this.virtualHeight = this.virtualWidth / this.aspectRatio;
|
|
90
|
+
} })) : (h("div", null)))));
|
|
91
|
+
}
|
|
92
|
+
static get is() { return "verdocs-template-document-page"; }
|
|
93
|
+
static get originalStyleUrls() {
|
|
94
|
+
return {
|
|
95
|
+
"$": ["verdocs-template-document-page.scss"]
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
static get styleUrls() {
|
|
99
|
+
return {
|
|
100
|
+
"$": ["verdocs-template-document-page.css"]
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
static get properties() {
|
|
104
|
+
return {
|
|
105
|
+
"endpoint": {
|
|
106
|
+
"type": "unknown",
|
|
107
|
+
"mutable": false,
|
|
108
|
+
"complexType": {
|
|
109
|
+
"original": "VerdocsEndpoint",
|
|
110
|
+
"resolved": "VerdocsEndpoint",
|
|
111
|
+
"references": {
|
|
112
|
+
"VerdocsEndpoint": {
|
|
113
|
+
"location": "import",
|
|
114
|
+
"path": "@verdocs/js-sdk"
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
"required": false,
|
|
119
|
+
"optional": false,
|
|
120
|
+
"docs": {
|
|
121
|
+
"tags": [],
|
|
122
|
+
"text": "The endpoint to load from."
|
|
123
|
+
},
|
|
124
|
+
"defaultValue": "VerdocsEndpoint.getDefault()"
|
|
125
|
+
},
|
|
126
|
+
"templateId": {
|
|
127
|
+
"type": "string",
|
|
128
|
+
"mutable": false,
|
|
129
|
+
"complexType": {
|
|
130
|
+
"original": "string",
|
|
131
|
+
"resolved": "string",
|
|
132
|
+
"references": {}
|
|
133
|
+
},
|
|
134
|
+
"required": false,
|
|
135
|
+
"optional": false,
|
|
136
|
+
"docs": {
|
|
137
|
+
"tags": [],
|
|
138
|
+
"text": "The ID of the template the document is for."
|
|
139
|
+
},
|
|
140
|
+
"attribute": "template-id",
|
|
141
|
+
"reflect": false,
|
|
142
|
+
"defaultValue": "''"
|
|
143
|
+
},
|
|
144
|
+
"documentId": {
|
|
145
|
+
"type": "string",
|
|
146
|
+
"mutable": false,
|
|
147
|
+
"complexType": {
|
|
148
|
+
"original": "string",
|
|
149
|
+
"resolved": "string",
|
|
150
|
+
"references": {}
|
|
151
|
+
},
|
|
152
|
+
"required": false,
|
|
153
|
+
"optional": false,
|
|
154
|
+
"docs": {
|
|
155
|
+
"tags": [],
|
|
156
|
+
"text": "The ID of the document to display."
|
|
157
|
+
},
|
|
158
|
+
"attribute": "document-id",
|
|
159
|
+
"reflect": false,
|
|
160
|
+
"defaultValue": "''"
|
|
161
|
+
},
|
|
162
|
+
"pageNumber": {
|
|
163
|
+
"type": "number",
|
|
164
|
+
"mutable": false,
|
|
165
|
+
"complexType": {
|
|
166
|
+
"original": "number",
|
|
167
|
+
"resolved": "number",
|
|
168
|
+
"references": {}
|
|
169
|
+
},
|
|
170
|
+
"required": false,
|
|
171
|
+
"optional": false,
|
|
172
|
+
"docs": {
|
|
173
|
+
"tags": [],
|
|
174
|
+
"text": "The page number being rendered. (Reminder: page numbers are 1-based.)"
|
|
175
|
+
},
|
|
176
|
+
"attribute": "page-number",
|
|
177
|
+
"reflect": false,
|
|
178
|
+
"defaultValue": "1"
|
|
179
|
+
},
|
|
180
|
+
"virtualWidth": {
|
|
181
|
+
"type": "number",
|
|
182
|
+
"mutable": false,
|
|
183
|
+
"complexType": {
|
|
184
|
+
"original": "number",
|
|
185
|
+
"resolved": "number",
|
|
186
|
+
"references": {}
|
|
187
|
+
},
|
|
188
|
+
"required": false,
|
|
189
|
+
"optional": false,
|
|
190
|
+
"docs": {
|
|
191
|
+
"tags": [],
|
|
192
|
+
"text": "The \"virtual\" width of the page canvas. Defaults to 612 which at 72dpi is 8.5\" wide. This is used to compute\nthe aspect ratio of the final rendered element when scaling up/down."
|
|
193
|
+
},
|
|
194
|
+
"attribute": "virtual-width",
|
|
195
|
+
"reflect": false,
|
|
196
|
+
"defaultValue": "612"
|
|
197
|
+
},
|
|
198
|
+
"virtualHeight": {
|
|
199
|
+
"type": "number",
|
|
200
|
+
"mutable": true,
|
|
201
|
+
"complexType": {
|
|
202
|
+
"original": "number",
|
|
203
|
+
"resolved": "number",
|
|
204
|
+
"references": {}
|
|
205
|
+
},
|
|
206
|
+
"required": false,
|
|
207
|
+
"optional": false,
|
|
208
|
+
"docs": {
|
|
209
|
+
"tags": [],
|
|
210
|
+
"text": "The \"virtual\" height of the page canvas. Defaults to 792 which at 72dpi is 11\" tall. This is used to compute\nthe aspect ratio of the final rendered element when scaling up/down."
|
|
211
|
+
},
|
|
212
|
+
"attribute": "virtual-height",
|
|
213
|
+
"reflect": false,
|
|
214
|
+
"defaultValue": "792"
|
|
215
|
+
},
|
|
216
|
+
"layers": {
|
|
217
|
+
"type": "unknown",
|
|
218
|
+
"mutable": false,
|
|
219
|
+
"complexType": {
|
|
220
|
+
"original": "IPageLayer[]",
|
|
221
|
+
"resolved": "IPageLayer[]",
|
|
222
|
+
"references": {
|
|
223
|
+
"IPageLayer": {
|
|
224
|
+
"location": "import",
|
|
225
|
+
"path": "../../../utils/Types"
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
},
|
|
229
|
+
"required": false,
|
|
230
|
+
"optional": false,
|
|
231
|
+
"docs": {
|
|
232
|
+
"tags": [],
|
|
233
|
+
"text": "The layers that will be rendered. The DOM structure will be a DIV container with one child DIV for each layer.\nThe parent DIV will have a unique ID, and each child DIV will have that ID with the layer name appended, e.g.\nif `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```"
|
|
234
|
+
},
|
|
235
|
+
"defaultValue": "[{name: 'page', type: 'canvas'}]"
|
|
236
|
+
}
|
|
237
|
+
};
|
|
238
|
+
}
|
|
239
|
+
static get states() {
|
|
240
|
+
return {
|
|
241
|
+
"containerId": {},
|
|
242
|
+
"renderedWidth": {},
|
|
243
|
+
"renderedHeight": {},
|
|
244
|
+
"naturalWidth": {},
|
|
245
|
+
"naturalHeight": {},
|
|
246
|
+
"aspectRatio": {},
|
|
247
|
+
"skipFirstNotification": {},
|
|
248
|
+
"pageDisplayUri": {}
|
|
249
|
+
};
|
|
250
|
+
}
|
|
251
|
+
static get events() {
|
|
252
|
+
return [{
|
|
253
|
+
"method": "pageRendered",
|
|
254
|
+
"name": "pageRendered",
|
|
255
|
+
"bubbles": true,
|
|
256
|
+
"cancelable": true,
|
|
257
|
+
"composed": true,
|
|
258
|
+
"docs": {
|
|
259
|
+
"tags": [],
|
|
260
|
+
"text": "Fired when a page has been rendered. This is also fired when the page is resized."
|
|
261
|
+
},
|
|
262
|
+
"complexType": {
|
|
263
|
+
"original": "IDocumentPageInfo",
|
|
264
|
+
"resolved": "IDocumentPageInfo",
|
|
265
|
+
"references": {
|
|
266
|
+
"IDocumentPageInfo": {
|
|
267
|
+
"location": "import",
|
|
268
|
+
"path": "../../../utils/Types"
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
}];
|
|
273
|
+
}
|
|
274
|
+
static get elementRef() { return "container"; }
|
|
275
|
+
}
|
|
@@ -32,9 +32,6 @@ export class VerdocsPreview {
|
|
|
32
32
|
(_a = this.sdkError) === null || _a === void 0 ? void 0 : _a.emit(new SDKError(e.message, (_b = e.response) === null || _b === void 0 ? void 0 : _b.status, (_c = e.response) === null || _c === void 0 ? void 0 : _c.data));
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
|
-
async handleFieldChange(field, e, optionId) {
|
|
36
|
-
console.log('[PREVIEW] handleFieldChange', field, e, optionId);
|
|
37
|
-
}
|
|
38
35
|
handlePageRendered(e) {
|
|
39
36
|
const pageInfo = e.detail;
|
|
40
37
|
console.log('[PREVIEW] Page rendered', pageInfo);
|
|
@@ -51,7 +48,7 @@ export class VerdocsPreview {
|
|
|
51
48
|
pages.sort((a, b) => a.sequence - b.sequence);
|
|
52
49
|
return (h(Host, null, pages.map(page => {
|
|
53
50
|
console.log('rendering page', page);
|
|
54
|
-
return (h("verdocs-document-page", {
|
|
51
|
+
return (h("verdocs-template-document-page", { templateId: page.template_id, documentId: page.document_id, pageNumber: page.sequence, virtualWidth: 612, virtualHeight: 792, onPageRendered: e => this.handlePageRendered(e), layers: [
|
|
55
52
|
{ name: 'page', type: 'canvas' },
|
|
56
53
|
{ name: 'controls', type: 'div' },
|
|
57
54
|
] }));
|
package/dist/collection/components/templates/verdocs-template-fields/verdocs-template-fields.js
CHANGED
|
@@ -243,7 +243,7 @@ export class VerdocsTemplateFields {
|
|
|
243
243
|
console.log('onSubmit');
|
|
244
244
|
} }, h("div", { class: "pages" }, pages.map(page => {
|
|
245
245
|
// console.log('rendering page', page);
|
|
246
|
-
return (h("verdocs-document-page", {
|
|
246
|
+
return (h("verdocs-template-document-page", { templateId: page.template_id, documentId: page.document_id, pageNumber: page.sequence, virtualWidth: 612, virtualHeight: 792, onClick: (e) => this.handleClickPage(e, page), onPageRendered: e => this.handlePageRendered(e), layers: [
|
|
247
247
|
{ name: 'page', type: 'canvas' },
|
|
248
248
|
{ name: 'controls', type: 'div' },
|
|
249
249
|
] }));
|
|
@@ -94,6 +94,7 @@ export class VerdocsTemplateRecipients {
|
|
|
94
94
|
interact('.dropzone').dropzone({
|
|
95
95
|
overlap: 0.05,
|
|
96
96
|
ondrop: function handleDrop(event) {
|
|
97
|
+
var _a, _b;
|
|
97
98
|
event.target.classList.remove('active');
|
|
98
99
|
// target will be the recipient e.g. <div class="recipient" data-rolename="Buyer" />
|
|
99
100
|
// relatedTarget will be the drop zone, e.g. <div class="dropzone" data-order="2" data-sequence="1" />
|
|
@@ -107,7 +108,7 @@ export class VerdocsTemplateRecipients {
|
|
|
107
108
|
const roleName = event.relatedTarget.dataset.rolename;
|
|
108
109
|
const targetSequence = +event.target.dataset.sequence;
|
|
109
110
|
const targetOrder = +event.target.dataset.order;
|
|
110
|
-
const changingRole = TemplateStore.template.roles.find(role => role.name === roleName);
|
|
111
|
+
const changingRole = (_a = TemplateStore.template) === null || _a === void 0 ? void 0 : _a.roles.find(role => role.name === roleName);
|
|
111
112
|
if (changingRole) {
|
|
112
113
|
// To handle the renumbering, we update the role being moved to the new values, which will be some half-interval e.g.
|
|
113
114
|
// sequence 1.5 order 1. Then we
|
|
@@ -119,7 +120,7 @@ export class VerdocsTemplateRecipients {
|
|
|
119
120
|
// We have to update ALL the roles to be sure each gets new proper sequence/order numbers assigned.
|
|
120
121
|
// TODO: We could optimize this by tracking "dirty" states and only update the roles that have changed. But it's a LOT more
|
|
121
122
|
// code to do right, and since most workflows will typically only have 2-4 recipients max, it may not be worth it.
|
|
122
|
-
Promise.all(TemplateStore.template.roles.map(role => updateRole(this.endpoint, this.templateId, role.name, {
|
|
123
|
+
Promise.all((_b = TemplateStore.template) === null || _b === void 0 ? void 0 : _b.roles.map(role => updateRole(this.endpoint, this.templateId, role.name, {
|
|
123
124
|
sequence: role.sequence,
|
|
124
125
|
order: role.order,
|
|
125
126
|
})))
|
|
@@ -152,13 +153,15 @@ export class VerdocsTemplateRecipients {
|
|
|
152
153
|
(_a = this.next) === null || _a === void 0 ? void 0 : _a.emit();
|
|
153
154
|
}
|
|
154
155
|
sortTemplateRoles() {
|
|
155
|
-
|
|
156
|
+
var _a;
|
|
157
|
+
(_a = TemplateStore.template) === null || _a === void 0 ? void 0 : _a.roles.sort((a, b) => {
|
|
156
158
|
return a.sequence === b.sequence ? a.order - b.order : a.sequence - b.sequence;
|
|
157
159
|
});
|
|
158
160
|
}
|
|
159
161
|
extractSequenceNumbers() {
|
|
162
|
+
var _a;
|
|
160
163
|
this.sequences = [];
|
|
161
|
-
TemplateStore.template.roles.forEach(role => {
|
|
164
|
+
(_a = TemplateStore.template) === null || _a === void 0 ? void 0 : _a.roles.forEach(role => {
|
|
162
165
|
if (!this.sequences.includes(role.sequence)) {
|
|
163
166
|
this.sequences.push(role.sequence);
|
|
164
167
|
}
|
|
@@ -172,9 +175,8 @@ export class VerdocsTemplateRecipients {
|
|
|
172
175
|
// If the user dragged an entry from below a row to above it, we end up here like [1,0]. Make sure it's [0,1] for the next operation.
|
|
173
176
|
this.sequences.sort((a, b) => a - b);
|
|
174
177
|
this.sequences.forEach((originalSequence, newSequenceIndex) => {
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
.forEach((role, newOrderIndex) => {
|
|
178
|
+
var _a;
|
|
179
|
+
(_a = TemplateStore.template) === null || _a === void 0 ? void 0 : _a.roles.filter(role => role.sequence === originalSequence).forEach((role, newOrderIndex) => {
|
|
178
180
|
if (!renumbered.includes(role.name)) {
|
|
179
181
|
role.sequence = newSequenceIndex + 1;
|
|
180
182
|
role.order = newOrderIndex + 1;
|
|
@@ -187,12 +189,13 @@ export class VerdocsTemplateRecipients {
|
|
|
187
189
|
}
|
|
188
190
|
// Look for name conflicts, because they're UGC and can be anything, regardless of order.
|
|
189
191
|
getNextRecipientName() {
|
|
192
|
+
var _a, _b;
|
|
190
193
|
let name = '';
|
|
191
|
-
let nextNumber = TemplateStore.template.roles.length;
|
|
194
|
+
let nextNumber = (_a = TemplateStore.template) === null || _a === void 0 ? void 0 : _a.roles.length;
|
|
192
195
|
do {
|
|
193
196
|
nextNumber++;
|
|
194
197
|
name = `Recipient ${nextNumber}`;
|
|
195
|
-
} while (!name || TemplateStore.template.roles.some(role => role.name === name));
|
|
198
|
+
} while (!name || ((_b = TemplateStore.template) === null || _b === void 0 ? void 0 : _b.roles.some(role => role.name === name)));
|
|
196
199
|
return name;
|
|
197
200
|
}
|
|
198
201
|
handleAddRole(e, sequence) {
|
|
@@ -253,12 +256,16 @@ export class VerdocsTemplateRecipients {
|
|
|
253
256
|
if (!this.endpoint.session) {
|
|
254
257
|
return (h(Host, null, h("verdocs-component-error", { message: "You must be authenticated to use this module." })));
|
|
255
258
|
}
|
|
259
|
+
if (TemplateStore.loading || !TemplateStore.template) {
|
|
260
|
+
return (h(Host, null, h("verdocs-loader", null)));
|
|
261
|
+
}
|
|
256
262
|
const roleNames = (((_a = TemplateStore.template) === null || _a === void 0 ? void 0 : _a.roles) || []).map(role => role.name);
|
|
263
|
+
console.log('s', this.sequences);
|
|
257
264
|
return (h(Host, null, h("form", { onSubmit: e => e.preventDefault(), onClick: e => e.stopPropagation(), autocomplete: "off", "data-r": this.forceRerender }, h("h5", null, "Roles"), h("div", { class: "participants" }, h("div", { class: "left-line" }), h("div", { class: "row" }, h("div", { class: "icon", innerHTML: startIcon }), h("div", { class: "row-recipients" }, h("div", { class: "sender" }, h("span", { class: "label" }, "Sender:"), " ", senderLabels[TemplateStore.template.sender], ' ', h("div", { class: "settings-button", innerHTML: settingsIcon, onClick: () => (this.showingSenderDialog = true), "aria-role": "button" })))), h("div", { class: "row add-sequence", "data-sequence": 0 }, h("div", { class: "icon", innerHTML: plusIcon }), h("div", { class: "row-recipients" }, h("div", { class: "dropzone", "data-sequence": 0, "data-order": 1 }, "Add Step"))), this.sequences.map(sequence => (h(Fragment, null, h("div", { class: "row" }, h("div", { class: "icon", innerHTML: stepIcon }), h("div", { class: "row-recipients" }, h("div", { class: "dropzone", "data-order": 0.5, "data-sequence": sequence }), TemplateStore.template.roles
|
|
258
265
|
.filter(role => role.sequence === sequence)
|
|
259
266
|
.map(role => {
|
|
260
267
|
return (h(Fragment, null, h("div", { class: "recipient", style: { backgroundColor: getRGBA(getRoleIndex(roleNames, role.name)) }, "data-rolename": role.name }, h("span", { class: "type-icon", innerHTML: role.type === 'signer' ? iconSigner : role.type === 'cc' ? iconCC : iconApprover }), role.name, " ", h("div", { class: "settings-button", innerHTML: settingsIcon, onClick: () => (this.showingRoleDialog = role.name), "aria-role": "button" })), h("div", { class: "dropzone", "data-order": role.order + 0.5, "data-sequence": sequence })));
|
|
261
|
-
}), h("button", { class: "add-role", innerHTML: plusIcon, onClick: e => this.handleAddRole(e, sequence) }))), h("div", { class: "row add-sequence", "data-sequence": sequence }, h("div", { class: "row-recipients" }, h("div", { class: "icon", innerHTML: plusIcon }), h("div", { class: "dropzone", "data-sequence": sequence + 1, "data-order": 1 }, "Add Step")))))), h("div", { class: "row", "data-sequence": this.sequences.length + 1 }, h("div", { class: "row-recipients" }, h("div", { class: "icon", innerHTML: plusIcon }), h("button", { class: "add-step", innerHTML: plusIcon, onClick: e => this.handleAddStep(e, this.sequences.length + 1) }))), this.sequences.length < 1 && (h(Fragment, null, h("div", { class: "row" }, h("div", { class: "icon", innerHTML: stepIcon }), h("div", { class: "row-recipients" }, h("button", { class: "add-role", innerHTML: plusIcon, onClick: e => this.handleAddRole(e, 1) }))))), h("div", { class: "row" }, h("div", { class: "icon", innerHTML: doneIcon }), h("div", { class: "row-recipients" }, h("div", { class: "complete" }, "Document Complete")))), roleNames.length < 1 && (h("div", { class: "empty" }, "You must add at least one Role before proceeding.", h("br", null), " Click the ", h("span", { innerHTML: plusIcon }), " Add button above to get started.")), h("div", { class: "buttons" }, h("div", { class: "flex-fill" }), h("verdocs-button", { variant: "outline", label: "Cancel", size: "small", onClick: e => this.handleCancel(e) }), h("verdocs-button", { label: "OK", size: "small", onClick: e => this.handleSubmit(e), disabled: roleNames.length < 1 }))), this.showingRoleDialog && (h("verdocs-template-role-properties", { endpoint: this.endpoint, templateId: this.templateId, roleName: this.showingRoleDialog, onClose: () => {
|
|
268
|
+
}), h("button", { class: "add-role", innerHTML: plusIcon, onClick: e => this.handleAddRole(e, sequence) }))), this.sequences.length > 0 && (h("div", { class: "row add-sequence", "data-sequence": sequence }, h("div", { class: "row-recipients" }, h("div", { class: "icon", innerHTML: plusIcon }), h("div", { class: "dropzone", "data-sequence": sequence + 1, "data-order": 1 }, "Add Step"))))))), h("div", { class: "row", "data-sequence": this.sequences.length + 1 }, h("div", { class: "row-recipients" }, h("div", { class: "icon", innerHTML: plusIcon }), h("button", { class: "add-step", innerHTML: plusIcon, onClick: e => this.handleAddStep(e, this.sequences.length + 1) }))), this.sequences.length < 1 && (h(Fragment, null, h("div", { class: "row" }, h("div", { class: "icon", innerHTML: stepIcon }), h("div", { class: "row-recipients" }, h("button", { class: "add-role", innerHTML: plusIcon, onClick: e => this.handleAddRole(e, 1) }))))), h("div", { class: "row" }, h("div", { class: "icon", innerHTML: doneIcon }), h("div", { class: "row-recipients" }, h("div", { class: "complete" }, "Document Complete")))), roleNames.length < 1 && (h("div", { class: "empty" }, "You must add at least one Role before proceeding.", h("br", null), " Click the ", h("span", { innerHTML: plusIcon }), " Add button above to get started.")), h("div", { class: "buttons" }, h("div", { class: "flex-fill" }), h("verdocs-button", { variant: "outline", label: "Cancel", size: "small", onClick: e => this.handleCancel(e) }), h("verdocs-button", { label: "OK", size: "small", onClick: e => this.handleSubmit(e), disabled: roleNames.length < 1 }))), this.showingRoleDialog && (h("verdocs-template-role-properties", { endpoint: this.endpoint, templateId: this.templateId, roleName: this.showingRoleDialog, onClose: () => {
|
|
262
269
|
this.showingRoleDialog = null;
|
|
263
270
|
this.forceRerender++;
|
|
264
271
|
}, onDelete: e => {
|
|
@@ -3,8 +3,8 @@ export default {
|
|
|
3
3
|
title: 'Templates/Recipients',
|
|
4
4
|
component: 'verdocs-template-recipients',
|
|
5
5
|
args: {
|
|
6
|
+
// templateId: 'ea7a792f-7e46-4662-a0ff-db6bd389306e',
|
|
6
7
|
templateId: '951016b0-c5ef-450d-b628-9a0c5b84b163',
|
|
7
|
-
// templateId: '056b837f-b183-4039-b50a-d68acbf81b67',
|
|
8
8
|
},
|
|
9
9
|
argTypes: {
|
|
10
10
|
onSave: { action: 'save' },
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A TemplateDocument represents a PDF or other attachment in a Template.
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
6
|
+
var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
7
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
8
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
9
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
10
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
11
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
12
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
13
|
+
});
|
|
14
|
+
};
|
|
15
|
+
var __generator = (undefined && undefined.__generator) || function (thisArg, body) {
|
|
16
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
17
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
18
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
19
|
+
function step(op) {
|
|
20
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
21
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
22
|
+
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;
|
|
23
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
24
|
+
switch (op[0]) {
|
|
25
|
+
case 0: case 1: t = op; break;
|
|
26
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
27
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
28
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
29
|
+
default:
|
|
30
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
31
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
32
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
33
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
34
|
+
if (t[2]) _.ops.pop();
|
|
35
|
+
_.trys.pop(); continue;
|
|
36
|
+
}
|
|
37
|
+
op = body.call(thisArg, _);
|
|
38
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
39
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* Create a Document for a particular Template.
|
|
44
|
+
*
|
|
45
|
+
* ```typescript
|
|
46
|
+
* import {TemplateDocument} from '@verdocs/js-sdk/Templates';
|
|
47
|
+
*
|
|
48
|
+
* await TemplateDocument.createDocument((VerdocsEndpoint.getDefault(), templateID, params);
|
|
49
|
+
* ```
|
|
50
|
+
*/
|
|
51
|
+
var createTemplateDocument = function (endpoint, templateId, file, onUploadProgress) {
|
|
52
|
+
var formData = new FormData();
|
|
53
|
+
formData.append('document', file, file.name);
|
|
54
|
+
return endpoint.api //
|
|
55
|
+
.post("/templates/".concat(templateId, "/documents"), formData, {
|
|
56
|
+
timeout: 60000,
|
|
57
|
+
onUploadProgress: function (event) {
|
|
58
|
+
var total = event.total || 1;
|
|
59
|
+
var loaded = event.loaded || 0;
|
|
60
|
+
onUploadProgress === null || onUploadProgress === void 0 ? void 0 : onUploadProgress(Math.floor((loaded * 100) / (total || 1)), loaded, total || 1);
|
|
61
|
+
},
|
|
62
|
+
})
|
|
63
|
+
.then(function (r) { return r.data; });
|
|
64
|
+
};
|
|
65
|
+
/**
|
|
66
|
+
* Get a display URI for a given page in a file attached to a template document. These pages are rendered server-side
|
|
67
|
+
* into PNG resources suitable for display in IMG tags although they may be used elsewhere. Note that these are
|
|
68
|
+
* intended for DISPLAY ONLY, and do not contain any encoded metadata from participants. The original asset may be
|
|
69
|
+
* obtained by calling `getTemplateDocumentFile()` or similar.
|
|
70
|
+
*/
|
|
71
|
+
var getTemplateDocumentPageDisplayUri = function (endpoint, templateId, documentId, page) { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
72
|
+
return [2 /*return*/, endpoint.api.get("/templates/".concat(templateId, "/documents/").concat(documentId, "/pages/").concat(page, "/image")).then(function (r) { return r.data; })];
|
|
73
|
+
}); }); };
|
|
74
|
+
|
|
75
|
+
export { createTemplateDocument as c, getTemplateDocumentPageDisplayUri as g };
|
|
@@ -1251,7 +1251,7 @@ const transitionalDefaults = {
|
|
|
1251
1251
|
|
|
1252
1252
|
const URLSearchParams$1 = typeof URLSearchParams !== 'undefined' ? URLSearchParams : AxiosURLSearchParams;
|
|
1253
1253
|
|
|
1254
|
-
const FormData$1 = FormData;
|
|
1254
|
+
const FormData$1 = typeof FormData !== 'undefined' ? FormData : null;
|
|
1255
1255
|
|
|
1256
1256
|
/**
|
|
1257
1257
|
* Determine if we're running in a standard browser environment
|
|
@@ -1647,11 +1647,15 @@ function isValidHeaderName(str) {
|
|
|
1647
1647
|
return /^[-_a-zA-Z]+$/.test(str.trim());
|
|
1648
1648
|
}
|
|
1649
1649
|
|
|
1650
|
-
function matchHeaderValue(context, value, header, filter) {
|
|
1650
|
+
function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {
|
|
1651
1651
|
if (utils.isFunction(filter)) {
|
|
1652
1652
|
return filter.call(this, value, header);
|
|
1653
1653
|
}
|
|
1654
1654
|
|
|
1655
|
+
if (isHeaderNameFilter) {
|
|
1656
|
+
value = header;
|
|
1657
|
+
}
|
|
1658
|
+
|
|
1655
1659
|
if (!utils.isString(value)) return;
|
|
1656
1660
|
|
|
1657
1661
|
if (utils.isString(filter)) {
|
|
@@ -1795,7 +1799,7 @@ class AxiosHeaders {
|
|
|
1795
1799
|
|
|
1796
1800
|
while (i--) {
|
|
1797
1801
|
const key = keys[i];
|
|
1798
|
-
if(!matcher || matchHeaderValue(this, this[key], key, matcher)) {
|
|
1802
|
+
if(!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {
|
|
1799
1803
|
delete this[key];
|
|
1800
1804
|
deleted = true;
|
|
1801
1805
|
}
|
|
@@ -2643,7 +2647,7 @@ function mergeConfig(config1, config2) {
|
|
|
2643
2647
|
return config;
|
|
2644
2648
|
}
|
|
2645
2649
|
|
|
2646
|
-
const VERSION = "1.3.
|
|
2650
|
+
const VERSION = "1.3.3";
|
|
2647
2651
|
|
|
2648
2652
|
const validators$1 = {};
|
|
2649
2653
|
|
|
@@ -42,6 +42,7 @@ export { VerdocsStatusIndicator as VerdocsStatusIndicator } from '../types/compo
|
|
|
42
42
|
export { VerdocsTemplateAttachments as VerdocsTemplateAttachments } from '../types/components/templates/verdocs-template-attachments/verdocs-template-attachments';
|
|
43
43
|
export { VerdocsTemplateCard as VerdocsTemplateCard } from '../types/components/controls/verdocs-template-card/verdocs-template-card';
|
|
44
44
|
export { VerdocsTemplateCreate as VerdocsTemplateCreate } from '../types/components/templates/verdocs-template-create/verdocs-template-create';
|
|
45
|
+
export { VerdocsTemplateDocumentPage as VerdocsTemplateDocumentPage } from '../types/components/elements/verdocs-template-document-page/verdocs-template-document-page';
|
|
45
46
|
export { VerdocsTemplateFieldProperties as VerdocsTemplateFieldProperties } from '../types/components/templates/verdocs-template-field-properties/verdocs-template-field-properties';
|
|
46
47
|
export { VerdocsTemplateFields as VerdocsTemplateFields } from '../types/components/templates/verdocs-template-fields/verdocs-template-fields';
|
|
47
48
|
export { VerdocsTemplateName as VerdocsTemplateName } from '../types/components/templates/verdocs-template-name/verdocs-template-name';
|
package/dist/components/index.js
CHANGED
|
@@ -42,6 +42,7 @@ export { VerdocsStatusIndicator, defineCustomElement as defineCustomElementVerdo
|
|
|
42
42
|
export { VerdocsTemplateAttachments, defineCustomElement as defineCustomElementVerdocsTemplateAttachments } from './verdocs-template-attachments.js';
|
|
43
43
|
export { VerdocsTemplateCard, defineCustomElement as defineCustomElementVerdocsTemplateCard } from './verdocs-template-card.js';
|
|
44
44
|
export { VerdocsTemplateCreate, defineCustomElement as defineCustomElementVerdocsTemplateCreate } from './verdocs-template-create.js';
|
|
45
|
+
export { VerdocsTemplateDocumentPage, defineCustomElement as defineCustomElementVerdocsTemplateDocumentPage } from './verdocs-template-document-page.js';
|
|
45
46
|
export { VerdocsTemplateFieldProperties, defineCustomElement as defineCustomElementVerdocsTemplateFieldProperties } from './verdocs-template-field-properties.js';
|
|
46
47
|
export { VerdocsTemplateFields, defineCustomElement as defineCustomElementVerdocsTemplateFields } from './verdocs-template-fields.js';
|
|
47
48
|
export { VerdocsTemplateName, defineCustomElement as defineCustomElementVerdocsTemplateName } from './verdocs-template-name.js';
|