legalesign-document-viewer 0.9.0 → 0.9.2
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/ls-compose-loader_46.cjs.entry.js +93 -37
- package/dist/collection/components/ls-document-viewer/adapter/LsDocumentAdapter.js +1 -0
- package/dist/collection/components/ls-document-viewer/adapter/LsDocumentAdapter.js.map +1 -1
- package/dist/collection/components/ls-document-viewer/adapter/roleActions.js +1 -1
- package/dist/collection/components/ls-document-viewer/adapter/roleActions.js.map +1 -1
- package/dist/collection/components/ls-document-viewer/editorCalculator.js +0 -1
- package/dist/collection/components/ls-document-viewer/editorCalculator.js.map +1 -1
- package/dist/collection/components/ls-document-viewer/editorUtils.js +0 -11
- package/dist/collection/components/ls-document-viewer/editorUtils.js.map +1 -1
- package/dist/collection/components/ls-document-viewer/generateRoles.js +78 -0
- package/dist/collection/components/ls-document-viewer/generateRoles.js.map +1 -0
- package/dist/collection/components/ls-document-viewer/ls-document-viewer.js +5 -19
- package/dist/collection/components/ls-document-viewer/ls-document-viewer.js.map +1 -1
- package/dist/collection/components/ls-document-viewer/validator.js +0 -1
- package/dist/collection/components/ls-document-viewer/validator.js.map +1 -1
- package/dist/collection/components/ls-participant-card/ls-participant-card.js +2 -2
- package/dist/collection/components/ls-recipient-card/ls-recipient-card.js +1 -1
- package/dist/collection/components/ls-recipient-card/ls-recipient-card.js.map +1 -1
- package/dist/collection/components/ls-toolbox-field/ls-toolbox-field.js +13 -5
- package/dist/collection/components/ls-toolbox-field/ls-toolbox-field.js.map +1 -1
- package/dist/collection/types/LSApiRole.js.map +1 -1
- package/dist/components/ls-document-viewer.js +97 -36
- package/dist/components/ls-document-viewer.js.map +1 -1
- package/dist/components/ls-editor-field.js +1 -1
- package/dist/components/ls-field-content.js +1 -1
- package/dist/components/ls-field-distribute.js +1 -1
- package/dist/components/ls-field-properties-date.js +1 -1
- package/dist/components/ls-field-properties-dropdown.js +2 -2
- package/dist/components/ls-field-properties-email.js +1 -1
- package/dist/components/ls-field-properties-file.js +1 -1
- package/dist/components/ls-field-properties-general.js +1 -1
- package/dist/components/ls-field-properties-image.js +1 -1
- package/dist/components/ls-field-properties-multiple.js +1 -1
- package/dist/components/ls-field-properties-number.js +1 -1
- package/dist/components/ls-field-properties-signature.js +1 -1
- package/dist/components/ls-field-properties-text.js +1 -1
- package/dist/components/ls-field-properties.js +1 -1
- package/dist/components/ls-recipient-card.js +1 -1
- package/dist/components/ls-toolbox-field.js +1 -1
- package/dist/components/ls-validation-manager.js +1 -1
- package/dist/components/{p-BoD-V4Fi.js → p-BHgpGvUN.js} +4 -4
- package/dist/components/{p-BoD-V4Fi.js.map → p-BHgpGvUN.js.map} +1 -1
- package/dist/components/{p-B8554gGn.js → p-BMRmgOgI.js} +4 -4
- package/dist/components/{p-B8554gGn.js.map → p-BMRmgOgI.js.map} +1 -1
- package/dist/components/{p-D1dPEqzL.js → p-BMwSro4B.js} +14 -14
- package/dist/components/{p-D1dPEqzL.js.map → p-BMwSro4B.js.map} +1 -1
- package/dist/components/{p-CdoAgm8G.js → p-Bei-7c0Z.js} +3 -3
- package/dist/components/{p-CdoAgm8G.js.map → p-Bei-7c0Z.js.map} +1 -1
- package/dist/components/{p-gbOgbKVk.js → p-BiNy7PLs.js} +3 -3
- package/dist/components/{p-gbOgbKVk.js.map → p-BiNy7PLs.js.map} +1 -1
- package/dist/components/{p-B9_9Xdhz.js → p-BrlEg4Qz.js} +4 -4
- package/dist/components/{p-B9_9Xdhz.js.map → p-BrlEg4Qz.js.map} +1 -1
- package/dist/components/{p-DfDiDkjo.js → p-BvP3j_jp.js} +4 -4
- package/dist/components/{p-DfDiDkjo.js.map → p-BvP3j_jp.js.map} +1 -1
- package/dist/components/{p-8upZBxgh.js → p-CnaE4qFc.js} +3 -3
- package/dist/components/{p-8upZBxgh.js.map → p-CnaE4qFc.js.map} +1 -1
- package/dist/components/{p-DzXkIDXC.js → p-CtH0VgS3.js} +4 -4
- package/dist/components/{p-DzXkIDXC.js.map → p-CtH0VgS3.js.map} +1 -1
- package/dist/components/{p-Cuf-AQmR.js → p-CuMBeFTX.js} +3 -16
- package/dist/components/p-CuMBeFTX.js.map +1 -0
- package/dist/components/{p-CA1JS6cZ.js → p-Cz8VqXVw.js} +4 -4
- package/dist/components/{p-CA1JS6cZ.js.map → p-Cz8VqXVw.js.map} +1 -1
- package/dist/components/{p-DGHJ47H0.js → p-DMCjEnha.js} +4 -4
- package/dist/components/{p-DGHJ47H0.js.map → p-DMCjEnha.js.map} +1 -1
- package/dist/components/{p-BMbCmc2K.js → p-DQ6ETldK.js} +4 -4
- package/dist/components/{p-BMbCmc2K.js.map → p-DQ6ETldK.js.map} +1 -1
- package/dist/components/{p-B3aAtRjL.js → p-DcCalxAf.js} +13 -5
- package/dist/components/p-DcCalxAf.js.map +1 -0
- package/dist/components/{p-C86C90jD.js → p-DyKokp9n.js} +4 -4
- package/dist/components/{p-C86C90jD.js.map → p-DyKokp9n.js.map} +1 -1
- package/dist/components/{p-B__FshSU.js → p-KHhsJ0DX.js} +4 -4
- package/dist/components/{p-B__FshSU.js.map → p-KHhsJ0DX.js.map} +1 -1
- package/dist/esm/ls-compose-loader_46.entry.js +93 -37
- package/dist/ls-document-viewer/ls-document-viewer.esm.js +1 -1
- package/dist/ls-document-viewer/{p-238e6dda.entry.js → p-21edae50.entry.js} +594 -594
- package/dist/ls-document-viewer/p-21edae50.entry.js.map +1 -0
- package/dist/types/components/ls-document-viewer/generateRoles.d.ts +1 -0
- package/dist/types/components/ls-toolbox-field/ls-toolbox-field.d.ts +1 -1
- package/dist/types/components.d.ts +2 -2
- package/dist/types/types/LSApiRole.d.ts +1 -1
- package/package.json +1 -1
- package/dist/components/p-B3aAtRjL.js.map +0 -1
- package/dist/components/p-Cuf-AQmR.js.map +0 -1
- package/dist/ls-document-viewer/p-238e6dda.entry.js.map +0 -1
|
@@ -35151,7 +35151,6 @@ function addField(frame, data) {
|
|
|
35151
35151
|
const fields = this._template.elementConnection.templateElements;
|
|
35152
35152
|
this._template = { ...this._template, elementConnection: { ...this._template.elementConnection, templateElements: [...fields, data] } };
|
|
35153
35153
|
const assignee = this.mode === 'compose' ? this._recipients?.find(r => r.signerIndex === data.signer) : this._template.roles.find(r => r.signerIndex === data.signer);
|
|
35154
|
-
console.log(assignee?.previousRecipientDecides);
|
|
35155
35154
|
const node = document.createElement('ls-editor-field');
|
|
35156
35155
|
node.setAttribute('type', data.formElementType);
|
|
35157
35156
|
node.setAttribute('id', 'ls-field-' + data.id);
|
|
@@ -35368,7 +35367,6 @@ function validate(t) {
|
|
|
35368
35367
|
});
|
|
35369
35368
|
}
|
|
35370
35369
|
});
|
|
35371
|
-
console.log('validation errors', errors);
|
|
35372
35370
|
return errors;
|
|
35373
35371
|
}
|
|
35374
35372
|
|
|
@@ -35406,17 +35404,6 @@ function matchData(data) {
|
|
|
35406
35404
|
addField.bind(this)(this.component.shadowRoot.getElementById('ls-document-frame'), { ...data.obj, id });
|
|
35407
35405
|
this.update.emit({ event: { ...data.event, result: data.result }, template: this._template });
|
|
35408
35406
|
this.validationErrors = validate.bind(this)(this._template);
|
|
35409
|
-
// Check for compose mode to generate roles for fields added.
|
|
35410
|
-
if (this.mode === 'compose') {
|
|
35411
|
-
// Compose mode - syncing roles after create
|
|
35412
|
-
if (!this._template.roles.find(r => r.signerIndex === data.obj.signer)) {
|
|
35413
|
-
const recipient = this._recipients.find(r => r?.signerIndex === data.obj.signer);
|
|
35414
|
-
const roleDescription = recipient?.roleType ? recipient?.roleType.toUpperCase() : 'SIGNER';
|
|
35415
|
-
const signerIndex = data.obj.signer;
|
|
35416
|
-
// Role required - generate one
|
|
35417
|
-
this.addParticipant.emit({ signerIndex, name: roleDescription + signerIndex, type: roleDescription });
|
|
35418
|
-
}
|
|
35419
|
-
}
|
|
35420
35407
|
}
|
|
35421
35408
|
}
|
|
35422
35409
|
if (prefix === 'rol') {
|
|
@@ -40029,7 +40016,7 @@ const createRole = (role) => {
|
|
|
40029
40016
|
signerParent: ${newParent}
|
|
40030
40017
|
name: ${JSON.stringify(role.name)}
|
|
40031
40018
|
ordinal: ${role.ordinal}
|
|
40032
|
-
roleType: ${role.roleType
|
|
40019
|
+
roleType: ${role.roleType}
|
|
40033
40020
|
experience: "${role.experience}"
|
|
40034
40021
|
})
|
|
40035
40022
|
}`;
|
|
@@ -40090,6 +40077,7 @@ class LsDocumentAdapter {
|
|
|
40090
40077
|
case 'ele':
|
|
40091
40078
|
switch (event.action) {
|
|
40092
40079
|
case 'create':
|
|
40080
|
+
console.log(obj, event);
|
|
40093
40081
|
query = createElement(recalculateCoordinates(obj));
|
|
40094
40082
|
break;
|
|
40095
40083
|
case 'update':
|
|
@@ -40248,6 +40236,81 @@ const getGroupData = (id) => {
|
|
|
40248
40236
|
`;
|
|
40249
40237
|
};
|
|
40250
40238
|
|
|
40239
|
+
//Generate roles for any role not already present
|
|
40240
|
+
async function generateRoles() {
|
|
40241
|
+
const defaultExperience = this.groupInfo.experienceConnection.experiences.find(x => x.defaultExperience === true);
|
|
40242
|
+
// We have to wait for parent roles to be created first for WITNESS roles
|
|
40243
|
+
const rolePromises = this._recipients
|
|
40244
|
+
.filter(r => r.roleType !== 'WITNESS')
|
|
40245
|
+
.map((rec, index) => {
|
|
40246
|
+
const role = this._template.roles.filter(ro => ro.roleType !== 'WITNESS').find(ro => ro.signerIndex === rec.signerIndex);
|
|
40247
|
+
const roleType = rec?.roleType ? rec?.roleType : 'SIGNER';
|
|
40248
|
+
if (!role || role === undefined) {
|
|
40249
|
+
const newRole = {
|
|
40250
|
+
id: btoa('rol' + crypto.randomUUID()),
|
|
40251
|
+
signerIndex: rec?.signerIndex,
|
|
40252
|
+
name: rec?.lastName || roleType + (index + 1),
|
|
40253
|
+
roleType,
|
|
40254
|
+
ordinal: index + 1,
|
|
40255
|
+
signerParent: null,
|
|
40256
|
+
experience: defaultExperience ? defaultExperience.id : '',
|
|
40257
|
+
templateId: this._template.id,
|
|
40258
|
+
};
|
|
40259
|
+
return this.adapter.execute(this.token, createRole(newRole)).then(result => {
|
|
40260
|
+
this._template.roles = [...this._template.roles, { ...newRole, id: result.createTemplateRole }];
|
|
40261
|
+
});
|
|
40262
|
+
}
|
|
40263
|
+
else if (rec.signerIndex === 1 && rec.roleType !== role.roleType) {
|
|
40264
|
+
// If the detault generated role type has changed, update it
|
|
40265
|
+
this.mutate.emit([
|
|
40266
|
+
{
|
|
40267
|
+
action: 'update',
|
|
40268
|
+
data: { ...role, roleType: rec.roleType },
|
|
40269
|
+
},
|
|
40270
|
+
]);
|
|
40271
|
+
return Promise.resolve();
|
|
40272
|
+
}
|
|
40273
|
+
else {
|
|
40274
|
+
return Promise.resolve();
|
|
40275
|
+
}
|
|
40276
|
+
});
|
|
40277
|
+
await Promise.all(rolePromises);
|
|
40278
|
+
await checkWitness.bind(this)(defaultExperience);
|
|
40279
|
+
syncRoles
|
|
40280
|
+
.bind(this)()
|
|
40281
|
+
.then(() => {
|
|
40282
|
+
this.update.emit({ event: { recipients: this._recipients }, template: this._template });
|
|
40283
|
+
});
|
|
40284
|
+
}
|
|
40285
|
+
// Generate witness roles if needed
|
|
40286
|
+
async function checkWitness(defaultExperience) {
|
|
40287
|
+
const witActions = this._recipients
|
|
40288
|
+
.filter(r => r.roleType === 'WITNESS')
|
|
40289
|
+
.map(wit => {
|
|
40290
|
+
const parent = this._template.roles.find(ro => ro.signerIndex === wit.signerIndex % 100);
|
|
40291
|
+
const role = this._template.roles.find(ro => ro.signerIndex === wit.signerIndex);
|
|
40292
|
+
if (parent && parent !== undefined && (!role || role === undefined)) {
|
|
40293
|
+
const newRole = {
|
|
40294
|
+
id: btoa('rol' + crypto.randomUUID()),
|
|
40295
|
+
signerIndex: wit?.signerIndex,
|
|
40296
|
+
name: wit?.roleType + wit?.signerIndex,
|
|
40297
|
+
roleType: 'WITNESS',
|
|
40298
|
+
ordinal: parent.ordinal + 1,
|
|
40299
|
+
signerParent: parent.id,
|
|
40300
|
+
experience: defaultExperience ? defaultExperience.id : '',
|
|
40301
|
+
templateId: this._template.id,
|
|
40302
|
+
};
|
|
40303
|
+
return this.adapter.execute(this.token, createRole(newRole)).then(result => {
|
|
40304
|
+
this._template.roles = [...this._template.roles, { ...newRole, id: result.createTemplateRole }];
|
|
40305
|
+
});
|
|
40306
|
+
}
|
|
40307
|
+
else {
|
|
40308
|
+
return Promise.resolve();
|
|
40309
|
+
}
|
|
40310
|
+
});
|
|
40311
|
+
await Promise.all(witActions);
|
|
40312
|
+
}
|
|
40313
|
+
|
|
40251
40314
|
const lsDocumentViewerCss = () => `*,*::before,*::after{box-sizing:border-box}*{margin:0}@media (prefers-reduced-motion: no-preference){html{interpolate-size:allow-keywords}}body{line-height:1.5;-webkit-font-smoothing:antialiased}img,picture,video,canvas,svg{display:block;max-width:100%}input,button,textarea,select{font:inherit}p,h1,h2,h3,h4,h5,h6{overflow-wrap:break-word}p{text-wrap:pretty}h1,h2,h3,h4,h5,h6{text-wrap:balance}#root,#__next{isolation:isolate}:host{display:flex;flex-direction:row;width:100vw;height:100vh;margin:0px;padding:0px}.left-slot-wrapper{position:fixed;top:0.375rem;left:0.675rem;z-index:2000}slot{justify-content:center;align-items:center;border-radius:1rem;font-size:0.75rem;font-style:normal;font-weight:500;line-height:1.25rem;width:fit-content;background-color:var(--green-30, #9df5d4);color:var(--green-100, #125241)}.right-slot-wrapper{position:fixed;top:0.375rem;right:0.675rem;z-index:2000}.validation-tag-wrapper{position:fixed;top:0.375rem;right:0.375rem;z-index:2000}#my-field-panel{position:relative;height:calc(100% - 4.313rem)}.leftBox{position:relative;border-radius:1rem;border:1px solid var(--gray-30, #edeff2);background:var(--white, #fff);box-shadow:0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);width:21.25rem;margin:1rem;min-width:21.25rem;max-height:100%;z-index:1000;left:0;top:0}.left-box-inner{position:relative;display:flex;height:100%;padding:0.75rem;gap:0.75rem}.rightBox{border:1px gray solid;width:29.375rem;min-width:24.375rem;padding:0.25rem;font-family:inherit}.toolbox{display:flex;flex-direction:column;width:100%;height:100%;border-radius:0.5rem;border:1px solid var(--gray-30, #e0e2e5);background:var(--gray-10, #f7f8fa);padding:0.75rem;gap:1rem;overflow-y:auto}.compose-toolbox{display:flex;flex-direction:column;width:100%;height:100%;overflow:none;border-radius:0;border:none;background:white;padding:0.25rem}.custom-loader-slot{position:absolute;top:0;left:0;height:100%;width:100%;z-index:3999}.recipients-box{position:relative;display:flex;flex-direction:column;gap:0.75rem;overflow-y:auto;padding:0.75rem 0.25rem 0.25rem 0.25rem;height:100%}.scroll-gradient-top{position:absolute;top:5.9375rem;left:0;width:100%;height:1rem;background:linear-gradient(to bottom, white, rgba(255, 255, 255, 0));pointer-events:none;z-index:100}.scroll-gradient-bottom{position:absolute;bottom:1rem;left:0.75rem;width:calc(100% - 1.5rem);height:1rem;background:linear-gradient(to top, white, rgba(255, 255, 255, 0));pointer-events:none;z-index:100}.ls-editor-infobox{padding:0.125rem 0.5rem 0.125rem 0.5rem}#pdf-canvas{top:0px;left:0px;width:6.25rem;height:6.25rem;box-shadow:0 0.5rem 2rem 0 rgba(0, 0, 0, 0.12)}#ls-mid-area{position:absolute;top:0;left:0;display:flex;flex-direction:column;align-items:center;width:100vw;height:100%}.document-frame-wrapper{display:flex;flex-direction:column;justify-content:start;align-items:start;overflow:visible;max-height:100%;width:100vw;overflow:scroll;padding:5rem 23.75rem 2rem 23.75rem}#ls-document-frame{position:relative;height:98vh;margin-right:auto;margin-left:auto}.prevButton{position:relative;bottom:1.875rem}.nextButton{position:relative;bottom:1.875rem}.fieldBox{z-index:1000}#ls-box-selector{position:absolute;visibility:hidden;background-color:transparent;border:1px rgba(71, 71, 71, 0.716) dashed}#ls-editor-form{display:flex;width:100vw;height:calc(100vh - 2.25rem);position:relative;background:var(--gray-10, #f7f8fa);box-shadow:0 2px 6px 0 rgba(0, 0, 0, 0.04) inset, 0 10px 15px 0 rgba(0, 0, 0, 0.04) inset}.hidden{visibility:hidden;display:none;width:0px}.toolbox-section-title{color:var(--gray-100, #45484d);font-size:1.125rem;font-style:normal;font-weight:500;line-height:1.75rem;}.toolbox-section-description{color:var(--gray-80, #5e6066);font-size:0.75rem;font-style:normal;font-weight:400;line-height:1rem}.fields-box{display:flex;flex-direction:column;gap:0.75rem}.page-header{display:flex;height:2.25rem;gap:0.5rem;padding:0.25rem 0.75rem;justify-content:center;align-items:center}.header-text-1{color:var(--gray-100, #45484d);font-size:0.875rem;font-style:normal;font-weight:500;line-height:1.25rem}.header-text-2{color:var(--gray-100, #45484d);font-size:0.875rem;font-style:normal;font-weight:400;line-height:1.25rem}.properties-header{display:flex;padding:1rem;gap:0.75rem;align-items:center;border-bottom:1px solid var(--gray-20, #edeff2)}.properties-header-title{color:var(--gray-100, #45484d);width:100%;font-size:1.5rem;font-style:normal;font-weight:500;line-height:2rem;}.properties-header-icon{display:flex;padding:0.5rem;border-radius:0.625rem;background:var(--primary-10, #eff4ff);color:var(--primary-60, #4456f6)}.expand-fields-row{display:flex;align-items:center;gap:0.5rem;padding:0.5rem;cursor:pointer;color:var(--gray-80, #6c6e73);font-size:0.875rem;font-style:normal;font-weight:500;line-height:1.25rem;}.expand-fields-row p{color:var(--gray-100, #45484d);font-size:1rem;font-style:normal;font-weight:500;line-height:1.5rem;}p{color:var(--gray-80, #6c6e73);font-family:var(--font-family);font-size:var(--text-sm);font-style:normal;font-weight:400;line-height:var(--text-sm-line-height)}a{color:var(--primary-60, #4456f6);font-size:var(--text-sm);font-style:normal;font-weight:400;line-height:var(--text-sm-line-height);cursor:pointer}a:hover{text-decoration:underline;color:var(--primary-70, #2134dc)}.button-link,.button-link:hover{all:unset}select{appearance:none;height:2.25rem}.input-wrapper{position:relative;width:fit-content}#selectorIcon{position:absolute;top:50%;right:0.675rem;transform:translateY(-50%);pointer-events:none;color:var(--gray-80, #6c6e73)}#selectLeadingIcon{position:absolute;top:50%;left:0.675rem;transform:translateY(-50%);pointer-events:none;color:var(--gray-80, #6c6e73)}.has-leading-icon{padding-left:2.5rem}input,select,textarea{border:1px solid var(--gray-40, #d8d9dc);box-shadow:0 1px 0.125rem rgba(0, 0, 0, 0.05);padding:0.5rem 0.75rem;font-family:var(--font-family);font-size:var(--text-sm);border-radius:0.5rem;color:var(--gray-100, #45484d);font-weight:400}input::placeholder,select::placeholder,textarea::placeholder{color:var(--gray-60, #afb0b2)}input:hover,select:hover,textarea:hover{border-color:var(--gray-50, #c8c9cc);background-color:var(--white, #fff)}input:focus,select:focus,textarea:focus{outline:none;box-shadow:0 0 0 0.25rem var(--primary-40, #79adfc);border-color:var(--primary-60, #4456f6);background-color:var(--white, #fff)}input:active,select:active,textarea:active{border-color:var(--primary-50, #5185ff)}input:disabled,select:disabled,textarea:disabled{cursor:not-allowed;background-color:var(--gray-10, #f7f8fa)}input[type='checkbox']{appearance:none;position:relative;height:1rem;width:1rem;padding:0.25rem;border-radius:var(--radius-sm);border:1px solid #d1d5db;background-color:#ffffff;cursor:pointer}input[type='checkbox']:checked,input[type='checkbox'].indeterminate{background-color:var(--primary-60, #4456f6);border:none}input[type='checkbox']:checked::after{content:'';position:absolute;top:45%;left:50%;transform:translate(-50%, -50%) rotate(-45deg) scale(-1, 1);width:0.5rem;height:0.25rem;border-bottom:0.125rem solid white;border-right:0.125rem solid white}input[type='checkbox'].indeterminate::after{content:'';position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);width:0.5rem;height:0.125rem;background-color:white}input[type='checkbox']:checked:hover,input[type='checkbox'].indeterminate:hover{background-color:var(--primary-70, #2134dc);border:none}input[type='checkbox']:hover{border:1px solid #9ca3af}input[type='checkbox']:focus,input[type='checkbox']:active{outline:none;box-shadow:0 0 0 0.25rem var(--primary-20, #c7ddff);background-color:#f0f4f8}input[type='checkbox']:disabled{background-color:#f3f4f6;outline:none;cursor:not-allowed}input[type='checkbox']:disabled:checked{background-color:#e5e7eb;border:none;outline:none;cursor:not-allowed}.checkbox-container{display:flex;gap:0.5rem;width:100%}.checkbox-label{color:var(--gray-100, #45484d);font-size:1rem;font-style:normal;font-weight:400;line-height:1rem}.form-label{color:var(--gray-100, #45484d);font-size:1rem;font-style:normal;font-weight:500;line-height:1.5rem}.form-field{display:flex;flex-direction:column;gap:0.25rem;width:100%}.field-properties-outer{position:relative;height:100%}.loading-box{display:flex;justify-content:center;align-items:center;width:100%;height:100vh;color:var(--primary-60, #0c7cba)}button{border:0;appearance:button;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;border-radius:var(--radius-lg);background-color:var(--primary-60, #4456f6);color:white;text-transform:capitalize;min-height:2.25rem;min-width:2.25rem}button.tertiaryGrey{border:1px solid var(--gray-40, #d8d9dc);background-color:white;color:var(--gray-80, #787a80)}button.tertiaryGrey:hover{border:1px solid var(--gray-50, #c8c9cc);background:var(--gray-10, #f7f8fa)}.button-group{display:flex;border-radius:0.5rem;border:1px solid var(--gray-30, #e0e2e5);background:var(--white, #ffffff);overflow:clip}.button-group button{display:flex;background:transparent;border-radius:unset;padding:0.25rem 0.75rem;min-width:2.156rem;min-height:unset;color:var(--gray-80, #6c6e73)}.button-group button:hover{background:var(--gray-10, #f7f8fa)}.button-group>:first-child{border-radius:0.5rem 0 0 0.5rem}.button-group>:last-child{border-radius:0 0.5rem 0.5rem 0}.button-group>:not(:first-child){border-left:1px solid var(--gray-30, #e0e2e5)}`;
|
|
40252
40315
|
|
|
40253
40316
|
GlobalWorkerOptions.workerSrc = `https://unpkg.com/pdfjs-dist@5.4.449/build/pdf.worker.min.mjs`;
|
|
@@ -40791,23 +40854,8 @@ const LsDocumentViewer = class {
|
|
|
40791
40854
|
// Otherwise, keep original order
|
|
40792
40855
|
return a.signerIndex - b.signerIndex;
|
|
40793
40856
|
});
|
|
40794
|
-
//Generate roles for
|
|
40795
|
-
|
|
40796
|
-
const role = this._template.roles.find(ro => ro.signerIndex === rec.signerIndex);
|
|
40797
|
-
if (!role) {
|
|
40798
|
-
this.addParticipant.emit({
|
|
40799
|
-
signerIndex: rec?.signerIndex,
|
|
40800
|
-
name: 'APPROVER' + rec?.signerIndex,
|
|
40801
|
-
type: 'APPROVER'
|
|
40802
|
-
});
|
|
40803
|
-
}
|
|
40804
|
-
else if (rec.signerIndex === 1 && rec.roleType !== role.roleType) {
|
|
40805
|
-
this.mutate.emit([{
|
|
40806
|
-
action: 'update',
|
|
40807
|
-
data: { ...role, roleType: rec.roleType }
|
|
40808
|
-
}]);
|
|
40809
|
-
}
|
|
40810
|
-
});
|
|
40857
|
+
//Generate roles for any not already present
|
|
40858
|
+
generateRoles.bind(this)();
|
|
40811
40859
|
}
|
|
40812
40860
|
//Revalidate
|
|
40813
40861
|
this.validationErrors = validate.bind(this)(this._template);
|
|
@@ -40855,7 +40903,7 @@ const LsDocumentViewer = class {
|
|
|
40855
40903
|
return false;
|
|
40856
40904
|
}
|
|
40857
40905
|
render() {
|
|
40858
|
-
return (index.h(index.Host, { key: '
|
|
40906
|
+
return (index.h(index.Host, { key: '9a4715eeba2d7855b38a2cfa7e036d9967fce72f' }, index.h(index.h.Fragment, null, this.isLoading && (index.h(index.h.Fragment, null, index.h("ls-page-loader", { key: 'e83ea211e3fa737ad9ccf8ea3ce98620d2e1a024' }), index.h("div", { key: '4fcec26458f289b8055c17900ea2607525c1023c', class: 'custom-loader-slot' }, index.h("slot", { key: 'c59a1fad465d430d3abc848eb66748765fd2e331', name: 'custom-loader' })), this.mode === 'compose' && index.h("ls-compose-loader", { key: '54516384d9a7807adfd11414b6ee6b6024f91ea9' }))), index.h("div", { key: 'ceb19ea42c840b31120fc361937b081cde362e36', class: "page-header" }, index.h("div", { key: '9b83c45192b9badd2c651af9a5f82856e13a7ed6', class: 'left-slot-wrapper' }, index.h("slot", { key: '7d874919342fd912cc795a1a7a0fb009caa5530c', name: "left-button" })), index.h("div", { key: 'b9ae870a87129dec636c1ea1cf526575ebc14da7', class: 'right-slot-wrapper' }, index.h("slot", { key: 'd857f5e01e45da758b9e1c5c9f1fa92bb75ba0fd', name: "right-button" })), this.mode === 'editor' && (index.h("div", { key: '0656060027528d4087d3d4423172ebd2f3e81b96' }, index.h("span", { key: '0f57e66eb07ffde9e34d51e08264a8ff7c061b59', class: "header-text-1" }, "Template Creation"), index.h("span", { key: '633ff3578c901f1eccef346509d5f91e4f41d0c8' }, "/"), index.h("span", { key: '2b5eef16e32358cbb04501024b14c2edf492400c', class: "header-text-2" }, this._template?.title))), this.mode === 'compose' && (index.h("div", { key: '04c3bc0ba0d356b08002057ee75d3501e62f71ed', style: { display: 'flex', alignItems: 'center', gap: '0.25rem' } }, index.h("slot", { key: '3637f7589f30881e6530309d4ee75ba2c08fc6cc', name: "top-bar" })))), this.mode === 'editor' && (index.h("div", { key: '5e6cbca7d5e23554d11c273ef4c28f887757a428', class: 'validation-tag-wrapper' }, index.h("ls-validation-tag", { key: 'c72268eb047ddcdead51284f8c3edf3956f8fd25', validationErrors: this.validationErrors }))), index.h("form", { key: 'c6235762eead3b415c9a6aedf4a89e8d735a4ae1', id: "ls-editor-form" }, this.mode !== 'preview' ? (index.h("div", { id: "ls-left-box", class: "leftBox", style: this.mode === 'compose' ? { borderRadius: '1.75rem' } : {} }, index.h("div", { class: !this.selected || this.selected.length === 0 ? 'left-box-inner' : 'hidden' }, this.mode === 'editor' && (index.h("ls-feature-column", { mode: this.mode, onManage: manager => {
|
|
40859
40907
|
if (manager.detail === 'document') {
|
|
40860
40908
|
var documentManager = this.component.shadowRoot.getElementById('ls-document-options');
|
|
40861
40909
|
documentManager.template = this._template;
|
|
@@ -40873,7 +40921,7 @@ const LsDocumentViewer = class {
|
|
|
40873
40921
|
this._recipients.map(recipient => (index.h("ls-recipient-card", { recipient: recipient, activeRecipient: this.signer, filtertoolbox: this.filtertoolbox, template: this._template, validationErrors: this.validationErrors, fieldTypeSelected: this.fieldTypeSelected, "data-signer-index": recipient.signerIndex })))), index.h("slot", { name: "recipient-panel" }))), !this.displayTable && (index.h("div", { class: this.selected.length > 0 ? 'field-properties-outer' : 'hidden' }, index.h("div", { class: 'properties-header' }, index.h("div", { class: 'properties-header-icon' }, index.h("ls-icon", { name: "pre-filled-content" })), index.h("h1", { class: 'properties-header-title' }, "Field Properties"), index.h("button", { class: 'tertiaryGrey', onClick: e => {
|
|
40874
40922
|
this.selected = [];
|
|
40875
40923
|
e.preventDefault();
|
|
40876
|
-
}, "data-tooltip": "Close Properties Panel" }, index.h("ls-icon", { name: "x", size: "1.25rem" }))), index.h("ls-field-properties", { id: "my-field-panel" }))))) : (index.h(index.h.Fragment, null)), index.h("ls-toolbar", { key: '
|
|
40924
|
+
}, "data-tooltip": "Close Properties Panel" }, index.h("ls-icon", { name: "x", size: "1.25rem" }))), index.h("ls-field-properties", { id: "my-field-panel" }))))) : (index.h(index.h.Fragment, null)), index.h("ls-toolbar", { key: '51a8fc8717edefa84746856a2869bcf3c08176df', id: "ls-toolbar", template: this._template, editor: this, groupInfo: this.groupInfo, mode: this.mode }), index.h("div", { key: '2dd4db2fd78fde81fa52ee8232cfaf708318446e', id: "ls-mid-area" }, index.h("div", { key: '6adcecba8014245655e89a4ad94350fdda847758', class: 'document-frame-wrapper', id: "document-frame-wrapper" }, index.h("div", { key: '5b0e96b9ae672008e21caf227ea2cebdf781731d', id: "ls-document-frame" }, index.h("canvas", { key: '34b47e8f2f8f2f9d104922ac3413d12f47e5d74b', id: "pdf-canvas", class: this.displayTable || this.isLoading ? 'hidden' : '' }), index.h("ls-editor-table", { key: 'ebf6f28f5a0f3f8c795585ab6b89de7af666fddd', editor: this, class: this.displayTable ? '' : 'hidden' }), index.h("div", { key: 'a425cbdf400705bd467d475ac4b5a723d457d81d', id: "ls-box-selector" }))), index.h("ls-statusbar", { key: '88211270ab98f7b42c8f3c64b35d561b4a87f3ff', editor: this, page: this.pageNum, pageCount: this.pageCount })))), index.h("ls-tooltip", { key: '5b85d7845c23b01dabdb2dbbf75cc5d7727d1a33', id: "ls-tooltip-master" })));
|
|
40877
40925
|
}
|
|
40878
40926
|
static get watchers() { return {
|
|
40879
40927
|
"mode": ["modeHandler"],
|
|
@@ -49939,7 +49987,7 @@ const LsRecipientCard = class {
|
|
|
49939
49987
|
color: defaultRolePalette[this.recipient?.signerIndex % 100].s100,
|
|
49940
49988
|
} }, this.recipient?.previousRecipientDecides ? 'To Be Decided' : this.recipient?.firstName + ' ' + this.recipient?.lastName), index.h("p", { key: '6a1d0b4d3e69fb1a4850e3bf3d066ebb017ffac7', class: "participant-text-type", style: {
|
|
49941
49989
|
color: defaultRolePalette[this.recipient?.signerIndex % 100].s80,
|
|
49942
|
-
} }, this.recipient?.previousRecipientDecides ? 'Previous Recipient Decides Details' : this.recipient.email)), index.h("div", { key: '8f5635a2f6b7928117c8e871a6d09a97dece2fbf', class: "fields-box", style: { display: this.recipient.signerIndex === this.activeRecipient ? 'flex' : 'hidden' } }, this.recipient.signerIndex > 0 && this.showTool('signature') && this.recipient?.roleType !== 'APPROVER' && (index.h("ls-toolbox-field", { key: '90e4da5c01c09c9de92b3089c25ada5151bd9acd', elementType: "signature", formElementType: "signature", label: "Signature", defaultHeight: 27, defaultWidth: 120, validation: 0, icon: "signature", tooltip: "Use this field to collect Signatures from Participants", signer: this.recipient.signerIndex, redDot: recipientSignatures.length === 0 })), this.recipient.signerIndex === 0 && this.showTool('auto sign') && (index.h("ls-toolbox-field", { key: '
|
|
49990
|
+
} }, this.recipient?.previousRecipientDecides ? 'Previous Recipient Decides Details' : this.recipient.email)), index.h("div", { key: '8f5635a2f6b7928117c8e871a6d09a97dece2fbf', class: "fields-box", style: { display: this.recipient.signerIndex === this.activeRecipient ? 'flex' : 'hidden' } }, this.recipient.signerIndex > 0 && this.showTool('signature') && this.recipient?.roleType !== 'APPROVER' && (index.h("ls-toolbox-field", { key: '90e4da5c01c09c9de92b3089c25ada5151bd9acd', elementType: "signature", formElementType: "signature", label: "Signature", defaultHeight: 27, defaultWidth: 120, validation: 0, icon: "signature", tooltip: "Use this field to collect Signatures from Participants", signer: this.recipient.signerIndex, redDot: recipientSignatures.length === 0 })), this.recipient.signerIndex === 0 && this.showTool('auto sign') && (index.h("ls-toolbox-field", { key: 'bd4f807c0a296a0baa629cd4026334911313d866', elementType: "admin", formElementType: "auto sign", label: "Auto Sign", defaultHeight: 27, defaultWidth: 120, validation: 3000, icon: "auto-sign", tooltip: "Auto-Sign lets Senders add a Signature to the Document that will be automatically applied upon Sending", signer: this.recipient.signerIndex })), this.showTool('text') && (index.h("ls-toolbox-field", { key: '1bc4a30c6f653a97c4dbc101b8084c1e5c632123', elementType: "text", formElementType: "text", label: "Text", defaultHeight: 27, defaultWidth: 100, validation: 0, icon: "text", tooltip: "A field for collecting any plain text values such as: names, addresses or descriptions", signer: this.recipient.signerIndex })), this.recipient.signerIndex > 0 && this.showTool('signing date') && (index.h("ls-toolbox-field", { key: '35e2394a3662e656fe10fb89aed2870f983713d4', elementType: "admin", formElementType: "signing date", label: "Signing Date", defaultHeight: 27, defaultWidth: 120, validation: 30, icon: "auto-date", tooltip: "Automatically inserts the date upon completion by the assigned Participant", signer: this.recipient.signerIndex })), this.showTool('date') && (index.h("ls-toolbox-field", { key: '4cafdbf5420c68b860830846a3e1cfea40b85d3e', elementType: "text", formElementType: "date", label: "Date", defaultHeight: 27, defaultWidth: 80, validation: 2, icon: "calender", tooltip: "A field for collecting dates with built-in date formatting options", signer: this.recipient.signerIndex })), this.showTool('email') && (index.h("ls-toolbox-field", { key: '099268ca6be7e70ed309ae171b00ea44b38e1f66', elementType: "text", formElementType: "email", label: "Email", defaultHeight: 27, defaultWidth: 120, validation: 1, icon: "at-symbol", tooltip: "A Field to only accept entries formatted as an email address (e.g., example@example.com)", signer: this.recipient.signerIndex })), this.showTool('initials') && (index.h("ls-toolbox-field", { key: '2140e1d4f815ed4c0737d6a2c7cc0314c81840b1', elementType: "initials", formElementType: "initials", label: "Initials", defaultHeight: 27, defaultWidth: 120, validation: 2000, icon: "initials", tooltip: "Use this field anywhere Participants are required to Initial your document", signer: this.recipient.signerIndex })), this.showTool('number') && (index.h("ls-toolbox-field", { key: '116893cae169211df0f27e7e771cd19e45eff585', elementType: "text", formElementType: "number", label: "Number", defaultHeight: 27, defaultWidth: 80, validation: 50, icon: "hashtag", tooltip: "A Field to only accept entries in numerical format. Additional validations include character limit (1 to 12 digits), and currency format (2 decimal places)", signer: this.recipient.signerIndex })), this.showTool('dropdown') && (index.h("ls-toolbox-field", { key: 'f553649da3579fec840f6390e4b8530f44400e33', elementType: "text", formElementType: "dropdown", label: "Dropdown", defaultHeight: 27, defaultWidth: 80, validation: 20, icon: "dropdown", tooltip: "Use this field to create custom dropdown menus in your document, or place one of our handy presets for countries or prefixes", signer: this.recipient.signerIndex })), this.showTool('checkbox') && (index.h("ls-toolbox-field", { key: '4f78adf1df37fea8d621a2cec12899b74d82e822', elementType: "text", formElementType: "checkbox", label: "Checkbox", defaultHeight: 27, defaultWidth: 27, validation: 25, icon: "check", tooltip: "Places a checkbox on your document. Handy for T&Cs or \u2714/\u2717 sections", signer: this.recipient.signerIndex })), this.recipient.signerIndex > 0 && this.showTool('regex') && (index.h("ls-toolbox-field", { key: 'ca4f98b026fa234c1369b5826b3913f2187e540d', elementType: "text", formElementType: "regex", label: "Regex", defaultHeight: 27, defaultWidth: 120, validation: 93, icon: "code", tooltip: "Need a specific validation? Use this field to enter a custom RegEx and have Participants enter exactly what you need", signer: this.recipient.signerIndex })), this.recipient.signerIndex > 0 && this.showTool('image') && (index.h("ls-toolbox-field", { key: '52e8467693285499e0ce5b86568407e52fb432d2', elementType: "text", formElementType: "image", label: "Image", defaultHeight: 27, defaultWidth: 120, validation: 90, icon: "photograph", tooltip: "Use when you need Participants to upload their own images during the signing process", signer: this.recipient.signerIndex })), this.recipient.signerIndex > 0 && this.showTool('file') && (index.h("ls-toolbox-field", { key: '83c75a3d7443f89adcaa544ba8180d14b9a68e3c', elementType: "text", formElementType: "file", label: "File", defaultHeight: 27, defaultWidth: 120, validation: 74, icon: "upload", tooltip: "Use when you need Participants to upload their own documents during the signing process", signer: this.recipient.signerIndex })), this.recipient.signerIndex > 0 && this.showTool('drawn') && (index.h("ls-toolbox-field", { key: '86e954a61381a143052dedabf4e17b2136be86fb', elementType: "text", formElementType: "drawn", label: "Drawn", defaultHeight: 120, defaultWidth: 120, validation: 90, icon: "pencil", tooltip: "Allow users to draw on the document using their mouse or touchscreen", signer: this.recipient.signerIndex }))))), index.h("slot", { key: '0324c40a703a8a529fecc4d1211e5e6952131cf9' }), index.h("ls-tooltip", { key: '788510f80928d69a615af03363faa98de05dba31', id: "ls-tooltip-master" })));
|
|
49943
49991
|
}
|
|
49944
49992
|
static get watchers() { return {
|
|
49945
49993
|
"activeRecipient": ["handleExpandCollapse"]
|
|
@@ -50139,6 +50187,14 @@ const LsToolboxField = class {
|
|
|
50139
50187
|
canvas.innerHTML = this.formElementType;
|
|
50140
50188
|
document.body.appendChild(canvas);
|
|
50141
50189
|
event.dataTransfer.setDragImage(canvas, -50, -20);
|
|
50190
|
+
console.log('drag start', {
|
|
50191
|
+
formElementType: this.formElementType,
|
|
50192
|
+
elementType: this.elementType,
|
|
50193
|
+
validation: this.validation,
|
|
50194
|
+
defaultHeight: this.defaultHeight,
|
|
50195
|
+
defaultWidth: this.defaultWidth,
|
|
50196
|
+
fixedAspect: this.fixedAspect,
|
|
50197
|
+
});
|
|
50142
50198
|
// Add the target element's id to the data transfer object
|
|
50143
50199
|
event.dataTransfer.setData('application/json', JSON.stringify({
|
|
50144
50200
|
formElementType: this.formElementType,
|
|
@@ -50159,7 +50215,7 @@ const LsToolboxField = class {
|
|
|
50159
50215
|
attachAllTooltips(this.component.shadowRoot);
|
|
50160
50216
|
}
|
|
50161
50217
|
render() {
|
|
50162
|
-
return (index.h(index.Host, { key: '
|
|
50218
|
+
return (index.h(index.Host, { key: '0dae5b6232bc71f0cb3e5ec0765514389545cfd4', draggable: "true" }, index.h("div", { key: '350cccdddf7d3c6efd51cfac814280943681e829', class: 'ls-toolbox-field', style: this.isSelected && {
|
|
50163
50219
|
background: defaultRolePalette[this.signer % 100].s10,
|
|
50164
50220
|
border: `1px solid ${defaultRolePalette[this.signer % 100].s60}`,
|
|
50165
50221
|
color: defaultRolePalette[this.signer % 100].s80,
|
|
@@ -50174,9 +50230,9 @@ const LsToolboxField = class {
|
|
|
50174
50230
|
defaultWidth: this.defaultWidth,
|
|
50175
50231
|
fixedAspect: this.fixedAspect,
|
|
50176
50232
|
});
|
|
50177
|
-
} }, index.h("div", { key: '
|
|
50233
|
+
} }, index.h("div", { key: '77e9137b7f2770de8009b12549842f6cfa4e84c5', class: "toolbox-field-icon", style: { '--signer-color-light': defaultRolePalette[this.signer % 100].s10, '--signer-color': defaultRolePalette[this.signer % 100].s60 }, "data-tooltip": this.tooltip, "data-tooltip-placement": "right" }, index.h("ls-icon", { key: '2c69393936f80905ad2efbd232533a0921bab186', name: this.icon, size: "1.25rem" })), index.h("p", { key: 'eea324013441dbecf214d3a0e5e9c0c1314910ab', class: "toolbox-field-label", style: this.isSelected && {
|
|
50178
50234
|
color: defaultRolePalette[this.signer % 100].s80,
|
|
50179
|
-
} }, this.label), this.redDot && (index.h("div", { key: '
|
|
50235
|
+
} }, this.label), this.redDot && (index.h("div", { key: '235250f8eab62f0dba45ad0dda83a499093ef2f1', class: 'warning-box', "data-tooltip": `${this.label} Field Required`, "data-tooltip-placement": "left" }, index.h("ls-icon", { key: 'df24c80b6703dced2514cbe51af8da69529eaa69', name: "exclamation-circle", size: "1.125rem", solid: true }))), index.h("ls-icon", { key: '58e477c6a8d869327cc7b0a922aa9e742071dd92', name: "drag-vertical", size: "1rem", color: "#787a80" })), index.h("ls-tooltip", { key: 'cd005f9c953a2a2197d1324193ddd1c43e002b05', id: "ls-tooltip-master", tooltipText: "Something" })));
|
|
50180
50236
|
}
|
|
50181
50237
|
};
|
|
50182
50238
|
LsToolboxField.style = lsToolboxFieldCss();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LsDocumentAdapter.js","sourceRoot":"","sources":["../../../../src/components/ls-document-viewer/adapter/LsDocumentAdapter.ts"],"names":[],"mappings":"AAAA,OAAO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,UAAU,CAAC,SAAS,CAAC,OAAO,EAC7C;gBACE,KAAK,EAAE,YAAY;gBACnB,SAAS,EAAE,iBAAiB,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,EAAE;aACtD,EACD;gBACE,OAAO,EAAE;oBACP,aAAa,EAAE,WAAW;iBAC3B;aACF,CACF,CAAC;YACF,OAAO,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC;QACvB,CAAC;aAAM,CAAC;YACN,OAAO,CAAC,IAAI,CAAC,yBAAyB,CAAC,CAAC;QAC1C,CAAC;QAED,OAAO,OAAO,CAAC,MAAM,EAAE,CAAC;IAC1B,CAAC;CACF","sourcesContent":["import axios, { AxiosResponse } from 'axios';\nimport { LSMutateEvent } from '../../../types/LSMutateEvent';\nimport { LSApiRole } from '../../../types/LSApiRole';\nimport { LSApiElement } from '../../../types/LSApiElement';\nimport { Parameters } from './parameters';\nimport { createElement, deleteElement, updateElement } from './elementActions';\nimport { createRole, deleteRole, swapRoles, updateRole } from './roleActions';\nimport { updateTemplate } from './templateActions';\nimport { LSApiTemplate } from '../../../components';\nimport { recalculateCoordinates } from '../editorCalculator';\n\nexport class LsDocumentAdapter {\n\n private endpoint: string | null;\n\n constructor(endpoint?: string | null) {\n this.endpoint = endpoint;\n }\n\n handleEvent = async (event: LSMutateEvent, accessToken: string) => {\n axios.defaults.headers.common['Authorization'] = accessToken;\n\n // Determine the object type being processed\n const obj: LSApiElement | LSApiRole | LSApiTemplate = event.data;\n if (!obj?.id) return 'invalid';\n\n const apiId = atob(obj.id);\n if (apiId.length < 3) return 'invalid';\n\n const prefix = atob(obj.id).substring(0, 3);\n let query = '';\n switch (prefix) {\n case 'ele':\n switch (event.action) {\n case 'create':\n query = createElement(recalculateCoordinates(obj as LSApiElement));\n break;\n case 'update':\n query = updateElement(recalculateCoordinates(obj as LSApiElement));\n break;\n case 'delete':\n query = deleteElement(obj);\n break;\n }\n break;\n case 'rol':\n switch (event.action) {\n case 'create':\n query = createRole(obj);\n break;\n case 'update':\n query = updateRole(obj);\n break;\n case 'delete':\n query = deleteRole(obj);\n break;\n case 'swap':\n console.log(obj, event)\n query = swapRoles(obj, event.data2);\n break;\n }\n break;\n case 'tpl':\n switch (event.action) {\n case 'update':\n query = updateTemplate(obj);\n break;\n }\n break;\n }\n const result = await this.execute(accessToken, query);\n \n return { result, obj, event };\n };\n\n /**\n * Run a general query or mutation against the GraphQL API.\n *\n * @returns a promise of a graphQL request\n */\n public async execute(accessToken: string, graphQLQuery: string, _graphQLVariables?: object): Promise<object> {\n if (accessToken) {\n //console.log(graphQLQuery);\n const res = await axios.post<AxiosResponse>(\n this.endpoint || Parameters.endpoints.graphQL,\n {\n query: graphQLQuery,\n variables: _graphQLVariables ? _graphQLVariables : {},\n },\n {\n headers: {\n Authorization: accessToken,\n },\n },\n );\n return res.data.data;\n } else {\n console.warn('UNASSIGNED ACCESS TOKEN');\n }\n\n return Promise.reject();\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"LsDocumentAdapter.js","sourceRoot":"","sources":["../../../../src/components/ls-document-viewer/adapter/LsDocumentAdapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAwB,MAAM,OAAO,CAAC;AAI7C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAC/E,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC9E,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAE7D,MAAM,OAAO,iBAAiB;IAEpB,QAAQ,CAAgB;IAEhC,YAAY,QAAwB;QAClC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;IAED,WAAW,GAAG,KAAK,EAAE,KAAoB,EAAE,WAAm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vent } from '../../../types/LSMutateEvent';\nimport { LSApiRole } from '../../../types/LSApiRole';\nimport { LSApiElement } from '../../../types/LSApiElement';\nimport { Parameters } from './parameters';\nimport { createElement, deleteElement, updateElement } from './elementActions';\nimport { createRole, deleteRole, swapRoles, updateRole } from './roleActions';\nimport { updateTemplate } from './templateActions';\nimport { LSApiTemplate } from '../../../components';\nimport { recalculateCoordinates } from '../editorCalculator';\n\nexport class LsDocumentAdapter {\n\n private endpoint: string | null;\n\n constructor(endpoint?: string | null) {\n this.endpoint = endpoint;\n }\n\n handleEvent = async (event: LSMutateEvent, accessToken: string) => {\n axios.defaults.headers.common['Authorization'] = accessToken;\n\n // Determine the object type being processed\n const obj: LSApiElement | LSApiRole | LSApiTemplate = event.data;\n if (!obj?.id) return 'invalid';\n\n const apiId = atob(obj.id);\n if (apiId.length < 3) return 'invalid';\n\n const prefix = atob(obj.id).substring(0, 3);\n let query = '';\n switch (prefix) {\n case 'ele':\n switch (event.action) {\n case 'create':\n console.log(obj, event)\n query = createElement(recalculateCoordinates(obj as LSApiElement));\n break;\n case 'update':\n query = updateElement(recalculateCoordinates(obj as LSApiElement));\n break;\n case 'delete':\n query = deleteElement(obj);\n break;\n }\n break;\n case 'rol':\n switch (event.action) {\n case 'create':\n query = createRole(obj);\n break;\n case 'update':\n query = updateRole(obj);\n break;\n case 'delete':\n query = deleteRole(obj);\n break;\n case 'swap':\n console.log(obj, event)\n query = swapRoles(obj, event.data2);\n break;\n }\n break;\n case 'tpl':\n switch (event.action) {\n case 'update':\n query = updateTemplate(obj);\n break;\n }\n break;\n }\n const result = await this.execute(accessToken, query);\n \n return { result, obj, event };\n };\n\n /**\n * Run a general query or mutation against the GraphQL API.\n *\n * @returns a promise of a graphQL request\n */\n public async execute(accessToken: string, graphQLQuery: string, _graphQLVariables?: object): Promise<object> {\n if (accessToken) {\n //console.log(graphQLQuery);\n const res = await axios.post<AxiosResponse>(\n this.endpoint || Parameters.endpoints.graphQL,\n {\n query: graphQLQuery,\n variables: _graphQLVariables ? _graphQLVariables : {},\n },\n {\n headers: {\n Authorization: accessToken,\n },\n },\n );\n return res.data.data;\n } else {\n console.warn('UNASSIGNED ACCESS TOKEN');\n }\n\n return Promise.reject();\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"roleActions.js","sourceRoot":"","sources":["../../../../src/components/ls-document-viewer/adapter/roleActions.ts"],"names":[],"mappings":"AACA,aAAa;AACb,MAAM,UAAU,GAAG,CAAC,IAAI,EAAE,EAAE;IAC1B,MAAM,SAAS,GAAG,IAAI,EAAE,YAAY,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,YAAY,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC;IACzE,OAAO;;;qBAGY,IAAI,CAAC,UAAU;uBACb,IAAI,CAAC,WAAW;wBACf,SAAS;gBACjB,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC;mBACtB,IAAI,CAAC,OAAO;oBACX,IAAI,CAAC,QAAQ
|
|
1
|
+
{"version":3,"file":"roleActions.js","sourceRoot":"","sources":["../../../../src/components/ls-document-viewer/adapter/roleActions.ts"],"names":[],"mappings":"AACA,aAAa;AACb,MAAM,UAAU,GAAG,CAAC,IAAI,EAAE,EAAE;IAC1B,MAAM,SAAS,GAAG,IAAI,EAAE,YAAY,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,YAAY,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC;IACzE,OAAO;;;qBAGY,IAAI,CAAC,UAAU;uBACb,IAAI,CAAC,WAAW;wBACf,SAAS;gBACjB,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC;mBACtB,IAAI,CAAC,OAAO;oBACX,IAAI,CAAC,QAAQ;uBACV,IAAI,CAAC,UAAU;;IAElC,CAAA;AACJ,CAAC,CAAC;AAEF,gBAAgB;AAChB,MAAM,UAAU,GAAG,CAAC,IAAI,EAAE,EAAE;IAC1B,OAAO;;;2BAGkB,IAAI,CAAC,EAAE;;MAE5B,CAAA;AACN,CAAC,CAAC;AAEF,8BAA8B;AAC9B,MAAM,UAAU,GAAG,CAAC,IAAI,EAAE,EAAE;IAC1B,MAAM,SAAS,GAAG,IAAI,EAAE,YAAY,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,YAAY,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC;IACzE,OAAO;;;2BAGkB,IAAI,CAAC,EAAE;uBACX,IAAI,CAAC,WAAW;mBACpB,IAAI,CAAC,OAAO;wBACP,SAAS;gBACjB,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC;oBACrB,IAAI,CAAC,QAAQ,CAAC,WAAW,EAAE;uBACxB,IAAI,CAAC,UAAU;;MAEhC,CAAA;AACN,CAAC,CAAC;AAEF,0BAA0B;AAC1B,MAAM,SAAS,GAAG,CAAC,OAAO,EAAE,OAAO,EAAE,EAAE;IAErC,OAAO;;;oBAGW,OAAO,CAAC,EAAE;oBACV,OAAO,CAAC,EAAE;;MAExB,CAAC;AAEP,CAAC,CAAC;AAGF,MAAM,gBAAgB,GAAG,CAAC,EAAU,EAAE,EAAE;IACtC,OAAO;;0BAEiB,EAAE;;;;;;;;;;;;OAYrB,CAAC;AACR,CAAC,CAAC;AAGF,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,gBAAgB,EAAE,CAAC","sourcesContent":["\n// Add a role\nconst createRole = (role) => {\n const newParent = role?.signerParent ? `\"${role.signerParent}\"` : 'null';\n return `\n mutation LDVAddRole {\n createTemplateRole(input: {\n templateId: \"${role.templateId}\" \n signerIndex: ${role.signerIndex}\n signerParent: ${newParent}\n name: ${JSON.stringify(role.name)}\n ordinal: ${role.ordinal}\n roleType: ${role.roleType}\n experience: \"${role.experience}\"\n })\n }` \n};\n\n// Remove a role\nconst deleteRole = (role) => {\n return `\n mutation LDVremoveRole {\n deleteTemplateRole(input: {\n templateRoleId: \"${role.id}\" \n })\n }`\n};\n\n// Save any changes to an role\nconst updateRole = (role) => {\n const newParent = role?.signerParent ? `\"${role.signerParent}\"` : 'null';\n return `\n mutation LDVupdateRole {\n updateTemplateRole(input: {\n templateRoleId: \"${role.id}\" \n signerIndex: ${role.signerIndex}\n ordinal: ${role.ordinal}\n signerParent: ${newParent}\n name: ${JSON.stringify(role.name)}\n roleType: ${role.roleType.toUpperCase()}\n experience: \"${role.experience}\"\n })\n }`\n};\n\n// swap two adjacent roles\nconst swapRoles = (roleId1, roleId2) => {\n\n return `\n mutation LDVswapRole {\n swapRoles(input: {\n roleId1: \"${roleId1.id}\" \n roleId2: \"${roleId2.id}\"\n })\n }`;\n\n};\n\n\nconst getTemplateRoles = (id: string) => {\n return `\n query LDVGetTemplate {\n template(id: \"${id}\") { \n roles{\n id\n name\n roleType\n signerIndex\n ordinal\n signerParent\n experience\n }\n }\n }\n `;\n};\n\n\nexport { createRole, updateRole, deleteRole, swapRoles, getTemplateRoles };\n"]}
|
|
@@ -19,7 +19,6 @@ export function addField(frame, data) {
|
|
|
19
19
|
const fields = this._template.elementConnection.templateElements;
|
|
20
20
|
this._template = { ...this._template, elementConnection: { ...this._template.elementConnection, templateElements: [...fields, data] } };
|
|
21
21
|
const assignee = this.mode === 'compose' ? this._recipients?.find(r => r.signerIndex === data.signer) : this._template.roles.find(r => r.signerIndex === data.signer);
|
|
22
|
-
console.log(assignee?.previousRecipientDecides);
|
|
23
22
|
const node = document.createElement('ls-editor-field');
|
|
24
23
|
node.setAttribute('type', data.formElementType);
|
|
25
24
|
node.setAttribute('id', 'ls-field-' + data.id);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editorCalculator.js","sourceRoot":"","sources":["../../../src/components/ls-document-viewer/editorCalculator.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,MAA4C,EAAE,QAAqB,EAAE,UAAmB,KAAK,EAAE,WAAoB,KAAK,EAA8B,EAAE;IAC7K,MAAM,QAAQ,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AC3C,MAAM,EAAE,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,cAAc,CAAC,MAAM,CAAC;IAC3C,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,cAAc,CAAC,KAAK,CAAC;IACvD,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,cAAc,CAAC,MAAM,CAAC;IAExD,+FAA+F;IAC/F,OAAO;QACL,GAAG,CAAC;QACJ,EAAE;QACF,EAAE;QACF,EAAE;QACF,EAAE;KACH,CAAC;AACJ,CAAC,CAAC;AAEF,2CAA2C;AAC3C,MAAM,CAAC,MAAM,GAAG,GAAG,CAAC,CAAe,EAAW,EAAE;IAC9C,OAAO,CAAC,CAAC,IAAI,GAAG,CAAC,IAAI,CAAC,CAAC,GAAG,GAAG,CAAC,IAAI,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,cAAc,CAAC,KAAK,IAAI,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,cAAc,CAAC,MAAM,CAAC;AAC5H,CAAC,CAAC","sourcesContent":["import { LSApiElement } from '../../types/LSApiElement';\n\nexport const findIn = (fields: NodeListOf<HTMLLsEditorFieldElement>, selector: HTMLElement, restyle: boolean = false, additive: boolean = false): HTMLLsEditorFieldElement[] => {\n const selected: HTMLLsEditorFieldElement[] = new Array();\n const { top, left, bottom, right } = selector.getBoundingClientRect();\n\n fields.forEach(f => {\n if (f.getBoundingClientRect().bottom <= bottom && f.getBoundingClientRect().top >= top && f.getBoundingClientRect().left >= left && f.getBoundingClientRect().right <= right) {\n if (restyle) f.selected = true;\n selected.push(f);\n } else {\n if (restyle && !additive) f.selected = false;\n }\n });\n return selected;\n};\n\n// Used to append new fields (dropped or loaded from template data)\nexport function addField(frame: HTMLElement, data): HTMLLsEditorFieldElement {\n const fields = this._template.elementConnection.templateElements;\n this._template = { ...this._template, elementConnection: { ...this._template.elementConnection, templateElements: [...fields, data] } };\n const assignee = this.mode === 'compose' ? this._recipients?.find(r => r.signerIndex === data.signer) : this._template.roles.find(r => r.signerIndex === data.signer);\n console.log(assignee?.previousRecipientDecides);\n\n const node = document.createElement('ls-editor-field');\n node.setAttribute('type', data.formElementType);\n node.setAttribute('id', 'ls-field-' + data.id);\n node.setAttribute(\n 'assignee',\n this.mode === 'compose' && assignee?.previousRecipientDecides\n ? 'To Be Decided'\n : this.mode === 'compose'\n ? `${assignee?.firstName} ${assignee?.lastName}`\n : assignee?.name || `Participant ${data.signer}`,\n );\n node.setAttribute('zoom', String(this.zoom));\n // node.setAttribute('selected', 'selected');\n node.style.zIndex = '100';\n node.style.position = 'absolute';\n\n node.style.top = Math.floor(data.top * this.zoom) + 'px';\n node.style.left = Math.floor(data.left * this.zoom) + 'px';\n node.style.height = Math.floor(data.height * this.zoom) + 'px';\n node.style.width = Math.floor(data.width * this.zoom) + 'px';\n node.style.fontSize = Math.floor(data.fontSize * this.zoom) + 'pt';\n node.style.alignContent = data.align;\n node.style.fontFamily = data.fontName;\n node.dataItem = data;\n\n frame.appendChild(node);\n\n return node as any as HTMLLsEditorFieldElement;\n}\n\nexport function moveField(item: HTMLLsEditorFieldElement, data) {\n item.style.top = Math.floor(data.top * this.zoom) + 'px';\n item.style.left = Math.floor(data.left * this.zoom) + 'px';\n item.style.height = Math.floor(data.height * this.zoom) + 'px';\n item.style.width = Math.floor(data.width * this.zoom) + 'px';\n item.style.fontSize = Math.floor(data.fontSize * this.zoom) + 'pt';\n item.style.fontFamily = data.fontName;\n item.style.textAlign = data.align;\n item.dataItem = recalculateCoordinates(data);\n}\n\n// calculates html compatible coords at current zoom level\nexport const transformCoordinates = (\n sourceField: LSApiElement,\n inputFieldWidth: number,\n inputFieldHeight: number,\n viewerWidth: number,\n viewerHeight: number,\n left: number,\n top: number,\n fontName: string,\n fontSize: number,\n zoom: number,\n): LSApiElement => {\n // Returns X, Y coordinates\n const ax = left > 0 ? left / viewerWidth : 0;\n const ay = top > 0 ? top / viewerHeight : 0;\n const bx = (left + inputFieldWidth) / viewerWidth;\n const by = (top + inputFieldHeight) / viewerHeight;\n\n // Return with calculated styles that try to place it as it would appear on legacy signing page\n return {\n ...sourceField,\n ax,\n ay,\n bx,\n by,\n cstyle: {\n margin: 0,\n verticalAlign: 'top',\n boxSizing: 'content-box',\n fontSize: viewerWidth < 640 ? `${(fontSize / 24) * zoom}rem` : `${fontSize * zoom}px`,\n fontFamily: fontName || 'arial',\n width: `${(inputFieldWidth * bx - inputFieldWidth * ax) * zoom}px`, // app1 input has padding-x 3px\n height: `${inputFieldHeight * (by - ay) * zoom}px`, // app1 input has padding-y 2px\n // minHeight: `${inputFieldHeight * (BY - AY) * zoom - 2}px`,\n lineHeight: 'inherit',\n },\n divStyle: {\n position: 'absolute',\n top: `${inputFieldHeight * ay * zoom}px`,\n left: `${inputFieldWidth * ax * zoom}px`,\n width: `${(inputFieldWidth * bx - inputFieldWidth * ax) * zoom}px`,\n height: `${inputFieldHeight * (by - ay) * zoom}px`,\n zIndex: 1000,\n fontSize: viewerWidth < 640 ? `${(fontSize / 24) * zoom}rem` : `${fontSize * zoom}px`,\n },\n objectHeight: `${inputFieldHeight * (by - ay) * zoom}px`,\n };\n};\n\n// from a field element get all dimension data including LEGACY dimensions\nexport const findDimensions = (\n frameContainer: HTMLDivElement,\n sourceField: HTMLLsEditorFieldElement,\n pageHeight: number,\n pageWidth: number,\n zoom: number,\n): { top: number; left: number; height: number; width: number; ax: number; ay: number; bx: number; by: number } => {\n // Position of widget frame\n const frmDims = frameContainer.getBoundingClientRect();\n // dimensions relative to viewport\n const { height, width } = sourceField.getBoundingClientRect();\n const top = Math.floor((sourceField.getBoundingClientRect().top - frmDims.top) / zoom);\n const left = Math.floor((sourceField.getBoundingClientRect().left - frmDims.left) / zoom);\n\n // Returns X, Y coordinates\n const ax = left > 0 ? left / pageWidth : 0;\n const ay = top > 0 ? top / pageHeight : 0;\n const bx = (left + width / zoom) / pageWidth;\n const by = (top + height / zoom) / pageHeight;\n\n // Return with calculated styles that try to place it as it would appear on legacy signing page\n return {\n top,\n left,\n height: Math.round(height / zoom),\n width: Math.round(width / zoom),\n ax,\n ay,\n bx,\n by,\n };\n};\n\n// from a field element get all dimension data including LEGACY dimensions\nexport const recalculateCoordinates = (d: LSApiElement): LSApiElement => {\n // Returns X, Y coordinates\n const ax = d.left / d.pageDimensions.width;\n const ay = d.top / d.pageDimensions.height;\n const bx = (d.left + d.width) / d.pageDimensions.width;\n const by = (d.top + d.height) / d.pageDimensions.height;\n\n // Return with calculated styles that try to place it as it would appear on legacy signing page\n return {\n ...d,\n ax,\n ay,\n bx,\n by,\n };\n};\n\n// from a field determinse if out of bounds\nexport const oob = (d: LSApiElement): boolean => {\n return d.left < 0 || d.top < 0 || d.left + d.width > d.pageDimensions.width || d.top + d.height > d.pageDimensions.height;\n};\n"]}
|
|
1
|
+
{"version":3,"file":"editorCalculator.js","sourceRoot":"","sources":["../../../src/components/ls-document-viewer/editorCalculator.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,MAA4C,EAAE,QAAqB,EAAE,UAAmB,KAAK,EAAE,WAAoB,KAAK,EAA8B,EAAE;IAC7K,MAAM,QAAQ,GAA+B,IAAI,KAAK,EAAE,CAAC;IACzD,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,QAAQ,CAAC,qBAAqB,EAAE,CAAC;IAEtE,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE;QACjB,IAAI,CAAC,CAAC,qBAAqB,EAAE,CAAC,MAAM,IAAI,MAAM,IAAI,CAAC,CAAC,qBAAqB,EAAE,CAAC,GAAG,IAAI,GAAG,IAAI,CAAC,CAAC,qBAAqB,EAAE,CAAC,IAAI,IAAI,IAAI,IAAI,C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AC,CAAC;AAEF,2CAA2C;AAC3C,MAAM,CAAC,MAAM,GAAG,GAAG,CAAC,CAAe,EAAW,EAAE;IAC9C,OAAO,CAAC,CAAC,IAAI,GAAG,CAAC,IAAI,CAAC,CAAC,GAAG,GAAG,CAAC,IAAI,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,cAAc,CAAC,KAAK,IAAI,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,cAAc,CAAC,MAAM,CAAC;AAC5H,CAAC,CAAC","sourcesContent":["import { LSApiElement } from '../../types/LSApiElement';\n\nexport const findIn = (fields: NodeListOf<HTMLLsEditorFieldElement>, selector: HTMLElement, restyle: boolean = false, additive: boolean = false): HTMLLsEditorFieldElement[] => {\n const selected: HTMLLsEditorFieldElement[] = new Array();\n const { top, left, bottom, right } = selector.getBoundingClientRect();\n\n fields.forEach(f => {\n if (f.getBoundingClientRect().bottom <= bottom && f.getBoundingClientRect().top >= top && f.getBoundingClientRect().left >= left && f.getBoundingClientRect().right <= right) {\n if (restyle) f.selected = true;\n selected.push(f);\n } else {\n if (restyle && !additive) f.selected = false;\n }\n });\n return selected;\n};\n\n// Used to append new fields (dropped or loaded from template data)\nexport function addField(frame: HTMLElement, data): HTMLLsEditorFieldElement {\n const fields = this._template.elementConnection.templateElements;\n this._template = { ...this._template, elementConnection: { ...this._template.elementConnection, templateElements: [...fields, data] } };\n const assignee = this.mode === 'compose' ? this._recipients?.find(r => r.signerIndex === data.signer) : this._template.roles.find(r => r.signerIndex === data.signer);\n const node = document.createElement('ls-editor-field');\n node.setAttribute('type', data.formElementType);\n node.setAttribute('id', 'ls-field-' + data.id);\n node.setAttribute(\n 'assignee',\n this.mode === 'compose' && assignee?.previousRecipientDecides\n ? 'To Be Decided'\n : this.mode === 'compose'\n ? `${assignee?.firstName} ${assignee?.lastName}`\n : assignee?.name || `Participant ${data.signer}`,\n );\n node.setAttribute('zoom', String(this.zoom));\n // node.setAttribute('selected', 'selected');\n node.style.zIndex = '100';\n node.style.position = 'absolute';\n\n node.style.top = Math.floor(data.top * this.zoom) + 'px';\n node.style.left = Math.floor(data.left * this.zoom) + 'px';\n node.style.height = Math.floor(data.height * this.zoom) + 'px';\n node.style.width = Math.floor(data.width * this.zoom) + 'px';\n node.style.fontSize = Math.floor(data.fontSize * this.zoom) + 'pt';\n node.style.alignContent = data.align;\n node.style.fontFamily = data.fontName;\n node.dataItem = data;\n\n frame.appendChild(node);\n\n return node as any as HTMLLsEditorFieldElement;\n}\n\nexport function moveField(item: HTMLLsEditorFieldElement, data) {\n item.style.top = Math.floor(data.top * this.zoom) + 'px';\n item.style.left = Math.floor(data.left * this.zoom) + 'px';\n item.style.height = Math.floor(data.height * this.zoom) + 'px';\n item.style.width = Math.floor(data.width * this.zoom) + 'px';\n item.style.fontSize = Math.floor(data.fontSize * this.zoom) + 'pt';\n item.style.fontFamily = data.fontName;\n item.style.textAlign = data.align;\n item.dataItem = recalculateCoordinates(data);\n}\n\n// calculates html compatible coords at current zoom level\nexport const transformCoordinates = (\n sourceField: LSApiElement,\n inputFieldWidth: number,\n inputFieldHeight: number,\n viewerWidth: number,\n viewerHeight: number,\n left: number,\n top: number,\n fontName: string,\n fontSize: number,\n zoom: number,\n): LSApiElement => {\n // Returns X, Y coordinates\n const ax = left > 0 ? left / viewerWidth : 0;\n const ay = top > 0 ? top / viewerHeight : 0;\n const bx = (left + inputFieldWidth) / viewerWidth;\n const by = (top + inputFieldHeight) / viewerHeight;\n\n // Return with calculated styles that try to place it as it would appear on legacy signing page\n return {\n ...sourceField,\n ax,\n ay,\n bx,\n by,\n cstyle: {\n margin: 0,\n verticalAlign: 'top',\n boxSizing: 'content-box',\n fontSize: viewerWidth < 640 ? `${(fontSize / 24) * zoom}rem` : `${fontSize * zoom}px`,\n fontFamily: fontName || 'arial',\n width: `${(inputFieldWidth * bx - inputFieldWidth * ax) * zoom}px`, // app1 input has padding-x 3px\n height: `${inputFieldHeight * (by - ay) * zoom}px`, // app1 input has padding-y 2px\n // minHeight: `${inputFieldHeight * (BY - AY) * zoom - 2}px`,\n lineHeight: 'inherit',\n },\n divStyle: {\n position: 'absolute',\n top: `${inputFieldHeight * ay * zoom}px`,\n left: `${inputFieldWidth * ax * zoom}px`,\n width: `${(inputFieldWidth * bx - inputFieldWidth * ax) * zoom}px`,\n height: `${inputFieldHeight * (by - ay) * zoom}px`,\n zIndex: 1000,\n fontSize: viewerWidth < 640 ? `${(fontSize / 24) * zoom}rem` : `${fontSize * zoom}px`,\n },\n objectHeight: `${inputFieldHeight * (by - ay) * zoom}px`,\n };\n};\n\n// from a field element get all dimension data including LEGACY dimensions\nexport const findDimensions = (\n frameContainer: HTMLDivElement,\n sourceField: HTMLLsEditorFieldElement,\n pageHeight: number,\n pageWidth: number,\n zoom: number,\n): { top: number; left: number; height: number; width: number; ax: number; ay: number; bx: number; by: number } => {\n // Position of widget frame\n const frmDims = frameContainer.getBoundingClientRect();\n // dimensions relative to viewport\n const { height, width } = sourceField.getBoundingClientRect();\n const top = Math.floor((sourceField.getBoundingClientRect().top - frmDims.top) / zoom);\n const left = Math.floor((sourceField.getBoundingClientRect().left - frmDims.left) / zoom);\n\n // Returns X, Y coordinates\n const ax = left > 0 ? left / pageWidth : 0;\n const ay = top > 0 ? top / pageHeight : 0;\n const bx = (left + width / zoom) / pageWidth;\n const by = (top + height / zoom) / pageHeight;\n\n // Return with calculated styles that try to place it as it would appear on legacy signing page\n return {\n top,\n left,\n height: Math.round(height / zoom),\n width: Math.round(width / zoom),\n ax,\n ay,\n bx,\n by,\n };\n};\n\n// from a field element get all dimension data including LEGACY dimensions\nexport const recalculateCoordinates = (d: LSApiElement): LSApiElement => {\n // Returns X, Y coordinates\n const ax = d.left / d.pageDimensions.width;\n const ay = d.top / d.pageDimensions.height;\n const bx = (d.left + d.width) / d.pageDimensions.width;\n const by = (d.top + d.height) / d.pageDimensions.height;\n\n // Return with calculated styles that try to place it as it would appear on legacy signing page\n return {\n ...d,\n ax,\n ay,\n bx,\n by,\n };\n};\n\n// from a field determinse if out of bounds\nexport const oob = (d: LSApiElement): boolean => {\n return d.left < 0 || d.top < 0 || d.left + d.width > d.pageDimensions.width || d.top + d.height > d.pageDimensions.height;\n};\n"]}
|
|
@@ -49,17 +49,6 @@ export function matchData(data) {
|
|
|
49
49
|
addField.bind(this)(this.component.shadowRoot.getElementById('ls-document-frame'), { ...data.obj, id });
|
|
50
50
|
this.update.emit({ event: { ...data.event, result: data.result }, template: this._template });
|
|
51
51
|
this.validationErrors = validate.bind(this)(this._template);
|
|
52
|
-
// Check for compose mode to generate roles for fields added.
|
|
53
|
-
if (this.mode === 'compose') {
|
|
54
|
-
// Compose mode - syncing roles after create
|
|
55
|
-
if (!this._template.roles.find(r => r.signerIndex === data.obj.signer)) {
|
|
56
|
-
const recipient = this._recipients.find(r => r?.signerIndex === data.obj.signer);
|
|
57
|
-
const roleDescription = recipient?.roleType ? recipient?.roleType.toUpperCase() : 'SIGNER';
|
|
58
|
-
const signerIndex = data.obj.signer;
|
|
59
|
-
// Role required - generate one
|
|
60
|
-
this.addParticipant.emit({ signerIndex, name: roleDescription + signerIndex, type: roleDescription });
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
52
|
}
|
|
64
53
|
}
|
|
65
54
|
if (prefix === 'rol') {
|