@verdocs/web-sdk 6.8.6 → 6.8.7

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 (132) hide show
  1. package/dist/cjs/index-CQ5bTnED.js +14 -6
  2. package/dist/cjs/loader.cjs.js +1 -1
  3. package/dist/cjs/verdocs-build.cjs.entry.js +4 -2
  4. package/dist/cjs/verdocs-build.entry.cjs.js.map +1 -1
  5. package/dist/cjs/{verdocs-button-panel_2.cjs.entry.js → verdocs-button-panel.cjs.entry.js} +1 -27
  6. package/dist/cjs/verdocs-button-panel.entry.cjs.js.map +1 -0
  7. package/dist/cjs/verdocs-preview.verdocs-send.verdocs-template-attachments.verdocs-template-build-tabs.verdocs-template-fields.verdocs-template-roles.entry.cjs.js.map +1 -0
  8. package/dist/cjs/{verdocs-preview_7.cjs.entry.js → verdocs-preview_6.cjs.entry.js} +35 -194
  9. package/dist/cjs/verdocs-tabs.cjs.entry.js +31 -0
  10. package/dist/cjs/verdocs-tabs.entry.cjs.js.map +1 -0
  11. package/dist/cjs/verdocs-template-settings.cjs.entry.js +150 -0
  12. package/dist/cjs/verdocs-template-settings.entry.cjs.js.map +1 -0
  13. package/dist/cjs/verdocs-web-sdk.cjs.js +1 -1
  14. package/dist/collection/components/embeds/verdocs-build/verdocs-build.css +4 -0
  15. package/dist/collection/components/embeds/verdocs-build/verdocs-build.js +5 -3
  16. package/dist/collection/components/embeds/verdocs-build/verdocs-build.js.map +1 -1
  17. package/dist/collection/components/templates/verdocs-template-build-tabs/verdocs-template-build-tabs.css +41 -49
  18. package/dist/collection/components/templates/verdocs-template-build-tabs/verdocs-template-build-tabs.js +25 -45
  19. package/dist/collection/components/templates/verdocs-template-build-tabs/verdocs-template-build-tabs.js.map +1 -1
  20. package/dist/collection/components/templates/verdocs-template-fields/verdocs-template-fields.js +11 -36
  21. package/dist/collection/components/templates/verdocs-template-fields/verdocs-template-fields.js.map +1 -1
  22. package/dist/components/{p-BYDdRCru.js → p-_cxVjdiK.js} +11 -11
  23. package/dist/components/p-_cxVjdiK.js.map +1 -0
  24. package/dist/components/p-eZKhg-2i.js +156 -0
  25. package/dist/components/p-eZKhg-2i.js.map +1 -0
  26. package/dist/components/verdocs-build.js +72 -94
  27. package/dist/components/verdocs-build.js.map +1 -1
  28. package/dist/components/verdocs-button-panel.js +98 -1
  29. package/dist/components/verdocs-button-panel.js.map +1 -1
  30. package/dist/components/verdocs-tabs.js +45 -1
  31. package/dist/components/verdocs-tabs.js.map +1 -1
  32. package/dist/components/verdocs-template-build-tabs.js +1 -1
  33. package/dist/components/verdocs-template-fields.js +1 -1
  34. package/dist/components/verdocs-template-settings.js +215 -1
  35. package/dist/components/verdocs-template-settings.js.map +1 -1
  36. package/dist/custom-elements.json +0 -6
  37. package/dist/esm/index-BIRwgFLv.js +14 -6
  38. package/dist/esm/loader.js +1 -1
  39. package/dist/esm/verdocs-build.entry.js +4 -2
  40. package/dist/esm/verdocs-build.entry.js.map +1 -1
  41. package/dist/{components/p-rboJNAPD.js → esm/verdocs-button-panel.entry.js} +9 -32
  42. package/dist/esm/verdocs-button-panel.entry.js.map +1 -0
  43. package/dist/esm/verdocs-preview.verdocs-send.verdocs-template-attachments.verdocs-template-build-tabs.verdocs-template-fields.verdocs-template-roles.entry.js.map +1 -0
  44. package/dist/esm/{verdocs-preview_7.entry.js → verdocs-preview_6.entry.js} +37 -195
  45. package/dist/{components/p-e7e4Os6T.js → esm/verdocs-tabs.entry.js} +8 -29
  46. package/dist/esm/verdocs-tabs.entry.js.map +1 -0
  47. package/dist/{components/p-Cp7g7TMK.js → esm/verdocs-template-settings.entry.js} +12 -84
  48. package/dist/esm/verdocs-template-settings.entry.js.map +1 -0
  49. package/dist/esm/verdocs-web-sdk.js +1 -1
  50. package/dist/esm-es5/index-BIRwgFLv.js +1 -1
  51. package/dist/esm-es5/loader.js +1 -1
  52. package/dist/esm-es5/verdocs-build.entry.js +1 -1
  53. package/dist/esm-es5/verdocs-build.entry.js.map +1 -1
  54. package/dist/esm-es5/verdocs-button-panel.entry.js +2 -0
  55. package/dist/esm-es5/verdocs-button-panel.entry.js.map +1 -0
  56. package/dist/esm-es5/verdocs-preview.verdocs-send.verdocs-template-attachments.verdocs-template-build-tabs.verdocs-template-fields.verdocs-template-roles.entry.js.map +1 -0
  57. package/dist/esm-es5/verdocs-preview_6.entry.js +8 -0
  58. package/dist/esm-es5/verdocs-preview_6.entry.js.map +1 -0
  59. package/dist/esm-es5/verdocs-tabs.entry.js +2 -0
  60. package/dist/esm-es5/verdocs-tabs.entry.js.map +1 -0
  61. package/dist/esm-es5/verdocs-template-settings.entry.js +2 -0
  62. package/dist/esm-es5/verdocs-template-settings.entry.js.map +1 -0
  63. package/dist/esm-es5/verdocs-web-sdk.js +1 -1
  64. package/dist/types/components/embeds/verdocs-build/verdocs-build.d.ts +1 -1
  65. package/dist/types/components/templates/verdocs-template-build-tabs/verdocs-template-build-tabs.d.ts +8 -3
  66. package/dist/types/components/templates/verdocs-template-fields/verdocs-template-fields.d.ts +2 -8
  67. package/dist/types/components.d.ts +2 -4
  68. package/dist/verdocs-web-sdk/p-0fcfde01.entry.js +8 -0
  69. package/dist/verdocs-web-sdk/p-0fcfde01.entry.js.map +1 -0
  70. package/dist/verdocs-web-sdk/p-267c890e.entry.js +2 -0
  71. package/dist/verdocs-web-sdk/p-267c890e.entry.js.map +1 -0
  72. package/dist/verdocs-web-sdk/p-2e4d6431.system.entry.js +8 -0
  73. package/dist/verdocs-web-sdk/p-2e4d6431.system.entry.js.map +1 -0
  74. package/dist/verdocs-web-sdk/p-39b03469.entry.js +2 -0
  75. package/dist/verdocs-web-sdk/p-39b03469.entry.js.map +1 -0
  76. package/dist/verdocs-web-sdk/p-5ee3ef82.entry.js +2 -0
  77. package/dist/verdocs-web-sdk/{p-da28bd7d.entry.js.map → p-5ee3ef82.entry.js.map} +1 -1
  78. package/dist/verdocs-web-sdk/p-8229308e.system.entry.js +2 -0
  79. package/dist/verdocs-web-sdk/{p-e65af831.system.entry.js.map → p-8229308e.system.entry.js.map} +1 -1
  80. package/dist/verdocs-web-sdk/p-B8zpaHu-.system.js +1 -1
  81. package/dist/verdocs-web-sdk/p-Bb7iRsoQ.system.js.map +1 -0
  82. package/dist/verdocs-web-sdk/p-CCv1s4sj.system.js.map +1 -0
  83. package/dist/verdocs-web-sdk/p-DFNdvv2j.system.js.map +1 -0
  84. package/dist/verdocs-web-sdk/p-DrBEr1CO.system.js.map +1 -0
  85. package/dist/verdocs-web-sdk/p-a06b40a9.system.entry.js +2 -0
  86. package/dist/verdocs-web-sdk/p-a06b40a9.system.entry.js.map +1 -0
  87. package/dist/verdocs-web-sdk/p-b04c507f.system.entry.js +2 -0
  88. package/dist/verdocs-web-sdk/p-b04c507f.system.entry.js.map +1 -0
  89. package/dist/verdocs-web-sdk/p-dde291ad.system.entry.js +2 -0
  90. package/dist/verdocs-web-sdk/p-dde291ad.system.entry.js.map +1 -0
  91. package/dist/verdocs-web-sdk/p-fd923850.entry.js +2 -0
  92. package/dist/verdocs-web-sdk/p-fd923850.entry.js.map +1 -0
  93. package/dist/verdocs-web-sdk/p-wKFmf5bX.system.js.map +1 -0
  94. package/dist/verdocs-web-sdk/verdocs-build.entry.esm.js.map +1 -1
  95. package/dist/verdocs-web-sdk/verdocs-button-panel.entry.esm.js.map +1 -0
  96. package/dist/verdocs-web-sdk/verdocs-preview.verdocs-send.verdocs-template-attachments.verdocs-template-build-tabs.verdocs-template-fields.verdocs-template-roles.entry.esm.js.map +1 -0
  97. package/dist/verdocs-web-sdk/verdocs-tabs.entry.esm.js.map +1 -0
  98. package/dist/verdocs-web-sdk/verdocs-template-settings.entry.esm.js.map +1 -0
  99. package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
  100. package/package.json +1 -1
  101. package/dist/cjs/verdocs-button-panel.verdocs-tabs.entry.cjs.js.map +0 -1
  102. package/dist/cjs/verdocs-preview.verdocs-send.verdocs-template-attachments.verdocs-template-build-tabs.verdocs-template-fields.verdocs-template-roles.verdocs-template-settings.entry.cjs.js.map +0 -1
  103. package/dist/components/p-BYDdRCru.js.map +0 -1
  104. package/dist/components/p-Cp7g7TMK.js.map +0 -1
  105. package/dist/components/p-e7e4Os6T.js.map +0 -1
  106. package/dist/components/p-hDK3S4nn.js +0 -188
  107. package/dist/components/p-hDK3S4nn.js.map +0 -1
  108. package/dist/components/p-rboJNAPD.js.map +0 -1
  109. package/dist/esm/verdocs-button-panel.verdocs-tabs.entry.js.map +0 -1
  110. package/dist/esm/verdocs-button-panel_2.entry.js +0 -105
  111. package/dist/esm/verdocs-preview.verdocs-send.verdocs-template-attachments.verdocs-template-build-tabs.verdocs-template-fields.verdocs-template-roles.verdocs-template-settings.entry.js.map +0 -1
  112. package/dist/esm-es5/verdocs-button-panel.verdocs-tabs.entry.js.map +0 -1
  113. package/dist/esm-es5/verdocs-button-panel_2.entry.js +0 -2
  114. package/dist/esm-es5/verdocs-button-panel_2.entry.js.map +0 -1
  115. package/dist/esm-es5/verdocs-preview.verdocs-send.verdocs-template-attachments.verdocs-template-build-tabs.verdocs-template-fields.verdocs-template-roles.verdocs-template-settings.entry.js.map +0 -1
  116. package/dist/esm-es5/verdocs-preview_7.entry.js +0 -8
  117. package/dist/esm-es5/verdocs-preview_7.entry.js.map +0 -1
  118. package/dist/verdocs-web-sdk/p-07bd9f14.entry.js +0 -2
  119. package/dist/verdocs-web-sdk/p-07bd9f14.entry.js.map +0 -1
  120. package/dist/verdocs-web-sdk/p-5bc00fc6.entry.js +0 -8
  121. package/dist/verdocs-web-sdk/p-5bc00fc6.entry.js.map +0 -1
  122. package/dist/verdocs-web-sdk/p-BZv_Bu9M.system.js.map +0 -1
  123. package/dist/verdocs-web-sdk/p-DEv3ZZhp.system.js.map +0 -1
  124. package/dist/verdocs-web-sdk/p-DGOssAS4.system.js.map +0 -1
  125. package/dist/verdocs-web-sdk/p-acf58947.system.entry.js +0 -8
  126. package/dist/verdocs-web-sdk/p-acf58947.system.entry.js.map +0 -1
  127. package/dist/verdocs-web-sdk/p-da28bd7d.entry.js +0 -2
  128. package/dist/verdocs-web-sdk/p-e3075674.system.entry.js +0 -2
  129. package/dist/verdocs-web-sdk/p-e3075674.system.entry.js.map +0 -1
  130. package/dist/verdocs-web-sdk/p-e65af831.system.entry.js +0 -2
  131. package/dist/verdocs-web-sdk/verdocs-button-panel.verdocs-tabs.entry.esm.js.map +0 -1
  132. package/dist/verdocs-web-sdk/verdocs-preview.verdocs-send.verdocs-template-attachments.verdocs-template-build-tabs.verdocs-template-fields.verdocs-template-roles.verdocs-template-settings.entry.esm.js.map +0 -1
@@ -1,13 +1,13 @@
1
1
  import { r as registerInstance, c as createEvent, h, H as Host, F as Fragment, g as getElement } from './index-BIRwgFLv.js';
2
- import { VerdocsEndpoint, getTemplate, integerSequence, getOrganizationContacts, isValidEmail, createEnvelope, formatFullName, getRGBA, createTemplateDocument, deleteTemplateDocument, updateField, createField, updateTemplateRole, createTemplateRole, updateTemplate } from '@verdocs/js-sdk';
2
+ import { VerdocsEndpoint, getTemplate, integerSequence, getOrganizationContacts, isValidEmail, createEnvelope, formatFullName, getRGBA, createTemplateDocument, deleteTemplateDocument, updateField, createField, updateTemplateRole, createTemplateRole } from '@verdocs/js-sdk';
3
3
  import { a as renderDocumentField, g as getFieldId, h as updateCssTransform, i as removeCssTransform, j as setControlStyles, d as defaultHeight, k as defaultWidth } from './utils-CerrMWqr.js';
4
4
  import { S as SDKError } from './errors-C1sRVZWv.js';
5
5
  import { S as Store } from './Datastore-bS8INhRF.js';
6
6
  import { D as DefaultEndpoint } from './Environment-C_Xku1v2.js';
7
7
  import { V as VerdocsToast } from './Toast-D97GxsI-.js';
8
8
  import { a as DocIcon, P as PngIcon, J as JpgIcon, b as PdfIcon, F as FileIcon, c as PageCountIcon, T as TrashIcon, D as DocumentPageIcon } from './Icons-BU5rnXp2.js';
9
- import { d as dateFnsExports } from './index-dzBXqXlK.js';
10
9
  import { i as interact } from './interact.min-BepJAdBZ.js';
10
+ import './index-dzBXqXlK.js';
11
11
  import './Types-BqoC0yeA.js';
12
12
  import './_commonjsHelpers-BFTU3MAI.js';
13
13
 
@@ -521,11 +521,8 @@ const VerdocsTemplateAttachments = class {
521
521
  };
522
522
  VerdocsTemplateAttachments.style = verdocsTemplateAttachmentsCss;
523
523
 
524
- const verdocsTemplateBuildTabsCss = "verdocs-template-build-tabs{-ms-flex:1;flex:1;gap:15px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;font-family:var(--verdocs-primary-font, \"Inter\", \"Barlow\", sans-serif)}verdocs-template-build-tabs verdocs-button-panel svg{-webkit-transform:scale(0.8);transform:scale(0.8)}verdocs-template-build-tabs verdocs-template-attachments,verdocs-template-build-tabs verdocs-template-roles{margin:20px}verdocs-template-build-tabs verdocs-template-fields{border-top:1px solid #777777}verdocs-template-build-tabs verdocs-template-attachments{padding:20px;background:#ffffff}verdocs-template-build-tabs verdocs-template-fields{width:100%}verdocs-template-build-tabs verdocs-preview{-ms-flex:1;flex:1}.template-details-panel .row{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;gap:8px;margin:10px 0}.template-details-panel label{-ms-flex:0 0 70px;flex:0 0 70px}.template-details-panel .value{-ms-flex:1;flex:1;font-weight:300;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.template-details-panel .icon-button{cursor:pointer;opacity:0.8;-ms-flex:0;flex:0;width:18px;height:18px}.template-details-panel .icon-button svg{stroke:#000000;width:18px;height:18px}.template-details-panel .icon-button:hover{opacity:1}";
524
+ const verdocsTemplateBuildTabsCss = "verdocs-template-build-tabs{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:end;align-items:flex-end;-ms-flex:0 0 50px;flex:0 0 50px;width:100%;background:#ffffff;color:#72757d;border-bottom:1px solid #dddddd;-webkit-filter:drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));filter:drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));font-family:var(--verdocs-primary-font, \"Inter\", \"Barlow\", sans-serif)}verdocs-template-build-tabs .tab{position:relative;display:-ms-flexbox;display:flex;-ms-flex:1;flex:1;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;height:50px;padding:0 4px;background:#e7e7e7;font-weight:700;font-size:12px;cursor:pointer}@media (min-width: 768px){verdocs-template-build-tabs .tab{padding:0 8px 0 24px;font-size:14px}}verdocs-template-build-tabs .tab svg{position:absolute;top:0;right:-19px;z-index:10;pointer-events:none;display:none}@media (min-width: 768px){verdocs-template-build-tabs .tab svg{display:block}}verdocs-template-build-tabs .tab.active{background:#ffffff;color:#707ae5}verdocs-template-build-tabs .tab.disabled{cursor:default;color:#d1d5db}";
525
525
 
526
- const HelpIcon = '<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24" fill="#5c6575"><path d="M11.925 18q.55 0 .938-.387.387-.388.387-.938 0-.55-.387-.925-.388-.375-.938-.375-.55 0-.925.375t-.375.925q0 .55.375.938.375.387.925.387Zm-.95-3.85h1.95q0-.8.2-1.287.2-.488 1.025-1.288.65-.625 1.025-1.213.375-.587.375-1.437 0-1.425-1.025-2.175Q13.5 6 12.1 6q-1.425 0-2.35.775t-1.275 1.85l1.775.7q.125-.45.55-.975.425-.525 1.275-.525.725 0 1.1.412.375.413.375.888 0 .475-.287.9-.288.425-.713.775-1.075.95-1.325 1.475-.25.525-.25 1.875ZM12 22.2q-2.125 0-3.988-.8-1.862-.8-3.237-2.175Q3.4 17.85 2.6 15.988 1.8 14.125 1.8 12t.8-3.988q.8-1.862 2.175-3.237Q6.15 3.4 8.012 2.6 9.875 1.8 12 1.8t3.988.8q1.862.8 3.237 2.175Q20.6 6.15 21.4 8.012q.8 1.863.8 3.988t-.8 3.988q-.8 1.862-2.175 3.237Q17.85 20.6 15.988 21.4q-1.863.8-3.988.8Zm0-2.275q3.325 0 5.625-2.3t2.3-5.625q0-3.325-2.3-5.625T12 4.075q-3.325 0-5.625 2.3T4.075 12q0 3.325 2.3 5.625t5.625 2.3ZM12 12Z"/></svg>';
527
- const CopyIcon = `<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5"><path stroke-linecap="round" stroke-linejoin="round" d="M15.75 17.25v3.375c0 .621-.504 1.125-1.125 1.125h-9.75a1.125 1.125 0 0 1-1.125-1.125V7.875c0-.621.504-1.125 1.125-1.125H6.75a9.06 9.06 0 0 1 1.5.124m7.5 10.376h3.375c.621 0 1.125-.504 1.125-1.125V11.25c0-4.46-3.243-8.161-7.5-8.876a9.06 9.06 0 0 0-1.5-.124H9.375c-.621 0-1.125.504-1.125 1.125v3.5m7.5 10.375H9.375a1.125 1.125 0 0 1-1.125-1.125v-9.25m12 6.625v-1.875a3.375 3.375 0 0 0-3.375-3.375h-1.5a1.125 1.125 0 0 1-1.125-1.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H9.75" /></svg>`;
528
- const STEPS = ['attachments', 'roles', 'settings', 'fields', 'preview'];
529
526
  const VerdocsTemplateBuildTabs = class {
530
527
  constructor(hostRef) {
531
528
  registerInstance(this, hostRef);
@@ -592,28 +589,16 @@ const VerdocsTemplateBuildTabs = class {
592
589
  (_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));
593
590
  }
594
591
  }
595
- setStep(e) {
592
+ handleSelect(tab) {
596
593
  var _a;
597
- console.log('[BUILD_TABS] Selected step', e.detail.tab.id);
598
- e.stopPropagation();
599
- e.preventDefault();
600
- this.step = e.detail.tab.id;
601
- (_a = this.stepChanged) === null || _a === void 0 ? void 0 : _a.emit(e.detail.tab.id);
602
- }
603
- copyTemplateId() {
604
- navigator.clipboard
605
- .writeText(this.templateId)
606
- .then(() => {
607
- VerdocsToast('Template ID copied', { style: 'success', duration: 3000 });
608
- })
609
- .catch(e => {
610
- var _a;
611
- console.warn('[BUILD_TABS] Error copying to clipboard', e);
612
- (_a = this.sdkError) === null || _a === void 0 ? void 0 : _a.emit(e);
613
- });
594
+ if (tab.disabled || tab.id === this.step) {
595
+ return;
596
+ }
597
+ this.step = tab.id;
598
+ (_a = this.stepChanged) === null || _a === void 0 ? void 0 : _a.emit(tab.id);
614
599
  }
615
600
  render() {
616
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
601
+ var _a, _b, _c;
617
602
  if (this.loading) {
618
603
  return (h(Host, null, h("verdocs-loader", null)));
619
604
  }
@@ -621,26 +606,23 @@ const VerdocsTemplateBuildTabs = class {
621
606
  return (h(Host, null, h("verdocs-component-error", { message: "You must be authenticated to use this module." })));
622
607
  }
623
608
  const canEditRoles = (((_a = this.template) === null || _a === void 0 ? void 0 : _a.documents) || []).length > 0;
624
- let canEditFields = canEditRoles && (((_b = this.template) === null || _b === void 0 ? void 0 : _b.roles) || []).length > 0;
609
+ const canEditFields = canEditRoles && (((_b = this.template) === null || _b === void 0 ? void 0 : _b.roles) || []).length > 0;
625
610
  const canPreview = canEditFields && (((_c = this.template) === null || _c === void 0 ? void 0 : _c.fields) || []).length > 0;
626
- let selectedStepIndex = Math.max(STEPS.indexOf(this.step), 0);
627
- if (!canPreview && selectedStepIndex >= 4) {
628
- selectedStepIndex = 3;
629
- }
630
- if (!canEditFields && selectedStepIndex >= 3) {
631
- selectedStepIndex = 1;
632
- }
633
- if (!canEditRoles && selectedStepIndex >= 1) {
634
- selectedStepIndex = 0;
635
- }
636
- return (h(Host, null, h("verdocs-tabs", { onSelectTab: e => this.setStep(e), selectedTab: selectedStepIndex, tabs: [
637
- { id: 'attachments', disabled: false, label: 'Attachment(s)' },
638
- { id: 'roles', disabled: !canEditRoles, label: 'Roles' },
639
- { id: 'settings', disabled: !canEditFields, label: 'Settings' },
640
- { id: 'fields', disabled: !canEditFields, label: 'Fields' },
641
- { id: 'preview', disabled: !canPreview, label: 'Preview/Send' },
642
- ] }), this.templateId && (h("div", { class: "info" }, h("verdocs-button-panel", { icon: HelpIcon }, h("div", { class: "template-details-panel" }, h("h6", null, "Template Details"), h("div", { class: "row" }, h("label", null, "ID:"), h("div", { class: "value" }, this.templateId), h("div", { class: "icon-button", innerHTML: CopyIcon, onClick: () => this.copyTemplateId() })), h("div", { class: "row" }, h("label", null, "Name:"), h("div", { class: "value" }, (_d = this.template) === null || _d === void 0 ? void 0 : _d.name)), h("div", { class: "row" }, h("label", null, "Visibility:"), h("div", { class: "value" }, ((_e = this.template) === null || _e === void 0 ? void 0 : _e.is_public) ? 'Public' : ((_f = this.template) === null || _f === void 0 ? void 0 : _f.is_personal) ? 'Private' : 'Shared')), h("div", { class: "row" }, h("label", null, "Created:"), h("div", { class: "value" }, ((_g = this.template) === null || _g === void 0 ? void 0 : _g.counter) ? dateFnsExports.format(new Date((_h = this.template) === null || _h === void 0 ? void 0 : _h.created_at), 'P p') : '')), h("div", { class: "row" }, h("label", null, "Used:"), h("div", { class: "value" }, (_j = this.template) === null || _j === void 0 ? void 0 :
643
- _j.counter, " time(s)"))))))));
611
+ const tabs = [
612
+ { id: 'attachments', label: 'Attachments', disabled: false },
613
+ { id: 'roles', label: 'Workflow', disabled: !canEditRoles },
614
+ { id: 'fields', label: 'Fields', disabled: !canEditFields },
615
+ { id: 'preview', label: 'Preview & Send', disabled: !canPreview },
616
+ ];
617
+ return (h(Host, null, tabs.map(tab => {
618
+ const isActive = tab.id === this.step;
619
+ const classes = ['tab'];
620
+ if (isActive)
621
+ classes.push('active');
622
+ if (tab.disabled)
623
+ classes.push('disabled');
624
+ return (h("div", { class: classes.join(' '), onClick: () => this.handleSelect(tab) }, h("span", null, tab.label), h("svg", { "aria-hidden": "true", xmlns: "http://www.w3.org/2000/svg", width: "19", height: "50", viewBox: "0 0 19 50" }, h("polygon", { points: "0,0 19,25 0,50", fill: isActive ? '#ffffff' : '#e7e7e7' }))));
625
+ })));
644
626
  }
645
627
  static get watchers() { return {
646
628
  "templateId": ["onTemplateIdChanged"],
@@ -660,7 +642,7 @@ const iconInitial = '<svg xmlns="http://www.w3.org/2000/svg" height="24" width="
660
642
  // const iconTimestamp =
661
643
  // '<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="M9 1h6v2H9zm10.03 6.39 1.42-1.42c-.43-.51-.9-.99-1.41-1.41l-1.42 1.42C16.07 4.74 14.12 4 12 4c-4.97 0-9 4.03-9 9s4.02 9 9 9 9-4.03 9-9c0-2.12-.74-4.07-1.97-5.61zM13 14h-2V8h2v6z"></path></svg>';
662
644
  const iconDropdown = '<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24" stroke-width="1.5" stroke="currentColor"><path stroke="#ffffff" stroke-linecap="round" stroke-linejoin="round" d="M3 4.5h14.25M3 9h9.75M3 13.5h9.75m4.5-4.5v12m0 0l-3.75-3.75M17.25 21L21 17.25" /></svg>';
663
- const iconAttachment = '<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-6"><path stroke-linecap="round" stroke-linejoin="round" d="m18.375 12.739-7.693 7.693a4.5 4.5 0 0 1-6.364-6.364l10.94-10.94A3 3 0 1 1 19.5 7.372L8.552 18.32m.009-.01-.01.01m5.699-9.941-7.81 7.81a1.5 1.5 0 0 0 2.112 2.13" /></svg>';
645
+ const iconAttachment = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-6"><path stroke-linecap="round" stroke-linejoin="round" d="m18.375 12.739-7.693 7.693a4.5 4.5 0 0 1-6.364-6.364l10.94-10.94A3 3 0 1 1 19.5 7.372L8.552 18.32m.009-.01-.01.01m5.699-9.941-7.81 7.81a1.5 1.5 0 0 0 2.112 2.13" /></svg>';
664
646
  const separator = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14.707 14.707"><g><rect x="6.275" y="0" fill="#ffffff7f" width="1" height="15"/></g></svg>';
665
647
  const menuOptions = [
666
648
  { id: 'signature', tooltip: 'Signature', icon: iconSignature, class: 'signature' },
@@ -682,7 +664,6 @@ const VerdocsTemplateFields = class {
682
664
  registerInstance(this, hostRef);
683
665
  this.sdkError = createEvent(this, "sdkError");
684
666
  this.templateUpdated = createEvent(this, "templateUpdated");
685
- this.fieldsUpdated = createEvent(this, "fieldsUpdated");
686
667
  this.templateListenerId = null;
687
668
  /**
688
669
  * The endpoint to use to communicate with Verdocs. If not set, the default endpoint will be used.
@@ -778,23 +759,27 @@ const VerdocsTemplateFields = class {
778
759
  }
779
760
  }
780
761
  attachFieldAttributes(pageInfo, field, el) {
781
- // el.addEventListener('input', e => this.handleFieldChange(field, e));
782
762
  el.addEventListener('settingsChanged', () => {
783
763
  var _a;
784
- (_a = this.templateUpdated) === null || _a === void 0 ? void 0 : _a.emit({ endpoint: this.endpoint, template: this.template, event: 'added-field' });
764
+ console.log('[FIELDS] Field settings changed, updating template...');
765
+ (_a = this.templateUpdated) === null || _a === void 0 ? void 0 : _a.emit({ endpoint: this.endpoint, template: this.template, event: 'updated-field' });
785
766
  });
786
767
  el.addEventListener('deleted', () => {
787
768
  var _a;
788
769
  el.remove();
789
- (_a = this.templateUpdated) === null || _a === void 0 ? void 0 : _a.emit({ endpoint: this.endpoint, template: this.template, event: 'updated-field' });
770
+ console.log('[FIELDS] Field deleted, updating template...');
771
+ (_a = this.templateUpdated) === null || _a === void 0 ? void 0 : _a.emit({ endpoint: this.endpoint, template: this.template, event: 'deleted-field' });
790
772
  });
791
773
  el.setAttribute('templateid', this.templateId);
792
774
  el.setAttribute('fieldname', field.name);
793
775
  el.setAttribute('documentid', String(pageInfo.documentId));
776
+ // TODO: Merge these
794
777
  el.setAttribute('pageNumber', String(pageInfo.pageNumber));
778
+ el.setAttribute('pagenumber', String(field.page));
795
779
  el.setAttribute('xScale', String(pageInfo.xScale));
796
780
  el.setAttribute('yScale', String(pageInfo.yScale));
797
781
  el.setAttribute('name', field.name);
782
+ this.makeDraggable(el);
798
783
  }
799
784
  handlePageRendered(e) {
800
785
  var _a, _b;
@@ -810,10 +795,7 @@ const VerdocsTemplateFields = class {
810
795
  const id = getFieldId(field);
811
796
  const el = document.getElementById(id);
812
797
  if (el) {
813
- el.setAttribute('fieldname', field.name);
814
- el.setAttribute('pagenumber', String(field.page));
815
- el.setAttribute('documentid', String(field.document_id));
816
- this.makeDraggable(el);
798
+ this.attachFieldAttributes(pageInfo, field, el);
817
799
  }
818
800
  });
819
801
  }
@@ -3954,145 +3936,5 @@ const VerdocsTemplateRoles = class {
3954
3936
  };
3955
3937
  VerdocsTemplateRoles.style = verdocsTemplateRolesCss;
3956
3938
 
3957
- const verdocsTemplateSettingsCss = "verdocs-template-settings{display:block;max-width:600px;font-family:var(--verdocs-primary-font, \"Inter\", \"Barlow\", sans-serif)}verdocs-template-settings>form{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;background-color:#ffffff;padding:12px}verdocs-template-settings>form h5{font-size:16px;font-weight:bold;color:#46497d;margin:0 0 10px 0}verdocs-template-settings>form label{display:block;font-size:14px;font-weight:500;margin:0 0 4px 0;color:#5c6575}verdocs-template-settings>form input{border:none;font-size:18px;padding:3px 6px 3px 0;background:transparent;border-bottom:1px solid #33364b}verdocs-template-settings>form input:focus{outline:none}verdocs-template-settings>form .row{margin:20px 0 0 0}verdocs-template-settings .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-template-settings ::-webkit-input-placeholder{color:#aaaaaa}verdocs-template-settings ::-moz-placeholder{color:#aaaaaa}verdocs-template-settings :-ms-input-placeholder{color:#aaaaaa}verdocs-template-settings ::-ms-input-placeholder{color:#aaaaaa}verdocs-template-settings ::placeholder{color:#aaaaaa}";
3958
-
3959
- const MS_PER_DAY = 24 * 60 * 60 * 1000;
3960
- const VerdocsTemplateSettings = class {
3961
- constructor(hostRef) {
3962
- registerInstance(this, hostRef);
3963
- this.next = createEvent(this, "next");
3964
- this.exit = createEvent(this, "exit");
3965
- this.sdkError = createEvent(this, "sdkError");
3966
- this.templateUpdated = createEvent(this, "templateUpdated");
3967
- this.templateListenerId = null;
3968
- /**
3969
- * The endpoint to use to communicate with Verdocs. If not set, the default endpoint will be used.
3970
- */
3971
- this.endpoint = VerdocsEndpoint.getDefault();
3972
- /**
3973
- * The template ID to edit.
3974
- */
3975
- this.templateId = '';
3976
- this.name = null;
3977
- this.visibility = 'private';
3978
- this.sender = 'envelope_creator';
3979
- this.sendReminders = false;
3980
- this.initialReminder = 0;
3981
- this.followupReminders = 0;
3982
- this.dirty = false;
3983
- this.loading = true;
3984
- this.template = null;
3985
- }
3986
- disconnectedCallback() {
3987
- this.unlistenToTemplate();
3988
- }
3989
- async listenToTemplate() {
3990
- console.log('[SETTINGS] Loading template', this.templateId);
3991
- this.unlistenToTemplate();
3992
- Store.subscribe('templates', this.templateId, () => getTemplate(this.endpoint, this.templateId), false, (template) => {
3993
- console.log('[SETTINGS] Template Updated', template);
3994
- this.template = template;
3995
- this.name = template.name;
3996
- this.visibility = template.visibility;
3997
- this.sender = template.sender;
3998
- this.sendReminders = template.initial_reminder !== null;
3999
- this.initialReminder = template.initial_reminder ? Math.floor(template.initial_reminder / MS_PER_DAY) : null;
4000
- this.followupReminders = template.followup_reminders ? Math.floor(template.followup_reminders / MS_PER_DAY) : null;
4001
- this.dirty = false;
4002
- this.loading = false;
4003
- });
4004
- }
4005
- unlistenToTemplate() {
4006
- if (this.templateListenerId) {
4007
- Store.store.delListener(this.templateListenerId);
4008
- this.templateListenerId = null;
4009
- }
4010
- }
4011
- async componentWillLoad() {
4012
- var _a, _b, _c;
4013
- try {
4014
- this.endpoint.loadSession();
4015
- if (!this.templateId) {
4016
- console.log(`[SETTINGS] Missing required template ID ${this.templateId}`);
4017
- return;
4018
- }
4019
- if (!this.endpoint.session) {
4020
- console.log('[SETTINGS] Unable to start builder session, must be authenticated');
4021
- return;
4022
- }
4023
- this.listenToTemplate();
4024
- }
4025
- catch (e) {
4026
- console.log('[SETTINGS] Error with preview session', e);
4027
- (_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));
4028
- }
4029
- }
4030
- handleCancel() {
4031
- var _a;
4032
- (_a = this.exit) === null || _a === void 0 ? void 0 : _a.emit();
4033
- }
4034
- handleSubmit() {
4035
- updateTemplate(this.endpoint, this.templateId, {
4036
- name: this.name,
4037
- visibility: this.visibility,
4038
- sender: this.sender,
4039
- initial_reminder: this.sendReminders ? this.initialReminder * MS_PER_DAY : null,
4040
- followup_reminders: this.sendReminders ? this.followupReminders * MS_PER_DAY : null,
4041
- })
4042
- .then(template => {
4043
- var _a, _b;
4044
- console.log('[SETTINGS] Template Updated', template);
4045
- this.dirty = false;
4046
- this.name = template.name;
4047
- this.visibility = template.visibility;
4048
- this.sender = template.sender;
4049
- this.sendReminders = template.initial_reminder !== null;
4050
- this.initialReminder = template.initial_reminder ? Math.floor(template.initial_reminder / MS_PER_DAY) : null;
4051
- this.followupReminders = template.followup_reminders ? Math.floor(template.followup_reminders / MS_PER_DAY) : null;
4052
- (_a = this.templateUpdated) === null || _a === void 0 ? void 0 : _a.emit({ endpoint: this.endpoint, template, event: 'update' });
4053
- (_b = this.next) === null || _b === void 0 ? void 0 : _b.emit();
4054
- })
4055
- .catch(e => {
4056
- var _a, _b, _c, _d, _e;
4057
- console.log('[SETTINGS] Error updating template', e);
4058
- (_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));
4059
- 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.');
4060
- });
4061
- }
4062
- render() {
4063
- if (!this.endpoint.session) {
4064
- return (h(Host, null, h("verdocs-component-error", { message: "You must be authenticated to use this module." })));
4065
- }
4066
- if (this.loading || !this.template) {
4067
- return (h(Host, { class: "loading" }, h("verdocs-loader", null)));
4068
- }
4069
- 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) => {
4070
- this.name = e.target.value;
4071
- this.dirty = true;
4072
- } })), h("div", { class: "row" }, h("verdocs-select-input", { label: "Visibility", value: this.visibility, onInput: (e) => {
4073
- this.visibility = e.target.value;
4074
- this.dirty = true;
4075
- }, options: [
4076
- { value: 'private', label: 'Private' },
4077
- { value: 'shared', label: 'Shared' },
4078
- { value: 'public', label: 'Public' },
4079
- ] })), h("div", { class: "row" }, h("verdocs-select-input", { label: "Owner for envelopes created from this template", value: this.sender, onInput: (e) => {
4080
- this.sender = e.target.value;
4081
- this.dirty = true;
4082
- }, options: [
4083
- { value: 'envelope_creator', label: 'Envelope Creator' },
4084
- { value: 'template_owner', label: 'Template Owner' },
4085
- ] })), 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) => {
4086
- this.initialReminder = +e.target.value;
4087
- this.dirty = true;
4088
- } }))), 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) => {
4089
- this.followupReminders = +e.target.value;
4090
- this.dirty = true;
4091
- } }))), 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 })))));
4092
- }
4093
- get el() { return getElement(this); }
4094
- };
4095
- VerdocsTemplateSettings.style = verdocsTemplateSettingsCss;
4096
-
4097
- export { VerdocsPreview as verdocs_preview, VerdocsSend as verdocs_send, VerdocsTemplateAttachments as verdocs_template_attachments, VerdocsTemplateBuildTabs as verdocs_template_build_tabs, VerdocsTemplateFields as verdocs_template_fields, VerdocsTemplateRoles as verdocs_template_roles, VerdocsTemplateSettings as verdocs_template_settings };
4098
- //# sourceMappingURL=verdocs-preview.verdocs-send.verdocs-template-attachments.verdocs-template-build-tabs.verdocs-template-fields.verdocs-template-roles.verdocs-template-settings.entry.js.map
3939
+ export { VerdocsPreview as verdocs_preview, VerdocsSend as verdocs_send, VerdocsTemplateAttachments as verdocs_template_attachments, VerdocsTemplateBuildTabs as verdocs_template_build_tabs, VerdocsTemplateFields as verdocs_template_fields, VerdocsTemplateRoles as verdocs_template_roles };
3940
+ //# sourceMappingURL=verdocs-preview.verdocs-send.verdocs-template-attachments.verdocs-template-build-tabs.verdocs-template-fields.verdocs-template-roles.entry.js.map
@@ -1,13 +1,10 @@
1
- import { p as proxyCustomElement, H, c as createEvent, h, d as Host } from './p-CUAGH_8P.js';
1
+ import { r as registerInstance, c as createEvent, h, H as Host } from './index-BIRwgFLv.js';
2
2
 
3
3
  const verdocsTabsCss = "verdocs-tabs{gap:10px;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-direction:row;flex-direction:row;font-family:\"Inter\", \"Barlow\", sans-serif}verdocs-tabs .tab{display:-ms-flexbox;display:flex;color:#111111;cursor:pointer;font-size:14px;font-weight:400;padding:5px 10px;-ms-flex-align:center;align-items:center;text-transform:none;-ms-flex-pack:center;justify-content:center;border-bottom:4px solid transparent}verdocs-tabs .tab:focus{border:none;outline:none}verdocs-tabs .tab.active{color:#000000;font-weight:500;border-bottom:4px solid #654dcb}verdocs-tabs .tab.disabled{color:#aaaaaa;cursor:default}";
4
4
 
5
- const VerdocsTabs = /*@__PURE__*/ proxyCustomElement(class VerdocsTabs extends H {
6
- constructor(registerHost) {
7
- super();
8
- if (registerHost !== false) {
9
- this.__registerHost();
10
- }
5
+ const VerdocsTabs = class {
6
+ constructor(hostRef) {
7
+ registerInstance(this, hostRef);
11
8
  this.selectTab = createEvent(this, "selectTab");
12
9
  /**
13
10
  * The tabs to display
@@ -25,26 +22,8 @@ const VerdocsTabs = /*@__PURE__*/ proxyCustomElement(class VerdocsTabs extends H
25
22
  render() {
26
23
  return (h(Host, { key: 'b78818a23892499517726f89f5cce6af6b7f42e1' }, this.tabs.map((tab, index) => (h("div", { class: `tab ${index === this.selectedTab ? 'active' : ''} ${tab.disabled ? 'disabled' : ''}`, onClick: tab.disabled ? () => { } : () => this.handleSelectTab(index) }, tab.label))), h("div", { key: '2105eefb878bc7237bd9c46d8533085d580b94f8', class: "flex flex-1" }), h("slot", { key: 'c477b2f6880442e15bc3bc95f67dec12f1134074' }, h("div", { key: 'c6481423137eb98ee64cc9afedea6d43eca89b75' }))));
27
24
  }
28
- static get style() { return verdocsTabsCss; }
29
- }, [260, "verdocs-tabs", {
30
- "tabs": [16],
31
- "selectedTab": [2, "selected-tab"]
32
- }]);
33
- function defineCustomElement() {
34
- if (typeof customElements === "undefined") {
35
- return;
36
- }
37
- const components = ["verdocs-tabs"];
38
- components.forEach(tagName => { switch (tagName) {
39
- case "verdocs-tabs":
40
- if (!customElements.get(tagName)) {
41
- customElements.define(tagName, VerdocsTabs);
42
- }
43
- break;
44
- } });
45
- }
46
-
47
- export { VerdocsTabs as V, defineCustomElement as d };
48
- //# sourceMappingURL=p-e7e4Os6T.js.map
25
+ };
26
+ VerdocsTabs.style = verdocsTabsCss;
49
27
 
50
- //# sourceMappingURL=p-e7e4Os6T.js.map
28
+ export { VerdocsTabs as verdocs_tabs };
29
+ //# sourceMappingURL=verdocs-tabs.entry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"verdocs-tabs.entry.js","sources":["src/components/controls/verdocs-tabs/verdocs-tabs.scss?tag=verdocs-tabs","src/components/controls/verdocs-tabs/verdocs-tabs.tsx"],"sourcesContent":["@import '../../../theme.scss';\n\nverdocs-tabs {\n gap: 10px;\n display: flex;\n flex-wrap: wrap;\n flex-direction: row;\n font-family: $primary-font;\n\n .tab {\n display: flex;\n color: #111111;\n cursor: pointer;\n font-size: 14px;\n font-weight: 400;\n padding: 5px 10px;\n align-items: center;\n text-transform: none;\n justify-content: center;\n border-bottom: 4px solid transparent;\n\n &:focus {\n border: none;\n outline: none;\n }\n\n &.active {\n color: #000000;\n font-weight: 500;\n border-bottom: 4px solid #654dcb;\n }\n\n &.disabled {\n color: #aaaaaa;\n cursor: default;\n }\n }\n}\n","import {Component, Prop, Host, h, Event, EventEmitter} from '@stencil/core';\n\nexport interface ITab {\n id?: string;\n label: string;\n disabled?: boolean;\n // TODO: Tooltips?\n}\n\n/**\n * Display a simple row of selectable tabs. This is a controlled element.\n * The parent must adjust selectedTab as selection events are fired.\n *\n * ```ts\n * <verdocs-tabs tabs={[...tabs]} />\n * ```\n */\n@Component({\n tag: 'verdocs-tabs',\n styleUrl: 'verdocs-tabs.scss',\n})\nexport class VerdocsTabs {\n /**\n * The tabs to display\n */\n @Prop() tabs: ITab[] = [];\n\n /**\n * The index of the tab to show selected.\n */\n @Prop() selectedTab: number = 0;\n\n /**\n * Event fired when the user clicks a template to view it. Typically the host application will use this to navigate\n * to the template preview. This is also fired when the user selects \"Preview/Send\" fropm the dropdown menu.\n */\n @Event({composed: true}) selectTab: EventEmitter<{tab: ITab; index: number}>;\n\n handleSelectTab(index: number) {\n this.selectTab?.emit({tab: this.tabs[index], index});\n }\n\n render() {\n return (\n <Host>\n {this.tabs.map((tab, index) => (\n <div class={`tab ${index === this.selectedTab ? 'active' : ''} ${tab.disabled ? 'disabled' : ''}`} onClick={tab.disabled ? () => {} : () => this.handleSelectTab(index)}>\n {tab.label}\n </div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25 +1,15 @@
1
- import { p as proxyCustomElement, H, c as createEvent, h, d as Host } from './p-CUAGH_8P.js';
1
+ import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-BIRwgFLv.js';
2
2
  import { VerdocsEndpoint, getTemplate, updateTemplate } from '@verdocs/js-sdk';
3
- import { V as VerdocsToast } from './p-D97GxsI-.js';
4
- import { S as SDKError } from './p-C1sRVZWv.js';
5
- import { S as Store } from './p-bS8INhRF.js';
6
- import { d as defineCustomElement$7 } from './p-C_yyK5xE.js';
7
- import { d as defineCustomElement$6 } from './p-CdmWI0-q.js';
8
- import { d as defineCustomElement$5 } from './p-CnPaJH5T.js';
9
- import { d as defineCustomElement$4 } from './p-CNKACBaL.js';
10
- import { d as defineCustomElement$3 } from './p-C1AtapGD.js';
11
- import { d as defineCustomElement$2 } from './p-j7Gj43ri.js';
12
- import { d as defineCustomElement$1 } from './p--qy4LrSt.js';
3
+ import { V as VerdocsToast } from './Toast-D97GxsI-.js';
4
+ import { S as SDKError } from './errors-C1sRVZWv.js';
5
+ import { S as Store } from './Datastore-bS8INhRF.js';
13
6
 
14
7
  const verdocsTemplateSettingsCss = "verdocs-template-settings{display:block;max-width:600px;font-family:var(--verdocs-primary-font, \"Inter\", \"Barlow\", sans-serif)}verdocs-template-settings>form{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;background-color:#ffffff;padding:12px}verdocs-template-settings>form h5{font-size:16px;font-weight:bold;color:#46497d;margin:0 0 10px 0}verdocs-template-settings>form label{display:block;font-size:14px;font-weight:500;margin:0 0 4px 0;color:#5c6575}verdocs-template-settings>form input{border:none;font-size:18px;padding:3px 6px 3px 0;background:transparent;border-bottom:1px solid #33364b}verdocs-template-settings>form input:focus{outline:none}verdocs-template-settings>form .row{margin:20px 0 0 0}verdocs-template-settings .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-template-settings ::-webkit-input-placeholder{color:#aaaaaa}verdocs-template-settings ::-moz-placeholder{color:#aaaaaa}verdocs-template-settings :-ms-input-placeholder{color:#aaaaaa}verdocs-template-settings ::-ms-input-placeholder{color:#aaaaaa}verdocs-template-settings ::placeholder{color:#aaaaaa}";
15
8
 
16
9
  const MS_PER_DAY = 24 * 60 * 60 * 1000;
17
- const VerdocsTemplateSettings = /*@__PURE__*/ proxyCustomElement(class VerdocsTemplateSettings extends H {
18
- constructor(registerHost) {
19
- super();
20
- if (registerHost !== false) {
21
- this.__registerHost();
22
- }
10
+ const VerdocsTemplateSettings = class {
11
+ constructor(hostRef) {
12
+ registerInstance(this, hostRef);
23
13
  this.next = createEvent(this, "next");
24
14
  this.exit = createEvent(this, "exit");
25
15
  this.sdkError = createEvent(this, "sdkError");
@@ -150,71 +140,9 @@ const VerdocsTemplateSettings = /*@__PURE__*/ proxyCustomElement(class VerdocsTe
150
140
  this.dirty = true;
151
141
  } }))), 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 })))));
152
142
  }
153
- get el() { return this; }
154
- static get style() { return verdocsTemplateSettingsCss; }
155
- }, [256, "verdocs-template-settings", {
156
- "endpoint": [16],
157
- "templateId": [1, "template-id"],
158
- "name": [32],
159
- "visibility": [32],
160
- "sender": [32],
161
- "sendReminders": [32],
162
- "initialReminder": [32],
163
- "followupReminders": [32],
164
- "dirty": [32],
165
- "loading": [32],
166
- "template": [32]
167
- }]);
168
- function defineCustomElement() {
169
- if (typeof customElements === "undefined") {
170
- return;
171
- }
172
- const components = ["verdocs-template-settings", "verdocs-button", "verdocs-component-error", "verdocs-help-icon", "verdocs-loader", "verdocs-select-input", "verdocs-switch", "verdocs-text-input"];
173
- components.forEach(tagName => { switch (tagName) {
174
- case "verdocs-template-settings":
175
- if (!customElements.get(tagName)) {
176
- customElements.define(tagName, VerdocsTemplateSettings);
177
- }
178
- break;
179
- case "verdocs-button":
180
- if (!customElements.get(tagName)) {
181
- defineCustomElement$7();
182
- }
183
- break;
184
- case "verdocs-component-error":
185
- if (!customElements.get(tagName)) {
186
- defineCustomElement$6();
187
- }
188
- break;
189
- case "verdocs-help-icon":
190
- if (!customElements.get(tagName)) {
191
- defineCustomElement$5();
192
- }
193
- break;
194
- case "verdocs-loader":
195
- if (!customElements.get(tagName)) {
196
- defineCustomElement$4();
197
- }
198
- break;
199
- case "verdocs-select-input":
200
- if (!customElements.get(tagName)) {
201
- defineCustomElement$3();
202
- }
203
- break;
204
- case "verdocs-switch":
205
- if (!customElements.get(tagName)) {
206
- defineCustomElement$2();
207
- }
208
- break;
209
- case "verdocs-text-input":
210
- if (!customElements.get(tagName)) {
211
- defineCustomElement$1();
212
- }
213
- break;
214
- } });
215
- }
216
-
217
- export { VerdocsTemplateSettings as V, defineCustomElement as d };
218
- //# sourceMappingURL=p-Cp7g7TMK.js.map
143
+ get el() { return getElement(this); }
144
+ };
145
+ VerdocsTemplateSettings.style = verdocsTemplateSettingsCss;
219
146
 
220
- //# sourceMappingURL=p-Cp7g7TMK.js.map
147
+ export { VerdocsTemplateSettings as verdocs_template_settings };
148
+ //# sourceMappingURL=verdocs-template-settings.entry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"verdocs-template-settings.entry.js","sources":["src/components/templates/verdocs-template-settings/verdocs-template-settings.scss?tag=verdocs-template-settings","src/components/templates/verdocs-template-settings/verdocs-template-settings.tsx"],"sourcesContent":["@import '../../../theme.scss';\n\nverdocs-template-settings {\n display: block;\n max-width: 600px;\n font-family: $verdocs-primary-font;\n\n > form {\n display: flex;\n flex-direction: column;\n background-color: $verdocs-grey-4;\n\n // The extra right padding helps ensure when dragged elements move to absolute positioning\n padding: 12px;\n\n h5 {\n font-size: 16px;\n font-weight: bold;\n color: $verdocs-grey-blue;\n margin: 0 0 10px 0;\n }\n\n label {\n display: block;\n font-size: 14px;\n font-weight: 500;\n margin: 0 0 4px 0;\n color: $verdocs-bg-4;\n }\n\n input {\n border: none;\n font-size: 18px;\n padding: 3px 6px 3px 0;\n background: transparent;\n border-bottom: 1px solid $verdocs-dark-blue;\n\n &:focus {\n outline: none;\n }\n }\n\n .row {\n margin: 20px 0 0 0;\n }\n }\n\n .buttons {\n display: flex;\n column-gap: 8px;\n margin-top: 16px;\n flex-direction: row;\n }\n\n ::placeholder {\n color: $verdocs-bg-2;\n }\n}\n","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"],"names":[],"mappings":";;;;;;AAAA,MAAM,0BAA0B,GAAG,qtCAAqtC;;ACMxvC,MAAM,UAAU,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI;MAUzB,uBAAuB,GAAA,MAAA;AALpC,IAAA,WAAA,CAAA,OAAA,EAAA;;;;;;AAMU,QAAA,IAAkB,CAAA,kBAAA,GAAG,IAAI;AAKjC;;AAEG;AACK,QAAA,IAAA,CAAA,QAAQ,GAAoB,eAAe,CAAC,UAAU,EAAE;AAEhE;;AAEG;AACK,QAAA,IAAU,CAAA,UAAA,GAAW,EAAE;AAuBtB,QAAA,IAAI,CAAA,IAAA,GAAkB,IAAI;AAC1B,QAAA,IAAU,CAAA,UAAA,GAAwB,SAAS;AAC3C,QAAA,IAAM,CAAA,MAAA,GAAoB,kBAAkB;AAC5C,QAAA,IAAa,CAAA,aAAA,GAAG,KAAK;AACrB,QAAA,IAAe,CAAA,eAAA,GAAG,CAAC;AACnB,QAAA,IAA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