@verdocs/web-sdk 2.3.6 → 2.3.8

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 (60) hide show
  1. package/dist/cjs/loader.cjs.js +1 -1
  2. package/dist/cjs/{verdocs-contact-picker_2.cjs.entry.js → verdocs-contact-picker_3.cjs.entry.js} +73 -1
  3. package/dist/cjs/verdocs-field-dropdown.cjs.entry.js +0 -1
  4. package/dist/cjs/verdocs-preview_8.cjs.entry.js +2 -1
  5. package/dist/cjs/verdocs-template-fields_4.cjs.entry.js +4 -1
  6. package/dist/cjs/verdocs-web-sdk.cjs.js +1 -1
  7. package/dist/collection/collection-manifest.json +1 -0
  8. package/dist/collection/components/controls/verdocs-portal/verdocs-portal.css +0 -0
  9. package/dist/collection/components/controls/verdocs-portal/verdocs-portal.js +181 -0
  10. package/dist/collection/components/controls/verdocs-portal/verdocs-portal.stories.js +20 -0
  11. package/dist/collection/components/embeds/verdocs-send/verdocs-send.js +2 -1
  12. package/dist/collection/components/envelopes/verdocs-contact-picker/verdocs-contact-picker.css +4 -1
  13. package/dist/collection/components/fields/verdocs-field-dropdown/verdocs-field-dropdown.js +0 -1
  14. package/dist/collection/components/templates/verdocs-template-fields/verdocs-template-fields.js +4 -1
  15. package/dist/components/index.d.ts +1 -0
  16. package/dist/components/index.js +1 -0
  17. package/dist/components/verdocs-build.js +22 -16
  18. package/dist/components/verdocs-contact-picker2.js +1 -1
  19. package/dist/components/verdocs-field-dropdown.js +0 -1
  20. package/dist/components/verdocs-portal.d.ts +11 -0
  21. package/dist/components/verdocs-portal.js +6 -0
  22. package/dist/components/verdocs-portal2.js +93 -0
  23. package/dist/components/verdocs-send2.js +12 -5
  24. package/dist/components/verdocs-template-fields2.js +4 -1
  25. package/dist/docs.json +122 -1
  26. package/dist/esm/loader.js +1 -1
  27. package/dist/esm/{verdocs-contact-picker_2.entry.js → verdocs-contact-picker_3.entry.js} +73 -2
  28. package/dist/esm/verdocs-field-dropdown.entry.js +0 -1
  29. package/dist/esm/verdocs-preview_8.entry.js +2 -1
  30. package/dist/esm/verdocs-template-fields_4.entry.js +4 -1
  31. package/dist/esm/verdocs-web-sdk.js +1 -1
  32. package/dist/esm-es5/loader.js +1 -1
  33. package/dist/esm-es5/verdocs-contact-picker_3.entry.js +1 -0
  34. package/dist/esm-es5/verdocs-field-dropdown.entry.js +1 -1
  35. package/dist/esm-es5/verdocs-preview_8.entry.js +1 -1
  36. package/dist/esm-es5/verdocs-template-fields_4.entry.js +1 -1
  37. package/dist/esm-es5/verdocs-web-sdk.js +1 -1
  38. package/dist/types/components/controls/verdocs-portal/verdocs-portal.d.ts +37 -0
  39. package/dist/types/components/controls/verdocs-portal/verdocs-portal.stories.d.ts +7 -0
  40. package/dist/types/components.d.ts +42 -0
  41. package/dist/verdocs-web-sdk/{p-ad0805b6.system.entry.js → p-0d4739c4.system.entry.js} +1 -1
  42. package/dist/verdocs-web-sdk/p-7c61d1b4.system.entry.js +1 -0
  43. package/dist/verdocs-web-sdk/p-8941fee6.entry.js +1 -0
  44. package/dist/verdocs-web-sdk/p-992f92f4.entry.js +1 -0
  45. package/dist/verdocs-web-sdk/p-9b1c719d.system.entry.js +1 -0
  46. package/dist/verdocs-web-sdk/p-9b1cb5bd.entry.js +1 -0
  47. package/dist/verdocs-web-sdk/p-eb8029ba.entry.js +1 -0
  48. package/dist/verdocs-web-sdk/p-f04bf956.system.js +1 -1
  49. package/dist/verdocs-web-sdk/p-f25a6c17.system.entry.js +1 -0
  50. package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
  51. package/package.json +1 -1
  52. package/dist/custom-elements.json +0 -2059
  53. package/dist/esm-es5/verdocs-contact-picker_2.entry.js +0 -1
  54. package/dist/verdocs-web-sdk/p-0f4a5b95.entry.js +0 -1
  55. package/dist/verdocs-web-sdk/p-242f4479.entry.js +0 -1
  56. package/dist/verdocs-web-sdk/p-2979d6eb.entry.js +0 -1
  57. package/dist/verdocs-web-sdk/p-57fd4c5e.system.entry.js +0 -1
  58. package/dist/verdocs-web-sdk/p-663073d5.system.entry.js +0 -1
  59. package/dist/verdocs-web-sdk/p-6ff52337.entry.js +0 -1
  60. package/dist/verdocs-web-sdk/p-d33eb0d9.system.entry.js +0 -1
@@ -1,6 +1,9 @@
1
1
  verdocs-contact-picker {
2
- font-family: "Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;
2
+ display: block;
3
+ border: 1px solid #ebebeb;
3
4
  background-color: #ffffff;
5
+ font-family: "Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;
6
+ box-shadow: 0 0 15px 0 rgba(0, 0, 0, 0.1);
4
7
  }
5
8
  verdocs-contact-picker form {
6
9
  background-color: #f5f5fa;
@@ -25,7 +25,6 @@ export class VerdocsFieldDropdown {
25
25
  }
26
26
  async showSettingsPanel() {
27
27
  const settingsPanel = document.getElementById(`verdocs-settings-panel-${this.field.name}`);
28
- console.log('will hide', settingsPanel);
29
28
  if (settingsPanel && settingsPanel.showPanel) {
30
29
  settingsPanel.showPanel();
31
30
  }
@@ -185,6 +185,7 @@ export class VerdocsTemplateFields {
185
185
  const name = event.target.getAttribute('name');
186
186
  const option = +(event.target.getAttribute('option') || '0');
187
187
  const field = (_a = this.store) === null || _a === void 0 ? void 0 : _a.state.fields.find(field => field.name === name);
188
+ console.log('Dropped field', name, field);
188
189
  if (!field) {
189
190
  console.log('[FIELDS] Unable to find field', name);
190
191
  return;
@@ -194,12 +195,14 @@ export class VerdocsTemplateFields {
194
195
  const clientRect = event.target.getBoundingClientRect();
195
196
  const parent = event.target.parentElement;
196
197
  const parentRect = parent.getBoundingClientRect();
198
+ const width = field.setting.width || defaultWidth(field.type);
199
+ const height = field.setting.height || defaultHeight(field.type);
197
200
  // These two being backwards is not a mistake. Left measures "over" from the left (positive displacement) while bottom measures
198
201
  // "up" from the bottom (negative displacement).
199
202
  const newX = Math.max(clientRect.left - parentRect.left, 0);
200
203
  const newY = Math.max(renderedHeight - (parentRect.bottom - clientRect.bottom), 0);
201
204
  // console.log('Computing coordinates', {naturalWidth, width: event.rect.width, naturalHeight, height: event.rect.height, newX, newY});
202
- const { x, y } = this.viewCoordinatesToPageCoordinates(newX, newY, pageNumber, naturalWidth - field.setting.width, naturalHeight - field.setting.height);
205
+ const { x, y } = this.viewCoordinatesToPageCoordinates(newX, newY, pageNumber, naturalWidth - width, naturalHeight - height);
203
206
  // console.log('Drop End', {x, y, newX, newY});
204
207
  switch (field.type) {
205
208
  case 'attachment':
@@ -35,6 +35,7 @@ export { VerdocsLoader as VerdocsLoader } from '../types/components/controls/ver
35
35
  export { VerdocsOkDialog as VerdocsOkDialog } from '../types/components/dialogs/verdocs-ok-dialog/verdocs-ok-dialog';
36
36
  export { VerdocsOrganizationCard as VerdocsOrganizationCard } from '../types/components/controls/verdocs-organization-card/verdocs-organization-card';
37
37
  export { VerdocsQuickFilter as VerdocsPagination } from '../types/components/controls/verdocs-pagination/verdocs-pagination';
38
+ export { VerdocsPortal as VerdocsPortal } from '../types/components/controls/verdocs-portal/verdocs-portal';
38
39
  export { VerdocsPreview as VerdocsPreview } from '../types/components/embeds/verdocs-preview/verdocs-preview';
39
40
  export { VerdocsProgressBar as VerdocsProgressBar } from '../types/components/controls/verdocs-progress-bar/verdocs-progress-bar';
40
41
  export { VerdocsQuickFilter as VerdocsQuickFilter } from '../types/components/controls/verdocs-quick-filter/verdocs-quick-filter';
@@ -35,6 +35,7 @@ export { VerdocsLoader, defineCustomElement as defineCustomElementVerdocsLoader
35
35
  export { VerdocsOkDialog, defineCustomElement as defineCustomElementVerdocsOkDialog } from './verdocs-ok-dialog.js';
36
36
  export { VerdocsOrganizationCard, defineCustomElement as defineCustomElementVerdocsOrganizationCard } from './verdocs-organization-card.js';
37
37
  export { VerdocsPagination, defineCustomElement as defineCustomElementVerdocsPagination } from './verdocs-pagination.js';
38
+ export { VerdocsPortal, defineCustomElement as defineCustomElementVerdocsPortal } from './verdocs-portal.js';
38
39
  export { VerdocsPreview, defineCustomElement as defineCustomElementVerdocsPreview } from './verdocs-preview.js';
39
40
  export { VerdocsProgressBar, defineCustomElement as defineCustomElementVerdocsProgressBar } from './verdocs-progress-bar.js';
40
41
  export { VerdocsQuickFilter, defineCustomElement as defineCustomElementVerdocsQuickFilter } from './verdocs-quick-filter.js';
@@ -3,14 +3,15 @@ import './Types.js';
3
3
  import { V as VerdocsEndpoint } from './VerdocsEndpoint.js';
4
4
  import { g as getTemplateStore } from './TemplateStore.js';
5
5
  import { S as SDKError } from './errors.js';
6
- import { d as defineCustomElement$u } from './verdocs-button2.js';
7
- import { d as defineCustomElement$t } from './verdocs-checkbox2.js';
8
- import { d as defineCustomElement$s } from './verdocs-component-error2.js';
9
- import { d as defineCustomElement$r } from './verdocs-contact-picker2.js';
10
- import { d as defineCustomElement$q } from './verdocs-file-chooser2.js';
11
- import { d as defineCustomElement$p } from './verdocs-help-icon2.js';
12
- import { d as defineCustomElement$o } from './verdocs-loader2.js';
13
- import { d as defineCustomElement$n } from './verdocs-ok-dialog2.js';
6
+ import { d as defineCustomElement$v } from './verdocs-button2.js';
7
+ import { d as defineCustomElement$u } from './verdocs-checkbox2.js';
8
+ import { d as defineCustomElement$t } from './verdocs-component-error2.js';
9
+ import { d as defineCustomElement$s } from './verdocs-contact-picker2.js';
10
+ import { d as defineCustomElement$r } from './verdocs-file-chooser2.js';
11
+ import { d as defineCustomElement$q } from './verdocs-help-icon2.js';
12
+ import { d as defineCustomElement$p } from './verdocs-loader2.js';
13
+ import { d as defineCustomElement$o } from './verdocs-ok-dialog2.js';
14
+ import { d as defineCustomElement$n } from './verdocs-portal2.js';
14
15
  import { d as defineCustomElement$m } from './verdocs-preview2.js';
15
16
  import { d as defineCustomElement$l } from './verdocs-progress-bar2.js';
16
17
  import { d as defineCustomElement$k } from './verdocs-radio-button2.js';
@@ -143,7 +144,7 @@ function defineCustomElement$1() {
143
144
  if (typeof customElements === "undefined") {
144
145
  return;
145
146
  }
146
- const components = ["verdocs-build", "verdocs-button", "verdocs-checkbox", "verdocs-component-error", "verdocs-contact-picker", "verdocs-file-chooser", "verdocs-help-icon", "verdocs-loader", "verdocs-ok-dialog", "verdocs-preview", "verdocs-progress-bar", "verdocs-radio-button", "verdocs-select-input", "verdocs-send", "verdocs-spinner", "verdocs-tabs", "verdocs-template-attachments", "verdocs-template-build-tabs", "verdocs-template-create", "verdocs-template-document-page", "verdocs-template-fields", "verdocs-template-name", "verdocs-template-reminders", "verdocs-template-role-properties", "verdocs-template-roles", "verdocs-template-sender", "verdocs-template-visibility", "verdocs-text-input", "verdocs-toggle-button", "verdocs-toolbar-icon"];
147
+ const components = ["verdocs-build", "verdocs-button", "verdocs-checkbox", "verdocs-component-error", "verdocs-contact-picker", "verdocs-file-chooser", "verdocs-help-icon", "verdocs-loader", "verdocs-ok-dialog", "verdocs-portal", "verdocs-preview", "verdocs-progress-bar", "verdocs-radio-button", "verdocs-select-input", "verdocs-send", "verdocs-spinner", "verdocs-tabs", "verdocs-template-attachments", "verdocs-template-build-tabs", "verdocs-template-create", "verdocs-template-document-page", "verdocs-template-fields", "verdocs-template-name", "verdocs-template-reminders", "verdocs-template-role-properties", "verdocs-template-roles", "verdocs-template-sender", "verdocs-template-visibility", "verdocs-text-input", "verdocs-toggle-button", "verdocs-toolbar-icon"];
147
148
  components.forEach(tagName => { switch (tagName) {
148
149
  case "verdocs-build":
149
150
  if (!customElements.get(tagName)) {
@@ -152,40 +153,45 @@ function defineCustomElement$1() {
152
153
  break;
153
154
  case "verdocs-button":
154
155
  if (!customElements.get(tagName)) {
155
- defineCustomElement$u();
156
+ defineCustomElement$v();
156
157
  }
157
158
  break;
158
159
  case "verdocs-checkbox":
159
160
  if (!customElements.get(tagName)) {
160
- defineCustomElement$t();
161
+ defineCustomElement$u();
161
162
  }
162
163
  break;
163
164
  case "verdocs-component-error":
164
165
  if (!customElements.get(tagName)) {
165
- defineCustomElement$s();
166
+ defineCustomElement$t();
166
167
  }
167
168
  break;
168
169
  case "verdocs-contact-picker":
169
170
  if (!customElements.get(tagName)) {
170
- defineCustomElement$r();
171
+ defineCustomElement$s();
171
172
  }
172
173
  break;
173
174
  case "verdocs-file-chooser":
174
175
  if (!customElements.get(tagName)) {
175
- defineCustomElement$q();
176
+ defineCustomElement$r();
176
177
  }
177
178
  break;
178
179
  case "verdocs-help-icon":
179
180
  if (!customElements.get(tagName)) {
180
- defineCustomElement$p();
181
+ defineCustomElement$q();
181
182
  }
182
183
  break;
183
184
  case "verdocs-loader":
184
185
  if (!customElements.get(tagName)) {
185
- defineCustomElement$o();
186
+ defineCustomElement$p();
186
187
  }
187
188
  break;
188
189
  case "verdocs-ok-dialog":
190
+ if (!customElements.get(tagName)) {
191
+ defineCustomElement$o();
192
+ }
193
+ break;
194
+ case "verdocs-portal":
189
195
  if (!customElements.get(tagName)) {
190
196
  defineCustomElement$n();
191
197
  }
@@ -5,7 +5,7 @@ import { d as convertToE164 } from './utils.js';
5
5
  import { d as defineCustomElement$2 } from './verdocs-button2.js';
6
6
  import { d as defineCustomElement$1 } from './verdocs-toggle-button2.js';
7
7
 
8
- const verdocsContactPickerCss = "verdocs-contact-picker{font-family:\"Inter\", -apple-system, \"Segoe UI\", \"Roboto\", \"Helvetica Neue\", sans-serif;background-color:#ffffff}verdocs-contact-picker form{background-color:#f5f5fa;padding:12px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}verdocs-contact-picker form .row{width:300px;display:-ms-flexbox;display:flex;position:relative;margin:0 0 20px 0;-ms-flex-direction:column;flex-direction:column}verdocs-contact-picker form label{display:block;font-size:14px;font-weight:500;margin:0 0 4px 0;color:#5c6575}verdocs-contact-picker form input{border:none;font-size:18px;padding:3px 6px 3px 0;background:transparent;border-bottom:1px solid #33364b}verdocs-contact-picker form input:focus{outline:none}verdocs-contact-picker form .dropdown{left:0;right:0;top:49px;z-index:1000000;position:absolute;background:#ffffff;-webkit-box-shadow:0 0 15px 0 rgba(0, 0, 0, 0.1);box-shadow:0 0 15px 0 rgba(0, 0, 0, 0.1)}verdocs-contact-picker form .dropdown .suggestion{display:-ms-flexbox;display:flex;padding:6px 12px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-contact-picker form .dropdown .suggestion svg{fill:#666666}verdocs-contact-picker form .dropdown .suggestion .avatar{width:48px;height:48px;-ms-flex:0 0 48px;flex:0 0 48px;margin-right:8px;border-radius:100%}verdocs-contact-picker form .dropdown .suggestion .details{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}verdocs-contact-picker form .dropdown .suggestion .name{font-size:16px;font-weight:500;margin-bottom:3px;color:#092c4c}verdocs-contact-picker form .dropdown .suggestion .destination{font-size:14px;margin-bottom:3px;color:#33364b}verdocs-contact-picker form .dropdown .suggestion:hover{background:#eee;cursor:pointer}verdocs-contact-picker .buttons{display:-ms-flexbox;display:flex;-webkit-column-gap:8px;-moz-column-gap:8px;column-gap:8px;margin-top:16px;-ms-flex-direction:row;flex-direction:row}verdocs-contact-picker .buttons .flex-fill{-ms-flex:1;flex:1}verdocs-contact-picker ::-webkit-input-placeholder{color:#aaaaaa}verdocs-contact-picker ::-moz-placeholder{color:#aaaaaa}verdocs-contact-picker :-ms-input-placeholder{color:#aaaaaa}verdocs-contact-picker ::-ms-input-placeholder{color:#aaaaaa}verdocs-contact-picker ::placeholder{color:#aaaaaa}verdocs-contact-picker [data-lastpass-icon-root]{display:none !important}";
8
+ const verdocsContactPickerCss = "verdocs-contact-picker{display:block;border:1px solid #ebebeb;background-color:#ffffff;font-family:\"Inter\", -apple-system, \"Segoe UI\", \"Roboto\", \"Helvetica Neue\", sans-serif;-webkit-box-shadow:0 0 15px 0 rgba(0, 0, 0, 0.1);box-shadow:0 0 15px 0 rgba(0, 0, 0, 0.1)}verdocs-contact-picker form{background-color:#f5f5fa;padding:12px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}verdocs-contact-picker form .row{width:300px;display:-ms-flexbox;display:flex;position:relative;margin:0 0 20px 0;-ms-flex-direction:column;flex-direction:column}verdocs-contact-picker form label{display:block;font-size:14px;font-weight:500;margin:0 0 4px 0;color:#5c6575}verdocs-contact-picker form input{border:none;font-size:18px;padding:3px 6px 3px 0;background:transparent;border-bottom:1px solid #33364b}verdocs-contact-picker form input:focus{outline:none}verdocs-contact-picker form .dropdown{left:0;right:0;top:49px;z-index:1000000;position:absolute;background:#ffffff;-webkit-box-shadow:0 0 15px 0 rgba(0, 0, 0, 0.1);box-shadow:0 0 15px 0 rgba(0, 0, 0, 0.1)}verdocs-contact-picker form .dropdown .suggestion{display:-ms-flexbox;display:flex;padding:6px 12px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-contact-picker form .dropdown .suggestion svg{fill:#666666}verdocs-contact-picker form .dropdown .suggestion .avatar{width:48px;height:48px;-ms-flex:0 0 48px;flex:0 0 48px;margin-right:8px;border-radius:100%}verdocs-contact-picker form .dropdown .suggestion .details{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}verdocs-contact-picker form .dropdown .suggestion .name{font-size:16px;font-weight:500;margin-bottom:3px;color:#092c4c}verdocs-contact-picker form .dropdown .suggestion .destination{font-size:14px;margin-bottom:3px;color:#33364b}verdocs-contact-picker form .dropdown .suggestion:hover{background:#eee;cursor:pointer}verdocs-contact-picker .buttons{display:-ms-flexbox;display:flex;-webkit-column-gap:8px;-moz-column-gap:8px;column-gap:8px;margin-top:16px;-ms-flex-direction:row;flex-direction:row}verdocs-contact-picker .buttons .flex-fill{-ms-flex:1;flex:1}verdocs-contact-picker ::-webkit-input-placeholder{color:#aaaaaa}verdocs-contact-picker ::-moz-placeholder{color:#aaaaaa}verdocs-contact-picker :-ms-input-placeholder{color:#aaaaaa}verdocs-contact-picker ::-ms-input-placeholder{color:#aaaaaa}verdocs-contact-picker ::placeholder{color:#aaaaaa}verdocs-contact-picker [data-lastpass-icon-root]{display:none !important}";
9
9
 
10
10
  const messageIcon = '<svg class="MuiSvgIcon-root MuiSvgIcon-fontSizeMedium MuiBox-root css-1om0hkc" focusable="false" aria-hidden="true" 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>';
11
11
  const delegateIcon = '<svg class="MuiSvgIcon-root MuiSvgIcon-fontSizeMedium MuiSvgIcon-root MuiSvgIcon-fontSizeLarge css-zjt8k" focusable="false" aria-hidden="true" viewBox="0 0 24 24" data-testid="AssignmentIndIcon" tabindex="-1" title="AssignmentInd"><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>';
@@ -37,7 +37,6 @@ const VerdocsFieldDropdown$1 = /*@__PURE__*/ proxyCustomElement(class extends HT
37
37
  }
38
38
  async showSettingsPanel() {
39
39
  const settingsPanel = document.getElementById(`verdocs-settings-panel-${this.field.name}`);
40
- console.log('will hide', settingsPanel);
41
40
  if (settingsPanel && settingsPanel.showPanel) {
42
41
  settingsPanel.showPanel();
43
42
  }
@@ -0,0 +1,11 @@
1
+ import type { Components, JSX } from "../types/components";
2
+
3
+ interface VerdocsPortal extends Components.VerdocsPortal, HTMLElement {}
4
+ export const VerdocsPortal: {
5
+ prototype: VerdocsPortal;
6
+ new (): VerdocsPortal;
7
+ };
8
+ /**
9
+ * Used to define this component and all nested components recursively.
10
+ */
11
+ export const defineCustomElement: () => void;
@@ -0,0 +1,6 @@
1
+ import { V as VerdocsPortal$1, d as defineCustomElement$1 } from './verdocs-portal2.js';
2
+
3
+ const VerdocsPortal = VerdocsPortal$1;
4
+ const defineCustomElement = defineCustomElement$1;
5
+
6
+ export { VerdocsPortal, defineCustomElement };
@@ -0,0 +1,93 @@
1
+ import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
2
+
3
+ const verdocsPortalCss = "";
4
+
5
+ const Z_INDEX = '10001';
6
+ const VerdocsPortal = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
7
+ constructor() {
8
+ super();
9
+ this.__registerHost();
10
+ this.clickAway = createEvent(this, "clickAway", 7);
11
+ this.moved = false;
12
+ this.anchor = undefined;
13
+ this.voffset = 0;
14
+ this.align = 'left';
15
+ }
16
+ handleScroll() {
17
+ this.calculatePosition();
18
+ }
19
+ handleResize() {
20
+ this.calculatePosition();
21
+ }
22
+ handleClick(e) {
23
+ var _a;
24
+ if (!this.element.contains(e.target)) {
25
+ (_a = this.clickAway) === null || _a === void 0 ? void 0 : _a.emit();
26
+ }
27
+ }
28
+ calculateLeft() {
29
+ const anchorEl = document.getElementById(this.anchor);
30
+ if (!anchorEl)
31
+ return 0;
32
+ const anchorRect = anchorEl.getBoundingClientRect();
33
+ if (this.align === 'left') {
34
+ return Math.max(anchorRect.left, 0);
35
+ }
36
+ if (this.align === 'right') {
37
+ return Math.max(anchorRect.left + anchorRect.width - this.portal.offsetWidth, 0);
38
+ }
39
+ return Math.max(anchorRect.left - this.portal.offsetWidth / 2 + anchorRect.width / 2, 0);
40
+ }
41
+ calculateTop() {
42
+ const anchorEl = document.getElementById(this.anchor);
43
+ if (!anchorEl)
44
+ return 0;
45
+ const anchorRect = anchorEl.getBoundingClientRect();
46
+ return anchorRect.bottom + this.voffset;
47
+ }
48
+ calculatePosition() {
49
+ this.portal.style.top = `${this.calculateTop()}px`;
50
+ this.portal.style.left = `${this.calculateLeft()}px`;
51
+ }
52
+ componentWillLoad() {
53
+ var _a;
54
+ const id = `${this.anchor}-portal`;
55
+ (_a = document.getElementById(id)) === null || _a === void 0 ? void 0 : _a.remove();
56
+ this.portal = document.createElement('div');
57
+ this.portal.setAttribute('id', id);
58
+ this.portal.style.zIndex = Z_INDEX;
59
+ this.portal.style.position = 'absolute';
60
+ document.body.append(this.portal);
61
+ }
62
+ componentDidLoad() {
63
+ this.portal.appendChild(this.element);
64
+ this.calculatePosition();
65
+ }
66
+ disconnectedCallback() {
67
+ this.moved ? this.portal.remove() : (this.moved = true);
68
+ }
69
+ render() {
70
+ return (h(Host, { ref: el => (this.element = el) }, h("slot", null)));
71
+ }
72
+ static get style() { return verdocsPortalCss; }
73
+ }, [4, "verdocs-portal", {
74
+ "anchor": [1],
75
+ "voffset": [2],
76
+ "align": [1]
77
+ }, [[11, "scroll", "handleScroll"], [11, "resize", "handleResize"], [10, "click", "handleClick"]]]);
78
+ function defineCustomElement() {
79
+ if (typeof customElements === "undefined") {
80
+ return;
81
+ }
82
+ const components = ["verdocs-portal"];
83
+ components.forEach(tagName => { switch (tagName) {
84
+ case "verdocs-portal":
85
+ if (!customElements.get(tagName)) {
86
+ customElements.define(tagName, VerdocsPortal);
87
+ }
88
+ break;
89
+ } });
90
+ }
91
+ defineCustomElement();
92
+
93
+ export { VerdocsPortal as V, defineCustomElement as d };
@@ -7,8 +7,9 @@ import { g as getRGBA } from './Colors.js';
7
7
  import { g as getTemplateStore } from './TemplateStore.js';
8
8
  import { b as getRoleIndex } from './utils.js';
9
9
  import { S as SDKError } from './errors.js';
10
- import { d as defineCustomElement$4 } from './verdocs-button2.js';
11
- import { d as defineCustomElement$3 } from './verdocs-contact-picker2.js';
10
+ import { d as defineCustomElement$5 } from './verdocs-button2.js';
11
+ import { d as defineCustomElement$4 } from './verdocs-contact-picker2.js';
12
+ import { d as defineCustomElement$3 } from './verdocs-portal2.js';
12
13
  import { d as defineCustomElement$2 } from './verdocs-spinner2.js';
13
14
  import { d as defineCustomElement$1 } from './verdocs-toggle-button2.js';
14
15
 
@@ -153,7 +154,8 @@ const VerdocsSend = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
153
154
  return (h(Host, { class: { sendable: (_d = (_c = this.store) === null || _c === void 0 ? void 0 : _c.state) === null || _d === void 0 ? void 0 : _d.is_sendable } }, h("div", { class: "recipients" }, h("div", { class: "left-line" }), h("div", { class: `level level-start` }, this.getLevelIcon(-1), h("div", { class: "complete" }, "Send Envelope")), this.levels.map(level => (h("div", { class: `level level-${level}` }, this.getLevelIcon(level), this.rolesAtLevel[level].map(role => {
154
155
  var _a, _b, _c, _d, _e, _f;
155
156
  const unknown = !role.email;
156
- return unknown ? (h("div", { class: "recipient", style: { backgroundColor: getRGBA(getRoleIndex(roleNames, role.name)) }, onClick: e => this.handleClickRole(e, role) }, (_b = (_a = this.rolesCompleted[role.id]) === null || _a === void 0 ? void 0 : _a.full_name) !== null && _b !== void 0 ? _b : role.name, h("div", { class: "icon", innerHTML: editIcon }), this.showPickerForId === role.id && (h("verdocs-contact-picker", { onExit: () => (this.showPickerForId = ''), onNext: e => this.handleSelectContact(e, role), contactSuggestions: this.sessionContacts, templateRole: (_c = this.rolesCompleted[role.id]) !== null && _c !== void 0 ? _c : role, onSearchContacts: e => { var _a; return (_a = this.searchContacts) === null || _a === void 0 ? void 0 : _a.emit(e.detail); } })))) : (h("div", { class: "recipient", style: { borderColor: getRGBA(getRoleIndex(roleNames, role.name)) }, onClick: e => this.handleClickRole(e, role) }, (_e = (_d = this.rolesCompleted[role.id]) === null || _d === void 0 ? void 0 : _d.full_name) !== null && _e !== void 0 ? _e : role.full_name, h("div", { class: "icon", innerHTML: editIcon }), this.showPickerForId === role.id && (h("verdocs-contact-picker", { onExit: () => (this.showPickerForId = ''), onNext: e => this.handleSelectContact(e, role), contactSuggestions: this.sessionContacts, templateRole: (_f = this.rolesCompleted[role.id]) !== null && _f !== void 0 ? _f : role, onSearchContacts: e => { var _a; return (_a = this.searchContacts) === null || _a === void 0 ? void 0 : _a.emit(e.detail); } }))));
157
+ const elId = `verdocs-send-recipient-${role.name}`;
158
+ return unknown ? (h("div", { class: "recipient", style: { backgroundColor: getRGBA(getRoleIndex(roleNames, role.name)) }, onClick: e => this.handleClickRole(e, role), id: elId }, (_b = (_a = this.rolesCompleted[role.id]) === null || _a === void 0 ? void 0 : _a.full_name) !== null && _b !== void 0 ? _b : role.name, h("div", { class: "icon", innerHTML: editIcon }), this.showPickerForId === role.id && (h("verdocs-portal", { anchor: elId, onClickAway: () => (this.showPickerForId = '') }, h("verdocs-contact-picker", { onExit: () => (this.showPickerForId = ''), onNext: e => this.handleSelectContact(e, role), contactSuggestions: this.sessionContacts, templateRole: (_c = this.rolesCompleted[role.id]) !== null && _c !== void 0 ? _c : role, onSearchContacts: e => { var _a; return (_a = this.searchContacts) === null || _a === void 0 ? void 0 : _a.emit(e.detail); } }))))) : (h("div", { class: "recipient", style: { borderColor: getRGBA(getRoleIndex(roleNames, role.name)) }, onClick: e => this.handleClickRole(e, role), id: elId }, (_e = (_d = this.rolesCompleted[role.id]) === null || _d === void 0 ? void 0 : _d.full_name) !== null && _e !== void 0 ? _e : role.full_name, h("div", { class: "icon", innerHTML: editIcon }), this.showPickerForId === role.id && (h("verdocs-portal", { anchor: elId, onClickAway: () => (this.showPickerForId = '') }, h("verdocs-contact-picker", { onExit: () => (this.showPickerForId = ''), onNext: e => this.handleSelectContact(e, role), contactSuggestions: this.sessionContacts, templateRole: (_f = this.rolesCompleted[role.id]) !== null && _f !== void 0 ? _f : role, onSearchContacts: e => { var _a; return (_a = this.searchContacts) === null || _a === void 0 ? void 0 : _a.emit(e.detail); } })))));
157
159
  })))), h("div", { class: `level level-done` }, this.getLevelIcon(this.levels.length), h("div", { class: "complete" }, "Signing Complete"))), h("div", { class: "buttons" }, h("verdocs-button", { label: "Cancel", size: "small", variant: "outline", onClick: e => this.handleCancel(e), disabled: this.sending }), h("verdocs-button", { label: "Send", size: "small", disabled: !allRolesAssigned || this.sending, onClick: e => this.handleSend(e) }), this.sending && h("verdocs-spinner", null))));
158
160
  }
159
161
  static get style() { return verdocsSendCss; }
@@ -173,7 +175,7 @@ function defineCustomElement() {
173
175
  if (typeof customElements === "undefined") {
174
176
  return;
175
177
  }
176
- const components = ["verdocs-send", "verdocs-button", "verdocs-contact-picker", "verdocs-spinner", "verdocs-toggle-button"];
178
+ const components = ["verdocs-send", "verdocs-button", "verdocs-contact-picker", "verdocs-portal", "verdocs-spinner", "verdocs-toggle-button"];
177
179
  components.forEach(tagName => { switch (tagName) {
178
180
  case "verdocs-send":
179
181
  if (!customElements.get(tagName)) {
@@ -182,10 +184,15 @@ function defineCustomElement() {
182
184
  break;
183
185
  case "verdocs-button":
184
186
  if (!customElements.get(tagName)) {
185
- defineCustomElement$4();
187
+ defineCustomElement$5();
186
188
  }
187
189
  break;
188
190
  case "verdocs-contact-picker":
191
+ if (!customElements.get(tagName)) {
192
+ defineCustomElement$4();
193
+ }
194
+ break;
195
+ case "verdocs-portal":
189
196
  if (!customElements.get(tagName)) {
190
197
  defineCustomElement$3();
191
198
  }
@@ -196,6 +196,7 @@ const VerdocsTemplateFields = /*@__PURE__*/ proxyCustomElement(class extends HTM
196
196
  const name = event.target.getAttribute('name');
197
197
  const option = +(event.target.getAttribute('option') || '0');
198
198
  const field = (_a = this.store) === null || _a === void 0 ? void 0 : _a.state.fields.find(field => field.name === name);
199
+ console.log('Dropped field', name, field);
199
200
  if (!field) {
200
201
  console.log('[FIELDS] Unable to find field', name);
201
202
  return;
@@ -205,12 +206,14 @@ const VerdocsTemplateFields = /*@__PURE__*/ proxyCustomElement(class extends HTM
205
206
  const clientRect = event.target.getBoundingClientRect();
206
207
  const parent = event.target.parentElement;
207
208
  const parentRect = parent.getBoundingClientRect();
209
+ const width = field.setting.width || defaultWidth(field.type);
210
+ const height = field.setting.height || defaultHeight(field.type);
208
211
  // These two being backwards is not a mistake. Left measures "over" from the left (positive displacement) while bottom measures
209
212
  // "up" from the bottom (negative displacement).
210
213
  const newX = Math.max(clientRect.left - parentRect.left, 0);
211
214
  const newY = Math.max(renderedHeight - (parentRect.bottom - clientRect.bottom), 0);
212
215
  // console.log('Computing coordinates', {naturalWidth, width: event.rect.width, naturalHeight, height: event.rect.height, newX, newY});
213
- const { x, y } = this.viewCoordinatesToPageCoordinates(newX, newY, pageNumber, naturalWidth - field.setting.width, naturalHeight - field.setting.height);
216
+ const { x, y } = this.viewCoordinatesToPageCoordinates(newX, newY, pageNumber, naturalWidth - width, naturalHeight - height);
214
217
  // console.log('Drop End', {x, y, newX, newY});
215
218
  switch (field.type) {
216
219
  case 'attachment':
package/dist/docs.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "timestamp": "2023-12-17T22:44:32",
2
+ "timestamp": "2023-12-21T15:00:03",
3
3
  "compiler": {
4
4
  "name": "@stencil/core",
5
5
  "version": "2.20.0",
@@ -562,6 +562,7 @@
562
562
  "verdocs-ok-dialog"
563
563
  ],
564
564
  "verdocs-send": [
565
+ "verdocs-portal",
565
566
  "verdocs-contact-picker",
566
567
  "verdocs-button",
567
568
  "verdocs-spinner"
@@ -5936,6 +5937,124 @@
5936
5937
  ]
5937
5938
  }
5938
5939
  },
5940
+ {
5941
+ "filePath": "./src/components/controls/verdocs-portal/verdocs-portal.tsx",
5942
+ "encapsulation": "none",
5943
+ "tag": "verdocs-portal",
5944
+ "docs": "Display a child component in a \"portal\", popping it out of the main DOM tree\nto allow it to escape the bounds set by its parent.",
5945
+ "docsTags": [
5946
+ {
5947
+ "name": "credit",
5948
+ "text": "https://github.com/tomas-teston/stencil-portal for the basic\ntechnique. This has been altered in a few ways to make it more friendly\nto cases where there may be multiple portals on the page and provide more\nalignment options for the child to be displayed."
5949
+ }
5950
+ ],
5951
+ "usage": {},
5952
+ "props": [
5953
+ {
5954
+ "name": "align",
5955
+ "type": "\"center\" | \"left\" | \"right\"",
5956
+ "mutable": false,
5957
+ "attr": "align",
5958
+ "reflectToAttr": false,
5959
+ "docs": "Horizontal alignment.",
5960
+ "docsTags": [],
5961
+ "default": "'left'",
5962
+ "values": [
5963
+ {
5964
+ "value": "center",
5965
+ "type": "string"
5966
+ },
5967
+ {
5968
+ "value": "left",
5969
+ "type": "string"
5970
+ },
5971
+ {
5972
+ "value": "right",
5973
+ "type": "string"
5974
+ }
5975
+ ],
5976
+ "optional": false,
5977
+ "required": false
5978
+ },
5979
+ {
5980
+ "name": "anchor",
5981
+ "type": "string",
5982
+ "mutable": false,
5983
+ "attr": "anchor",
5984
+ "reflectToAttr": false,
5985
+ "docs": "Unique ID of the parent element to anchor to.",
5986
+ "docsTags": [],
5987
+ "values": [
5988
+ {
5989
+ "type": "string"
5990
+ }
5991
+ ],
5992
+ "optional": false,
5993
+ "required": false
5994
+ },
5995
+ {
5996
+ "name": "voffset",
5997
+ "type": "number",
5998
+ "mutable": false,
5999
+ "attr": "voffset",
6000
+ "reflectToAttr": false,
6001
+ "docs": "Vertical offset from the parent.",
6002
+ "docsTags": [],
6003
+ "default": "0",
6004
+ "values": [
6005
+ {
6006
+ "type": "number"
6007
+ }
6008
+ ],
6009
+ "optional": false,
6010
+ "required": false
6011
+ }
6012
+ ],
6013
+ "methods": [],
6014
+ "events": [
6015
+ {
6016
+ "event": "clickAway",
6017
+ "detail": "void",
6018
+ "bubbles": true,
6019
+ "cancelable": true,
6020
+ "composed": true,
6021
+ "docs": "",
6022
+ "docsTags": []
6023
+ }
6024
+ ],
6025
+ "listeners": [
6026
+ {
6027
+ "event": "scroll",
6028
+ "target": "window",
6029
+ "capture": true,
6030
+ "passive": true
6031
+ },
6032
+ {
6033
+ "event": "resize",
6034
+ "target": "window",
6035
+ "capture": true,
6036
+ "passive": true
6037
+ },
6038
+ {
6039
+ "event": "click",
6040
+ "target": "window",
6041
+ "capture": true,
6042
+ "passive": false
6043
+ }
6044
+ ],
6045
+ "styles": [],
6046
+ "slots": [],
6047
+ "parts": [],
6048
+ "dependents": [
6049
+ "verdocs-send"
6050
+ ],
6051
+ "dependencies": [],
6052
+ "dependencyGraph": {
6053
+ "verdocs-send": [
6054
+ "verdocs-portal"
6055
+ ]
6056
+ }
6057
+ },
5939
6058
  {
5940
6059
  "filePath": "./src/components/embeds/verdocs-preview/verdocs-preview.tsx",
5941
6060
  "encapsulation": "none",
@@ -6901,12 +7020,14 @@
6901
7020
  "verdocs-build"
6902
7021
  ],
6903
7022
  "dependencies": [
7023
+ "verdocs-portal",
6904
7024
  "verdocs-contact-picker",
6905
7025
  "verdocs-button",
6906
7026
  "verdocs-spinner"
6907
7027
  ],
6908
7028
  "dependencyGraph": {
6909
7029
  "verdocs-send": [
7030
+ "verdocs-portal",
6910
7031
  "verdocs-contact-picker",
6911
7032
  "verdocs-button",
6912
7033
  "verdocs-spinner"