@verdocs/web-sdk 6.5.0-beta.26 → 6.5.0-beta.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/dist/cjs/loader.cjs.js +1 -1
  2. package/dist/cjs/verdocs-sign.cjs.entry.js +35 -31
  3. package/dist/cjs/verdocs-sign.entry.cjs.js.map +1 -1
  4. package/dist/cjs/verdocs-web-sdk.cjs.js +1 -1
  5. package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.js +37 -32
  6. package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.js.map +1 -1
  7. package/dist/components/verdocs-sign.js +37 -32
  8. package/dist/components/verdocs-sign.js.map +1 -1
  9. package/dist/custom-elements.json +2460 -0
  10. package/dist/esm/loader.js +1 -1
  11. package/dist/esm/verdocs-sign.entry.js +35 -31
  12. package/dist/esm/verdocs-sign.entry.js.map +1 -1
  13. package/dist/esm/verdocs-web-sdk.js +1 -1
  14. package/dist/esm-es5/loader.js +1 -1
  15. package/dist/esm-es5/verdocs-sign.entry.js +1 -1
  16. package/dist/esm-es5/verdocs-sign.entry.js.map +1 -1
  17. package/dist/esm-es5/verdocs-web-sdk.js +1 -1
  18. package/dist/types/components/embeds/verdocs-sign/verdocs-sign.d.ts +1 -0
  19. package/dist/verdocs-web-sdk/p-261ee132.entry.js +2 -0
  20. package/dist/verdocs-web-sdk/p-261ee132.entry.js.map +1 -0
  21. package/dist/verdocs-web-sdk/p-B8zpaHu-.system.js +1 -1
  22. package/dist/verdocs-web-sdk/p-BviXv93R.system.js.map +1 -0
  23. package/dist/verdocs-web-sdk/p-d5bdf7e8.system.entry.js +2 -0
  24. package/dist/verdocs-web-sdk/p-d5bdf7e8.system.entry.js.map +1 -0
  25. package/dist/verdocs-web-sdk/verdocs-sign.entry.esm.js.map +1 -1
  26. package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
  27. package/package.json +1 -1
  28. package/dist/verdocs-web-sdk/p-0dcdcdb4.entry.js +0 -2
  29. package/dist/verdocs-web-sdk/p-0dcdcdb4.entry.js.map +0 -1
  30. package/dist/verdocs-web-sdk/p-4f622891.system.entry.js +0 -2
  31. package/dist/verdocs-web-sdk/p-4f622891.system.entry.js.map +0 -1
  32. package/dist/verdocs-web-sdk/p-BayI_PF4.system.js.map +0 -1
@@ -134,6 +134,7 @@ const VerdocsSign$1 = /*@__PURE__*/ proxyCustomElement(class VerdocsSign extends
134
134
  this.loading = true;
135
135
  this.envelope = null;
136
136
  this.zoomLevel = 'normal';
137
+ this.signingProgressMode = 'start';
137
138
  this.renderedPages = {};
138
139
  }
139
140
  async componentDidLoad() {
@@ -158,12 +159,13 @@ const VerdocsSign$1 = /*@__PURE__*/ proxyCustomElement(class VerdocsSign extends
158
159
  // session and might have a different "view" of the envelope.
159
160
  const response = await startSigningSession(this.endpoint, this.envelopeId, this.roleId, this.inviteCode);
160
161
  this.processAuthResponse(response);
161
- const fillable = this.getSortedFillableFields();
162
- if (fillable.length > 0) {
163
- setTimeout(() => {
164
- this.focusedField = fillable[0].name;
165
- }, 500);
166
- }
162
+ //
163
+ // const fillable = this.getSortedFillableFields();
164
+ // if (fillable.length > 0) {
165
+ // setTimeout(() => {
166
+ // this.focusedField = fillable[0].name;
167
+ // }, 500);
168
+ // }
167
169
  }
168
170
  catch (e) {
169
171
  console.log('[SIGN] Error with signing session', e);
@@ -552,6 +554,26 @@ const VerdocsSign$1 = /*@__PURE__*/ proxyCustomElement(class VerdocsSign extends
552
554
  this.nextSubmits = false;
553
555
  }
554
556
  this.updateAllFlags();
557
+ // We need a way to know if the user has started signing. But after trying two
558
+ // obvious ways (has the user adopted a signature? are any fields filled in yet?)
559
+ // they both had flaws (we could be carrying over a sig from a previous session,
560
+ // and things like defaults and auto-filled fields make the filled-field approach
561
+ // tricky to maintain).
562
+ // This is sort of a Hail Mary but it works well for now. We just keep a variable
563
+ // in localStorage that tracks the last 10 envelopes the user has "started".
564
+ // We never get a chance to clean them up but 10 GUIDs is tiny compared to what
565
+ // many apps store in a user's browser.
566
+ const startedEnvelopes = JSON.parse(localStorage.getItem('startedEnvelopes') || '[]');
567
+ const hasStarted = startedEnvelopes.includes(this.envelopeId);
568
+ if (this.nextSubmits) {
569
+ this.signingProgressMode = 'completed';
570
+ }
571
+ else if (hasStarted) {
572
+ this.signingProgressMode = 'signing';
573
+ }
574
+ else {
575
+ this.signingProgressMode = 'start';
576
+ }
555
577
  }
556
578
  getNextRequiredField() {
557
579
  // Find and focus the next incomplete field (that is fillable)
@@ -927,12 +949,11 @@ const VerdocsSign$1 = /*@__PURE__*/ proxyCustomElement(class VerdocsSign extends
927
949
  total: optionalFields.length,
928
950
  },
929
951
  };
930
- const focusedFieldObj = this.getSortedFillableFields().find(f => f.name === this.focusedField);
931
- const currentIndex = this.getSortedFillableFields().findIndex(f => f.name === this.focusedField) + 1;
932
- const totalFields = this.getSortedFillableFields().length;
933
- const remainingFields = this.getSortedFillableFields()
934
- .filter(f => f.required && !isFilled(f))
935
- .map(f => ({ name: f.name, type: f.type, required: f.required }));
952
+ const myFields = this.getSortedFillableFields();
953
+ const focusedFieldObj = myFields.find(f => f.name === this.focusedField);
954
+ const currentIndex = myFields.findIndex(f => f.name === this.focusedField) + 1;
955
+ const totalFields = myFields.length;
956
+ const remainingFields = myFields.filter(f => f.required && !isFilled(f)).map(f => ({ name: f.name, type: f.type, required: f.required }));
936
957
  console.log('[SIGN] Progress Debug:', {
937
958
  allFields: allFields.length,
938
959
  requiredFields: requiredFields.length,
@@ -941,25 +962,7 @@ const VerdocsSign$1 = /*@__PURE__*/ proxyCustomElement(class VerdocsSign extends
941
962
  optionalRemaining,
942
963
  filledFields: recipientFields.filter(f => isFilled(f)).map(f => ({ name: f.name, type: f.type, val: f.value })),
943
964
  });
944
- let mode = 'start';
945
- // We need a way to know if the user has started signing. But after trying two
946
- // obvious ways (has the user adopted a signature? are any fields filled in yet?)
947
- // they both had flaws (we could be carrying over a sig from a previous session,
948
- // and things like defaults and auto-filled fields make the filled-field approach
949
- // tricky to maintain).
950
- // This is sort of a Hail Mary but it works well for now. We just keep a variable
951
- // in localStorage that tracks the last 10 envelopes the user has "started".
952
- // We never get a chance to clean them up but 10 GUIDs is tiny compared to what
953
- // many apps store in a user's browser.
954
- const startedEnvelopes = JSON.parse(localStorage.getItem('startedEnvelopes') || '[]');
955
- const hasStarted = startedEnvelopes.includes(this.envelopeId);
956
- if (this.nextSubmits) {
957
- mode = 'completed';
958
- }
959
- else if (hasStarted) {
960
- mode = 'signing';
961
- }
962
- return (h("verdocs-signing-progress", { mode: mode, current: Math.max(1, currentIndex), total: totalFields, remainingFields: remainingFields, progress: progress, fieldLabel: getFieldLabel(focusedFieldObj), fieldCompleted: focusedFieldObj ? !!isFilled(focusedFieldObj) : false, onStarted: () => {
965
+ return (h("verdocs-signing-progress", { mode: this.signingProgressMode, current: Math.max(1, currentIndex), total: totalFields, remainingFields: remainingFields, progress: progress, fieldLabel: getFieldLabel(focusedFieldObj), fieldCompleted: focusedFieldObj ? !!isFilled(focusedFieldObj) : false, onStarted: () => {
963
966
  this.adoptingSignature = true;
964
967
  }, onNext: () => this.handleNext(), onPrevious: () => this.handlePrev(), onExit: () => this.handleNext() }));
965
968
  })(), h("div", { class: `document signed-document-container zoom-${this.zoomLevel}` }, (this.envelope.documents || []).map(envelopeDocument => {
@@ -1008,6 +1011,7 @@ const VerdocsSign$1 = /*@__PURE__*/ proxyCustomElement(class VerdocsSign extends
1008
1011
  }
1009
1012
  localStorage.setItem('startedEnvelopes', JSON.stringify(startedEnvelopes));
1010
1013
  }
1014
+ this.signingProgressMode = 'signing';
1011
1015
  }, onExit: () => (this.adoptingSignature = false) })), (this.submitting || this.showSpinner) && (h("verdocs-portal", null, h("div", { class: "spinner-overlay" }, h("verdocs-spinner", null)))), this.showDownloadDialog && (h("verdocs-download-dialog", { hasCertificate: (_b = (_a = this.envelope) === null || _a === void 0 ? void 0 : _a.documents) === null || _b === void 0 ? void 0 : _b.some(d => d.type === 'certificate'), onExit: () => (this.showDownloadDialog = false), onNext: async (e) => {
1012
1016
  this.showDownloadDialog = false;
1013
1017
  const { action } = e.detail;
@@ -1106,7 +1110,8 @@ const VerdocsSign$1 = /*@__PURE__*/ proxyCustomElement(class VerdocsSign extends
1106
1110
  "showDownloadDialog": [32],
1107
1111
  "loading": [32],
1108
1112
  "envelope": [32],
1109
- "zoomLevel": [32]
1113
+ "zoomLevel": [32],
1114
+ "signingProgressMode": [32]
1110
1115
  }]);
1111
1116
  function defineCustomElement$1() {
1112
1117
  if (typeof customElements === "undefined") {