@verdocs/web-sdk 4.2.9 → 4.2.12

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.
Files changed (27) hide show
  1. package/dist/cjs/loader.cjs.js +1 -1
  2. package/dist/cjs/verdocs-auth.cjs.entry.js +30 -57
  3. package/dist/cjs/verdocs-preview_10.cjs.entry.js +9 -4
  4. package/dist/cjs/verdocs-web-sdk.cjs.js +1 -1
  5. package/dist/collection/components/embeds/verdocs-auth/verdocs-auth.js +33 -65
  6. package/dist/collection/components/templates/verdocs-template-roles/verdocs-template-roles.js +9 -4
  7. package/dist/components/verdocs-auth.js +37 -75
  8. package/dist/components/verdocs-template-roles2.js +9 -4
  9. package/dist/custom-elements.json +2086 -0
  10. package/dist/esm/loader.js +1 -1
  11. package/dist/esm/verdocs-auth.entry.js +30 -57
  12. package/dist/esm/verdocs-preview_10.entry.js +9 -4
  13. package/dist/esm/verdocs-web-sdk.js +1 -1
  14. package/dist/esm-es5/loader.js +1 -1
  15. package/dist/esm-es5/verdocs-auth.entry.js +1 -1
  16. package/dist/esm-es5/verdocs-preview_10.entry.js +1 -1
  17. package/dist/esm-es5/verdocs-web-sdk.js +1 -1
  18. package/dist/types/components/embeds/verdocs-auth/verdocs-auth.d.ts +4 -8
  19. package/dist/verdocs-web-sdk/p-18363901.entry.js +1 -0
  20. package/dist/verdocs-web-sdk/p-322fa613.system.js +1 -1
  21. package/dist/verdocs-web-sdk/{p-2c4c1890.system.entry.js → p-51544250.system.entry.js} +1 -1
  22. package/dist/verdocs-web-sdk/{p-bf5446a3.entry.js → p-a7dac539.entry.js} +1 -1
  23. package/dist/verdocs-web-sdk/p-f0299a13.system.entry.js +1 -0
  24. package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
  25. package/package.json +2 -2
  26. package/dist/verdocs-web-sdk/p-16beca12.entry.js +0 -1
  27. package/dist/verdocs-web-sdk/p-9bef9a21.system.entry.js +0 -1
@@ -2,55 +2,14 @@ import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/i
2
2
  import { VerdocsEndpoint, createProfile, authenticate, decodeAccessTokenBody, resendVerification, resetPassword } from '@verdocs/js-sdk';
3
3
  import { V as VerdocsToast } from './Toast.js';
4
4
  import { S as SDKError } from './errors.js';
5
- import { d as defineCustomElement$5 } from './verdocs-button2.js';
6
- import { d as defineCustomElement$4 } from './verdocs-help-icon2.js';
7
- import { d as defineCustomElement$3 } from './verdocs-select-input2.js';
5
+ import { d as defineCustomElement$4 } from './verdocs-button2.js';
6
+ import { d as defineCustomElement$3 } from './verdocs-help-icon2.js';
8
7
  import { d as defineCustomElement$2 } from './verdocs-text-input2.js';
9
8
 
10
9
  const verdocsAuthCss = "@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-auth{font-family:\"Inter\", -apple-system, \"Segoe UI\", \"Roboto\", \"Helvetica Neue\", sans-serif;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}verdocs-auth .form{background:#ffffff;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;-ms-flex-direction:column;flex-direction:column;display:-ms-flexbox;display:flex;padding:20px;width:300px;max-width:100%}verdocs-auth .logo{margin:20px 0 30px;width:128px;max-width:100%}verdocs-auth h3{text-align:center;font-weight:400;font-size:16px;line-height:1.75;margin:0}verdocs-auth h4{text-align:center;font-weight:400;font-size:14px;line-height:1.43;margin:0}verdocs-auth h4 verdocs-button button.normal .button-label{padding:0}verdocs-auth .buttons{gap:20px;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:center;justify-content:center}verdocs-auth .status-result{display:none}verdocs-auth .status-result.debug{white-space:pre-wrap;font-size:14px;background:#fff;padding:10px;display:block;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:center;justify-content:center}verdocs-auth form{width:100%}verdocs-auth verdocs-text-input{margin-bottom:10px}verdocs-auth .account-option{gap:8px;margin:20px 0 8px 0;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row}verdocs-auth p+p{margin-top:0}verdocs-auth verdocs-help-icon{margin-top:18px;display:-ms-flexbox;display:flex;width:32px;height:32px;-ms-flex:0 0 32px;flex:0 0 32px}";
11
10
  const VerdocsAuthStyle0 = verdocsAuthCss;
12
11
 
13
12
  const RECHECK_INTERVAL = 5000;
14
- const Industries = [
15
- { value: '', label: '' },
16
- { value: 'Accounting & Tax', label: 'Accounting & Tax' },
17
- { value: 'Business Services / Consulting', label: 'Business Services / Consulting' },
18
- { value: 'Construction', label: 'Construction' },
19
- { value: 'Education', label: 'Education' },
20
- { value: 'Financial Services', label: 'Financial Services' },
21
- { value: 'Government', label: 'Government' },
22
- { value: 'Healthcare - Health Plans & Payers', label: 'Healthcare - Health Plans & Payers' },
23
- { value: 'Healthcare - Providers', label: 'Healthcare - Providers' },
24
- { value: 'Insurance', label: 'Insurance' },
25
- { value: 'Legal', label: 'Legal' },
26
- { value: 'Life Sciences', label: 'Life Sciences' },
27
- { value: 'Manufacturing', label: 'Manufacturing' },
28
- { value: 'Mortgage', label: 'Mortgage' },
29
- { value: 'Not For Profit', label: 'Not For Profit' },
30
- { value: 'Real Estate - Commercial', label: 'Real Estate - Commercial' },
31
- { value: 'Real Estate - Residential', label: 'Real Estate - Residential' },
32
- { value: 'Retail', label: 'Retail' },
33
- { value: 'Technology', label: 'Technology' },
34
- { value: 'Other', label: 'Other' },
35
- ];
36
- const Reasons = [
37
- { value: '', label: '' },
38
- { value: 'I want to send a document for signature.', label: 'I want to send a document for signature.' },
39
- { value: 'I just need to sign a document today.', label: 'I just need to sign a document today.' },
40
- { value: "I'm evaluating it for my business.", label: "I'm evaluating it for my business." },
41
- { value: "I'm evaluating it for my personal use.", label: "I'm evaluating it for my personal use." },
42
- { value: "I'm a developer building an integration.", label: "I'm a developer building an integration." },
43
- ];
44
- const CompanySizes = [
45
- { value: '', label: '' },
46
- { value: 'Solo', label: 'Solo' },
47
- { value: '2-10', label: '2-10' },
48
- { value: '11-50', label: '11-50' },
49
- { value: '51-200', label: '51-200' },
50
- { value: '201-500', label: '201-500' },
51
- { value: '501-1000', label: '501-1000' },
52
- { value: '1000+', label: '1000+' },
53
- ];
54
13
  const VerdocsAuth$1 = /*@__PURE__*/ proxyCustomElement(class VerdocsAuth extends HTMLElement {
55
14
  constructor() {
56
15
  super();
@@ -65,19 +24,14 @@ const VerdocsAuth$1 = /*@__PURE__*/ proxyCustomElement(class VerdocsAuth extends
65
24
  this.logo = 'https://app.verdocs.com/assets/blue-logo.svg';
66
25
  this.isAuthenticated = false;
67
26
  this.displayMode = 'login';
68
- this.orgname = '';
69
- this.first = '';
70
- this.last = '';
27
+ this.org_name = '';
28
+ this.first_name = '';
29
+ this.last_name = '';
71
30
  this.username = '';
72
- this.phone = '';
73
31
  this.password = '';
74
32
  this.submitting = false;
75
33
  this.activeSession = null;
76
34
  this.accountType = 'org';
77
- this.howHear = '';
78
- this.industry = '';
79
- this.companySize = '';
80
- this.reason = '';
81
35
  this.signupStep = 1;
82
36
  this.resendDisabled = false;
83
37
  this.checkingOrg = false;
@@ -119,20 +73,38 @@ const VerdocsAuth$1 = /*@__PURE__*/ proxyCustomElement(class VerdocsAuth extends
119
73
  this.resendDisabledTimer = null;
120
74
  }
121
75
  }
76
+ isPasswordComplex(password) {
77
+ const isUppercase = (ch) => /[A-Z]/.test(ch);
78
+ const isLowercase = (ch) => /[a-z]/.test(ch);
79
+ const isSpecialChar = (ch) => /[`!@#$%^&*()_\-+=\[\]{};':"\\|,.<>\/?~ ]/.test(ch);
80
+ let countOfUpperCase = 0, countOfLowerCase = 0, countOfSpecialChar = 0;
81
+ for (let i = 0; i < password.length; i++) {
82
+ let ch = password.charAt(i);
83
+ if (isUppercase(ch))
84
+ countOfUpperCase++;
85
+ else if (isLowercase(ch))
86
+ countOfLowerCase++;
87
+ else if (isSpecialChar(ch))
88
+ countOfSpecialChar++;
89
+ }
90
+ return password.length >= 8 && countOfLowerCase > 0 && countOfUpperCase > 0 && countOfSpecialChar > 0;
91
+ }
122
92
  handleSignup() {
123
93
  this.submitting = true;
124
94
  this.accessTokenForVerification = null;
95
+ if (!this.isPasswordComplex(this.password)) {
96
+ window.alert('Password must be at least 8 characters long and contain at least one uppercase, one lowercase, and one special character.');
97
+ return;
98
+ }
125
99
  createProfile(this.endpoint, {
126
100
  email: this.username,
127
101
  password: this.password,
128
- firstName: this.first,
129
- lastName: this.last,
130
- orgName: this.orgname,
102
+ first_name: this.first_name,
103
+ last_name: this.last_name,
104
+ org_name: this.org_name,
131
105
  })
132
106
  .then(r => {
133
- console.log('Result', r);
134
- console.log('[AUTH] Created profile', r.profile);
135
- console.log('[AUTH] Created organization', r.organization);
107
+ console.log('Profile creation result', r);
136
108
  this.loginAndCheckVerification();
137
109
  })
138
110
  .catch(e => {
@@ -168,7 +140,7 @@ const VerdocsAuth$1 = /*@__PURE__*/ proxyCustomElement(class VerdocsAuth extends
168
140
  console.log('[AUTH] Logged in, pending email address verification');
169
141
  this.displayMode = 'verify';
170
142
  this.accessTokenForVerification = r.access_token;
171
- this.recheckTimer = setTimeout(() => this.loginAndCheckVerification(), RECHECK_INTERVAL);
143
+ this.recheckTimer = setTimeout(this.loginAndCheckVerification, RECHECK_INTERVAL);
172
144
  }
173
145
  })
174
146
  .catch(e => {
@@ -229,8 +201,8 @@ const VerdocsAuth$1 = /*@__PURE__*/ proxyCustomElement(class VerdocsAuth extends
229
201
  return (h("verdocs-button", { label: "Sign Out", disabled: this.submitting, onClick: () => this.handleLogout(), style: { display: 'flex', justifyContent: 'center', margin: '30px auto 0' } }));
230
202
  }
231
203
  if (this.displayMode === 'signup') {
232
- const step1Invalid = this.submitting || !this.first || !this.last || !this.username || !this.password || !this.orgname;
233
- return (h("div", { class: "form" }, h("a", { href: "https://verdocs.com/en/" }, h("img", { src: this.logo, alt: "Verdocs Logo", class: "logo" })), h("h3", null, "Sign up for a trial account"), h("h4", null, "Already have an account?", h("verdocs-button", { label: "Log In", variant: "text", onClick: () => (this.displayMode = 'login'), disabled: this.submitting })), this.signupStep === 1 && (h("form", { onSubmit: () => this.handleSignup() }, h("div", { style: { display: 'flex', flexDirection: 'row', columnGap: '20px' } }, h("verdocs-text-input", { label: "First Name", autocomplete: "first", required: true, value: this.first, onInput: (e) => (this.first = e.target.value), disabled: this.submitting }), h("verdocs-text-input", { label: "Last Name", autocomplete: "last", required: true, value: this.last, onInput: (e) => (this.last = e.target.value), disabled: this.submitting })), h("verdocs-text-input", { label: "Email", autocomplete: "email", required: true, value: this.username, onInput: (e) => (this.username = e.target.value), disabled: this.submitting }), h("verdocs-text-input", { label: "Phone #", autocomplete: "phone", value: this.phone, onInput: (e) => (this.phone = e.target.value), disabled: this.submitting }), h("verdocs-text-input", { label: "Password", type: "password", required: true, autocomplete: "current-password", value: this.password, onInput: (e) => (this.password = e.target.value), disabled: this.submitting }), h("verdocs-text-input", { label: "Organization Name", autocomplete: "org", required: true, value: this.orgname, onInput: (e) => (this.orgname = e.target.value), disabled: this.submitting, style: { flex: '1' } }), h("div", { style: { marginTop: '30px' } }), h("verdocs-button", { label: "Next", disabled: step1Invalid, onClick: () => (this.signupStep = 2), style: { display: 'flex', justifyContent: 'center', margin: '30px auto 0' } }))), this.signupStep === 2 && (h("form", { onSubmit: () => this.handleSignup() }, h("verdocs-text-input", { label: "How did you hear about Verdocs?", value: this.howHear, onInput: (e) => (this.howHear = e.target.value), disabled: this.submitting }), h("verdocs-select-input", { label: "Your Industry", options: Industries, value: this.industry, onInput: (e) => (this.industry = e.target.value), disabled: this.submitting }), h("verdocs-select-input", { label: "Company Size", options: CompanySizes, value: this.companySize, onInput: (e) => (this.companySize = e.target.value), disabled: this.submitting }), h("verdocs-select-input", { label: "Purpose", options: Reasons, value: this.reason, onInput: (e) => (this.reason = e.target.value), disabled: this.submitting }), h("div", { style: { marginTop: '30px' } }), h("verdocs-button", { label: "Create Account", disabled: this.submitting, onClick: () => this.handleSignup(), style: { display: 'flex', justifyContent: 'center', margin: '30px auto 0' } }))), this.signupStep === 3 && (h("form", { onSubmit: () => this.handleSignup() }, h("p", null, "Please check your e-mail inbox for a verification code and follow the instructions provided."), h("p", null, h("em", null, "Verification messages may take up to 1 hour to arrive. If you do not receive the invitation, ", h("a", { href: "#" }, "Click Here"), " to resend it. Be sure to check your spam folder.")), h("div", { style: { display: 'flex', flexDirection: 'row', gap: '20px' } }, h("verdocs-button", { label: "Back", disabled: this.submitting, onClick: () => {
204
+ const step1Invalid = this.submitting || !this.first_name || !this.last_name || !this.username || !this.password || !this.org_name;
205
+ return (h("div", { class: "form" }, h("a", { href: "https://verdocs.com/en/" }, h("img", { src: this.logo, alt: "Verdocs Logo", class: "logo" })), h("h3", null, "Sign up for a free account"), h("h4", null, "Already have an account?", h("verdocs-button", { label: "Log In", variant: "text", onClick: () => (this.displayMode = 'login'), disabled: this.submitting })), this.signupStep === 1 && (h("form", { onSubmit: () => this.handleSignup() }, h("div", { style: { display: 'flex', flexDirection: 'row', columnGap: '20px' } }, h("verdocs-text-input", { label: "First Name", autocomplete: "first", required: true, value: this.first_name, onInput: (e) => (this.first_name = e.target.value), disabled: this.submitting }), h("verdocs-text-input", { label: "Last Name", autocomplete: "last", required: true, value: this.last_name, onInput: (e) => (this.last_name = e.target.value), disabled: this.submitting })), h("verdocs-text-input", { label: "Email Address", autocomplete: "email", required: true, value: this.username, onInput: (e) => (this.username = e.target.value), disabled: this.submitting }), h("verdocs-text-input", { label: "Password", type: "password", required: true, autocomplete: "current-password", value: this.password, onInput: (e) => (this.password = e.target.value), disabled: this.submitting }), h("verdocs-text-input", { label: "Organization Name", autocomplete: "org", required: true, value: this.org_name, onInput: (e) => (this.org_name = e.target.value), disabled: this.submitting, style: { flex: '1' } }), h("div", { style: { marginTop: '30px' } }), h("verdocs-button", { label: "Next", disabled: step1Invalid, onClick: () => this.handleSignup(), style: { display: 'flex', justifyContent: 'center', margin: '30px auto 0' } }))), this.signupStep === 3 && (h("form", { onSubmit: () => this.handleSignup() }, h("p", null, "Please check your e-mail inbox for a verification code and follow the instructions provided."), h("p", null, h("em", null, "Verification messages may take up to 1 hour to arrive. If you do not receive the invitation, ", h("a", { href: "#" }, "Click Here"), " to resend it. Be sure to check your spam folder.")), h("div", { style: { display: 'flex', flexDirection: 'row', gap: '20px' } }, h("verdocs-button", { label: "Back", disabled: this.submitting, onClick: () => {
234
206
  this.signupStep = 2;
235
207
  }, style: { display: 'flex', justifyContent: 'center', margin: '30px auto 0' } }), h("verdocs-button", { label: "Go to Dashboard", disabled: true, onClick: () => this.handleSignup(), style: { display: 'flex', justifyContent: 'center', margin: '30px auto 0' } }))))));
236
208
  }
@@ -257,19 +229,14 @@ const VerdocsAuth$1 = /*@__PURE__*/ proxyCustomElement(class VerdocsAuth extends
257
229
  "logo": [1],
258
230
  "isAuthenticated": [32],
259
231
  "displayMode": [32],
260
- "orgname": [32],
261
- "first": [32],
262
- "last": [32],
232
+ "org_name": [32],
233
+ "first_name": [32],
234
+ "last_name": [32],
263
235
  "username": [32],
264
- "phone": [32],
265
236
  "password": [32],
266
237
  "submitting": [32],
267
238
  "activeSession": [32],
268
239
  "accountType": [32],
269
- "howHear": [32],
270
- "industry": [32],
271
- "companySize": [32],
272
- "reason": [32],
273
240
  "signupStep": [32],
274
241
  "resendDisabled": [32],
275
242
  "checkingOrg": [32]
@@ -278,7 +245,7 @@ function defineCustomElement$1() {
278
245
  if (typeof customElements === "undefined") {
279
246
  return;
280
247
  }
281
- const components = ["verdocs-auth", "verdocs-button", "verdocs-help-icon", "verdocs-select-input", "verdocs-text-input"];
248
+ const components = ["verdocs-auth", "verdocs-button", "verdocs-help-icon", "verdocs-text-input"];
282
249
  components.forEach(tagName => { switch (tagName) {
283
250
  case "verdocs-auth":
284
251
  if (!customElements.get(tagName)) {
@@ -286,16 +253,11 @@ function defineCustomElement$1() {
286
253
  }
287
254
  break;
288
255
  case "verdocs-button":
289
- if (!customElements.get(tagName)) {
290
- defineCustomElement$5();
291
- }
292
- break;
293
- case "verdocs-help-icon":
294
256
  if (!customElements.get(tagName)) {
295
257
  defineCustomElement$4();
296
258
  }
297
259
  break;
298
- case "verdocs-select-input":
260
+ case "verdocs-help-icon":
299
261
  if (!customElements.get(tagName)) {
300
262
  defineCustomElement$3();
301
263
  }
@@ -188,10 +188,15 @@ const VerdocsTemplateRoles = /*@__PURE__*/ proxyCustomElement(class VerdocsTempl
188
188
  this.getSequenceNumbers().forEach((originalSequence, newSequenceIndex) => {
189
189
  this.getRolesAtSequence(originalSequence).forEach((role, newOrderIndex) => {
190
190
  if (!renumbered.includes(role.name)) {
191
- role.sequence = newSequenceIndex + 1;
192
- role.order = newOrderIndex + 1;
193
- renumbered.push(role.name);
194
- renumberRequests.push(updateTemplateRole(this.endpoint, this.templateId, role.name, { sequence: role.sequence, order: role.order }));
191
+ if (role.sequence !== newSequenceIndex + 1 || role.order !== newOrderIndex + 1) {
192
+ role.sequence = newSequenceIndex + 1;
193
+ role.order = newOrderIndex + 1;
194
+ renumbered.push(role.name);
195
+ renumberRequests.push(updateTemplateRole(this.endpoint, this.templateId, role.name, {
196
+ sequence: role.sequence,
197
+ order: role.order,
198
+ }));
199
+ }
195
200
  }
196
201
  });
197
202
  });