@verdocs/web-sdk 5.0.32 → 5.0.34

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 (127) hide show
  1. package/dist/cjs/index-ccac8641.js +8 -4
  2. package/dist/cjs/loader.cjs.js +1 -1
  3. package/dist/cjs/verdocs-build.cjs.entry.js +1 -1
  4. package/dist/cjs/verdocs-build.cjs.entry.js.map +1 -1
  5. package/dist/cjs/verdocs-contact-picker_2.cjs.entry.js +8 -7
  6. package/dist/cjs/verdocs-contact-picker_2.cjs.entry.js.map +1 -1
  7. package/dist/cjs/{verdocs-envelope-recipient-link_2.cjs.entry.js → verdocs-envelope-recipient-link.cjs.entry.js} +1 -25
  8. package/dist/cjs/verdocs-envelope-recipient-link.cjs.entry.js.map +1 -0
  9. package/dist/cjs/{verdocs-preview_6.cjs.entry.js → verdocs-preview_7.cjs.entry.js} +146 -15
  10. package/dist/cjs/verdocs-preview_7.cjs.entry.js.map +1 -0
  11. package/dist/cjs/verdocs-switch.cjs.entry.js +32 -0
  12. package/dist/cjs/verdocs-switch.cjs.entry.js.map +1 -0
  13. package/dist/cjs/verdocs-web-sdk.cjs.js +1 -1
  14. package/dist/collection/collection-manifest.json +1 -0
  15. package/dist/collection/components/controls/verdocs-switch/verdocs-switch.css +2 -2
  16. package/dist/collection/components/controls/verdocs-switch/verdocs-switch.js +3 -3
  17. package/dist/collection/components/controls/verdocs-switch/verdocs-switch.js.map +1 -1
  18. package/dist/collection/components/embeds/verdocs-build/verdocs-build.js +1 -1
  19. package/dist/collection/components/embeds/verdocs-build/verdocs-build.js.map +1 -1
  20. package/dist/collection/components/embeds/verdocs-send/verdocs-send.js +16 -16
  21. package/dist/collection/components/embeds/verdocs-send/verdocs-send.js.map +1 -1
  22. package/dist/collection/components/envelopes/verdocs-contact-picker/verdocs-contact-picker.css +3 -3
  23. package/dist/collection/components/envelopes/verdocs-contact-picker/verdocs-contact-picker.js +7 -6
  24. package/dist/collection/components/envelopes/verdocs-contact-picker/verdocs-contact-picker.js.map +1 -1
  25. package/dist/collection/components/templates/verdocs-template-settings/verdocs-template-settings.css +57 -0
  26. package/dist/collection/components/templates/verdocs-template-settings/verdocs-template-settings.js +282 -0
  27. package/dist/collection/components/templates/verdocs-template-settings/verdocs-template-settings.js.map +1 -0
  28. package/dist/components/index.js +2 -0
  29. package/dist/components/index.js.map +1 -1
  30. package/dist/components/{p-f4e068a9.js → p-38e1fed8.js} +4 -4
  31. package/dist/components/{p-f4e068a9.js.map → p-38e1fed8.js.map} +1 -1
  32. package/dist/components/p-7ad22da6.js +212 -0
  33. package/dist/components/p-7ad22da6.js.map +1 -0
  34. package/dist/components/{p-449f2b47.js → p-a1ba64de.js} +11 -16
  35. package/dist/components/p-a1ba64de.js.map +1 -0
  36. package/dist/components/{p-27548ebd.js → p-a443bd3a.js} +9 -8
  37. package/dist/components/{p-27548ebd.js.map → p-a443bd3a.js.map} +1 -1
  38. package/dist/components/verdocs-build.js +85 -73
  39. package/dist/components/verdocs-build.js.map +1 -1
  40. package/dist/components/verdocs-contact-picker.js +1 -1
  41. package/dist/components/verdocs-envelope-sidebar.js +1 -1
  42. package/dist/components/verdocs-send.js +1 -1
  43. package/dist/components/verdocs-switch.js +1 -1
  44. package/dist/components/verdocs-template-settings.d.ts +11 -0
  45. package/dist/components/verdocs-template-settings.js +8 -0
  46. package/dist/components/verdocs-template-settings.js.map +1 -0
  47. package/dist/custom-elements.json +14 -1
  48. package/dist/esm/index-272d51a4.js +8 -4
  49. package/dist/esm/loader.js +1 -1
  50. package/dist/esm/verdocs-build.entry.js +1 -1
  51. package/dist/esm/verdocs-build.entry.js.map +1 -1
  52. package/dist/esm/verdocs-contact-picker_2.entry.js +8 -7
  53. package/dist/esm/verdocs-contact-picker_2.entry.js.map +1 -1
  54. package/dist/esm/{verdocs-envelope-recipient-link_2.entry.js → verdocs-envelope-recipient-link.entry.js} +2 -25
  55. package/dist/esm/verdocs-envelope-recipient-link.entry.js.map +1 -0
  56. package/dist/esm/{verdocs-preview_6.entry.js → verdocs-preview_7.entry.js} +147 -17
  57. package/dist/esm/verdocs-preview_7.entry.js.map +1 -0
  58. package/dist/esm/verdocs-switch.entry.js +28 -0
  59. package/dist/esm/verdocs-switch.entry.js.map +1 -0
  60. package/dist/esm/verdocs-web-sdk.js +1 -1
  61. package/dist/esm-es5/index-272d51a4.js +1 -1
  62. package/dist/esm-es5/index-272d51a4.js.map +1 -1
  63. package/dist/esm-es5/loader.js +1 -1
  64. package/dist/esm-es5/loader.js.map +1 -1
  65. package/dist/esm-es5/verdocs-build.entry.js +1 -1
  66. package/dist/esm-es5/verdocs-build.entry.js.map +1 -1
  67. package/dist/esm-es5/verdocs-contact-picker_2.entry.js +1 -1
  68. package/dist/esm-es5/verdocs-contact-picker_2.entry.js.map +1 -1
  69. package/dist/esm-es5/{verdocs-envelope-recipient-link_2.entry.js → verdocs-envelope-recipient-link.entry.js} +2 -2
  70. package/dist/esm-es5/verdocs-envelope-recipient-link.entry.js.map +1 -0
  71. package/dist/esm-es5/verdocs-preview_7.entry.js +8 -0
  72. package/dist/esm-es5/verdocs-preview_7.entry.js.map +1 -0
  73. package/dist/esm-es5/verdocs-switch.entry.js +2 -0
  74. package/dist/esm-es5/verdocs-switch.entry.js.map +1 -0
  75. package/dist/esm-es5/verdocs-web-sdk.js +1 -1
  76. package/dist/esm-es5/verdocs-web-sdk.js.map +1 -1
  77. package/dist/types/components/controls/verdocs-switch/verdocs-switch.d.ts +1 -1
  78. package/dist/types/components/embeds/verdocs-send/verdocs-send.d.ts +3 -2
  79. package/dist/types/components/templates/verdocs-template-settings/verdocs-template-settings.d.ts +55 -0
  80. package/dist/types/components.d.ts +81 -6
  81. package/dist/verdocs-web-sdk/p-09460960.entry.js +8 -0
  82. package/dist/verdocs-web-sdk/p-09460960.entry.js.map +1 -0
  83. package/dist/verdocs-web-sdk/p-17457a7a.entry.js +2 -0
  84. package/dist/verdocs-web-sdk/p-17457a7a.entry.js.map +1 -0
  85. package/dist/verdocs-web-sdk/p-21e9abff.system.entry.js +2 -0
  86. package/dist/verdocs-web-sdk/p-21e9abff.system.entry.js.map +1 -0
  87. package/dist/verdocs-web-sdk/p-27ddc017.system.entry.js +2 -0
  88. package/dist/verdocs-web-sdk/p-27ddc017.system.entry.js.map +1 -0
  89. package/dist/verdocs-web-sdk/p-5df005a9.system.entry.js +8 -0
  90. package/dist/verdocs-web-sdk/p-5df005a9.system.entry.js.map +1 -0
  91. package/dist/verdocs-web-sdk/p-69527aaf.system.entry.js +2 -0
  92. package/dist/verdocs-web-sdk/p-69527aaf.system.entry.js.map +1 -0
  93. package/dist/verdocs-web-sdk/{p-6f1e2f2f.entry.js → p-8e699235.entry.js} +2 -2
  94. package/dist/verdocs-web-sdk/p-8e699235.entry.js.map +1 -0
  95. package/dist/verdocs-web-sdk/p-a1aefbfc.entry.js +2 -0
  96. package/dist/verdocs-web-sdk/p-a1aefbfc.entry.js.map +1 -0
  97. package/dist/verdocs-web-sdk/{p-cabfdb9d.system.entry.js → p-a63b359e.system.entry.js} +2 -2
  98. package/dist/verdocs-web-sdk/p-a63b359e.system.entry.js.map +1 -0
  99. package/dist/verdocs-web-sdk/p-dddd328d.entry.js +2 -0
  100. package/dist/verdocs-web-sdk/p-dddd328d.entry.js.map +1 -0
  101. package/dist/verdocs-web-sdk/p-e2b70dfb.system.js +1 -1
  102. package/dist/verdocs-web-sdk/p-e2b70dfb.system.js.map +1 -1
  103. package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
  104. package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js.map +1 -1
  105. package/package.json +1 -1
  106. package/dist/cjs/verdocs-envelope-recipient-link_2.cjs.entry.js.map +0 -1
  107. package/dist/cjs/verdocs-preview_6.cjs.entry.js.map +0 -1
  108. package/dist/components/p-449f2b47.js.map +0 -1
  109. package/dist/esm/verdocs-envelope-recipient-link_2.entry.js.map +0 -1
  110. package/dist/esm/verdocs-preview_6.entry.js.map +0 -1
  111. package/dist/esm-es5/verdocs-envelope-recipient-link_2.entry.js.map +0 -1
  112. package/dist/esm-es5/verdocs-preview_6.entry.js +0 -8
  113. package/dist/esm-es5/verdocs-preview_6.entry.js.map +0 -1
  114. package/dist/verdocs-web-sdk/p-0666fb5d.system.entry.js +0 -8
  115. package/dist/verdocs-web-sdk/p-0666fb5d.system.entry.js.map +0 -1
  116. package/dist/verdocs-web-sdk/p-6f1e2f2f.entry.js.map +0 -1
  117. package/dist/verdocs-web-sdk/p-8d7d61ee.system.entry.js +0 -2
  118. package/dist/verdocs-web-sdk/p-8d7d61ee.system.entry.js.map +0 -1
  119. package/dist/verdocs-web-sdk/p-b9fee1a7.entry.js +0 -2
  120. package/dist/verdocs-web-sdk/p-b9fee1a7.entry.js.map +0 -1
  121. package/dist/verdocs-web-sdk/p-cabfdb9d.system.entry.js.map +0 -1
  122. package/dist/verdocs-web-sdk/p-d58010a4.entry.js +0 -2
  123. package/dist/verdocs-web-sdk/p-d58010a4.entry.js.map +0 -1
  124. package/dist/verdocs-web-sdk/p-e3efeb57.system.entry.js +0 -2
  125. package/dist/verdocs-web-sdk/p-e3efeb57.system.entry.js.map +0 -1
  126. package/dist/verdocs-web-sdk/p-f81f766c.entry.js +0 -8
  127. package/dist/verdocs-web-sdk/p-f81f766c.entry.js.map +0 -1
@@ -42,7 +42,7 @@ verdocs-contact-picker form .names-row {
42
42
  }
43
43
  verdocs-contact-picker form .names-row > input {
44
44
  font-size: 14px;
45
- width: 103px;
45
+ width: 83px;
46
46
  }
47
47
  verdocs-contact-picker form .kba-row {
48
48
  gap: 8px;
@@ -89,8 +89,8 @@ verdocs-contact-picker form .zip-code > input {
89
89
  }
90
90
  verdocs-contact-picker form label {
91
91
  display: flex;
92
- flex: 0 0 50px;
93
- font-size: 14px;
92
+ flex: 0 0 80px;
93
+ font-size: 13px;
94
94
  font-weight: 500;
95
95
  color: #5c6575;
96
96
  }
@@ -126,16 +126,17 @@ export class VerdocsContactPicker {
126
126
  return (h("div", { key: (_a = suggestion.id) !== null && _a !== void 0 ? _a : suggestion.email, class: "suggestion", onClick: e => this.handleSelectSuggestion(e, suggestion) }, suggestion.picture ? h("img", { alt: "Avatar", class: "avatar", src: suggestion.picture }) : h("div", { class: "avatar", innerHTML: addrBookIcon }), h("div", { class: "details" }, h("div", { class: "name" }, formatFullName(suggestion)), suggestion.email && h("div", { class: "destination" }, suggestion.email), suggestion.phone && h("div", { class: "destination" }, suggestion.phone))));
127
127
  })))), h("div", { key: 'f18fd6d889ea70f8a5e51bd1780007b3ff061b56', class: "row" }, h("label", { key: '5cda3922bb705ed0d3af00644df9ef8d42042021', htmlFor: this.emailFieldId }, "Email:"), h("input", { key: '34474c4c8bbbde2802b3c2f58ea3abed4b3e27f6', id: this.emailFieldId, name: this.emailFieldId, type: "text", "data-lpignore": "true", autoComplete: "blocked", value: this.email, placeholder: "Email address...", onFocus: () => (this.showSuggestions = false), onInput: (e) => (this.email = e.target.value) })), h("div", { key: 'c757b186ca60272855ed5701c59857856dcd863f', class: "row" }, h("label", { key: '1d971705ab36609db6a4e9cb7d24281d98441cd5', htmlFor: this.phoneFieldId }, "Phone:"), h("input", { key: '2a516e28498a6727409ef51e61ca3fe912c65789', id: this.phoneFieldId, name: this.phoneFieldId, type: "text", "data-lpignore": "true", autoComplete: "blocked", value: this.phone, placeholder: "Phone (SMS)...", onFocus: () => (this.showSuggestions = false), onInput: (e) => {
128
128
  this.phone = convertToE164(e.target.value);
129
- } })), this.showKba && (h(Fragment, { key: '05cdb2c78abc3156d04a012c40a52f2c6ab24a86' }, h("div", { key: '56d53a04ba6ab45ecc30f11e44669ad503400a49', class: "kba-row" }, h("label", { key: '8af91071db065071bb40e931ea92231f31e9c0c9' }, "KBA:"), h("verdocs-select-input", { key: '3f2eec31ee0078779eeed5d3f2fbd222fcdbaa42', value: this.kba_method, onInput: (e) => {
129
+ } })), this.showKba && (h(Fragment, { key: '05cdb2c78abc3156d04a012c40a52f2c6ab24a86' }, h("div", { key: '56d53a04ba6ab45ecc30f11e44669ad503400a49', class: "kba-row" }, h("label", { key: '8af91071db065071bb40e931ea92231f31e9c0c9' }, "Recipient Verification:"), h("verdocs-select-input", { key: 'b4696c06eec6b05ba81031fd66c9d30048035b2f', value: this.kba_method, onInput: (e) => {
130
130
  this.kba_method = e.target.value;
131
131
  this.zip = '';
132
132
  this.address = '';
133
133
  this.kba_pin = '';
134
134
  }, options: [
135
135
  { label: 'None', value: '' },
136
- { label: 'PIN Code', value: 'pin' },
137
- { label: 'Full Verification', value: 'identity' },
138
- ] }), h("div", { key: '33e9efc07399e6930264b4b79f73a5497728c7c7', style: { flex: '1' } }), h("verdocs-help-icon", { key: 'bc5ec8ad3fcf22a4f9a0f4659b574e238526574a', text: "Knowledge-Based Authentication adds additional authentication for this user either via a simple PIN code or full address validation. NOTE: There may be a fee for using this feature." })), this.kba_method === 'pin' && (h("div", { key: 'cd07404e1e9cd0a344c0975bdd23b2374d97ad61', class: "row pin-code" }, h("input", { key: '92909cedb50e11bffe60dcd032b2d8c3dd901834', id: "verdocs-pin-code", name: "verdocs-pin-code", type: "text", "data-lpignore": "true", autocomplete: "blocked", value: this.kba_pin, placeholder: "PIN Code...", onFocus: () => (this.showSuggestions = false), onInput: (e) => (this.kba_pin = e.target.value) }))), this.kba_method === 'identity' && (h("div", { key: '6ad1983ac8f9394bb9f35a8a9bba2f16d48d7bcd', class: "row address" }, h("input", { key: 'd598a1fb52b77eb85f17bda65f1730900d1d94e5', id: "verdocs-address", name: "verdocs-address", type: "text", "data-lpignore": "true", autocomplete: "blocked", value: this.address, placeholder: "Address...", onFocus: () => (this.showSuggestions = false), onInput: (e) => (this.address = e.target.value) }), h("verdocs-help-icon", { key: '09d3cfa8e92c6c59cda2cff599ae474296de35a0', text: "Pre-fill the recipient's current street address. They will still be asked ID challenge questions." }))), this.kba_method === 'identity' && (h("div", { key: '1ccb3caa35f5474f40245ca1fe9c11aa175b4cc2', class: "row zip-code" }, h("input", { key: 'e967aba3ffac6e25f359c56c0bd5cd057394ad82', id: "verdocs-zip-code", name: "verdocs-zip-code", type: "text", "data-lpignore": "true", autocomplete: "blocked", value: this.zip, placeholder: "Zip Code...", onFocus: () => (this.showSuggestions = false), onInput: (e) => (this.zip = e.target.value) }), h("verdocs-help-icon", { key: 'b4075b320d84028e8717e8383113751155a6aebf', text: "Pre-fill the recipient's current zip code. They will still be asked ID challenge questions." }))))), this.showMessage && (h("div", { key: '8212baa1274eb1dd98deeec972afeeb5bfb3c400', class: "row message" }, h("label", { key: '1b1c58c77ebd0dfd1e193e68a9bf472d93b8914f', htmlFor: "verdocs-contact-picker-message" }, "Message:"), h("input", { key: 'd5525496367b3fa0bde52a91bad7f68964454a3c', id: "verdocs-contact-picker-message", name: "verdocs-contact-picker-message", type: "text", "data-lpignore": "true", autocomplete: "blocked", value: this.message, placeholder: "Message shown in invitation...", onFocus: () => (this.showSuggestions = false), onInput: (e) => (this.message = e.target.value) }))), h("div", { key: 'c39a19e49ea3ae82ecb287bf2acb87734237fdb9', class: "buttons" }, h("verdocs-toggle-button", { key: '311f86449b98cad74d5811473578ab223237d39e', icon: kbaIcon, size: "small", active: this.showKba, onToggle: e => {
136
+ { label: 'Passcode', value: 'pin' },
137
+ // TODO: SMS feature flag and entitlement
138
+ { label: 'Knowledge-Based (KBA)', value: 'identity' },
139
+ ] }), h("div", { key: '9768c8b0be7676a41be3def114f8fe0f7f13abea', style: { flex: '1' } }), h("verdocs-help-icon", { key: '167d1eb5a977d35fa1ff374d6168e433d578828f', text: "Knowledge-Based Authentication adds additional authentication for this user either via a simple PIN code or full address validation. NOTE: There may be a fee for using this feature." })), this.kba_method === 'pin' && (h("div", { key: '6265713bb6e4a50d698364f59469f26162384924', class: "row pin-code" }, h("input", { key: '4001196fbcfb1c6c030c5b7b9f72890910d49eab', id: "verdocs-pin-code", name: "verdocs-pin-code", type: "text", "data-lpignore": "true", autocomplete: "blocked", value: this.kba_pin, placeholder: "PIN Code...", onFocus: () => (this.showSuggestions = false), onInput: (e) => (this.kba_pin = e.target.value) }))), this.kba_method === 'identity' && (h("div", { key: 'f8537cc8443a9e1ba81f9f39bf7f1f9dd82b8a15', class: "row address" }, h("input", { key: '755fb29d955c2a1af1f12f0cd81256c10ff79df6', id: "verdocs-address", name: "verdocs-address", type: "text", "data-lpignore": "true", autocomplete: "blocked", value: this.address, placeholder: "Address...", onFocus: () => (this.showSuggestions = false), onInput: (e) => (this.address = e.target.value) }), h("verdocs-help-icon", { key: 'd44e44ba39b4d426c760964aa7b263a758dbef06', text: "Pre-fill the recipient's current street address. They will still be asked ID challenge questions." }))), this.kba_method === 'identity' && (h("div", { key: '18a896e1ae09c39f0a0a5de13103516fb0d313c7', class: "row zip-code" }, h("input", { key: '94c2fb31ff9961ae07d64c0203d1b5c3756bb08e', id: "verdocs-zip-code", name: "verdocs-zip-code", type: "text", "data-lpignore": "true", autocomplete: "blocked", value: this.zip, placeholder: "Zip Code...", onFocus: () => (this.showSuggestions = false), onInput: (e) => (this.zip = e.target.value) }), h("verdocs-help-icon", { key: 'd01467b25467b1d3d718fcfca46ffe28efa995b7', text: "Pre-fill the recipient's current zip code. They will still be asked ID challenge questions." }))))), this.showMessage && (h("div", { key: '35146d6bd7df23248b811305fd6c542d435783ca', class: "row message" }, h("label", { key: 'efa29b9faf09edd9847f23d2b14232510acc5c45', htmlFor: "verdocs-contact-picker-message" }, "Message:"), h("input", { key: '887a58dfde10154191eb8ed447d7aec106fefb32', id: "verdocs-contact-picker-message", name: "verdocs-contact-picker-message", type: "text", "data-lpignore": "true", autocomplete: "blocked", value: this.message, placeholder: "Message shown in invitation...", onFocus: () => (this.showSuggestions = false), onInput: (e) => (this.message = e.target.value) }))), h("div", { key: '7093463a1fa71c4d700b40cf59314179ed14e56b', class: "buttons" }, h("verdocs-toggle-button", { key: '4b36b0fc7605b5d53019850053953aa37174e52e', icon: kbaIcon, size: "small", active: this.showKba, onToggle: e => {
139
140
  this.showKba = e.detail.active;
140
141
  if (!e.detail.active) {
141
142
  this.kba_pin = '';
@@ -143,10 +144,10 @@ export class VerdocsContactPicker {
143
144
  this.zip = '';
144
145
  }
145
146
  this.showSuggestions = false;
146
- } }), h("verdocs-toggle-button", { key: 'c51c8bba37758ad6ada6946d9c2df9880204b1be', icon: messageIcon, size: "small", active: this.showMessage, onToggle: e => {
147
+ } }), h("verdocs-toggle-button", { key: '74af3cf9142f697481deda60e0ce455150abdb7e', icon: messageIcon, size: "small", active: this.showMessage, onToggle: e => {
147
148
  this.showMessage = e.detail.active;
148
149
  this.showSuggestions = false;
149
- } }), h("div", { key: '747951c6d9273bf5142be1f20b6e51a2cc4239d5', class: "flex-fill" }), h("verdocs-button", { key: '12f60448cac7f6bb6804119ad620bdc77d4c0c9c', variant: "outline", label: "Cancel", size: "small", onClick: e => this.handleCancel(e) }), h("verdocs-button", { key: '507b52e7904d9e5c31e1ba40c7ffa0ccba7763f2', label: "OK", size: "small", disabled: !canSubmit, onClick: !canSubmit ? () => { } : e => this.handleSubmit(e) }))));
150
+ } }), h("div", { key: 'ed898d7e08aba69b9ecb7288c3e30ab29c301428', class: "flex-fill" }), h("verdocs-button", { key: 'cdcb81c831b8a9f714d658d85a37ddb0eebf57cc', variant: "outline", label: "Cancel", size: "small", onClick: e => this.handleCancel(e) }), h("verdocs-button", { key: 'b0fbf03a89a02320d123666b8b5e91ee2fa0f482', label: "OK", size: "small", disabled: !canSubmit, onClick: !canSubmit ? () => { } : e => this.handleSubmit(e) }))));
150
151
  }
151
152
  static get is() { return "verdocs-contact-picker"; }
152
153
  static get originalStyleUrls() {
@@ -1 +1 @@
1
- {"version":3,"file":"verdocs-contact-picker.js","sourceRoot":"","sources":["../../../../src/components/envelopes/verdocs-contact-picker/verdocs-contact-picker.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,CAAC,EAAE,KAAK,EAAgB,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAC,MAAM,eAAe,CAAC;AACvF,OAAO,EAAC,cAAc,EAAwB,YAAY,EAAE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AAC,EAAE,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,GAAI,CACxH,CACD,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {Component, h, Event, EventEmitter, Fragment, Prop, State} from '@stencil/core';\nimport {formatFullName, IProfile, IRecipient, isValidEmail, VerdocsEndpoint} from '@verdocs/js-sdk';\nimport {convertToE164} from '../../../utils/utils';\n\nconst messageIcon =\n '<svg focusable=\"false\" viewBox=\"0 0 24 24\"><path d=\"M20 2H4c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-2 12H6v-2h12v2zm0-3H6V9h12v2zm0-3H6V6h12v2z\"></path></svg>';\n\n// const delegateIcon =\n// '<svg focusable=\"false\" viewBox=\"0 0 24 24\"><path d=\"M19 3h-4.18C14.4 1.84 13.3 1 12 1c-1.3 0-2.4.84-2.82 2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-7 0c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zm0 4c1.66 0 3 1.34 3 3s-1.34 3-3 3-3-1.34-3-3 1.34-3 3-3zm6 12H6v-1.4c0-2 4-3.1 6-3.1s6 1.1 6 3.1V19z\"></path></svg>';\n\nconst kbaIcon =\n '<svg focusable=\"false\" viewBox=\"0 0 24 24\"><path fill-rule=\"evenodd\" d=\"M4.5 3.75a3 3 0 0 0-3 3v10.5a3 3 0 0 0 3 3h15a3 3 0 0 0 3-3V6.75a3 3 0 0 0-3-3h-15Zm4.125 3a2.25 2.25 0 1 0 0 4.5 2.25 2.25 0 0 0 0-4.5Zm-3.873 8.703a4.126 4.126 0 0 1 7.746 0 .75.75 0 0 1-.351.92 7.47 7.47 0 0 1-3.522.877 7.47 7.47 0 0 1-3.522-.877.75.75 0 0 1-.351-.92ZM15 8.25a.75.75 0 0 0 0 1.5h3.75a.75.75 0 0 0 0-1.5H15ZM14.25 12a.75.75 0 0 1 .75-.75h3.75a.75.75 0 0 1 0 1.5H15a.75.75 0 0 1-.75-.75Zm.75 2.25a.75.75 0 0 0 0 1.5h3.75a.75.75 0 0 0 0-1.5H15Z\" clip-rule=\"evenodd\" /></svg>';\n\nconst addrBookIcon = `<svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" class=\"lucide lucide-book-user\"><path d=\"M15 13a3 3 0 1 0-6 0\"/><path d=\"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20\"/><circle cx=\"12\" cy=\"8\" r=\"2\"/></svg>`;\n\nexport interface IContactSearchEvent {\n query: string;\n}\n\nexport interface IContactSelectEvent {\n first_name: string;\n last_name: string;\n email: string;\n phone: string;\n message: string;\n delegator: boolean;\n kba_method: string;\n kba_pin: string;\n address: string;\n zip: string;\n}\n\nexport type TPickerContact = Partial<IProfile>;\n\n/**\n * Display a contact picker suitable for filling out Recipient objects when sending Envelopes.\n *\n * This picker can also be integrated with a backend to provide contact list / suggestion / address-book style behavior. As the\n * user interacts with the component, the text entered in the name fields is sent back to the parent via the `searchContacts` event.\n * The parent can use that text as a query string to call a backend to obtain appropriate contacts to show. This list may also be\n * hard-coded ahead of time to provide the user with smart suggestions on initial display, such as \"Recently Used\" contacts, or\n * to always display the user's own contact record.\n *\n * ```ts\n * <verdocs-contact-picker\n * templateRole={role}\n * contactSuggestions={[]}\n * onNext={e => console.log('Contact completed', e.detail)}\n * />\n * ```\n */\n@Component({\n tag: 'verdocs-contact-picker',\n styleUrl: 'verdocs-contact-picker.scss',\n shadow: false,\n})\nexport class VerdocsContactPicker {\n /**\n * The endpoint to use to communicate with Verdocs. If not set, the default endpoint will be used.\n */\n @Prop() endpoint: VerdocsEndpoint = VerdocsEndpoint.getDefault();\n\n /**\n * The role that this contact will be assigned to.\n */\n @Prop() templateRole: Partial<IRecipient> | null = null;\n\n /**\n * If set, suggestions will be displayed in a drop-down list to the user. It is recommended that the number\n * of suggestions be limited to the 5 best matching records.\n */\n @Prop() contactSuggestions: TPickerContact[] = [];\n\n /**\n * Event fired when the user enters text in the search field. The calling application may use this to update\n * the `contactSuggestions` property.\n */\n @Event({composed: true}) searchContacts: EventEmitter<IContactSearchEvent>;\n\n /**\n * Event fired when the step is cancelled. This is called exit to avoid conflicts with the JS-reserved \"cancel\" event name.\n */\n @Event({composed: true}) exit: EventEmitter;\n\n /**\n * Event fired when the user changes the type.\n */\n @Event({composed: true}) next: EventEmitter<IContactSelectEvent>;\n\n @State() first_name: string;\n @State() last_name: string;\n @State() email: string;\n @State() phone: string;\n @State() zip: string;\n @State() address: string;\n @State() message: string;\n @State() showSuggestions: boolean = false;\n @State() showMessage: boolean = false;\n @State() delegator: boolean = false;\n @State() showKba: boolean = false;\n @State() kba_method: '' | 'pin' | 'identity' = '';\n @State() kba_pin: string = '';\n\n @State() nameFieldId = `verdocs-contact-picker-name-${Math.random().toString(36).substring(2, 11)}`;\n @State() firstNameFieldId = `verdocs-contact-picker-firstname-${Math.random().toString(36).substring(2, 11)}`;\n @State() lastNameFieldId = `verdocs-contact-picker-lastname-${Math.random().toString(36).substring(2, 11)}`;\n @State() emailFieldId = `verdocs-contact-picker-email-${Math.random().toString(36).substring(2, 11)}`;\n @State() phoneFieldId = `verdocs-contact-picker-phone-${Math.random().toString(36).substring(2, 11)}`;\n\n componentWillLoad() {\n if (this.templateRole) {\n const fullName = formatFullName(this.templateRole);\n const nameComponents = fullName.split(' ');\n const firstName = this.templateRole.first_name || nameComponents.shift() || '';\n const lastName = this.templateRole.last_name || nameComponents.join(' ') || '';\n this.first_name = firstName;\n this.last_name = lastName;\n\n this.email = this.templateRole.email || '';\n this.phone = this.templateRole.phone || '';\n this.delegator = this.templateRole.delegator || false;\n this.message = this.templateRole.message || '';\n this.showMessage = this.message !== '';\n this.kba_method = this.templateRole.kba_method || '';\n this.kba_pin = this.templateRole.kba_pin || '';\n this.showKba = !!this.kba_method;\n // TODO: Allow template roles to have zip codes predefined?\n }\n }\n\n handleFirstNameChange(e: any) {\n this.first_name = e.target.value;\n this.searchContacts?.emit({query: this.first_name});\n }\n\n handleLastNameChange(e: any) {\n this.last_name = e.target.value;\n this.searchContacts?.emit({query: this.last_name});\n }\n\n handleCancel(e: any) {\n e.stopPropagation();\n this.showSuggestions = false;\n this.exit?.emit();\n }\n\n handleSubmit(e: any) {\n e.stopPropagation();\n\n this.showSuggestions = false;\n this.next?.emit({\n first_name: this.first_name,\n last_name: this.last_name,\n email: this.email,\n phone: this.phone,\n message: this.message,\n delegator: this.delegator,\n kba_method: this.kba_method,\n kba_pin: this.kba_pin,\n address: this.address,\n zip: this.zip,\n });\n }\n\n handleSelectSuggestion(e: any, suggestion: TPickerContact) {\n e.stopPropagation();\n\n this.first_name = suggestion.first_name;\n this.last_name = suggestion.last_name;\n this.email = suggestion.email;\n this.phone = suggestion.phone;\n this.showSuggestions = false;\n }\n\n // The reason for the random names/IDs is to disable browser autocomplete. We set the autocomplete tags but many browsers ignore them\n // and show a duplicate autocomplete picker on top of our own.\n render() {\n // TODO: Re-activate this one SMS is re-enabled\n // const hasBasics = this.first_name && this.last_name && (isValidEmail(this.email) || isValidPhone(this.phone));\n const hasBasics = this.first_name && this.last_name && isValidEmail(this.email);\n const hasKbaRequirements =\n !this.kba_method ||\n (this.kba_method === 'pin' && this.kba_pin) ||\n this.kba_method === 'identity';\n // TODO: For discussion\n // (this.kba_method === 'identity' && this.address && this.zip)\n const canSubmit = hasBasics && hasKbaRequirements;\n\n return (\n <form onSubmit={e => e.preventDefault()} onClick={e => e.stopPropagation()} autocomplete=\"off\">\n <div class=\"row\">\n <label htmlFor={this.nameFieldId}>Name:</label>\n <div class=\"names-row\">\n <input\n id={this.firstNameFieldId}\n name={this.firstNameFieldId}\n type=\"text\"\n data-lpignore=\"true\"\n autocomplete=\"blocked\"\n value={this.first_name}\n placeholder=\"First...\"\n onFocus={() => (this.showSuggestions = this.contactSuggestions?.length > 0)}\n onInput={e => this.handleFirstNameChange(e)}\n />\n <input\n id={this.lastNameFieldId}\n name={this.lastNameFieldId}\n type=\"text\"\n data-lpignore=\"true\"\n autocomplete=\"blocked\"\n value={this.last_name}\n placeholder=\"Last...\"\n onFocus={() => (this.showSuggestions = false)}\n onInput={e => this.handleLastNameChange(e)}\n />\n </div>\n\n {this.showSuggestions && (\n <div class=\"dropdown\">\n {this.contactSuggestions\n .filter(suggestion => !this.first_name || suggestion.first_name.toLowerCase().includes(this.first_name.toLowerCase()))\n .map(suggestion => (\n <div key={suggestion.id ?? suggestion.email} class=\"suggestion\" onClick={e => this.handleSelectSuggestion(e, suggestion)}>\n {suggestion.picture ? <img alt=\"Avatar\" class=\"avatar\" src={suggestion.picture} /> : <div class=\"avatar\" innerHTML={addrBookIcon} />}\n <div class=\"details\">\n <div class=\"name\">{formatFullName(suggestion)}</div>\n {suggestion.email && <div class=\"destination\">{suggestion.email}</div>}\n {suggestion.phone && <div class=\"destination\">{suggestion.phone}</div>}\n </div>\n </div>\n ))}\n </div>\n )}\n </div>\n\n <div class=\"row\">\n <label htmlFor={this.emailFieldId}>Email:</label>\n <input\n id={this.emailFieldId}\n name={this.emailFieldId}\n type=\"text\"\n data-lpignore=\"true\"\n autoComplete=\"blocked\"\n value={this.email}\n placeholder=\"Email address...\"\n onFocus={() => (this.showSuggestions = false)}\n onInput={(e: any) => (this.email = e.target.value)}\n />\n </div>\n\n <div class=\"row\">\n <label htmlFor={this.phoneFieldId}>Phone:</label>\n <input\n id={this.phoneFieldId}\n name={this.phoneFieldId}\n type=\"text\"\n data-lpignore=\"true\"\n autoComplete=\"blocked\"\n value={this.phone}\n placeholder=\"Phone (SMS)...\"\n onFocus={() => (this.showSuggestions = false)}\n onInput={(e: any) => {\n this.phone = convertToE164(e.target.value);\n }}\n />\n </div>\n\n {this.showKba && (\n <Fragment>\n <div class=\"kba-row\">\n <label>KBA:</label>\n <verdocs-select-input\n value={this.kba_method}\n onInput={(e: any) => {\n this.kba_method = e.target.value;\n this.zip = '';\n this.address = '';\n this.kba_pin = '';\n }}\n options={[\n {label: 'None', value: ''},\n {label: 'PIN Code', value: 'pin'},\n {label: 'Full Verification', value: 'identity'},\n ]}\n />\n <div style={{flex: '1'}}></div>\n <verdocs-help-icon text=\"Knowledge-Based Authentication adds additional authentication for this user either via a simple PIN code or full address validation. NOTE: There may be a fee for using this feature.\" />\n </div>\n\n {this.kba_method === 'pin' && (\n <div class=\"row pin-code\">\n <input\n id=\"verdocs-pin-code\"\n name=\"verdocs-pin-code\"\n type=\"text\"\n data-lpignore=\"true\"\n autocomplete=\"blocked\"\n value={this.kba_pin}\n placeholder=\"PIN Code...\"\n onFocus={() => (this.showSuggestions = false)}\n onInput={(e: any) => (this.kba_pin = e.target.value)}\n />\n </div>\n )}\n\n {this.kba_method === 'identity' && (\n <div class=\"row address\">\n <input\n id=\"verdocs-address\"\n name=\"verdocs-address\"\n type=\"text\"\n data-lpignore=\"true\"\n autocomplete=\"blocked\"\n value={this.address}\n placeholder=\"Address...\"\n onFocus={() => (this.showSuggestions = false)}\n onInput={(e: any) => (this.address = e.target.value)}\n />\n <verdocs-help-icon text=\"Pre-fill the recipient's current street address. They will still be asked ID challenge questions.\" />\n </div>\n )}\n\n {this.kba_method === 'identity' && (\n <div class=\"row zip-code\">\n <input\n id=\"verdocs-zip-code\"\n name=\"verdocs-zip-code\"\n type=\"text\"\n data-lpignore=\"true\"\n autocomplete=\"blocked\"\n value={this.zip}\n placeholder=\"Zip Code...\"\n onFocus={() => (this.showSuggestions = false)}\n onInput={(e: any) => (this.zip = e.target.value)}\n />\n <verdocs-help-icon text=\"Pre-fill the recipient's current zip code. They will still be asked ID challenge questions.\" />\n </div>\n )}\n </Fragment>\n )}\n\n {this.showMessage && (\n <div class=\"row message\">\n <label htmlFor=\"verdocs-contact-picker-message\">Message:</label>\n <input\n id=\"verdocs-contact-picker-message\"\n name=\"verdocs-contact-picker-message\"\n type=\"text\"\n data-lpignore=\"true\"\n autocomplete=\"blocked\"\n value={this.message}\n placeholder=\"Message shown in invitation...\"\n onFocus={() => (this.showSuggestions = false)}\n onInput={(e: any) => (this.message = e.target.value)}\n />\n </div>\n )}\n\n <div class=\"buttons\">\n <verdocs-toggle-button\n icon={kbaIcon}\n size=\"small\"\n active={this.showKba}\n onToggle={e => {\n this.showKba = e.detail.active;\n if (!e.detail.active) {\n this.kba_pin = '';\n this.kba_method = '';\n this.zip = '';\n }\n this.showSuggestions = false;\n }}\n />\n <verdocs-toggle-button\n icon={messageIcon}\n size=\"small\"\n active={this.showMessage}\n onToggle={e => {\n this.showMessage = e.detail.active;\n this.showSuggestions = false;\n }}\n />\n\n <div class=\"flex-fill\" />\n\n <verdocs-button variant=\"outline\" label=\"Cancel\" size=\"small\" onClick={e => this.handleCancel(e)} />\n <verdocs-button label=\"OK\" size=\"small\" disabled={!canSubmit} onClick={!canSubmit ? () => {} : e => this.handleSubmit(e)} />\n </div>\n </form>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"verdocs-contact-picker.js","sourceRoot":"","sources":["../../../../src/components/envelopes/verdocs-contact-picker/verdocs-contact-picker.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,CAAC,EAAE,KAAK,EAAgB,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAC,MAAM,eAAe,CAAC;AACvF,OAAO,EAAC,cAAc,EAAwB,YAAY,EAAE,eAAe,EAAC,MAAM,iBAAiB,CAAC;AACpG,OAAO,EAAC,aAAa,EAAC,MAAM,sBAAsB,CAAC;AAEnD,MAAM,WAAW,GACf,2LAA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {Component, h, Event, EventEmitter, Fragment, Prop, State} from '@stencil/core';\nimport {formatFullName, IProfile, IRecipient, isValidEmail, VerdocsEndpoint} from '@verdocs/js-sdk';\nimport {convertToE164} from '../../../utils/utils';\n\nconst messageIcon =\n '<svg focusable=\"false\" viewBox=\"0 0 24 24\"><path d=\"M20 2H4c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-2 12H6v-2h12v2zm0-3H6V9h12v2zm0-3H6V6h12v2z\"></path></svg>';\n\n// const delegateIcon =\n// '<svg focusable=\"false\" viewBox=\"0 0 24 24\"><path d=\"M19 3h-4.18C14.4 1.84 13.3 1 12 1c-1.3 0-2.4.84-2.82 2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-7 0c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zm0 4c1.66 0 3 1.34 3 3s-1.34 3-3 3-3-1.34-3-3 1.34-3 3-3zm6 12H6v-1.4c0-2 4-3.1 6-3.1s6 1.1 6 3.1V19z\"></path></svg>';\n\nconst kbaIcon =\n '<svg focusable=\"false\" viewBox=\"0 0 24 24\"><path fill-rule=\"evenodd\" d=\"M4.5 3.75a3 3 0 0 0-3 3v10.5a3 3 0 0 0 3 3h15a3 3 0 0 0 3-3V6.75a3 3 0 0 0-3-3h-15Zm4.125 3a2.25 2.25 0 1 0 0 4.5 2.25 2.25 0 0 0 0-4.5Zm-3.873 8.703a4.126 4.126 0 0 1 7.746 0 .75.75 0 0 1-.351.92 7.47 7.47 0 0 1-3.522.877 7.47 7.47 0 0 1-3.522-.877.75.75 0 0 1-.351-.92ZM15 8.25a.75.75 0 0 0 0 1.5h3.75a.75.75 0 0 0 0-1.5H15ZM14.25 12a.75.75 0 0 1 .75-.75h3.75a.75.75 0 0 1 0 1.5H15a.75.75 0 0 1-.75-.75Zm.75 2.25a.75.75 0 0 0 0 1.5h3.75a.75.75 0 0 0 0-1.5H15Z\" clip-rule=\"evenodd\" /></svg>';\n\nconst addrBookIcon = `<svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" class=\"lucide lucide-book-user\"><path d=\"M15 13a3 3 0 1 0-6 0\"/><path d=\"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20\"/><circle cx=\"12\" cy=\"8\" r=\"2\"/></svg>`;\n\nexport interface IContactSearchEvent {\n query: string;\n}\n\nexport interface IContactSelectEvent {\n first_name: string;\n last_name: string;\n email: string;\n phone: string;\n message: string;\n delegator: boolean;\n kba_method: string;\n kba_pin: string;\n address: string;\n zip: string;\n}\n\nexport type TPickerContact = Partial<IProfile>;\n\n/**\n * Display a contact picker suitable for filling out Recipient objects when sending Envelopes.\n *\n * This picker can also be integrated with a backend to provide contact list / suggestion / address-book style behavior. As the\n * user interacts with the component, the text entered in the name fields is sent back to the parent via the `searchContacts` event.\n * The parent can use that text as a query string to call a backend to obtain appropriate contacts to show. This list may also be\n * hard-coded ahead of time to provide the user with smart suggestions on initial display, such as \"Recently Used\" contacts, or\n * to always display the user's own contact record.\n *\n * ```ts\n * <verdocs-contact-picker\n * templateRole={role}\n * contactSuggestions={[]}\n * onNext={e => console.log('Contact completed', e.detail)}\n * />\n * ```\n */\n@Component({\n tag: 'verdocs-contact-picker',\n styleUrl: 'verdocs-contact-picker.scss',\n shadow: false,\n})\nexport class VerdocsContactPicker {\n /**\n * The endpoint to use to communicate with Verdocs. If not set, the default endpoint will be used.\n */\n @Prop() endpoint: VerdocsEndpoint = VerdocsEndpoint.getDefault();\n\n /**\n * The role that this contact will be assigned to.\n */\n @Prop() templateRole: Partial<IRecipient> | null = null;\n\n /**\n * If set, suggestions will be displayed in a drop-down list to the user. It is recommended that the number\n * of suggestions be limited to the 5 best matching records.\n */\n @Prop() contactSuggestions: TPickerContact[] = [];\n\n /**\n * Event fired when the user enters text in the search field. The calling application may use this to update\n * the `contactSuggestions` property.\n */\n @Event({composed: true}) searchContacts: EventEmitter<IContactSearchEvent>;\n\n /**\n * Event fired when the step is cancelled. This is called exit to avoid conflicts with the JS-reserved \"cancel\" event name.\n */\n @Event({composed: true}) exit: EventEmitter;\n\n /**\n * Event fired when the user changes the type.\n */\n @Event({composed: true}) next: EventEmitter<IContactSelectEvent>;\n\n @State() first_name: string;\n @State() last_name: string;\n @State() email: string;\n @State() phone: string;\n @State() zip: string;\n @State() address: string;\n @State() message: string;\n @State() showSuggestions: boolean = false;\n @State() showMessage: boolean = false;\n @State() delegator: boolean = false;\n @State() showKba: boolean = false;\n @State() kba_method: '' | 'pin' | 'identity' = '';\n @State() kba_pin: string = '';\n\n @State() nameFieldId = `verdocs-contact-picker-name-${Math.random().toString(36).substring(2, 11)}`;\n @State() firstNameFieldId = `verdocs-contact-picker-firstname-${Math.random().toString(36).substring(2, 11)}`;\n @State() lastNameFieldId = `verdocs-contact-picker-lastname-${Math.random().toString(36).substring(2, 11)}`;\n @State() emailFieldId = `verdocs-contact-picker-email-${Math.random().toString(36).substring(2, 11)}`;\n @State() phoneFieldId = `verdocs-contact-picker-phone-${Math.random().toString(36).substring(2, 11)}`;\n\n componentWillLoad() {\n if (this.templateRole) {\n const fullName = formatFullName(this.templateRole);\n const nameComponents = fullName.split(' ');\n const firstName = this.templateRole.first_name || nameComponents.shift() || '';\n const lastName = this.templateRole.last_name || nameComponents.join(' ') || '';\n this.first_name = firstName;\n this.last_name = lastName;\n\n this.email = this.templateRole.email || '';\n this.phone = this.templateRole.phone || '';\n this.delegator = this.templateRole.delegator || false;\n this.message = this.templateRole.message || '';\n this.showMessage = this.message !== '';\n this.kba_method = this.templateRole.kba_method || '';\n this.kba_pin = this.templateRole.kba_pin || '';\n this.showKba = !!this.kba_method;\n // TODO: Allow template roles to have zip codes predefined?\n }\n }\n\n handleFirstNameChange(e: any) {\n this.first_name = e.target.value;\n this.searchContacts?.emit({query: this.first_name});\n }\n\n handleLastNameChange(e: any) {\n this.last_name = e.target.value;\n this.searchContacts?.emit({query: this.last_name});\n }\n\n handleCancel(e: any) {\n e.stopPropagation();\n this.showSuggestions = false;\n this.exit?.emit();\n }\n\n handleSubmit(e: any) {\n e.stopPropagation();\n\n this.showSuggestions = false;\n this.next?.emit({\n first_name: this.first_name,\n last_name: this.last_name,\n email: this.email,\n phone: this.phone,\n message: this.message,\n delegator: this.delegator,\n kba_method: this.kba_method,\n kba_pin: this.kba_pin,\n address: this.address,\n zip: this.zip,\n });\n }\n\n handleSelectSuggestion(e: any, suggestion: TPickerContact) {\n e.stopPropagation();\n\n this.first_name = suggestion.first_name;\n this.last_name = suggestion.last_name;\n this.email = suggestion.email;\n this.phone = suggestion.phone;\n this.showSuggestions = false;\n }\n\n // The reason for the random names/IDs is to disable browser autocomplete. We set the autocomplete tags but many browsers ignore them\n // and show a duplicate autocomplete picker on top of our own.\n render() {\n // TODO: Re-activate this one SMS is re-enabled\n // const hasBasics = this.first_name && this.last_name && (isValidEmail(this.email) || isValidPhone(this.phone));\n const hasBasics = this.first_name && this.last_name && isValidEmail(this.email);\n const hasKbaRequirements =\n !this.kba_method ||\n (this.kba_method === 'pin' && this.kba_pin) ||\n this.kba_method === 'identity';\n // TODO: For discussion\n // (this.kba_method === 'identity' && this.address && this.zip)\n const canSubmit = hasBasics && hasKbaRequirements;\n\n return (\n <form onSubmit={e => e.preventDefault()} onClick={e => e.stopPropagation()} autocomplete=\"off\">\n <div class=\"row\">\n <label htmlFor={this.nameFieldId}>Name:</label>\n <div class=\"names-row\">\n <input\n id={this.firstNameFieldId}\n name={this.firstNameFieldId}\n type=\"text\"\n data-lpignore=\"true\"\n autocomplete=\"blocked\"\n value={this.first_name}\n placeholder=\"First...\"\n onFocus={() => (this.showSuggestions = this.contactSuggestions?.length > 0)}\n onInput={e => this.handleFirstNameChange(e)}\n />\n <input\n id={this.lastNameFieldId}\n name={this.lastNameFieldId}\n type=\"text\"\n data-lpignore=\"true\"\n autocomplete=\"blocked\"\n value={this.last_name}\n placeholder=\"Last...\"\n onFocus={() => (this.showSuggestions = false)}\n onInput={e => this.handleLastNameChange(e)}\n />\n </div>\n\n {this.showSuggestions && (\n <div class=\"dropdown\">\n {this.contactSuggestions\n .filter(suggestion => !this.first_name || suggestion.first_name.toLowerCase().includes(this.first_name.toLowerCase()))\n .map(suggestion => (\n <div key={suggestion.id ?? suggestion.email} class=\"suggestion\" onClick={e => this.handleSelectSuggestion(e, suggestion)}>\n {suggestion.picture ? <img alt=\"Avatar\" class=\"avatar\" src={suggestion.picture} /> : <div class=\"avatar\" innerHTML={addrBookIcon} />}\n <div class=\"details\">\n <div class=\"name\">{formatFullName(suggestion)}</div>\n {suggestion.email && <div class=\"destination\">{suggestion.email}</div>}\n {suggestion.phone && <div class=\"destination\">{suggestion.phone}</div>}\n </div>\n </div>\n ))}\n </div>\n )}\n </div>\n\n <div class=\"row\">\n <label htmlFor={this.emailFieldId}>Email:</label>\n <input\n id={this.emailFieldId}\n name={this.emailFieldId}\n type=\"text\"\n data-lpignore=\"true\"\n autoComplete=\"blocked\"\n value={this.email}\n placeholder=\"Email address...\"\n onFocus={() => (this.showSuggestions = false)}\n onInput={(e: any) => (this.email = e.target.value)}\n />\n </div>\n\n <div class=\"row\">\n <label htmlFor={this.phoneFieldId}>Phone:</label>\n <input\n id={this.phoneFieldId}\n name={this.phoneFieldId}\n type=\"text\"\n data-lpignore=\"true\"\n autoComplete=\"blocked\"\n value={this.phone}\n placeholder=\"Phone (SMS)...\"\n onFocus={() => (this.showSuggestions = false)}\n onInput={(e: any) => {\n this.phone = convertToE164(e.target.value);\n }}\n />\n </div>\n\n {this.showKba && (\n <Fragment>\n <div class=\"kba-row\">\n <label>Recipient Verification:</label>\n <verdocs-select-input\n value={this.kba_method}\n onInput={(e: any) => {\n this.kba_method = e.target.value;\n this.zip = '';\n this.address = '';\n this.kba_pin = '';\n }}\n options={[\n {label: 'None', value: ''},\n {label: 'Passcode', value: 'pin'},\n // TODO: SMS feature flag and entitlement\n {label: 'Knowledge-Based (KBA)', value: 'identity'},\n ]}\n />\n <div style={{flex: '1'}}></div>\n <verdocs-help-icon text=\"Knowledge-Based Authentication adds additional authentication for this user either via a simple PIN code or full address validation. NOTE: There may be a fee for using this feature.\" />\n </div>\n\n {this.kba_method === 'pin' && (\n <div class=\"row pin-code\">\n <input\n id=\"verdocs-pin-code\"\n name=\"verdocs-pin-code\"\n type=\"text\"\n data-lpignore=\"true\"\n autocomplete=\"blocked\"\n value={this.kba_pin}\n placeholder=\"PIN Code...\"\n onFocus={() => (this.showSuggestions = false)}\n onInput={(e: any) => (this.kba_pin = e.target.value)}\n />\n </div>\n )}\n\n {this.kba_method === 'identity' && (\n <div class=\"row address\">\n <input\n id=\"verdocs-address\"\n name=\"verdocs-address\"\n type=\"text\"\n data-lpignore=\"true\"\n autocomplete=\"blocked\"\n value={this.address}\n placeholder=\"Address...\"\n onFocus={() => (this.showSuggestions = false)}\n onInput={(e: any) => (this.address = e.target.value)}\n />\n <verdocs-help-icon text=\"Pre-fill the recipient's current street address. They will still be asked ID challenge questions.\" />\n </div>\n )}\n\n {this.kba_method === 'identity' && (\n <div class=\"row zip-code\">\n <input\n id=\"verdocs-zip-code\"\n name=\"verdocs-zip-code\"\n type=\"text\"\n data-lpignore=\"true\"\n autocomplete=\"blocked\"\n value={this.zip}\n placeholder=\"Zip Code...\"\n onFocus={() => (this.showSuggestions = false)}\n onInput={(e: any) => (this.zip = e.target.value)}\n />\n <verdocs-help-icon text=\"Pre-fill the recipient's current zip code. They will still be asked ID challenge questions.\" />\n </div>\n )}\n </Fragment>\n )}\n\n {this.showMessage && (\n <div class=\"row message\">\n <label htmlFor=\"verdocs-contact-picker-message\">Message:</label>\n <input\n id=\"verdocs-contact-picker-message\"\n name=\"verdocs-contact-picker-message\"\n type=\"text\"\n data-lpignore=\"true\"\n autocomplete=\"blocked\"\n value={this.message}\n placeholder=\"Message shown in invitation...\"\n onFocus={() => (this.showSuggestions = false)}\n onInput={(e: any) => (this.message = e.target.value)}\n />\n </div>\n )}\n\n <div class=\"buttons\">\n <verdocs-toggle-button\n icon={kbaIcon}\n size=\"small\"\n active={this.showKba}\n onToggle={e => {\n this.showKba = e.detail.active;\n if (!e.detail.active) {\n this.kba_pin = '';\n this.kba_method = '';\n this.zip = '';\n }\n this.showSuggestions = false;\n }}\n />\n <verdocs-toggle-button\n icon={messageIcon}\n size=\"small\"\n active={this.showMessage}\n onToggle={e => {\n this.showMessage = e.detail.active;\n this.showSuggestions = false;\n }}\n />\n\n <div class=\"flex-fill\" />\n\n <verdocs-button variant=\"outline\" label=\"Cancel\" size=\"small\" onClick={e => this.handleCancel(e)} />\n <verdocs-button label=\"OK\" size=\"small\" disabled={!canSubmit} onClick={!canSubmit ? () => {} : e => this.handleSubmit(e)} />\n </div>\n </form>\n );\n }\n}\n"]}
@@ -0,0 +1,57 @@
1
+ @keyframes verdocs-field-pulse {
2
+ 0% {
3
+ background-color: rgba(0, 0, 0, 0.35);
4
+ }
5
+ 50% {
6
+ background-color: rgba(0, 0, 0, 0);
7
+ }
8
+ 100% {
9
+ background-color: rgba(0, 0, 0, 0.35);
10
+ }
11
+ }
12
+ verdocs-template-settings {
13
+ display: block;
14
+ max-width: 600px;
15
+ font-family: "Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;
16
+ }
17
+ verdocs-template-settings > form {
18
+ display: flex;
19
+ flex-direction: column;
20
+ background-color: #ffffff;
21
+ padding: 12px;
22
+ }
23
+ verdocs-template-settings > form h5 {
24
+ font-size: 16px;
25
+ font-weight: bold;
26
+ color: #46497d;
27
+ margin: 0 0 10px 0;
28
+ }
29
+ verdocs-template-settings > form label {
30
+ display: block;
31
+ font-size: 14px;
32
+ font-weight: 500;
33
+ margin: 0 0 4px 0;
34
+ color: #5c6575;
35
+ }
36
+ verdocs-template-settings > form input {
37
+ border: none;
38
+ font-size: 18px;
39
+ padding: 3px 6px 3px 0;
40
+ background: transparent;
41
+ border-bottom: 1px solid #33364b;
42
+ }
43
+ verdocs-template-settings > form input:focus {
44
+ outline: none;
45
+ }
46
+ verdocs-template-settings > form .row {
47
+ margin: 20px 0 0 0;
48
+ }
49
+ verdocs-template-settings .buttons {
50
+ display: flex;
51
+ column-gap: 8px;
52
+ margin-top: 16px;
53
+ flex-direction: row;
54
+ }
55
+ verdocs-template-settings ::placeholder {
56
+ color: #aaaaaa;
57
+ }
@@ -0,0 +1,282 @@
1
+ import { h, Host } from "@stencil/core";
2
+ import { getTemplate, updateTemplate, VerdocsEndpoint } from "@verdocs/js-sdk";
3
+ import { VerdocsToast } from "../../../utils/Toast";
4
+ import { SDKError } from "../../../utils/errors";
5
+ import { Store } from "../../../utils/Datastore";
6
+ const MS_PER_DAY = 24 * 60 * 60 * 1000;
7
+ /**
8
+ * Display an edit form that allows the user to adjust a template's roles and workflow.
9
+ */
10
+ export class VerdocsTemplateSettings {
11
+ constructor() {
12
+ this.templateListenerId = null;
13
+ this.endpoint = VerdocsEndpoint.getDefault();
14
+ this.templateId = '';
15
+ this.name = null;
16
+ this.visibility = 'private';
17
+ this.sender = 'envelope_creator';
18
+ this.sendReminders = false;
19
+ this.initialReminder = 0;
20
+ this.followupReminders = 0;
21
+ this.dirty = false;
22
+ this.loading = true;
23
+ this.template = null;
24
+ }
25
+ disconnectedCallback() {
26
+ this.unlistenToTemplate();
27
+ }
28
+ async listenToTemplate() {
29
+ console.log('[SETTINGS] Loading template', this.templateId);
30
+ this.unlistenToTemplate();
31
+ Store.subscribe('templates', this.templateId, () => getTemplate(this.endpoint, this.templateId), false, (template) => {
32
+ console.log('[SETTINGS] Template Updated', template);
33
+ this.template = template;
34
+ this.name = template.name;
35
+ this.visibility = template.visibility;
36
+ this.sender = template.sender;
37
+ this.sendReminders = template.initial_reminder !== null;
38
+ this.initialReminder = template.initial_reminder ? Math.floor(template.initial_reminder / MS_PER_DAY) : null;
39
+ this.followupReminders = template.followup_reminders ? Math.floor(template.followup_reminders / MS_PER_DAY) : null;
40
+ this.dirty = false;
41
+ this.loading = false;
42
+ });
43
+ }
44
+ unlistenToTemplate() {
45
+ if (this.templateListenerId) {
46
+ Store.store.delListener(this.templateListenerId);
47
+ this.templateListenerId = null;
48
+ }
49
+ }
50
+ async componentWillLoad() {
51
+ var _a, _b, _c;
52
+ try {
53
+ this.endpoint.loadSession();
54
+ if (!this.templateId) {
55
+ console.log(`[SETTINGS] Missing required template ID ${this.templateId}`);
56
+ return;
57
+ }
58
+ if (!this.endpoint.session) {
59
+ console.log('[SETTINGS] Unable to start builder session, must be authenticated');
60
+ return;
61
+ }
62
+ this.listenToTemplate();
63
+ }
64
+ catch (e) {
65
+ console.log('[SETTINGS] Error with preview session', e);
66
+ (_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));
67
+ }
68
+ }
69
+ handleCancel() {
70
+ var _a;
71
+ (_a = this.exit) === null || _a === void 0 ? void 0 : _a.emit();
72
+ }
73
+ handleSubmit() {
74
+ updateTemplate(this.endpoint, this.templateId, {
75
+ name: this.name,
76
+ visibility: this.visibility,
77
+ sender: this.sender,
78
+ initial_reminder: this.sendReminders ? this.initialReminder * MS_PER_DAY : null,
79
+ followup_reminders: this.sendReminders ? this.followupReminders * MS_PER_DAY : null,
80
+ })
81
+ .then(template => {
82
+ var _a, _b;
83
+ console.log('[SETTINGS] Template Updated', template);
84
+ this.dirty = false;
85
+ this.name = template.name;
86
+ this.visibility = template.visibility;
87
+ this.sender = template.sender;
88
+ this.sendReminders = template.initial_reminder !== null;
89
+ this.initialReminder = template.initial_reminder ? Math.floor(template.initial_reminder / MS_PER_DAY) : null;
90
+ this.followupReminders = template.followup_reminders ? Math.floor(template.followup_reminders / MS_PER_DAY) : null;
91
+ (_a = this.templateUpdated) === null || _a === void 0 ? void 0 : _a.emit({ endpoint: this.endpoint, template, event: 'update' });
92
+ (_b = this.next) === null || _b === void 0 ? void 0 : _b.emit();
93
+ })
94
+ .catch(e => {
95
+ var _a, _b, _c, _d, _e;
96
+ console.log('[SETTINGS] Error updating template', e);
97
+ (_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));
98
+ VerdocsToast(((_e = (_d = e.response) === null || _d === void 0 ? void 0 : _d.data) === null || _e === void 0 ? void 0 : _e.error) || 'Error updating template, please try again later.');
99
+ });
100
+ }
101
+ render() {
102
+ if (!this.endpoint.session) {
103
+ return (h(Host, null, h("verdocs-component-error", { message: "You must be authenticated to use this module." })));
104
+ }
105
+ if (this.loading || !this.template) {
106
+ return (h(Host, { class: "loading" }, h("verdocs-loader", null)));
107
+ }
108
+ return (h(Host, null, h("form", { onSubmit: e => e.preventDefault(), onClick: e => e.stopPropagation(), autocomplete: "off" }, h("h5", null, "Settings"), h("div", { class: "row" }, h("verdocs-text-input", { id: "verdocs-field-name", label: "Template Name", value: this.name, autocomplete: "off", placeholder: "Template Name...", onInput: (e) => {
109
+ this.name = e.target.value;
110
+ this.dirty = true;
111
+ } })), h("div", { class: "row" }, h("verdocs-select-input", { label: "Visibility", value: this.visibility, onInput: (e) => {
112
+ this.visibility = e.target.value;
113
+ this.dirty = true;
114
+ }, options: [
115
+ { value: 'private', label: 'Private' },
116
+ { value: 'shared', label: 'Shared' },
117
+ { value: 'public', label: 'Public' },
118
+ ] })), h("div", { class: "row" }, h("verdocs-select-input", { label: "Owner for envelopes created from this template", value: this.sender, onInput: (e) => {
119
+ this.sender = e.target.value;
120
+ this.dirty = true;
121
+ }, options: [
122
+ { value: 'envelope_creator', label: 'Envelope Creator' },
123
+ { value: 'template_owner', label: 'Template Owner' },
124
+ ] })), h("div", { class: "row" }, h("label", null, "Send Reminders"), h("verdocs-switch", { checked: this.sendReminders, onCheckedChange: e => (this.sendReminders = e.detail) })), this.sendReminders && (h("div", { class: "row" }, h("verdocs-text-input", { id: "verdocs-field-name", label: "First Reminder (days)", value: String(this.initialReminder || 0), autocomplete: "off", placeholder: "Delay in days...", onInput: (e) => {
125
+ this.initialReminder = +e.target.value;
126
+ this.dirty = true;
127
+ } }))), this.sendReminders && (h("div", { class: "row" }, h("verdocs-text-input", { id: "verdocs-field-name", label: "Follow-up Reminders (days)", value: String(this.followupReminders || 0), autocomplete: "off", placeholder: "Delay in days...", onInput: (e) => {
128
+ this.followupReminders = +e.target.value;
129
+ this.dirty = true;
130
+ } }))), h("div", { class: "buttons" }, h("verdocs-button", { variant: "outline", label: "Cancel", size: "small", onClick: () => this.handleCancel() }), h("verdocs-button", { label: "Save", size: "small", onClick: () => this.handleSubmit(), disabled: !this.dirty })))));
131
+ }
132
+ static get is() { return "verdocs-template-settings"; }
133
+ static get originalStyleUrls() {
134
+ return {
135
+ "$": ["verdocs-template-settings.scss"]
136
+ };
137
+ }
138
+ static get styleUrls() {
139
+ return {
140
+ "$": ["verdocs-template-settings.css"]
141
+ };
142
+ }
143
+ static get properties() {
144
+ return {
145
+ "endpoint": {
146
+ "type": "unknown",
147
+ "mutable": false,
148
+ "complexType": {
149
+ "original": "VerdocsEndpoint",
150
+ "resolved": "VerdocsEndpoint",
151
+ "references": {
152
+ "VerdocsEndpoint": {
153
+ "location": "import",
154
+ "path": "@verdocs/js-sdk",
155
+ "id": "node_modules::VerdocsEndpoint"
156
+ }
157
+ }
158
+ },
159
+ "required": false,
160
+ "optional": false,
161
+ "docs": {
162
+ "tags": [],
163
+ "text": "The endpoint to use to communicate with Verdocs. If not set, the default endpoint will be used."
164
+ },
165
+ "defaultValue": "VerdocsEndpoint.getDefault()"
166
+ },
167
+ "templateId": {
168
+ "type": "string",
169
+ "mutable": false,
170
+ "complexType": {
171
+ "original": "string",
172
+ "resolved": "string",
173
+ "references": {}
174
+ },
175
+ "required": false,
176
+ "optional": false,
177
+ "docs": {
178
+ "tags": [],
179
+ "text": "The template ID to edit."
180
+ },
181
+ "attribute": "template-id",
182
+ "reflect": false,
183
+ "defaultValue": "''"
184
+ }
185
+ };
186
+ }
187
+ static get states() {
188
+ return {
189
+ "name": {},
190
+ "visibility": {},
191
+ "sender": {},
192
+ "sendReminders": {},
193
+ "initialReminder": {},
194
+ "followupReminders": {},
195
+ "dirty": {},
196
+ "loading": {},
197
+ "template": {}
198
+ };
199
+ }
200
+ static get events() {
201
+ return [{
202
+ "method": "next",
203
+ "name": "next",
204
+ "bubbles": true,
205
+ "cancelable": true,
206
+ "composed": true,
207
+ "docs": {
208
+ "tags": [],
209
+ "text": "Event fired when the user clicks to proceed."
210
+ },
211
+ "complexType": {
212
+ "original": "any",
213
+ "resolved": "any",
214
+ "references": {}
215
+ }
216
+ }, {
217
+ "method": "exit",
218
+ "name": "exit",
219
+ "bubbles": true,
220
+ "cancelable": true,
221
+ "composed": true,
222
+ "docs": {
223
+ "tags": [],
224
+ "text": "Event fired when the step is cancelled. This is called exit to avoid conflicts with the JS-reserved \"cancel\" event name."
225
+ },
226
+ "complexType": {
227
+ "original": "any",
228
+ "resolved": "any",
229
+ "references": {}
230
+ }
231
+ }, {
232
+ "method": "sdkError",
233
+ "name": "sdkError",
234
+ "bubbles": true,
235
+ "cancelable": true,
236
+ "composed": true,
237
+ "docs": {
238
+ "tags": [],
239
+ "text": "Event fired if an error occurs. The event details will contain information about the error. Most errors will\nterminate the process, and the calling application should correct the condition and re-render the component."
240
+ },
241
+ "complexType": {
242
+ "original": "SDKError",
243
+ "resolved": "SDKError",
244
+ "references": {
245
+ "SDKError": {
246
+ "location": "import",
247
+ "path": "../../../utils/errors",
248
+ "id": "src/utils/errors.ts::SDKError"
249
+ }
250
+ }
251
+ }
252
+ }, {
253
+ "method": "templateUpdated",
254
+ "name": "templateUpdated",
255
+ "bubbles": true,
256
+ "cancelable": true,
257
+ "composed": true,
258
+ "docs": {
259
+ "tags": [],
260
+ "text": "Event fired when the template is updated in any way. May be used for tasks such as cache invalidation or reporting to other systems."
261
+ },
262
+ "complexType": {
263
+ "original": "{endpoint: VerdocsEndpoint; template: ITemplate; event: string}",
264
+ "resolved": "{ endpoint: VerdocsEndpoint; template: ITemplate; event: string; }",
265
+ "references": {
266
+ "VerdocsEndpoint": {
267
+ "location": "import",
268
+ "path": "@verdocs/js-sdk",
269
+ "id": "node_modules::VerdocsEndpoint"
270
+ },
271
+ "ITemplate": {
272
+ "location": "import",
273
+ "path": "@verdocs/js-sdk",
274
+ "id": "node_modules::ITemplate"
275
+ }
276
+ }
277
+ }
278
+ }];
279
+ }
280
+ static get elementRef() { return "el"; }
281
+ }
282
+ //# sourceMappingURL=verdocs-template-settings.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"verdocs-template-settings.js","sourceRoot":"","sources":["../../../../src/components/templates/verdocs-template-settings/verdocs-template-settings.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,CAAC,EAAE,OAAO,EAAE,KAAK,EAAgB,IAAI,EAAE,IAAI,EAAE,KAAK,EAAC,MAAM,eAAe,CAAC;AAC5F,OAAO,EAAC,WAAW,EAAmD,cAAc,EAAE,eAAe,EAAC,MAAM,iBAAiB,CAAC;AAC9H,OAAO,EAAC,YAAY,EAAC,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAC,QAAQ,EAAC,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAC,KAAK,EAAC,MAAM,0BAA0B,CAAC;AAE/C,MAAM,UAAU,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AAEvC;;GAEG;AAMH,MAAM,O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AAQ,EAAE,CAAC,IAAI,CAAC,KAAK,GAAI,CACnG,CACD,CACF,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {Component, h, Element, Event, EventEmitter, Host, Prop, State} from '@stencil/core';\nimport {getTemplate, ITemplate, TTemplateSender, TTemplateVisibility, updateTemplate, VerdocsEndpoint} from '@verdocs/js-sdk';\nimport {VerdocsToast} from '../../../utils/Toast';\nimport {SDKError} from '../../../utils/errors';\nimport {Store} from '../../../utils/Datastore';\n\nconst MS_PER_DAY = 24 * 60 * 60 * 1000;\n\n/**\n * Display an edit form that allows the user to adjust a template's roles and workflow.\n */\n@Component({\n tag: 'verdocs-template-settings',\n styleUrl: 'verdocs-template-settings.scss',\n shadow: false,\n})\nexport class VerdocsTemplateSettings {\n private templateListenerId = null;\n\n @Element()\n el: HTMLElement;\n\n /**\n * The endpoint to use to communicate with Verdocs. If not set, the default endpoint will be used.\n */\n @Prop() endpoint: VerdocsEndpoint = VerdocsEndpoint.getDefault();\n\n /**\n * The template ID to edit.\n */\n @Prop() templateId: string = '';\n\n /**\n * Event fired when the user clicks to proceed.\n */\n @Event({composed: true}) next: EventEmitter;\n\n /**\n * Event fired when the step is cancelled. This is called exit to avoid conflicts with the JS-reserved \"cancel\" event name.\n */\n @Event({composed: true}) exit: EventEmitter;\n\n /**\n * Event fired if an error occurs. The event details will contain information about the error. Most errors will\n * terminate the process, and the calling application should correct the condition and re-render the component.\n */\n @Event({composed: true}) sdkError: EventEmitter<SDKError>;\n\n /**\n * Event fired when the template is updated in any way. May be used for tasks such as cache invalidation or reporting to other systems.\n */\n @Event({composed: true}) templateUpdated: EventEmitter<{endpoint: VerdocsEndpoint; template: ITemplate; event: string}>;\n\n @State() name: string | null = null;\n @State() visibility: TTemplateVisibility = 'private';\n @State() sender: TTemplateSender = 'envelope_creator';\n @State() sendReminders = false;\n @State() initialReminder = 0;\n @State() followupReminders = 0;\n @State() dirty = false;\n\n @State() loading = true;\n @State() template: ITemplate | null = null;\n\n disconnectedCallback() {\n this.unlistenToTemplate();\n }\n\n async listenToTemplate() {\n console.log('[SETTINGS] Loading template', this.templateId);\n this.unlistenToTemplate();\n Store.subscribe(\n 'templates',\n this.templateId,\n () => getTemplate(this.endpoint, this.templateId),\n false,\n (template: ITemplate) => {\n console.log('[SETTINGS] Template Updated', template);\n this.template = template;\n this.name = template.name;\n this.visibility = template.visibility;\n this.sender = template.sender;\n this.sendReminders = template.initial_reminder !== null;\n this.initialReminder = template.initial_reminder ? Math.floor(template.initial_reminder / MS_PER_DAY) : null;\n this.followupReminders = template.followup_reminders ? Math.floor(template.followup_reminders / MS_PER_DAY) : null;\n this.dirty = false;\n this.loading = false;\n },\n );\n }\n\n unlistenToTemplate() {\n if (this.templateListenerId) {\n Store.store.delListener(this.templateListenerId);\n this.templateListenerId = null;\n }\n }\n\n async componentWillLoad() {\n try {\n this.endpoint.loadSession();\n\n if (!this.templateId) {\n console.log(`[SETTINGS] Missing required template ID ${this.templateId}`);\n return;\n }\n\n if (!this.endpoint.session) {\n console.log('[SETTINGS] Unable to start builder session, must be authenticated');\n return;\n }\n\n this.listenToTemplate();\n } catch (e) {\n console.log('[SETTINGS] Error with preview session', e);\n this.sdkError?.emit(new SDKError(e.message, e.response?.status, e.response?.data));\n }\n }\n\n handleCancel() {\n this.exit?.emit();\n }\n\n handleSubmit() {\n updateTemplate(this.endpoint, this.templateId, {\n name: this.name,\n visibility: this.visibility,\n sender: this.sender,\n initial_reminder: this.sendReminders ? this.initialReminder * MS_PER_DAY : null,\n followup_reminders: this.sendReminders ? this.followupReminders * MS_PER_DAY : null,\n })\n .then(template => {\n console.log('[SETTINGS] Template Updated', template);\n this.dirty = false;\n this.name = template.name;\n this.visibility = template.visibility;\n this.sender = template.sender;\n this.sendReminders = template.initial_reminder !== null;\n this.initialReminder = template.initial_reminder ? Math.floor(template.initial_reminder / MS_PER_DAY) : null;\n this.followupReminders = template.followup_reminders ? Math.floor(template.followup_reminders / MS_PER_DAY) : null;\n this.templateUpdated?.emit({endpoint: this.endpoint, template, event: 'update'});\n this.next?.emit();\n })\n .catch(e => {\n console.log('[SETTINGS] Error updating template', e);\n this.sdkError?.emit(new SDKError(e.message, e.response?.status, e.response?.data));\n VerdocsToast(e.response?.data?.error || 'Error updating template, please try again later.');\n });\n }\n\n render() {\n if (!this.endpoint.session) {\n return (\n <Host>\n <verdocs-component-error message=\"You must be authenticated to use this module.\" />\n </Host>\n );\n }\n\n if (this.loading || !this.template) {\n return (\n <Host class=\"loading\">\n <verdocs-loader />\n </Host>\n );\n }\n\n return (\n <Host>\n <form onSubmit={e => e.preventDefault()} onClick={e => e.stopPropagation()} autocomplete=\"off\">\n <h5>Settings</h5>\n\n <div class=\"row\">\n <verdocs-text-input\n id=\"verdocs-field-name\"\n label=\"Template Name\"\n value={this.name}\n autocomplete=\"off\"\n placeholder=\"Template Name...\"\n onInput={(e: any) => {\n this.name = e.target.value;\n this.dirty = true;\n }}\n />\n </div>\n\n <div class=\"row\">\n <verdocs-select-input\n label=\"Visibility\"\n value={this.visibility}\n onInput={(e: any) => {\n this.visibility = e.target.value;\n this.dirty = true;\n }}\n options={[\n {value: 'private', label: 'Private'},\n {value: 'shared', label: 'Shared'},\n {value: 'public', label: 'Public'},\n ]}\n />\n </div>\n\n <div class=\"row\">\n <verdocs-select-input\n label=\"Owner for envelopes created from this template\"\n value={this.sender}\n onInput={(e: any) => {\n this.sender = e.target.value;\n this.dirty = true;\n }}\n options={[\n {value: 'envelope_creator', label: 'Envelope Creator'},\n {value: 'template_owner', label: 'Template Owner'},\n ]}\n />\n </div>\n\n <div class=\"row\">\n <label>Send Reminders</label>\n <verdocs-switch checked={this.sendReminders} onCheckedChange={e => (this.sendReminders = e.detail)} />\n </div>\n\n {this.sendReminders && (\n <div class=\"row\">\n <verdocs-text-input\n id=\"verdocs-field-name\"\n label=\"First Reminder (days)\"\n value={String(this.initialReminder || 0)}\n autocomplete=\"off\"\n placeholder=\"Delay in days...\"\n onInput={(e: any) => {\n this.initialReminder = +e.target.value;\n this.dirty = true;\n }}\n />\n </div>\n )}\n\n {this.sendReminders && (\n <div class=\"row\">\n <verdocs-text-input\n id=\"verdocs-field-name\"\n label=\"Follow-up Reminders (days)\"\n value={String(this.followupReminders || 0)}\n autocomplete=\"off\"\n placeholder=\"Delay in days...\"\n onInput={(e: any) => {\n this.followupReminders = +e.target.value;\n this.dirty = true;\n }}\n />\n </div>\n )}\n\n <div class=\"buttons\">\n <verdocs-button variant=\"outline\" label=\"Cancel\" size=\"small\" onClick={() => this.handleCancel()} />\n <verdocs-button label=\"Save\" size=\"small\" onClick={() => this.handleSubmit()} disabled={!this.dirty} />\n </div>\n </form>\n </Host>\n );\n }\n}\n"]}
@@ -58,6 +58,7 @@ import { VerdocsTemplateFieldProperties } from './verdocs-template-field-propert
58
58
  import { VerdocsTemplateFields } from './verdocs-template-fields.js';
59
59
  import { VerdocsTemplateRoleProperties } from './verdocs-template-role-properties.js';
60
60
  import { VerdocsTemplateRoles } from './verdocs-template-roles.js';
61
+ import { VerdocsTemplateSettings } from './verdocs-template-settings.js';
61
62
  import { VerdocsTemplateStar } from './verdocs-template-star.js';
62
63
  import { VerdocsTemplateTags } from './verdocs-template-tags.js';
63
64
  import { VerdocsTemplatesList } from './verdocs-templates-list.js';
@@ -132,6 +133,7 @@ const defineCustomElements = (opts) => {
132
133
  VerdocsTemplateFields,
133
134
  VerdocsTemplateRoleProperties,
134
135
  VerdocsTemplateRoles,
136
+ VerdocsTemplateSettings,
135
137
  VerdocsTemplateStar,
136
138
  VerdocsTemplateTags,
137
139
  VerdocsTemplatesList,
@@ -1 +1 @@
1
- {"file":"index.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":[],"sourcesContent":[],"version":3}
1
+ {"file":"index.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":[],"sourcesContent":[],"version":3}