@verdocs/web-sdk 6.5.0-beta.33 → 6.5.0-beta.34

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (26) hide show
  1. 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 +1 -1
  2. package/dist/cjs/verdocs-preview_7.cjs.entry.js +7 -5
  3. package/dist/collection/components/templates/verdocs-template-fields/verdocs-template-fields.css +0 -1
  4. package/dist/collection/components/templates/verdocs-template-fields/verdocs-template-fields.js +6 -4
  5. package/dist/collection/components/templates/verdocs-template-fields/verdocs-template-fields.js.map +1 -1
  6. package/dist/components/{p-5kRAYvGJ.js → p-BWvUv89M.js} +9 -7
  7. package/dist/components/p-BWvUv89M.js.map +1 -0
  8. package/dist/components/verdocs-build.js +1 -1
  9. package/dist/components/verdocs-template-fields.js +1 -1
  10. 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 +1 -1
  11. package/dist/esm/verdocs-preview_7.entry.js +7 -5
  12. 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 +1 -1
  13. package/dist/esm-es5/verdocs-preview_7.entry.js +1 -1
  14. package/dist/esm-es5/verdocs-preview_7.entry.js.map +1 -1
  15. package/dist/verdocs-web-sdk/{p-c554dc0d.system.entry.js → p-932934f5.system.entry.js} +2 -2
  16. package/dist/verdocs-web-sdk/p-932934f5.system.entry.js.map +1 -0
  17. package/dist/verdocs-web-sdk/p-B8zpaHu-.system.js +1 -1
  18. package/dist/verdocs-web-sdk/{p-CcXKU_8V.system.js.map → p-B_NM_Ddi.system.js.map} +1 -1
  19. package/dist/verdocs-web-sdk/{p-2173cb13.entry.js → p-d09f0a2c.entry.js} +2 -2
  20. package/dist/verdocs-web-sdk/p-d09f0a2c.entry.js.map +1 -0
  21. 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 +1 -1
  22. package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
  23. package/package.json +1 -1
  24. package/dist/components/p-5kRAYvGJ.js.map +0 -1
  25. package/dist/verdocs-web-sdk/p-2173cb13.entry.js.map +0 -1
  26. package/dist/verdocs-web-sdk/p-c554dc0d.system.entry.js.map +0 -1
@@ -651,7 +651,7 @@ const VerdocsTemplateBuildTabs = class {
651
651
  };
652
652
  VerdocsTemplateBuildTabs.style = verdocsTemplateBuildTabsCss;
653
653
 
654
- const verdocsTemplateFieldsCss = "verdocs-template-fields{font-family:var(--verdocs-primary-font, \"Inter\", \"Barlow\", sans-serif);position:relative;display:block;min-height:600px}verdocs-template-fields .page-0{padding:65px 15px 0 15px;-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-template-fields .page-0 .user-placed-fields{height:100px;position:relative;background:#ffffff;-webkit-box-shadow:0 0 10px 5px rgba(0, 0, 0, 0.0588235294);box-shadow:0 0 10px 5px rgba(0, 0, 0, 0.0588235294)}verdocs-template-fields .page-0 .user-placed-fields .title{top:0;left:0;color:#ffffff;font-size:12px;padding:3px 6px;font-weight:bold;position:absolute;background:#46497d}verdocs-template-fields .pages{display:-ms-flexbox;display:flex;padding:15px;row-gap:15px;min-height:200px;position:relative;-ms-flex-align:center;align-items:center;-webkit-box-sizing:border-box;box-sizing:border-box;-ms-flex-direction:column;flex-direction:column}verdocs-template-fields .pages div,verdocs-template-fields .pages canvas{-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-template-fields .pages .document-separator{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:10px;padding:12px 20px;width:100%;max-width:1028px;-webkit-box-sizing:border-box;box-sizing:border-box;background-color:#33364b;color:white;border-radius:6px;font-size:16px;font-weight:500;margin-top:20px;-webkit-box-shadow:0 2px 4px rgba(0, 0, 0, 0.1);box-shadow:0 2px 4px rgba(0, 0, 0, 0.1)}verdocs-template-fields .pages .document-separator svg{-ms-flex-negative:0;flex-shrink:0}verdocs-template-fields .pages .document-separator:first-child{margin-top:0}verdocs-template-fields #verdocs-template-fields-toolbar{width:100%;height:50px;display:-ms-flexbox;display:flex;-webkit-column-gap:15px;-moz-column-gap:15px;column-gap:15px;font-weight:700;padding:0 20px 0 0;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;color:#f5f5fa;-ms-flex-pack:center;justify-content:center;background:#46497d}verdocs-template-fields #verdocs-template-fields-toolbar>verdocs-select-input{margin:0}verdocs-template-fields #verdocs-template-fields-toolbar svg{width:24px;height:24px}verdocs-template-fields #verdocs-template-fields-toolbar .add-for{margin:0;font-weight:500;color:#f5f5fa}verdocs-template-fields #verdocs-template-fields-toolbar verdocs-select-input{margin:0 20px 0 0}@media all and (max-width: 1000px){verdocs-template-fields #verdocs-template-fields-toolbar{-webkit-column-gap:8px;-moz-column-gap:8px;column-gap:8px;padding:0 10px 0 0}verdocs-template-fields #verdocs-template-fields-toolbar svg{-webkit-transform:scale(0.8);transform:scale(0.8)}verdocs-template-fields #verdocs-template-fields-toolbar .add-for,verdocs-template-fields #verdocs-template-fields-toolbar verdocs-select-input{display:none}}@media all and (max-width: 600px){verdocs-template-fields #verdocs-template-fields-toolbar{-webkit-column-gap:6px;-moz-column-gap:6px;column-gap:6px}verdocs-template-fields #verdocs-template-fields-toolbar svg{-webkit-transform:scale(0.6);transform:scale(0.6)}verdocs-template-fields #verdocs-template-fields-toolbar .separator,verdocs-template-fields #verdocs-template-fields-toolbar .add-for,verdocs-template-fields #verdocs-template-fields-toolbar verdocs-select-input{display:none}}verdocs-template-fields.placing-attachment{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-checkbox{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-date{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath fill='%23000000' d='M7.6 13.925q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375Zm4.4 0q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375Zm4.4 0q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375ZM5.3 22.85q-1.325 0-2.238-.912-.912-.913-.912-2.238V6.3q0-1.325.912-2.238.913-.912 2.238-.912H6v-2h2.575v2h6.85v-2H18v2h.7q1.325 0 2.238.912.912.913.912 2.238v13.4q0 1.325-.912 2.238-.913.912-2.238.912Zm0-3.15h13.4V10H5.3v9.7ZM5.3 8h13.4V6.3H5.3Zm0 0V6.3 8Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-dropdown{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24' stroke-width='1.5' stroke='currentColor'%3E%3Cpath stroke='%23000000' 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' /%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-initial{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='M6.225 20.775V7h-5V3.225H15V7h-5v13.775Zm9.775 0v-8h-3V9h9.775v3.775h-3v8Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-payment{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-radio{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='M12 17q2.075 0 3.538-1.463Q17 14.075 17 12t-1.462-3.538Q14.075 7 12 7 9.925 7 8.463 8.462 7 9.925 7 12q0 2.075 1.463 3.537Q9.925 17 12 17Zm0 5.85q-2.275 0-4.25-.85t-3.438-2.312Q2.85 18.225 2 16.25q-.85-1.975-.85-4.25T2 7.75q.85-1.975 2.312-3.438Q5.775 2.85 7.75 2q1.975-.85 4.25-.85t4.25.85q1.975.85 3.438 2.312Q21.15 5.775 22 7.75q.85 1.975.85 4.25T22 16.25q-.85 1.975-2.312 3.438Q18.225 21.15 16.25 22q-1.975.85-4.25.85Zm0-3.15q3.25 0 5.475-2.225Q19.7 15.25 19.7 12q0-3.25-2.225-5.475Q15.25 4.3 12 4.3q-3.25 0-5.475 2.225Q4.3 8.75 4.3 12q0 3.25 2.225 5.475Q8.75 19.7 12 19.7Zm0-7.7Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-signature{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='m9.225 21.225 4.65-4.65h8.45v4.65Zm-5.35-2.2H5.05l8.5-8.5-1.175-1.175-8.5 8.5Zm14.25-9.95L13.8 4.8l1.325-1.325q.625-.65 1.525-.663.9-.012 1.6.663l1.225 1.175q.675.675.663 1.562-.013.888-.663 1.513ZM16.7 10.55 6 21.225H1.675V16.9L12.35 6.225Zm-3.725-.625-.6-.575 1.175 1.175Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-textarea{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='M3.225 20.725v-3.15h11.55v3.15Zm0-4.775V12.8h17.55v3.15Zm0-4.75V8.05h17.55v3.15Zm0-4.775v-3.15h17.55v3.15Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-textbox{cursor:url(\"data:image/svg+xml,%3Csvg width='32' height='15' viewBox='0 0 32 15' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cmask id='path-1-inside-1_1401_24' fill='white'%3E%3Cpath d='M0 0H32V15H0V0Z'/%3E%3C/mask%3E%3Cpath d='M0 0H32V15H0V0Z' fill='%234C56CB' fill-opacity='0.1'/%3E%3Cpath d='M0 0V-1H-1V0H0ZM0 15H-1V16H0V15ZM0 1H32V-1H0V1ZM32 14H0V16H32V14ZM1 15V0H-1V15H1Z' fill='%234C56CB' mask='url(%23path-1-inside-1_1401_24)'/%3E%3Cpath d='M3 11.8V8.65H14.15V11.8H3ZM3 6.65V3.5H20.15V6.65H3Z' fill='%234C56CB'/%3E%3Cline x1='31.5' y1='1' x2='31.5' y2='14' stroke='%234C56CB' stroke-opacity='0.32' stroke-dasharray='1 1'/%3E%3C/svg%3E%0A\") 0 14, pointer}verdocs-template-fields.placing-timestamp{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath fill='%23000000' 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'%3E%3C/path%3E%3C/svg%3E\") 16 16, pointer}";
654
+ const verdocsTemplateFieldsCss = "verdocs-template-fields{font-family:var(--verdocs-primary-font, \"Inter\", \"Barlow\", sans-serif);position:relative;display:block;min-height:600px}verdocs-template-fields .page-0{padding:65px 15px 0 15px;-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-template-fields .page-0 .user-placed-fields{height:100px;position:relative;background:#ffffff;-webkit-box-shadow:0 0 10px 5px rgba(0, 0, 0, 0.0588235294);box-shadow:0 0 10px 5px rgba(0, 0, 0, 0.0588235294)}verdocs-template-fields .page-0 .user-placed-fields .title{top:0;left:0;color:#ffffff;font-size:12px;padding:3px 6px;font-weight:bold;position:absolute;background:#46497d}verdocs-template-fields .pages{display:-ms-flexbox;display:flex;padding:15px;row-gap:15px;min-height:200px;position:relative;-ms-flex-align:center;align-items:center;-webkit-box-sizing:border-box;box-sizing:border-box;-ms-flex-direction:column;flex-direction:column}verdocs-template-fields .pages div,verdocs-template-fields .pages canvas{-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-template-fields .pages .document-separator{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:10px;padding:12px 20px;width:100%;-webkit-box-sizing:border-box;box-sizing:border-box;background-color:#33364b;color:white;border-radius:6px;font-size:16px;font-weight:500;margin-top:20px;-webkit-box-shadow:0 2px 4px rgba(0, 0, 0, 0.1);box-shadow:0 2px 4px rgba(0, 0, 0, 0.1)}verdocs-template-fields .pages .document-separator svg{-ms-flex-negative:0;flex-shrink:0}verdocs-template-fields .pages .document-separator:first-child{margin-top:0}verdocs-template-fields #verdocs-template-fields-toolbar{width:100%;height:50px;display:-ms-flexbox;display:flex;-webkit-column-gap:15px;-moz-column-gap:15px;column-gap:15px;font-weight:700;padding:0 20px 0 0;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;color:#f5f5fa;-ms-flex-pack:center;justify-content:center;background:#46497d}verdocs-template-fields #verdocs-template-fields-toolbar>verdocs-select-input{margin:0}verdocs-template-fields #verdocs-template-fields-toolbar svg{width:24px;height:24px}verdocs-template-fields #verdocs-template-fields-toolbar .add-for{margin:0;font-weight:500;color:#f5f5fa}verdocs-template-fields #verdocs-template-fields-toolbar verdocs-select-input{margin:0 20px 0 0}@media all and (max-width: 1000px){verdocs-template-fields #verdocs-template-fields-toolbar{-webkit-column-gap:8px;-moz-column-gap:8px;column-gap:8px;padding:0 10px 0 0}verdocs-template-fields #verdocs-template-fields-toolbar svg{-webkit-transform:scale(0.8);transform:scale(0.8)}verdocs-template-fields #verdocs-template-fields-toolbar .add-for,verdocs-template-fields #verdocs-template-fields-toolbar verdocs-select-input{display:none}}@media all and (max-width: 600px){verdocs-template-fields #verdocs-template-fields-toolbar{-webkit-column-gap:6px;-moz-column-gap:6px;column-gap:6px}verdocs-template-fields #verdocs-template-fields-toolbar svg{-webkit-transform:scale(0.6);transform:scale(0.6)}verdocs-template-fields #verdocs-template-fields-toolbar .separator,verdocs-template-fields #verdocs-template-fields-toolbar .add-for,verdocs-template-fields #verdocs-template-fields-toolbar verdocs-select-input{display:none}}verdocs-template-fields.placing-attachment{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-checkbox{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-date{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath fill='%23000000' d='M7.6 13.925q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375Zm4.4 0q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375Zm4.4 0q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375ZM5.3 22.85q-1.325 0-2.238-.912-.912-.913-.912-2.238V6.3q0-1.325.912-2.238.913-.912 2.238-.912H6v-2h2.575v2h6.85v-2H18v2h.7q1.325 0 2.238.912.912.913.912 2.238v13.4q0 1.325-.912 2.238-.913.912-2.238.912Zm0-3.15h13.4V10H5.3v9.7ZM5.3 8h13.4V6.3H5.3Zm0 0V6.3 8Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-dropdown{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24' stroke-width='1.5' stroke='currentColor'%3E%3Cpath stroke='%23000000' 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' /%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-initial{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='M6.225 20.775V7h-5V3.225H15V7h-5v13.775Zm9.775 0v-8h-3V9h9.775v3.775h-3v8Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-payment{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-radio{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='M12 17q2.075 0 3.538-1.463Q17 14.075 17 12t-1.462-3.538Q14.075 7 12 7 9.925 7 8.463 8.462 7 9.925 7 12q0 2.075 1.463 3.537Q9.925 17 12 17Zm0 5.85q-2.275 0-4.25-.85t-3.438-2.312Q2.85 18.225 2 16.25q-.85-1.975-.85-4.25T2 7.75q.85-1.975 2.312-3.438Q5.775 2.85 7.75 2q1.975-.85 4.25-.85t4.25.85q1.975.85 3.438 2.312Q21.15 5.775 22 7.75q.85 1.975.85 4.25T22 16.25q-.85 1.975-2.312 3.438Q18.225 21.15 16.25 22q-1.975.85-4.25.85Zm0-3.15q3.25 0 5.475-2.225Q19.7 15.25 19.7 12q0-3.25-2.225-5.475Q15.25 4.3 12 4.3q-3.25 0-5.475 2.225Q4.3 8.75 4.3 12q0 3.25 2.225 5.475Q8.75 19.7 12 19.7Zm0-7.7Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-signature{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='m9.225 21.225 4.65-4.65h8.45v4.65Zm-5.35-2.2H5.05l8.5-8.5-1.175-1.175-8.5 8.5Zm14.25-9.95L13.8 4.8l1.325-1.325q.625-.65 1.525-.663.9-.012 1.6.663l1.225 1.175q.675.675.663 1.562-.013.888-.663 1.513ZM16.7 10.55 6 21.225H1.675V16.9L12.35 6.225Zm-3.725-.625-.6-.575 1.175 1.175Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-textarea{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='M3.225 20.725v-3.15h11.55v3.15Zm0-4.775V12.8h17.55v3.15Zm0-4.75V8.05h17.55v3.15Zm0-4.775v-3.15h17.55v3.15Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-textbox{cursor:url(\"data:image/svg+xml,%3Csvg width='32' height='15' viewBox='0 0 32 15' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cmask id='path-1-inside-1_1401_24' fill='white'%3E%3Cpath d='M0 0H32V15H0V0Z'/%3E%3C/mask%3E%3Cpath d='M0 0H32V15H0V0Z' fill='%234C56CB' fill-opacity='0.1'/%3E%3Cpath d='M0 0V-1H-1V0H0ZM0 15H-1V16H0V15ZM0 1H32V-1H0V1ZM32 14H0V16H32V14ZM1 15V0H-1V15H1Z' fill='%234C56CB' mask='url(%23path-1-inside-1_1401_24)'/%3E%3Cpath d='M3 11.8V8.65H14.15V11.8H3ZM3 6.65V3.5H20.15V6.65H3Z' fill='%234C56CB'/%3E%3Cline x1='31.5' y1='1' x2='31.5' y2='14' stroke='%234C56CB' stroke-opacity='0.32' stroke-dasharray='1 1'/%3E%3C/svg%3E%0A\") 0 14, pointer}verdocs-template-fields.placing-timestamp{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath fill='%23000000' 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'%3E%3C/path%3E%3C/svg%3E\") 16 16, pointer}";
655
655
 
656
656
  const iconTextbox = '<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="M3.425 16.15V13h11.15v3.15Zm0-5.15V7.85h17.15V11Z"/></svg>';
657
657
  const iconCheck = '<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z"/></svg>';
@@ -752,7 +752,7 @@ const VerdocsTemplateFields = class {
752
752
  componentWillUpdate() {
753
753
  var _a, _b;
754
754
  // If a new role was added and there were none yet so far, or the "selected" role was deleted, reset our selection
755
- const roles = ((_a = this.template) === null || _a === void 0 ? void 0 : _a.roles) || [];
755
+ const roles = [...(((_a = this.template) === null || _a === void 0 ? void 0 : _a.roles) || [])].sort((a, b) => { var _a, _b; return ((_a = a.sequence) !== null && _a !== void 0 ? _a : 0) - ((_b = b.sequence) !== null && _b !== void 0 ? _b : 0); });
756
756
  if (!this.selectedRoleName || !roles.find(role => role && role.name === this.selectedRoleName)) {
757
757
  this.selectedRoleName = ((_b = roles[0]) === null || _b === void 0 ? void 0 : _b.name) || '';
758
758
  console.log('[FIELDS] Selected new role', this.selectedRoleName);
@@ -764,11 +764,12 @@ const VerdocsTemplateFields = class {
764
764
  async listenToTemplate() {
765
765
  this.unlistenToTemplate();
766
766
  Datastore.Store.subscribe('templates', this.templateId, () => jsSdk.getTemplate(this.endpoint, this.templateId), false, (template) => {
767
- var _a, _b;
767
+ var _a;
768
768
  this.template = template;
769
769
  this.loading = false;
770
770
  if (!this.selectedRoleName) {
771
- this.selectedRoleName = ((_b = (_a = template.roles) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.name) || '';
771
+ const sorted = [...(template.roles || [])].sort((a, b) => { var _a, _b; return ((_a = a.sequence) !== null && _a !== void 0 ? _a : 0) - ((_b = b.sequence) !== null && _b !== void 0 ? _b : 0); });
772
+ this.selectedRoleName = ((_a = sorted[0]) === null || _a === void 0 ? void 0 : _a.name) || '';
772
773
  }
773
774
  });
774
775
  }
@@ -967,7 +968,8 @@ const VerdocsTemplateFields = class {
967
968
  if (!this.endpoint.session) {
968
969
  return (index$1.h(index$1.Host, null, index$1.h("verdocs-component-error", { message: "You must be authenticated to use this module." })));
969
970
  }
970
- const selectableRoles = (((_a = this.template) === null || _a === void 0 ? void 0 : _a.roles) || []).map(role => ({ value: role.name, label: role.full_name ? `${role.name}: ${role.full_name}` : role.name }));
971
+ const sortedRoles = [...(((_a = this.template) === null || _a === void 0 ? void 0 : _a.roles) || [])].sort((a, b) => { var _a, _b; return ((_a = a.sequence) !== null && _a !== void 0 ? _a : 0) - ((_b = b.sequence) !== null && _b !== void 0 ? _b : 0); });
972
+ const selectableRoles = sortedRoles.map(role => ({ value: role.name, label: role.full_name ? `${role.name}: ${role.full_name}` : role.name }));
971
973
  return (index$1.h(index$1.Host, { class: this.placing ? { [`placing-${this.placing}`]: true } : {}, onSubmit: () => { } }, index$1.h("div", { id: "verdocs-template-fields-toolbar" }, index$1.h("div", { class: "add-for" }, "Add field:"), index$1.h("verdocs-select-input", { value: this.selectedRoleName, options: selectableRoles, onInput: (e) => (this.selectedRoleName = e.target.value) }), menuOptions.map(option => (index$1.h("verdocs-toolbar-icon", { text: option.tooltip, icon: option.icon, class: option.class, onClick: () => {
972
974
  // We ignore empty-tooltip entries because they're separators
973
975
  if (option.tooltip) {
@@ -44,7 +44,6 @@ verdocs-template-fields .pages .document-separator {
44
44
  gap: 10px;
45
45
  padding: 12px 20px;
46
46
  width: 100%;
47
- max-width: 1028px;
48
47
  box-sizing: border-box;
49
48
  background-color: #33364b;
50
49
  color: white;
@@ -105,7 +105,7 @@ export class VerdocsTemplateFields {
105
105
  componentWillUpdate() {
106
106
  var _a, _b;
107
107
  // If a new role was added and there were none yet so far, or the "selected" role was deleted, reset our selection
108
- const roles = ((_a = this.template) === null || _a === void 0 ? void 0 : _a.roles) || [];
108
+ const roles = [...(((_a = this.template) === null || _a === void 0 ? void 0 : _a.roles) || [])].sort((a, b) => { var _a, _b; return ((_a = a.sequence) !== null && _a !== void 0 ? _a : 0) - ((_b = b.sequence) !== null && _b !== void 0 ? _b : 0); });
109
109
  if (!this.selectedRoleName || !roles.find(role => role && role.name === this.selectedRoleName)) {
110
110
  this.selectedRoleName = ((_b = roles[0]) === null || _b === void 0 ? void 0 : _b.name) || '';
111
111
  console.log('[FIELDS] Selected new role', this.selectedRoleName);
@@ -117,11 +117,12 @@ export class VerdocsTemplateFields {
117
117
  async listenToTemplate() {
118
118
  this.unlistenToTemplate();
119
119
  Store.subscribe('templates', this.templateId, () => getTemplate(this.endpoint, this.templateId), false, (template) => {
120
- var _a, _b;
120
+ var _a;
121
121
  this.template = template;
122
122
  this.loading = false;
123
123
  if (!this.selectedRoleName) {
124
- this.selectedRoleName = ((_b = (_a = template.roles) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.name) || '';
124
+ const sorted = [...(template.roles || [])].sort((a, b) => { var _a, _b; return ((_a = a.sequence) !== null && _a !== void 0 ? _a : 0) - ((_b = b.sequence) !== null && _b !== void 0 ? _b : 0); });
125
+ this.selectedRoleName = ((_a = sorted[0]) === null || _a === void 0 ? void 0 : _a.name) || '';
125
126
  }
126
127
  });
127
128
  }
@@ -320,7 +321,8 @@ export class VerdocsTemplateFields {
320
321
  if (!this.endpoint.session) {
321
322
  return (h(Host, null, h("verdocs-component-error", { message: "You must be authenticated to use this module." })));
322
323
  }
323
- const selectableRoles = (((_a = this.template) === null || _a === void 0 ? void 0 : _a.roles) || []).map(role => ({ value: role.name, label: role.full_name ? `${role.name}: ${role.full_name}` : role.name }));
324
+ const sortedRoles = [...(((_a = this.template) === null || _a === void 0 ? void 0 : _a.roles) || [])].sort((a, b) => { var _a, _b; return ((_a = a.sequence) !== null && _a !== void 0 ? _a : 0) - ((_b = b.sequence) !== null && _b !== void 0 ? _b : 0); });
325
+ const selectableRoles = sortedRoles.map(role => ({ value: role.name, label: role.full_name ? `${role.name}: ${role.full_name}` : role.name }));
324
326
  return (h(Host, { class: this.placing ? { [`placing-${this.placing}`]: true } : {}, onSubmit: () => { } }, h("div", { id: "verdocs-template-fields-toolbar" }, h("div", { class: "add-for" }, "Add field:"), h("verdocs-select-input", { value: this.selectedRoleName, options: selectableRoles, onInput: (e) => (this.selectedRoleName = e.target.value) }), menuOptions.map(option => (h("verdocs-toolbar-icon", { text: option.tooltip, icon: option.icon, class: option.class, onClick: () => {
325
327
  // We ignore empty-tooltip entries because they're separators
326
328
  if (option.tooltip) {
@@ -1 +1 @@
1
- {"version":3,"file":"verdocs-template-fields.js","sourceRoot":"","sources":["../../../../src/components/templates/verdocs-template-fields/verdocs-template-fields.tsx"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,EAAC,SAAS,EAAE,CAAC,EAAE,KAAK,EAAgB,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAC,MAAM,eAAe,CAAC;AAC5G,OAAO,EAAC,WAAW,EAAE,WAAW,EAAE,eAAe,EAAyC,WAAW,EAAE,eAAe,EAAC,MAAM,iBAAiB,CAAC;AAC/I,OAAO,EAAC,aAAa,EAAE,YAAY,EAAE,UAAU,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,kBAAkB,EAAC,MAAM,sBAAsB,CAAC;AAEvI,OAAO,EAAC,gBAAgB,EAAC,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAC,YAAY,EAAC,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAC,QAAQ,EAAC,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAC,KAAK,EAAC,MAAM,0BAA0B,CAAC;AAE/C,MAAM,WAAW,GAAG,mJAAmJ,CAAC;AAExK,MAAM,SAAS,GACb,mZAAmZ,CAAC;AAEtZ,MAAM,SAAS,GACb,0qBAA0qB,CAAC;AAE7qB,MAAM,cAAc,GAClB,ytBAAytB,CAAC;AAE5tB,MAAM,aAAa,GACjB,oXAAoX,CAAC;AAEvX,MAAM,WAAW,GACf,4KAA4K,CAAC;AAE/K,wBAAwB;AACxB,+RAA+R;AAE/R,MAAM,YAAY,GAChB,0QAA0Q,CAAC;AAE7Q,MAAM,cAAc,GAClB,oWAAoW,CAAC;AAEvW,MAAM,SAAS,GAAG,iJAAiJ,CAAC;AAEpK,MAAM,WAAW,GAAG;IAClB,EAAC,EAAE,EAAE,WAAW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AAE,IAAI,EAAE,QAAQ,EAAC;gCAC9B,EAAC,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,KAAK,EAAC;6BAChC,GACD,CACO,CACZ,CAAC;gBACJ,CAAC,CAAC,CAAC;YACL,CAAC,CAAC,CACE;YACL,IAAI,CAAC,kBAAkB,IAAI,CAC1B,yBACE,OAAO,EAAC,qBAAqB,EAC7B,OAAO,EAAE,CAAC,CAAA,MAAA,IAAI,CAAC,QAAQ,0CAAE,KAAK,KAAI,EAAE,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,4CAA4C,CAAC,CAAC,CAAC,oDAAoD,EACtJ,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,kBAAkB,GAAG,KAAK,CAAC,GAC/C,CACH,CACI,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import interact from 'interactjs';\nimport {Component, h, Event, EventEmitter, Fragment, Prop, Host, State, Listen, Watch} from '@stencil/core';\nimport {createField, getTemplate, integerSequence, ITemplate, ITemplateField, TFieldType, updateField, VerdocsEndpoint} from '@verdocs/js-sdk';\nimport {defaultHeight, defaultWidth, getFieldId, removeCssTransform, setControlStyles, updateCssTransform} from '../../../utils/utils';\nimport {IDocumentPageInfo} from '../../../utils/Types';\nimport {DocumentPageIcon} from '../../../utils/Icons';\nimport {VerdocsToast} from '../../../utils/Toast';\nimport {SDKError} from '../../../utils/errors';\nimport {Store} from '../../../utils/Datastore';\n\nconst iconTextbox = '<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" width=\"24\"><path fill=\"#ffffff\" d=\"M3.425 16.15V13h11.15v3.15Zm0-5.15V7.85h17.15V11Z\"/></svg>';\n\nconst iconCheck =\n '<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" width=\"24\"><path fill=\"#ffffff\" d=\"m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z\"/></svg>';\n\nconst iconRadio =\n '<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" width=\"24\"><path fill=\"#ffffff\" d=\"M12 17q2.075 0 3.538-1.463Q17 14.075 17 12t-1.462-3.538Q14.075 7 12 7 9.925 7 8.463 8.462 7 9.925 7 12q0 2.075 1.463 3.537Q9.925 17 12 17Zm0 5.85q-2.275 0-4.25-.85t-3.438-2.312Q2.85 18.225 2 16.25q-.85-1.975-.85-4.25T2 7.75q.85-1.975 2.312-3.438Q5.775 2.85 7.75 2q1.975-.85 4.25-.85t4.25.85q1.975.85 3.438 2.312Q21.15 5.775 22 7.75q.85 1.975.85 4.25T22 16.25q-.85 1.975-2.312 3.438Q18.225 21.15 16.25 22q-1.975.85-4.25.85Zm0-3.15q3.25 0 5.475-2.225Q19.7 15.25 19.7 12q0-3.25-2.225-5.475Q15.25 4.3 12 4.3q-3.25 0-5.475 2.225Q4.3 8.75 4.3 12q0 3.25 2.225 5.475Q8.75 19.7 12 19.7Zm0-7.7Z\"/></svg>';\n\nconst iconDatepicker =\n '<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" width=\"24\"><path fill=\"#ffffff\" d=\"M7.6 13.925q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375Zm4.4 0q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375Zm4.4 0q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375ZM5.3 22.85q-1.325 0-2.238-.912-.912-.913-.912-2.238V6.3q0-1.325.912-2.238.913-.912 2.238-.912H6v-2h2.575v2h6.85v-2H18v2h.7q1.325 0 2.238.912.912.913.912 2.238v13.4q0 1.325-.912 2.238-.913.912-2.238.912Zm0-3.15h13.4V10H5.3v9.7ZM5.3 8h13.4V6.3H5.3Zm0 0V6.3 8Z\"/></svg>';\n\nconst iconSignature =\n '<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" width=\"24\"><path fill=\"#ffffff\" d=\"m9.225 21.225 4.65-4.65h8.45v4.65Zm-5.35-2.2H5.05l8.5-8.5-1.175-1.175-8.5 8.5Zm14.25-9.95L13.8 4.8l1.325-1.325q.625-.65 1.525-.663.9-.012 1.6.663l1.225 1.175q.675.675.663 1.562-.013.888-.663 1.513ZM16.7 10.55 6 21.225H1.675V16.9L12.35 6.225Zm-3.725-.625-.6-.575 1.175 1.175Z\"/></svg>';\n\nconst iconInitial =\n '<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" width=\"24\"><path fill=\"#ffffff\" d=\"M6.225 20.775V7h-5V3.225H15V7h-5v13.775Zm9.775 0v-8h-3V9h9.775v3.775h-3v8Z\"/></svg>';\n\n// const iconTimestamp =\n// '<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>';\n\nconst iconDropdown =\n '<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>';\n\nconst iconAttachment =\n '<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>';\n\nconst 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>';\n\nconst menuOptions = [\n {id: 'signature', tooltip: 'Signature', icon: iconSignature, class: 'signature'},\n {id: 'initial', tooltip: 'Initials', icon: iconInitial, class: 'initial'},\n {id: 'sep1', tooltip: '', icon: separator, class: 'separator'},\n {id: 'textbox', tooltip: 'Text Box', icon: iconTextbox, class: 'textbox'},\n {id: 'checkbox', tooltip: 'Check Box', icon: iconCheck, class: 'checkbox'},\n {id: 'radio', tooltip: 'Radio Button', icon: iconRadio, class: 'radio'},\n {id: 'dropdown', tooltip: 'Dropdown', icon: iconDropdown, class: 'dropdown'},\n {id: 'sep2', tooltip: '', icon: separator, class: 'separator'},\n {id: 'date', tooltip: 'Date', icon: iconDatepicker, class: 'date'},\n // {id: 'timestamp', tooltip: 'Timestamp', icon: iconTimestamp, class: 'timestamp'},\n // {id: 'sep3', tooltip: '', icon: separator},\n {id: 'attachment', tooltip: 'Attachment', icon: iconAttachment, class: 'attachment'},\n // {id: 'payment', tooltip: 'Payment', icon: 'P'},\n];\n\n/**\n * Displays a builder experience for laying out fields in a template. Note that this experience requires a large display area to\n * present all of the required controls, so it is primarily intended to be used in desktop environments.\n */\n@Component({\n tag: 'verdocs-template-fields',\n styleUrl: 'verdocs-template-fields.scss',\n shadow: false,\n})\nexport class VerdocsTemplateFields {\n private templateListenerId = null;\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 ID of the template to create the document from.\n */\n @Prop({reflect: true, mutable: true}) templateId: string | null = null;\n\n /**\n * If set, (recommended), the host application should create a <DIV> element with a unique ID. When this\n * component renders, the toolbar will be removed from its default location and placed in the target element.\n * This allows the parent application to more easily control its placement and scroll effects.\n *\n * The movement of the toolbar to the target container is not dynamic - it is performed only on the initial\n * render. Host applications should not conditionally render this container. If the toolbar's visibility must\n * be externally controlled, use CSS display options to hide/show it instead.\n */\n @Prop() toolbarTargetId: string | null = null;\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 @Event({composed: true}) fieldsUpdated: EventEmitter<{endpoint: VerdocsEndpoint; templateId: string; event: 'added' | 'deleted' | 'updated'; fields: ITemplateField[]}>;\n\n @State() placing: TFieldType | null = null;\n @State() showMustSelectRole = false;\n @State() selectedRoleName = '';\n\n @State() loading = true;\n @State() template: ITemplate | null = null;\n\n pageHeights: Record<number, number> = {};\n\n @Watch('templateId')\n onTemplateIdChanged() {\n this.listenToTemplate();\n }\n\n // Stop field-placement mode if ESC is pressed\n @Listen('keydown', {target: 'document'})\n handleKeyDown(ev: KeyboardEvent) {\n if (ev.key === 'Escape') {\n this.placing = null;\n }\n }\n\n async componentWillLoad() {\n try {\n this.endpoint.loadSession();\n\n if (!this.templateId) {\n console.log(`[FIELDS] Missing required template ID ${this.templateId}`);\n return;\n }\n\n if (!this.endpoint.session) {\n console.log('[FIELDS] Unable to start builder session, must be authenticated');\n return;\n }\n\n this.listenToTemplate();\n } catch (e) {\n console.log('[FIELDS] Error with fields session', e);\n this.sdkError?.emit(new SDKError(e.message, e.response?.status, e.response?.data));\n }\n }\n\n componentDidRender() {\n interact.dynamicDrop(true);\n\n const toolbarTarget = this.toolbarTargetId ? document.getElementById(this.toolbarTargetId) : null;\n const toolbarEl = document.getElementById('verdocs-template-fields-toolbar');\n if (toolbarTarget && toolbarEl) {\n toolbarEl.remove();\n toolbarTarget.append(toolbarEl);\n }\n }\n\n componentWillUpdate() {\n // If a new role was added and there were none yet so far, or the \"selected\" role was deleted, reset our selection\n const roles = this.template?.roles || [];\n if (!this.selectedRoleName || !roles.find(role => role && role.name === this.selectedRoleName)) {\n this.selectedRoleName = roles[0]?.name || '';\n console.log('[FIELDS] Selected new role', this.selectedRoleName);\n }\n }\n\n disconnectedCallback() {\n this.unlistenToTemplate();\n }\n\n async listenToTemplate() {\n this.unlistenToTemplate();\n Store.subscribe(\n 'templates',\n this.templateId,\n () => getTemplate(this.endpoint, this.templateId),\n false,\n (template: ITemplate) => {\n this.template = template;\n this.loading = false;\n\n if (!this.selectedRoleName) {\n this.selectedRoleName = template.roles?.[0]?.name || '';\n }\n },\n );\n }\n\n unlistenToTemplate() {\n if (this.templateListenerId) {\n Store.store.delListener(this.templateListenerId);\n this.templateListenerId = null;\n }\n }\n\n attachFieldAttributes(pageInfo: IDocumentPageInfo, field: ITemplateField, el: HTMLInputElement) {\n // el.addEventListener('input', e => this.handleFieldChange(field, e));\n el.addEventListener('settingsChanged', () => {\n this.templateUpdated?.emit({endpoint: this.endpoint, template: this.template, event: 'added-field'});\n });\n el.addEventListener('deleted', () => {\n el.remove();\n this.templateUpdated?.emit({endpoint: this.endpoint, template: this.template, event: 'updated-field'});\n });\n el.setAttribute('templateid', this.templateId);\n el.setAttribute('fieldname', field.name);\n el.setAttribute('documentid', String(pageInfo.documentId));\n el.setAttribute('pageNumber', String(pageInfo.pageNumber));\n el.setAttribute('xScale', String(pageInfo.xScale));\n el.setAttribute('yScale', String(pageInfo.yScale));\n el.setAttribute('name', field.name);\n }\n\n cachedPageInfo: Record<string, Record<number, IDocumentPageInfo>> = {};\n handlePageRendered(e: any) {\n const pageInfo = e.detail as IDocumentPageInfo;\n console.log('[FIELDS] Page rendered', pageInfo.documentId, pageInfo.pageNumber, pageInfo.xScale, pageInfo.yScale);\n this.cachedPageInfo[pageInfo.documentId] ??= {};\n this.cachedPageInfo[pageInfo.documentId][pageInfo.pageNumber] = pageInfo;\n\n this.pageHeights[pageInfo.pageNumber] = pageInfo.naturalHeight;\n\n (this.template?.fields || [])\n .filter(field => field && field.page === pageInfo.pageNumber)\n .forEach(field => {\n const id = getFieldId(field);\n const el = document.getElementById(id);\n if (el) {\n el.setAttribute('fieldname', field.name);\n el.setAttribute('pagenumber', String(field.page));\n el.setAttribute('documentid', String(field.document_id));\n this.makeDraggable(el);\n }\n });\n }\n\n makeDraggable(el: HTMLElement) {\n interact(el).draggable({\n listeners: {\n move: this.handleMoveField.bind(this),\n end: this.handleMoveEnd.bind(this),\n },\n });\n }\n\n async handleMoveField(event: any) {\n const oldX = +(event.target.getAttribute('posX') || 0);\n const oldY = +(event.target.getAttribute('posY') || 0);\n const xScale = +(event.target.getAttribute('xScale') || 1);\n const yScale = +(event.target.getAttribute('yScale') || 1);\n const newX = event.dx / xScale + oldX;\n const newY = event.dy / yScale + oldY;\n event.target.setAttribute('posX', newX);\n event.target.setAttribute('posy', newY);\n updateCssTransform(event.target, 'translate', `${newX}px, ${newY}px`);\n }\n\n async handleMoveEnd(event: any) {\n const name = event.target.getAttribute('fieldname');\n const field = (this.template?.fields || []).find(field => field.name === name);\n if (!field) {\n console.log('[FIELDS] Unable to find field', name, event.target);\n return;\n }\n\n const pageNumber = event.target.getAttribute('pagenumber');\n const documentId = event.target.getAttribute('documentid');\n let {naturalWidth = 612, naturalHeight = 792, renderedHeight = 792} = this.cachedPageInfo[documentId][pageNumber];\n const clientRect = event.target.getBoundingClientRect();\n const parent = event.target.parentElement;\n const parentRect = parent.getBoundingClientRect();\n\n const width = field.width || defaultWidth(field.type);\n const height = field.height || defaultHeight(field.type);\n\n // These two being backwards is not a mistake. Left measures \"over\" from the left\n // (positive displacement) while bottom measures \"up\" from the bottom (negative displacement).\n const newX = Math.max(clientRect.left - parentRect.left, 0);\n let newY = Math.max(renderedHeight - (parentRect.bottom - clientRect.bottom), 0);\n\n let newPageNumber = parseInt(pageNumber);\n if (newY > renderedHeight) {\n newPageNumber = Math.min(newPageNumber + 1, (this.template?.documents || [])?.[0]?.pages || 1);\n newY -= renderedHeight;\n renderedHeight = this.cachedPageInfo[documentId][newPageNumber].renderedHeight;\n\n console.log('Next page', {newPageNumber, newY, renderedHeight});\n } else if (newY < 0) {\n newPageNumber = Math.max(newPageNumber - 1, 1);\n renderedHeight = this.cachedPageInfo[documentId][newPageNumber].renderedHeight;\n newY += renderedHeight;\n console.log('[FIELDS] Next page', {newPageNumber, newY, renderedHeight});\n }\n\n const {x, y} = this.viewCoordinatesToPageCoordinates(newX, newY, documentId, pageNumber, naturalWidth - width, naturalHeight - height);\n try {\n const params = {x, y, page: newPageNumber};\n const updatedField = await updateField(this.endpoint, this.templateId, name, params);\n console.log('[FIELDS] Updated', updatedField);\n\n const newTemplate = JSON.parse(JSON.stringify(this.template));\n const fieldIndex = newTemplate.fields.findIndex(field => field.name === name);\n if (fieldIndex > -1) {\n newTemplate.fields[fieldIndex] = updatedField;\n }\n\n Store.updateTemplate(this.templateId, newTemplate);\n event.target.removeAttribute('posX');\n event.target.removeAttribute('posY');\n removeCssTransform(event.target);\n const {xScale = 1, yScale = 1} = this.cachedPageInfo[documentId][pageNumber];\n setControlStyles(event.target, updatedField, xScale, yScale);\n this.templateUpdated?.emit({endpoint: this.endpoint, template: newTemplate, event: 'updated-field'});\n } catch (e) {\n VerdocsToast('Error updating field, please try again later', {style: 'error'});\n console.log('[FIELDS] Error updating field', e);\n this.sdkError?.emit(new SDKError(e.message, e.response?.status, e.response?.data));\n event.target.removeAttribute('posX');\n event.target.removeAttribute('posY');\n removeCssTransform(event.target);\n }\n }\n\n generateFieldName(type: string, pageNumber: number) {\n let i = 1;\n let fieldName: string;\n do {\n fieldName = `${type}P${pageNumber}-${i}`;\n i++;\n } while ((this.template?.fields || []).some(field => field && field.name === fieldName));\n\n return fieldName;\n }\n\n // Scale the X,Y clicks to the virtual page dimensions. Also ensure the field doesn't go off the page.\n viewCoordinatesToPageCoordinates(viewX: number, viewY: number, documentId: string, pageNumber: number, xMax: number, yMax: number) {\n const {xScale = 1, yScale = 1, renderedHeight = 792} = this.cachedPageInfo[documentId][pageNumber];\n const x = Math.floor(Math.min(viewX / xScale, xMax));\n const y = Math.floor(Math.min(Math.max(renderedHeight - viewY, 0) / yScale, yMax));\n return {x, y};\n }\n\n async handleClickPage(e: any, documentId: string, pageNumber: number) {\n if (this.placing) {\n console.log('Placing field', {documentId, pageNumber});\n const clickedX = e.offsetX;\n const clickedY = e.offsetY;\n\n const width = defaultWidth(this.placing);\n const height = defaultHeight(this.placing);\n\n const cachedPage = this.cachedPageInfo[documentId][pageNumber];\n const {naturalWidth = 612, naturalHeight = 792} = cachedPage;\n\n const coords = this.viewCoordinatesToPageCoordinates(clickedX, clickedY, documentId, pageNumber, naturalWidth - width, naturalHeight - height);\n const x = Math.floor(coords.x);\n const y = Math.floor(coords.y);\n\n const field: ITemplateField = {\n name: this.generateFieldName(this.placing, pageNumber), // 'textboxP1-22',\n role_name: this.selectedRoleName,\n template_id: this.templateId,\n document_id: cachedPage.documentId,\n type: this.placing,\n required: this.placing !== 'radio' && this.placing !== 'attachment' && this.placing !== 'checkbox',\n page: pageNumber,\n validator: null,\n label: null,\n default: null,\n placeholder: null,\n group: null,\n settings: {},\n x,\n y,\n width,\n height,\n multiline: false,\n readonly: false,\n options: this.placing === 'radio' ? [{id: 'option-1', label: 'Option 1'}] : [],\n };\n console.log('[FIELDS] Will save new field', field);\n\n const newField = await createField(this.endpoint, this.templateId, field);\n console.log('[FIELDS] Saved field', newField);\n\n const newTemplate = JSON.parse(JSON.stringify(this.template));\n newTemplate.fields.push(newField);\n Store.updateTemplate(this.templateId, newTemplate);\n this.templateUpdated?.emit({endpoint: this.endpoint, template: newTemplate, event: 'added-field'});\n\n this.placing = null;\n }\n }\n\n render() {\n if (this.loading) {\n return (\n <Host>\n <verdocs-loader />\n </Host>\n );\n }\n\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 const selectableRoles = (this.template?.roles || []).map(role => ({value: role.name, label: role.full_name ? `${role.name}: ${role.full_name}` : role.name}));\n\n return (\n <Host class={this.placing ? {[`placing-${this.placing}`]: true} : {}} onSubmit={() => {}}>\n <div id=\"verdocs-template-fields-toolbar\">\n <div class=\"add-for\">Add field:</div>\n <verdocs-select-input value={this.selectedRoleName} options={selectableRoles} onInput={(e: any) => (this.selectedRoleName = e.target.value)} />\n\n {menuOptions.map(option => (\n <verdocs-toolbar-icon\n text={option.tooltip}\n icon={option.icon}\n class={option.class}\n onClick={() => {\n // We ignore empty-tooltip entries because they're separators\n if (option.tooltip) {\n // We require a role to be selected first\n if (this.selectedRoleName) {\n this.placing = option.id as TFieldType;\n } else {\n this.showMustSelectRole = true;\n }\n }\n }}\n />\n ))}\n </div>\n\n {/* <div class=\"page-0\" ref={el => (this.page0El = el as HTMLDivElement)}>*/}\n {/* <div class=\"user-placed-fields\">*/}\n {/* <div class=\"title\">User-Placed Fields</div>*/}\n {/* <verdocs-field-signature*/}\n {/* field={testField}*/}\n {/* style={{width: '82px', height: '41px', left: '20px', top: '40px', transform: 'scale(1,1)', backgroundColor: getRGBA(0)}}*/}\n {/* moveable={true}*/}\n {/* editable={true}*/}\n {/* />*/}\n {/* </div>*/}\n {/*</div>*/}\n\n <div class=\"pages\">\n {(this.template?.documents || []).map(document => {\n const pageNumbers = integerSequence(1, document.pages);\n\n return pageNumbers.map(page => {\n const pageSize = document.page_sizes[page];\n\n return (\n <Fragment>\n {this.template?.documents.length > 1 && (\n <div class=\"document-separator\">\n <div innerHTML={DocumentPageIcon} />\n <span>{document.name}</span>\n </div>\n )}\n\n <verdocs-template-document-page\n templateId={this.templateId}\n documentId={document.id}\n pageNumber={page}\n virtualWidth={pageSize?.width || 612}\n virtualHeight={pageSize?.height || 792}\n disabled={true}\n editable={true}\n done={false}\n onClick={(e: PointerEvent) => this.handleClickPage(e, document.id, page)}\n onPageRendered={e => this.handlePageRendered(e)}\n layers={[\n {name: 'page', type: 'canvas'},\n {name: 'controls', type: 'div'},\n ]}\n />\n </Fragment>\n );\n });\n })}\n </div>\n {this.showMustSelectRole && (\n <verdocs-ok-dialog\n heading=\"Unable to add field\"\n message={(this.template?.roles || []).length > 0 ? 'Please select a role before adding fields.' : 'Please add at least one role before adding fields.'}\n onNext={() => (this.showMustSelectRole = false)}\n />\n )}\n </Host>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"verdocs-template-fields.js","sourceRoot":"","sources":["../../../../src/components/templates/verdocs-template-fields/verdocs-template-fields.tsx"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,EAAC,SAAS,EAAE,CAAC,EAAE,KAAK,EAAgB,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAC,MAAM,eAAe,CAAC;AAC5G,OAAO,EAAC,WAAW,EAAE,WAAW,EAAE,eAAe,EAAyC,WAAW,EAAE,eAAe,EAAC,MAAM,iBAAiB,CAAC;AAC/I,OAAO,EAAC,aAAa,EAAE,YAAY,EAAE,UAAU,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,kBAAkB,EAAC,MAAM,sBAAsB,CAAC;A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EAAE,EAAE,IAAI,CAAC,EACxE,cAAc,EAAE,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC,CAAC,EAC/C,MAAM,EAAE;gCACN,EAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAC;gCAC9B,EAAC,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,KAAK,EAAC;6BAChC,GACD,CACO,CACZ,CAAC;gBACJ,CAAC,CAAC,CAAC;YACL,CAAC,CAAC,CACE;YACL,IAAI,CAAC,kBAAkB,IAAI,CAC1B,yBACE,OAAO,EAAC,qBAAqB,EAC7B,OAAO,EAAE,CAAC,CAAA,MAAA,IAAI,CAAC,QAAQ,0CAAE,KAAK,KAAI,EAAE,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,4CAA4C,CAAC,CAAC,CAAC,oDAAoD,EACtJ,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,kBAAkB,GAAG,KAAK,CAAC,GAC/C,CACH,CACI,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import interact from 'interactjs';\nimport {Component, h, Event, EventEmitter, Fragment, Prop, Host, State, Listen, Watch} from '@stencil/core';\nimport {createField, getTemplate, integerSequence, ITemplate, ITemplateField, TFieldType, updateField, VerdocsEndpoint} from '@verdocs/js-sdk';\nimport {defaultHeight, defaultWidth, getFieldId, removeCssTransform, setControlStyles, updateCssTransform} from '../../../utils/utils';\nimport {IDocumentPageInfo} from '../../../utils/Types';\nimport {DocumentPageIcon} from '../../../utils/Icons';\nimport {VerdocsToast} from '../../../utils/Toast';\nimport {SDKError} from '../../../utils/errors';\nimport {Store} from '../../../utils/Datastore';\n\nconst iconTextbox = '<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" width=\"24\"><path fill=\"#ffffff\" d=\"M3.425 16.15V13h11.15v3.15Zm0-5.15V7.85h17.15V11Z\"/></svg>';\n\nconst iconCheck =\n '<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" width=\"24\"><path fill=\"#ffffff\" d=\"m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z\"/></svg>';\n\nconst iconRadio =\n '<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" width=\"24\"><path fill=\"#ffffff\" d=\"M12 17q2.075 0 3.538-1.463Q17 14.075 17 12t-1.462-3.538Q14.075 7 12 7 9.925 7 8.463 8.462 7 9.925 7 12q0 2.075 1.463 3.537Q9.925 17 12 17Zm0 5.85q-2.275 0-4.25-.85t-3.438-2.312Q2.85 18.225 2 16.25q-.85-1.975-.85-4.25T2 7.75q.85-1.975 2.312-3.438Q5.775 2.85 7.75 2q1.975-.85 4.25-.85t4.25.85q1.975.85 3.438 2.312Q21.15 5.775 22 7.75q.85 1.975.85 4.25T22 16.25q-.85 1.975-2.312 3.438Q18.225 21.15 16.25 22q-1.975.85-4.25.85Zm0-3.15q3.25 0 5.475-2.225Q19.7 15.25 19.7 12q0-3.25-2.225-5.475Q15.25 4.3 12 4.3q-3.25 0-5.475 2.225Q4.3 8.75 4.3 12q0 3.25 2.225 5.475Q8.75 19.7 12 19.7Zm0-7.7Z\"/></svg>';\n\nconst iconDatepicker =\n '<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" width=\"24\"><path fill=\"#ffffff\" d=\"M7.6 13.925q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375Zm4.4 0q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375Zm4.4 0q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375ZM5.3 22.85q-1.325 0-2.238-.912-.912-.913-.912-2.238V6.3q0-1.325.912-2.238.913-.912 2.238-.912H6v-2h2.575v2h6.85v-2H18v2h.7q1.325 0 2.238.912.912.913.912 2.238v13.4q0 1.325-.912 2.238-.913.912-2.238.912Zm0-3.15h13.4V10H5.3v9.7ZM5.3 8h13.4V6.3H5.3Zm0 0V6.3 8Z\"/></svg>';\n\nconst iconSignature =\n '<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" width=\"24\"><path fill=\"#ffffff\" d=\"m9.225 21.225 4.65-4.65h8.45v4.65Zm-5.35-2.2H5.05l8.5-8.5-1.175-1.175-8.5 8.5Zm14.25-9.95L13.8 4.8l1.325-1.325q.625-.65 1.525-.663.9-.012 1.6.663l1.225 1.175q.675.675.663 1.562-.013.888-.663 1.513ZM16.7 10.55 6 21.225H1.675V16.9L12.35 6.225Zm-3.725-.625-.6-.575 1.175 1.175Z\"/></svg>';\n\nconst iconInitial =\n '<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" width=\"24\"><path fill=\"#ffffff\" d=\"M6.225 20.775V7h-5V3.225H15V7h-5v13.775Zm9.775 0v-8h-3V9h9.775v3.775h-3v8Z\"/></svg>';\n\n// const iconTimestamp =\n// '<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>';\n\nconst iconDropdown =\n '<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>';\n\nconst iconAttachment =\n '<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>';\n\nconst 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>';\n\nconst menuOptions = [\n {id: 'signature', tooltip: 'Signature', icon: iconSignature, class: 'signature'},\n {id: 'initial', tooltip: 'Initials', icon: iconInitial, class: 'initial'},\n {id: 'sep1', tooltip: '', icon: separator, class: 'separator'},\n {id: 'textbox', tooltip: 'Text Box', icon: iconTextbox, class: 'textbox'},\n {id: 'checkbox', tooltip: 'Check Box', icon: iconCheck, class: 'checkbox'},\n {id: 'radio', tooltip: 'Radio Button', icon: iconRadio, class: 'radio'},\n {id: 'dropdown', tooltip: 'Dropdown', icon: iconDropdown, class: 'dropdown'},\n {id: 'sep2', tooltip: '', icon: separator, class: 'separator'},\n {id: 'date', tooltip: 'Date', icon: iconDatepicker, class: 'date'},\n // {id: 'timestamp', tooltip: 'Timestamp', icon: iconTimestamp, class: 'timestamp'},\n // {id: 'sep3', tooltip: '', icon: separator},\n {id: 'attachment', tooltip: 'Attachment', icon: iconAttachment, class: 'attachment'},\n // {id: 'payment', tooltip: 'Payment', icon: 'P'},\n];\n\n/**\n * Displays a builder experience for laying out fields in a template. Note that this experience requires a large display area to\n * present all of the required controls, so it is primarily intended to be used in desktop environments.\n */\n@Component({\n tag: 'verdocs-template-fields',\n styleUrl: 'verdocs-template-fields.scss',\n shadow: false,\n})\nexport class VerdocsTemplateFields {\n private templateListenerId = null;\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 ID of the template to create the document from.\n */\n @Prop({reflect: true, mutable: true}) templateId: string | null = null;\n\n /**\n * If set, (recommended), the host application should create a <DIV> element with a unique ID. When this\n * component renders, the toolbar will be removed from its default location and placed in the target element.\n * This allows the parent application to more easily control its placement and scroll effects.\n *\n * The movement of the toolbar to the target container is not dynamic - it is performed only on the initial\n * render. Host applications should not conditionally render this container. If the toolbar's visibility must\n * be externally controlled, use CSS display options to hide/show it instead.\n */\n @Prop() toolbarTargetId: string | null = null;\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 @Event({composed: true}) fieldsUpdated: EventEmitter<{endpoint: VerdocsEndpoint; templateId: string; event: 'added' | 'deleted' | 'updated'; fields: ITemplateField[]}>;\n\n @State() placing: TFieldType | null = null;\n @State() showMustSelectRole = false;\n @State() selectedRoleName = '';\n\n @State() loading = true;\n @State() template: ITemplate | null = null;\n\n pageHeights: Record<number, number> = {};\n\n @Watch('templateId')\n onTemplateIdChanged() {\n this.listenToTemplate();\n }\n\n // Stop field-placement mode if ESC is pressed\n @Listen('keydown', {target: 'document'})\n handleKeyDown(ev: KeyboardEvent) {\n if (ev.key === 'Escape') {\n this.placing = null;\n }\n }\n\n async componentWillLoad() {\n try {\n this.endpoint.loadSession();\n\n if (!this.templateId) {\n console.log(`[FIELDS] Missing required template ID ${this.templateId}`);\n return;\n }\n\n if (!this.endpoint.session) {\n console.log('[FIELDS] Unable to start builder session, must be authenticated');\n return;\n }\n\n this.listenToTemplate();\n } catch (e) {\n console.log('[FIELDS] Error with fields session', e);\n this.sdkError?.emit(new SDKError(e.message, e.response?.status, e.response?.data));\n }\n }\n\n componentDidRender() {\n interact.dynamicDrop(true);\n\n const toolbarTarget = this.toolbarTargetId ? document.getElementById(this.toolbarTargetId) : null;\n const toolbarEl = document.getElementById('verdocs-template-fields-toolbar');\n if (toolbarTarget && toolbarEl) {\n toolbarEl.remove();\n toolbarTarget.append(toolbarEl);\n }\n }\n\n componentWillUpdate() {\n // If a new role was added and there were none yet so far, or the \"selected\" role was deleted, reset our selection\n const roles = [...(this.template?.roles || [])].sort((a, b) => (a.sequence ?? 0) - (b.sequence ?? 0));\n if (!this.selectedRoleName || !roles.find(role => role && role.name === this.selectedRoleName)) {\n this.selectedRoleName = roles[0]?.name || '';\n console.log('[FIELDS] Selected new role', this.selectedRoleName);\n }\n }\n\n disconnectedCallback() {\n this.unlistenToTemplate();\n }\n\n async listenToTemplate() {\n this.unlistenToTemplate();\n Store.subscribe(\n 'templates',\n this.templateId,\n () => getTemplate(this.endpoint, this.templateId),\n false,\n (template: ITemplate) => {\n this.template = template;\n this.loading = false;\n\n if (!this.selectedRoleName) {\n const sorted = [...(template.roles || [])].sort((a, b) => (a.sequence ?? 0) - (b.sequence ?? 0));\n this.selectedRoleName = sorted[0]?.name || '';\n }\n },\n );\n }\n\n unlistenToTemplate() {\n if (this.templateListenerId) {\n Store.store.delListener(this.templateListenerId);\n this.templateListenerId = null;\n }\n }\n\n attachFieldAttributes(pageInfo: IDocumentPageInfo, field: ITemplateField, el: HTMLInputElement) {\n // el.addEventListener('input', e => this.handleFieldChange(field, e));\n el.addEventListener('settingsChanged', () => {\n this.templateUpdated?.emit({endpoint: this.endpoint, template: this.template, event: 'added-field'});\n });\n el.addEventListener('deleted', () => {\n el.remove();\n this.templateUpdated?.emit({endpoint: this.endpoint, template: this.template, event: 'updated-field'});\n });\n el.setAttribute('templateid', this.templateId);\n el.setAttribute('fieldname', field.name);\n el.setAttribute('documentid', String(pageInfo.documentId));\n el.setAttribute('pageNumber', String(pageInfo.pageNumber));\n el.setAttribute('xScale', String(pageInfo.xScale));\n el.setAttribute('yScale', String(pageInfo.yScale));\n el.setAttribute('name', field.name);\n }\n\n cachedPageInfo: Record<string, Record<number, IDocumentPageInfo>> = {};\n handlePageRendered(e: any) {\n const pageInfo = e.detail as IDocumentPageInfo;\n console.log('[FIELDS] Page rendered', pageInfo.documentId, pageInfo.pageNumber, pageInfo.xScale, pageInfo.yScale);\n this.cachedPageInfo[pageInfo.documentId] ??= {};\n this.cachedPageInfo[pageInfo.documentId][pageInfo.pageNumber] = pageInfo;\n\n this.pageHeights[pageInfo.pageNumber] = pageInfo.naturalHeight;\n\n (this.template?.fields || [])\n .filter(field => field && field.page === pageInfo.pageNumber)\n .forEach(field => {\n const id = getFieldId(field);\n const el = document.getElementById(id);\n if (el) {\n el.setAttribute('fieldname', field.name);\n el.setAttribute('pagenumber', String(field.page));\n el.setAttribute('documentid', String(field.document_id));\n this.makeDraggable(el);\n }\n });\n }\n\n makeDraggable(el: HTMLElement) {\n interact(el).draggable({\n listeners: {\n move: this.handleMoveField.bind(this),\n end: this.handleMoveEnd.bind(this),\n },\n });\n }\n\n async handleMoveField(event: any) {\n const oldX = +(event.target.getAttribute('posX') || 0);\n const oldY = +(event.target.getAttribute('posY') || 0);\n const xScale = +(event.target.getAttribute('xScale') || 1);\n const yScale = +(event.target.getAttribute('yScale') || 1);\n const newX = event.dx / xScale + oldX;\n const newY = event.dy / yScale + oldY;\n event.target.setAttribute('posX', newX);\n event.target.setAttribute('posy', newY);\n updateCssTransform(event.target, 'translate', `${newX}px, ${newY}px`);\n }\n\n async handleMoveEnd(event: any) {\n const name = event.target.getAttribute('fieldname');\n const field = (this.template?.fields || []).find(field => field.name === name);\n if (!field) {\n console.log('[FIELDS] Unable to find field', name, event.target);\n return;\n }\n\n const pageNumber = event.target.getAttribute('pagenumber');\n const documentId = event.target.getAttribute('documentid');\n let {naturalWidth = 612, naturalHeight = 792, renderedHeight = 792} = this.cachedPageInfo[documentId][pageNumber];\n const clientRect = event.target.getBoundingClientRect();\n const parent = event.target.parentElement;\n const parentRect = parent.getBoundingClientRect();\n\n const width = field.width || defaultWidth(field.type);\n const height = field.height || defaultHeight(field.type);\n\n // These two being backwards is not a mistake. Left measures \"over\" from the left\n // (positive displacement) while bottom measures \"up\" from the bottom (negative displacement).\n const newX = Math.max(clientRect.left - parentRect.left, 0);\n let newY = Math.max(renderedHeight - (parentRect.bottom - clientRect.bottom), 0);\n\n let newPageNumber = parseInt(pageNumber);\n if (newY > renderedHeight) {\n newPageNumber = Math.min(newPageNumber + 1, (this.template?.documents || [])?.[0]?.pages || 1);\n newY -= renderedHeight;\n renderedHeight = this.cachedPageInfo[documentId][newPageNumber].renderedHeight;\n\n console.log('Next page', {newPageNumber, newY, renderedHeight});\n } else if (newY < 0) {\n newPageNumber = Math.max(newPageNumber - 1, 1);\n renderedHeight = this.cachedPageInfo[documentId][newPageNumber].renderedHeight;\n newY += renderedHeight;\n console.log('[FIELDS] Next page', {newPageNumber, newY, renderedHeight});\n }\n\n const {x, y} = this.viewCoordinatesToPageCoordinates(newX, newY, documentId, pageNumber, naturalWidth - width, naturalHeight - height);\n try {\n const params = {x, y, page: newPageNumber};\n const updatedField = await updateField(this.endpoint, this.templateId, name, params);\n console.log('[FIELDS] Updated', updatedField);\n\n const newTemplate = JSON.parse(JSON.stringify(this.template));\n const fieldIndex = newTemplate.fields.findIndex(field => field.name === name);\n if (fieldIndex > -1) {\n newTemplate.fields[fieldIndex] = updatedField;\n }\n\n Store.updateTemplate(this.templateId, newTemplate);\n event.target.removeAttribute('posX');\n event.target.removeAttribute('posY');\n removeCssTransform(event.target);\n const {xScale = 1, yScale = 1} = this.cachedPageInfo[documentId][pageNumber];\n setControlStyles(event.target, updatedField, xScale, yScale);\n this.templateUpdated?.emit({endpoint: this.endpoint, template: newTemplate, event: 'updated-field'});\n } catch (e) {\n VerdocsToast('Error updating field, please try again later', {style: 'error'});\n console.log('[FIELDS] Error updating field', e);\n this.sdkError?.emit(new SDKError(e.message, e.response?.status, e.response?.data));\n event.target.removeAttribute('posX');\n event.target.removeAttribute('posY');\n removeCssTransform(event.target);\n }\n }\n\n generateFieldName(type: string, pageNumber: number) {\n let i = 1;\n let fieldName: string;\n do {\n fieldName = `${type}P${pageNumber}-${i}`;\n i++;\n } while ((this.template?.fields || []).some(field => field && field.name === fieldName));\n\n return fieldName;\n }\n\n // Scale the X,Y clicks to the virtual page dimensions. Also ensure the field doesn't go off the page.\n viewCoordinatesToPageCoordinates(viewX: number, viewY: number, documentId: string, pageNumber: number, xMax: number, yMax: number) {\n const {xScale = 1, yScale = 1, renderedHeight = 792} = this.cachedPageInfo[documentId][pageNumber];\n const x = Math.floor(Math.min(viewX / xScale, xMax));\n const y = Math.floor(Math.min(Math.max(renderedHeight - viewY, 0) / yScale, yMax));\n return {x, y};\n }\n\n async handleClickPage(e: any, documentId: string, pageNumber: number) {\n if (this.placing) {\n console.log('Placing field', {documentId, pageNumber});\n const clickedX = e.offsetX;\n const clickedY = e.offsetY;\n\n const width = defaultWidth(this.placing);\n const height = defaultHeight(this.placing);\n\n const cachedPage = this.cachedPageInfo[documentId][pageNumber];\n const {naturalWidth = 612, naturalHeight = 792} = cachedPage;\n\n const coords = this.viewCoordinatesToPageCoordinates(clickedX, clickedY, documentId, pageNumber, naturalWidth - width, naturalHeight - height);\n const x = Math.floor(coords.x);\n const y = Math.floor(coords.y);\n\n const field: ITemplateField = {\n name: this.generateFieldName(this.placing, pageNumber), // 'textboxP1-22',\n role_name: this.selectedRoleName,\n template_id: this.templateId,\n document_id: cachedPage.documentId,\n type: this.placing,\n required: this.placing !== 'radio' && this.placing !== 'attachment' && this.placing !== 'checkbox',\n page: pageNumber,\n validator: null,\n label: null,\n default: null,\n placeholder: null,\n group: null,\n settings: {},\n x,\n y,\n width,\n height,\n multiline: false,\n readonly: false,\n options: this.placing === 'radio' ? [{id: 'option-1', label: 'Option 1'}] : [],\n };\n console.log('[FIELDS] Will save new field', field);\n\n const newField = await createField(this.endpoint, this.templateId, field);\n console.log('[FIELDS] Saved field', newField);\n\n const newTemplate = JSON.parse(JSON.stringify(this.template));\n newTemplate.fields.push(newField);\n Store.updateTemplate(this.templateId, newTemplate);\n this.templateUpdated?.emit({endpoint: this.endpoint, template: newTemplate, event: 'added-field'});\n\n this.placing = null;\n }\n }\n\n render() {\n if (this.loading) {\n return (\n <Host>\n <verdocs-loader />\n </Host>\n );\n }\n\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 const sortedRoles = [...(this.template?.roles || [])].sort((a, b) => (a.sequence ?? 0) - (b.sequence ?? 0));\n const selectableRoles = sortedRoles.map(role => ({value: role.name, label: role.full_name ? `${role.name}: ${role.full_name}` : role.name}));\n\n return (\n <Host class={this.placing ? {[`placing-${this.placing}`]: true} : {}} onSubmit={() => {}}>\n <div id=\"verdocs-template-fields-toolbar\">\n <div class=\"add-for\">Add field:</div>\n <verdocs-select-input value={this.selectedRoleName} options={selectableRoles} onInput={(e: any) => (this.selectedRoleName = e.target.value)} />\n\n {menuOptions.map(option => (\n <verdocs-toolbar-icon\n text={option.tooltip}\n icon={option.icon}\n class={option.class}\n onClick={() => {\n // We ignore empty-tooltip entries because they're separators\n if (option.tooltip) {\n // We require a role to be selected first\n if (this.selectedRoleName) {\n this.placing = option.id as TFieldType;\n } else {\n this.showMustSelectRole = true;\n }\n }\n }}\n />\n ))}\n </div>\n\n {/* <div class=\"page-0\" ref={el => (this.page0El = el as HTMLDivElement)}>*/}\n {/* <div class=\"user-placed-fields\">*/}\n {/* <div class=\"title\">User-Placed Fields</div>*/}\n {/* <verdocs-field-signature*/}\n {/* field={testField}*/}\n {/* style={{width: '82px', height: '41px', left: '20px', top: '40px', transform: 'scale(1,1)', backgroundColor: getRGBA(0)}}*/}\n {/* moveable={true}*/}\n {/* editable={true}*/}\n {/* />*/}\n {/* </div>*/}\n {/*</div>*/}\n\n <div class=\"pages\">\n {(this.template?.documents || []).map(document => {\n const pageNumbers = integerSequence(1, document.pages);\n\n return pageNumbers.map(page => {\n const pageSize = document.page_sizes[page];\n\n return (\n <Fragment>\n {this.template?.documents.length > 1 && (\n <div class=\"document-separator\">\n <div innerHTML={DocumentPageIcon} />\n <span>{document.name}</span>\n </div>\n )}\n\n <verdocs-template-document-page\n templateId={this.templateId}\n documentId={document.id}\n pageNumber={page}\n virtualWidth={pageSize?.width || 612}\n virtualHeight={pageSize?.height || 792}\n disabled={true}\n editable={true}\n done={false}\n onClick={(e: PointerEvent) => this.handleClickPage(e, document.id, page)}\n onPageRendered={e => this.handlePageRendered(e)}\n layers={[\n {name: 'page', type: 'canvas'},\n {name: 'controls', type: 'div'},\n ]}\n />\n </Fragment>\n );\n });\n })}\n </div>\n {this.showMustSelectRole && (\n <verdocs-ok-dialog\n heading=\"Unable to add field\"\n message={(this.template?.roles || []).length > 0 ? 'Please select a role before adding fields.' : 'Please add at least one role before adding fields.'}\n onNext={() => (this.showMustSelectRole = false)}\n />\n )}\n </Host>\n );\n }\n}\n"]}
@@ -32,7 +32,7 @@ import { d as defineCustomElement$3 } from './p-764zY_TM.js';
32
32
  import { d as defineCustomElement$2 } from './p-Cif8CeGC.js';
33
33
  import { d as defineCustomElement$1 } from './p-DHJY1Udu.js';
34
34
 
35
- const verdocsTemplateFieldsCss = "verdocs-template-fields{font-family:var(--verdocs-primary-font, \"Inter\", \"Barlow\", sans-serif);position:relative;display:block;min-height:600px}verdocs-template-fields .page-0{padding:65px 15px 0 15px;-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-template-fields .page-0 .user-placed-fields{height:100px;position:relative;background:#ffffff;-webkit-box-shadow:0 0 10px 5px rgba(0, 0, 0, 0.0588235294);box-shadow:0 0 10px 5px rgba(0, 0, 0, 0.0588235294)}verdocs-template-fields .page-0 .user-placed-fields .title{top:0;left:0;color:#ffffff;font-size:12px;padding:3px 6px;font-weight:bold;position:absolute;background:#46497d}verdocs-template-fields .pages{display:-ms-flexbox;display:flex;padding:15px;row-gap:15px;min-height:200px;position:relative;-ms-flex-align:center;align-items:center;-webkit-box-sizing:border-box;box-sizing:border-box;-ms-flex-direction:column;flex-direction:column}verdocs-template-fields .pages div,verdocs-template-fields .pages canvas{-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-template-fields .pages .document-separator{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:10px;padding:12px 20px;width:100%;max-width:1028px;-webkit-box-sizing:border-box;box-sizing:border-box;background-color:#33364b;color:white;border-radius:6px;font-size:16px;font-weight:500;margin-top:20px;-webkit-box-shadow:0 2px 4px rgba(0, 0, 0, 0.1);box-shadow:0 2px 4px rgba(0, 0, 0, 0.1)}verdocs-template-fields .pages .document-separator svg{-ms-flex-negative:0;flex-shrink:0}verdocs-template-fields .pages .document-separator:first-child{margin-top:0}verdocs-template-fields #verdocs-template-fields-toolbar{width:100%;height:50px;display:-ms-flexbox;display:flex;-webkit-column-gap:15px;-moz-column-gap:15px;column-gap:15px;font-weight:700;padding:0 20px 0 0;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;color:#f5f5fa;-ms-flex-pack:center;justify-content:center;background:#46497d}verdocs-template-fields #verdocs-template-fields-toolbar>verdocs-select-input{margin:0}verdocs-template-fields #verdocs-template-fields-toolbar svg{width:24px;height:24px}verdocs-template-fields #verdocs-template-fields-toolbar .add-for{margin:0;font-weight:500;color:#f5f5fa}verdocs-template-fields #verdocs-template-fields-toolbar verdocs-select-input{margin:0 20px 0 0}@media all and (max-width: 1000px){verdocs-template-fields #verdocs-template-fields-toolbar{-webkit-column-gap:8px;-moz-column-gap:8px;column-gap:8px;padding:0 10px 0 0}verdocs-template-fields #verdocs-template-fields-toolbar svg{-webkit-transform:scale(0.8);transform:scale(0.8)}verdocs-template-fields #verdocs-template-fields-toolbar .add-for,verdocs-template-fields #verdocs-template-fields-toolbar verdocs-select-input{display:none}}@media all and (max-width: 600px){verdocs-template-fields #verdocs-template-fields-toolbar{-webkit-column-gap:6px;-moz-column-gap:6px;column-gap:6px}verdocs-template-fields #verdocs-template-fields-toolbar svg{-webkit-transform:scale(0.6);transform:scale(0.6)}verdocs-template-fields #verdocs-template-fields-toolbar .separator,verdocs-template-fields #verdocs-template-fields-toolbar .add-for,verdocs-template-fields #verdocs-template-fields-toolbar verdocs-select-input{display:none}}verdocs-template-fields.placing-attachment{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-checkbox{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-date{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath fill='%23000000' d='M7.6 13.925q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375Zm4.4 0q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375Zm4.4 0q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375ZM5.3 22.85q-1.325 0-2.238-.912-.912-.913-.912-2.238V6.3q0-1.325.912-2.238.913-.912 2.238-.912H6v-2h2.575v2h6.85v-2H18v2h.7q1.325 0 2.238.912.912.913.912 2.238v13.4q0 1.325-.912 2.238-.913.912-2.238.912Zm0-3.15h13.4V10H5.3v9.7ZM5.3 8h13.4V6.3H5.3Zm0 0V6.3 8Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-dropdown{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24' stroke-width='1.5' stroke='currentColor'%3E%3Cpath stroke='%23000000' 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' /%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-initial{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='M6.225 20.775V7h-5V3.225H15V7h-5v13.775Zm9.775 0v-8h-3V9h9.775v3.775h-3v8Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-payment{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-radio{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='M12 17q2.075 0 3.538-1.463Q17 14.075 17 12t-1.462-3.538Q14.075 7 12 7 9.925 7 8.463 8.462 7 9.925 7 12q0 2.075 1.463 3.537Q9.925 17 12 17Zm0 5.85q-2.275 0-4.25-.85t-3.438-2.312Q2.85 18.225 2 16.25q-.85-1.975-.85-4.25T2 7.75q.85-1.975 2.312-3.438Q5.775 2.85 7.75 2q1.975-.85 4.25-.85t4.25.85q1.975.85 3.438 2.312Q21.15 5.775 22 7.75q.85 1.975.85 4.25T22 16.25q-.85 1.975-2.312 3.438Q18.225 21.15 16.25 22q-1.975.85-4.25.85Zm0-3.15q3.25 0 5.475-2.225Q19.7 15.25 19.7 12q0-3.25-2.225-5.475Q15.25 4.3 12 4.3q-3.25 0-5.475 2.225Q4.3 8.75 4.3 12q0 3.25 2.225 5.475Q8.75 19.7 12 19.7Zm0-7.7Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-signature{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='m9.225 21.225 4.65-4.65h8.45v4.65Zm-5.35-2.2H5.05l8.5-8.5-1.175-1.175-8.5 8.5Zm14.25-9.95L13.8 4.8l1.325-1.325q.625-.65 1.525-.663.9-.012 1.6.663l1.225 1.175q.675.675.663 1.562-.013.888-.663 1.513ZM16.7 10.55 6 21.225H1.675V16.9L12.35 6.225Zm-3.725-.625-.6-.575 1.175 1.175Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-textarea{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='M3.225 20.725v-3.15h11.55v3.15Zm0-4.775V12.8h17.55v3.15Zm0-4.75V8.05h17.55v3.15Zm0-4.775v-3.15h17.55v3.15Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-textbox{cursor:url(\"data:image/svg+xml,%3Csvg width='32' height='15' viewBox='0 0 32 15' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cmask id='path-1-inside-1_1401_24' fill='white'%3E%3Cpath d='M0 0H32V15H0V0Z'/%3E%3C/mask%3E%3Cpath d='M0 0H32V15H0V0Z' fill='%234C56CB' fill-opacity='0.1'/%3E%3Cpath d='M0 0V-1H-1V0H0ZM0 15H-1V16H0V15ZM0 1H32V-1H0V1ZM32 14H0V16H32V14ZM1 15V0H-1V15H1Z' fill='%234C56CB' mask='url(%23path-1-inside-1_1401_24)'/%3E%3Cpath d='M3 11.8V8.65H14.15V11.8H3ZM3 6.65V3.5H20.15V6.65H3Z' fill='%234C56CB'/%3E%3Cline x1='31.5' y1='1' x2='31.5' y2='14' stroke='%234C56CB' stroke-opacity='0.32' stroke-dasharray='1 1'/%3E%3C/svg%3E%0A\") 0 14, pointer}verdocs-template-fields.placing-timestamp{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath fill='%23000000' 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'%3E%3C/path%3E%3C/svg%3E\") 16 16, pointer}";
35
+ const verdocsTemplateFieldsCss = "verdocs-template-fields{font-family:var(--verdocs-primary-font, \"Inter\", \"Barlow\", sans-serif);position:relative;display:block;min-height:600px}verdocs-template-fields .page-0{padding:65px 15px 0 15px;-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-template-fields .page-0 .user-placed-fields{height:100px;position:relative;background:#ffffff;-webkit-box-shadow:0 0 10px 5px rgba(0, 0, 0, 0.0588235294);box-shadow:0 0 10px 5px rgba(0, 0, 0, 0.0588235294)}verdocs-template-fields .page-0 .user-placed-fields .title{top:0;left:0;color:#ffffff;font-size:12px;padding:3px 6px;font-weight:bold;position:absolute;background:#46497d}verdocs-template-fields .pages{display:-ms-flexbox;display:flex;padding:15px;row-gap:15px;min-height:200px;position:relative;-ms-flex-align:center;align-items:center;-webkit-box-sizing:border-box;box-sizing:border-box;-ms-flex-direction:column;flex-direction:column}verdocs-template-fields .pages div,verdocs-template-fields .pages canvas{-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-template-fields .pages .document-separator{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:10px;padding:12px 20px;width:100%;-webkit-box-sizing:border-box;box-sizing:border-box;background-color:#33364b;color:white;border-radius:6px;font-size:16px;font-weight:500;margin-top:20px;-webkit-box-shadow:0 2px 4px rgba(0, 0, 0, 0.1);box-shadow:0 2px 4px rgba(0, 0, 0, 0.1)}verdocs-template-fields .pages .document-separator svg{-ms-flex-negative:0;flex-shrink:0}verdocs-template-fields .pages .document-separator:first-child{margin-top:0}verdocs-template-fields #verdocs-template-fields-toolbar{width:100%;height:50px;display:-ms-flexbox;display:flex;-webkit-column-gap:15px;-moz-column-gap:15px;column-gap:15px;font-weight:700;padding:0 20px 0 0;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;color:#f5f5fa;-ms-flex-pack:center;justify-content:center;background:#46497d}verdocs-template-fields #verdocs-template-fields-toolbar>verdocs-select-input{margin:0}verdocs-template-fields #verdocs-template-fields-toolbar svg{width:24px;height:24px}verdocs-template-fields #verdocs-template-fields-toolbar .add-for{margin:0;font-weight:500;color:#f5f5fa}verdocs-template-fields #verdocs-template-fields-toolbar verdocs-select-input{margin:0 20px 0 0}@media all and (max-width: 1000px){verdocs-template-fields #verdocs-template-fields-toolbar{-webkit-column-gap:8px;-moz-column-gap:8px;column-gap:8px;padding:0 10px 0 0}verdocs-template-fields #verdocs-template-fields-toolbar svg{-webkit-transform:scale(0.8);transform:scale(0.8)}verdocs-template-fields #verdocs-template-fields-toolbar .add-for,verdocs-template-fields #verdocs-template-fields-toolbar verdocs-select-input{display:none}}@media all and (max-width: 600px){verdocs-template-fields #verdocs-template-fields-toolbar{-webkit-column-gap:6px;-moz-column-gap:6px;column-gap:6px}verdocs-template-fields #verdocs-template-fields-toolbar svg{-webkit-transform:scale(0.6);transform:scale(0.6)}verdocs-template-fields #verdocs-template-fields-toolbar .separator,verdocs-template-fields #verdocs-template-fields-toolbar .add-for,verdocs-template-fields #verdocs-template-fields-toolbar verdocs-select-input{display:none}}verdocs-template-fields.placing-attachment{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-checkbox{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-date{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath fill='%23000000' d='M7.6 13.925q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375Zm4.4 0q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375Zm4.4 0q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375ZM5.3 22.85q-1.325 0-2.238-.912-.912-.913-.912-2.238V6.3q0-1.325.912-2.238.913-.912 2.238-.912H6v-2h2.575v2h6.85v-2H18v2h.7q1.325 0 2.238.912.912.913.912 2.238v13.4q0 1.325-.912 2.238-.913.912-2.238.912Zm0-3.15h13.4V10H5.3v9.7ZM5.3 8h13.4V6.3H5.3Zm0 0V6.3 8Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-dropdown{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24' stroke-width='1.5' stroke='currentColor'%3E%3Cpath stroke='%23000000' 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' /%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-initial{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='M6.225 20.775V7h-5V3.225H15V7h-5v13.775Zm9.775 0v-8h-3V9h9.775v3.775h-3v8Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-payment{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-radio{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='M12 17q2.075 0 3.538-1.463Q17 14.075 17 12t-1.462-3.538Q14.075 7 12 7 9.925 7 8.463 8.462 7 9.925 7 12q0 2.075 1.463 3.537Q9.925 17 12 17Zm0 5.85q-2.275 0-4.25-.85t-3.438-2.312Q2.85 18.225 2 16.25q-.85-1.975-.85-4.25T2 7.75q.85-1.975 2.312-3.438Q5.775 2.85 7.75 2q1.975-.85 4.25-.85t4.25.85q1.975.85 3.438 2.312Q21.15 5.775 22 7.75q.85 1.975.85 4.25T22 16.25q-.85 1.975-2.312 3.438Q18.225 21.15 16.25 22q-1.975.85-4.25.85Zm0-3.15q3.25 0 5.475-2.225Q19.7 15.25 19.7 12q0-3.25-2.225-5.475Q15.25 4.3 12 4.3q-3.25 0-5.475 2.225Q4.3 8.75 4.3 12q0 3.25 2.225 5.475Q8.75 19.7 12 19.7Zm0-7.7Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-signature{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='m9.225 21.225 4.65-4.65h8.45v4.65Zm-5.35-2.2H5.05l8.5-8.5-1.175-1.175-8.5 8.5Zm14.25-9.95L13.8 4.8l1.325-1.325q.625-.65 1.525-.663.9-.012 1.6.663l1.225 1.175q.675.675.663 1.562-.013.888-.663 1.513ZM16.7 10.55 6 21.225H1.675V16.9L12.35 6.225Zm-3.725-.625-.6-.575 1.175 1.175Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-textarea{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='M3.225 20.725v-3.15h11.55v3.15Zm0-4.775V12.8h17.55v3.15Zm0-4.75V8.05h17.55v3.15Zm0-4.775v-3.15h17.55v3.15Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-textbox{cursor:url(\"data:image/svg+xml,%3Csvg width='32' height='15' viewBox='0 0 32 15' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cmask id='path-1-inside-1_1401_24' fill='white'%3E%3Cpath d='M0 0H32V15H0V0Z'/%3E%3C/mask%3E%3Cpath d='M0 0H32V15H0V0Z' fill='%234C56CB' fill-opacity='0.1'/%3E%3Cpath d='M0 0V-1H-1V0H0ZM0 15H-1V16H0V15ZM0 1H32V-1H0V1ZM32 14H0V16H32V14ZM1 15V0H-1V15H1Z' fill='%234C56CB' mask='url(%23path-1-inside-1_1401_24)'/%3E%3Cpath d='M3 11.8V8.65H14.15V11.8H3ZM3 6.65V3.5H20.15V6.65H3Z' fill='%234C56CB'/%3E%3Cline x1='31.5' y1='1' x2='31.5' y2='14' stroke='%234C56CB' stroke-opacity='0.32' stroke-dasharray='1 1'/%3E%3C/svg%3E%0A\") 0 14, pointer}verdocs-template-fields.placing-timestamp{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath fill='%23000000' 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'%3E%3C/path%3E%3C/svg%3E\") 16 16, pointer}";
36
36
 
37
37
  const iconTextbox = '<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="M3.425 16.15V13h11.15v3.15Zm0-5.15V7.85h17.15V11Z"/></svg>';
38
38
  const iconCheck = '<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z"/></svg>';
@@ -136,7 +136,7 @@ const VerdocsTemplateFields = /*@__PURE__*/ proxyCustomElement(class VerdocsTemp
136
136
  componentWillUpdate() {
137
137
  var _a, _b;
138
138
  // If a new role was added and there were none yet so far, or the "selected" role was deleted, reset our selection
139
- const roles = ((_a = this.template) === null || _a === void 0 ? void 0 : _a.roles) || [];
139
+ const roles = [...(((_a = this.template) === null || _a === void 0 ? void 0 : _a.roles) || [])].sort((a, b) => { var _a, _b; return ((_a = a.sequence) !== null && _a !== void 0 ? _a : 0) - ((_b = b.sequence) !== null && _b !== void 0 ? _b : 0); });
140
140
  if (!this.selectedRoleName || !roles.find(role => role && role.name === this.selectedRoleName)) {
141
141
  this.selectedRoleName = ((_b = roles[0]) === null || _b === void 0 ? void 0 : _b.name) || '';
142
142
  console.log('[FIELDS] Selected new role', this.selectedRoleName);
@@ -148,11 +148,12 @@ const VerdocsTemplateFields = /*@__PURE__*/ proxyCustomElement(class VerdocsTemp
148
148
  async listenToTemplate() {
149
149
  this.unlistenToTemplate();
150
150
  Store.subscribe('templates', this.templateId, () => getTemplate(this.endpoint, this.templateId), false, (template) => {
151
- var _a, _b;
151
+ var _a;
152
152
  this.template = template;
153
153
  this.loading = false;
154
154
  if (!this.selectedRoleName) {
155
- this.selectedRoleName = ((_b = (_a = template.roles) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.name) || '';
155
+ const sorted = [...(template.roles || [])].sort((a, b) => { var _a, _b; return ((_a = a.sequence) !== null && _a !== void 0 ? _a : 0) - ((_b = b.sequence) !== null && _b !== void 0 ? _b : 0); });
156
+ this.selectedRoleName = ((_a = sorted[0]) === null || _a === void 0 ? void 0 : _a.name) || '';
156
157
  }
157
158
  });
158
159
  }
@@ -351,7 +352,8 @@ const VerdocsTemplateFields = /*@__PURE__*/ proxyCustomElement(class VerdocsTemp
351
352
  if (!this.endpoint.session) {
352
353
  return (h(Host, null, h("verdocs-component-error", { message: "You must be authenticated to use this module." })));
353
354
  }
354
- const selectableRoles = (((_a = this.template) === null || _a === void 0 ? void 0 : _a.roles) || []).map(role => ({ value: role.name, label: role.full_name ? `${role.name}: ${role.full_name}` : role.name }));
355
+ const sortedRoles = [...(((_a = this.template) === null || _a === void 0 ? void 0 : _a.roles) || [])].sort((a, b) => { var _a, _b; return ((_a = a.sequence) !== null && _a !== void 0 ? _a : 0) - ((_b = b.sequence) !== null && _b !== void 0 ? _b : 0); });
356
+ const selectableRoles = sortedRoles.map(role => ({ value: role.name, label: role.full_name ? `${role.name}: ${role.full_name}` : role.name }));
355
357
  return (h(Host, { class: this.placing ? { [`placing-${this.placing}`]: true } : {}, onSubmit: () => { } }, h("div", { id: "verdocs-template-fields-toolbar" }, h("div", { class: "add-for" }, "Add field:"), h("verdocs-select-input", { value: this.selectedRoleName, options: selectableRoles, onInput: (e) => (this.selectedRoleName = e.target.value) }), menuOptions.map(option => (h("verdocs-toolbar-icon", { text: option.tooltip, icon: option.icon, class: option.class, onClick: () => {
356
358
  // We ignore empty-tooltip entries because they're separators
357
359
  if (option.tooltip) {
@@ -531,6 +533,6 @@ function defineCustomElement() {
531
533
  }
532
534
 
533
535
  export { VerdocsTemplateFields as V, defineCustomElement as d };
534
- //# sourceMappingURL=p-5kRAYvGJ.js.map
536
+ //# sourceMappingURL=p-BWvUv89M.js.map
535
537
 
536
- //# sourceMappingURL=p-5kRAYvGJ.js.map
538
+ //# sourceMappingURL=p-BWvUv89M.js.map
@@ -0,0 +1 @@
1
+ {"file":"p-BWvUv89M.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,MAAM,wBAAwB,GAAG,+mRAA+mR;;ACUhpR,MAAM,WAAW,GAAG,mJAAmJ;AAEvK,MAAM,SAAS,GACb,mZAAmZ;AAErZ,MAAM,SAAS,GACb,0qBAA0qB;AAE5qB,MAAM,cAAc,GAClB,ytBAAytB;AAE3tB,MAAM,aAAa,GACjB,oXAAoX;AAEtX,MAAM,WAAW,GACf,4KAA4K;AAE9K;AACA;AAEA,MAAM,YAAY,GAChB,0QAA0Q;AAE5Q,MAAM,cAAc,GAClB,oWAAoW;AAEtW,MAAM,SAAS,GAAG,iJAAiJ;AAEnK,MAAM,WAAW,GAAG;AAClB,IAAA,EAAC,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE,WAAW,EAAC;AAChF,IAAA,EAAC,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,WAAW,EAAE,KAAK,EAAE,SAAS,EAAC;AACzE,IAAA,EAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,WAAW,EAAC;AAC9D,IAAA,EAAC,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,WAAW,EAAE,KAAK,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LElement"],"sources":["src/components/templates/verdocs-template-fields/verdocs-template-fields.scss?tag=verdocs-template-fields","src/components/templates/verdocs-template-fields/verdocs-template-fields.tsx"],"sourcesContent":["@import '../../../theme.scss';\n\nverdocs-template-fields {\n font-family: $verdocs-primary-font;\n position: relative;\n display: block;\n min-height: 600px;\n\n .page-0 {\n padding: 65px 15px 0 15px;\n box-sizing: border-box;\n\n .user-placed-fields {\n height: 100px;\n position: relative;\n background: #ffffff;\n box-shadow: 0 0 10px 5px #0000000f;\n\n .title {\n top: 0;\n left: 0;\n color: #ffffff;\n font-size: 12px;\n padding: 3px 6px;\n font-weight: bold;\n position: absolute;\n background: $verdocs-grey-blue;\n }\n }\n }\n\n .pages {\n display: flex;\n padding: 15px;\n row-gap: 15px;\n min-height: 200px;\n position: relative;\n align-items: center;\n box-sizing: border-box;\n flex-direction: column;\n\n div,\n canvas {\n box-sizing: border-box;\n }\n\n .document-separator {\n display: flex;\n align-items: center;\n gap: 10px;\n padding: 12px 20px;\n width: 100%;\n box-sizing: border-box;\n background-color: $verdocs-grey-1;\n color: white;\n border-radius: 6px;\n font-size: 16px;\n font-weight: 500;\n margin-top: 20px;\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);\n\n svg {\n flex-shrink: 0;\n }\n\n // Remove margin for the very first one if desired, but 20px spacing is probably good even for the first one\n &:first-child {\n margin-top: 0;\n }\n }\n }\n\n #verdocs-template-fields-toolbar {\n width: 100%;\n height: 50px;\n display: flex;\n column-gap: 15px;\n font-weight: 700;\n padding: 0 20px 0 0; // Right-only to better balance the visual\n align-items: center;\n flex-direction: row;\n color: $verdocs-grey-3;\n justify-content: center;\n background: $verdocs-grey-blue;\n\n > verdocs-select-input {\n margin: 0;\n }\n\n svg {\n width: 24px;\n height: 24px;\n }\n\n .add-for {\n margin: 0;\n font-weight: 500;\n color: $verdocs-grey-3;\n }\n\n verdocs-select-input {\n margin: 0 20px 0 0;\n }\n\n @media all and (max-width: 1000px) {\n column-gap: 8px;\n padding: 0 10px 0 0; // Right-only to better balance the visual\n\n svg {\n transform: scale(0.8);\n }\n\n .add-for,\n verdocs-select-input {\n display: none;\n }\n }\n\n @media all and (max-width: 600px) {\n column-gap: 6px;\n\n svg {\n transform: scale(0.6);\n }\n\n .separator,\n .add-for,\n verdocs-select-input {\n display: none;\n }\n }\n }\n\n &.placing-attachment {\n cursor:\n url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z'/%3E%3C/svg%3E\")\n 16 16,\n pointer;\n }\n\n &.placing-checkbox {\n cursor:\n url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z'/%3E%3C/svg%3E\")\n 16 16,\n pointer;\n }\n\n &.placing-date {\n cursor:\n url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath fill='%23000000' d='M7.6 13.925q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375Zm4.4 0q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375Zm4.4 0q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375ZM5.3 22.85q-1.325 0-2.238-.912-.912-.913-.912-2.238V6.3q0-1.325.912-2.238.913-.912 2.238-.912H6v-2h2.575v2h6.85v-2H18v2h.7q1.325 0 2.238.912.912.913.912 2.238v13.4q0 1.325-.912 2.238-.913.912-2.238.912Zm0-3.15h13.4V10H5.3v9.7ZM5.3 8h13.4V6.3H5.3Zm0 0V6.3 8Z'/%3E%3C/svg%3E\")\n 16 16,\n pointer;\n }\n\n &.placing-dropdown {\n cursor:\n url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24' stroke-width='1.5' stroke='currentColor'%3E%3Cpath stroke='%23000000' 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' /%3E%3C/svg%3E\")\n 16 16,\n pointer;\n }\n\n &.placing-initial {\n cursor:\n url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='M6.225 20.775V7h-5V3.225H15V7h-5v13.775Zm9.775 0v-8h-3V9h9.775v3.775h-3v8Z'/%3E%3C/svg%3E\")\n 16 16,\n pointer;\n }\n\n &.placing-payment {\n cursor:\n url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z'/%3E%3C/svg%3E\")\n 16 16,\n pointer;\n }\n\n &.placing-radio {\n cursor:\n url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='M12 17q2.075 0 3.538-1.463Q17 14.075 17 12t-1.462-3.538Q14.075 7 12 7 9.925 7 8.463 8.462 7 9.925 7 12q0 2.075 1.463 3.537Q9.925 17 12 17Zm0 5.85q-2.275 0-4.25-.85t-3.438-2.312Q2.85 18.225 2 16.25q-.85-1.975-.85-4.25T2 7.75q.85-1.975 2.312-3.438Q5.775 2.85 7.75 2q1.975-.85 4.25-.85t4.25.85q1.975.85 3.438 2.312Q21.15 5.775 22 7.75q.85 1.975.85 4.25T22 16.25q-.85 1.975-2.312 3.438Q18.225 21.15 16.25 22q-1.975.85-4.25.85Zm0-3.15q3.25 0 5.475-2.225Q19.7 15.25 19.7 12q0-3.25-2.225-5.475Q15.25 4.3 12 4.3q-3.25 0-5.475 2.225Q4.3 8.75 4.3 12q0 3.25 2.225 5.475Q8.75 19.7 12 19.7Zm0-7.7Z'/%3E%3C/svg%3E\")\n 16 16,\n pointer;\n }\n\n &.placing-signature {\n cursor:\n url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='m9.225 21.225 4.65-4.65h8.45v4.65Zm-5.35-2.2H5.05l8.5-8.5-1.175-1.175-8.5 8.5Zm14.25-9.95L13.8 4.8l1.325-1.325q.625-.65 1.525-.663.9-.012 1.6.663l1.225 1.175q.675.675.663 1.562-.013.888-.663 1.513ZM16.7 10.55 6 21.225H1.675V16.9L12.35 6.225Zm-3.725-.625-.6-.575 1.175 1.175Z'/%3E%3C/svg%3E\")\n 16 16,\n pointer;\n }\n\n &.placing-textarea {\n cursor:\n url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='M3.225 20.725v-3.15h11.55v3.15Zm0-4.775V12.8h17.55v3.15Zm0-4.75V8.05h17.55v3.15Zm0-4.775v-3.15h17.55v3.15Z'/%3E%3C/svg%3E\")\n 16 16,\n pointer;\n }\n\n &.placing-textbox {\n cursor:\n url(\"data:image/svg+xml,%3Csvg width='32' height='15' viewBox='0 0 32 15' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cmask id='path-1-inside-1_1401_24' fill='white'%3E%3Cpath d='M0 0H32V15H0V0Z'/%3E%3C/mask%3E%3Cpath d='M0 0H32V15H0V0Z' fill='%234C56CB' fill-opacity='0.1'/%3E%3Cpath d='M0 0V-1H-1V0H0ZM0 15H-1V16H0V15ZM0 1H32V-1H0V1ZM32 14H0V16H32V14ZM1 15V0H-1V15H1Z' fill='%234C56CB' mask='url(%23path-1-inside-1_1401_24)'/%3E%3Cpath d='M3 11.8V8.65H14.15V11.8H3ZM3 6.65V3.5H20.15V6.65H3Z' fill='%234C56CB'/%3E%3Cline x1='31.5' y1='1' x2='31.5' y2='14' stroke='%234C56CB' stroke-opacity='0.32' stroke-dasharray='1 1'/%3E%3C/svg%3E%0A\")\n 0 14,\n pointer;\n }\n\n &.placing-timestamp {\n cursor:\n url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath fill='%23000000' 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'%3E%3C/path%3E%3C/svg%3E\")\n 16 16,\n pointer;\n }\n}\n","import interact from 'interactjs';\nimport {Component, h, Event, EventEmitter, Fragment, Prop, Host, State, Listen, Watch} from '@stencil/core';\nimport {createField, getTemplate, integerSequence, ITemplate, ITemplateField, TFieldType, updateField, VerdocsEndpoint} from '@verdocs/js-sdk';\nimport {defaultHeight, defaultWidth, getFieldId, removeCssTransform, setControlStyles, updateCssTransform} from '../../../utils/utils';\nimport {IDocumentPageInfo} from '../../../utils/Types';\nimport {DocumentPageIcon} from '../../../utils/Icons';\nimport {VerdocsToast} from '../../../utils/Toast';\nimport {SDKError} from '../../../utils/errors';\nimport {Store} from '../../../utils/Datastore';\n\nconst iconTextbox = '<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" width=\"24\"><path fill=\"#ffffff\" d=\"M3.425 16.15V13h11.15v3.15Zm0-5.15V7.85h17.15V11Z\"/></svg>';\n\nconst iconCheck =\n '<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" width=\"24\"><path fill=\"#ffffff\" d=\"m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z\"/></svg>';\n\nconst iconRadio =\n '<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" width=\"24\"><path fill=\"#ffffff\" d=\"M12 17q2.075 0 3.538-1.463Q17 14.075 17 12t-1.462-3.538Q14.075 7 12 7 9.925 7 8.463 8.462 7 9.925 7 12q0 2.075 1.463 3.537Q9.925 17 12 17Zm0 5.85q-2.275 0-4.25-.85t-3.438-2.312Q2.85 18.225 2 16.25q-.85-1.975-.85-4.25T2 7.75q.85-1.975 2.312-3.438Q5.775 2.85 7.75 2q1.975-.85 4.25-.85t4.25.85q1.975.85 3.438 2.312Q21.15 5.775 22 7.75q.85 1.975.85 4.25T22 16.25q-.85 1.975-2.312 3.438Q18.225 21.15 16.25 22q-1.975.85-4.25.85Zm0-3.15q3.25 0 5.475-2.225Q19.7 15.25 19.7 12q0-3.25-2.225-5.475Q15.25 4.3 12 4.3q-3.25 0-5.475 2.225Q4.3 8.75 4.3 12q0 3.25 2.225 5.475Q8.75 19.7 12 19.7Zm0-7.7Z\"/></svg>';\n\nconst iconDatepicker =\n '<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" width=\"24\"><path fill=\"#ffffff\" d=\"M7.6 13.925q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375Zm4.4 0q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375Zm4.4 0q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375ZM5.3 22.85q-1.325 0-2.238-.912-.912-.913-.912-2.238V6.3q0-1.325.912-2.238.913-.912 2.238-.912H6v-2h2.575v2h6.85v-2H18v2h.7q1.325 0 2.238.912.912.913.912 2.238v13.4q0 1.325-.912 2.238-.913.912-2.238.912Zm0-3.15h13.4V10H5.3v9.7ZM5.3 8h13.4V6.3H5.3Zm0 0V6.3 8Z\"/></svg>';\n\nconst iconSignature =\n '<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" width=\"24\"><path fill=\"#ffffff\" d=\"m9.225 21.225 4.65-4.65h8.45v4.65Zm-5.35-2.2H5.05l8.5-8.5-1.175-1.175-8.5 8.5Zm14.25-9.95L13.8 4.8l1.325-1.325q.625-.65 1.525-.663.9-.012 1.6.663l1.225 1.175q.675.675.663 1.562-.013.888-.663 1.513ZM16.7 10.55 6 21.225H1.675V16.9L12.35 6.225Zm-3.725-.625-.6-.575 1.175 1.175Z\"/></svg>';\n\nconst iconInitial =\n '<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" width=\"24\"><path fill=\"#ffffff\" d=\"M6.225 20.775V7h-5V3.225H15V7h-5v13.775Zm9.775 0v-8h-3V9h9.775v3.775h-3v8Z\"/></svg>';\n\n// const iconTimestamp =\n// '<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>';\n\nconst iconDropdown =\n '<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>';\n\nconst iconAttachment =\n '<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>';\n\nconst 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>';\n\nconst menuOptions = [\n {id: 'signature', tooltip: 'Signature', icon: iconSignature, class: 'signature'},\n {id: 'initial', tooltip: 'Initials', icon: iconInitial, class: 'initial'},\n {id: 'sep1', tooltip: '', icon: separator, class: 'separator'},\n {id: 'textbox', tooltip: 'Text Box', icon: iconTextbox, class: 'textbox'},\n {id: 'checkbox', tooltip: 'Check Box', icon: iconCheck, class: 'checkbox'},\n {id: 'radio', tooltip: 'Radio Button', icon: iconRadio, class: 'radio'},\n {id: 'dropdown', tooltip: 'Dropdown', icon: iconDropdown, class: 'dropdown'},\n {id: 'sep2', tooltip: '', icon: separator, class: 'separator'},\n {id: 'date', tooltip: 'Date', icon: iconDatepicker, class: 'date'},\n // {id: 'timestamp', tooltip: 'Timestamp', icon: iconTimestamp, class: 'timestamp'},\n // {id: 'sep3', tooltip: '', icon: separator},\n {id: 'attachment', tooltip: 'Attachment', icon: iconAttachment, class: 'attachment'},\n // {id: 'payment', tooltip: 'Payment', icon: 'P'},\n];\n\n/**\n * Displays a builder experience for laying out fields in a template. Note that this experience requires a large display area to\n * present all of the required controls, so it is primarily intended to be used in desktop environments.\n */\n@Component({\n tag: 'verdocs-template-fields',\n styleUrl: 'verdocs-template-fields.scss',\n shadow: false,\n})\nexport class VerdocsTemplateFields {\n private templateListenerId = null;\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 ID of the template to create the document from.\n */\n @Prop({reflect: true, mutable: true}) templateId: string | null = null;\n\n /**\n * If set, (recommended), the host application should create a <DIV> element with a unique ID. When this\n * component renders, the toolbar will be removed from its default location and placed in the target element.\n * This allows the parent application to more easily control its placement and scroll effects.\n *\n * The movement of the toolbar to the target container is not dynamic - it is performed only on the initial\n * render. Host applications should not conditionally render this container. If the toolbar's visibility must\n * be externally controlled, use CSS display options to hide/show it instead.\n */\n @Prop() toolbarTargetId: string | null = null;\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 @Event({composed: true}) fieldsUpdated: EventEmitter<{endpoint: VerdocsEndpoint; templateId: string; event: 'added' | 'deleted' | 'updated'; fields: ITemplateField[]}>;\n\n @State() placing: TFieldType | null = null;\n @State() showMustSelectRole = false;\n @State() selectedRoleName = '';\n\n @State() loading = true;\n @State() template: ITemplate | null = null;\n\n pageHeights: Record<number, number> = {};\n\n @Watch('templateId')\n onTemplateIdChanged() {\n this.listenToTemplate();\n }\n\n // Stop field-placement mode if ESC is pressed\n @Listen('keydown', {target: 'document'})\n handleKeyDown(ev: KeyboardEvent) {\n if (ev.key === 'Escape') {\n this.placing = null;\n }\n }\n\n async componentWillLoad() {\n try {\n this.endpoint.loadSession();\n\n if (!this.templateId) {\n console.log(`[FIELDS] Missing required template ID ${this.templateId}`);\n return;\n }\n\n if (!this.endpoint.session) {\n console.log('[FIELDS] Unable to start builder session, must be authenticated');\n return;\n }\n\n this.listenToTemplate();\n } catch (e) {\n console.log('[FIELDS] Error with fields session', e);\n this.sdkError?.emit(new SDKError(e.message, e.response?.status, e.response?.data));\n }\n }\n\n componentDidRender() {\n interact.dynamicDrop(true);\n\n const toolbarTarget = this.toolbarTargetId ? document.getElementById(this.toolbarTargetId) : null;\n const toolbarEl = document.getElementById('verdocs-template-fields-toolbar');\n if (toolbarTarget && toolbarEl) {\n toolbarEl.remove();\n toolbarTarget.append(toolbarEl);\n }\n }\n\n componentWillUpdate() {\n // If a new role was added and there were none yet so far, or the \"selected\" role was deleted, reset our selection\n const roles = [...(this.template?.roles || [])].sort((a, b) => (a.sequence ?? 0) - (b.sequence ?? 0));\n if (!this.selectedRoleName || !roles.find(role => role && role.name === this.selectedRoleName)) {\n this.selectedRoleName = roles[0]?.name || '';\n console.log('[FIELDS] Selected new role', this.selectedRoleName);\n }\n }\n\n disconnectedCallback() {\n this.unlistenToTemplate();\n }\n\n async listenToTemplate() {\n this.unlistenToTemplate();\n Store.subscribe(\n 'templates',\n this.templateId,\n () => getTemplate(this.endpoint, this.templateId),\n false,\n (template: ITemplate) => {\n this.template = template;\n this.loading = false;\n\n if (!this.selectedRoleName) {\n const sorted = [...(template.roles || [])].sort((a, b) => (a.sequence ?? 0) - (b.sequence ?? 0));\n this.selectedRoleName = sorted[0]?.name || '';\n }\n },\n );\n }\n\n unlistenToTemplate() {\n if (this.templateListenerId) {\n Store.store.delListener(this.templateListenerId);\n this.templateListenerId = null;\n }\n }\n\n attachFieldAttributes(pageInfo: IDocumentPageInfo, field: ITemplateField, el: HTMLInputElement) {\n // el.addEventListener('input', e => this.handleFieldChange(field, e));\n el.addEventListener('settingsChanged', () => {\n this.templateUpdated?.emit({endpoint: this.endpoint, template: this.template, event: 'added-field'});\n });\n el.addEventListener('deleted', () => {\n el.remove();\n this.templateUpdated?.emit({endpoint: this.endpoint, template: this.template, event: 'updated-field'});\n });\n el.setAttribute('templateid', this.templateId);\n el.setAttribute('fieldname', field.name);\n el.setAttribute('documentid', String(pageInfo.documentId));\n el.setAttribute('pageNumber', String(pageInfo.pageNumber));\n el.setAttribute('xScale', String(pageInfo.xScale));\n el.setAttribute('yScale', String(pageInfo.yScale));\n el.setAttribute('name', field.name);\n }\n\n cachedPageInfo: Record<string, Record<number, IDocumentPageInfo>> = {};\n handlePageRendered(e: any) {\n const pageInfo = e.detail as IDocumentPageInfo;\n console.log('[FIELDS] Page rendered', pageInfo.documentId, pageInfo.pageNumber, pageInfo.xScale, pageInfo.yScale);\n this.cachedPageInfo[pageInfo.documentId] ??= {};\n this.cachedPageInfo[pageInfo.documentId][pageInfo.pageNumber] = pageInfo;\n\n this.pageHeights[pageInfo.pageNumber] = pageInfo.naturalHeight;\n\n (this.template?.fields || [])\n .filter(field => field && field.page === pageInfo.pageNumber)\n .forEach(field => {\n const id = getFieldId(field);\n const el = document.getElementById(id);\n if (el) {\n el.setAttribute('fieldname', field.name);\n el.setAttribute('pagenumber', String(field.page));\n el.setAttribute('documentid', String(field.document_id));\n this.makeDraggable(el);\n }\n });\n }\n\n makeDraggable(el: HTMLElement) {\n interact(el).draggable({\n listeners: {\n move: this.handleMoveField.bind(this),\n end: this.handleMoveEnd.bind(this),\n },\n });\n }\n\n async handleMoveField(event: any) {\n const oldX = +(event.target.getAttribute('posX') || 0);\n const oldY = +(event.target.getAttribute('posY') || 0);\n const xScale = +(event.target.getAttribute('xScale') || 1);\n const yScale = +(event.target.getAttribute('yScale') || 1);\n const newX = event.dx / xScale + oldX;\n const newY = event.dy / yScale + oldY;\n event.target.setAttribute('posX', newX);\n event.target.setAttribute('posy', newY);\n updateCssTransform(event.target, 'translate', `${newX}px, ${newY}px`);\n }\n\n async handleMoveEnd(event: any) {\n const name = event.target.getAttribute('fieldname');\n const field = (this.template?.fields || []).find(field => field.name === name);\n if (!field) {\n console.log('[FIELDS] Unable to find field', name, event.target);\n return;\n }\n\n const pageNumber = event.target.getAttribute('pagenumber');\n const documentId = event.target.getAttribute('documentid');\n let {naturalWidth = 612, naturalHeight = 792, renderedHeight = 792} = this.cachedPageInfo[documentId][pageNumber];\n const clientRect = event.target.getBoundingClientRect();\n const parent = event.target.parentElement;\n const parentRect = parent.getBoundingClientRect();\n\n const width = field.width || defaultWidth(field.type);\n const height = field.height || defaultHeight(field.type);\n\n // These two being backwards is not a mistake. Left measures \"over\" from the left\n // (positive displacement) while bottom measures \"up\" from the bottom (negative displacement).\n const newX = Math.max(clientRect.left - parentRect.left, 0);\n let newY = Math.max(renderedHeight - (parentRect.bottom - clientRect.bottom), 0);\n\n let newPageNumber = parseInt(pageNumber);\n if (newY > renderedHeight) {\n newPageNumber = Math.min(newPageNumber + 1, (this.template?.documents || [])?.[0]?.pages || 1);\n newY -= renderedHeight;\n renderedHeight = this.cachedPageInfo[documentId][newPageNumber].renderedHeight;\n\n console.log('Next page', {newPageNumber, newY, renderedHeight});\n } else if (newY < 0) {\n newPageNumber = Math.max(newPageNumber - 1, 1);\n renderedHeight = this.cachedPageInfo[documentId][newPageNumber].renderedHeight;\n newY += renderedHeight;\n console.log('[FIELDS] Next page', {newPageNumber, newY, renderedHeight});\n }\n\n const {x, y} = this.viewCoordinatesToPageCoordinates(newX, newY, documentId, pageNumber, naturalWidth - width, naturalHeight - height);\n try {\n const params = {x, y, page: newPageNumber};\n const updatedField = await updateField(this.endpoint, this.templateId, name, params);\n console.log('[FIELDS] Updated', updatedField);\n\n const newTemplate = JSON.parse(JSON.stringify(this.template));\n const fieldIndex = newTemplate.fields.findIndex(field => field.name === name);\n if (fieldIndex > -1) {\n newTemplate.fields[fieldIndex] = updatedField;\n }\n\n Store.updateTemplate(this.templateId, newTemplate);\n event.target.removeAttribute('posX');\n event.target.removeAttribute('posY');\n removeCssTransform(event.target);\n const {xScale = 1, yScale = 1} = this.cachedPageInfo[documentId][pageNumber];\n setControlStyles(event.target, updatedField, xScale, yScale);\n this.templateUpdated?.emit({endpoint: this.endpoint, template: newTemplate, event: 'updated-field'});\n } catch (e) {\n VerdocsToast('Error updating field, please try again later', {style: 'error'});\n console.log('[FIELDS] Error updating field', e);\n this.sdkError?.emit(new SDKError(e.message, e.response?.status, e.response?.data));\n event.target.removeAttribute('posX');\n event.target.removeAttribute('posY');\n removeCssTransform(event.target);\n }\n }\n\n generateFieldName(type: string, pageNumber: number) {\n let i = 1;\n let fieldName: string;\n do {\n fieldName = `${type}P${pageNumber}-${i}`;\n i++;\n } while ((this.template?.fields || []).some(field => field && field.name === fieldName));\n\n return fieldName;\n }\n\n // Scale the X,Y clicks to the virtual page dimensions. Also ensure the field doesn't go off the page.\n viewCoordinatesToPageCoordinates(viewX: number, viewY: number, documentId: string, pageNumber: number, xMax: number, yMax: number) {\n const {xScale = 1, yScale = 1, renderedHeight = 792} = this.cachedPageInfo[documentId][pageNumber];\n const x = Math.floor(Math.min(viewX / xScale, xMax));\n const y = Math.floor(Math.min(Math.max(renderedHeight - viewY, 0) / yScale, yMax));\n return {x, y};\n }\n\n async handleClickPage(e: any, documentId: string, pageNumber: number) {\n if (this.placing) {\n console.log('Placing field', {documentId, pageNumber});\n const clickedX = e.offsetX;\n const clickedY = e.offsetY;\n\n const width = defaultWidth(this.placing);\n const height = defaultHeight(this.placing);\n\n const cachedPage = this.cachedPageInfo[documentId][pageNumber];\n const {naturalWidth = 612, naturalHeight = 792} = cachedPage;\n\n const coords = this.viewCoordinatesToPageCoordinates(clickedX, clickedY, documentId, pageNumber, naturalWidth - width, naturalHeight - height);\n const x = Math.floor(coords.x);\n const y = Math.floor(coords.y);\n\n const field: ITemplateField = {\n name: this.generateFieldName(this.placing, pageNumber), // 'textboxP1-22',\n role_name: this.selectedRoleName,\n template_id: this.templateId,\n document_id: cachedPage.documentId,\n type: this.placing,\n required: this.placing !== 'radio' && this.placing !== 'attachment' && this.placing !== 'checkbox',\n page: pageNumber,\n validator: null,\n label: null,\n default: null,\n placeholder: null,\n group: null,\n settings: {},\n x,\n y,\n width,\n height,\n multiline: false,\n readonly: false,\n options: this.placing === 'radio' ? [{id: 'option-1', label: 'Option 1'}] : [],\n };\n console.log('[FIELDS] Will save new field', field);\n\n const newField = await createField(this.endpoint, this.templateId, field);\n console.log('[FIELDS] Saved field', newField);\n\n const newTemplate = JSON.parse(JSON.stringify(this.template));\n newTemplate.fields.push(newField);\n Store.updateTemplate(this.templateId, newTemplate);\n this.templateUpdated?.emit({endpoint: this.endpoint, template: newTemplate, event: 'added-field'});\n\n this.placing = null;\n }\n }\n\n render() {\n if (this.loading) {\n return (\n <Host>\n <verdocs-loader />\n </Host>\n );\n }\n\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 const sortedRoles = [...(this.template?.roles || [])].sort((a, b) => (a.sequence ?? 0) - (b.sequence ?? 0));\n const selectableRoles = sortedRoles.map(role => ({value: role.name, label: role.full_name ? `${role.name}: ${role.full_name}` : role.name}));\n\n return (\n <Host class={this.placing ? {[`placing-${this.placing}`]: true} : {}} onSubmit={() => {}}>\n <div id=\"verdocs-template-fields-toolbar\">\n <div class=\"add-for\">Add field:</div>\n <verdocs-select-input value={this.selectedRoleName} options={selectableRoles} onInput={(e: any) => (this.selectedRoleName = e.target.value)} />\n\n {menuOptions.map(option => (\n <verdocs-toolbar-icon\n text={option.tooltip}\n icon={option.icon}\n class={option.class}\n onClick={() => {\n // We ignore empty-tooltip entries because they're separators\n if (option.tooltip) {\n // We require a role to be selected first\n if (this.selectedRoleName) {\n this.placing = option.id as TFieldType;\n } else {\n this.showMustSelectRole = true;\n }\n }\n }}\n />\n ))}\n </div>\n\n {/* <div class=\"page-0\" ref={el => (this.page0El = el as HTMLDivElement)}>*/}\n {/* <div class=\"user-placed-fields\">*/}\n {/* <div class=\"title\">User-Placed Fields</div>*/}\n {/* <verdocs-field-signature*/}\n {/* field={testField}*/}\n {/* style={{width: '82px', height: '41px', left: '20px', top: '40px', transform: 'scale(1,1)', backgroundColor: getRGBA(0)}}*/}\n {/* moveable={true}*/}\n {/* editable={true}*/}\n {/* />*/}\n {/* </div>*/}\n {/*</div>*/}\n\n <div class=\"pages\">\n {(this.template?.documents || []).map(document => {\n const pageNumbers = integerSequence(1, document.pages);\n\n return pageNumbers.map(page => {\n const pageSize = document.page_sizes[page];\n\n return (\n <Fragment>\n {this.template?.documents.length > 1 && (\n <div class=\"document-separator\">\n <div innerHTML={DocumentPageIcon} />\n <span>{document.name}</span>\n </div>\n )}\n\n <verdocs-template-document-page\n templateId={this.templateId}\n documentId={document.id}\n pageNumber={page}\n virtualWidth={pageSize?.width || 612}\n virtualHeight={pageSize?.height || 792}\n disabled={true}\n editable={true}\n done={false}\n onClick={(e: PointerEvent) => this.handleClickPage(e, document.id, page)}\n onPageRendered={e => this.handlePageRendered(e)}\n layers={[\n {name: 'page', type: 'canvas'},\n {name: 'controls', type: 'div'},\n ]}\n />\n </Fragment>\n );\n });\n })}\n </div>\n {this.showMustSelectRole && (\n <verdocs-ok-dialog\n heading=\"Unable to add field\"\n message={(this.template?.roles || []).length > 0 ? 'Please select a role before adding fields.' : 'Please add at least one role before adding fields.'}\n onNext={() => (this.showMustSelectRole = false)}\n />\n )}\n </Host>\n );\n }\n}\n"],"version":3}
@@ -36,7 +36,7 @@ import { d as defineCustomElement$c } from './p-dJ-8COo-.js';
36
36
  import { d as defineCustomElement$b } from './p-CMjSbrE6.js';
37
37
  import { d as defineCustomElement$a } from './p-CY-c2d8q.js';
38
38
  import { d as defineCustomElement$9 } from './p-CG5hnDaJ.js';
39
- import { d as defineCustomElement$8 } from './p-5kRAYvGJ.js';
39
+ import { d as defineCustomElement$8 } from './p-BWvUv89M.js';
40
40
  import { d as defineCustomElement$7 } from './p-2-71mUOp.js';
41
41
  import { d as defineCustomElement$6 } from './p-D-ZRWW6J.js';
42
42
  import { d as defineCustomElement$5 } from './p-BkdE4JBa.js';
@@ -1,4 +1,4 @@
1
- import { V as VerdocsTemplateFields$1, d as defineCustomElement$1 } from './p-5kRAYvGJ.js';
1
+ import { V as VerdocsTemplateFields$1, d as defineCustomElement$1 } from './p-BWvUv89M.js';
2
2
 
3
3
  const VerdocsTemplateFields = VerdocsTemplateFields$1;
4
4
  const defineCustomElement = defineCustomElement$1;