@verdocs/web-sdk 1.10.6 → 1.10.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/verdocs-quick-functions_3.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-template-create_2.cjs.entry.js +37 -7
- package/dist/cjs/verdocs-template-recipients.cjs.entry.js +5 -3
- package/dist/collection/components/elements/verdocs-search-box/verdocs-search-box.js +2 -2
- package/dist/collection/components/templates/verdocs-template-fields/verdocs-template-fields.js +37 -7
- package/dist/collection/components/templates/verdocs-template-recipients/verdocs-template-recipients.css +11 -0
- package/dist/collection/components/templates/verdocs-template-recipients/verdocs-template-recipients.js +18 -2
- package/dist/collection/components/templates/verdocs-template-recipients/verdocs-template-recipients.stories.js +5 -4
- package/dist/components/verdocs-search-box2.js +1 -1
- package/dist/components/verdocs-template-fields2.js +37 -7
- package/dist/components/verdocs-template-recipients.js +5 -3
- package/dist/custom-elements.json +1361 -0
- package/dist/docs.json +11 -2
- package/dist/esm/verdocs-quick-functions_3.entry.js +1 -1
- package/dist/esm/verdocs-template-create_2.entry.js +37 -7
- package/dist/esm/verdocs-template-recipients.entry.js +5 -3
- package/dist/esm-es5/verdocs-quick-functions_3.entry.js +1 -1
- package/dist/esm-es5/verdocs-template-create_2.entry.js +1 -1
- package/dist/esm-es5/verdocs-template-recipients.entry.js +1 -1
- package/dist/types/components/templates/verdocs-template-recipients/verdocs-template-recipients.d.ts +4 -0
- package/dist/types/components/templates/verdocs-template-recipients/verdocs-template-recipients.stories.d.ts +3 -2
- package/dist/types/components.d.ts +4 -0
- package/dist/verdocs-web-sdk/p-53198827.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-59c4e444.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-7bc5fc1e.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/{p-3fbe602a.system.entry.js → p-83adc0f7.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-c16b6ca4.system.js +1 -1
- package/dist/verdocs-web-sdk/{p-205027db.entry.js → p-cf8522b5.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-cf9883c7.system.entry.js → p-e82bebc9.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
- package/package.json +2 -2
- package/dist/verdocs-web-sdk/p-8c3d48c1.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-e179e3de.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-f69cdc41.entry.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(e,t,r,o){function n(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,i){function s(e){try{l(o.next(e))}catch(e){i(e)}}function a(e){try{l(o["throw"](e))}catch(e){i(e)}}function l(e){e.done?r(e.value):n(e.value).then(s,a)}l((o=o.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},o,n,i,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(e){return function(t){return l([e,t])}}function l(s){if(o)throw new TypeError("Generator is already executing.");while(r)try{if(o=1,n&&(i=s[0]&2?n["return"]:s[0]?n["throw"]||((i=n["return"])&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;if(n=0,i)s=[s[0]&2,i.value];switch(s[0]){case 0:case 1:i=s;break;case 4:r.label++;return{value:s[1],done:false};case 5:r.label++;n=s[1];s=[0];continue;case 7:s=r.ops.pop();r.trys.pop();continue;default:if(!(i=r.trys,i=i.length>0&&i[i.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){r.label=s[1];break}if(s[0]===6&&r.label<i[1]){r.label=i[1];i=s;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(s);break}if(i[2])r.ops.pop();r.trys.pop();continue}s=t.call(e,r)}catch(e){s=[6,e];n=0}finally{o=i=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};System.register(["./p-97329951.system.js","./p-d122cadd.system.js","./p-fbc81799.system.js","./p-261dcea1.system.js","./p-05eb4fed.system.js","./p-5b62f239.system.js","./p-7067adce.system.js","./p-e090d5e1.system.js","./p-187b20b7.system.js","./p-af2c2f79.system.js","./p-0f6da8c7.system.js","./p-d50523fd.system.js","./p-69912cbf.system.js","./p-e0cfad01.system.js","./p-327858f0.system.js"],(function(e){"use strict";var t,r,o,n,i,s,a,l,c,p,d,u,f,m,g,v;return{setters:[function(e){t=e.r;r=e.c;o=e.h;n=e.F;i=e.H;s=e.a},function(e){a=e.i},function(e){l=e.u;c=e.c},function(e){p=e.V;d=e.T},function(e){u=e.g},function(e){f=e.s},function(e){m=e.l},function(e){g=e.a},function(e){v=e.S},function(){},function(){},function(){},function(){},function(){},function(){}],execute:function(){var h;var x='verdocs-template-recipients{display:block;min-width:400px;font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-template-recipients>form{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;background-color:#ffffff;padding:12px}verdocs-template-recipients>form h5{font-size:16px;font-weight:bold;color:#4c56cb;margin:0 0 10px 0}verdocs-template-recipients>form .participants{position:relative}verdocs-template-recipients>form .left-line{top:32px;left:11px;z-index:1;width:12px;bottom:30px;position:absolute;background:#ffffff;border-left:3px dotted #9b9b9b}verdocs-template-recipients>form .row{display:-ms-flexbox;display:flex;-webkit-column-gap:0;-moz-column-gap:0;column-gap:0;margin-left:40px;position:relative;-ms-flex-direction:row;flex-direction:row;padding:6px 0 4px 0}verdocs-template-recipients>form .row .row-recipients{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex;-webkit-column-gap:10px;-moz-column-gap:10px;column-gap:10px;-ms-flex-direction:row;flex-direction:row}verdocs-template-recipients>form .row .icon{top:14px;z-index:2;left:-40px;width:24px;height:24px;position:absolute;background:#ffffff}verdocs-template-recipients>form .row .sender{height:30px;display:-ms-flexbox;display:flex;font-size:14px;padding:0 5px 0 15px;line-height:30px;-ms-flex-direction:row;flex-direction:row;border-radius:30px;border:1px solid #c6c9cc;background-color:#f5f5fa}verdocs-template-recipients>form .row .complete{height:30px;display:-ms-flexbox;display:flex;font-size:14px;padding:0 15px;line-height:30px;-ms-flex-direction:row;flex-direction:row;border-radius:30px;background-color:#f5f5fa;border:1px solid #aeb4bf}verdocs-template-recipients>form .row .label{font-weight:bold;margin-right:6px;color:#33364b}verdocs-template-recipients>form .row .settings-button{margin:4px 0 0 9px;cursor:pointer}verdocs-template-recipients>form .row .recipient{height:30px;display:-ms-flexbox;display:flex;font-size:14px;line-height:30px;border-radius:30px;-ms-flex-direction:row;flex-direction:row;padding:0 5px 0 6px;white-space:nowrap;border:1px solid #aeb4bf}verdocs-template-recipients>form .row .recipient .type-icon{width:24px;height:24px;-webkit-transform:scale(0.8);transform:scale(0.8);opacity:0.6;margin:4px 12px 0 0}verdocs-template-recipients>form .row .recipient.dragging{position:absolute}verdocs-template-recipients>form .row .recipient.dragging+.dropzone{display:none !important}verdocs-template-recipients>form .row .dropzone{width:14px;height:30px;display:none}verdocs-template-recipients>form .row .dropzone svg{fill:#cccccc}verdocs-template-recipients>form .row .dropzone.visible{margin:0 7px;display:-ms-flexbox;display:flex;-ms-flex:0 0 14px;flex:0 0 14px}verdocs-template-recipients>form .row .dropzone.active{-ms-flex:0 0 120px;flex:0 0 120px;border-radius:30px;background:#654dcb7f;border:1px dashed #654dcb}verdocs-template-recipients>form label{display:block;font-size:14px;font-weight:500;margin:0 0 4px 0;color:#5c6575}verdocs-template-recipients>form input{border:none;font-size:18px;padding:3px 6px 3px 0;background:transparent;border-bottom:1px solid #33364b}verdocs-template-recipients>form input:focus{outline:none}verdocs-template-recipients .row.add-sequence{display:none}verdocs-template-recipients .add-role{margin:0;padding:0;border:none;opacity:0.5;cursor:pointer;background:none}verdocs-template-recipients .add-role:hover{opacity:1}verdocs-template-recipients .add-role svg{width:32px;height:32px}verdocs-template-recipients.dragging .add-role{display:none}verdocs-template-recipients.dragging form .row .recipient+.dropzone{display:-ms-flexbox;display:flex}verdocs-template-recipients.dragging .row.add-sequence{display:-ms-flexbox;display:flex}verdocs-template-recipients.dragging .row.add-sequence .dropzone{opacity:0.5;-ms-flex:0 0 120px;flex:0 0 120px;border-radius:30px;-ms-flex-align:center;align-items:center;background:#654dcb7f;-ms-flex-pack:center;justify-content:center;border:1px dashed #654dcb}verdocs-template-recipients.dragging .row.add-sequence .dropzone.active{opacity:1}verdocs-template-recipients .buttons{display:-ms-flexbox;display:flex;-webkit-column-gap:8px;-moz-column-gap:8px;column-gap:8px;margin-top:16px;-ms-flex-direction:row;flex-direction:row}verdocs-template-recipients ::-webkit-input-placeholder{color:#aaaaaa}verdocs-template-recipients ::-moz-placeholder{color:#aaaaaa}verdocs-template-recipients :-ms-input-placeholder{color:#aaaaaa}verdocs-template-recipients ::-ms-input-placeholder{color:#aaaaaa}verdocs-template-recipients ::placeholder{color:#aaaaaa}';var b=(h={},h[d.EVERYONE]="Everyone",h[d.EVERYONE_AS_CREATOR]="Everyone as Me",h[d.ORGANIZATION_MEMBER]="Organization member",h[d.ORGANIZATION_MEMBER_AS_CREATOR]="Organization Member as Me",h[d.CREATOR]="Me",h);var w='<svg xmlns="http://www.w3.org/2000/svg" height="20" width="20" fill="#00000089"><path d="m8.021 17.917-.313-2.5q-.27-.125-.625-.334-.354-.208-.625-.395l-2.312.979-1.979-3.438 1.979-1.5q-.021-.167-.031-.364-.011-.198-.011-.365 0-.146.011-.344.01-.198.031-.385l-1.979-1.5 1.979-3.417 2.312.958q.271-.187.615-.385t.635-.344l.313-2.5h3.958l.313 2.5q.312.167.625.344.312.177.604.385l2.333-.958 1.979 3.417-1.979 1.521q.021.187.021.364V10q0 .146-.01.333-.011.188-.011.396l1.958 1.5-1.979 3.438-2.312-.979q-.292.208-.615.395-.323.188-.614.334l-.313 2.5Zm1.937-5.355q1.063 0 1.813-.75t.75-1.812q0-1.062-.75-1.812t-1.813-.75q-1.041 0-1.802.75-.76.75-.76 1.812t.76 1.812q.761.75 1.802.75Zm0-1.333q-.5 0-.864-.364-.365-.365-.365-.865t.365-.865q.364-.364.864-.364t.865.364q.365.365.365.865t-.365.865q-.365.364-.865.364ZM10.021 10Zm-.854 6.583h1.666l.25-2.187q.605-.167 1.136-.49.531-.323 1.031-.802l2.021.875.854-1.375-1.792-1.354q.105-.333.136-.635.031-.303.031-.615 0-.292-.031-.573-.031-.281-.115-.635l1.792-1.396-.834-1.375-2.062.875q-.438-.438-1.021-.781-.583-.344-1.125-.49l-.271-2.208H9.167l-.271 2.208q-.584.146-1.125.458-.542.313-1.042.792l-2.021-.854-.833 1.375 1.75 1.354q-.083.333-.125.646-.042.312-.042.604t.042.594q.042.302.125.635l-1.75 1.375.833 1.375 2.021-.854q.479.458 1.021.771.542.312 1.146.479Z"/></svg>';var y='<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" fill="#00000089"><path d="M2 12C2 6.48 6.48 2 12 2s10 4.48 10 10-4.48 10-10 10S2 17.52 2 12zm10 6c3.31 0 6-2.69 6-6s-2.69-6-6-6-6 2.69-6 6 2.69 6 6 6z"></path></svg>';var q='<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" fill="#00000089"><path d="M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z"></path></svg>';var R='<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" fill="#00000089"><path d="m18 7-1.41-1.41-6.34 6.34 1.41 1.41L18 7zm4.24-1.41L11.66 16.17 7.48 12l-1.41 1.41L11.66 19l12-12-1.42-1.41zM.41 13.41 6 19l1.41-1.41L1.83 12 .41 13.41z"></path></svg>';var z='<svg xmlns="http://www.w3.org/2000/svg" fill="#ffffff" viewBox="0 0 24 24" strokeWidth={1.5} stroke="currentColor"><path strokeLinecap="round" strokeLinejoin="round" d="M12 9v6m3-3H9m12 0a9 9 0 11-18 0 9 9 0 0118 0z" /></svg>';var E='<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path 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>';var k='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path fill-rule="evenodd" d="M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12zm13.36-1.814a.75.75 0 10-1.22-.872l-3.236 4.53L9.53 12.22a.75.75 0 00-1.06 1.06l2.25 2.25a.75.75 0 001.14-.094l3.75-5.25z" clip-rule="evenodd" /></svg>';var I='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M1.5 8.67v8.58a3 3 0 003 3h15a3 3 0 003-3V8.67l-8.928 5.493a3 3 0 01-3.144 0L1.5 8.67z" /><path d="M22.5 6.908V6.75a3 3 0 00-3-3h-15a3 3 0 00-3 3v.158l9.714 5.978a1.5 1.5 0 001.572 0L22.5 6.908z" /></svg>';var L=e("verdocs_template_recipients",function(){function e(e){t(this,e);this.cancel=r(this,"cancel",7);this.sdkError=r(this,"sdkError",7);this.sequences=[];this.endpoint=p.getDefault();this.templateId="";this.showingRoleDialog=null;this.showingSenderDialog=false;this.sender=null;this.forceRerender=1}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,r,o,n,i,s,a;return __generator(this,(function(l){switch(l.label){case 0:l.trys.push([0,5,,6]);this.endpoint.loadSession();if(!this.templateId){console.log("[RECIPIENTS] Missing required template ID ".concat(this.templateId));return[2]}if(!this.endpoint.session){console.log("[RECIPIENTS] Unable to start builder session, must be authenticated");return[2]}l.label=1;case 1:l.trys.push([1,3,,4]);console.log("[RECIPIENTS] Loading template ".concat(this.templateId),this.endpoint.session);return[4,m(this.endpoint,this.templateId)];case 2:l.sent();return[3,4];case 3:s=l.sent();console.log("[RECIPIENTS] Error loading template",s);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new v(s.message,(t=s.response)===null||t===void 0?void 0:t.status,(r=s.response)===null||r===void 0?void 0:r.data));return[3,4];case 4:this.sortTemplateRoles();this.renumberTemplateRoles();return[3,6];case 5:a=l.sent();console.log("[FIELDS] Error with preview session",a);(o=this.sdkError)===null||o===void 0?void 0:o.emit(new v(a.message,(n=a.response)===null||n===void 0?void 0:n.status,(i=a.response)===null||i===void 0?void 0:i.data));return[3,6];case 6:return[2]}}))}))};e.prototype.componentDidRender=function(){a.dynamicDrop(true);a(".recipient").draggable({listeners:{start:function e(t){t.target.classList.add("dragging");this.el.classList.add("dragging")}.bind(this),move:function e(t){var r=+(t.target.getAttribute("posX")||0);var o=+(t.target.getAttribute("posY")||0);var n=t.dx+r;var i=t.dy+o;t.target.setAttribute("posX",n);t.target.setAttribute("posy",i);t.target.style.transform="translate(".concat(n+100,"px, ").concat(i-40,"px)")}.bind(this),end:function e(t){t.target.classList.remove("dragging");this.el.classList.remove("dragging");t.target.setAttribute("posX",0);t.target.setAttribute("posy",0);t.target.style.transform="translate(0px, 0px)"}.bind(this)}});a(".dropzone").dropzone({overlap:.05,ondrop:function e(t){var r=this;t.target.classList.remove("active");var o=t.relatedTarget.dataset.rolename;var n=+t.target.dataset.sequence;var i=+t.target.dataset.order;var s=f.template.roles.find((function(e){return e.name===o}));if(s){s.sequence=n;s.order=i;this.sortTemplateRoles();this.renumberTemplateRoles();this.forceRerender++;Promise.all(f.template.roles.map((function(e){return l(r.endpoint,r.templateId,e.name,{sequence:e.sequence,order:e.order})}))).then((function(){return console.log("[RECIPIENTS] Updated roles")})).catch((function(e){return console.log("[RECIPIENTS] Role updates failed",e)}))}}.bind(this),ondropactivate:function(e){e.target.classList.add("visible")},ondropdeactivate:function(e){e.target.classList.remove("visible")},ondragenter:function(e){e.target.classList.add("active")},ondragleave:function(e){e.target.classList.remove("active")}})};e.prototype.handleCancel=function(e){var t;e.stopPropagation();(t=this.cancel)===null||t===void 0?void 0:t.emit()};e.prototype.handleSubmit=function(e){e.stopPropagation()};e.prototype.sortTemplateRoles=function(){f.template.roles.sort((function(e,t){return e.sequence===t.sequence?e.order-t.order:e.sequence-t.sequence}))};e.prototype.extractSequenceNumbers=function(){var e=this;this.sequences=[];f.template.roles.forEach((function(t){if(!e.sequences.includes(t.sequence)){e.sequences.push(t.sequence)}}))};e.prototype.renumberTemplateRoles=function(){this.extractSequenceNumbers();var e=[];this.sequences.sort((function(e,t){return e-t}));this.sequences.forEach((function(t,r){f.template.roles.filter((function(e){return e.sequence===t})).forEach((function(t,o){if(!e.includes(t.name)){t.sequence=r+1;t.order=o+1;e.push(t.name)}}))}));this.extractSequenceNumbers()};e.prototype.handleAddRole=function(e,t){var r=this;e.stopPropagation();var o=f.template.roles.filter((function(e){return e.sequence===t})).length+1;var n="";var i=f.template.roles.length;do{i++;n="Recipient ".concat(i)}while(!n||f.template.roles.some((function(e){return e.name===n})));console.log("Will create",n,t,o);c(this.endpoint,this.templateId,{template_id:this.templateId,name:n,full_name:"",email:"",phone:"",sequence:t,order:o,type:"signer",delegator:false}).then((function(e){console.log("Created role",e);f.template.roles.push(e);r.renumberTemplateRoles();r.forceRerender++})).catch((function(e){console.log("Error creating role",e)}))};e.prototype.render=function(){var e=this;var t=f.template.roles.map((function(e){return e.name}));return o(i,null,o("form",{onSubmit:function(e){return e.preventDefault()},onClick:function(e){return e.stopPropagation()},autocomplete:"off","data-r":this.forceRerender},o("h5",null,"Recipients"),o("div",{class:"participants"},o("div",{class:"left-line"}),o("div",{class:"row"},o("div",{class:"icon",innerHTML:y}),o("div",{class:"row-recipients"},o("div",{class:"sender"},o("span",{class:"label"},"Sender:")," ",b[f.template.sender]," ",o("div",{class:"settings-button",innerHTML:w,onClick:function(){return e.showingSenderDialog=true},"aria-role":"button"})))),o("div",{class:"row add-sequence","data-sequence":0},o("div",{class:"icon",innerHTML:z}),o("div",{class:"row-recipients"},o("div",{class:"dropzone","data-sequence":0,"data-order":1},"Add Step"))),this.sequences.map((function(r){return o(n,null,o("div",{class:"row"},o("div",{class:"icon",innerHTML:q}),o("div",{class:"row-recipients"},o("div",{class:"dropzone","data-order":.5,"data-sequence":r}),f.template.roles.filter((function(e){return e.sequence===r})).map((function(i){return o(n,null,o("div",{class:"recipient",style:{backgroundColor:u(g(t,i.name))},"data-rolename":i.name},o("span",{class:"type-icon",innerHTML:i.type==="signer"?E:i.type==="cc"?I:k}),i.name," ",o("div",{class:"settings-button",innerHTML:w,onClick:function(){return e.showingRoleDialog=i.name},"aria-role":"button"})),o("div",{class:"dropzone","data-order":i.order+.5,"data-sequence":r}))})),o("button",{class:"add-role",innerHTML:z,onClick:function(t){return e.handleAddRole(t,r)}}))),o("div",{class:"row add-sequence","data-sequence":r},o("div",{class:"row-recipients"},o("div",{class:"icon",innerHTML:z}),o("div",{class:"dropzone","data-sequence":r+1,"data-order":1},"Add Step"))))})),o("div",{class:"row"},o("div",{class:"icon",innerHTML:R}),o("div",{class:"row-recipients"},o("div",{class:"complete"},"Document Complete")))),o("div",{class:"buttons"},o("div",{class:"flex-fill"}),o("verdocs-button",{variant:"outline",label:"Cancel",size:"small",onClick:function(t){return e.handleCancel(t)}}),o("verdocs-button",{label:"OK",size:"small",onClick:function(t){return e.handleSubmit(t)}}))),this.showingRoleDialog&&o("verdocs-template-role-properties",{endpoint:this.endpoint,templateId:this.templateId,roleName:this.showingRoleDialog,onClose:function(){e.showingRoleDialog=null;e.forceRerender++},onDelete:function(t){console.log("deleted",t.detail);e.renumberTemplateRoles();e.showingRoleDialog=null;e.forceRerender++}}),this.showingSenderDialog&&o("verdocs-template-sender",{endpoint:this.endpoint,templateId:this.templateId,onClose:function(){return e.showingSenderDialog=false}}))};Object.defineProperty(e.prototype,"el",{get:function(){return s(this)},enumerable:false,configurable:true});return e}());L.style=x}}}));
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e,c as i,h as t,F as o,H as s,a as r}from"./p-ff1278ed.js";import{i as a}from"./p-4f12a8a7.js";import{u as l,c as n}from"./p-ffe60abd.js";import{V as p,T as d}from"./p-2d4712ea.js";import{g as c}from"./p-6de76553.js";import{s as m}from"./p-3cb8a7f4.js";import{l as f}from"./p-d1393a1a.js";import{a as h}from"./p-d6e07c20.js";import{S as x}from"./p-7a1b2643.js";import"./p-21603661.js";import"./p-5ea05a1d.js";import"./p-7291906c.js";import"./p-b28ef4bb.js";import"./p-880b619d.js";import"./p-aa124212.js";const v={[d.EVERYONE]:"Everyone",[d.EVERYONE_AS_CREATOR]:"Everyone as Me",[d.ORGANIZATION_MEMBER]:"Organization member",[d.ORGANIZATION_MEMBER_AS_CREATOR]:"Organization Member as Me",[d.CREATOR]:"Me"},g='<svg xmlns="http://www.w3.org/2000/svg" height="20" width="20" fill="#00000089"><path d="m8.021 17.917-.313-2.5q-.27-.125-.625-.334-.354-.208-.625-.395l-2.312.979-1.979-3.438 1.979-1.5q-.021-.167-.031-.364-.011-.198-.011-.365 0-.146.011-.344.01-.198.031-.385l-1.979-1.5 1.979-3.417 2.312.958q.271-.187.615-.385t.635-.344l.313-2.5h3.958l.313 2.5q.312.167.625.344.312.177.604.385l2.333-.958 1.979 3.417-1.979 1.521q.021.187.021.364V10q0 .146-.01.333-.011.188-.011.396l1.958 1.5-1.979 3.438-2.312-.979q-.292.208-.615.395-.323.188-.614.334l-.313 2.5Zm1.937-5.355q1.063 0 1.813-.75t.75-1.812q0-1.062-.75-1.812t-1.813-.75q-1.041 0-1.802.75-.76.75-.76 1.812t.76 1.812q.761.75 1.802.75Zm0-1.333q-.5 0-.864-.364-.365-.365-.365-.865t.365-.865q.364-.364.864-.364t.865.364q.365.365.365.865t-.365.865q-.365.364-.865.364ZM10.021 10Zm-.854 6.583h1.666l.25-2.187q.605-.167 1.136-.49.531-.323 1.031-.802l2.021.875.854-1.375-1.792-1.354q.105-.333.136-.635.031-.303.031-.615 0-.292-.031-.573-.031-.281-.115-.635l1.792-1.396-.834-1.375-2.062.875q-.438-.438-1.021-.781-.583-.344-1.125-.49l-.271-2.208H9.167l-.271 2.208q-.584.146-1.125.458-.542.313-1.042.792l-2.021-.854-.833 1.375 1.75 1.354q-.083.333-.125.646-.042.312-.042.604t.042.594q.042.302.125.635l-1.75 1.375.833 1.375 2.021-.854q.479.458 1.021.771.542.312 1.146.479Z"/></svg>',u='<svg xmlns="http://www.w3.org/2000/svg" fill="#ffffff" viewBox="0 0 24 24" strokeWidth={1.5} stroke="currentColor"><path strokeLinecap="round" strokeLinejoin="round" d="M12 9v6m3-3H9m12 0a9 9 0 11-18 0 9 9 0 0118 0z" /></svg>',b=class{constructor(t){e(this,t),this.cancel=i(this,"cancel",7),this.sdkError=i(this,"sdkError",7),this.sequences=[],this.endpoint=p.getDefault(),this.templateId="",this.showingRoleDialog=null,this.showingSenderDialog=!1,this.sender=null,this.forceRerender=1}async componentWillLoad(){var e,i,t,o,s,r;try{if(this.endpoint.loadSession(),!this.templateId)return void console.log(`[RECIPIENTS] Missing required template ID ${this.templateId}`);if(!this.endpoint.session)return void console.log("[RECIPIENTS] Unable to start builder session, must be authenticated");try{console.log(`[RECIPIENTS] Loading template ${this.templateId}`,this.endpoint.session),await f(this.endpoint,this.templateId)}catch(o){console.log("[RECIPIENTS] Error loading template",o),null===(e=this.sdkError)||void 0===e||e.emit(new x(o.message,null===(i=o.response)||void 0===i?void 0:i.status,null===(t=o.response)||void 0===t?void 0:t.data))}this.sortTemplateRoles(),this.renumberTemplateRoles()}catch(e){console.log("[FIELDS] Error with preview session",e),null===(o=this.sdkError)||void 0===o||o.emit(new x(e.message,null===(s=e.response)||void 0===s?void 0:s.status,null===(r=e.response)||void 0===r?void 0:r.data))}}componentDidRender(){a.dynamicDrop(!0),a(".recipient").draggable({listeners:{start:function(e){e.target.classList.add("dragging"),this.el.classList.add("dragging")}.bind(this),move:function(e){const i=+(e.target.getAttribute("posX")||0),t=+(e.target.getAttribute("posY")||0),o=e.dx+i,s=e.dy+t;e.target.setAttribute("posX",o),e.target.setAttribute("posy",s),e.target.style.transform=`translate(${o+100}px, ${s-40}px)`}.bind(this),end:function(e){e.target.classList.remove("dragging"),this.el.classList.remove("dragging"),e.target.setAttribute("posX",0),e.target.setAttribute("posy",0),e.target.style.transform="translate(0px, 0px)"}.bind(this)}}),a(".dropzone").dropzone({overlap:.05,ondrop:function(e){e.target.classList.remove("active");const i=e.relatedTarget.dataset.rolename,t=+e.target.dataset.sequence,o=+e.target.dataset.order,s=m.template.roles.find((e=>e.name===i));s&&(s.sequence=t,s.order=o,this.sortTemplateRoles(),this.renumberTemplateRoles(),this.forceRerender++,Promise.all(m.template.roles.map((e=>l(this.endpoint,this.templateId,e.name,{sequence:e.sequence,order:e.order})))).then((()=>console.log("[RECIPIENTS] Updated roles"))).catch((e=>console.log("[RECIPIENTS] Role updates failed",e))))}.bind(this),ondropactivate:e=>{e.target.classList.add("visible")},ondropdeactivate:e=>{e.target.classList.remove("visible")},ondragenter:e=>{e.target.classList.add("active")},ondragleave:e=>{e.target.classList.remove("active")}})}handleCancel(e){var i;e.stopPropagation(),null===(i=this.cancel)||void 0===i||i.emit()}handleSubmit(e){e.stopPropagation()}sortTemplateRoles(){m.template.roles.sort(((e,i)=>e.sequence===i.sequence?e.order-i.order:e.sequence-i.sequence))}extractSequenceNumbers(){this.sequences=[],m.template.roles.forEach((e=>{this.sequences.includes(e.sequence)||this.sequences.push(e.sequence)}))}renumberTemplateRoles(){this.extractSequenceNumbers();const e=[];this.sequences.sort(((e,i)=>e-i)),this.sequences.forEach(((i,t)=>{m.template.roles.filter((e=>e.sequence===i)).forEach(((i,o)=>{e.includes(i.name)||(i.sequence=t+1,i.order=o+1,e.push(i.name))}))})),this.extractSequenceNumbers()}handleAddRole(e,i){e.stopPropagation();const t=m.template.roles.filter((e=>e.sequence===i)).length+1;let o="",s=m.template.roles.length;do{s++,o=`Recipient ${s}`}while(!o||m.template.roles.some((e=>e.name===o)));console.log("Will create",o,i,t),n(this.endpoint,this.templateId,{template_id:this.templateId,name:o,full_name:"",email:"",phone:"",sequence:i,order:t,type:"signer",delegator:!1}).then((e=>{console.log("Created role",e),m.template.roles.push(e),this.renumberTemplateRoles(),this.forceRerender++})).catch((e=>{console.log("Error creating role",e)}))}render(){const e=m.template.roles.map((e=>e.name));return t(s,null,t("form",{onSubmit:e=>e.preventDefault(),onClick:e=>e.stopPropagation(),autocomplete:"off","data-r":this.forceRerender},t("h5",null,"Recipients"),t("div",{class:"participants"},t("div",{class:"left-line"}),t("div",{class:"row"},t("div",{class:"icon",innerHTML:'<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" fill="#00000089"><path d="M2 12C2 6.48 6.48 2 12 2s10 4.48 10 10-4.48 10-10 10S2 17.52 2 12zm10 6c3.31 0 6-2.69 6-6s-2.69-6-6-6-6 2.69-6 6 2.69 6 6 6z"></path></svg>'}),t("div",{class:"row-recipients"},t("div",{class:"sender"},t("span",{class:"label"},"Sender:")," ",v[m.template.sender]," ",t("div",{class:"settings-button",innerHTML:g,onClick:()=>this.showingSenderDialog=!0,"aria-role":"button"})))),t("div",{class:"row add-sequence","data-sequence":0},t("div",{class:"icon",innerHTML:u}),t("div",{class:"row-recipients"},t("div",{class:"dropzone","data-sequence":0,"data-order":1},"Add Step"))),this.sequences.map((i=>t(o,null,t("div",{class:"row"},t("div",{class:"icon",innerHTML:'<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" fill="#00000089"><path d="M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z"></path></svg>'}),t("div",{class:"row-recipients"},t("div",{class:"dropzone","data-order":.5,"data-sequence":i}),m.template.roles.filter((e=>e.sequence===i)).map((s=>t(o,null,t("div",{class:"recipient",style:{backgroundColor:c(h(e,s.name))},"data-rolename":s.name},t("span",{class:"type-icon",innerHTML:"signer"===s.type?'<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path 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>':"cc"===s.type?'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M1.5 8.67v8.58a3 3 0 003 3h15a3 3 0 003-3V8.67l-8.928 5.493a3 3 0 01-3.144 0L1.5 8.67z" /><path d="M22.5 6.908V6.75a3 3 0 00-3-3h-15a3 3 0 00-3 3v.158l9.714 5.978a1.5 1.5 0 001.572 0L22.5 6.908z" /></svg>':'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path fill-rule="evenodd" d="M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12zm13.36-1.814a.75.75 0 10-1.22-.872l-3.236 4.53L9.53 12.22a.75.75 0 00-1.06 1.06l2.25 2.25a.75.75 0 001.14-.094l3.75-5.25z" clip-rule="evenodd" /></svg>'}),s.name," ",t("div",{class:"settings-button",innerHTML:g,onClick:()=>this.showingRoleDialog=s.name,"aria-role":"button"})),t("div",{class:"dropzone","data-order":s.order+.5,"data-sequence":i})))),t("button",{class:"add-role",innerHTML:u,onClick:e=>this.handleAddRole(e,i)}))),t("div",{class:"row add-sequence","data-sequence":i},t("div",{class:"row-recipients"},t("div",{class:"icon",innerHTML:u}),t("div",{class:"dropzone","data-sequence":i+1,"data-order":1},"Add Step")))))),t("div",{class:"row"},t("div",{class:"icon",innerHTML:'<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" fill="#00000089"><path d="m18 7-1.41-1.41-6.34 6.34 1.41 1.41L18 7zm4.24-1.41L11.66 16.17 7.48 12l-1.41 1.41L11.66 19l12-12-1.42-1.41zM.41 13.41 6 19l1.41-1.41L1.83 12 .41 13.41z"></path></svg>'}),t("div",{class:"row-recipients"},t("div",{class:"complete"},"Document Complete")))),t("div",{class:"buttons"},t("div",{class:"flex-fill"}),t("verdocs-button",{variant:"outline",label:"Cancel",size:"small",onClick:e=>this.handleCancel(e)}),t("verdocs-button",{label:"OK",size:"small",onClick:e=>this.handleSubmit(e)}))),this.showingRoleDialog&&t("verdocs-template-role-properties",{endpoint:this.endpoint,templateId:this.templateId,roleName:this.showingRoleDialog,onClose:()=>{this.showingRoleDialog=null,this.forceRerender++},onDelete:e=>{console.log("deleted",e.detail),this.renumberTemplateRoles(),this.showingRoleDialog=null,this.forceRerender++}}),this.showingSenderDialog&&t("verdocs-template-sender",{endpoint:this.endpoint,templateId:this.templateId,onClose:()=>this.showingSenderDialog=!1}))}get el(){return r(this)}};b.style='verdocs-template-recipients{display:block;min-width:400px;font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-template-recipients>form{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;background-color:#ffffff;padding:12px}verdocs-template-recipients>form h5{font-size:16px;font-weight:bold;color:#4c56cb;margin:0 0 10px 0}verdocs-template-recipients>form .participants{position:relative}verdocs-template-recipients>form .left-line{top:32px;left:11px;z-index:1;width:12px;bottom:30px;position:absolute;background:#ffffff;border-left:3px dotted #9b9b9b}verdocs-template-recipients>form .row{display:-ms-flexbox;display:flex;-webkit-column-gap:0;-moz-column-gap:0;column-gap:0;margin-left:40px;position:relative;-ms-flex-direction:row;flex-direction:row;padding:6px 0 4px 0}verdocs-template-recipients>form .row .row-recipients{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex;-webkit-column-gap:10px;-moz-column-gap:10px;column-gap:10px;-ms-flex-direction:row;flex-direction:row}verdocs-template-recipients>form .row .icon{top:14px;z-index:2;left:-40px;width:24px;height:24px;position:absolute;background:#ffffff}verdocs-template-recipients>form .row .sender{height:30px;display:-ms-flexbox;display:flex;font-size:14px;padding:0 5px 0 15px;line-height:30px;-ms-flex-direction:row;flex-direction:row;border-radius:30px;border:1px solid #c6c9cc;background-color:#f5f5fa}verdocs-template-recipients>form .row .complete{height:30px;display:-ms-flexbox;display:flex;font-size:14px;padding:0 15px;line-height:30px;-ms-flex-direction:row;flex-direction:row;border-radius:30px;background-color:#f5f5fa;border:1px solid #aeb4bf}verdocs-template-recipients>form .row .label{font-weight:bold;margin-right:6px;color:#33364b}verdocs-template-recipients>form .row .settings-button{margin:4px 0 0 9px;cursor:pointer}verdocs-template-recipients>form .row .recipient{height:30px;display:-ms-flexbox;display:flex;font-size:14px;line-height:30px;border-radius:30px;-ms-flex-direction:row;flex-direction:row;padding:0 5px 0 6px;white-space:nowrap;border:1px solid #aeb4bf}verdocs-template-recipients>form .row .recipient .type-icon{width:24px;height:24px;-webkit-transform:scale(0.8);transform:scale(0.8);opacity:0.6;margin:4px 12px 0 0}verdocs-template-recipients>form .row .recipient.dragging{position:absolute}verdocs-template-recipients>form .row .recipient.dragging+.dropzone{display:none !important}verdocs-template-recipients>form .row .dropzone{width:14px;height:30px;display:none}verdocs-template-recipients>form .row .dropzone svg{fill:#cccccc}verdocs-template-recipients>form .row .dropzone.visible{margin:0 7px;display:-ms-flexbox;display:flex;-ms-flex:0 0 14px;flex:0 0 14px}verdocs-template-recipients>form .row .dropzone.active{-ms-flex:0 0 120px;flex:0 0 120px;border-radius:30px;background:#654dcb7f;border:1px dashed #654dcb}verdocs-template-recipients>form label{display:block;font-size:14px;font-weight:500;margin:0 0 4px 0;color:#5c6575}verdocs-template-recipients>form input{border:none;font-size:18px;padding:3px 6px 3px 0;background:transparent;border-bottom:1px solid #33364b}verdocs-template-recipients>form input:focus{outline:none}verdocs-template-recipients .row.add-sequence{display:none}verdocs-template-recipients .add-role{margin:0;padding:0;border:none;opacity:0.5;cursor:pointer;background:none}verdocs-template-recipients .add-role:hover{opacity:1}verdocs-template-recipients .add-role svg{width:32px;height:32px}verdocs-template-recipients.dragging .add-role{display:none}verdocs-template-recipients.dragging form .row .recipient+.dropzone{display:-ms-flexbox;display:flex}verdocs-template-recipients.dragging .row.add-sequence{display:-ms-flexbox;display:flex}verdocs-template-recipients.dragging .row.add-sequence .dropzone{opacity:0.5;-ms-flex:0 0 120px;flex:0 0 120px;border-radius:30px;-ms-flex-align:center;align-items:center;background:#654dcb7f;-ms-flex-pack:center;justify-content:center;border:1px dashed #654dcb}verdocs-template-recipients.dragging .row.add-sequence .dropzone.active{opacity:1}verdocs-template-recipients .buttons{display:-ms-flexbox;display:flex;-webkit-column-gap:8px;-moz-column-gap:8px;column-gap:8px;margin-top:16px;-ms-flex-direction:row;flex-direction:row}verdocs-template-recipients ::-webkit-input-placeholder{color:#aaaaaa}verdocs-template-recipients ::-moz-placeholder{color:#aaaaaa}verdocs-template-recipients :-ms-input-placeholder{color:#aaaaaa}verdocs-template-recipients ::-ms-input-placeholder{color:#aaaaaa}verdocs-template-recipients ::placeholder{color:#aaaaaa}';export{b as verdocs_template_recipients}
|