@nylas/web-elements 1.1.0-canary.8 → 1.1.0-canary.9
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/{add-circle-icon_22.cjs.entry.js → add-circle-icon_21.cjs.entry.js} +35 -156
- package/dist/cjs/add-circle-icon_21.cjs.entry.js.map +1 -0
- package/dist/cjs/forward-icon_6.cjs.entry.js +2 -2
- package/dist/cjs/google-logo-icon_4.cjs.entry.js +24 -16
- package/dist/cjs/google-logo-icon_4.cjs.entry.js.map +1 -1
- package/dist/cjs/index-7af03e3f.js +1 -158
- package/dist/cjs/index-c14ea8f5.js +1 -362
- package/dist/cjs/index.cjs.js +2 -2
- package/dist/cjs/{index.es-4a7d8d3f.js → index.es-cc2d145f.js} +3 -3
- package/dist/cjs/index.es-cc2d145f.js.map +1 -0
- package/dist/cjs/{index.es-b2cce060.js → index.es-ec84e726.js} +3 -3
- package/dist/cjs/index.es-ec84e726.js.map +1 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{mailbox-store-ecceb918.js → mailbox-store-5ea7604e.js} +3 -3
- package/dist/cjs/{mailbox-store-a2f858b7.js.map → mailbox-store-5ea7604e.js.map} +1 -1
- package/dist/cjs/{mailbox-store-a2f858b7.js → mailbox-store-a02df2a7.js} +3 -3
- package/dist/cjs/{mailbox-store-ecceb918.js.map → mailbox-store-a02df2a7.js.map} +1 -1
- package/dist/cjs/multi-select-dropdown.cjs.entry.js +1 -1
- package/dist/cjs/nylas-additional-participants.cjs.entry.js +2 -2
- package/dist/cjs/{nylas-api-request-c9e0e347.js → nylas-api-request-05f1e068.js} +2 -2
- package/dist/cjs/{nylas-api-request-c9e0e347.js.map → nylas-api-request-05f1e068.js.map} +1 -1
- package/dist/cjs/{nylas-api-request-28b4576a.js → nylas-api-request-de316f1a.js} +2 -2
- package/dist/cjs/{nylas-api-request-28b4576a.js.map → nylas-api-request-de316f1a.js.map} +1 -1
- package/dist/cjs/nylas-availability-picker.cjs.entry.js +4 -3
- package/dist/cjs/nylas-availability-picker.cjs.entry.js.map +1 -1
- package/dist/cjs/nylas-booked-event-card.cjs.entry.js +21 -5
- package/dist/cjs/nylas-booked-event-card.cjs.entry.js.map +1 -1
- package/dist/cjs/nylas-booked-event-card_10.cjs.entry.js +54 -9
- package/dist/cjs/nylas-booked-event-card_10.cjs.entry.js.map +1 -1
- package/dist/cjs/nylas-booking-calendar-picker.cjs.entry.js +2 -2
- package/dist/cjs/nylas-booking-form.cjs.entry.js +2 -2
- package/dist/cjs/nylas-buffer-time.cjs.entry.js +4 -4
- package/dist/cjs/nylas-buffer-time.cjs.entry.js.map +1 -1
- package/dist/cjs/nylas-calendar-picker.cjs.entry.js +2 -2
- package/dist/cjs/nylas-cancel-booking-form.cjs.entry.js +2 -2
- package/dist/cjs/nylas-cancelled-event-card.cjs.entry.js +22 -5
- package/dist/cjs/nylas-cancelled-event-card.cjs.entry.js.map +1 -1
- package/dist/cjs/nylas-composer.cjs.entry.js +1 -1
- package/dist/cjs/nylas-custom-booking-flow.cjs.entry.js +2 -2
- package/dist/cjs/nylas-date-picker.cjs.entry.js +15 -3
- package/dist/cjs/nylas-date-picker.cjs.entry.js.map +1 -1
- package/dist/cjs/nylas-editor-tabs.cjs.entry.js +18 -12
- package/dist/cjs/nylas-editor-tabs.cjs.entry.js.map +1 -1
- package/dist/cjs/nylas-event-description.cjs.entry.js +2 -2
- package/dist/cjs/nylas-event-duration.cjs.entry.js +2 -2
- package/dist/cjs/nylas-event-info.cjs.entry.js +3 -3
- package/dist/cjs/nylas-event-info.cjs.entry.js.map +1 -1
- package/dist/cjs/nylas-event-limits.cjs.entry.js +3 -3
- package/dist/cjs/nylas-event-limits.cjs.entry.js.map +1 -1
- package/dist/cjs/nylas-event-title.cjs.entry.js +2 -2
- package/dist/cjs/nylas-form-card.cjs.entry.js +2 -2
- package/dist/cjs/nylas-if-state.cjs.entry.js +2 -2
- package/dist/cjs/nylas-limit-future-bookings.cjs.entry.js +3 -3
- package/dist/cjs/nylas-limit-future-bookings.cjs.entry.js.map +1 -1
- package/dist/cjs/nylas-list-configurations.cjs.entry.js +8 -6
- package/dist/cjs/nylas-list-configurations.cjs.entry.js.map +1 -1
- package/dist/cjs/nylas-list-folders.cjs.entry.js +2 -2
- package/dist/cjs/nylas-list-threads.cjs.entry.js +2 -2
- package/dist/cjs/nylas-locale-switch.cjs.entry.js +2 -2
- package/dist/cjs/nylas-location-component.cjs.entry.js +3 -3
- package/dist/cjs/nylas-location-component.cjs.entry.js.map +1 -1
- package/dist/cjs/nylas-login.cjs.entry.js +2 -2
- package/dist/cjs/nylas-mailbox-pagination.cjs.entry.js +2 -2
- package/dist/cjs/nylas-mailbox-toolbar-button.cjs.entry.js +2 -2
- package/dist/cjs/nylas-mailbox.cjs.entry.js +3 -3
- package/dist/cjs/nylas-min-cancellation-notice.cjs.entry.js +3 -3
- package/dist/cjs/nylas-min-cancellation-notice.cjs.entry.js.map +1 -1
- package/dist/cjs/nylas-notification.cjs.entry.js +1 -1
- package/dist/cjs/nylas-provider.cjs.entry.js +5 -5
- package/dist/cjs/nylas-scheduler-editor.cjs.entry.js +8 -14
- package/dist/cjs/nylas-scheduler-editor.cjs.entry.js.map +1 -1
- package/dist/cjs/nylas-scheduling.cjs.entry.js +35 -12
- package/dist/cjs/nylas-scheduling.cjs.entry.js.map +1 -1
- package/dist/cjs/nylas-selected-event-card.cjs.entry.js +2 -2
- package/dist/cjs/nylas-summarize-message-button.cjs.entry.js +2 -2
- package/dist/cjs/nylas-threads-refresh.cjs.entry.js +2 -2
- package/dist/cjs/nylas-threads-search.cjs.entry.js +2 -2
- package/dist/cjs/nylas-time-window-picker.cjs.entry.js +1 -1
- package/dist/cjs/nylas-timeslot-picker.cjs.entry.js +2 -2
- package/dist/cjs/nylas-view-email.cjs.entry.js +1 -1
- package/dist/cjs/nylas-view-thread.cjs.entry.js +2 -2
- package/dist/cjs/nylas-web-elements.cjs.js +1 -1
- package/dist/cjs/{register-component-98ab6f54.js → register-component-2c3ad1d1.js} +2 -2
- package/dist/cjs/{register-component-7ecacf90.js.map → register-component-2c3ad1d1.js.map} +1 -1
- package/dist/cjs/{register-component-7ecacf90.js → register-component-4f8ae42c.js} +2 -2
- package/dist/cjs/{register-component-98ab6f54.js.map → register-component-4f8ae42c.js.map} +1 -1
- package/dist/cjs/{scheduler-config-store-37690bf0.js → scheduler-config-store-918c20d5.js} +3 -4
- package/dist/cjs/scheduler-config-store-918c20d5.js.map +1 -0
- package/dist/cjs/{scheduler-config-store-529c8d7e.js → scheduler-config-store-a5b7c08b.js} +3 -4
- package/dist/cjs/scheduler-config-store-a5b7c08b.js.map +1 -0
- package/dist/cjs/{scheduler-store-22103c86.js → scheduler-store-33e204ef.js} +39 -7
- package/dist/cjs/scheduler-store-33e204ef.js.map +1 -0
- package/dist/cjs/{scheduler-store-fad9ed7a.js → scheduler-store-df23f511.js} +39 -7
- package/dist/cjs/scheduler-store-df23f511.js.map +1 -0
- package/dist/cjs/time-period-selector.cjs.entry.js +1 -1
- package/dist/cjs/{utils-d8cfc3be.js → utils-85bd0909.js} +64 -2
- package/dist/cjs/utils-85bd0909.js.map +1 -0
- package/dist/cjs/{utils-9fc33c77.js → utils-e6d76818.js} +64 -2
- package/dist/cjs/utils-e6d76818.js.map +1 -0
- package/dist/collection/common/types.js.map +1 -1
- package/dist/collection/components/scheduler/nylas-booked-event-card/nylas-booked-event-card.css +2 -1
- package/dist/collection/components/scheduler/nylas-booked-event-card/nylas-booked-event-card.js +56 -3
- package/dist/collection/components/scheduler/nylas-booked-event-card/nylas-booked-event-card.js.map +1 -1
- package/dist/collection/components/scheduler/nylas-cancelled-event-card/nylas-cancelled-event-card.js +75 -6
- package/dist/collection/components/scheduler/nylas-cancelled-event-card/nylas-cancelled-event-card.js.map +1 -1
- package/dist/collection/components/scheduler/nylas-date-picker/nylas-date-picker.js +37 -3
- package/dist/collection/components/scheduler/nylas-date-picker/nylas-date-picker.js.map +1 -1
- package/dist/collection/components/scheduler/nylas-scheduler/nylas-scheduling.js +41 -12
- package/dist/collection/components/scheduler/nylas-scheduler/nylas-scheduling.js.map +1 -1
- package/dist/collection/components/scheduler-editor/nylas-availability-picker/nylas-availability-picker.js +2 -1
- package/dist/collection/components/scheduler-editor/nylas-availability-picker/nylas-availability-picker.js.map +1 -1
- package/dist/collection/components/scheduler-editor/nylas-buffer-time/nylas-buffer-time.css +23 -3
- package/dist/collection/components/scheduler-editor/nylas-buffer-time/nylas-buffer-time.js +1 -1
- package/dist/collection/components/scheduler-editor/nylas-buffer-time/nylas-buffer-time.js.map +1 -1
- package/dist/collection/components/scheduler-editor/nylas-editor-tabs/nylas-editor-tabs.css +7 -0
- package/dist/collection/components/scheduler-editor/nylas-editor-tabs/nylas-editor-tabs.js +39 -14
- package/dist/collection/components/scheduler-editor/nylas-editor-tabs/nylas-editor-tabs.js.map +1 -1
- package/dist/collection/components/scheduler-editor/nylas-editor-tabs/tab-contents.js +1 -1
- package/dist/collection/components/scheduler-editor/nylas-editor-tabs/tab-contents.js.map +1 -1
- package/dist/collection/components/scheduler-editor/nylas-event-info/nylas-event-info.js +1 -1
- package/dist/collection/components/scheduler-editor/nylas-event-info/nylas-event-info.js.map +1 -1
- package/dist/collection/components/scheduler-editor/nylas-event-limits/nylas-event-limits.js +1 -1
- package/dist/collection/components/scheduler-editor/nylas-event-limits/nylas-event-limits.js.map +1 -1
- package/dist/collection/components/scheduler-editor/nylas-limit-future-bookings/nylas-limit-future-bookings.css +7 -1
- package/dist/collection/components/scheduler-editor/nylas-list-configurations/nylas-list-configurations.css +20 -2
- package/dist/collection/components/scheduler-editor/nylas-list-configurations/nylas-list-configurations.js +5 -3
- package/dist/collection/components/scheduler-editor/nylas-list-configurations/nylas-list-configurations.js.map +1 -1
- package/dist/collection/components/scheduler-editor/nylas-location-component/nylas-location-component.css +5 -0
- package/dist/collection/components/scheduler-editor/nylas-min-cancellation-notice/nylas-min-cancellation-notice.css +7 -1
- package/dist/collection/components/scheduler-editor/nylas-scheduler-editor/nylas-scheduler-editor.css +20 -0
- package/dist/collection/components/scheduler-editor/nylas-scheduler-editor/nylas-scheduler-editor.js +6 -13
- package/dist/collection/components/scheduler-editor/nylas-scheduler-editor/nylas-scheduler-editor.js.map +1 -1
- package/dist/collection/connector/shared/api/scheduler-config.js +0 -1
- package/dist/collection/connector/shared/api/scheduler-config.js.map +1 -1
- package/dist/collection/connector/shared/api/scheduler.js +37 -5
- package/dist/collection/connector/shared/api/scheduler.js.map +1 -1
- package/dist/collection/stores/scheduler-config-store.js +2 -3
- package/dist/collection/stores/scheduler-config-store.js.map +1 -1
- package/dist/collection/stores/scheduler-store.js.map +1 -1
- package/dist/collection/utils/utils.js +60 -1
- package/dist/collection/utils/utils.js.map +1 -1
- package/dist/components/index.es.js +2 -2
- package/dist/components/index.es.js.map +1 -1
- package/dist/components/nylas-availability-picker2.js +2 -1
- package/dist/components/nylas-availability-picker2.js.map +1 -1
- package/dist/components/nylas-booked-event-card2.js +22 -5
- package/dist/components/nylas-booked-event-card2.js.map +1 -1
- package/dist/components/nylas-buffer-time2.js +2 -2
- package/dist/components/nylas-buffer-time2.js.map +1 -1
- package/dist/components/nylas-cancelled-event-card2.js +23 -4
- package/dist/components/nylas-cancelled-event-card2.js.map +1 -1
- package/dist/components/nylas-custom-booking-flow.js +170 -1
- package/dist/components/nylas-custom-booking-flow.js.map +1 -1
- package/dist/components/nylas-date-picker2.js +17 -3
- package/dist/components/nylas-date-picker2.js.map +1 -1
- package/dist/components/nylas-editor-tabs2.js +52 -51
- package/dist/components/nylas-editor-tabs2.js.map +1 -1
- package/dist/components/nylas-event-info2.js +1 -1
- package/dist/components/nylas-event-info2.js.map +1 -1
- package/dist/components/nylas-event-limits2.js +1 -1
- package/dist/components/nylas-event-limits2.js.map +1 -1
- package/dist/components/nylas-event-title2.js +1 -1
- package/dist/components/nylas-limit-future-bookings2.js +1 -1
- package/dist/components/nylas-limit-future-bookings2.js.map +1 -1
- package/dist/components/nylas-list-configurations2.js +7 -5
- package/dist/components/nylas-list-configurations2.js.map +1 -1
- package/dist/components/nylas-list-folders.js +1 -1
- package/dist/components/nylas-list-threads.js +1 -1
- package/dist/components/nylas-location-component2.js +1 -1
- package/dist/components/nylas-location-component2.js.map +1 -1
- package/dist/components/nylas-min-cancellation-notice2.js +1 -1
- package/dist/components/nylas-min-cancellation-notice2.js.map +1 -1
- package/dist/components/nylas-scheduler-editor.js +46 -59
- package/dist/components/nylas-scheduler-editor.js.map +1 -1
- package/dist/components/nylas-scheduling.js +34 -11
- package/dist/components/nylas-scheduling.js.map +1 -1
- package/dist/components/nylas-summarize-message-button2.js +1 -1
- package/dist/components/nylas-timeslot-picker2.js +1 -1
- package/dist/components/nylas-view-email2.js +1 -1
- package/dist/components/nylas-view-thread.js +1 -1
- package/dist/components/scheduler-config-store.js +2 -3
- package/dist/components/scheduler-config-store.js.map +1 -1
- package/dist/components/scheduler-store.js +37 -5
- package/dist/components/scheduler-store.js.map +1 -1
- package/dist/components/utils.js +61 -2
- package/dist/components/utils.js.map +1 -1
- package/dist/esm/{add-circle-icon_22.entry.js → add-circle-icon_21.entry.js} +36 -156
- package/dist/esm/add-circle-icon_21.entry.js.map +1 -0
- package/dist/esm/forward-icon_6.entry.js +2 -2
- package/dist/esm/google-logo-icon_4.entry.js +24 -16
- package/dist/esm/google-logo-icon_4.entry.js.map +1 -1
- package/dist/esm/index-7cb0dd3d.js +1 -158
- package/dist/esm/index-8362ce5c.js +1 -362
- package/dist/esm/{index.es-df564f87.js → index.es-be19d2df.js} +3 -3
- package/dist/esm/index.es-be19d2df.js.map +1 -0
- package/dist/{nylas-web-elements/index.es-e4f027a2.js → esm/index.es-eb477d56.js} +3 -3
- package/dist/esm/index.es-eb477d56.js.map +1 -0
- package/dist/esm/index.js +2 -2
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{mailbox-store-69c5c5f6.js → mailbox-store-76540d24.js} +3 -3
- package/dist/{nylas-web-elements/mailbox-store-5075f820.js.map → esm/mailbox-store-76540d24.js.map} +1 -1
- package/dist/{nylas-web-elements/mailbox-store-5075f820.js → esm/mailbox-store-9f819402.js} +3 -3
- package/dist/esm/{mailbox-store-5075f820.js.map → mailbox-store-9f819402.js.map} +1 -1
- package/dist/esm/multi-select-dropdown.entry.js +1 -1
- package/dist/esm/nylas-additional-participants.entry.js +2 -2
- package/dist/esm/{nylas-api-request-b49b1da6.js → nylas-api-request-59738f8c.js} +2 -2
- package/dist/esm/{nylas-api-request-b49b1da6.js.map → nylas-api-request-59738f8c.js.map} +1 -1
- package/dist/{nylas-web-elements/nylas-api-request-6a19db25.js → esm/nylas-api-request-ff2869d7.js} +2 -2
- package/dist/esm/{nylas-api-request-6a19db25.js.map → nylas-api-request-ff2869d7.js.map} +1 -1
- package/dist/esm/nylas-availability-picker.entry.js +4 -3
- package/dist/esm/nylas-availability-picker.entry.js.map +1 -1
- package/dist/esm/nylas-booked-event-card.entry.js +21 -5
- package/dist/esm/nylas-booked-event-card.entry.js.map +1 -1
- package/dist/esm/nylas-booked-event-card_10.entry.js +54 -9
- package/dist/esm/nylas-booked-event-card_10.entry.js.map +1 -1
- package/dist/esm/nylas-booking-calendar-picker.entry.js +2 -2
- package/dist/esm/nylas-booking-form.entry.js +2 -2
- package/dist/esm/nylas-buffer-time.entry.js +4 -4
- package/dist/esm/nylas-buffer-time.entry.js.map +1 -1
- package/dist/esm/nylas-calendar-picker.entry.js +2 -2
- package/dist/esm/nylas-cancel-booking-form.entry.js +2 -2
- package/dist/esm/nylas-cancelled-event-card.entry.js +22 -5
- package/dist/esm/nylas-cancelled-event-card.entry.js.map +1 -1
- package/dist/esm/nylas-composer.entry.js +1 -1
- package/dist/esm/nylas-custom-booking-flow.entry.js +2 -2
- package/dist/esm/nylas-date-picker.entry.js +15 -3
- package/dist/esm/nylas-date-picker.entry.js.map +1 -1
- package/dist/esm/nylas-editor-tabs.entry.js +18 -12
- package/dist/esm/nylas-editor-tabs.entry.js.map +1 -1
- package/dist/esm/nylas-event-description.entry.js +2 -2
- package/dist/esm/nylas-event-duration.entry.js +2 -2
- package/dist/esm/nylas-event-info.entry.js +3 -3
- package/dist/esm/nylas-event-info.entry.js.map +1 -1
- package/dist/esm/nylas-event-limits.entry.js +3 -3
- package/dist/esm/nylas-event-limits.entry.js.map +1 -1
- package/dist/esm/nylas-event-title.entry.js +2 -2
- package/dist/esm/nylas-form-card.entry.js +2 -2
- package/dist/esm/nylas-if-state.entry.js +2 -2
- package/dist/esm/nylas-limit-future-bookings.entry.js +3 -3
- package/dist/esm/nylas-limit-future-bookings.entry.js.map +1 -1
- package/dist/esm/nylas-list-configurations.entry.js +8 -6
- package/dist/esm/nylas-list-configurations.entry.js.map +1 -1
- package/dist/esm/nylas-list-folders.entry.js +2 -2
- package/dist/esm/nylas-list-threads.entry.js +2 -2
- package/dist/esm/nylas-locale-switch.entry.js +2 -2
- package/dist/esm/nylas-location-component.entry.js +3 -3
- package/dist/esm/nylas-location-component.entry.js.map +1 -1
- package/dist/esm/nylas-login.entry.js +2 -2
- package/dist/esm/nylas-mailbox-pagination.entry.js +2 -2
- package/dist/esm/nylas-mailbox-toolbar-button.entry.js +2 -2
- package/dist/esm/nylas-mailbox.entry.js +3 -3
- package/dist/esm/nylas-min-cancellation-notice.entry.js +3 -3
- package/dist/esm/nylas-min-cancellation-notice.entry.js.map +1 -1
- package/dist/esm/nylas-notification.entry.js +1 -1
- package/dist/esm/nylas-provider.entry.js +5 -5
- package/dist/esm/nylas-scheduler-editor.entry.js +8 -14
- package/dist/esm/nylas-scheduler-editor.entry.js.map +1 -1
- package/dist/esm/nylas-scheduling.entry.js +35 -12
- package/dist/esm/nylas-scheduling.entry.js.map +1 -1
- package/dist/esm/nylas-selected-event-card.entry.js +2 -2
- package/dist/esm/nylas-summarize-message-button.entry.js +2 -2
- package/dist/esm/nylas-threads-refresh.entry.js +2 -2
- package/dist/esm/nylas-threads-search.entry.js +2 -2
- package/dist/esm/nylas-time-window-picker.entry.js +1 -1
- package/dist/esm/nylas-timeslot-picker.entry.js +2 -2
- package/dist/esm/nylas-view-email.entry.js +1 -1
- package/dist/esm/nylas-view-thread.entry.js +2 -2
- package/dist/esm/nylas-web-elements.js +1 -1
- package/dist/{nylas-web-elements/register-component-ff6f5df4.js → esm/register-component-0462b27d.js} +2 -2
- package/dist/esm/{register-component-b9cfcbaf.js.map → register-component-0462b27d.js.map} +1 -1
- package/dist/esm/{register-component-b9cfcbaf.js → register-component-83e24412.js} +2 -2
- package/dist/esm/{register-component-ff6f5df4.js.map → register-component-83e24412.js.map} +1 -1
- package/dist/{nylas-web-elements/scheduler-config-store-8f2e658e.js → esm/scheduler-config-store-8ccc8dc7.js} +3 -4
- package/dist/esm/scheduler-config-store-8ccc8dc7.js.map +1 -0
- package/dist/esm/{scheduler-config-store-07d98279.js → scheduler-config-store-ec3b6190.js} +3 -4
- package/dist/esm/scheduler-config-store-ec3b6190.js.map +1 -0
- package/dist/esm/{scheduler-store-24fd0e91.js → scheduler-store-8ca9003d.js} +39 -7
- package/dist/esm/scheduler-store-8ca9003d.js.map +1 -0
- package/dist/esm/{scheduler-store-e62b2146.js → scheduler-store-e314bbe6.js} +39 -7
- package/dist/esm/scheduler-store-e314bbe6.js.map +1 -0
- package/dist/esm/time-period-selector.entry.js +1 -1
- package/dist/esm/{utils-3e18e0b2.js → utils-157014b4.js} +62 -3
- package/dist/esm/utils-157014b4.js.map +1 -0
- package/dist/esm/{utils-db11d29c.js → utils-e6b73120.js} +62 -3
- package/dist/esm/utils-e6b73120.js.map +1 -0
- package/dist/{esm/index.es-e4f027a2.js → nylas-web-elements/index.es-eb477d56.js} +3 -3
- package/dist/nylas-web-elements/index.es-eb477d56.js.map +1 -0
- package/dist/nylas-web-elements/index.esm.js +2 -2
- package/dist/{esm/mailbox-store-5075f820.js → nylas-web-elements/mailbox-store-9f819402.js} +3 -3
- package/dist/{esm/mailbox-store-69c5c5f6.js.map → nylas-web-elements/mailbox-store-9f819402.js.map} +1 -1
- package/dist/nylas-web-elements/multi-select-dropdown.entry.js +1 -1
- package/dist/nylas-web-elements/nylas-additional-participants.entry.js +2 -2
- package/dist/{esm/nylas-api-request-6a19db25.js → nylas-web-elements/nylas-api-request-ff2869d7.js} +2 -2
- package/dist/nylas-web-elements/{nylas-api-request-6a19db25.js.map → nylas-api-request-ff2869d7.js.map} +1 -1
- package/dist/nylas-web-elements/nylas-availability-picker.entry.js +4 -3
- package/dist/nylas-web-elements/nylas-availability-picker.entry.js.map +1 -1
- package/dist/nylas-web-elements/nylas-booked-event-card.entry.js +21 -5
- package/dist/nylas-web-elements/nylas-booked-event-card.entry.js.map +1 -1
- package/dist/nylas-web-elements/nylas-booking-calendar-picker.entry.js +2 -2
- package/dist/nylas-web-elements/nylas-booking-form.entry.js +2 -2
- package/dist/nylas-web-elements/nylas-buffer-time.entry.js +4 -4
- package/dist/nylas-web-elements/nylas-buffer-time.entry.js.map +1 -1
- package/dist/nylas-web-elements/nylas-calendar-picker.entry.js +2 -2
- package/dist/nylas-web-elements/nylas-cancel-booking-form.entry.js +2 -2
- package/dist/nylas-web-elements/nylas-cancelled-event-card.entry.js +22 -5
- package/dist/nylas-web-elements/nylas-cancelled-event-card.entry.js.map +1 -1
- package/dist/nylas-web-elements/nylas-composer.entry.js +1 -1
- package/dist/nylas-web-elements/nylas-custom-booking-flow.entry.js +2 -2
- package/dist/nylas-web-elements/nylas-date-picker.entry.js +15 -3
- package/dist/nylas-web-elements/nylas-date-picker.entry.js.map +1 -1
- package/dist/nylas-web-elements/nylas-editor-tabs.entry.js +18 -12
- package/dist/nylas-web-elements/nylas-editor-tabs.entry.js.map +1 -1
- package/dist/nylas-web-elements/nylas-event-description.entry.js +2 -2
- package/dist/nylas-web-elements/nylas-event-duration.entry.js +2 -2
- package/dist/nylas-web-elements/nylas-event-info.entry.js +3 -3
- package/dist/nylas-web-elements/nylas-event-info.entry.js.map +1 -1
- package/dist/nylas-web-elements/nylas-event-limits.entry.js +3 -3
- package/dist/nylas-web-elements/nylas-event-limits.entry.js.map +1 -1
- package/dist/nylas-web-elements/nylas-event-title.entry.js +2 -2
- package/dist/nylas-web-elements/nylas-form-card.entry.js +2 -2
- package/dist/nylas-web-elements/nylas-if-state.entry.js +2 -2
- package/dist/nylas-web-elements/nylas-limit-future-bookings.entry.js +3 -3
- package/dist/nylas-web-elements/nylas-limit-future-bookings.entry.js.map +1 -1
- package/dist/nylas-web-elements/nylas-list-configurations.entry.js +8 -6
- package/dist/nylas-web-elements/nylas-list-configurations.entry.js.map +1 -1
- package/dist/nylas-web-elements/nylas-list-folders.entry.js +2 -2
- package/dist/nylas-web-elements/nylas-list-threads.entry.js +2 -2
- package/dist/nylas-web-elements/nylas-locale-switch.entry.js +2 -2
- package/dist/nylas-web-elements/nylas-location-component.entry.js +3 -3
- package/dist/nylas-web-elements/nylas-location-component.entry.js.map +1 -1
- package/dist/nylas-web-elements/nylas-login.entry.js +2 -2
- package/dist/nylas-web-elements/nylas-mailbox-pagination.entry.js +2 -2
- package/dist/nylas-web-elements/nylas-mailbox-toolbar-button.entry.js +2 -2
- package/dist/nylas-web-elements/nylas-mailbox.entry.js +3 -3
- package/dist/nylas-web-elements/nylas-min-cancellation-notice.entry.js +3 -3
- package/dist/nylas-web-elements/nylas-min-cancellation-notice.entry.js.map +1 -1
- package/dist/nylas-web-elements/nylas-notification.entry.js +1 -1
- package/dist/nylas-web-elements/nylas-provider.entry.js +5 -5
- package/dist/nylas-web-elements/nylas-scheduler-editor.entry.js +8 -14
- package/dist/nylas-web-elements/nylas-scheduler-editor.entry.js.map +1 -1
- package/dist/nylas-web-elements/nylas-scheduling.entry.js +35 -12
- package/dist/nylas-web-elements/nylas-scheduling.entry.js.map +1 -1
- package/dist/nylas-web-elements/nylas-selected-event-card.entry.js +2 -2
- package/dist/nylas-web-elements/nylas-summarize-message-button.entry.js +2 -2
- package/dist/nylas-web-elements/nylas-threads-refresh.entry.js +2 -2
- package/dist/nylas-web-elements/nylas-threads-search.entry.js +2 -2
- package/dist/nylas-web-elements/nylas-time-window-picker.entry.js +1 -1
- package/dist/nylas-web-elements/nylas-timeslot-picker.entry.js +2 -2
- package/dist/nylas-web-elements/nylas-view-email.entry.js +1 -1
- package/dist/nylas-web-elements/nylas-view-thread.entry.js +2 -2
- package/dist/nylas-web-elements/nylas-web-elements.esm.js +1 -1
- package/dist/nylas-web-elements/{p-ad7cf473.js → p-01e86103.js} +2 -2
- package/dist/nylas-web-elements/p-01e86103.js.map +1 -0
- package/dist/nylas-web-elements/{p-a17f542c.entry.js → p-0d1caebd.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-a3b1a98c.js → p-0dabcb4d.js} +2 -2
- package/dist/nylas-web-elements/{p-22531c3d.entry.js → p-2b63efd8.entry.js} +2 -2
- package/dist/nylas-web-elements/p-30f17ef2.entry.js +2 -0
- package/dist/nylas-web-elements/p-30f17ef2.entry.js.map +1 -0
- package/dist/nylas-web-elements/{p-21c3dcad.entry.js → p-38675cc5.entry.js} +2 -2
- package/dist/nylas-web-elements/p-39aa2263.js +2 -0
- package/dist/nylas-web-elements/p-39aa2263.js.map +1 -0
- package/dist/nylas-web-elements/{p-980c32d9.entry.js → p-44a0f658.entry.js} +3 -3
- package/dist/nylas-web-elements/{p-980c32d9.entry.js.map → p-44a0f658.entry.js.map} +1 -1
- package/dist/nylas-web-elements/{p-828165d3.entry.js → p-47fa06de.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-7614e31e.entry.js → p-48b205a2.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-f3974e14.entry.js → p-551871cb.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-434fcde2.entry.js → p-61b25ea6.entry.js} +2 -2
- package/dist/nylas-web-elements/p-74492776.entry.js +2 -0
- package/dist/nylas-web-elements/p-74492776.entry.js.map +1 -0
- package/dist/nylas-web-elements/{p-7687925d.entry.js → p-75bc6ef8.entry.js} +2 -2
- package/dist/nylas-web-elements/p-76461af6.entry.js +2 -0
- package/dist/nylas-web-elements/p-76461af6.entry.js.map +1 -0
- package/dist/nylas-web-elements/{p-2d151de9.entry.js → p-78e7f732.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-f0f3f350.js → p-8b53becf.js} +2 -2
- package/dist/nylas-web-elements/{p-47b99cf5.js → p-8f88a748.js} +2 -2
- package/dist/nylas-web-elements/p-8ffc644d.entry.js +2 -0
- package/dist/nylas-web-elements/p-8ffc644d.entry.js.map +1 -0
- package/dist/nylas-web-elements/{p-f5d17746.entry.js → p-933c6d32.entry.js} +4 -4
- package/dist/nylas-web-elements/p-933c6d32.entry.js.map +1 -0
- package/dist/nylas-web-elements/{p-4154e97e.entry.js → p-a002b4cf.entry.js} +2 -2
- package/dist/nylas-web-elements/p-ab09a78d.js +2 -0
- package/dist/nylas-web-elements/p-ab09a78d.js.map +1 -0
- package/dist/nylas-web-elements/p-b1b3eb52.entry.js +2 -0
- package/dist/nylas-web-elements/p-b1b3eb52.entry.js.map +1 -0
- package/dist/nylas-web-elements/{p-f47163ac.entry.js → p-b302fbb1.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-5caa0f36.entry.js → p-b77c316c.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-d5375409.entry.js → p-d3065401.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-bb89e973.entry.js → p-da732fb1.entry.js} +2 -2
- package/dist/nylas-web-elements/p-ee91a2a0.js +2 -0
- package/dist/nylas-web-elements/p-ee91a2a0.js.map +1 -0
- package/dist/{esm/register-component-ff6f5df4.js → nylas-web-elements/register-component-0462b27d.js} +2 -2
- package/dist/nylas-web-elements/{register-component-ff6f5df4.js.map → register-component-0462b27d.js.map} +1 -1
- package/dist/{esm/scheduler-config-store-8f2e658e.js → nylas-web-elements/scheduler-config-store-8ccc8dc7.js} +3 -4
- package/dist/nylas-web-elements/scheduler-config-store-8ccc8dc7.js.map +1 -0
- package/dist/nylas-web-elements/{scheduler-store-e62b2146.js → scheduler-store-e314bbe6.js} +39 -7
- package/dist/nylas-web-elements/scheduler-store-e314bbe6.js.map +1 -0
- package/dist/nylas-web-elements/time-period-selector.entry.js +1 -1
- package/dist/nylas-web-elements/{utils-3e18e0b2.js → utils-157014b4.js} +62 -3
- package/dist/nylas-web-elements/utils-157014b4.js.map +1 -0
- package/dist/types/common/types.d.ts +10 -0
- package/dist/types/components/scheduler/nylas-booked-event-card/nylas-booked-event-card.d.ts +8 -1
- package/dist/types/components/scheduler/nylas-cancelled-event-card/nylas-cancelled-event-card.d.ts +8 -2
- package/dist/types/components/scheduler/nylas-date-picker/nylas-date-picker.d.ts +3 -0
- package/dist/types/components/scheduler/nylas-scheduler/nylas-scheduling.d.ts +2 -0
- package/dist/types/components/scheduler-editor/nylas-availability-picker/nylas-availability-picker.d.ts +1 -1
- package/dist/types/components/scheduler-editor/nylas-editor-tabs/nylas-editor-tabs.d.ts +2 -1
- package/dist/types/components/scheduler-editor/nylas-scheduler-editor/nylas-scheduler-editor.d.ts +1 -2
- package/dist/types/components.d.ts +87 -16
- package/dist/types/connector/shared/api/scheduler.d.ts +4 -1
- package/dist/types/stores/scheduler-config-store.d.ts +0 -1
- package/dist/types/stores/scheduler-store.d.ts +11 -0
- package/dist/types/utils/utils.d.ts +4 -0
- package/package.json +3 -3
- package/dist/cjs/add-circle-icon_22.cjs.entry.js.map +0 -1
- package/dist/cjs/index.es-4a7d8d3f.js.map +0 -1
- package/dist/cjs/index.es-b2cce060.js.map +0 -1
- package/dist/cjs/scheduler-config-store-37690bf0.js.map +0 -1
- package/dist/cjs/scheduler-config-store-529c8d7e.js.map +0 -1
- package/dist/cjs/scheduler-store-22103c86.js.map +0 -1
- package/dist/cjs/scheduler-store-fad9ed7a.js.map +0 -1
- package/dist/cjs/utils-9fc33c77.js.map +0 -1
- package/dist/cjs/utils-d8cfc3be.js.map +0 -1
- package/dist/components/nylas-custom-booking-flow2.js +0 -174
- package/dist/components/nylas-custom-booking-flow2.js.map +0 -1
- package/dist/esm/add-circle-icon_22.entry.js.map +0 -1
- package/dist/esm/index.es-df564f87.js.map +0 -1
- package/dist/esm/index.es-e4f027a2.js.map +0 -1
- package/dist/esm/scheduler-config-store-07d98279.js.map +0 -1
- package/dist/esm/scheduler-config-store-8f2e658e.js.map +0 -1
- package/dist/esm/scheduler-store-24fd0e91.js.map +0 -1
- package/dist/esm/scheduler-store-e62b2146.js.map +0 -1
- package/dist/esm/utils-3e18e0b2.js.map +0 -1
- package/dist/esm/utils-db11d29c.js.map +0 -1
- package/dist/nylas-web-elements/index.es-e4f027a2.js.map +0 -1
- package/dist/nylas-web-elements/p-074919b0.entry.js +0 -2
- package/dist/nylas-web-elements/p-074919b0.entry.js.map +0 -1
- package/dist/nylas-web-elements/p-349f07e3.entry.js +0 -2
- package/dist/nylas-web-elements/p-349f07e3.entry.js.map +0 -1
- package/dist/nylas-web-elements/p-4c12e1e9.js +0 -2
- package/dist/nylas-web-elements/p-4c12e1e9.js.map +0 -1
- package/dist/nylas-web-elements/p-ad7cf473.js.map +0 -1
- package/dist/nylas-web-elements/p-c529dced.entry.js +0 -2
- package/dist/nylas-web-elements/p-c529dced.entry.js.map +0 -1
- package/dist/nylas-web-elements/p-da74ec1c.entry.js +0 -2
- package/dist/nylas-web-elements/p-da74ec1c.entry.js.map +0 -1
- package/dist/nylas-web-elements/p-db15d382.js +0 -2
- package/dist/nylas-web-elements/p-db15d382.js.map +0 -1
- package/dist/nylas-web-elements/p-f0250b7d.js +0 -2
- package/dist/nylas-web-elements/p-f0250b7d.js.map +0 -1
- package/dist/nylas-web-elements/p-f5d17746.entry.js.map +0 -1
- package/dist/nylas-web-elements/scheduler-config-store-8f2e658e.js.map +0 -1
- package/dist/nylas-web-elements/scheduler-store-e62b2146.js.map +0 -1
- package/dist/nylas-web-elements/utils-3e18e0b2.js.map +0 -1
- /package/dist/nylas-web-elements/{p-a17f542c.entry.js.map → p-0d1caebd.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-a3b1a98c.js.map → p-0dabcb4d.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-22531c3d.entry.js.map → p-2b63efd8.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-21c3dcad.entry.js.map → p-38675cc5.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-828165d3.entry.js.map → p-47fa06de.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-7614e31e.entry.js.map → p-48b205a2.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-f3974e14.entry.js.map → p-551871cb.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-434fcde2.entry.js.map → p-61b25ea6.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-7687925d.entry.js.map → p-75bc6ef8.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-2d151de9.entry.js.map → p-78e7f732.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-f0f3f350.js.map → p-8b53becf.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-47b99cf5.js.map → p-8f88a748.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-4154e97e.entry.js.map → p-a002b4cf.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-f47163ac.entry.js.map → p-b302fbb1.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-5caa0f36.entry.js.map → p-b77c316c.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-d5375409.entry.js.map → p-d3065401.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-bb89e973.entry.js.map → p-da732fb1.entry.js.map} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"scheduler-config-store-8ccc8dc7.js","mappings":";;SA0CgB,+BAA+B,CAAC,eAAwD,EAAE;IACxG,MAAM,2BAA2B,GAAmC;QAClE,qBAAqB,EAAE,EAAE;QACzB,cAAc,EAAE,EAAE;QAClB,SAAS,EAAE,EAAE;QACb,WAAW,EAAE,IAAI;QACjB,MAAM,EAAE,IAAI;QACZ,GAAG,YAAY;KAChB,CAAC;IACF,MAAM,KAAK,GAAG,WAAW,CAAiC,2BAA2B,CAAC,CAAC;IAMvF,SAAS,0BAA0B;QACjC,KAAK,CAAC,GAAG,CAAC,uBAAuB,EAAE,EAAE,GAAG,YAAY,CAAC,uBAAuB,CAAC,EAAE,CAAC,CAAC;KAClF;IAED,KAAK,CAAC,QAAQ,CAAC,QAAQ,EAAE,OAAM,MAAM;QACnC,IAAI,CAAC,MAAM,EAAE;YACX,0BAA0B,EAAE,CAAC;SAC9B;KACF,CAAC,CAAC;IAEH,OAAO;QACL,GAAG,KAAK;QACR,0BAA0B;KAC3B,CAAC;AACJ;;;;","names":[],"sources":["src/stores/scheduler-config-store.ts"],"sourcesContent":["import { Calendar, Configuration } from '@nylas/core';\nimport { ObservableMap, createStore } from '@stencil/store';\nimport { User } from '@/common/nylas-api-request';\n\nexport interface NylasSchedulerConfigStoreState {\n /**\n * The selected configuration.\n * This is the configuration that is currently selected, use it to populate default values for new configurations.\n */\n selectedConfiguration: Partial<Configuration>;\n /**\n * The list of configurations.\n * This is the list of configurations that the user has created.\n */\n configurations: Configuration[];\n /**\n * The list of calendars.\n * This is the list of calendars that the user has access to.\n */\n calendars: Calendar[];\n /**\n * The current user.\n * This is the user that is currently logged in.\n */\n currentUser: User | null;\n /**\n * The current action.\n * This is the current action that the user is performing.\n */\n action: 'create' | 'edit' | null;\n}\n\nexport type NylasSchedulerConfigStoreType = ReturnType<typeof CreateNylasSchedulerConfigStore>;\n\nexport type CreateNylasSchedulerConfigStoreReturnType = ObservableMap<NylasSchedulerConfigStoreState> & {\n /**\n * Reset the selected configuration to the default state.\n * This is used to reset the selected configuration to the default state instead of setting it to an empty object.\n */\n resetSelectedConfiguration: () => void;\n};\n\nexport function CreateNylasSchedulerConfigStore(defaultState: Partial<NylasSchedulerConfigStoreState> = {}): CreateNylasSchedulerConfigStoreReturnType {\n const defaultSchedulerConfigState: NylasSchedulerConfigStoreState = {\n selectedConfiguration: {},\n configurations: [],\n calendars: [],\n currentUser: null,\n action: null,\n ...defaultState,\n };\n const store = createStore<NylasSchedulerConfigStoreState>(defaultSchedulerConfigState);\n\n /**\n * Reset the selected configuration to the default state.\n * This is used to reset the selected configuration to the default state instead of setting it to an empty object.\n */\n function resetSelectedConfiguration() {\n store.set('selectedConfiguration', { ...defaultState['selectedConfiguration'] });\n }\n\n store.onChange('action', async action => {\n if (!action) {\n resetSelectedConfiguration();\n }\n });\n\n return {\n ...store,\n resetSelectedConfiguration,\n };\n}\n"],"version":3}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as debug } from './utils-
|
|
1
|
+
import { a as debug } from './utils-157014b4.js';
|
|
2
2
|
import { c as createStore } from './index-11d12497.js';
|
|
3
3
|
|
|
4
4
|
var ErrorCategory;
|
|
@@ -157,6 +157,7 @@ class NylaSchedulerAPIConnector {
|
|
|
157
157
|
method,
|
|
158
158
|
headers: {
|
|
159
159
|
'Content-Type': 'application/json',
|
|
160
|
+
'Origin': window.location.origin,
|
|
160
161
|
...headers,
|
|
161
162
|
},
|
|
162
163
|
body,
|
|
@@ -207,12 +208,8 @@ class NylaSchedulerAPIConnector {
|
|
|
207
208
|
},
|
|
208
209
|
});
|
|
209
210
|
}
|
|
210
|
-
async
|
|
211
|
+
async resetStoreStateAndFetchAvailability() {
|
|
211
212
|
const today = new Date();
|
|
212
|
-
this.schedulerStore.set('rescheduleBookingId', bookingID);
|
|
213
|
-
this.schedulerStore.set('selectedTimeslot', null);
|
|
214
|
-
this.schedulerStore.set('eventInfo', null);
|
|
215
|
-
this.schedulerStore.set('showBookingForm', false);
|
|
216
213
|
const startTime = new Date(today.getFullYear(), today.getMonth(), 1).getTime() / 1000;
|
|
217
214
|
const endTime = new Date(today.getFullYear(), today.getMonth() + 1, 1).getTime() / 1000;
|
|
218
215
|
const result = await this.getAvailability(startTime, endTime);
|
|
@@ -222,11 +219,25 @@ class NylaSchedulerAPIConnector {
|
|
|
222
219
|
_selectedDate = firstAvailableDate.start_time;
|
|
223
220
|
}
|
|
224
221
|
this.schedulerStore.set('selectedDate', _selectedDate);
|
|
222
|
+
this.schedulerStore.set('eventInfo', null);
|
|
223
|
+
this.schedulerStore.set('showBookingForm', false);
|
|
224
|
+
this.schedulerStore.set('selectedTimeslot', null);
|
|
225
|
+
return result;
|
|
226
|
+
}
|
|
227
|
+
async setReschedule(bookingID) {
|
|
228
|
+
const result = await this.resetStoreStateAndFetchAvailability();
|
|
229
|
+
this.schedulerStore.set('rescheduleBookingId', bookingID);
|
|
225
230
|
return result;
|
|
226
231
|
}
|
|
227
232
|
async setCancel(bookingID) {
|
|
228
233
|
this.schedulerStore.set('cancelBookingId', bookingID);
|
|
229
234
|
}
|
|
235
|
+
async resetCancel() {
|
|
236
|
+
const result = await this.resetStoreStateAndFetchAvailability();
|
|
237
|
+
this.schedulerStore.set('cancelBookingId', '');
|
|
238
|
+
this.schedulerStore.set('cancelledEventInfo', null);
|
|
239
|
+
return result;
|
|
240
|
+
}
|
|
230
241
|
async bookTimeslot(data) {
|
|
231
242
|
this.schedulerStore.set('isLoading', true);
|
|
232
243
|
const { selectedTimeslot, selectedTimezone, bookingInfo } = this.schedulerStore.state;
|
|
@@ -269,6 +280,27 @@ class NylaSchedulerAPIConnector {
|
|
|
269
280
|
this.schedulerStore.set('isLoading', false);
|
|
270
281
|
return response;
|
|
271
282
|
}
|
|
283
|
+
async getUISettings() {
|
|
284
|
+
this.schedulerStore.set('isLoading', true);
|
|
285
|
+
const headers = this.getHeaders();
|
|
286
|
+
const configIdParam = this.configId ? `?configuration_id=${this.configId}` : '';
|
|
287
|
+
const url = `/v3/scheduling/ui-settings${configIdParam}`;
|
|
288
|
+
const response = await this.makeAPIRequest(url, 'GET', undefined, headers);
|
|
289
|
+
if ('error' in response) {
|
|
290
|
+
this.schedulerStore.set('isLoading', false);
|
|
291
|
+
const errorType = response.error?.type;
|
|
292
|
+
let error = response.error;
|
|
293
|
+
if (errorType && errorType in this.errors.api('Get UI Settings')) {
|
|
294
|
+
error = this.errors.api('Get UI Settings')[errorType](error?.message || error?.title || 'Something went wrong');
|
|
295
|
+
}
|
|
296
|
+
return { error };
|
|
297
|
+
}
|
|
298
|
+
if ('data' in response) {
|
|
299
|
+
this.schedulerStore.set('configSettings', response.data);
|
|
300
|
+
}
|
|
301
|
+
this.schedulerStore.set('isLoading', false);
|
|
302
|
+
return response;
|
|
303
|
+
}
|
|
272
304
|
async getAvailability(startTime = 0, endTime = 0) {
|
|
273
305
|
this.schedulerStore.set('isLoading', true);
|
|
274
306
|
const params = new URLSearchParams();
|
|
@@ -430,4 +462,4 @@ function CreateNylasSchedulerStore(defaultState = {}) {
|
|
|
430
462
|
|
|
431
463
|
export { CreateNylasSchedulerStore as C, ErrorCategory as E, NylaSchedulerAPIConnector as N };
|
|
432
464
|
|
|
433
|
-
//# sourceMappingURL=scheduler-store-
|
|
465
|
+
//# sourceMappingURL=scheduler-store-e314bbe6.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"scheduler-store-e314bbe6.js","mappings":";;;IAAY;AAAZ,WAAY,aAAa;IACvB,wCAAuB,CAAA;IACvB,4BAAW,CAAA;IACX,8BAAa,CAAA;AACf,CAAC,EAJW,aAAa,KAAb,aAAa,QAIxB;AAQD,IAAY,kBASX;AATD,WAAY,kBAAkB;IAC5B,qEAA+C,CAAA;IAC/C,yDAAmC,CAAA;IACnC,mEAA6C,CAAA;IAC7C,mEAA6C,CAAA;IAC7C,qDAA+B,CAAA;IAC/B,+DAAyC,CAAA;IACzC,2DAAqC,CAAA;IACrC,2DAAqC,CAAA;AACvC,CAAC,EATW,kBAAkB,KAAlB,kBAAkB,QAS7B;AAED,IAAY,YAMX;AAND,WAAY,YAAY;IACtB,mDAAmC,CAAA;IACnC,+CAA+B,CAAA;IAC/B,iDAAiC,CAAA;IACjC,+DAA+C,CAAA;IAC/C,iEAAiD,CAAA;AACnD,CAAC,EANW,YAAY,KAAZ,YAAY,QAMvB;MAEY,MAAM;IAAnB;QACE,cAAS,GAAG,CAAC,MAAc;YACzB,MAAM,QAAQ,GAAG,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MAAM,KAAK,GAAG,sBAAsB,CAAC,GAA0C,CAAC,CAAC;YACjF,KAAK,CAAC,GAAG,CAAC,GAAU,EAAE,KAAK,CAAC,CAAC;SAC9B;KACF,CAAC;IAEF,OAAO,KAAK,CAAC;AACf;;;;","names":[],"sources":["src/connector/nylas-scheduler-connector/errors/index.ts","src/connector/shared/api/scheduler.ts","src/stores/scheduler-store.ts"],"sourcesContent":["export enum ErrorCategory {\n Component = 'component',\n Api = 'api',\n Auth = 'auth',\n}\n\nexport interface ErrorDetails {\n title: string;\n message: string;\n category: ErrorCategory;\n}\n\nexport enum ComponentErrorType {\n endtime_not_in_future = 'endtime_not_in_future',\n no_booking_info = 'no_booking_info',\n no_timeslot_selected = 'no_timeslot_selected',\n no_timezone_selected = 'no_timezone_selected',\n no_booking_id = 'no_booking_id',\n invalid_start_time = 'invalid_start_time',\n invalid_end_time = 'invalid_end_time',\n invalid_timezone = 'invalid_timezone',\n}\n\nexport enum APIErrorType {\n invalid_session = 'invalid_session',\n general_error = 'general_error',\n internal_error = 'internal_error',\n invalid_request_error = 'invalid_request_error',\n timeslot_not_available = 'timeslot_not_available',\n}\n\nexport class Errors {\n component = (_title: string): Record<ComponentErrorType, (message?: string) => ErrorDetails> => {\n const category = ErrorCategory.Component;\n const title = `${_title} error`;\n return {\n endtime_not_in_future: (message: string = '\"endtime\" can not be in the future') => {\n return {\n title,\n message,\n category,\n };\n },\n no_booking_info: (message: string = 'No booking info provided') => {\n return {\n title,\n message,\n category,\n };\n },\n no_timeslot_selected: (message: string = 'No timeslot selected') => {\n return {\n title,\n message,\n category,\n };\n },\n no_timezone_selected: (message: string = 'No timezone selected') => {\n return {\n title,\n message,\n category,\n };\n },\n no_booking_id: (message: string = 'No booking id provided') => {\n return {\n title,\n message,\n category,\n };\n },\n invalid_start_time: (message: string = 'Invalid start time') => {\n return {\n title,\n message,\n category,\n };\n },\n invalid_end_time: (message: string = 'Invalid end time') => {\n return {\n title,\n message,\n category,\n };\n },\n invalid_timezone: (message: string = 'Invalid timezone') => {\n return {\n title,\n message,\n category,\n };\n },\n };\n };\n\n api = (_title: string): Record<APIErrorType, (message: string) => ErrorDetails> => {\n const category = ErrorCategory.Api;\n const title = `${_title} error`;\n\n return {\n invalid_session: (message: string) => {\n return {\n title,\n message,\n category,\n };\n },\n general_error: (message: string) => {\n return {\n title,\n message,\n category,\n };\n },\n internal_error: (message: string) => {\n return {\n title,\n message,\n category,\n };\n },\n invalid_request_error: (message: string) => {\n return {\n title,\n message,\n category,\n };\n },\n timeslot_not_available: (message: string) => {\n return {\n title,\n message,\n category,\n };\n },\n };\n };\n}\n","import { AvailabilityResponse, NylasEvent, UISettingsResponse } from '@/common/types';\nimport { NylasSchedulerStoreType } from '../../../components';\nimport type { NylasErrorResponse, NylasResponse, NylasSchedulerBookingData, NylasSchedulerResponse, Timeslot } from '@nylas/core';\nimport { APIErrorType, Errors } from '@/connector/nylas-scheduler-connector/errors';\n\ntype NylasSchedulerAPIConnectorOptions = {\n schedulerAPIURL: string;\n schedulerStore: NylasSchedulerStoreType;\n sessionId?: string;\n configId?: string;\n};\n\n/**\n * NylaSchedulerConnector\n * This class is used to make API requests to the scheduler.\n */\nexport class NylaSchedulerAPIConnector {\n private schedulerStore: NylasSchedulerStoreType;\n private schedulerAPIURL: string;\n private sessionId: string | undefined;\n private configId: string | undefined;\n private errors = new Errors();\n\n constructor({ schedulerAPIURL, schedulerStore, sessionId, configId }: NylasSchedulerAPIConnectorOptions) {\n this.schedulerStore = schedulerStore;\n this.schedulerAPIURL = schedulerAPIURL;\n this.sessionId = sessionId;\n this.configId = configId;\n }\n\n private getHeaders() {\n return !this.configId\n ? {\n Authorization: `Bearer ${this.sessionId}`,\n }\n : {};\n }\n\n /**\n * Makes an API request to the scheduler.\n * @param path The path to the API endpoint.\n * @param method The HTTP method.\n * @param body The request body (if any).\n * @returns {Promise<T>}\n */\n public async makeAPIRequest<T>(path: string, method: string, body: string | undefined, headers = {}): Promise<NylasResponse<T>> {\n try {\n const schedulerURL = new URL(this.schedulerAPIURL);\n schedulerURL.pathname = path;\n const response = await fetch(decodeURIComponent(schedulerURL.toString()), {\n method,\n headers: {\n 'Content-Type': 'application/json',\n 'Origin': window.location.origin,\n ...headers,\n },\n body,\n });\n // The server returns a json object for errors: eg.\n // {\n // \"request_id\": \"<request_id>\",\n // \"error\": {\n // \"type\": \"not_found_error\",\n // \"message\": \"Session not found\"\n // }\n // }\n const data = await response.json();\n return data as NylasResponse<T>;\n } catch (error: any) {\n // NOTE: current server implementation doesn't return a JSON object for errors on some endpoints\n // handle this case by returning the error response as a string to be handled downstream\n return {\n error: {\n message: error.message,\n title: 'API request failed',\n type: 'api',\n },\n } as NylasErrorResponse;\n }\n }\n\n /**\n * Selects a date in the scheduler.\n */\n public selectDate(date: Date) {\n this.schedulerStore.set('selectedDate', date);\n this.schedulerStore.set('selectedTimeslot', null);\n }\n\n /**\n * Selects a time in the scheduler.\n */\n public selectTime(time: Timeslot) {\n this.schedulerStore.set('selectedTimeslot', time);\n }\n\n /**\n * Sets the timezone in the scheduler.\n */\n public selectTimezone(timezone: string) {\n this.schedulerStore.set('selectedTimezone', timezone);\n }\n\n /**\n * Toggles showBookingForm\n * @param value boolean\n */\n public toggleAdditionalData(value: boolean) {\n this.schedulerStore.set('showBookingForm', value);\n }\n\n /**\n * Set/update the name of the participant booking the event.\n */\n public setParticipantName(name: string) {\n const { bookingInfo } = this.schedulerStore.state;\n this.schedulerStore.set('bookingInfo', {\n ...bookingInfo,\n primaryParticipant: {\n ...(bookingInfo?.primaryParticipant as NylasSchedulerBookingData['primaryParticipant']),\n name,\n },\n });\n }\n\n /**\n * Set/update the email of the participant booking the event.\n */\n public setParticipantEmail(email: string) {\n const { bookingInfo } = this.schedulerStore.state;\n this.schedulerStore.set('bookingInfo', {\n ...bookingInfo,\n primaryParticipant: {\n ...(bookingInfo?.primaryParticipant as NylasSchedulerBookingData['primaryParticipant']),\n email,\n },\n });\n }\n\n private async resetStoreStateAndFetchAvailability() {\n const today = new Date();\n // Refetch availability\n const startTime = new Date(today.getFullYear(), today.getMonth(), 1).getTime() / 1000;\n const endTime = new Date(today.getFullYear(), today.getMonth() + 1, 1).getTime() / 1000;\n const result = await this.getAvailability(startTime, endTime);\n // Set selected date to first available date\n const firstAvailableDate = this.schedulerStore.get('availability').find((timeslot: any) => new Date(timeslot.start_time) > new Date());\n let _selectedDate = today;\n if (firstAvailableDate) {\n _selectedDate = firstAvailableDate.start_time;\n }\n this.schedulerStore.set('selectedDate', _selectedDate);\n // Reset store state\n this.schedulerStore.set('eventInfo', null);\n this.schedulerStore.set('showBookingForm', false);\n this.schedulerStore.set('selectedTimeslot', null);\n\n return result;\n }\n\n /**\n * Set reschedule booking id\n */\n public async setReschedule(bookingID: string) {\n // Set reschedule booking id\n const result = await this.resetStoreStateAndFetchAvailability();\n this.schedulerStore.set('rescheduleBookingId', bookingID);\n return result;\n }\n\n /**\n * Set cancel booking id\n */\n public async setCancel(bookingID: string) {\n this.schedulerStore.set('cancelBookingId', bookingID);\n }\n\n public async resetCancel() {\n const result = await this.resetStoreStateAndFetchAvailability();\n this.schedulerStore.set('cancelBookingId', '');\n this.schedulerStore.set('cancelledEventInfo', null);\n return result;\n }\n\n /**\n * Book the selected timeslot.\n * @param data The booking info.\n * @returns {Promise<NylasResponse<NylasEvent>>}\n */\n public async bookTimeslot(data?: NylasSchedulerBookingData & { timeslot?: Timeslot }): Promise<NylasSchedulerResponse<NylasEvent>> {\n this.schedulerStore.set('isLoading', true);\n const { selectedTimeslot, selectedTimezone, bookingInfo } = this.schedulerStore.state;\n if (!data && !bookingInfo) {\n return { error: this.errors.component('Booking').no_booking_info() };\n }\n\n const timeslot = data?.timeslot || selectedTimeslot;\n if (!timeslot) {\n return { error: this.errors.component('Create Booking').no_timeslot_selected() };\n }\n\n const timezone = data && data?.timezone ? data?.timezone : selectedTimezone;\n\n if (!timezone) {\n return { error: this.errors.component('Create Booking').no_timezone_selected() };\n }\n\n const primaryParticipant = data ? data?.primaryParticipant : bookingInfo?.primaryParticipant;\n const guests = data ? data?.guests || [] : bookingInfo?.guests || [];\n const additional_fields = data ? { ...data?.additionalFields, guests } : { ...bookingInfo?.additionalFields, guests };\n\n const headers = this.getHeaders();\n const configIdParam = this.configId ? `?configuration_id=${this.configId}` : '';\n const url = `/v3/scheduling/bookings${configIdParam}`;\n\n const response = await this.makeAPIRequest<NylasEvent>(\n decodeURIComponent(url),\n 'POST',\n JSON.stringify({\n additional_fields,\n guest: { ...primaryParticipant },\n start_time: timeslot.start_time.getTime() / 1000,\n end_time: timeslot.end_time.getTime() / 1000,\n timezone: timezone,\n }),\n headers,\n );\n\n if ('error' in response) {\n this.schedulerStore.set('isLoading', false);\n const errorType = response.error?.type;\n let error = response.error;\n if (errorType && errorType in this.errors.api('Create Booking')) {\n error = this.errors.api('Create Booking')[errorType as APIErrorType](error?.message || error?.title || 'Something went wrong');\n }\n return { error };\n }\n\n if ('data' in response) {\n this.schedulerStore.set('eventInfo', response?.data);\n }\n\n this.schedulerStore.set('isLoading', false);\n return response;\n }\n\n /**\n * Get UI settings for the scheduler.\n */\n public async getUISettings(): Promise<NylasSchedulerResponse<UISettingsResponse>> {\n this.schedulerStore.set('isLoading', true);\n const headers = this.getHeaders();\n const configIdParam = this.configId ? `?configuration_id=${this.configId}` : '';\n const url = `/v3/scheduling/ui-settings${configIdParam}`;\n\n const response = await this.makeAPIRequest<UISettingsResponse>(url, 'GET', undefined, headers);\n if ('error' in response) {\n this.schedulerStore.set('isLoading', false);\n const errorType = response.error?.type;\n let error = response.error;\n if (errorType && errorType in this.errors.api('Get UI Settings')) {\n error = this.errors.api('Get UI Settings')[errorType as APIErrorType](error?.message || error?.title || 'Something went wrong');\n }\n return { error };\n }\n if ('data' in response) {\n this.schedulerStore.set('configSettings', response.data);\n }\n this.schedulerStore.set('isLoading', false);\n return response;\n }\n\n /**\n * Gets the availability for a page.\n * @param startTime The start time.\n * @param endTime The end time.\n * @returns {Promise<AvailabilityResponse>}\n */\n public async getAvailability(startTime: number = 0, endTime: number = 0): Promise<NylasSchedulerResponse<AvailabilityResponse>> {\n this.schedulerStore.set('isLoading', true);\n const params = new URLSearchParams();\n const now = new Date();\n const nowTime = now.getTime();\n\n if (endTime && endTime < nowTime / 1000) {\n this.schedulerStore.set('isLoading', false);\n const error = this.errors.component('Get Availability').endtime_not_in_future();\n return { error };\n }\n\n // Calculate the start of the current month if startTime is not provided\n if (!startTime) {\n const startOfMonth = new Date(now.getFullYear(), now.getMonth(), 1);\n startTime = Math.floor(startOfMonth.getTime() / 1000); // Convert to UNIX timestamp in seconds\n }\n\n // Calculate the end of the current month if endTime is not provided\n if (!endTime) {\n const endOfMonth = new Date(now.getFullYear(), now.getMonth() + 1, 0); // Setting day to 0 gets the last day of the previous month, so in this case, the last day of the current month\n endTime = Math.floor(endOfMonth.getTime() / 1000); // Convert to UNIX timestamp in seconds\n }\n\n params.append('start_time', encodeURIComponent(startTime.toString()));\n params.append('end_time', encodeURIComponent(endTime.toString()));\n if (this.configId) {\n params.append('configuration_id', encodeURIComponent(this.configId));\n }\n const queryString = params.toString();\n const url = `/v3/scheduling/availability${queryString ? `?${queryString}` : ''}`;\n const headers = this.getHeaders();\n const response = await this.makeAPIRequest<AvailabilityResponse>(decodeURIComponent(url), 'GET', undefined, headers);\n\n if ('error' in response) {\n this.schedulerStore.set('availability', []);\n this.schedulerStore.set('isLoading', false);\n const errorType = response.error?.type;\n let error = response.error;\n if (errorType && errorType in this.errors.api('Get Availability')) {\n error = this.errors.api('Get Availability')[errorType as APIErrorType](error?.message || error?.title || 'Something went wrong');\n }\n return { error };\n }\n\n if ('data' in response) {\n const availability =\n response.data?.time_slots?.map(timeslot => {\n return {\n ...timeslot,\n start_time: new Date(timeslot.start_time * 1000),\n end_time: new Date(timeslot.end_time * 1000),\n };\n }) || [];\n\n // Filter out timeslots that are in the past\n const availabilityTimeslotsFiltered = availability.filter(timeslot => timeslot.start_time.getTime() > nowTime);\n this.schedulerStore.set('availability', availabilityTimeslotsFiltered);\n }\n\n this.schedulerStore.set('isLoading', false);\n return response;\n }\n\n /**\n * Cancels a booking.\n * @param bookingId The booking ID.\n */\n public async cancelBooking(bookingId: string): Promise<NylasSchedulerResponse<Partial<NylasEvent>>> {\n this.schedulerStore.set('isLoading', true);\n if (!bookingId) {\n return { error: this.errors.component('Cancel Booking').no_booking_id() };\n }\n const configIdParam = this.configId ? `?configuration_id=${this.configId}` : '';\n const url = `/v3/scheduling/bookings/${bookingId}${configIdParam}`;\n const headers = this.getHeaders();\n const response = await this.makeAPIRequest<Partial<NylasEvent>>(\n decodeURIComponent(url),\n 'DELETE',\n JSON.stringify({\n action: 'cancel',\n }),\n headers,\n );\n\n if ('error' in response) {\n this.schedulerStore.set('isLoading', false);\n const errorType = response.error?.type;\n let error = response.error;\n if (errorType && errorType in this.errors.api('Cancel Booking')) {\n error = this.errors.api('Cancel Booking')[errorType as APIErrorType](error?.message || error?.title || 'Something went wrong');\n }\n return { error };\n }\n\n this.schedulerStore.set('cancelledEventInfo', {\n booking_id: bookingId,\n });\n\n this.schedulerStore.set('isLoading', false);\n return response;\n }\n\n /**\n * Reschedules a booking.\n * @param bookingId The booking ID.\n * @param data The booking info.\n * @returns {Promise<NylasResponse<NylasEvent>>}\n */\n public async rescheduleBooking(bookingId: string, data: NylasSchedulerBookingData): Promise<NylasSchedulerResponse<NylasEvent>> {\n this.schedulerStore.set('isLoading', true);\n if (!bookingId) {\n return { error: this.errors.component('Reschedule Booking').no_booking_id() };\n }\n const apiErrors = this.errors.api('Reschedule Booking');\n const componentErrors = this.errors.component('Reschedule Booking');\n const { bookingInfo, selectedTimeslot, selectedTimezone } = this.schedulerStore.state;\n // Validate data\n const { startTime, endTime, timezone } = data;\n const start_time = startTime || selectedTimeslot?.start_time;\n\n if (!start_time) {\n return { error: componentErrors.invalid_start_time('Please pass \"startTime\" in data or set \"selectedTimeslot\" in the defaultSchedulerState.') };\n }\n const end_time = endTime || selectedTimeslot?.end_time;\n if (!end_time) {\n return { error: componentErrors.invalid_end_time('Please pass \"endTime\" in data or set \"selectedTimeslot\" in the defaultSchedulerState.') };\n }\n const time_zone = timezone || selectedTimezone;\n if (!time_zone) {\n return { error: componentErrors.invalid_timezone('Please pass \"timezone\" in data or set \"selectedTimezone\" in the defaultSchedulerState.') };\n }\n\n const primaryParticipant = data ? data?.primaryParticipant : bookingInfo?.primaryParticipant;\n const guests = data ? data?.guests || [] : bookingInfo?.guests || [];\n const additional_fields = data ? { ...data?.additionalFields, guests } : { ...bookingInfo?.additionalFields, guests };\n\n const configIdParam = this.configId ? `?configuration_id=${this.configId}` : '';\n const url = `/v3/scheduling/bookings/${bookingId}${configIdParam}`;\n const headers = this.getHeaders();\n const response = await this.makeAPIRequest<NylasEvent>(\n decodeURIComponent(url),\n 'PATCH',\n JSON.stringify({\n start_time: start_time.getTime() / 1000,\n end_time: end_time.getTime() / 1000,\n time_zone,\n additional_fields,\n guest: { ...primaryParticipant },\n }),\n headers,\n );\n\n if ('error' in response) {\n this.schedulerStore.set('isLoading', false);\n const errorType = response.error?.type;\n let error = response.error;\n if (errorType && errorType in apiErrors) {\n error = apiErrors[errorType as APIErrorType](error?.message || error?.title || 'Something went wrong');\n }\n }\n\n if ('data' in response) this.schedulerStore.set('eventInfo', response?.data);\n\n this.schedulerStore.set('isLoading', false);\n return response;\n }\n}\n","import { DataState, NylasEvent } from '@/common/types';\nimport { debug } from '@/utils/utils';\nimport { NylasSchedulerBookingData, Timeslot } from '@nylas/core';\nimport { createStore } from '@stencil/store';\n\nexport type AvailabilityTimeslot = {\n emails: string[];\n start_time: Date;\n end_time: Date;\n};\n\nexport type LoadingState = {\n api: 'availability' | 'createBooking' | 'cancelBooking' | 'rescheduleBooking';\n};\n\nexport type ConfigSettings = {\n scheduler: {\n available_days_in_future: number;\n min_cancellation_notice: number;\n };\n organizer: {\n name: string;\n email: string;\n };\n};\n\nexport interface NylasSchedulerStoreState {\n selectedDate: Date | null;\n selectedLanguage: string;\n selectedTimezone: string;\n selectedTimeslot: Timeslot | null;\n showBookingForm: boolean;\n selectableDates: Date[] | null;\n availability: AvailabilityTimeslot[];\n state: DataState;\n eventInfo: NylasEvent | null;\n cancelledEventInfo: Partial<NylasEvent> | null;\n bookingInfo?: NylasSchedulerBookingData;\n rescheduleBookingId?: string;\n cancelBookingId?: string;\n isLoading: boolean;\n nylasBranding?: boolean;\n configSettings?: ConfigSettings;\n}\n\nexport type NylasSchedulerStoreType = ReturnType<typeof CreateNylasSchedulerStore>;\n\nexport function CreateNylasSchedulerStore(defaultState: Partial<NylasSchedulerStoreState> = {}) {\n const defaultNylasStoreState: NylasSchedulerStoreState = {\n selectedDate: null,\n selectedLanguage: navigator.language,\n selectedTimezone: Intl.DateTimeFormat().resolvedOptions().timeZone,\n selectedTimeslot: null,\n showBookingForm: false,\n selectableDates: null,\n availability: [],\n state: 'ready',\n eventInfo: null,\n cancelledEventInfo: null,\n isLoading: false,\n nylasBranding: true,\n ...defaultState,\n };\n debug(`[defaultNylasStoreState]: `, defaultNylasStoreState);\n const store = createStore<NylasSchedulerStoreState>(defaultNylasStoreState);\n\n store.onChange('availability', availability => {\n debug(`[availability]: `, availability);\n const selectableDates = availability.map(timeslot => timeslot.start_time);\n debug(`[selectableDates]: `, selectableDates);\n store.set('selectableDates', selectableDates);\n });\n\n /**\n * Reset the Nylas store to its default state.\n * There is something wrong with the stencil/store reset method,\n * so we have to do it via this hack.\n */\n store.reset = () => {\n for (const key in defaultNylasStoreState) {\n const value = defaultNylasStoreState[key as keyof typeof defaultNylasStoreState];\n store.set(key as any, value);\n }\n };\n\n return store;\n}\n"],"version":3}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, i as createEvent, h, e as getElement } from './index-8362ce5c.js';
|
|
2
|
-
import { a as debug } from './utils-
|
|
2
|
+
import { a as debug } from './utils-157014b4.js';
|
|
3
3
|
import './_commonjsHelpers-7c16df4a.js';
|
|
4
4
|
|
|
5
5
|
const timePeriodSelectorCss = ".time-period-selector.sc-time-period-selector{display:flex;gap:0.5rem}.time-period-selector.sc-time-period-selector select-dropdown.sc-time-period-selector{border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x)}.time-period-selector.sc-time-period-selector select-dropdown#time-period.sc-time-period-selector::part(sd_dropdown-button){min-width:108px}.time-period-selector.sc-time-period-selector select-dropdown#time-number.sc-time-period-selector::part(sd_dropdown-button){min-width:84px}.time-period-selector.sc-time-period-selector select-dropdown.sc-time-period-selector::part(sd_dropdown-button){padding:1rem;gap:1rem}.time-period-selector.sc-time-period-selector select-dropdown.sc-time-period-selector::part(sd_dropdown-content){width:100%;max-height:200px}";
|
|
@@ -3733,7 +3733,9 @@ function removeUndefined(obj) {
|
|
|
3733
3733
|
}
|
|
3734
3734
|
function debug(...args) {
|
|
3735
3735
|
if (window && window.localStorage && window.localStorage.getItem('debug')) {
|
|
3736
|
-
console.
|
|
3736
|
+
console.group(...args);
|
|
3737
|
+
console.trace();
|
|
3738
|
+
console.groupEnd();
|
|
3737
3739
|
}
|
|
3738
3740
|
}
|
|
3739
3741
|
function error(...args) {
|
|
@@ -4069,7 +4071,64 @@ function isNonPrintableKey(event) {
|
|
|
4069
4071
|
}
|
|
4070
4072
|
return false;
|
|
4071
4073
|
}
|
|
4074
|
+
function addDaysToCurrentDate(startDate, days) {
|
|
4075
|
+
const currentDate = new Date(startDate);
|
|
4076
|
+
currentDate.setDate(currentDate.getDate() + days);
|
|
4077
|
+
currentDate.setHours(23);
|
|
4078
|
+
currentDate.setMinutes(59);
|
|
4079
|
+
currentDate.setSeconds(0);
|
|
4080
|
+
currentDate.setMilliseconds(0);
|
|
4081
|
+
return currentDate;
|
|
4082
|
+
}
|
|
4083
|
+
function addMinutesToCurrentTime(startDate, minutes) {
|
|
4084
|
+
const currentDate = new Date(startDate);
|
|
4085
|
+
currentDate.setMinutes(currentDate.getMinutes() + minutes);
|
|
4086
|
+
return currentDate;
|
|
4087
|
+
}
|
|
4088
|
+
function isObject(item) {
|
|
4089
|
+
return item && typeof item === 'object' && !Array.isArray(item);
|
|
4090
|
+
}
|
|
4091
|
+
function mergeDeep(target, source) {
|
|
4092
|
+
if (Array.isArray(target) && Array.isArray(source) && target !== source) {
|
|
4093
|
+
if (target.some(item => item.is_organizer) && source.some(item => item.is_organizer)) {
|
|
4094
|
+
target = target.map(participant => ({ ...participant, is_organizer: false }));
|
|
4095
|
+
}
|
|
4096
|
+
else if (!source.some(item => item.is_organizer)) {
|
|
4097
|
+
let foundOrganizer = false;
|
|
4098
|
+
target = target.map(participant => {
|
|
4099
|
+
if (!foundOrganizer) {
|
|
4100
|
+
foundOrganizer = true;
|
|
4101
|
+
return { ...participant, is_organizer: true };
|
|
4102
|
+
}
|
|
4103
|
+
return participant;
|
|
4104
|
+
});
|
|
4105
|
+
}
|
|
4106
|
+
return target
|
|
4107
|
+
.map((item, index) => {
|
|
4108
|
+
return source[index] ? mergeDeep(item, source[index]) : item;
|
|
4109
|
+
})
|
|
4110
|
+
.concat(source.slice(target.length));
|
|
4111
|
+
}
|
|
4112
|
+
else if (isObject(target) && isObject(source)) {
|
|
4113
|
+
const output = Object.assign({}, target);
|
|
4114
|
+
Object.keys(source).forEach(key => {
|
|
4115
|
+
if (isObject(source[key])) {
|
|
4116
|
+
if (!(key in target)) {
|
|
4117
|
+
output[key] = source[key];
|
|
4118
|
+
}
|
|
4119
|
+
else {
|
|
4120
|
+
output[key] = mergeDeep(target[key], source[key]);
|
|
4121
|
+
}
|
|
4122
|
+
}
|
|
4123
|
+
else {
|
|
4124
|
+
output[key] = source[key];
|
|
4125
|
+
}
|
|
4126
|
+
});
|
|
4127
|
+
return output;
|
|
4128
|
+
}
|
|
4129
|
+
return source;
|
|
4130
|
+
}
|
|
4072
4131
|
|
|
4073
|
-
export {
|
|
4132
|
+
export { convertTo24HourFormat as A, getBrowser as B, isNonPrintableKey as C, dayjs as D, autocompleteTimeFormat as E, validateTimeFormatInput as F, roundToNearest15Minutes as G, validateExactTimeFormat as H, debug as a, formatParticipants as b, formatDateTime as c, dataResponse as d, error as e, formatFolderName as f, formatEventName as g, addDaysToCurrentDate as h, formatTimeAgo as i, formatRecipient as j, addMinutesToCurrentTime as k, getLastDayOfMonth as l, getFirstDayOfMonth as m, isSameDay as n, isSameMonth as o, mergeDeep as p, parsePreviewLink as q, htmlToPlainText as r, detectIfMessageIsHTML as s, toTitleCase as t, uniqueID as u, detectHTMLOrPlainText as v, parsePlainTextToHTML as w, timeToMinutes as x, convertTo12HourFormat as y, minutesToTime as z };
|
|
4074
4133
|
|
|
4075
|
-
//# sourceMappingURL=utils-
|
|
4134
|
+
//# sourceMappingURL=utils-157014b4.js.map
|