@verdocs/web-sdk 2.2.21 → 2.2.23
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/{TemplateStore-66577b50.js → TemplateStore-a5fa2b0c.js} +1 -1
- package/dist/cjs/{VerdocsEndpoint-a2dc85ad.js → VerdocsEndpoint-45deeb6a.js} +2 -2
- package/dist/cjs/ipc-test.cjs.entry.js +2 -2
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/verdocs-activity-box.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-auth.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-build.cjs.entry.js +24 -77
- package/dist/cjs/verdocs-button-panel_2.cjs.entry.js +2 -2
- package/dist/cjs/verdocs-contact-picker_2.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-dropdown.cjs.entry.js +1 -0
- package/dist/cjs/verdocs-envelope-document-page.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-envelope-recipient-link_2.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-envelope-sidebar.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-envelopes-list.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-file-chooser_2.cjs.entry.js +1 -1
- package/dist/cjs/{verdocs-preview_7.cjs.entry.js → verdocs-preview_8.cjs.entry.js} +96 -2
- 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-settings-api-keys_4.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-settings.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-sign.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-tabs.cjs.entry.js +0 -8
- package/dist/cjs/verdocs-template-document-page_2.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-template-fields_4.cjs.entry.js +11 -5
- package/dist/cjs/verdocs-template-star.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-templates-list.cjs.entry.js +1 -1
- 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/controls/verdocs-dropdown/verdocs-dropdown.js +1 -0
- package/dist/collection/components/controls/verdocs-tabs/verdocs-tabs.js +5 -17
- package/dist/collection/components/embeds/verdocs-build/verdocs-build.js +25 -38
- package/dist/collection/components/templates/verdocs-template-build-tabs/verdocs-template-build-tabs.css +25 -0
- package/dist/collection/components/templates/verdocs-template-build-tabs/verdocs-template-build-tabs.js +219 -0
- package/dist/collection/components/templates/verdocs-template-build-tabs/verdocs-template-build-tabs.stories.js +16 -0
- package/dist/collection/components/templates/verdocs-template-roles/verdocs-template-roles.js +9 -3
- package/dist/components/VerdocsEndpoint.js +1 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +1 -0
- package/dist/components/verdocs-build.js +61 -109
- package/dist/components/verdocs-dropdown2.js +1 -0
- package/dist/components/verdocs-tabs2.js +1 -10
- package/dist/components/verdocs-template-build-tabs.d.ts +11 -0
- package/dist/components/verdocs-template-build-tabs.js +6 -0
- package/dist/components/verdocs-template-build-tabs2.js +132 -0
- package/dist/components/verdocs-template-roles2.js +9 -3
- package/dist/custom-elements.json +37 -3
- package/dist/docs.json +137 -11
- package/dist/esm/{TemplateStore-3c138524.js → TemplateStore-e8cf5a15.js} +1 -1
- package/dist/esm/{VerdocsEndpoint-6fe4258b.js → VerdocsEndpoint-d58d5544.js} +1 -1
- package/dist/esm/ipc-test.entry.js +2 -2
- package/dist/esm/loader.js +1 -1
- package/dist/esm/verdocs-activity-box.entry.js +1 -1
- package/dist/esm/verdocs-auth.entry.js +1 -1
- package/dist/esm/verdocs-build.entry.js +25 -78
- package/dist/esm/verdocs-button-panel_2.entry.js +2 -2
- package/dist/esm/verdocs-contact-picker_2.entry.js +1 -1
- package/dist/esm/verdocs-dropdown.entry.js +1 -0
- package/dist/esm/verdocs-envelope-document-page.entry.js +1 -1
- package/dist/esm/verdocs-envelope-recipient-link_2.entry.js +1 -1
- package/dist/esm/verdocs-envelope-sidebar.entry.js +1 -1
- package/dist/esm/verdocs-envelopes-list.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-file-chooser_2.entry.js +1 -1
- package/dist/esm/{verdocs-preview_7.entry.js → verdocs-preview_8.entry.js} +96 -3
- package/dist/esm/verdocs-quick-functions_3.entry.js +1 -1
- package/dist/esm/verdocs-search.entry.js +1 -1
- package/dist/esm/verdocs-settings-api-keys_4.entry.js +1 -1
- package/dist/esm/verdocs-settings.entry.js +1 -1
- package/dist/esm/verdocs-sign.entry.js +1 -1
- package/dist/esm/verdocs-tabs.entry.js +0 -8
- package/dist/esm/verdocs-template-document-page_2.entry.js +1 -1
- package/dist/esm/verdocs-template-fields_4.entry.js +11 -5
- package/dist/esm/verdocs-template-star.entry.js +1 -1
- package/dist/esm/verdocs-templates-list.entry.js +1 -1
- package/dist/esm/verdocs-view.entry.js +1 -1
- package/dist/esm/verdocs-web-sdk.js +1 -1
- package/dist/esm-es5/{TemplateStore-3c138524.js → TemplateStore-e8cf5a15.js} +1 -1
- package/dist/esm-es5/{VerdocsEndpoint-6fe4258b.js → VerdocsEndpoint-d58d5544.js} +1 -1
- package/dist/esm-es5/ipc-test.entry.js +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/verdocs-activity-box.entry.js +1 -1
- package/dist/esm-es5/verdocs-auth.entry.js +1 -1
- package/dist/esm-es5/verdocs-build.entry.js +1 -1
- package/dist/esm-es5/verdocs-button-panel_2.entry.js +1 -1
- package/dist/esm-es5/verdocs-contact-picker_2.entry.js +1 -1
- package/dist/esm-es5/verdocs-dropdown.entry.js +1 -1
- package/dist/esm-es5/verdocs-envelope-document-page.entry.js +1 -1
- package/dist/esm-es5/verdocs-envelope-recipient-link_2.entry.js +1 -1
- package/dist/esm-es5/verdocs-envelope-sidebar.entry.js +1 -1
- package/dist/esm-es5/verdocs-envelopes-list.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-file-chooser_2.entry.js +1 -1
- package/dist/esm-es5/verdocs-preview_8.entry.js +1 -0
- 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-settings-api-keys_4.entry.js +1 -1
- package/dist/esm-es5/verdocs-settings.entry.js +1 -1
- package/dist/esm-es5/verdocs-sign.entry.js +1 -1
- package/dist/esm-es5/verdocs-tabs.entry.js +1 -1
- package/dist/esm-es5/verdocs-template-document-page_2.entry.js +1 -1
- package/dist/esm-es5/verdocs-template-fields_4.entry.js +1 -1
- package/dist/esm-es5/verdocs-template-star.entry.js +1 -1
- package/dist/esm-es5/verdocs-templates-list.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/controls/verdocs-tabs/verdocs-tabs.d.ts +3 -5
- package/dist/types/components/embeds/verdocs-build/verdocs-build.d.ts +5 -4
- package/dist/types/components/templates/verdocs-template-build-tabs/verdocs-template-build-tabs.d.ts +39 -0
- package/dist/types/components/templates/verdocs-template-build-tabs/verdocs-template-build-tabs.stories.d.ts +8 -0
- package/dist/types/components/templates/verdocs-template-roles/verdocs-template-roles.d.ts +1 -0
- package/dist/types/components.d.ts +56 -6
- package/dist/verdocs-web-sdk/{p-963f6e05.system.entry.js → p-07696831.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-8eb640c4.system.entry.js → p-07b5f356.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-957e1e4e.entry.js → p-0b2102df.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-ec9f11dc.system.entry.js → p-0df9e6e1.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-15df3998.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/{p-724d4efa.system.js → p-1753f57b.system.js} +1 -1
- package/dist/verdocs-web-sdk/p-1dda2d09.entry.js +1 -0
- package/dist/verdocs-web-sdk/{p-7fb8387d.system.entry.js → p-21e137f0.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-1ab8f7f6.system.entry.js → p-2284d430.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-49777798.system.entry.js → p-2549a794.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-353c7ff6.system.entry.js → p-272933c6.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-53fb6c8c.entry.js → p-2b6e4f2a.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-a06f6e8e.entry.js → p-3a90098d.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-4a3f9e45.entry.js → p-3da4fed1.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-3a5d8085.system.entry.js → p-4017b53a.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-f867f61b.entry.js → p-428de4a5.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-6c4de84c.entry.js → p-42f27e8c.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-4422958b.system.js +1 -0
- package/dist/verdocs-web-sdk/{p-71d6e1c3.system.entry.js → p-45bee3f6.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-92e3d974.system.entry.js → p-45d5e035.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-0fa99a06.system.entry.js → p-48c62137.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-79c09ffc.system.entry.js → p-506754d5.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-79410da3.entry.js → p-51979353.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-2cb422a2.entry.js → p-5ab837bf.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-65c99d51.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/{p-96fb90bd.system.entry.js → p-66cec042.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-f732abf1.entry.js → p-6ccb86b6.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-6f1e794d.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-70685224.entry.js +1 -0
- package/dist/verdocs-web-sdk/{p-58c8584e.entry.js → p-77ecee31.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-b3b370b5.entry.js → p-78e4f430.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-6734b77c.entry.js → p-79b0c643.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-c26d3d7b.system.entry.js → p-7bd5db75.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-5ed21587.entry.js → p-84efd562.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-b3706eb2.system.entry.js → p-883d60e1.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-8d14ace0.entry.js +1 -0
- package/dist/verdocs-web-sdk/{p-87c527e4.entry.js → p-9009e136.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-a41a8742.entry.js → p-965b66a8.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-99c8acfa.system.entry.js → p-a0ad315e.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-d56ac75b.entry.js → p-a1e82d5a.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-a8aefe57.system.entry.js → p-a894761f.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-ab7df219.system.entry.js → p-aba05f25.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-c488219f.entry.js → p-ad273610.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-1e48cc2c.system.entry.js → p-ae971bb4.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-53276c5b.js → p-af048fad.js} +1 -1
- package/dist/verdocs-web-sdk/{p-ec06b3d1.entry.js → p-ba04698a.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-55f66c83.entry.js → p-bbd400a5.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-c230e3d1.entry.js +1 -0
- package/dist/verdocs-web-sdk/{p-38031118.system.entry.js → p-cd64b223.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-e36c7481.entry.js → p-d4aec860.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-2c5e2d73.js → p-d4d8858f.js} +1 -1
- package/dist/verdocs-web-sdk/{p-a6d93251.entry.js → p-e40dd4d1.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-f8210aa7.system.entry.js → p-edabba6b.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-f04bf956.system.js +1 -1
- package/dist/verdocs-web-sdk/{p-994623c4.entry.js → p-f2deae25.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-3e20d28c.system.entry.js → p-f9e89b56.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-75435256.system.entry.js → p-fab73ec8.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
- package/package.json +1 -1
- package/dist/esm-es5/verdocs-preview_7.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-08571348.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-3d25b680.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-473f6990.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-65e1ab33.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-686bf682.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-9e15bdda.system.js +0 -1
- package/dist/verdocs-web-sdk/p-b860a7fe.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-d07dcf76.system.entry.js +0 -1
@@ -1,7 +1,7 @@
|
|
1
1
|
import { r as registerInstance, c as createEvent, h } from './index-172625c5.js';
|
2
2
|
import { d as decodeAccessTokenBody } from './Types-5f31149e.js';
|
3
3
|
import { c as createBusinessAccount, i as isOrgAvailable } from './Profiles-4cc942ef.js';
|
4
|
-
import { V as VerdocsEndpoint } from './VerdocsEndpoint-
|
4
|
+
import { V as VerdocsEndpoint } from './VerdocsEndpoint-d58d5544.js';
|
5
5
|
import { V as VerdocsToast } from './Toast-f3b8fd46.js';
|
6
6
|
import { S as SDKError } from './errors-9b5498c8.js';
|
7
7
|
|
@@ -1,51 +1,11 @@
|
|
1
|
-
import { r as registerInstance, c as createEvent, h, H as Host } from './index-172625c5.js';
|
1
|
+
import { r as registerInstance, c as createEvent, f as forceUpdate, h, H as Host, a as getElement } from './index-172625c5.js';
|
2
2
|
import './Types-5f31149e.js';
|
3
|
-
import {
|
4
|
-
import { g as getTemplateStore } from './TemplateStore-
|
3
|
+
import { V as VerdocsEndpoint } from './VerdocsEndpoint-d58d5544.js';
|
4
|
+
import { g as getTemplateStore } from './TemplateStore-e8cf5a15.js';
|
5
5
|
import { S as SDKError } from './errors-9b5498c8.js';
|
6
6
|
import './index-4439b0d1.js';
|
7
7
|
import './Templates-f90883f7.js';
|
8
8
|
|
9
|
-
/**
|
10
|
-
* Confirm whether the user has all of the specified permissions.
|
11
|
-
*/
|
12
|
-
var userHasPermissions = function (session, permissions) {
|
13
|
-
return permissions.every(function (perm) { return ((session === null || session === void 0 ? void 0 : session.permissions) || []).includes(perm); });
|
14
|
-
};
|
15
|
-
|
16
|
-
/**
|
17
|
-
* Various helpers to identify available operations for a template by a user.
|
18
|
-
*
|
19
|
-
* @module
|
20
|
-
*/
|
21
|
-
/**
|
22
|
-
* Check to see if the user created the template.
|
23
|
-
*/
|
24
|
-
var userIsTemplateCreator = function (session, template) {
|
25
|
-
return session && template && session.profile_id === template.profile_id;
|
26
|
-
};
|
27
|
-
/**
|
28
|
-
* Check to see if a template is "shared" with the user.
|
29
|
-
*/
|
30
|
-
var userHasSharedTemplate = function (session, template) {
|
31
|
-
return session && template && !template.is_personal && session.organization_id === template.organization_id;
|
32
|
-
};
|
33
|
-
/**
|
34
|
-
* Check to see if the user can update a tempate.
|
35
|
-
*/
|
36
|
-
var userCanUpdateTemplate = function (session, template) {
|
37
|
-
return userIsTemplateCreator(session, template) ||
|
38
|
-
(userHasSharedTemplate(session, template) &&
|
39
|
-
userHasPermissions(session, [Permissions.TEMPLATE_MEMBER_READ, Permissions.TEMPLATE_MEMBER_WRITE]));
|
40
|
-
};
|
41
|
-
/**
|
42
|
-
* Check to see if the user can "build" the template (use the field builder). The user must have write access to the
|
43
|
-
* template, and the template must have at least one signer role.
|
44
|
-
*/
|
45
|
-
var userCanBuildTemplate = function (session, template) {
|
46
|
-
return userCanUpdateTemplate(session, template) && (template.roles || []).filter(function (role) { return role.type === 'signer'; }).length > 0;
|
47
|
-
};
|
48
|
-
|
49
9
|
const verdocsBuildCss = "verdocs-build{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;font-family:\"Inter\", -apple-system, \"Segoe UI\", \"Roboto\", \"Helvetica Neue\", sans-serif}verdocs-build .content{-ms-flex:1;flex:1;gap:20px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-direction:column;flex-direction:column}verdocs-build verdocs-template-attachments,verdocs-build verdocs-template-roles{margin:20px}verdocs-build verdocs-template-fields{border-top:1px solid #777777}verdocs-build verdocs-template-attachments{padding:20px;background:#ffffff}verdocs-build verdocs-template-fields{width:100%}verdocs-build verdocs-preview{-ms-flex:1;flex:1}";
|
50
10
|
|
51
11
|
const VerdocsBuild = class {
|
@@ -60,11 +20,14 @@ const VerdocsBuild = class {
|
|
60
20
|
this.templateId = null;
|
61
21
|
this.step = 'preview';
|
62
22
|
this.store = null;
|
63
|
-
this.tabsUpdateKey = 1;
|
64
23
|
}
|
65
|
-
onTemplateIdChanged() {
|
66
|
-
console.log('Template ID changed',
|
67
|
-
this.loadTemplate().catch((e) => console.log('Unknown Error', e));
|
24
|
+
onTemplateIdChanged(newTemplateId) {
|
25
|
+
console.log('Template ID changed', newTemplateId);
|
26
|
+
this.loadTemplate(newTemplateId).catch((e) => console.log('Unknown Error', e));
|
27
|
+
}
|
28
|
+
onStepChanged(newStep) {
|
29
|
+
console.log('Step changed', newStep);
|
30
|
+
this.loadTemplate(this.templateId).catch((e) => console.log('Unknown Error', e));
|
68
31
|
}
|
69
32
|
async componentWillLoad() {
|
70
33
|
var _a, _b, _c;
|
@@ -79,16 +42,18 @@ const VerdocsBuild = class {
|
|
79
42
|
console.log('[BUILD] Unable to start builder session, must be authenticated');
|
80
43
|
return;
|
81
44
|
}
|
82
|
-
this.loadTemplate().catch(e => console.log('[BUILD] Unable to load template', e));
|
45
|
+
this.loadTemplate(this.templateId).catch(e => console.log('[BUILD] Unable to load template', e));
|
83
46
|
}
|
84
47
|
catch (e) {
|
85
48
|
console.log('[BUILD] Error loading template', e);
|
86
49
|
(_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));
|
87
50
|
}
|
88
51
|
}
|
89
|
-
async loadTemplate() {
|
90
|
-
if (
|
91
|
-
|
52
|
+
async loadTemplate(templateId) {
|
53
|
+
if (templateId) {
|
54
|
+
console.log('Loading store', templateId);
|
55
|
+
this.store = await getTemplateStore(this.endpoint, templateId, true);
|
56
|
+
forceUpdate(this.el);
|
92
57
|
}
|
93
58
|
}
|
94
59
|
handleCancel(e) {
|
@@ -97,8 +62,8 @@ const VerdocsBuild = class {
|
|
97
62
|
}
|
98
63
|
async handleTemplateCreated(templateId) {
|
99
64
|
var _a;
|
65
|
+
await this.loadTemplate(templateId);
|
100
66
|
this.templateId = templateId;
|
101
|
-
await this.loadTemplate();
|
102
67
|
this.step = 'roles';
|
103
68
|
(_a = this.stepChanged) === null || _a === void 0 ? void 0 : _a.emit('roles');
|
104
69
|
}
|
@@ -106,7 +71,6 @@ const VerdocsBuild = class {
|
|
106
71
|
var _a;
|
107
72
|
console.log('tup');
|
108
73
|
(_a = this.templateUpdated) === null || _a === void 0 ? void 0 : _a.emit(e.detail);
|
109
|
-
this.tabsUpdateKey++;
|
110
74
|
}
|
111
75
|
handleAttachmentsNext() {
|
112
76
|
var _a;
|
@@ -118,44 +82,27 @@ const VerdocsBuild = class {
|
|
118
82
|
this.step = 'fields';
|
119
83
|
(_a = this.stepChanged) === null || _a === void 0 ? void 0 : _a.emit('fields');
|
120
84
|
}
|
121
|
-
|
85
|
+
handleStepChanged(step) {
|
122
86
|
var _a;
|
123
|
-
|
124
|
-
e.preventDefault();
|
87
|
+
console.log('osc', step);
|
125
88
|
this.step = step;
|
126
89
|
(_a = this.stepChanged) === null || _a === void 0 ? void 0 : _a.emit(step);
|
127
90
|
}
|
128
91
|
render() {
|
129
|
-
var _a, _b, _c;
|
130
92
|
if (!this.endpoint.session) {
|
131
93
|
return (h(Host, null, h("verdocs-component-error", { message: "You must be authenticated to use this module." })));
|
132
94
|
}
|
133
|
-
if (!this.
|
95
|
+
if (!this.store) {
|
134
96
|
console.log('[BUILD] No template ID, rendering created view');
|
135
|
-
return (h(Host, null, h("div", { class: "content" }, h("verdocs-tabs", {
|
136
|
-
{ id: 'attachments', disabled: false, label: 'Upload Attachment(s)' },
|
137
|
-
{ id: 'roles', disabled: true, label: 'Roles' },
|
138
|
-
{ id: 'settings', disabled: true, label: 'Settings' },
|
139
|
-
{ id: 'fields', disabled: true, label: 'Fields' },
|
140
|
-
{ id: 'preview', disabled: true, label: 'Preview/Send' },
|
141
|
-
] }), h("verdocs-template-create", { endpoint: this.endpoint, onExit: e => this.handleCancel(e), onNext: () => this.handleAttachmentsNext(), onTemplateCreated: e => this.handleTemplateCreated(e.detail.templateId) }))));
|
97
|
+
return (h(Host, null, h("div", { class: "content" }, h("verdocs-template-build-tabs", { endpoint: this.endpoint, templateId: this.templateId, step: "attachments", onSdkError: e => { var _a; return (_a = this.sdkError) === null || _a === void 0 ? void 0 : _a.emit(e.detail); }, onStepChanged: e => this.handleStepChanged(e.detail) }), h("verdocs-template-create", { endpoint: this.endpoint, onExit: e => this.handleCancel(e), onNext: () => this.handleAttachmentsNext(), onTemplateCreated: e => this.handleTemplateCreated(e.detail.templateId) }))));
|
142
98
|
}
|
143
99
|
console.log('[BUILD] Rendering build view', this.step, ['attachments', 'roles', 'settings', 'fields', 'preview'].indexOf(this.step));
|
144
|
-
|
145
|
-
// TODO: Had to disable this for now to research why reactivity isn't re-rendering the tabs
|
146
|
-
const canPreview = this.store && userCanBuildTemplate(this.endpoint.session, (_a = this.store) === null || _a === void 0 ? void 0 : _a.state);
|
147
|
-
const canEditFields = this.store && userCanBuildTemplate(this.endpoint.session, (_b = this.store) === null || _b === void 0 ? void 0 : _b.state);
|
148
|
-
const canEditRoles = this.store && userCanUpdateTemplate(this.endpoint.session, (_c = this.store) === null || _c === void 0 ? void 0 : _c.state);
|
149
|
-
return (h(Host, null, h("div", { class: "content" }, h("verdocs-tabs", { key: this.tabsUpdateKey, onSelectTab: e => this.setStep(e, e.detail.tab.id), defaultTab: ['attachments', 'roles', 'settings', 'fields', 'preview'].indexOf(this.step), tabs: [
|
150
|
-
{ id: 'attachments', disabled: false, label: 'Attachment(s)' },
|
151
|
-
{ id: 'roles', disabled: !canEditRoles, label: 'Roles' },
|
152
|
-
{ id: 'settings', disabled: !canEditFields, label: 'Settings' },
|
153
|
-
{ id: 'fields', disabled: !canEditFields, label: 'Fields' },
|
154
|
-
{ id: 'preview', disabled: !canPreview, label: 'Preview/Send' },
|
155
|
-
] }), this.step === 'attachments' && (h("verdocs-template-attachments", { templateId: this.templateId, endpoint: this.endpoint, onExit: e => this.handleCancel(e), onNext: () => this.handleAttachmentsNext(), onTemplateUpdated: e => this.handleTemplateUpdated(e) })), this.step === 'roles' && (h("verdocs-template-roles", { templateId: this.templateId, endpoint: this.endpoint, onExit: e => this.handleCancel(e), onNext: () => this.handleRolesNext(), onTemplateUpdated: e => this.handleTemplateUpdated(e) })), this.step === 'settings' && (h("div", { style: { flexDirection: 'column', gap: '20px', display: 'flex', maxWidth: '400px', margin: '20px' } }, h("verdocs-template-name", { templateId: this.templateId, endpoint: this.endpoint, style: { backgroundColor: '#ffffff', padding: '20px' }, onTemplateUpdated: e => this.handleTemplateUpdated(e) }), h("verdocs-template-reminders", { templateId: this.templateId, endpoint: this.endpoint, style: { backgroundColor: '#ffffff', padding: '20px' }, onTemplateUpdated: e => this.handleTemplateUpdated(e) }), h("verdocs-template-visibility", { templateId: this.templateId, endpoint: this.endpoint, style: { backgroundColor: '#ffffff', padding: '20px' }, onTemplateUpdated: e => this.handleTemplateUpdated(e) }))), this.step === 'fields' && h("verdocs-template-fields", { templateId: this.templateId, endpoint: this.endpoint, onTemplateUpdated: e => this.handleTemplateUpdated(e) }), this.step === 'preview' && (h("div", { style: { flexDirection: 'row', display: 'flex', width: '100%', backgroundColor: '#eeeeee', maxHeight: '100%' } }, h("div", { style: { display: 'flex', flex: '0 0 300px', backgroundColor: '#ffffff', boxShadow: '1px 1px 6px -2px #0000007f' } }, h("verdocs-send", { templateId: this.templateId, endpoint: this.endpoint, onSend: e => { var _a; return (_a = this.send) === null || _a === void 0 ? void 0 : _a.emit(e.detail); }, style: { width: '100%' } })), h("div", { style: { display: 'flex', flex: '1', justifyContent: 'center', overflowY: 'scroll' } }, h("verdocs-preview", { templateId: this.templateId, endpoint: this.endpoint, style: { display: 'flex', flex: '1', maxWidth: '1000px' } })))))));
|
100
|
+
return (h(Host, null, h("div", { class: "content" }, h("verdocs-template-build-tabs", { endpoint: this.endpoint, templateId: this.templateId, step: this.step, onSdkError: e => { var _a; return (_a = this.sdkError) === null || _a === void 0 ? void 0 : _a.emit(e.detail); }, onStepChanged: e => this.handleStepChanged(e.detail) }), this.step === 'attachments' && (h("verdocs-template-attachments", { templateId: this.templateId, endpoint: this.endpoint, onExit: e => this.handleCancel(e), onNext: () => this.handleAttachmentsNext(), onTemplateUpdated: e => this.handleTemplateUpdated(e) })), this.step === 'roles' && (h("verdocs-template-roles", { templateId: this.templateId, endpoint: this.endpoint, onExit: e => this.handleCancel(e), onNext: () => this.handleRolesNext(), onTemplateUpdated: e => this.handleTemplateUpdated(e) })), this.step === 'settings' && (h("div", { style: { flexDirection: 'column', gap: '20px', display: 'flex', maxWidth: '400px', margin: '20px' } }, h("verdocs-template-name", { templateId: this.templateId, endpoint: this.endpoint, style: { backgroundColor: '#ffffff', padding: '20px' }, onTemplateUpdated: e => this.handleTemplateUpdated(e) }), h("verdocs-template-reminders", { templateId: this.templateId, endpoint: this.endpoint, style: { backgroundColor: '#ffffff', padding: '20px' }, onTemplateUpdated: e => this.handleTemplateUpdated(e) }), h("verdocs-template-visibility", { templateId: this.templateId, endpoint: this.endpoint, style: { backgroundColor: '#ffffff', padding: '20px' }, onTemplateUpdated: e => this.handleTemplateUpdated(e) }))), this.step === 'fields' && h("verdocs-template-fields", { templateId: this.templateId, endpoint: this.endpoint, onTemplateUpdated: e => this.handleTemplateUpdated(e) }), this.step === 'preview' && (h("div", { style: { flexDirection: 'row', display: 'flex', width: '100%', backgroundColor: '#eeeeee', maxHeight: '100%' } }, h("div", { style: { display: 'flex', flex: '0 0 300px', backgroundColor: '#ffffff', boxShadow: '1px 1px 6px -2px #0000007f' } }, h("verdocs-send", { templateId: this.templateId, endpoint: this.endpoint, onSend: e => { var _a; return (_a = this.send) === null || _a === void 0 ? void 0 : _a.emit(e.detail); }, style: { width: '100%' } })), h("div", { style: { display: 'flex', flex: '1', justifyContent: 'center', overflowY: 'scroll' } }, h("verdocs-preview", { templateId: this.templateId, endpoint: this.endpoint, style: { display: 'flex', flex: '1', maxWidth: '1000px' } })))))));
|
156
101
|
}
|
102
|
+
get el() { return getElement(this); }
|
157
103
|
static get watchers() { return {
|
158
|
-
"templateId": ["onTemplateIdChanged"]
|
104
|
+
"templateId": ["onTemplateIdChanged"],
|
105
|
+
"step": ["onStepChanged"]
|
159
106
|
}; }
|
160
107
|
};
|
161
108
|
VerdocsBuild.style = verdocsBuildCss;
|
@@ -2,9 +2,9 @@ import { r as registerInstance, h, H as Host, c as createEvent, a as getElement
|
|
2
2
|
import { c as createPopper } from './popper-15e448b4.js';
|
3
3
|
import { a as commonjsGlobal } from './_commonjsHelpers-5ec8f9b7.js';
|
4
4
|
import './Types-5f31149e.js';
|
5
|
-
import { V as VerdocsEndpoint } from './VerdocsEndpoint-
|
5
|
+
import { V as VerdocsEndpoint } from './VerdocsEndpoint-d58d5544.js';
|
6
6
|
import { u as updateField, d as deleteField } from './Fields-c82e6df3.js';
|
7
|
-
import { g as getTemplateStore } from './TemplateStore-
|
7
|
+
import { g as getTemplateStore } from './TemplateStore-e8cf5a15.js';
|
8
8
|
import { S as SDKError } from './errors-9b5498c8.js';
|
9
9
|
import './index-4439b0d1.js';
|
10
10
|
import './Templates-f90883f7.js';
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host } from './index-172625c5.js';
|
2
2
|
import './Types-5f31149e.js';
|
3
|
-
import { V as VerdocsEndpoint } from './VerdocsEndpoint-
|
3
|
+
import { V as VerdocsEndpoint } from './VerdocsEndpoint-d58d5544.js';
|
4
4
|
import { d as convertToE164 } from './utils-c0cd0b91.js';
|
5
5
|
import './_commonjsHelpers-5ec8f9b7.js';
|
6
6
|
import './Envelopes-5e32159f.js';
|
@@ -43,6 +43,7 @@ const VerdocsDropdown = class {
|
|
43
43
|
const bodyWidth = document.body.scrollWidth;
|
44
44
|
const buttonRect = (_a = this.dropdownButton) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
|
45
45
|
const triggerHeight = ((_b = this.dropdownButton) === null || _b === void 0 ? void 0 : _b.offsetWidth) || 28;
|
46
|
+
console.log('Repositioning dropdown', { bodyWidth, buttonRect, triggerHeight }, menu);
|
46
47
|
menu.style.top = `${((buttonRect === null || buttonRect === void 0 ? void 0 : buttonRect.top) || 0) + triggerHeight}px`;
|
47
48
|
menu.style.right = `${Math.max(0, bodyWidth - ((buttonRect === null || buttonRect === void 0 ? void 0 : buttonRect.right) || 0))}px`;
|
48
49
|
}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host, a as getElement } from './index-172625c5.js';
|
2
2
|
import { j as getEnvelopeDocumentPageDisplayUri } from './Envelopes-5e32159f.js';
|
3
3
|
import './Types-5f31149e.js';
|
4
|
-
import { V as VerdocsEndpoint } from './VerdocsEndpoint-
|
4
|
+
import { V as VerdocsEndpoint } from './VerdocsEndpoint-d58d5544.js';
|
5
5
|
import { t as throttle } from './utils-c0cd0b91.js';
|
6
6
|
import './_commonjsHelpers-5ec8f9b7.js';
|
7
7
|
import './Files-70a192df.js';
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host } from './index-172625c5.js';
|
2
2
|
import './Types-5f31149e.js';
|
3
3
|
import { g as getInPersonLink } from './Recipients-4ec2138c.js';
|
4
|
-
import { V as VerdocsEndpoint } from './VerdocsEndpoint-
|
4
|
+
import { V as VerdocsEndpoint } from './VerdocsEndpoint-d58d5544.js';
|
5
5
|
import { g as getEnvelopeStore } from './EnvelopeStore-7f484014.js';
|
6
6
|
import { V as VerdocsToast } from './Toast-f3b8fd46.js';
|
7
7
|
import { S as SDKError } from './errors-9b5498c8.js';
|
@@ -3,7 +3,7 @@ import { c as cancelEnvelope } from './Envelopes-5e32159f.js';
|
|
3
3
|
import { u as userIsEnvelopeOwner } from './Permissions-f2eb0421.js';
|
4
4
|
import { r as resendInvitation } from './Recipients-4ec2138c.js';
|
5
5
|
import './Types-5f31149e.js';
|
6
|
-
import { V as VerdocsEndpoint } from './VerdocsEndpoint-
|
6
|
+
import { V as VerdocsEndpoint } from './VerdocsEndpoint-d58d5544.js';
|
7
7
|
import { g as getEnvelopeStore } from './EnvelopeStore-7f484014.js';
|
8
8
|
import { F as FORMAT_TIMESTAMP } from './Types-de18e225.js';
|
9
9
|
import { V as VerdocsToast } from './Toast-f3b8fd46.js';
|
@@ -2,7 +2,7 @@ import { r as registerInstance, c as createEvent, h, H as Host } from './index-1
|
|
2
2
|
import { l as listEnvelopes, c as cancelEnvelope } from './Envelopes-5e32159f.js';
|
3
3
|
import { g as getRecipientsWithActions, a as userCanAct, b as userCanCancelEnvelope } from './Permissions-f2eb0421.js';
|
4
4
|
import './Types-5f31149e.js';
|
5
|
-
import { V as VerdocsEndpoint } from './VerdocsEndpoint-
|
5
|
+
import { V as VerdocsEndpoint } from './VerdocsEndpoint-d58d5544.js';
|
6
6
|
import { i as integerSequence } from './Primitives-8fe93caf.js';
|
7
7
|
import { s as saveEnvelopesAsZip } from './utils-c0cd0b91.js';
|
8
8
|
import { V as VerdocsToast } from './Toast-f3b8fd46.js';
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host, a as getElement } from './index-172625c5.js';
|
2
2
|
import { i as interact } from './interact.min-cf83fa88.js';
|
3
3
|
import './Types-5f31149e.js';
|
4
|
-
import { V as VerdocsEndpoint } from './VerdocsEndpoint-
|
4
|
+
import { V as VerdocsEndpoint } from './VerdocsEndpoint-d58d5544.js';
|
5
5
|
import { u as updateField } from './Fields-c82e6df3.js';
|
6
6
|
import { g as getRGBA } from './Colors-1b298092.js';
|
7
7
|
import { g as getFieldSettings } from './utils-c0cd0b91.js';
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host, a as getElement } from './index-172625c5.js';
|
2
2
|
import { i as interact } from './interact.min-cf83fa88.js';
|
3
3
|
import './Types-5f31149e.js';
|
4
|
-
import { V as VerdocsEndpoint } from './VerdocsEndpoint-
|
4
|
+
import { V as VerdocsEndpoint } from './VerdocsEndpoint-d58d5544.js';
|
5
5
|
import { u as updateField } from './Fields-c82e6df3.js';
|
6
6
|
import { g as getRGBA } from './Colors-1b298092.js';
|
7
7
|
import { g as getFieldSettings } from './utils-c0cd0b91.js';
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host } from './index-172625c5.js';
|
2
2
|
import './Types-5f31149e.js';
|
3
|
-
import { V as VerdocsEndpoint } from './VerdocsEndpoint-
|
3
|
+
import { V as VerdocsEndpoint } from './VerdocsEndpoint-d58d5544.js';
|
4
4
|
import { u as unicodeNBSP } from './Icons-c29eb0fa.js';
|
5
5
|
|
6
6
|
const verdocsFileChooserCss = "verdocs-file-chooser{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;background-color:#ffffff;font-family:\"Inter\", -apple-system, \"Segoe UI\", \"Roboto\", \"Helvetica Neue\", sans-serif}verdocs-file-chooser .upload-box{text-align:center;-webkit-box-sizing:border-box;box-sizing:border-box;padding:40px 15px;color:rgba(0, 0, 0, 0.54)}verdocs-file-chooser .upload-box svg{width:64px;height:64px;fill:#5c6575}verdocs-file-chooser .selected-filename{font-size:20px;font-weight:bold;overflow-wrap:anywhere}verdocs-file-chooser .or-prefer{height:20px;margin:20px 0;font-size:16px}";
|
@@ -1,8 +1,8 @@
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host } from './index-172625c5.js';
|
2
2
|
import './Types-5f31149e.js';
|
3
|
-
import { V as VerdocsEndpoint } from './VerdocsEndpoint-
|
3
|
+
import { V as VerdocsEndpoint } from './VerdocsEndpoint-d58d5544.js';
|
4
4
|
import { r as renderDocumentField, b as getRoleIndex } from './utils-c0cd0b91.js';
|
5
|
-
import { g as getTemplateStore, a as getRoleNames } from './TemplateStore-
|
5
|
+
import { g as getTemplateStore, a as getRoleNames } from './TemplateStore-e8cf5a15.js';
|
6
6
|
import { S as SDKError } from './errors-9b5498c8.js';
|
7
7
|
import { a as isValidEmail, i as isValidPhone } from './Validators-16a2a43b.js';
|
8
8
|
import { g as getRGBA } from './Colors-1b298092.js';
|
@@ -345,6 +345,99 @@ const VerdocsTemplateAttachments = class {
|
|
345
345
|
};
|
346
346
|
VerdocsTemplateAttachments.style = verdocsTemplateAttachmentsCss;
|
347
347
|
|
348
|
+
const verdocsTemplateBuildTabsCss = "verdocs-template-build-tabs{-ms-flex:1;flex:1;gap:20px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-direction:column;flex-direction:column;font-family:\"Inter\", -apple-system, \"Segoe UI\", \"Roboto\", \"Helvetica Neue\", sans-serif}verdocs-template-build-tabs verdocs-template-attachments,verdocs-template-build-tabs verdocs-template-roles{margin:20px}verdocs-template-build-tabs verdocs-template-fields{border-top:1px solid #777777}verdocs-template-build-tabs verdocs-template-attachments{padding:20px;background:#ffffff}verdocs-template-build-tabs verdocs-template-fields{width:100%}verdocs-template-build-tabs verdocs-preview{-ms-flex:1;flex:1}";
|
349
|
+
|
350
|
+
const STEPS = ['attachments', 'roles', 'settings', 'fields', 'preview'];
|
351
|
+
const VerdocsTemplateBuildTabs = class {
|
352
|
+
constructor(hostRef) {
|
353
|
+
registerInstance(this, hostRef);
|
354
|
+
this.sdkError = createEvent(this, "sdkError", 7);
|
355
|
+
this.stepChanged = createEvent(this, "stepChanged", 7);
|
356
|
+
this.endpoint = VerdocsEndpoint.getDefault();
|
357
|
+
this.templateId = null;
|
358
|
+
this.step = 'preview';
|
359
|
+
this.store = null;
|
360
|
+
}
|
361
|
+
onStepChanged() {
|
362
|
+
console.log('Step changed', this.step, this.templateId);
|
363
|
+
this.loadTemplate().catch((e) => console.log('Unknown Error', e));
|
364
|
+
}
|
365
|
+
async componentWillLoad() {
|
366
|
+
var _a, _b, _c;
|
367
|
+
try {
|
368
|
+
this.endpoint.loadSession();
|
369
|
+
if (!this.endpoint.session) {
|
370
|
+
console.log('[BUILD_TABS] Unable to start builder session, must be authenticated');
|
371
|
+
return;
|
372
|
+
}
|
373
|
+
if (!this.templateId) {
|
374
|
+
this.step = 'preview';
|
375
|
+
return;
|
376
|
+
}
|
377
|
+
this.loadTemplate().catch(e => console.log('[BUILD_TABS] Unable to load template', e));
|
378
|
+
}
|
379
|
+
catch (e) {
|
380
|
+
console.log('[BUILD_TABS] Error loading template', e);
|
381
|
+
(_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));
|
382
|
+
}
|
383
|
+
}
|
384
|
+
async loadTemplate() {
|
385
|
+
if (this.templateId) {
|
386
|
+
this.store = await getTemplateStore(this.endpoint, this.templateId, false);
|
387
|
+
}
|
388
|
+
}
|
389
|
+
setStep(e) {
|
390
|
+
var _a;
|
391
|
+
console.log('Selected step', e.detail.tab.id);
|
392
|
+
e.stopPropagation();
|
393
|
+
e.preventDefault();
|
394
|
+
this.step = e.detail.tab.id;
|
395
|
+
(_a = this.stepChanged) === null || _a === void 0 ? void 0 : _a.emit(e.detail.tab.id);
|
396
|
+
}
|
397
|
+
render() {
|
398
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
399
|
+
if (!this.endpoint.session) {
|
400
|
+
return (h(Host, null, h("verdocs-component-error", { message: "You must be authenticated to use this module." })));
|
401
|
+
}
|
402
|
+
let canPreview = false;
|
403
|
+
let canEditFields = false;
|
404
|
+
let canEditRoles = false;
|
405
|
+
if (this.templateId && this.store) {
|
406
|
+
console.log('lengths', (_b = (_a = this.store) === null || _a === void 0 ? void 0 : _a.state) === null || _b === void 0 ? void 0 : _b.template_documents.length, (_d = (_c = this.store) === null || _c === void 0 ? void 0 : _c.state) === null || _d === void 0 ? void 0 : _d.roles.length, (_f = (_e = this.store) === null || _e === void 0 ? void 0 : _e.state) === null || _f === void 0 ? void 0 : _f.fields.length);
|
407
|
+
canEditRoles = ((_h = (_g = this.store) === null || _g === void 0 ? void 0 : _g.state) === null || _h === void 0 ? void 0 : _h.template_documents.length) > 0;
|
408
|
+
canEditFields = canEditRoles && ((_k = (_j = this.store) === null || _j === void 0 ? void 0 : _j.state) === null || _k === void 0 ? void 0 : _k.roles.length) > 0;
|
409
|
+
canPreview = canEditFields && ((_m = (_l = this.store) === null || _l === void 0 ? void 0 : _l.state) === null || _m === void 0 ? void 0 : _m.fields.length) > 0;
|
410
|
+
// TODO
|
411
|
+
// canPreview = this.store && userCanPreviewTemplate(this.endpoint.session, this.store?.state);
|
412
|
+
// canEditFields = this.store && userCanBuildTemplate(this.endpoint.session, this.store?.state);
|
413
|
+
// canEditRoles = this.store && userCanUpdateTemplate(this.endpoint.session, this.store?.state);
|
414
|
+
}
|
415
|
+
let selectedStepIndex = Math.max(STEPS.indexOf(this.step), 0);
|
416
|
+
if (!canPreview && selectedStepIndex >= 4) {
|
417
|
+
selectedStepIndex = 3;
|
418
|
+
}
|
419
|
+
if (!canEditFields && selectedStepIndex >= 3) {
|
420
|
+
selectedStepIndex = 1;
|
421
|
+
}
|
422
|
+
if (!canEditRoles && selectedStepIndex >= 1) {
|
423
|
+
selectedStepIndex = 0;
|
424
|
+
}
|
425
|
+
console.log({ selectedStepIndex, canPreview, canEditFields, canEditRoles });
|
426
|
+
console.log('[BUILD_TABS] Rendering', this.step, selectedStepIndex);
|
427
|
+
return (h(Host, null, h("verdocs-tabs", { onSelectTab: e => this.setStep(e), selectedTab: selectedStepIndex, tabs: [
|
428
|
+
{ id: 'attachments', disabled: false, label: this.templateId && this.store ? 'Attachment(s)' : 'Upload Attachment(s)' },
|
429
|
+
{ id: 'roles', disabled: !canEditRoles, label: 'Roles' },
|
430
|
+
{ id: 'settings', disabled: !canEditFields, label: 'Settings' },
|
431
|
+
{ id: 'fields', disabled: !canEditFields, label: 'Fields' },
|
432
|
+
{ id: 'preview', disabled: !canPreview, label: 'Preview/Send' },
|
433
|
+
] })));
|
434
|
+
}
|
435
|
+
static get watchers() { return {
|
436
|
+
"step": ["onStepChanged"]
|
437
|
+
}; }
|
438
|
+
};
|
439
|
+
VerdocsTemplateBuildTabs.style = verdocsTemplateBuildTabsCss;
|
440
|
+
|
348
441
|
const verdocsTemplateCreateCss = "verdocs-template-create{font-family:\"Inter\", -apple-system, \"Segoe UI\", \"Roboto\", \"Helvetica Neue\", sans-serif}verdocs-template-create form{background-color:#ffffff;padding:12px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}verdocs-template-create form .upload-box{-webkit-box-sizing:border-box;box-sizing:border-box;width:320px;text-align:center;padding:44px 18px 66px;border:2px dashed #979797;color:rgba(0, 0, 0, 0.54)}verdocs-template-create form .upload-box.drag-over{border:2px solid #4c56cb}verdocs-template-create form .upload-box svg{width:64px;fill:#5c6575}verdocs-template-create .loader-wrapper{background-color:#ffffff;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-webkit-box-sizing:border-box;box-sizing:border-box;position:relative;width:320px;height:320px;text-align:center;border:2px dashed #979797;-ms-flex-pack:end;justify-content:flex-end}verdocs-template-create .progress-wrapper{padding:20px}verdocs-template-create .buttons{display:-ms-flexbox;display:flex;-webkit-column-gap:8px;-moz-column-gap:8px;column-gap:8px;margin-top:16px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:end;justify-content:flex-end}verdocs-template-create .buttons .flex-fill{-ms-flex:1;flex:1}verdocs-template-create ::-webkit-input-placeholder{color:#aaaaaa}verdocs-template-create ::-moz-placeholder{color:#aaaaaa}verdocs-template-create :-ms-input-placeholder{color:#aaaaaa}verdocs-template-create ::-ms-input-placeholder{color:#aaaaaa}verdocs-template-create ::placeholder{color:#aaaaaa}";
|
349
442
|
|
350
443
|
const unicodeNBSP = ' ';
|
@@ -688,4 +781,4 @@ const VerdocsTemplateVisibility = class {
|
|
688
781
|
};
|
689
782
|
VerdocsTemplateVisibility.style = verdocsTemplateVisibilityCss;
|
690
783
|
|
691
|
-
export { VerdocsPreview as verdocs_preview, VerdocsSend as verdocs_send, VerdocsTemplateAttachments as verdocs_template_attachments, VerdocsTemplateCreate as verdocs_template_create, VerdocsTemplateName as verdocs_template_name, VerdocsTemplateReminders as verdocs_template_reminders, VerdocsTemplateVisibility as verdocs_template_visibility };
|
784
|
+
export { VerdocsPreview as verdocs_preview, VerdocsSend as verdocs_send, VerdocsTemplateAttachments as verdocs_template_attachments, VerdocsTemplateBuildTabs as verdocs_template_build_tabs, VerdocsTemplateCreate as verdocs_template_create, VerdocsTemplateName as verdocs_template_name, VerdocsTemplateReminders as verdocs_template_reminders, VerdocsTemplateVisibility as verdocs_template_visibility };
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { r as registerInstance, c as createEvent, h } from './index-172625c5.js';
|
2
2
|
import './Types-5f31149e.js';
|
3
|
-
import { V as VerdocsEndpoint } from './VerdocsEndpoint-
|
3
|
+
import { V as VerdocsEndpoint } from './VerdocsEndpoint-d58d5544.js';
|
4
4
|
import { a as getTemplates } from './Templates-f90883f7.js';
|
5
5
|
|
6
6
|
/**
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { r as registerInstance, h } from './index-172625c5.js';
|
2
2
|
import './Types-5f31149e.js';
|
3
|
-
import { V as VerdocsEndpoint } from './VerdocsEndpoint-
|
3
|
+
import { V as VerdocsEndpoint } from './VerdocsEndpoint-d58d5544.js';
|
4
4
|
|
5
5
|
const verdocsSearchCss = "verdocs-search{font-family:\"Inter\", -apple-system, \"Segoe UI\", \"Roboto\", \"Helvetica Neue\", sans-serif;display:-ms-flexbox;display:flex;background-color:#1e2031}verdocs-search search-box{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;margin:20px 10px}verdocs-search .boxes{-ms-flex-wrap:wrap;flex-wrap:wrap;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;margin:20px 0}verdocs-search search-recent,verdocs-search search-saved,verdocs-search search-quick-functions,verdocs-search search-starred{display:-ms-flexbox;display:flex;margin:0 20px 20px 0}";
|
6
6
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host } from './index-172625c5.js';
|
2
2
|
import './Types-5f31149e.js';
|
3
|
-
import { V as VerdocsEndpoint } from './VerdocsEndpoint-
|
3
|
+
import { V as VerdocsEndpoint } from './VerdocsEndpoint-d58d5544.js';
|
4
4
|
import { a as formatFullName, c as capitalize, b as formatInitials } from './Primitives-8fe93caf.js';
|
5
5
|
import { V as VerdocsToast } from './Toast-f3b8fd46.js';
|
6
6
|
import { S as SDKError } from './errors-9b5498c8.js';
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host } from './index-172625c5.js';
|
2
2
|
import './Types-5f31149e.js';
|
3
|
-
import { V as VerdocsEndpoint } from './VerdocsEndpoint-
|
3
|
+
import { V as VerdocsEndpoint } from './VerdocsEndpoint-d58d5544.js';
|
4
4
|
import { S as SDKError } from './errors-9b5498c8.js';
|
5
5
|
|
6
6
|
const verdocsSettingsCss = "verdocs-settings{font-family:\"Inter\", -apple-system, \"Segoe UI\", \"Roboto\", \"Helvetica Neue\", sans-serif;display:-ms-flexbox;display:flex;padding:15px;row-gap:15px;min-height:200px;position:relative;-ms-flex-align:center;align-items:center;-webkit-box-sizing:border-box;box-sizing:border-box;-ms-flex-direction:column;flex-direction:column}verdocs-settings .tabs{gap:4px;width:100%;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-direction:row;flex-direction:row;border-bottom:1px solid #654dcb}verdocs-settings .tabs .tab{cursor:pointer;padding:5px 10px;color:#ffffff;background-color:#777777}verdocs-settings .tabs .tab.active{color:#ffffff;background-color:#654dcb}";
|
@@ -2,7 +2,7 @@ import { r as registerInstance, c as createEvent, h, H as Host, F as Fragment }
|
|
2
2
|
import { e as getSigningSession, t as throttledGetEnvelope, u as updateEnvelopeField, f as updateEnvelopeFieldSignature, h as updateEnvelopeFieldInitials, i as uploadEnvelopeFieldAttachment } from './Envelopes-5e32159f.js';
|
3
3
|
import { R as RecipientStates } from './Types-5f31149e.js';
|
4
4
|
import { e as envelopeRecipientAgree, a as envelopeRecipientDecline, b as envelopeRecipientSubmit } from './Recipients-4ec2138c.js';
|
5
|
-
import { V as VerdocsEndpoint } from './VerdocsEndpoint-
|
5
|
+
import { V as VerdocsEndpoint } from './VerdocsEndpoint-d58d5544.js';
|
6
6
|
import { i as isValidPhone, a as isValidEmail } from './Validators-16a2a43b.js';
|
7
7
|
import { f as fullNameToInitials, i as integerSequence } from './Primitives-8fe93caf.js';
|
8
8
|
import { a as saveAttachment, u as updateDocumentFieldValue, b as getRoleIndex, r as renderDocumentField, c as getFieldId } from './utils-c0cd0b91.js';
|
@@ -7,18 +7,10 @@ const VerdocsTabs = class {
|
|
7
7
|
registerInstance(this, hostRef);
|
8
8
|
this.selectTab = createEvent(this, "selectTab", 7);
|
9
9
|
this.tabs = [];
|
10
|
-
this.defaultTab = 0;
|
11
10
|
this.selectedTab = 0;
|
12
11
|
}
|
13
|
-
componentDidLoad() {
|
14
|
-
this.selectedTab = this.defaultTab || 0;
|
15
|
-
}
|
16
|
-
componentDidUpdate() {
|
17
|
-
this.selectedTab = this.defaultTab || 0;
|
18
|
-
}
|
19
12
|
handleSelectTab(index) {
|
20
13
|
var _a;
|
21
|
-
this.selectedTab = index;
|
22
14
|
(_a = this.selectTab) === null || _a === void 0 ? void 0 : _a.emit({ tab: this.tabs[index], index });
|
23
15
|
}
|
24
16
|
render() {
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host, a as getElement } from './index-172625c5.js';
|
2
2
|
import './Types-5f31149e.js';
|
3
|
-
import { V as VerdocsEndpoint } from './VerdocsEndpoint-
|
3
|
+
import { V as VerdocsEndpoint } from './VerdocsEndpoint-d58d5544.js';
|
4
4
|
import { g as getTemplateDocumentPageDisplayUri } from './TemplateDocuments-6fd2f4e2.js';
|
5
5
|
import { t as throttle } from './utils-c0cd0b91.js';
|
6
6
|
import { c as createPopper } from './popper-15e448b4.js';
|
@@ -1,11 +1,11 @@
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host, F as Fragment, a as getElement } from './index-172625c5.js';
|
2
2
|
import { i as interact } from './interact.min-cf83fa88.js';
|
3
3
|
import './Types-5f31149e.js';
|
4
|
-
import { V as VerdocsEndpoint, T as TemplateSenderTypes } from './VerdocsEndpoint-
|
4
|
+
import { V as VerdocsEndpoint, T as TemplateSenderTypes } from './VerdocsEndpoint-d58d5544.js';
|
5
5
|
import { u as updateField, c as createField } from './Fields-c82e6df3.js';
|
6
6
|
import { i as integerSequence } from './Primitives-8fe93caf.js';
|
7
7
|
import { b as getRoleIndex, r as renderDocumentField, h as updateCssTransform, i as defaultWidth, j as defaultHeight } from './utils-c0cd0b91.js';
|
8
|
-
import { g as getTemplateStore, a as getRoleNames } from './TemplateStore-
|
8
|
+
import { g as getTemplateStore, a as getRoleNames } from './TemplateStore-e8cf5a15.js';
|
9
9
|
import { S as SDKError } from './errors-9b5498c8.js';
|
10
10
|
import { g as getRGBA } from './Colors-1b298092.js';
|
11
11
|
import { u as updateTemplate } from './Templates-f90883f7.js';
|
@@ -604,15 +604,18 @@ const VerdocsTemplateRoles = class {
|
|
604
604
|
console.log('[ROLES] Unable to start builder session, must be authenticated');
|
605
605
|
return;
|
606
606
|
}
|
607
|
-
|
608
|
-
this.sortTemplateRoles();
|
609
|
-
this.renumberTemplateRoles();
|
607
|
+
await this.reloadStore();
|
610
608
|
}
|
611
609
|
catch (e) {
|
612
610
|
console.log('[FIELDS] Error with preview session', e);
|
613
611
|
(_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));
|
614
612
|
}
|
615
613
|
}
|
614
|
+
async reloadStore() {
|
615
|
+
this.store = await getTemplateStore(this.endpoint, this.templateId, true);
|
616
|
+
this.sortTemplateRoles();
|
617
|
+
this.renumberTemplateRoles();
|
618
|
+
}
|
616
619
|
componentDidRender() {
|
617
620
|
interact.dynamicDrop(true);
|
618
621
|
interact('.recipient').draggable({
|
@@ -677,6 +680,7 @@ const VerdocsTemplateRoles = class {
|
|
677
680
|
var _a, _b;
|
678
681
|
console.log('[ROLES] Updated roles');
|
679
682
|
(_a = this.templateUpdated) === null || _a === void 0 ? void 0 : _a.emit({ event: 'updated-role', endpoint: this.endpoint, template: (_b = this.store) === null || _b === void 0 ? void 0 : _b.state });
|
683
|
+
this.reloadStore().catch(e => console.log('Unknown error', e));
|
680
684
|
})
|
681
685
|
.catch(e => console.log('[ROLES] Role updates failed', e));
|
682
686
|
}
|
@@ -771,6 +775,7 @@ const VerdocsTemplateRoles = class {
|
|
771
775
|
// this.store.state.roles = [...this.store?.state.roles, r];
|
772
776
|
// this.renumberTemplateRoles();
|
773
777
|
(_a = this.templateUpdated) === null || _a === void 0 ? void 0 : _a.emit({ event: 'created-role', endpoint: this.endpoint, template: (_b = this.store) === null || _b === void 0 ? void 0 : _b.state });
|
778
|
+
this.reloadStore().catch(e => console.log('Unknown error', e));
|
774
779
|
})
|
775
780
|
.catch(e => {
|
776
781
|
console.log('[ROLES] Error creating role', e);
|
@@ -817,6 +822,7 @@ const VerdocsTemplateRoles = class {
|
|
817
822
|
this.showingRoleDialog = null;
|
818
823
|
// this.forceRerender++;
|
819
824
|
(_a = this.templateUpdated) === null || _a === void 0 ? void 0 : _a.emit({ event: 'deleted-role', endpoint: this.endpoint, template: (_b = this.store) === null || _b === void 0 ? void 0 : _b.state });
|
825
|
+
this.reloadStore().catch(e => console.log('Unknown error', e));
|
820
826
|
} })), this.showingSenderDialog && h("verdocs-template-sender", { endpoint: this.endpoint, templateId: this.templateId, onClose: () => (this.showingSenderDialog = false) })));
|
821
827
|
}
|
822
828
|
get el() { return getElement(this); }
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host } from './index-172625c5.js';
|
2
|
-
import { V as VerdocsEndpoint } from './VerdocsEndpoint-
|
2
|
+
import { V as VerdocsEndpoint } from './VerdocsEndpoint-d58d5544.js';
|
3
3
|
import './Types-5f31149e.js';
|
4
4
|
|
5
5
|
/**
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host } from './index-172625c5.js';
|
2
2
|
import './Types-5f31149e.js';
|
3
|
-
import { V as VerdocsEndpoint, a as TemplateActions } from './VerdocsEndpoint-
|
3
|
+
import { V as VerdocsEndpoint, a as TemplateActions } from './VerdocsEndpoint-d58d5544.js';
|
4
4
|
import { l as listTemplates, d as deleteTemplate } from './Templates-f90883f7.js';
|
5
5
|
import { i as integerSequence } from './Primitives-8fe93caf.js';
|
6
6
|
import { S as SDKError } from './errors-9b5498c8.js';
|
@@ -2,7 +2,7 @@ import { r as registerInstance, c as createEvent, h, H as Host, F as Fragment, a
|
|
2
2
|
import { t as throttledGetEnvelope, c as cancelEnvelope } from './Envelopes-5e32159f.js';
|
3
3
|
import { b as userCanCancelEnvelope } from './Permissions-f2eb0421.js';
|
4
4
|
import './Types-5f31149e.js';
|
5
|
-
import { V as VerdocsEndpoint } from './VerdocsEndpoint-
|
5
|
+
import { V as VerdocsEndpoint } from './VerdocsEndpoint-d58d5544.js';
|
6
6
|
import { i as integerSequence } from './Primitives-8fe93caf.js';
|
7
7
|
import { s as saveEnvelopesAsZip, e as saveCertificate, a as saveAttachment } from './utils-c0cd0b91.js';
|
8
8
|
import { S as SDKError } from './errors-9b5498c8.js';
|