@nylas/web-elements 2.6.0 → 2.6.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.
Files changed (53) hide show
  1. package/dist/cdn/nylas-scheduler-editor/nylas-scheduler-editor.es.js +961 -961
  2. package/dist/cdn/nylas-scheduling/nylas-scheduling.es.js +74 -70
  3. package/dist/cjs/google-logo-icon.microsoft-logo-icon.nylas-editor-tabs.nylas-editor-tabs-group.nylas-list-configurations.nylas-select-event-type.entry.cjs.js.map +1 -1
  4. package/dist/cjs/google-logo-icon_6.cjs.entry.js +8 -7
  5. package/dist/cjs/google-logo-icon_6.cjs.entry.js.map +1 -1
  6. package/dist/cjs/nylas-scheduler-editor.cjs.entry.js +1 -1
  7. package/dist/cjs/nylas-scheduling.cjs.entry.js +9 -6
  8. package/dist/cjs/nylas-scheduling.cjs.entry.js.map +1 -1
  9. package/dist/cjs/nylas-scheduling.entry.cjs.js.map +1 -1
  10. package/dist/cjs/{version-CHszslqN.js → version-pNhv-OnX.js} +3 -3
  11. package/dist/cjs/{version-CHszslqN.js.map → version-pNhv-OnX.js.map} +1 -1
  12. package/dist/collection/components/scheduler-editor/nylas-editor-tabs-group/nylas-editor-tabs-group.js +7 -6
  13. package/dist/collection/components/scheduler-editor/nylas-editor-tabs-group/nylas-editor-tabs-group.js.map +1 -1
  14. package/dist/collection/connector/shared/api/scheduler.js +8 -5
  15. package/dist/collection/connector/shared/api/scheduler.js.map +1 -1
  16. package/dist/collection/version.js +1 -1
  17. package/dist/collection/version.js.map +1 -1
  18. package/dist/components/nylas-editor-tabs-group.js +1 -1
  19. package/dist/components/nylas-editor-tabs.js +1 -1
  20. package/dist/components/nylas-scheduler-editor.js +3 -3
  21. package/dist/components/nylas-scheduling.js +9 -6
  22. package/dist/components/nylas-scheduling.js.map +1 -1
  23. package/dist/components/{p-CNj6i-JK.js → p-BvUse-6u.js} +3 -3
  24. package/dist/components/{p-CNj6i-JK.js.map → p-BvUse-6u.js.map} +1 -1
  25. package/dist/components/{p-DTNmzKXY.js → p-CK_YvIAV.js} +10 -9
  26. package/dist/components/p-CK_YvIAV.js.map +1 -0
  27. package/dist/components/{p-Z5I7z8cD.js → p-CmX4JCsD.js} +3 -3
  28. package/dist/components/{p-Z5I7z8cD.js.map → p-CmX4JCsD.js.map} +1 -1
  29. package/dist/esm/google-logo-icon.microsoft-logo-icon.nylas-editor-tabs.nylas-editor-tabs-group.nylas-list-configurations.nylas-select-event-type.entry.js.map +1 -1
  30. package/dist/esm/google-logo-icon_6.entry.js +8 -7
  31. package/dist/esm/google-logo-icon_6.entry.js.map +1 -1
  32. package/dist/esm/nylas-scheduler-editor.entry.js +1 -1
  33. package/dist/esm/nylas-scheduling.entry.js +9 -6
  34. package/dist/esm/nylas-scheduling.entry.js.map +1 -1
  35. package/dist/esm/{version-CYTx0-4Z.js → version-D-6xYsvk.js} +3 -3
  36. package/dist/esm/{version-CYTx0-4Z.js.map → version-D-6xYsvk.js.map} +1 -1
  37. package/dist/nylas-web-elements/google-logo-icon.microsoft-logo-icon.nylas-editor-tabs.nylas-editor-tabs-group.nylas-list-configurations.nylas-select-event-type.entry.esm.js.map +1 -1
  38. package/dist/nylas-web-elements/nylas-scheduling.entry.esm.js.map +1 -1
  39. package/dist/nylas-web-elements/nylas-web-elements.esm.js +1 -1
  40. package/dist/nylas-web-elements/{p-CYTx0-4Z.js → p-D-6xYsvk.js} +2 -2
  41. package/dist/nylas-web-elements/{p-CYTx0-4Z.js.map → p-D-6xYsvk.js.map} +1 -1
  42. package/dist/nylas-web-elements/{p-5d3ae749.entry.js → p-a6909b16.entry.js} +2 -2
  43. package/dist/nylas-web-elements/p-d346e3fb.entry.js +2 -0
  44. package/dist/nylas-web-elements/p-d346e3fb.entry.js.map +1 -0
  45. package/dist/nylas-web-elements/{p-f5ccd7f3.entry.js → p-f831f2f7.entry.js} +2 -2
  46. package/dist/nylas-web-elements/{p-f5ccd7f3.entry.js.map → p-f831f2f7.entry.js.map} +1 -1
  47. package/dist/types/connector/shared/api/scheduler.d.ts +1 -0
  48. package/dist/types/version.d.ts +1 -1
  49. package/package.json +1 -1
  50. package/dist/components/p-DTNmzKXY.js.map +0 -1
  51. package/dist/nylas-web-elements/p-82b39e7c.entry.js +0 -2
  52. package/dist/nylas-web-elements/p-82b39e7c.entry.js.map +0 -1
  53. /package/dist/nylas-web-elements/{p-5d3ae749.entry.js.map → p-a6909b16.entry.js.map} +0 -0
@@ -2,7 +2,7 @@ import { h, F as Fragment, r as registerInstance, c as createEvent, H as Host, a
2
2
  import { N as NylasBaseProvider } from './abstract-provider-C4xP8KoA.js';
3
3
  import { N as NylasIdentityRequestWrapper } from './nylas-api-request-CWLncKIc.js';
4
4
  import { d as dayjs, u as utc, t as timezone, a as debug, b as dataResponse, g as getCalendarRange, e as error, C as CONFIGURATION_EVENT_TYPE, L as LANGUAGE_CODE, i as instance, c as LANGUAGE_MAP } from './utils-DfIu4gMZ.js';
5
- import { o as o$1, v as version, E as ErrorCategory, N as NotificationType } from './version-CYTx0-4Z.js';
5
+ import { o as o$1, v as version, E as ErrorCategory, N as NotificationType } from './version-D-6xYsvk.js';
6
6
  import { c as createStore } from './index-DVBNi-yR.js';
7
7
 
8
8
  dayjs.extend(utc);
@@ -1,7 +1,7 @@
1
1
  import { h, F as Fragment, r as registerInstance, c as createEvent, H as Host, a as getElement } from './index-0EQQA0nE.js';
2
2
  import { N as NylasBaseProvider } from './abstract-provider-C4xP8KoA.js';
3
3
  import { n as normalizeSupportedLanguageCode, L as LANGUAGE_CODE, i as instance, f as normalizeDateInput, h as addDaysToCurrentDate, a as debug, j as detectBrowserLanguageCode, k as compactStringToUUIDs, l as LANGUAGE_CODE_TO_LOCALE_MAP, m as capitalizeFirstLetter, c as LANGUAGE_MAP } from './utils-DfIu4gMZ.js';
4
- import { E as ErrorCategory, v as version, u } from './version-CYTx0-4Z.js';
4
+ import { E as ErrorCategory, v as version, u } from './version-D-6xYsvk.js';
5
5
  import { c as createStore } from './index-DVBNi-yR.js';
6
6
  import { i as isInitialized, a as init, f as feedbackSyncIntegration, c as captureMessage, b as captureFeedback } from './feedbackSync-B8tfyAQm.js';
7
7
 
@@ -230,7 +230,7 @@ class NylaSchedulerAPIConnector {
230
230
  }
231
231
  async toggleAdditionalData(value) {
232
232
  if (!value) {
233
- await this.refetchAvailability();
233
+ await this.refetchAvailability(this.getViewedMonthAnchor());
234
234
  }
235
235
  this.schedulerStore.set('showBookingForm', value);
236
236
  }
@@ -275,11 +275,14 @@ class NylaSchedulerAPIConnector {
275
275
  additionalFields: merged,
276
276
  });
277
277
  }
278
- async refetchAvailability() {
278
+ getViewedMonthAnchor() {
279
+ return (normalizeDateInput(this.schedulerStore.get('selectedDate')) ?? normalizeDateInput(this.schedulerStore.get('selectedTimeslot')?.start_time));
280
+ }
281
+ async refetchAvailability(anchorDate = new Date()) {
279
282
  const today = new Date();
280
- const startTime = new Date(today.getFullYear(), today.getMonth(), 1).getTime() / 1000;
283
+ const startTime = new Date(anchorDate.getFullYear(), anchorDate.getMonth(), 1).getTime() / 1000;
281
284
  const startTimeWithOffset = startTime < today.getTime() / 1000 ? Math.floor(today.getTime() / 1000) : startTime;
282
- const endTime = new Date(today.getFullYear(), today.getMonth() + 1, 1).getTime() / 1000;
285
+ const endTime = new Date(anchorDate.getFullYear(), anchorDate.getMonth() + 1, 1).getTime() / 1000;
283
286
  const result = await this.getAvailability(startTimeWithOffset, endTime);
284
287
  return result;
285
288
  }
@@ -752,7 +755,7 @@ class NylaSchedulerAPIConnector {
752
755
  const errorMessage = this.getErrorMessage(error);
753
756
  error = this.errors.api(instance.t('validateTimeslotErrorTitle'))[errorType](errorMessage);
754
757
  }
755
- this.refetchAvailability();
758
+ this.refetchAvailability(timeslot.start_time);
756
759
  return { error };
757
760
  }
758
761
  this.schedulerStore.set('selectedTimeslot', timeslot);