@nylas/web-elements 1.0.0-prealpha1
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/LICENSE +21 -0
- package/dist/cjs/_commonjsHelpers-0a7b82d9.js +23 -0
- package/dist/cjs/_commonjsHelpers-0a7b82d9.js.map +1 -0
- package/dist/cjs/app-globals-d58ac016.js +11 -0
- package/dist/cjs/app-globals-d58ac016.js.map +1 -0
- package/dist/cjs/archive-icon_7.cjs.entry.js +120 -0
- package/dist/cjs/archive-icon_7.cjs.entry.js.map +1 -0
- package/dist/cjs/arrow-icon.cjs.entry.js +24 -0
- package/dist/cjs/arrow-icon.cjs.entry.js.map +1 -0
- package/dist/cjs/bold-icon_3.cjs.entry.js +56 -0
- package/dist/cjs/bold-icon_3.cjs.entry.js.map +1 -0
- package/dist/cjs/calendar-cancel-icon.cjs.entry.js +24 -0
- package/dist/cjs/calendar-cancel-icon.cjs.entry.js.map +1 -0
- package/dist/cjs/calendar-check-icon_3.cjs.entry.js +56 -0
- package/dist/cjs/calendar-check-icon_3.cjs.entry.js.map +1 -0
- package/dist/cjs/calendar-icon.cjs.entry.js +24 -0
- package/dist/cjs/calendar-icon.cjs.entry.js.map +1 -0
- package/dist/cjs/chevron-icon.cjs.entry.js +24 -0
- package/dist/cjs/chevron-icon.cjs.entry.js.map +1 -0
- package/dist/cjs/close-icon_2.cjs.entry.js +40 -0
- package/dist/cjs/close-icon_2.cjs.entry.js.map +1 -0
- package/dist/cjs/document-refresh-icon.cjs.entry.js +24 -0
- package/dist/cjs/document-refresh-icon.cjs.entry.js.map +1 -0
- package/dist/cjs/duration-18b22d1b.js +84 -0
- package/dist/cjs/duration-18b22d1b.js.map +1 -0
- package/dist/cjs/elements-b06c817b.js +21585 -0
- package/dist/cjs/elements-b06c817b.js.map +1 -0
- package/dist/cjs/flow-d922fbd4.js +891 -0
- package/dist/cjs/flow-d922fbd4.js.map +1 -0
- package/dist/cjs/focus-visible-857fc8f9.js +327 -0
- package/dist/cjs/focus-visible-857fc8f9.js.map +1 -0
- package/dist/cjs/forward-icon_6.cjs.entry.js +2216 -0
- package/dist/cjs/forward-icon_6.cjs.entry.js.map +1 -0
- package/dist/cjs/globe-icon.cjs.entry.js +24 -0
- package/dist/cjs/globe-icon.cjs.entry.js.map +1 -0
- package/dist/cjs/index-34e64e2d.js +2173 -0
- package/dist/cjs/index-34e64e2d.js.map +1 -0
- package/dist/cjs/index-e869130c.js +198 -0
- package/dist/cjs/index-e869130c.js.map +1 -0
- package/dist/cjs/index.cjs.js +12 -0
- package/dist/cjs/index.cjs.js.map +1 -0
- package/dist/cjs/index.es-e78884f5.js +3217 -0
- package/dist/cjs/index.es-e78884f5.js.map +1 -0
- package/dist/cjs/loader.cjs.js +17 -0
- package/dist/cjs/loader.cjs.js.map +1 -0
- package/dist/cjs/loading-icon.cjs.entry.js +24 -0
- package/dist/cjs/loading-icon.cjs.entry.js.map +1 -0
- package/dist/cjs/mailbox-store-0b1636fa.js +529 -0
- package/dist/cjs/mailbox-store-0b1636fa.js.map +1 -0
- package/dist/cjs/nylas-booked-event-card_9.cjs.entry.js +8127 -0
- package/dist/cjs/nylas-booked-event-card_9.cjs.entry.js.map +1 -0
- package/dist/cjs/nylas-if-state_3.cjs.entry.js +409 -0
- package/dist/cjs/nylas-if-state_3.cjs.entry.js.map +1 -0
- package/dist/cjs/nylas-list-folders.cjs.entry.js +120 -0
- package/dist/cjs/nylas-list-folders.cjs.entry.js.map +1 -0
- package/dist/cjs/nylas-list-threads.cjs.entry.js +89 -0
- package/dist/cjs/nylas-list-threads.cjs.entry.js.map +1 -0
- package/dist/cjs/nylas-mailbox-pagination.cjs.entry.js +140 -0
- package/dist/cjs/nylas-mailbox-pagination.cjs.entry.js.map +1 -0
- package/dist/cjs/nylas-mailbox-toolbar-button.cjs.entry.js +100 -0
- package/dist/cjs/nylas-mailbox-toolbar-button.cjs.entry.js.map +1 -0
- package/dist/cjs/nylas-open-hours-picker.cjs.entry.js +333 -0
- package/dist/cjs/nylas-open-hours-picker.cjs.entry.js.map +1 -0
- package/dist/cjs/nylas-provider.cjs.entry.js +184 -0
- package/dist/cjs/nylas-provider.cjs.entry.js.map +1 -0
- package/dist/cjs/nylas-scheduler.cjs.entry.js +242 -0
- package/dist/cjs/nylas-scheduler.cjs.entry.js.map +1 -0
- package/dist/cjs/nylas-threads-refresh.cjs.entry.js +118 -0
- package/dist/cjs/nylas-threads-refresh.cjs.entry.js.map +1 -0
- package/dist/cjs/nylas-threads-search.cjs.entry.js +84 -0
- package/dist/cjs/nylas-threads-search.cjs.entry.js.map +1 -0
- package/dist/cjs/nylas-view-thread.cjs.entry.js +234 -0
- package/dist/cjs/nylas-view-thread.cjs.entry.js.map +1 -0
- package/dist/cjs/nylas-web-elements.cjs.js +27 -0
- package/dist/cjs/nylas-web-elements.cjs.js.map +1 -0
- package/dist/cjs/play-icon_2.cjs.entry.js +40 -0
- package/dist/cjs/play-icon_2.cjs.entry.js.map +1 -0
- package/dist/cjs/property-d934a711.js +47 -0
- package/dist/cjs/property-d934a711.js.map +1 -0
- package/dist/cjs/refresh-icon.cjs.entry.js +24 -0
- package/dist/cjs/refresh-icon.cjs.entry.js.map +1 -0
- package/dist/cjs/register-component-f76b61a6.js +140 -0
- package/dist/cjs/register-component-f76b61a6.js.map +1 -0
- package/dist/cjs/scheduler-store-e9822441.js +254 -0
- package/dist/cjs/scheduler-store-e9822441.js.map +1 -0
- package/dist/cjs/translate-icon.cjs.entry.js +24 -0
- package/dist/cjs/translate-icon.cjs.entry.js.map +1 -0
- package/dist/cjs/utils-f91d4c73.js +161 -0
- package/dist/cjs/utils-f91d4c73.js.map +1 -0
- package/dist/collection/assets/icons/chevron.svg +3 -0
- package/dist/collection/collection-manifest.json +66 -0
- package/dist/collection/common/abstract-provider.js +231 -0
- package/dist/collection/common/abstract-provider.js.map +1 -0
- package/dist/collection/common/component-types.js +2 -0
- package/dist/collection/common/component-types.js.map +1 -0
- package/dist/collection/common/constants.js +12 -0
- package/dist/collection/common/constants.js.map +1 -0
- package/dist/collection/common/global.js +4 -0
- package/dist/collection/common/global.js.map +1 -0
- package/dist/collection/common/icons/archive.js +63 -0
- package/dist/collection/common/icons/archive.js.map +1 -0
- package/dist/collection/common/icons/arrow.js +63 -0
- package/dist/collection/common/icons/arrow.js.map +1 -0
- package/dist/collection/common/icons/bold.js +63 -0
- package/dist/collection/common/icons/bold.js.map +1 -0
- package/dist/collection/common/icons/calendar-cancel.js +63 -0
- package/dist/collection/common/icons/calendar-cancel.js.map +1 -0
- package/dist/collection/common/icons/calendar-check.js +63 -0
- package/dist/collection/common/icons/calendar-check.js.map +1 -0
- package/dist/collection/common/icons/calendar.js +63 -0
- package/dist/collection/common/icons/calendar.js.map +1 -0
- package/dist/collection/common/icons/checkmark-circle.js +63 -0
- package/dist/collection/common/icons/checkmark-circle.js.map +1 -0
- package/dist/collection/common/icons/chevron.js +63 -0
- package/dist/collection/common/icons/chevron.js.map +1 -0
- package/dist/collection/common/icons/close.js +63 -0
- package/dist/collection/common/icons/close.js.map +1 -0
- package/dist/collection/common/icons/document-refresh.js +63 -0
- package/dist/collection/common/icons/document-refresh.js.map +1 -0
- package/dist/collection/common/icons/folder.js +63 -0
- package/dist/collection/common/icons/folder.js.map +1 -0
- package/dist/collection/common/icons/forward.js +63 -0
- package/dist/collection/common/icons/forward.js.map +1 -0
- package/dist/collection/common/icons/globe.js +63 -0
- package/dist/collection/common/icons/globe.js.map +1 -0
- package/dist/collection/common/icons/icon.css +3 -0
- package/dist/collection/common/icons/inbox.js +63 -0
- package/dist/collection/common/icons/inbox.js.map +1 -0
- package/dist/collection/common/icons/italic.js +63 -0
- package/dist/collection/common/icons/italic.js.map +1 -0
- package/dist/collection/common/icons/loading.css +33 -0
- package/dist/collection/common/icons/loading.js +63 -0
- package/dist/collection/common/icons/loading.js.map +1 -0
- package/dist/collection/common/icons/nylas-logo.js +63 -0
- package/dist/collection/common/icons/nylas-logo.js.map +1 -0
- package/dist/collection/common/icons/people.js +63 -0
- package/dist/collection/common/icons/people.js.map +1 -0
- package/dist/collection/common/icons/play.js +63 -0
- package/dist/collection/common/icons/play.js.map +1 -0
- package/dist/collection/common/icons/refresh.js +63 -0
- package/dist/collection/common/icons/refresh.js.map +1 -0
- package/dist/collection/common/icons/reply-all.js +63 -0
- package/dist/collection/common/icons/reply-all.js.map +1 -0
- package/dist/collection/common/icons/reply.js +63 -0
- package/dist/collection/common/icons/reply.js.map +1 -0
- package/dist/collection/common/icons/sent.js +63 -0
- package/dist/collection/common/icons/sent.js.map +1 -0
- package/dist/collection/common/icons/spam.js +63 -0
- package/dist/collection/common/icons/spam.js.map +1 -0
- package/dist/collection/common/icons/star.js +63 -0
- package/dist/collection/common/icons/star.js.map +1 -0
- package/dist/collection/common/icons/stop.js +63 -0
- package/dist/collection/common/icons/stop.js.map +1 -0
- package/dist/collection/common/icons/translate.js +63 -0
- package/dist/collection/common/icons/translate.js.map +1 -0
- package/dist/collection/common/icons/trash.js +63 -0
- package/dist/collection/common/icons/trash.js.map +1 -0
- package/dist/collection/common/icons/underline.js +63 -0
- package/dist/collection/common/icons/underline.js.map +1 -0
- package/dist/collection/common/icons/warning.js +63 -0
- package/dist/collection/common/icons/warning.js.map +1 -0
- package/dist/collection/common/mocks/threads.js +57 -0
- package/dist/collection/common/mocks/threads.js.map +1 -0
- package/dist/collection/common/nylas-theme/index.js +4 -0
- package/dist/collection/common/nylas-theme/index.js.map +1 -0
- package/dist/collection/common/register-component.js +134 -0
- package/dist/collection/common/register-component.js.map +1 -0
- package/dist/collection/common/types.js +2 -0
- package/dist/collection/common/types.js.map +1 -0
- package/dist/collection/components/mailbox/nylas-composer/nylas-composer.css +89 -0
- package/dist/collection/components/mailbox/nylas-composer/nylas-composer.js +241 -0
- package/dist/collection/components/mailbox/nylas-composer/nylas-composer.js.map +1 -0
- package/dist/collection/components/mailbox/nylas-composer/test/nylas-composer.e2e.js +10 -0
- package/dist/collection/components/mailbox/nylas-composer/test/nylas-composer.e2e.js.map +1 -0
- package/dist/collection/components/mailbox/nylas-composer/test/nylas-composer.spec-disabled.js +12 -0
- package/dist/collection/components/mailbox/nylas-composer/test/nylas-composer.spec-disabled.js.map +1 -0
- package/dist/collection/components/mailbox/nylas-list-folders/nylas-list-folders.css +37 -0
- package/dist/collection/components/mailbox/nylas-list-folders/nylas-list-folders.js +193 -0
- package/dist/collection/components/mailbox/nylas-list-folders/nylas-list-folders.js.map +1 -0
- package/dist/collection/components/mailbox/nylas-list-folders/test/nylas-list-folders.e2e.js +10 -0
- package/dist/collection/components/mailbox/nylas-list-folders/test/nylas-list-folders.e2e.js.map +1 -0
- package/dist/collection/components/mailbox/nylas-list-folders/test/nylas-list-folders.spec.js +12 -0
- package/dist/collection/components/mailbox/nylas-list-folders/test/nylas-list-folders.spec.js.map +1 -0
- package/dist/collection/components/mailbox/nylas-list-threads/nylas-list-threads.css +156 -0
- package/dist/collection/components/mailbox/nylas-list-threads/nylas-list-threads.js +218 -0
- package/dist/collection/components/mailbox/nylas-list-threads/nylas-list-threads.js.map +1 -0
- package/dist/collection/components/mailbox/nylas-list-threads/test/nylas-list-threads.e2e.js +22 -0
- package/dist/collection/components/mailbox/nylas-list-threads/test/nylas-list-threads.e2e.js.map +1 -0
- package/dist/collection/components/mailbox/nylas-list-threads/test/nylas-list-threads.spec.js +25 -0
- package/dist/collection/components/mailbox/nylas-list-threads/test/nylas-list-threads.spec.js.map +1 -0
- package/dist/collection/components/mailbox/nylas-mailbox/nylas-mailbox.css +3 -0
- package/dist/collection/components/mailbox/nylas-mailbox/nylas-mailbox.js +474 -0
- package/dist/collection/components/mailbox/nylas-mailbox/nylas-mailbox.js.map +1 -0
- package/dist/collection/components/mailbox/nylas-mailbox/test/nylas-mailbox.e2e.js +16 -0
- package/dist/collection/components/mailbox/nylas-mailbox/test/nylas-mailbox.e2e.js.map +1 -0
- package/dist/collection/components/mailbox/nylas-mailbox/test/nylas-mailbox.spec.js +32 -0
- package/dist/collection/components/mailbox/nylas-mailbox/test/nylas-mailbox.spec.js.map +1 -0
- package/dist/collection/components/mailbox/nylas-mailbox-pagination/nylas-mailbox-pagination.css +55 -0
- package/dist/collection/components/mailbox/nylas-mailbox-pagination/nylas-mailbox-pagination.js +371 -0
- package/dist/collection/components/mailbox/nylas-mailbox-pagination/nylas-mailbox-pagination.js.map +1 -0
- package/dist/collection/components/mailbox/nylas-mailbox-pagination/test/nylas-mailbox-pagination.e2e.js +10 -0
- package/dist/collection/components/mailbox/nylas-mailbox-pagination/test/nylas-mailbox-pagination.e2e.js.map +1 -0
- package/dist/collection/components/mailbox/nylas-mailbox-pagination/test/nylas-mailbox-pagination.spec.js +12 -0
- package/dist/collection/components/mailbox/nylas-mailbox-pagination/test/nylas-mailbox-pagination.spec.js.map +1 -0
- package/dist/collection/components/mailbox/nylas-mailbox-toolbar-button/nylas-mailbox-toolbar-button.css +18 -0
- package/dist/collection/components/mailbox/nylas-mailbox-toolbar-button/nylas-mailbox-toolbar-button.js +182 -0
- package/dist/collection/components/mailbox/nylas-mailbox-toolbar-button/nylas-mailbox-toolbar-button.js.map +1 -0
- package/dist/collection/components/mailbox/nylas-summarize-message-button/nylas-summarize-message-button.css +61 -0
- package/dist/collection/components/mailbox/nylas-summarize-message-button/nylas-summarize-message-button.js +329 -0
- package/dist/collection/components/mailbox/nylas-summarize-message-button/nylas-summarize-message-button.js.map +1 -0
- package/dist/collection/components/mailbox/nylas-summarize-message-button/test/nylas-summarize-message-button.e2e.js +10 -0
- package/dist/collection/components/mailbox/nylas-summarize-message-button/test/nylas-summarize-message-button.e2e.js.map +1 -0
- package/dist/collection/components/mailbox/nylas-summarize-message-button/test/nylas-summarize-message-button.spec.js +12 -0
- package/dist/collection/components/mailbox/nylas-summarize-message-button/test/nylas-summarize-message-button.spec.js.map +1 -0
- package/dist/collection/components/mailbox/nylas-threads-refresh/nylas-threads-refresh.css +53 -0
- package/dist/collection/components/mailbox/nylas-threads-refresh/nylas-threads-refresh.js +172 -0
- package/dist/collection/components/mailbox/nylas-threads-refresh/nylas-threads-refresh.js.map +1 -0
- package/dist/collection/components/mailbox/nylas-threads-refresh/test/nylas-threads-refresh.e2e.js +10 -0
- package/dist/collection/components/mailbox/nylas-threads-refresh/test/nylas-threads-refresh.e2e.js.map +1 -0
- package/dist/collection/components/mailbox/nylas-threads-refresh/test/nylas-threads-refresh.spec.js +12 -0
- package/dist/collection/components/mailbox/nylas-threads-refresh/test/nylas-threads-refresh.spec.js.map +1 -0
- package/dist/collection/components/mailbox/nylas-threads-search/nylas-threads-search.css +8 -0
- package/dist/collection/components/mailbox/nylas-threads-search/nylas-threads-search.js +130 -0
- package/dist/collection/components/mailbox/nylas-threads-search/nylas-threads-search.js.map +1 -0
- package/dist/collection/components/mailbox/nylas-threads-search/test/nylas-threads-search.e2e.js +10 -0
- package/dist/collection/components/mailbox/nylas-threads-search/test/nylas-threads-search.e2e.js.map +1 -0
- package/dist/collection/components/mailbox/nylas-threads-search/test/nylas-threads-search.spec.js +12 -0
- package/dist/collection/components/mailbox/nylas-threads-search/test/nylas-threads-search.spec.js.map +1 -0
- package/dist/collection/components/mailbox/nylas-view-email/nylas-view-email.css +43 -0
- package/dist/collection/components/mailbox/nylas-view-email/nylas-view-email.js +282 -0
- package/dist/collection/components/mailbox/nylas-view-email/nylas-view-email.js.map +1 -0
- package/dist/collection/components/mailbox/nylas-view-thread/nylas-view-thread.css +243 -0
- package/dist/collection/components/mailbox/nylas-view-thread/nylas-view-thread.js +342 -0
- package/dist/collection/components/mailbox/nylas-view-thread/nylas-view-thread.js.map +1 -0
- package/dist/collection/components/mailbox/nylas-view-thread/view-thread-message.js +25 -0
- package/dist/collection/components/mailbox/nylas-view-thread/view-thread-message.js.map +1 -0
- package/dist/collection/components/nylas-if-state/nylas-if-state.css +84 -0
- package/dist/collection/components/nylas-if-state/nylas-if-state.js +241 -0
- package/dist/collection/components/nylas-if-state/nylas-if-state.js.map +1 -0
- package/dist/collection/components/nylas-if-state/test/nylas-if-state.e2e.js +10 -0
- package/dist/collection/components/nylas-if-state/test/nylas-if-state.e2e.js.map +1 -0
- package/dist/collection/components/nylas-if-state/test/nylas-if-state.spec.js +12 -0
- package/dist/collection/components/nylas-if-state/test/nylas-if-state.spec.js.map +1 -0
- package/dist/collection/components/nylas-login/nylas-login.css +94 -0
- package/dist/collection/components/nylas-login/nylas-login.js +289 -0
- package/dist/collection/components/nylas-login/nylas-login.js.map +1 -0
- package/dist/collection/components/nylas-login/test/nylas-login.e2e.js +10 -0
- package/dist/collection/components/nylas-login/test/nylas-login.e2e.js.map +1 -0
- package/dist/collection/components/nylas-login/test/nylas-login.spec.js +12 -0
- package/dist/collection/components/nylas-login/test/nylas-login.spec.js.map +1 -0
- package/dist/collection/components/nylas-provider/nylas-provider.css +3 -0
- package/dist/collection/components/nylas-provider/nylas-provider.js +423 -0
- package/dist/collection/components/nylas-provider/nylas-provider.js.map +1 -0
- package/dist/collection/components/nylas-provider/test/nylas-provider.e2e.js +10 -0
- package/dist/collection/components/nylas-provider/test/nylas-provider.e2e.js.map +1 -0
- package/dist/collection/components/nylas-provider/test/nylas-provider.spec.js +32 -0
- package/dist/collection/components/nylas-provider/test/nylas-provider.spec.js.map +1 -0
- package/dist/collection/components/scheduler/nylas-booked-event-card/nylas-booked-event-card.css +155 -0
- package/dist/collection/components/scheduler/nylas-booked-event-card/nylas-booked-event-card.js +178 -0
- package/dist/collection/components/scheduler/nylas-booked-event-card/nylas-booked-event-card.js.map +1 -0
- package/dist/collection/components/scheduler/nylas-booking-form/nylas-booking-form.css +129 -0
- package/dist/collection/components/scheduler/nylas-booking-form/nylas-booking-form.js +323 -0
- package/dist/collection/components/scheduler/nylas-booking-form/nylas-booking-form.js.map +1 -0
- package/dist/collection/components/scheduler/nylas-cancelled-event-card/nylas-cancelled-event-card.css +78 -0
- package/dist/collection/components/scheduler/nylas-cancelled-event-card/nylas-cancelled-event-card.js +107 -0
- package/dist/collection/components/scheduler/nylas-cancelled-event-card/nylas-cancelled-event-card.js.map +1 -0
- package/dist/collection/components/scheduler/nylas-date-picker/nylas-date-picker.css +150 -0
- package/dist/collection/components/scheduler/nylas-date-picker/nylas-date-picker.js +213 -0
- package/dist/collection/components/scheduler/nylas-date-picker/nylas-date-picker.js.map +1 -0
- package/dist/collection/components/scheduler/nylas-locale-switch/nylas-locale-switch.css +72 -0
- package/dist/collection/components/scheduler/nylas-locale-switch/nylas-locale-switch.js +147 -0
- package/dist/collection/components/scheduler/nylas-locale-switch/nylas-locale-switch.js.map +1 -0
- package/dist/collection/components/scheduler/nylas-notification/nylas-notification.css +63 -0
- package/dist/collection/components/scheduler/nylas-notification/nylas-notification.js +132 -0
- package/dist/collection/components/scheduler/nylas-notification/nylas-notification.js.map +1 -0
- package/dist/collection/components/scheduler/nylas-open-hours-picker/nylas-open-hours-picker.css +105 -0
- package/dist/collection/components/scheduler/nylas-open-hours-picker/nylas-open-hours-picker.js +460 -0
- package/dist/collection/components/scheduler/nylas-open-hours-picker/nylas-open-hours-picker.js.map +1 -0
- package/dist/collection/components/scheduler/nylas-open-hours-picker/test/nylas-open-hours-picker.e2e.js +10 -0
- package/dist/collection/components/scheduler/nylas-open-hours-picker/test/nylas-open-hours-picker.e2e.js.map +1 -0
- package/dist/collection/components/scheduler/nylas-open-hours-picker/test/nylas-open-hours-picker.spec.js +12 -0
- package/dist/collection/components/scheduler/nylas-open-hours-picker/test/nylas-open-hours-picker.spec.js.map +1 -0
- package/dist/collection/components/scheduler/nylas-scheduler/nylas-scheduler.css +182 -0
- package/dist/collection/components/scheduler/nylas-scheduler/nylas-scheduler.js +533 -0
- package/dist/collection/components/scheduler/nylas-scheduler/nylas-scheduler.js.map +1 -0
- package/dist/collection/components/scheduler/nylas-scheduler/scheduler-view.js +6 -0
- package/dist/collection/components/scheduler/nylas-scheduler/scheduler-view.js.map +1 -0
- package/dist/collection/components/scheduler/nylas-selected-event-card/nylas-selected-event-card.css +63 -0
- package/dist/collection/components/scheduler/nylas-selected-event-card/nylas-selected-event-card.js +150 -0
- package/dist/collection/components/scheduler/nylas-selected-event-card/nylas-selected-event-card.js.map +1 -0
- package/dist/collection/components/scheduler/nylas-timeslot-picker/nylas-timeslot-picker.css +115 -0
- package/dist/collection/components/scheduler/nylas-timeslot-picker/nylas-timeslot-picker.js +311 -0
- package/dist/collection/components/scheduler/nylas-timeslot-picker/nylas-timeslot-picker.js.map +1 -0
- package/dist/collection/connector/connector-interface.js +2 -0
- package/dist/collection/connector/connector-interface.js.map +1 -0
- package/dist/collection/connector/nylas-connector/index.js +78 -0
- package/dist/collection/connector/nylas-connector/index.js.map +1 -0
- package/dist/collection/connector/nylas-mailbox-connector/index.js +62 -0
- package/dist/collection/connector/nylas-mailbox-connector/index.js.map +1 -0
- package/dist/collection/connector/nylas-scheduler-connector/index.js +43 -0
- package/dist/collection/connector/nylas-scheduler-connector/index.js.map +1 -0
- package/dist/collection/connector/shared/api/auth.js +60 -0
- package/dist/collection/connector/shared/api/auth.js.map +1 -0
- package/dist/collection/connector/shared/api/folders.js +33 -0
- package/dist/collection/connector/shared/api/folders.js.map +1 -0
- package/dist/collection/connector/shared/api/messages.js +95 -0
- package/dist/collection/connector/shared/api/messages.js.map +1 -0
- package/dist/collection/connector/shared/api/scheduler.js +203 -0
- package/dist/collection/connector/shared/api/scheduler.js.map +1 -0
- package/dist/collection/connector/shared/api/threads.js +165 -0
- package/dist/collection/connector/shared/api/threads.js.map +1 -0
- package/dist/collection/index.js +4 -0
- package/dist/collection/index.js.map +1 -0
- package/dist/collection/routers/hash-router.js +109 -0
- package/dist/collection/routers/hash-router.js.map +1 -0
- package/dist/collection/routers/router-interface.js +2 -0
- package/dist/collection/routers/router-interface.js.map +1 -0
- package/dist/collection/stores/auth-store.js +18 -0
- package/dist/collection/stores/auth-store.js.map +1 -0
- package/dist/collection/stores/mailbox-store.js +42 -0
- package/dist/collection/stores/mailbox-store.js.map +1 -0
- package/dist/collection/stores/scheduler-store.js +44 -0
- package/dist/collection/stores/scheduler-store.js.map +1 -0
- package/dist/collection/utils/color-utils.js +161 -0
- package/dist/collection/utils/color-utils.js.map +1 -0
- package/dist/collection/utils/utils.js +157 -0
- package/dist/collection/utils/utils.js.map +1 -0
- package/dist/collection/utils/utils.spec.js +16 -0
- package/dist/collection/utils/utils.spec.js.map +1 -0
- package/dist/components/_commonjsHelpers.js +20 -0
- package/dist/components/_commonjsHelpers.js.map +1 -0
- package/dist/components/archive-icon.d.ts +11 -0
- package/dist/components/archive-icon.js +8 -0
- package/dist/components/archive-icon.js.map +1 -0
- package/dist/components/archive.js +37 -0
- package/dist/components/archive.js.map +1 -0
- package/dist/components/arrow-icon.d.ts +11 -0
- package/dist/components/arrow-icon.js +8 -0
- package/dist/components/arrow-icon.js.map +1 -0
- package/dist/components/arrow.js +37 -0
- package/dist/components/arrow.js.map +1 -0
- package/dist/components/assets/chevron.svg +3 -0
- package/dist/components/bold-icon.d.ts +11 -0
- package/dist/components/bold-icon.js +8 -0
- package/dist/components/bold-icon.js.map +1 -0
- package/dist/components/bold.js +37 -0
- package/dist/components/bold.js.map +1 -0
- package/dist/components/calendar-cancel-icon.d.ts +11 -0
- package/dist/components/calendar-cancel-icon.js +8 -0
- package/dist/components/calendar-cancel-icon.js.map +1 -0
- package/dist/components/calendar-cancel.js +37 -0
- package/dist/components/calendar-cancel.js.map +1 -0
- package/dist/components/calendar-check-icon.d.ts +11 -0
- package/dist/components/calendar-check-icon.js +8 -0
- package/dist/components/calendar-check-icon.js.map +1 -0
- package/dist/components/calendar-check.js +37 -0
- package/dist/components/calendar-check.js.map +1 -0
- package/dist/components/calendar-icon.d.ts +11 -0
- package/dist/components/calendar-icon.js +8 -0
- package/dist/components/calendar-icon.js.map +1 -0
- package/dist/components/calendar.js +37 -0
- package/dist/components/calendar.js.map +1 -0
- package/dist/components/checkmark-circle-icon.d.ts +11 -0
- package/dist/components/checkmark-circle-icon.js +8 -0
- package/dist/components/checkmark-circle-icon.js.map +1 -0
- package/dist/components/checkmark-circle.js +37 -0
- package/dist/components/checkmark-circle.js.map +1 -0
- package/dist/components/chevron-icon.d.ts +11 -0
- package/dist/components/chevron-icon.js +8 -0
- package/dist/components/chevron-icon.js.map +1 -0
- package/dist/components/chevron.js +37 -0
- package/dist/components/chevron.js.map +1 -0
- package/dist/components/close-icon.d.ts +11 -0
- package/dist/components/close-icon.js +8 -0
- package/dist/components/close-icon.js.map +1 -0
- package/dist/components/close.js +37 -0
- package/dist/components/close.js.map +1 -0
- package/dist/components/constants.js +7296 -0
- package/dist/components/constants.js.map +1 -0
- package/dist/components/define-element.js +40 -0
- package/dist/components/define-element.js.map +1 -0
- package/dist/components/document-refresh-icon.d.ts +11 -0
- package/dist/components/document-refresh-icon.js +40 -0
- package/dist/components/document-refresh-icon.js.map +1 -0
- package/dist/components/duration.js +78 -0
- package/dist/components/duration.js.map +1 -0
- package/dist/components/elements.js +21583 -0
- package/dist/components/elements.js.map +1 -0
- package/dist/components/flow.js +888 -0
- package/dist/components/flow.js.map +1 -0
- package/dist/components/focus-visible.js +325 -0
- package/dist/components/focus-visible.js.map +1 -0
- package/dist/components/folder-icon.d.ts +11 -0
- package/dist/components/folder-icon.js +8 -0
- package/dist/components/folder-icon.js.map +1 -0
- package/dist/components/folder.js +37 -0
- package/dist/components/folder.js.map +1 -0
- package/dist/components/forward-icon.d.ts +11 -0
- package/dist/components/forward-icon.js +8 -0
- package/dist/components/forward-icon.js.map +1 -0
- package/dist/components/forward.js +37 -0
- package/dist/components/forward.js.map +1 -0
- package/dist/components/globe-icon.d.ts +11 -0
- package/dist/components/globe-icon.js +8 -0
- package/dist/components/globe-icon.js.map +1 -0
- package/dist/components/globe.js +37 -0
- package/dist/components/globe.js.map +1 -0
- package/dist/components/inbox-icon.d.ts +11 -0
- package/dist/components/inbox-icon.js +8 -0
- package/dist/components/inbox-icon.js.map +1 -0
- package/dist/components/inbox.js +37 -0
- package/dist/components/inbox.js.map +1 -0
- package/dist/components/index.d.ts +33 -0
- package/dist/components/index.es.js +3211 -0
- package/dist/components/index.es.js.map +1 -0
- package/dist/components/index.js +16 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/index2.js +196 -0
- package/dist/components/index2.js.map +1 -0
- package/dist/components/italic-icon.d.ts +11 -0
- package/dist/components/italic-icon.js +8 -0
- package/dist/components/italic-icon.js.map +1 -0
- package/dist/components/italic.js +37 -0
- package/dist/components/italic.js.map +1 -0
- package/dist/components/loading-icon.d.ts +11 -0
- package/dist/components/loading-icon.js +8 -0
- package/dist/components/loading-icon.js.map +1 -0
- package/dist/components/loading.js +38 -0
- package/dist/components/loading.js.map +1 -0
- package/dist/components/mailbox-store.js +521 -0
- package/dist/components/mailbox-store.js.map +1 -0
- package/dist/components/nylas-booked-event-card.d.ts +11 -0
- package/dist/components/nylas-booked-event-card.js +8 -0
- package/dist/components/nylas-booked-event-card.js.map +1 -0
- package/dist/components/nylas-booked-event-card2.js +121 -0
- package/dist/components/nylas-booked-event-card2.js.map +1 -0
- package/dist/components/nylas-booking-form.d.ts +11 -0
- package/dist/components/nylas-booking-form.js +8 -0
- package/dist/components/nylas-booking-form.js.map +1 -0
- package/dist/components/nylas-booking-form2.js +224 -0
- package/dist/components/nylas-booking-form2.js.map +1 -0
- package/dist/components/nylas-cancelled-event-card.d.ts +11 -0
- package/dist/components/nylas-cancelled-event-card.js +8 -0
- package/dist/components/nylas-cancelled-event-card.js.map +1 -0
- package/dist/components/nylas-cancelled-event-card2.js +85 -0
- package/dist/components/nylas-cancelled-event-card2.js.map +1 -0
- package/dist/components/nylas-composer.d.ts +11 -0
- package/dist/components/nylas-composer.js +8 -0
- package/dist/components/nylas-composer.js.map +1 -0
- package/dist/components/nylas-composer2.js +186 -0
- package/dist/components/nylas-composer2.js.map +1 -0
- package/dist/components/nylas-date-picker.d.ts +11 -0
- package/dist/components/nylas-date-picker.js +8 -0
- package/dist/components/nylas-date-picker.js.map +1 -0
- package/dist/components/nylas-date-picker2.js +150 -0
- package/dist/components/nylas-date-picker2.js.map +1 -0
- package/dist/components/nylas-if-state.d.ts +11 -0
- package/dist/components/nylas-if-state.js +153 -0
- package/dist/components/nylas-if-state.js.map +1 -0
- package/dist/components/nylas-list-folders.d.ts +11 -0
- package/dist/components/nylas-list-folders.js +183 -0
- package/dist/components/nylas-list-folders.js.map +1 -0
- package/dist/components/nylas-list-threads.d.ts +11 -0
- package/dist/components/nylas-list-threads.js +109 -0
- package/dist/components/nylas-list-threads.js.map +1 -0
- package/dist/components/nylas-locale-switch.d.ts +11 -0
- package/dist/components/nylas-locale-switch.js +8 -0
- package/dist/components/nylas-locale-switch.js.map +1 -0
- package/dist/components/nylas-locale-switch2.js +103 -0
- package/dist/components/nylas-locale-switch2.js.map +1 -0
- package/dist/components/nylas-login.d.ts +11 -0
- package/dist/components/nylas-login.js +127 -0
- package/dist/components/nylas-login.js.map +1 -0
- package/dist/components/nylas-logo.d.ts +11 -0
- package/dist/components/nylas-logo.js +8 -0
- package/dist/components/nylas-logo.js.map +1 -0
- package/dist/components/nylas-logo2.js +37 -0
- package/dist/components/nylas-logo2.js.map +1 -0
- package/dist/components/nylas-mailbox-pagination.d.ts +11 -0
- package/dist/components/nylas-mailbox-pagination.js +175 -0
- package/dist/components/nylas-mailbox-pagination.js.map +1 -0
- package/dist/components/nylas-mailbox-toolbar-button.d.ts +11 -0
- package/dist/components/nylas-mailbox-toolbar-button.js +119 -0
- package/dist/components/nylas-mailbox-toolbar-button.js.map +1 -0
- package/dist/components/nylas-mailbox.d.ts +11 -0
- package/dist/components/nylas-mailbox.js +219 -0
- package/dist/components/nylas-mailbox.js.map +1 -0
- package/dist/components/nylas-notification.d.ts +11 -0
- package/dist/components/nylas-notification.js +8 -0
- package/dist/components/nylas-notification.js.map +1 -0
- package/dist/components/nylas-notification2.js +90 -0
- package/dist/components/nylas-notification2.js.map +1 -0
- package/dist/components/nylas-open-hours-picker.d.ts +11 -0
- package/dist/components/nylas-open-hours-picker.js +365 -0
- package/dist/components/nylas-open-hours-picker.js.map +1 -0
- package/dist/components/nylas-provider.d.ts +11 -0
- package/dist/components/nylas-provider.js +206 -0
- package/dist/components/nylas-provider.js.map +1 -0
- package/dist/components/nylas-scheduler.d.ts +11 -0
- package/dist/components/nylas-scheduler.js +392 -0
- package/dist/components/nylas-scheduler.js.map +1 -0
- package/dist/components/nylas-selected-event-card.d.ts +11 -0
- package/dist/components/nylas-selected-event-card.js +8 -0
- package/dist/components/nylas-selected-event-card.js.map +1 -0
- package/dist/components/nylas-selected-event-card2.js +110 -0
- package/dist/components/nylas-selected-event-card2.js.map +1 -0
- package/dist/components/nylas-summarize-message-button.d.ts +11 -0
- package/dist/components/nylas-summarize-message-button.js +8 -0
- package/dist/components/nylas-summarize-message-button.js.map +1 -0
- package/dist/components/nylas-summarize-message-button2.js +233 -0
- package/dist/components/nylas-summarize-message-button2.js.map +1 -0
- package/dist/components/nylas-threads-refresh.d.ts +11 -0
- package/dist/components/nylas-threads-refresh.js +149 -0
- package/dist/components/nylas-threads-refresh.js.map +1 -0
- package/dist/components/nylas-threads-search.d.ts +11 -0
- package/dist/components/nylas-threads-search.js +103 -0
- package/dist/components/nylas-threads-search.js.map +1 -0
- package/dist/components/nylas-timeslot-picker.d.ts +11 -0
- package/dist/components/nylas-timeslot-picker.js +8 -0
- package/dist/components/nylas-timeslot-picker.js.map +1 -0
- package/dist/components/nylas-timeslot-picker2.js +174 -0
- package/dist/components/nylas-timeslot-picker2.js.map +1 -0
- package/dist/components/nylas-view-email.d.ts +11 -0
- package/dist/components/nylas-view-email.js +8 -0
- package/dist/components/nylas-view-email.js.map +1 -0
- package/dist/components/nylas-view-email2.js +1859 -0
- package/dist/components/nylas-view-email2.js.map +1 -0
- package/dist/components/nylas-view-thread.d.ts +11 -0
- package/dist/components/nylas-view-thread.js +338 -0
- package/dist/components/nylas-view-thread.js.map +1 -0
- package/dist/components/people-icon.d.ts +11 -0
- package/dist/components/people-icon.js +8 -0
- package/dist/components/people-icon.js.map +1 -0
- package/dist/components/people.js +37 -0
- package/dist/components/people.js.map +1 -0
- package/dist/components/play-icon.d.ts +11 -0
- package/dist/components/play-icon.js +8 -0
- package/dist/components/play-icon.js.map +1 -0
- package/dist/components/play.js +37 -0
- package/dist/components/play.js.map +1 -0
- package/dist/components/property.js +36 -0
- package/dist/components/property.js.map +1 -0
- package/dist/components/refresh-icon.d.ts +11 -0
- package/dist/components/refresh-icon.js +8 -0
- package/dist/components/refresh-icon.js.map +1 -0
- package/dist/components/refresh.js +37 -0
- package/dist/components/refresh.js.map +1 -0
- package/dist/components/register-component.js +138 -0
- package/dist/components/register-component.js.map +1 -0
- package/dist/components/reply-all-icon.d.ts +11 -0
- package/dist/components/reply-all-icon.js +8 -0
- package/dist/components/reply-all-icon.js.map +1 -0
- package/dist/components/reply-all.js +37 -0
- package/dist/components/reply-all.js.map +1 -0
- package/dist/components/reply-icon.d.ts +11 -0
- package/dist/components/reply-icon.js +8 -0
- package/dist/components/reply-icon.js.map +1 -0
- package/dist/components/reply.js +37 -0
- package/dist/components/reply.js.map +1 -0
- package/dist/components/scheduler-store.js +251 -0
- package/dist/components/scheduler-store.js.map +1 -0
- package/dist/components/sent-icon.d.ts +11 -0
- package/dist/components/sent-icon.js +8 -0
- package/dist/components/sent-icon.js.map +1 -0
- package/dist/components/sent.js +37 -0
- package/dist/components/sent.js.map +1 -0
- package/dist/components/sp-icon-chevron-left.js +23 -0
- package/dist/components/sp-icon-chevron-left.js.map +1 -0
- package/dist/components/spam-icon.d.ts +11 -0
- package/dist/components/spam-icon.js +8 -0
- package/dist/components/spam-icon.js.map +1 -0
- package/dist/components/spam.js +37 -0
- package/dist/components/spam.js.map +1 -0
- package/dist/components/star-icon.d.ts +11 -0
- package/dist/components/star-icon.js +8 -0
- package/dist/components/star-icon.js.map +1 -0
- package/dist/components/star.js +37 -0
- package/dist/components/star.js.map +1 -0
- package/dist/components/stop-icon.d.ts +11 -0
- package/dist/components/stop-icon.js +8 -0
- package/dist/components/stop-icon.js.map +1 -0
- package/dist/components/stop.js +37 -0
- package/dist/components/stop.js.map +1 -0
- package/dist/components/translate-icon.d.ts +11 -0
- package/dist/components/translate-icon.js +8 -0
- package/dist/components/translate-icon.js.map +1 -0
- package/dist/components/translate.js +37 -0
- package/dist/components/translate.js.map +1 -0
- package/dist/components/trash-icon.d.ts +11 -0
- package/dist/components/trash-icon.js +8 -0
- package/dist/components/trash-icon.js.map +1 -0
- package/dist/components/trash.js +37 -0
- package/dist/components/trash.js.map +1 -0
- package/dist/components/underline-icon.d.ts +11 -0
- package/dist/components/underline-icon.js +8 -0
- package/dist/components/underline-icon.js.map +1 -0
- package/dist/components/underline.js +37 -0
- package/dist/components/underline.js.map +1 -0
- package/dist/components/utils.js +140 -0
- package/dist/components/utils.js.map +1 -0
- package/dist/components/warning-icon.d.ts +11 -0
- package/dist/components/warning-icon.js +8 -0
- package/dist/components/warning-icon.js.map +1 -0
- package/dist/components/warning.js +37 -0
- package/dist/components/warning.js.map +1 -0
- package/dist/esm/_commonjsHelpers-57e89916.js +20 -0
- package/dist/esm/_commonjsHelpers-57e89916.js.map +1 -0
- package/dist/esm/app-globals-47969cee.js +9 -0
- package/dist/esm/app-globals-47969cee.js.map +1 -0
- package/dist/esm/archive-icon_7.entry.js +110 -0
- package/dist/esm/archive-icon_7.entry.js.map +1 -0
- package/dist/esm/arrow-icon.entry.js +20 -0
- package/dist/esm/arrow-icon.entry.js.map +1 -0
- package/dist/esm/bold-icon_3.entry.js +50 -0
- package/dist/esm/bold-icon_3.entry.js.map +1 -0
- package/dist/esm/calendar-cancel-icon.entry.js +20 -0
- package/dist/esm/calendar-cancel-icon.entry.js.map +1 -0
- package/dist/esm/calendar-check-icon_3.entry.js +50 -0
- package/dist/esm/calendar-check-icon_3.entry.js.map +1 -0
- package/dist/esm/calendar-icon.entry.js +20 -0
- package/dist/esm/calendar-icon.entry.js.map +1 -0
- package/dist/esm/chevron-icon.entry.js +20 -0
- package/dist/esm/chevron-icon.entry.js.map +1 -0
- package/dist/esm/close-icon_2.entry.js +35 -0
- package/dist/esm/close-icon_2.entry.js.map +1 -0
- package/dist/esm/document-refresh-icon.entry.js +20 -0
- package/dist/esm/document-refresh-icon.entry.js.map +1 -0
- package/dist/esm/duration-bddc4a13.js +78 -0
- package/dist/esm/duration-bddc4a13.js.map +1 -0
- package/dist/esm/elements-60ebdb01.js +21583 -0
- package/dist/esm/elements-60ebdb01.js.map +1 -0
- package/dist/esm/flow-40ff9cea.js +888 -0
- package/dist/esm/flow-40ff9cea.js.map +1 -0
- package/dist/esm/focus-visible-e8093c16.js +325 -0
- package/dist/esm/focus-visible-e8093c16.js.map +1 -0
- package/dist/esm/forward-icon_6.entry.js +2207 -0
- package/dist/esm/forward-icon_6.entry.js.map +1 -0
- package/dist/esm/globe-icon.entry.js +20 -0
- package/dist/esm/globe-icon.entry.js.map +1 -0
- package/dist/esm/index-2b85580a.js +196 -0
- package/dist/esm/index-2b85580a.js.map +1 -0
- package/dist/esm/index-b2270b4a.js +2141 -0
- package/dist/esm/index-b2270b4a.js.map +1 -0
- package/dist/esm/index.es-6f3582a1.js +3211 -0
- package/dist/esm/index.es-6f3582a1.js.map +1 -0
- package/dist/esm/index.js +8 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/loader.js +13 -0
- package/dist/esm/loader.js.map +1 -0
- package/dist/esm/loading-icon.entry.js +20 -0
- package/dist/esm/loading-icon.entry.js.map +1 -0
- package/dist/esm/mailbox-store-0019772c.js +521 -0
- package/dist/esm/mailbox-store-0019772c.js.map +1 -0
- package/dist/esm/nylas-booked-event-card_9.entry.js +8115 -0
- package/dist/esm/nylas-booked-event-card_9.entry.js.map +1 -0
- package/dist/esm/nylas-if-state_3.entry.js +403 -0
- package/dist/esm/nylas-if-state_3.entry.js.map +1 -0
- package/dist/esm/nylas-list-folders.entry.js +116 -0
- package/dist/esm/nylas-list-folders.entry.js.map +1 -0
- package/dist/esm/nylas-list-threads.entry.js +85 -0
- package/dist/esm/nylas-list-threads.entry.js.map +1 -0
- package/dist/esm/nylas-mailbox-pagination.entry.js +136 -0
- package/dist/esm/nylas-mailbox-pagination.entry.js.map +1 -0
- package/dist/esm/nylas-mailbox-toolbar-button.entry.js +96 -0
- package/dist/esm/nylas-mailbox-toolbar-button.entry.js.map +1 -0
- package/dist/esm/nylas-open-hours-picker.entry.js +329 -0
- package/dist/esm/nylas-open-hours-picker.entry.js.map +1 -0
- package/dist/esm/nylas-provider.entry.js +180 -0
- package/dist/esm/nylas-provider.entry.js.map +1 -0
- package/dist/esm/nylas-scheduler.entry.js +238 -0
- package/dist/esm/nylas-scheduler.entry.js.map +1 -0
- package/dist/esm/nylas-threads-refresh.entry.js +114 -0
- package/dist/esm/nylas-threads-refresh.entry.js.map +1 -0
- package/dist/esm/nylas-threads-search.entry.js +80 -0
- package/dist/esm/nylas-threads-search.entry.js.map +1 -0
- package/dist/esm/nylas-view-thread.entry.js +230 -0
- package/dist/esm/nylas-view-thread.entry.js.map +1 -0
- package/dist/esm/nylas-web-elements.js +22 -0
- package/dist/esm/nylas-web-elements.js.map +1 -0
- package/dist/esm/play-icon_2.entry.js +35 -0
- package/dist/esm/play-icon_2.entry.js.map +1 -0
- package/dist/esm/polyfills/core-js.js +11 -0
- package/dist/esm/polyfills/dom.js +79 -0
- package/dist/esm/polyfills/es5-html-element.js +1 -0
- package/dist/esm/polyfills/index.js +34 -0
- package/dist/esm/polyfills/system.js +6 -0
- package/dist/esm/property-0065dde7.js +36 -0
- package/dist/esm/property-0065dde7.js.map +1 -0
- package/dist/esm/refresh-icon.entry.js +20 -0
- package/dist/esm/refresh-icon.entry.js.map +1 -0
- package/dist/esm/register-component-55376f31.js +138 -0
- package/dist/esm/register-component-55376f31.js.map +1 -0
- package/dist/esm/scheduler-store-5a39585a.js +251 -0
- package/dist/esm/scheduler-store-5a39585a.js.map +1 -0
- package/dist/esm/translate-icon.entry.js +20 -0
- package/dist/esm/translate-icon.entry.js.map +1 -0
- package/dist/esm/utils-5074a070.js +140 -0
- package/dist/esm/utils-5074a070.js.map +1 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/nylas-web-elements/index.esm.js +2 -0
- package/dist/nylas-web-elements/index.esm.js.map +1 -0
- package/dist/nylas-web-elements/nylas-web-elements.css +239 -0
- package/dist/nylas-web-elements/nylas-web-elements.esm.js +2 -0
- package/dist/nylas-web-elements/nylas-web-elements.esm.js.map +1 -0
- package/dist/nylas-web-elements/p-06974d68.js +2 -0
- package/dist/nylas-web-elements/p-06974d68.js.map +1 -0
- package/dist/nylas-web-elements/p-113fe52e.entry.js +2 -0
- package/dist/nylas-web-elements/p-113fe52e.entry.js.map +1 -0
- package/dist/nylas-web-elements/p-16fb3c85.entry.js +2 -0
- package/dist/nylas-web-elements/p-16fb3c85.entry.js.map +1 -0
- package/dist/nylas-web-elements/p-24c42c37.entry.js +2 -0
- package/dist/nylas-web-elements/p-24c42c37.entry.js.map +1 -0
- package/dist/nylas-web-elements/p-2881b62f.js +16519 -0
- package/dist/nylas-web-elements/p-2881b62f.js.map +1 -0
- package/dist/nylas-web-elements/p-33da6cf1.entry.js +2 -0
- package/dist/nylas-web-elements/p-33da6cf1.entry.js.map +1 -0
- package/dist/nylas-web-elements/p-37f99b96.entry.js +2 -0
- package/dist/nylas-web-elements/p-37f99b96.entry.js.map +1 -0
- package/dist/nylas-web-elements/p-3bc3426e.entry.js +2 -0
- package/dist/nylas-web-elements/p-3bc3426e.entry.js.map +1 -0
- package/dist/nylas-web-elements/p-3c8822f1.entry.js +2 -0
- package/dist/nylas-web-elements/p-3c8822f1.entry.js.map +1 -0
- package/dist/nylas-web-elements/p-5770704d.js +2 -0
- package/dist/nylas-web-elements/p-5770704d.js.map +1 -0
- package/dist/nylas-web-elements/p-5862975b.js +2 -0
- package/dist/nylas-web-elements/p-5862975b.js.map +1 -0
- package/dist/nylas-web-elements/p-647cf7be.entry.js +2 -0
- package/dist/nylas-web-elements/p-647cf7be.entry.js.map +1 -0
- package/dist/nylas-web-elements/p-663edeb8.entry.js +2 -0
- package/dist/nylas-web-elements/p-663edeb8.entry.js.map +1 -0
- package/dist/nylas-web-elements/p-67c9158e.entry.js +2 -0
- package/dist/nylas-web-elements/p-67c9158e.entry.js.map +1 -0
- package/dist/nylas-web-elements/p-6ba7a037.js +2 -0
- package/dist/nylas-web-elements/p-6ba7a037.js.map +1 -0
- package/dist/nylas-web-elements/p-6da0b8f0.entry.js +2 -0
- package/dist/nylas-web-elements/p-6da0b8f0.entry.js.map +1 -0
- package/dist/nylas-web-elements/p-6df00ba0.js +27 -0
- package/dist/nylas-web-elements/p-6df00ba0.js.map +1 -0
- package/dist/nylas-web-elements/p-74141ef6.entry.js +2 -0
- package/dist/nylas-web-elements/p-74141ef6.entry.js.map +1 -0
- package/dist/nylas-web-elements/p-85d41197.entry.js +2 -0
- package/dist/nylas-web-elements/p-85d41197.entry.js.map +1 -0
- package/dist/nylas-web-elements/p-97518578.entry.js +2 -0
- package/dist/nylas-web-elements/p-97518578.entry.js.map +1 -0
- package/dist/nylas-web-elements/p-98ec4a7a.js +2 -0
- package/dist/nylas-web-elements/p-98ec4a7a.js.map +1 -0
- package/dist/nylas-web-elements/p-998d25d5.entry.js +2 -0
- package/dist/nylas-web-elements/p-998d25d5.entry.js.map +1 -0
- package/dist/nylas-web-elements/p-a7bfd3af.entry.js +77 -0
- package/dist/nylas-web-elements/p-a7bfd3af.entry.js.map +1 -0
- package/dist/nylas-web-elements/p-a95208c7.js +2 -0
- package/dist/nylas-web-elements/p-a95208c7.js.map +1 -0
- package/dist/nylas-web-elements/p-adacdaeb.entry.js +2 -0
- package/dist/nylas-web-elements/p-adacdaeb.entry.js.map +1 -0
- package/dist/nylas-web-elements/p-b7d4b7b5.entry.js +2 -0
- package/dist/nylas-web-elements/p-b7d4b7b5.entry.js.map +1 -0
- package/dist/nylas-web-elements/p-b85dfeac.entry.js +2 -0
- package/dist/nylas-web-elements/p-b85dfeac.entry.js.map +1 -0
- package/dist/nylas-web-elements/p-b96b37f1.entry.js +2 -0
- package/dist/nylas-web-elements/p-b96b37f1.entry.js.map +1 -0
- package/dist/nylas-web-elements/p-c2e69618.entry.js +2 -0
- package/dist/nylas-web-elements/p-c2e69618.entry.js.map +1 -0
- package/dist/nylas-web-elements/p-c440f148.entry.js +2 -0
- package/dist/nylas-web-elements/p-c440f148.entry.js.map +1 -0
- package/dist/nylas-web-elements/p-c66e27d0.js +3 -0
- package/dist/nylas-web-elements/p-c66e27d0.js.map +1 -0
- package/dist/nylas-web-elements/p-c685e944.entry.js +3 -0
- package/dist/nylas-web-elements/p-c685e944.entry.js.map +1 -0
- package/dist/nylas-web-elements/p-cb65c223.js +2 -0
- package/dist/nylas-web-elements/p-cb65c223.js.map +1 -0
- package/dist/nylas-web-elements/p-cc21d351.js +17 -0
- package/dist/nylas-web-elements/p-cc21d351.js.map +1 -0
- package/dist/nylas-web-elements/p-d4b1e3e4.entry.js +2 -0
- package/dist/nylas-web-elements/p-d4b1e3e4.entry.js.map +1 -0
- package/dist/nylas-web-elements/p-db24cc70.entry.js +2 -0
- package/dist/nylas-web-elements/p-db24cc70.entry.js.map +1 -0
- package/dist/nylas-web-elements/p-de1bcc4a.js +2 -0
- package/dist/nylas-web-elements/p-de1bcc4a.js.map +1 -0
- package/dist/nylas-web-elements/p-df9f71ea.js +2 -0
- package/dist/nylas-web-elements/p-df9f71ea.js.map +1 -0
- package/dist/nylas-web-elements/p-eeb0a591.js +2 -0
- package/dist/nylas-web-elements/p-eeb0a591.js.map +1 -0
- package/dist/nylas-web-elements/p-f029c1b7.entry.js +2 -0
- package/dist/nylas-web-elements/p-f029c1b7.entry.js.map +1 -0
- package/dist/nylas-web-elements/p-f9a4758a.entry.js +2 -0
- package/dist/nylas-web-elements/p-f9a4758a.entry.js.map +1 -0
- package/dist/types/common/abstract-provider.d.ts +52 -0
- package/dist/types/common/component-types.d.ts +22 -0
- package/dist/types/common/constants.d.ts +6 -0
- package/dist/types/common/global.d.ts +1 -0
- package/dist/types/common/icons/archive.d.ts +5 -0
- package/dist/types/common/icons/arrow.d.ts +5 -0
- package/dist/types/common/icons/bold.d.ts +5 -0
- package/dist/types/common/icons/calendar-cancel.d.ts +5 -0
- package/dist/types/common/icons/calendar-check.d.ts +5 -0
- package/dist/types/common/icons/calendar.d.ts +5 -0
- package/dist/types/common/icons/checkmark-circle.d.ts +5 -0
- package/dist/types/common/icons/chevron.d.ts +5 -0
- package/dist/types/common/icons/close.d.ts +5 -0
- package/dist/types/common/icons/document-refresh.d.ts +5 -0
- package/dist/types/common/icons/folder.d.ts +5 -0
- package/dist/types/common/icons/forward.d.ts +5 -0
- package/dist/types/common/icons/globe.d.ts +5 -0
- package/dist/types/common/icons/inbox.d.ts +5 -0
- package/dist/types/common/icons/italic.d.ts +5 -0
- package/dist/types/common/icons/loading.d.ts +5 -0
- package/dist/types/common/icons/nylas-logo.d.ts +5 -0
- package/dist/types/common/icons/people.d.ts +5 -0
- package/dist/types/common/icons/play.d.ts +5 -0
- package/dist/types/common/icons/refresh.d.ts +5 -0
- package/dist/types/common/icons/reply-all.d.ts +5 -0
- package/dist/types/common/icons/reply.d.ts +5 -0
- package/dist/types/common/icons/sent.d.ts +5 -0
- package/dist/types/common/icons/spam.d.ts +5 -0
- package/dist/types/common/icons/star.d.ts +5 -0
- package/dist/types/common/icons/stop.d.ts +5 -0
- package/dist/types/common/icons/translate.d.ts +5 -0
- package/dist/types/common/icons/trash.d.ts +5 -0
- package/dist/types/common/icons/underline.d.ts +5 -0
- package/dist/types/common/icons/warning.d.ts +5 -0
- package/dist/types/common/mocks/threads.d.ts +3 -0
- package/dist/types/common/nylas-theme/index.d.ts +27 -0
- package/dist/types/common/register-component.d.ts +29 -0
- package/dist/types/common/types.d.ts +108 -0
- package/dist/types/components/mailbox/nylas-composer/nylas-composer.d.ts +22 -0
- package/dist/types/components/mailbox/nylas-composer/test/nylas-composer.spec-disabled.d.ts +1 -0
- package/dist/types/components/mailbox/nylas-list-folders/nylas-list-folders.d.ts +19 -0
- package/dist/types/components/mailbox/nylas-list-threads/nylas-list-threads.d.ts +19 -0
- package/dist/types/components/mailbox/nylas-mailbox/nylas-mailbox.d.ts +35 -0
- package/dist/types/components/mailbox/nylas-mailbox-pagination/nylas-mailbox-pagination.d.ts +30 -0
- package/dist/types/components/mailbox/nylas-mailbox-toolbar-button/nylas-mailbox-toolbar-button.d.ts +26 -0
- package/dist/types/components/mailbox/nylas-summarize-message-button/nylas-summarize-message-button.d.ts +25 -0
- package/dist/types/components/mailbox/nylas-threads-refresh/nylas-threads-refresh.d.ts +23 -0
- package/dist/types/components/mailbox/nylas-threads-search/nylas-threads-search.d.ts +13 -0
- package/dist/types/components/mailbox/nylas-view-email/nylas-view-email.d.ts +25 -0
- package/dist/types/components/mailbox/nylas-view-thread/nylas-view-thread.d.ts +30 -0
- package/dist/types/components/mailbox/nylas-view-thread/view-thread-message.d.ts +12 -0
- package/dist/types/components/nylas-if-state/nylas-if-state.d.ts +22 -0
- package/dist/types/components/nylas-login/nylas-login.d.ts +26 -0
- package/dist/types/components/nylas-provider/nylas-provider.d.ts +35 -0
- package/dist/types/components/scheduler/nylas-booked-event-card/nylas-booked-event-card.d.ts +22 -0
- package/dist/types/components/scheduler/nylas-booking-form/nylas-booking-form.d.ts +33 -0
- package/dist/types/components/scheduler/nylas-cancelled-event-card/nylas-cancelled-event-card.d.ts +13 -0
- package/dist/types/components/scheduler/nylas-date-picker/nylas-date-picker.d.ts +19 -0
- package/dist/types/components/scheduler/nylas-locale-switch/nylas-locale-switch.d.ts +13 -0
- package/dist/types/components/scheduler/nylas-notification/nylas-notification.d.ts +13 -0
- package/dist/types/components/scheduler/nylas-open-hours-picker/nylas-open-hours-picker.d.ts +40 -0
- package/dist/types/components/scheduler/nylas-scheduler/nylas-scheduler.d.ts +41 -0
- package/dist/types/components/scheduler/nylas-scheduler/scheduler-view.d.ts +6 -0
- package/dist/types/components/scheduler/nylas-selected-event-card/nylas-selected-event-card.d.ts +15 -0
- package/dist/types/components/scheduler/nylas-timeslot-picker/nylas-timeslot-picker.d.ts +28 -0
- package/dist/types/components.d.ts +2123 -0
- package/dist/types/connector/connector-interface.d.ts +35 -0
- package/dist/types/connector/nylas-connector/index.d.ts +59 -0
- package/dist/types/connector/nylas-mailbox-connector/index.d.ts +52 -0
- package/dist/types/connector/nylas-scheduler-connector/index.d.ts +24 -0
- package/dist/types/connector/shared/api/auth.d.ts +13 -0
- package/dist/types/connector/shared/api/folders.d.ts +10 -0
- package/dist/types/connector/shared/api/messages.d.ts +13 -0
- package/dist/types/connector/shared/api/scheduler.d.ts +29 -0
- package/dist/types/connector/shared/api/threads.d.ts +20 -0
- package/dist/types/index.d.ts +4 -0
- package/dist/types/routers/hash-router.d.ts +21 -0
- package/dist/types/routers/router-interface.d.ts +16 -0
- package/dist/types/stencil-public-runtime.d.ts +1681 -0
- package/dist/types/stores/auth-store.d.ts +9 -0
- package/dist/types/stores/mailbox-store.d.ts +19 -0
- package/dist/types/stores/scheduler-store.d.ts +32 -0
- package/dist/types/utils/color-utils.d.ts +9 -0
- package/dist/types/utils/utils.d.ts +28 -0
- package/loader/cdn.js +3 -0
- package/loader/index.cjs.js +3 -0
- package/loader/index.d.ts +21 -0
- package/loader/index.es2017.js +3 -0
- package/loader/index.js +4 -0
- package/loader/package.json +11 -0
- package/package.json +69 -0
- package/readme.md +42 -0
|
@@ -0,0 +1,333 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-34e64e2d.js');
|
|
6
|
+
const utils = require('./utils-f91d4c73.js');
|
|
7
|
+
const duration = require('./duration-18b22d1b.js');
|
|
8
|
+
|
|
9
|
+
const timeMinute = duration.timeInterval((date) => {
|
|
10
|
+
date.setTime(date - date.getMilliseconds() - date.getSeconds() * duration.durationSecond);
|
|
11
|
+
}, (date, step) => {
|
|
12
|
+
date.setTime(+date + step * duration.durationMinute);
|
|
13
|
+
}, (start, end) => {
|
|
14
|
+
return (end - start) / duration.durationMinute;
|
|
15
|
+
}, (date) => {
|
|
16
|
+
return date.getMinutes();
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
const timeMinutes = timeMinute.range;
|
|
20
|
+
|
|
21
|
+
duration.timeInterval((date) => {
|
|
22
|
+
date.setUTCSeconds(0, 0);
|
|
23
|
+
}, (date, step) => {
|
|
24
|
+
date.setTime(+date + step * duration.durationMinute);
|
|
25
|
+
}, (start, end) => {
|
|
26
|
+
return (end - start) / duration.durationMinute;
|
|
27
|
+
}, (date) => {
|
|
28
|
+
return date.getUTCMinutes();
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
const timeHour = duration.timeInterval((date) => {
|
|
32
|
+
date.setTime(date - date.getMilliseconds() - date.getSeconds() * duration.durationSecond - date.getMinutes() * duration.durationMinute);
|
|
33
|
+
}, (date, step) => {
|
|
34
|
+
date.setTime(+date + step * duration.durationHour);
|
|
35
|
+
}, (start, end) => {
|
|
36
|
+
return (end - start) / duration.durationHour;
|
|
37
|
+
}, (date) => {
|
|
38
|
+
return date.getHours();
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
const timeHours = timeHour.range;
|
|
42
|
+
|
|
43
|
+
duration.timeInterval((date) => {
|
|
44
|
+
date.setUTCMinutes(0, 0, 0);
|
|
45
|
+
}, (date, step) => {
|
|
46
|
+
date.setTime(+date + step * duration.durationHour);
|
|
47
|
+
}, (start, end) => {
|
|
48
|
+
return (end - start) / duration.durationHour;
|
|
49
|
+
}, (date) => {
|
|
50
|
+
return date.getUTCHours();
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
const nylasOpenHoursPickerCss = ":host{display:block;font-size:inherit;font-family:inherit;--nylas-grid-border-color:var(--nylas-base-100);--nylas-available-color:var(--nylas-base-500);--nylas-available-hover-color:var(--nylas-base-100);--nylas-unavailable-color:inherit}.legend{display:grid;grid-template-columns:1fr 1fr;gap:1rem;align-items:center;font-size:inherit;font-family:inherit;max-width:fit-content;margin:0 auto;margin-top:1rem}.legend .available{display:grid;grid-template-columns:auto 1fr;gap:0.5rem;align-items:center;font-size:inherit;font-family:inherit}.legend .available .box{width:2rem;height:2rem;background-color:var(--nylas-available-color);border:1px dashed var(--nylas-grid-border-color)}.legend .unavailable{display:grid;grid-template-columns:auto 1fr;gap:0.5rem;align-items:center;font-size:inherit;font-family:inherit}.legend .unavailable .box{width:2rem;height:2rem;background-color:var(--nylas-unavailable-color);border:1px dashed var(--nylas-grid-border-color)}.open-hours{display:grid;gap:1rem;grid-template:\".... days days\" \"hours selected-hours selected-hours\" 1fr/auto 1fr}.open-hours .days{grid-area:days;display:grid;grid-auto-flow:column;grid-template-columns:1fr 1fr 1fr 1fr 1fr 1fr 1fr;text-align:center;justify-items:center;font-size:inherit;font-family:inherit}.open-hours .hours{display:grid;grid-auto-flow:row;grid-area:hours;text-align:right;align-items:start;font-size:inherit;font-family:inherit}.open-hours .hours span{top:-0.6rem;display:block;position:relative}.open-hours .selected-hours{display:grid;grid-area:selected-hours;grid-template-columns:1fr 1fr 1fr 1fr 1fr 1fr 1fr}.open-hours .selected-hours .hour{display:grid;border:1px dashed var(--nylas-grid-border-color);height:40px;background-color:var(--nylas-unavailable-color)}.open-hours .selected-hours .hour.selected{background-color:var(--nylas-available-color)}.open-hours .selected-hours .hour.hovered{background-color:var(--nylas-available-hover-color)}.open-hours .selected-hours.inverse .hour{background-color:var(--nylas-available-color)}.open-hours .selected-hours.inverse .hour.selected{background-color:var(--nylas-unavailable-color)}.open-hours .selected-hours.inverse .hour.hovered{background-color:var(--nylas-available-hover-color)}";
|
|
54
|
+
const NylasOpenHoursPickerStyle0 = nylasOpenHoursPickerCss;
|
|
55
|
+
|
|
56
|
+
const NylasOpenHoursPicker = class {
|
|
57
|
+
constructor(hostRef) {
|
|
58
|
+
index.registerInstance(this, hostRef);
|
|
59
|
+
this.openHoursChanged = index.createEvent(this, "openHoursChanged", 7);
|
|
60
|
+
this.dragStartTime = 0;
|
|
61
|
+
this.onSelectedHoursWeel = (event) => {
|
|
62
|
+
event.preventDefault();
|
|
63
|
+
event.stopPropagation();
|
|
64
|
+
const { deltaY } = event;
|
|
65
|
+
const step = deltaY > 0 ? -1 : 1;
|
|
66
|
+
if (this.intervalMinutes === this.stepMinutes && step === -1) {
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
if (this.intervalMinutes === 60 && step === 1) {
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
this.intervalMinutes = this.intervalMinutes + step * this.stepMinutes;
|
|
73
|
+
const end = new Date(this.startTime);
|
|
74
|
+
end.setHours(this.endTime.getHours(), 0, 0, 0);
|
|
75
|
+
if (this.intervalMinutes < 60) {
|
|
76
|
+
this.times = timeMinutes(this.startTime, end, this.intervalMinutes);
|
|
77
|
+
}
|
|
78
|
+
else {
|
|
79
|
+
this.times = timeHours(this.startTime, end, this.intervalMinutes / 60);
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
this.onContextMenu = (event) => {
|
|
83
|
+
event.preventDefault();
|
|
84
|
+
event.stopPropagation();
|
|
85
|
+
this.inverse = !this.inverse;
|
|
86
|
+
};
|
|
87
|
+
this.onMouseDown = (event, date) => {
|
|
88
|
+
this.draggingStartDate = date;
|
|
89
|
+
this.dragStartTime = new Date().getTime();
|
|
90
|
+
event.preventDefault();
|
|
91
|
+
event.stopPropagation();
|
|
92
|
+
};
|
|
93
|
+
this.onMouseOver = (_event, date) => {
|
|
94
|
+
if (!this.isDragging()) {
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
this.draggingEndDate = date;
|
|
98
|
+
};
|
|
99
|
+
this.onMouseUp = (event, _date) => {
|
|
100
|
+
const hoveredElements = this.host.querySelectorAll('.hovered');
|
|
101
|
+
hoveredElements.forEach(element => {
|
|
102
|
+
element.classList.remove('hovered');
|
|
103
|
+
});
|
|
104
|
+
if (this.isDragging() && this.draggingStartDate && this.draggingEndDate) {
|
|
105
|
+
const availableTimes = [];
|
|
106
|
+
let start = this.draggingStartDate;
|
|
107
|
+
let end = this.draggingEndDate;
|
|
108
|
+
end.setMinutes(end.getMinutes() + this.intervalMinutes);
|
|
109
|
+
const startDay = start.getDay();
|
|
110
|
+
const endDay = end.getDay();
|
|
111
|
+
if (startDay === endDay) {
|
|
112
|
+
availableTimes.push({ start, end });
|
|
113
|
+
}
|
|
114
|
+
else if (endDay > startDay) {
|
|
115
|
+
for (let i = 0; i <= endDay - startDay; i++) {
|
|
116
|
+
const newStart = new Date(start);
|
|
117
|
+
const newEnd = new Date(start);
|
|
118
|
+
newStart.setDate(start.getDate() + i);
|
|
119
|
+
newEnd.setDate(start.getDate() + i);
|
|
120
|
+
newEnd.setHours(end.getHours());
|
|
121
|
+
availableTimes.push({ start: newStart, end: newEnd });
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
for (let availableTime of availableTimes) {
|
|
125
|
+
this.updateAvailableTimes(availableTime.start, availableTime.end);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
this.draggingStartDate = null;
|
|
129
|
+
this.draggingEndDate = null;
|
|
130
|
+
event.preventDefault();
|
|
131
|
+
event.stopPropagation();
|
|
132
|
+
};
|
|
133
|
+
this.onTimeClick = (selectedDate) => {
|
|
134
|
+
if (this.isDragging()) {
|
|
135
|
+
utils.debug('dragging for more than threshold, skipping click event');
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
138
|
+
this.draggingStartDate = null;
|
|
139
|
+
const start = new Date(selectedDate);
|
|
140
|
+
const end = new Date(selectedDate);
|
|
141
|
+
end.setMinutes(end.getMinutes() + this.intervalMinutes);
|
|
142
|
+
this.updateAvailableTimes(start, end);
|
|
143
|
+
};
|
|
144
|
+
this.isDragging = () => {
|
|
145
|
+
const now = new Date().getTime();
|
|
146
|
+
return this.draggingStartDate && now - this.dragStartTime > this.dragThreshold;
|
|
147
|
+
};
|
|
148
|
+
this.updateAvailableTimes = (start, end) => {
|
|
149
|
+
const { availableTimes } = this;
|
|
150
|
+
const index = availableTimes.findIndex(aTime => start.getTime() >= aTime.start.getTime() && end.getTime() <= aTime.end.getTime());
|
|
151
|
+
if (index !== -1) {
|
|
152
|
+
availableTimes.splice(index, 1);
|
|
153
|
+
this.availableTimes = [...availableTimes];
|
|
154
|
+
return;
|
|
155
|
+
}
|
|
156
|
+
const prevIndex = availableTimes.findIndex(aTime => start.getTime() === aTime.end.getTime());
|
|
157
|
+
if (prevIndex !== -1) {
|
|
158
|
+
availableTimes[prevIndex].end = end;
|
|
159
|
+
this.availableTimes = [...availableTimes];
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
162
|
+
const nextIndex = availableTimes.findIndex(aTime => end.getTime() === aTime.start.getTime());
|
|
163
|
+
if (nextIndex !== -1) {
|
|
164
|
+
availableTimes[nextIndex].start = start;
|
|
165
|
+
this.availableTimes = [...availableTimes];
|
|
166
|
+
return;
|
|
167
|
+
}
|
|
168
|
+
this.availableTimes = [...availableTimes, { start, end }];
|
|
169
|
+
};
|
|
170
|
+
this.isAvailableTime = (date) => {
|
|
171
|
+
return this.availableTimes.some(aTime => {
|
|
172
|
+
return aTime.start.getTime() <= date.getTime() && aTime.end.getTime() > date.getTime();
|
|
173
|
+
});
|
|
174
|
+
};
|
|
175
|
+
this.getSelectedDate = (index) => {
|
|
176
|
+
const selectedDate = new Date(this.startTime);
|
|
177
|
+
selectedDate.setDate((index % 7) + 1);
|
|
178
|
+
const i = Math.floor(index / 7);
|
|
179
|
+
selectedDate.setHours(this.times[i].getHours());
|
|
180
|
+
selectedDate.setMinutes(this.times[i].getMinutes());
|
|
181
|
+
return selectedDate;
|
|
182
|
+
};
|
|
183
|
+
this.isHovering = (hoveredDate) => {
|
|
184
|
+
if (!this.draggingStartDate || !this.draggingEndDate) {
|
|
185
|
+
return false;
|
|
186
|
+
}
|
|
187
|
+
return (hoveredDate.getDay() >= this.draggingStartDate.getDay() &&
|
|
188
|
+
hoveredDate.getHours() >= this.draggingStartDate.getHours() &&
|
|
189
|
+
hoveredDate.getHours() <= this.draggingEndDate.getHours() &&
|
|
190
|
+
hoveredDate.getDay() <= this.draggingEndDate.getDay());
|
|
191
|
+
};
|
|
192
|
+
this.calculateAvailableTimes = (openHours) => {
|
|
193
|
+
const availableTimes = [];
|
|
194
|
+
for (const openHour of openHours) {
|
|
195
|
+
for (const day of openHour.days) {
|
|
196
|
+
if (openHour.start === openHour.end) {
|
|
197
|
+
continue;
|
|
198
|
+
}
|
|
199
|
+
const [startHours, startMinutes] = openHour.start.split(':').map(s => parseInt(s, 10));
|
|
200
|
+
const [endHours, endMinutes] = openHour.end.split(':').map(s => parseInt(s, 10));
|
|
201
|
+
const start = new Date(this.startTime);
|
|
202
|
+
start.setDate(start.getDate() + day);
|
|
203
|
+
start.setHours(startHours);
|
|
204
|
+
start.setMinutes(startMinutes);
|
|
205
|
+
const end = new Date(this.startTime);
|
|
206
|
+
end.setDate(end.getDate() + day);
|
|
207
|
+
end.setHours(endHours);
|
|
208
|
+
end.setMinutes(endMinutes);
|
|
209
|
+
availableTimes.push({ start, end });
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
availableTimes.sort((a, b) => a.start.getTime() - b.start.getTime());
|
|
213
|
+
utils.debug('availableTimes', availableTimes);
|
|
214
|
+
return availableTimes;
|
|
215
|
+
};
|
|
216
|
+
this.calculateOpenHours = () => {
|
|
217
|
+
const hours = {};
|
|
218
|
+
const openHours = [];
|
|
219
|
+
let availableTimes = [...this.availableTimes];
|
|
220
|
+
availableTimes.sort((a, b) => a.start.getTime() - b.start.getTime());
|
|
221
|
+
if (this.inverse) {
|
|
222
|
+
const copyOfAvailableTimes = [...availableTimes];
|
|
223
|
+
availableTimes = [];
|
|
224
|
+
let start = this.startTime;
|
|
225
|
+
for (const availableTime of copyOfAvailableTimes) {
|
|
226
|
+
const end = availableTime.start;
|
|
227
|
+
availableTimes.push({ start, end });
|
|
228
|
+
start = availableTime.end;
|
|
229
|
+
}
|
|
230
|
+
availableTimes.push({ start, end: this.endTime });
|
|
231
|
+
}
|
|
232
|
+
availableTimes.sort((a, b) => a.start.getTime() - b.start.getTime());
|
|
233
|
+
for (const availableTime of availableTimes) {
|
|
234
|
+
const startDay = availableTime.start.getDay();
|
|
235
|
+
const endDay = availableTime.end.getDay();
|
|
236
|
+
const nextDay = new Date(availableTime.start);
|
|
237
|
+
nextDay.setDate(nextDay.getDate() + 1);
|
|
238
|
+
nextDay.setHours(0, 0, 0, 0);
|
|
239
|
+
if (startDay > endDay || endDay > startDay) {
|
|
240
|
+
availableTimes.push({ start: nextDay, end: availableTime.end });
|
|
241
|
+
availableTime.end = new Date(availableTime.start);
|
|
242
|
+
availableTime.end.setHours(23, 0, 0, 0);
|
|
243
|
+
}
|
|
244
|
+
const startHours = utils.get24HourTime(availableTime.start);
|
|
245
|
+
const endHours = utils.get24HourTime(availableTime.end);
|
|
246
|
+
const pair = `${startHours}-${endHours}`;
|
|
247
|
+
if (!hours[pair]) {
|
|
248
|
+
hours[pair] = [startDay];
|
|
249
|
+
}
|
|
250
|
+
else {
|
|
251
|
+
hours[pair].push(startDay);
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
for (const key in hours) {
|
|
255
|
+
const [startHours, endHours] = key.split('-');
|
|
256
|
+
const days = hours[key];
|
|
257
|
+
const openHour = {
|
|
258
|
+
days,
|
|
259
|
+
start: startHours,
|
|
260
|
+
end: endHours,
|
|
261
|
+
timezone: utils.getUserTimezone(),
|
|
262
|
+
};
|
|
263
|
+
openHours.push(openHour);
|
|
264
|
+
}
|
|
265
|
+
this.openHoursChanged.emit(openHours);
|
|
266
|
+
};
|
|
267
|
+
this.getNumberOfDatesBetween = (start, end) => {
|
|
268
|
+
const diff = Math.abs(end.getTime() - start.getTime());
|
|
269
|
+
return Math.ceil(diff / (1000 * 60 * 60 * 24));
|
|
270
|
+
};
|
|
271
|
+
this.openHours = [];
|
|
272
|
+
this.startTime = new Date(2024, 8, 1, 8, 0, 0, 0);
|
|
273
|
+
this.endTime = new Date(2024, 8, 7, 18, 0, 0, 0);
|
|
274
|
+
this.stepMinutes = 15;
|
|
275
|
+
this.dragThreshold = 150;
|
|
276
|
+
this.mobileViewPortWidth = 768;
|
|
277
|
+
this.intervalMinutes = 60;
|
|
278
|
+
this.times = [];
|
|
279
|
+
this.availableTimes = [];
|
|
280
|
+
this.draggingStartDate = null;
|
|
281
|
+
this.draggingEndDate = null;
|
|
282
|
+
this.inverse = false;
|
|
283
|
+
this.isMobile = false;
|
|
284
|
+
}
|
|
285
|
+
componentWillLoad() {
|
|
286
|
+
this.onResize();
|
|
287
|
+
const end = new Date(this.startTime);
|
|
288
|
+
end.setHours(this.endTime.getHours(), 0, 0, 0);
|
|
289
|
+
this.times = timeHours(this.startTime, end, this.intervalMinutes / 60);
|
|
290
|
+
this.availableTimes = this.calculateAvailableTimes(this.openHours);
|
|
291
|
+
}
|
|
292
|
+
whenOpenHoursChanged(newValue, oldValue) {
|
|
293
|
+
if (JSON.stringify(newValue) === JSON.stringify(oldValue)) {
|
|
294
|
+
return;
|
|
295
|
+
}
|
|
296
|
+
this.availableTimes = this.calculateAvailableTimes(newValue);
|
|
297
|
+
}
|
|
298
|
+
availableTimesChanged() {
|
|
299
|
+
this.calculateOpenHours();
|
|
300
|
+
}
|
|
301
|
+
inverseChanged() {
|
|
302
|
+
this.calculateOpenHours();
|
|
303
|
+
}
|
|
304
|
+
onResize() {
|
|
305
|
+
const vw = Math.max(document.documentElement.clientWidth || 0, window.innerWidth || 0);
|
|
306
|
+
this.isMobile = vw <= this.mobileViewPortWidth;
|
|
307
|
+
}
|
|
308
|
+
render() {
|
|
309
|
+
return (index.h(index.Host, { key: '7d7260510342c7d666f9596eddee704088451dbb' }, index.h("div", { key: '8ebc305e29157af40c432ec8ff0e182c206cfda0', class: "open-hours", part: "open-hours" }, index.h("div", { key: 'df2e84e8387773ff864c56b78d5fbb3f8f7db606', class: "days", part: "days" }, Array.from({ length: this.getNumberOfDatesBetween(this.startTime, this.endTime) }).map((_, index$1) => {
|
|
310
|
+
const date = new Date(this.startTime);
|
|
311
|
+
date.setDate(date.getDate() + index$1);
|
|
312
|
+
return index.h("span", null, date.toLocaleDateString(undefined, { weekday: this.isMobile ? 'short' : 'long' }));
|
|
313
|
+
})), index.h("div", { key: '88dff2631e52fed25458d0545dfaba0e0586b8ec', class: "hours", part: "hours" }, this.times.map(date => (index.h("span", null, date.toLocaleTimeString(undefined, { timeStyle: 'short' }))))), index.h("div", { key: '53f658bf52ea9367376fb297ce50d8849bf99841', class: {
|
|
314
|
+
'selected-hours': true,
|
|
315
|
+
'inverse': this.inverse,
|
|
316
|
+
}, part: "selected-hours", onWheel: this.onSelectedHoursWeel, onContextMenu: this.onContextMenu }, Array.from({ length: this.getNumberOfDatesBetween(this.startTime, this.endTime) * this.times.length }).map((_, index$1) => (index.h("div", { part: "hour", class: {
|
|
317
|
+
hour: true,
|
|
318
|
+
selected: this.isAvailableTime(this.getSelectedDate(index$1)),
|
|
319
|
+
hovered: this.isHovering(this.getSelectedDate(index$1)),
|
|
320
|
+
}, onMouseDown: event => this.onMouseDown(event, this.getSelectedDate(index$1)), onMouseUp: event => this.onMouseUp(event, this.getSelectedDate(index$1)), onMouseOver: event => this.onMouseOver(event, this.getSelectedDate(index$1)), onClick: () => this.onTimeClick(this.getSelectedDate(index$1)) }, "\u00A0"))))), index.h("div", { key: '2f0459102a39a37ee38ff550b7fe7d303bfa9fef', class: "legend", part: "legend" }, index.h("div", { key: 'b2ce6eb4496270ae2577164f2fecb9145e7120d5', class: "available", part: "available" }, index.h("span", { key: '0fe60c643e3d9cee77509109bbb99059f1900716', class: "box", part: "box" }), index.h("span", { key: '3f03d82fe8b20dab316910ced828682880057a4d', class: "label", part: "label" }, "Available")), index.h("div", { key: '188ea3df5640bcd2fe197bf00e2dfd4ede0189cf', class: "unavailable", part: "unavailable" }, index.h("span", { key: '9b313c8a36f2752a8327612efd665ea275175fb5', class: "box", part: "box" }), index.h("span", { key: '772d25822bd93b80d434f8bb501b4487b5d6a04a', class: "label", part: "label" }, "Unavailable")))));
|
|
321
|
+
}
|
|
322
|
+
get host() { return index.getElement(this); }
|
|
323
|
+
static get watchers() { return {
|
|
324
|
+
"openHours": ["whenOpenHoursChanged"],
|
|
325
|
+
"availableTimes": ["availableTimesChanged"],
|
|
326
|
+
"inverse": ["inverseChanged"]
|
|
327
|
+
}; }
|
|
328
|
+
};
|
|
329
|
+
NylasOpenHoursPicker.style = NylasOpenHoursPickerStyle0;
|
|
330
|
+
|
|
331
|
+
exports.nylas_open_hours_picker = NylasOpenHoursPicker;
|
|
332
|
+
|
|
333
|
+
//# sourceMappingURL=nylas-open-hours-picker.cjs.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"nylas-open-hours-picker.entry.cjs.js","mappings":";;;;;;;;AAGO,MAAM,UAAU,GAAGA,qBAAY,CAAC,CAAC,IAAI,KAAK;AACjD,EAAE,IAAI,CAAC,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC,eAAe,EAAE,GAAG,IAAI,CAAC,UAAU,EAAE,GAAGC,uBAAc,CAAC,CAAC;AACnF,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK;AACnB,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,IAAI,GAAG,IAAI,GAAGC,uBAAc,CAAC,CAAC;AAC9C,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK;AACnB,EAAE,OAAO,CAAC,GAAG,GAAG,KAAK,IAAIA,uBAAc,CAAC;AACxC,CAAC,EAAE,CAAC,IAAI,KAAK;AACb,EAAE,OAAO,IAAI,CAAC,UAAU,EAAE,CAAC;AAC3B,CAAC,CAAC,CAAC;AACH;AACO,MAAM,WAAW,GAAG,UAAU,CAAC,KAAK,CAAC;AAC5C;AACyBF,qBAAY,CAAC,CAAC,IAAI,KAAK;AAChD,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAC3B,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK;AACnB,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,IAAI,GAAG,IAAI,GAAGE,uBAA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,EACpCA,mEAAM,KAAK,EAAC,OAAO,EAAC,IAAI,EAAC,OAAO,kBAEzB,CACH,CACF,CACD,EACP;KACH;;;;;;;;;;;;","names":["timeInterval","durationSecond","durationMinute","durationHour","debug","get24HourTime","getUserTimezone","h","Host","index"],"sources":["../../node_modules/.pnpm/d3-time@3.1.0/node_modules/d3-time/src/minute.js","../../node_modules/.pnpm/d3-time@3.1.0/node_modules/d3-time/src/hour.js","src/components/scheduler/nylas-open-hours-picker/nylas-open-hours-picker.scss?tag=nylas-open-hours-picker&encapsulation=shadow","src/components/scheduler/nylas-open-hours-picker/nylas-open-hours-picker.tsx"],"sourcesContent":["import {timeInterval} from \"./interval.js\";\nimport {durationMinute, durationSecond} from \"./duration.js\";\n\nexport const timeMinute = timeInterval((date) => {\n date.setTime(date - date.getMilliseconds() - date.getSeconds() * durationSecond);\n}, (date, step) => {\n date.setTime(+date + step * durationMinute);\n}, (start, end) => {\n return (end - start) / durationMinute;\n}, (date) => {\n return date.getMinutes();\n});\n\nexport const timeMinutes = timeMinute.range;\n\nexport const utcMinute = timeInterval((date) => {\n date.setUTCSeconds(0, 0);\n}, (date, step) => {\n date.setTime(+date + step * durationMinute);\n}, (start, end) => {\n return (end - start) / durationMinute;\n}, (date) => {\n return date.getUTCMinutes();\n});\n\nexport const utcMinutes = utcMinute.range;\n","import {timeInterval} from \"./interval.js\";\nimport {durationHour, durationMinute, durationSecond} from \"./duration.js\";\n\nexport const timeHour = timeInterval((date) => {\n date.setTime(date - date.getMilliseconds() - date.getSeconds() * durationSecond - date.getMinutes() * durationMinute);\n}, (date, step) => {\n date.setTime(+date + step * durationHour);\n}, (start, end) => {\n return (end - start) / durationHour;\n}, (date) => {\n return date.getHours();\n});\n\nexport const timeHours = timeHour.range;\n\nexport const utcHour = timeInterval((date) => {\n date.setUTCMinutes(0, 0, 0);\n}, (date, step) => {\n date.setTime(+date + step * durationHour);\n}, (start, end) => {\n return (end - start) / durationHour;\n}, (date) => {\n return date.getUTCHours();\n});\n\nexport const utcHours = utcHour.range;\n",":host {\n display: block;\n font-size: inherit;\n font-family: inherit;\n --nylas-grid-border-color: var(--nylas-base-100);\n --nylas-available-color: var(--nylas-base-500);\n --nylas-available-hover-color: var(--nylas-base-100);\n --nylas-unavailable-color: inherit;\n}\n\n.legend {\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: 1rem;\n align-items: center;\n font-size: inherit;\n font-family: inherit;\n\n max-width: fit-content;\n margin: 0 auto;\n margin-top: 1rem;\n\n .available {\n display: grid;\n grid-template-columns: auto 1fr;\n gap: 0.5rem;\n align-items: center;\n font-size: inherit;\n font-family: inherit;\n\n .box {\n width: 2rem;\n height: 2rem;\n background-color: var(--nylas-available-color);\n border: 1px dashed var(--nylas-grid-border-color);\n }\n }\n\n .unavailable {\n display: grid;\n grid-template-columns: auto 1fr;\n gap: 0.5rem;\n align-items: center;\n font-size: inherit;\n font-family: inherit;\n\n .box {\n width: 2rem;\n height: 2rem;\n background-color: var(--nylas-unavailable-color);\n border: 1px dashed var(--nylas-grid-border-color);\n }\n }\n}\n\n.open-hours {\n display: grid;\n gap: 1rem;\n grid-template:\n '.... days days'\n 'hours selected-hours selected-hours' 1fr / auto 1fr;\n\n .days {\n grid-area: days;\n display: grid;\n grid-auto-flow: column;\n grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr 1fr;\n text-align: center;\n justify-items: center;\n font-size: inherit;\n font-family: inherit;\n }\n\n .hours {\n display: grid;\n grid-auto-flow: row;\n grid-area: hours;\n text-align: right;\n align-items: start;\n font-size: inherit;\n font-family: inherit;\n\n span {\n top: -0.6rem;\n display: block;\n position: relative;\n }\n }\n\n .selected-hours {\n display: grid;\n grid-area: selected-hours;\n grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr 1fr;\n\n .hour {\n display: grid;\n border: 1px dashed var(--nylas-grid-border-color);\n\n height: 40px;\n\n background-color: var(--nylas-unavailable-color);\n\n &.selected {\n background-color: var(--nylas-available-color);\n }\n\n &.hovered {\n background-color: var(--nylas-available-hover-color);\n }\n }\n\n &.inverse {\n .hour {\n background-color: var(--nylas-available-color);\n\n &.selected {\n background-color: var(--nylas-unavailable-color);\n }\n\n &.hovered {\n background-color: var(--nylas-available-hover-color);\n }\n }\n }\n }\n}\n","import { debug, get24HourTime, getUserTimezone } from '@/utils/utils';\nimport { OpenHour } from '@nylas/core';\nimport { Component, Element, Event, EventEmitter, Host, Listen, Prop, State, Watch, h } from '@stencil/core';\nimport { timeHours, timeMinutes } from 'd3-time';\n\n@Component({\n tag: 'nylas-open-hours-picker',\n styleUrl: 'nylas-open-hours-picker.scss',\n shadow: true,\n})\nexport class NylasOpenHoursPicker {\n @Element() public host!: HTMLElement;\n\n /**\n * A pre-populated open hour configuration.\n */\n @Prop() public readonly openHours: OpenHour[] = [];\n\n /**\n * The start time of the day.\n * Leave this to the default date of 2024-09-01T00:00:00.000Z\n * unless you want want available times to be a specific year, month, and day.\n */\n @Prop({ mutable: true }) public startTime = new Date(2024, 8, 1, 8, 0, 0, 0);\n\n /**\n * The end time of the day.\n * Leave this to the default date of 2024-09-07T23:59:59.999Z\n * unless you want want available times to be a specific year, month, and day.\n */\n @Prop({ mutable: true }) public endTime: Date = new Date(2024, 8, 7, 18, 0, 0, 0);\n\n /**\n * The number of minutes between each time.\n * If this is 15, we'll show 15 minute intervals.\n * If this is 60, we'll show 1 hour intervals.\n */\n @Prop() public stepMinutes: number = 15;\n\n /**\n * The number of milliseconds the user must be dragging for before we consider it a drag event.\n */\n @Prop() public dragThreshold: number = 150;\n\n /**\n * The width of the viewport in mobile.\n */\n @Prop() public readonly mobileViewPortWidth: number = 768;\n\n @State() private intervalMinutes: number = 60;\n @State() private times: Date[] = [];\n @State() private availableTimes: { start: Date; end: Date }[] = [];\n @State() private draggingStartDate: Date | null = null;\n @State() private draggingEndDate: Date | null = null;\n @State() private inverse: boolean = false;\n @State() private isMobile: boolean = false;\n\n /**\n * Emitted when open hours is changed.\n */\n @Event() readonly openHoursChanged!: EventEmitter<OpenHour[]>;\n\n private dragStartTime: number = 0;\n\n componentWillLoad() {\n this.onResize();\n const end = new Date(this.startTime);\n end.setHours(this.endTime.getHours(), 0, 0, 0);\n\n this.times = timeHours(this.startTime, end, this.intervalMinutes / 60);\n this.availableTimes = this.calculateAvailableTimes(this.openHours);\n }\n\n @Watch('openHours')\n whenOpenHoursChanged(newValue: OpenHour[], oldValue: OpenHour[]) {\n // Deep compare newValue with this.openHours\n if (JSON.stringify(newValue) === JSON.stringify(oldValue)) {\n return;\n }\n\n this.availableTimes = this.calculateAvailableTimes(newValue);\n }\n\n @Watch('availableTimes')\n availableTimesChanged() {\n this.calculateOpenHours();\n }\n\n @Watch('inverse')\n inverseChanged() {\n this.calculateOpenHours();\n }\n\n @Listen('resize', { target: 'window' })\n onResize() {\n const vw = Math.max(document.documentElement.clientWidth || 0, window.innerWidth || 0);\n this.isMobile = vw <= this.mobileViewPortWidth;\n }\n\n private onSelectedHoursWeel = (event: WheelEvent) => {\n event.preventDefault();\n event.stopPropagation();\n\n const { deltaY } = event;\n const step = deltaY > 0 ? -1 : 1;\n\n // Do nothing if this.intervalMinutes is 15 and we're scrolling up\n if (this.intervalMinutes === this.stepMinutes && step === -1) {\n return;\n }\n\n // Do nothing if this.intervalMinutes is 60 and we're scrolling dwon\n if (this.intervalMinutes === 60 && step === 1) {\n return;\n }\n\n // If scrolling up, increase the interval betwen times by this.stepMinutes minutes\n // If scrolling down, decrease the interval between times by this.stepMinutes minutes\n this.intervalMinutes = this.intervalMinutes + step * this.stepMinutes;\n\n // If the interval is less than 1 hour, we'll use timeMinutes instead of timeHours\n // This will allow us to show 15 minute intervals\n\n const end = new Date(this.startTime);\n end.setHours(this.endTime.getHours(), 0, 0, 0);\n\n if (this.intervalMinutes < 60) {\n this.times = timeMinutes(this.startTime, end, this.intervalMinutes);\n } else {\n this.times = timeHours(this.startTime, end, this.intervalMinutes / 60);\n }\n };\n\n private onContextMenu = (event: MouseEvent) => {\n event.preventDefault();\n event.stopPropagation();\n this.inverse = !this.inverse;\n };\n\n private onMouseDown = (event: MouseEvent, date: Date) => {\n this.draggingStartDate = date;\n this.dragStartTime = new Date().getTime();\n event.preventDefault();\n event.stopPropagation();\n };\n\n private onMouseOver = (_event: MouseEvent, date: Date) => {\n // Only if draggingAt is within 500ms of the mouseup event\n if (!this.isDragging()) {\n return;\n }\n\n this.draggingEndDate = date;\n };\n\n private onMouseUp = (event: MouseEvent, _date: Date) => {\n // Remove all hovered classes\n const hoveredElements = this.host.querySelectorAll('.hovered');\n hoveredElements.forEach(element => {\n element.classList.remove('hovered');\n });\n // Only if draggingAt is within 500ms of the mouseup event\n if (this.isDragging() && this.draggingStartDate && this.draggingEndDate) {\n const availableTimes: { start: Date; end: Date }[] = [];\n let start = this.draggingStartDate;\n let end = this.draggingEndDate;\n end.setMinutes(end.getMinutes() + this.intervalMinutes);\n\n // Get the day of the week\n const startDay = start.getDay();\n const endDay = end.getDay();\n\n if (startDay === endDay) {\n availableTimes.push({ start, end });\n } else if (endDay > startDay) {\n for (let i = 0; i <= endDay - startDay; i++) {\n const newStart = new Date(start);\n const newEnd = new Date(start);\n newStart.setDate(start.getDate() + i);\n newEnd.setDate(start.getDate() + i);\n newEnd.setHours(end.getHours());\n availableTimes.push({ start: newStart, end: newEnd });\n }\n }\n\n for (let availableTime of availableTimes) {\n this.updateAvailableTimes(availableTime.start, availableTime.end);\n }\n }\n this.draggingStartDate = null;\n this.draggingEndDate = null;\n event.preventDefault();\n event.stopPropagation();\n };\n\n /**\n * When a time is clicked, we'll add it to the list of available times.\n * If the time is already in the list of available times, we'll remove it.\n *\n * If the time is near start of a previous available time, we'll extend the previous available time.\n * If the time is near the end of a previous available time, we'll extend the previous available time.\n */\n private onTimeClick = (selectedDate: Date) => {\n // If user has been dragging for more than threshold, skip click event\n if (this.isDragging()) {\n debug('dragging for more than threshold, skipping click event');\n return;\n }\n this.draggingStartDate = null;\n\n const start = new Date(selectedDate);\n const end = new Date(selectedDate);\n end.setMinutes(end.getMinutes() + this.intervalMinutes);\n\n this.updateAvailableTimes(start, end);\n };\n\n private isDragging = () => {\n const now = new Date().getTime();\n return this.draggingStartDate && now - this.dragStartTime > this.dragThreshold;\n };\n\n private updateAvailableTimes = (start: Date, end: Date) => {\n const { availableTimes } = this;\n\n // If the selected date is already in the list of available times, remove it\n const index = availableTimes.findIndex(aTime => start.getTime() >= aTime.start.getTime() && end.getTime() <= aTime.end.getTime());\n if (index !== -1) {\n availableTimes.splice(index, 1);\n this.availableTimes = [...availableTimes];\n return;\n }\n\n // If the selected date starts at the end of a previous available time, extend the previous available time\n const prevIndex = availableTimes.findIndex(aTime => start.getTime() === aTime.end.getTime());\n if (prevIndex !== -1) {\n availableTimes[prevIndex].end = end;\n this.availableTimes = [...availableTimes];\n return;\n }\n\n // If the selected date is near the end of a previous available time, extend the previous available time\n const nextIndex = availableTimes.findIndex(aTime => end.getTime() === aTime.start.getTime());\n if (nextIndex !== -1) {\n availableTimes[nextIndex].start = start;\n this.availableTimes = [...availableTimes];\n return;\n }\n\n // Otherwise, add the selected date to the list of available times\n this.availableTimes = [...availableTimes, { start, end }];\n };\n\n private isAvailableTime = (date: Date) => {\n return this.availableTimes.some(aTime => {\n return aTime.start.getTime() <= date.getTime() && aTime.end.getTime() > date.getTime();\n });\n };\n\n private getSelectedDate = (index: number) => {\n // Create a new date object with the date and time\n const selectedDate = new Date(this.startTime);\n selectedDate.setDate((index % 7) + 1);\n const i = Math.floor(index / 7);\n selectedDate.setHours(this.times[i].getHours());\n selectedDate.setMinutes(this.times[i].getMinutes());\n return selectedDate;\n };\n\n private isHovering = (hoveredDate: Date): boolean => {\n if (!this.draggingStartDate || !this.draggingEndDate) {\n return false;\n }\n\n return (\n hoveredDate.getDay() >= this.draggingStartDate.getDay() &&\n hoveredDate.getHours() >= this.draggingStartDate.getHours() &&\n hoveredDate.getHours() <= this.draggingEndDate.getHours() &&\n hoveredDate.getDay() <= this.draggingEndDate.getDay()\n );\n };\n\n private calculateAvailableTimes = (openHours: OpenHour[]) => {\n const availableTimes: { start: Date; end: Date }[] = [];\n\n // Loop through each OpenHour object\n for (const openHour of openHours) {\n // Loop through each day in the OpenHour object\n for (const day of openHour.days) {\n // Skip if invalid\n if (openHour.start === openHour.end) {\n continue;\n }\n\n // Get the start and end hours\n const [startHours, startMinutes] = openHour.start.split(':').map(s => parseInt(s, 10));\n const [endHours, endMinutes] = openHour.end.split(':').map(s => parseInt(s, 10));\n\n // Create a new start date\n const start = new Date(this.startTime);\n start.setDate(start.getDate() + day);\n start.setHours(startHours);\n start.setMinutes(startMinutes);\n\n // Create a new end date\n const end = new Date(this.startTime);\n end.setDate(end.getDate() + day);\n end.setHours(endHours);\n end.setMinutes(endMinutes);\n\n // Add the start and end date to the availableTimes array\n availableTimes.push({ start, end });\n }\n }\n\n // Sort the availableTimes array\n availableTimes.sort((a, b) => a.start.getTime() - b.start.getTime());\n\n debug('availableTimes', availableTimes);\n\n // Emit the openHoursChanged event\n return availableTimes;\n };\n\n private calculateOpenHours = () => {\n const hours: { [key: string]: number[] } = {};\n const openHours: OpenHour[] = [];\n\n let availableTimes = [...this.availableTimes];\n availableTimes.sort((a, b) => a.start.getTime() - b.start.getTime());\n\n if (this.inverse) {\n const copyOfAvailableTimes = [...availableTimes];\n availableTimes = [];\n let start = this.startTime;\n for (const availableTime of copyOfAvailableTimes) {\n const end = availableTime.start;\n availableTimes.push({ start, end });\n start = availableTime.end;\n }\n availableTimes.push({ start, end: this.endTime });\n }\n availableTimes.sort((a, b) => a.start.getTime() - b.start.getTime());\n\n for (const availableTime of availableTimes) {\n const startDay = availableTime.start.getDay();\n const endDay = availableTime.end.getDay();\n\n const nextDay = new Date(availableTime.start);\n nextDay.setDate(nextDay.getDate() + 1);\n nextDay.setHours(0, 0, 0, 0);\n\n if (startDay > endDay || endDay > startDay) {\n availableTimes.push({ start: nextDay, end: availableTime.end });\n availableTime.end = new Date(availableTime.start);\n availableTime.end.setHours(23, 0, 0, 0);\n }\n\n const startHours = get24HourTime(availableTime.start);\n const endHours = get24HourTime(availableTime.end);\n const pair = `${startHours}-${endHours}`;\n\n if (!hours[pair]) {\n hours[pair] = [startDay];\n } else {\n hours[pair].push(startDay);\n }\n }\n\n for (const key in hours) {\n const [startHours, endHours] = key.split('-');\n const days = hours[key];\n const openHour: OpenHour = {\n days,\n start: startHours,\n end: endHours,\n timezone: getUserTimezone(),\n };\n openHours.push(openHour);\n }\n\n this.openHoursChanged.emit(openHours);\n };\n\n private getNumberOfDatesBetween = (start: Date, end: Date) => {\n const diff = Math.abs(end.getTime() - start.getTime());\n return Math.ceil(diff / (1000 * 60 * 60 * 24));\n };\n\n render() {\n return (\n <Host>\n <div class=\"open-hours\" part=\"open-hours\">\n <div class=\"days\" part=\"days\">\n {\n // Get the days of the week from the start time\n // and loop through each day\n Array.from({ length: this.getNumberOfDatesBetween(this.startTime, this.endTime) }).map((_, index) => {\n const date = new Date(this.startTime);\n date.setDate(date.getDate() + index);\n return <span>{date.toLocaleDateString(undefined, { weekday: this.isMobile ? 'short' : 'long' })}</span>;\n })\n }\n </div>\n <div class=\"hours\" part=\"hours\">\n {this.times.map(date => (\n <span>{date.toLocaleTimeString(undefined, { timeStyle: 'short' })}</span>\n ))}\n </div>\n <div\n class={{\n 'selected-hours': true,\n 'inverse': this.inverse,\n }}\n part=\"selected-hours\"\n onWheel={this.onSelectedHoursWeel}\n onContextMenu={this.onContextMenu}\n >\n {\n // Grid of 7 * this.hours.length\n Array.from({ length: this.getNumberOfDatesBetween(this.startTime, this.endTime) * this.times.length }).map((_, index) => (\n <div\n part=\"hour\"\n class={{\n hour: true,\n selected: this.isAvailableTime(this.getSelectedDate(index)),\n hovered: this.isHovering(this.getSelectedDate(index)),\n }}\n onMouseDown={event => this.onMouseDown(event, this.getSelectedDate(index))}\n onMouseUp={event => this.onMouseUp(event, this.getSelectedDate(index))}\n onMouseOver={event => this.onMouseOver(event, this.getSelectedDate(index))}\n onClick={() => this.onTimeClick(this.getSelectedDate(index))}\n >\n \n </div>\n ))\n }\n </div>\n </div>\n <div class=\"legend\" part=\"legend\">\n <div class=\"available\" part=\"available\">\n <span class=\"box\" part=\"box\"></span>\n <span class=\"label\" part=\"label\">\n Available\n </span>\n </div>\n <div class=\"unavailable\" part=\"unavailable\">\n <span class=\"box\" part=\"box\"></span>\n <span class=\"label\" part=\"label\">\n Unavailable\n </span>\n </div>\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-34e64e2d.js');
|
|
6
|
+
const index_es = require('./index.es-e78884f5.js');
|
|
7
|
+
const utils = require('./utils-f91d4c73.js');
|
|
8
|
+
const mailboxStore = require('./mailbox-store-0b1636fa.js');
|
|
9
|
+
const schedulerStore = require('./scheduler-store-e9822441.js');
|
|
10
|
+
require('./index-e869130c.js');
|
|
11
|
+
|
|
12
|
+
class NylasConnector {
|
|
13
|
+
constructor(router, nylasAuth, nylasAuthStore, nylasMailboxStore, nylasSchedulerStore, schedulerAPIURL = 'https://scheduler.nylas.com') {
|
|
14
|
+
this.router = router;
|
|
15
|
+
this.schedulerAPIURL = schedulerAPIURL;
|
|
16
|
+
this.nylasAuth = nylasAuth;
|
|
17
|
+
this.nylasAuthStore = nylasAuthStore;
|
|
18
|
+
this.nylasMailboxStore = nylasMailboxStore;
|
|
19
|
+
this.nylasSchedulerStore = nylasSchedulerStore;
|
|
20
|
+
}
|
|
21
|
+
init() {
|
|
22
|
+
utils.debug('NylasConnector init');
|
|
23
|
+
}
|
|
24
|
+
get authStore() {
|
|
25
|
+
return this.nylasAuthStore;
|
|
26
|
+
}
|
|
27
|
+
get mailboxStore() {
|
|
28
|
+
return this.nylasMailboxStore;
|
|
29
|
+
}
|
|
30
|
+
get schedulerStore() {
|
|
31
|
+
return this.nylasSchedulerStore;
|
|
32
|
+
}
|
|
33
|
+
get auth() {
|
|
34
|
+
if (this._authConnector) {
|
|
35
|
+
return this._authConnector;
|
|
36
|
+
}
|
|
37
|
+
this._authConnector = new mailboxStore.NylasAuthConnector(this.nylasAuth, this.nylasAuthStore);
|
|
38
|
+
return this._authConnector;
|
|
39
|
+
}
|
|
40
|
+
get threads() {
|
|
41
|
+
if (this._threadConnector) {
|
|
42
|
+
return this._threadConnector;
|
|
43
|
+
}
|
|
44
|
+
this._threadConnector = new mailboxStore.NylasThreadsConnector(this.nylasAuth, this.nylasAuthStore, this.nylasMailboxStore, this.router);
|
|
45
|
+
return this._threadConnector;
|
|
46
|
+
}
|
|
47
|
+
get messages() {
|
|
48
|
+
if (this._messageConnector) {
|
|
49
|
+
return this._messageConnector;
|
|
50
|
+
}
|
|
51
|
+
this._messageConnector = new mailboxStore.NylasMessagesConnector(this.nylasAuth, this.nylasAuthStore, this.nylasMailboxStore);
|
|
52
|
+
return this._messageConnector;
|
|
53
|
+
}
|
|
54
|
+
get folders() {
|
|
55
|
+
if (this._foldersConnector) {
|
|
56
|
+
return this._foldersConnector;
|
|
57
|
+
}
|
|
58
|
+
this._foldersConnector = new mailboxStore.NylasFoldersConnector(this.nylasAuth, this.nylasAuthStore, this.nylasMailboxStore);
|
|
59
|
+
return this._foldersConnector;
|
|
60
|
+
}
|
|
61
|
+
get scheduler() {
|
|
62
|
+
if (this._schedulerAPIConnector) {
|
|
63
|
+
return this._schedulerAPIConnector;
|
|
64
|
+
}
|
|
65
|
+
this._schedulerAPIConnector = new schedulerStore.NylaSchedulerAPIConnector({
|
|
66
|
+
schedulerAPIURL: this.schedulerAPIURL,
|
|
67
|
+
schedulerStore: this.schedulerStore,
|
|
68
|
+
});
|
|
69
|
+
return this._schedulerAPIConnector;
|
|
70
|
+
}
|
|
71
|
+
getAuth() {
|
|
72
|
+
return this.nylasAuth;
|
|
73
|
+
}
|
|
74
|
+
resetStores() {
|
|
75
|
+
this.nylasAuthStore.reset();
|
|
76
|
+
this.nylasMailboxStore.reset();
|
|
77
|
+
}
|
|
78
|
+
async logout() {
|
|
79
|
+
await this.nylasAuth.logout();
|
|
80
|
+
this.resetStores();
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
const nylasProviderCss = ":host{display:contents}";
|
|
85
|
+
const NylasProviderStyle0 = nylasProviderCss;
|
|
86
|
+
|
|
87
|
+
const NylasProvider = class {
|
|
88
|
+
constructor(hostRef) {
|
|
89
|
+
index.registerInstance(this, hostRef);
|
|
90
|
+
this.init = index.createEvent(this, "init", 7);
|
|
91
|
+
this.loggedIn = index.createEvent(this, "loggedIn", 7);
|
|
92
|
+
this.loggedOut = index.createEvent(this, "loggedOut", 7);
|
|
93
|
+
this.handleAuthChange = async (isAuthenticated) => {
|
|
94
|
+
if (isAuthenticated) {
|
|
95
|
+
this.loggedIn.emit(this.host);
|
|
96
|
+
}
|
|
97
|
+
else {
|
|
98
|
+
this.loggedOut.emit(this.host);
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
this.authConfig = undefined;
|
|
102
|
+
this.eventOverrides = {};
|
|
103
|
+
this.automaticComponentRegistration = true;
|
|
104
|
+
}
|
|
105
|
+
connectedCallback() {
|
|
106
|
+
utils.debug('[nylas-provider] connectedCallback');
|
|
107
|
+
}
|
|
108
|
+
async componentWillLoad() {
|
|
109
|
+
utils.debug('[nylas-provider] componentWillLoad');
|
|
110
|
+
this.stores = {
|
|
111
|
+
auth: mailboxStore.CreateNylasAuthStore(),
|
|
112
|
+
mailbox: mailboxStore.CreateNylasMailboxStore(),
|
|
113
|
+
scheduler: schedulerStore.CreateNylasSchedulerStore(),
|
|
114
|
+
};
|
|
115
|
+
this.baseProvider = new index_es.NylasBaseProvider(this.host, this.stores, this.automaticComponentRegistration, this.eventOverrides);
|
|
116
|
+
const router = new mailboxStore.HashRouter();
|
|
117
|
+
this.nylasAuth = index_es.es({
|
|
118
|
+
apiUri: 'https://api.us.nylas.com',
|
|
119
|
+
elementsApiUri: 'https://elements.us.nylas.com',
|
|
120
|
+
storageType: 'indexeddb',
|
|
121
|
+
clientId: 'YOUR_CLIENT_ID',
|
|
122
|
+
defaultScopes: [],
|
|
123
|
+
redirectURI: '/',
|
|
124
|
+
...this.authConfig,
|
|
125
|
+
});
|
|
126
|
+
const nylasMailboxStore = this.baseProvider?.getStore('mailbox');
|
|
127
|
+
if (!nylasMailboxStore) {
|
|
128
|
+
throw new Error('The mailbox store is not set');
|
|
129
|
+
}
|
|
130
|
+
const nylasAuthStore = this.baseProvider?.getStore('auth');
|
|
131
|
+
if (!nylasAuthStore) {
|
|
132
|
+
throw new Error('The auth store is not set');
|
|
133
|
+
}
|
|
134
|
+
const nylasSchedulerStore = this.baseProvider?.getStore('scheduler');
|
|
135
|
+
if (!nylasSchedulerStore) {
|
|
136
|
+
throw new Error('The scheduler store is not set');
|
|
137
|
+
}
|
|
138
|
+
this.nylasConnector = new NylasConnector(router, this.nylasAuth, nylasAuthStore, nylasMailboxStore, nylasSchedulerStore);
|
|
139
|
+
const initEvent = this.init.emit(this.host);
|
|
140
|
+
if (!initEvent.defaultPrevented) {
|
|
141
|
+
await this.nylasConnector?.auth.validateSession();
|
|
142
|
+
}
|
|
143
|
+
this.handleAuthChange(nylasAuthStore.state.isAuthenticated);
|
|
144
|
+
this.baseProvider?.componentWillLoad(this.nylasConnector);
|
|
145
|
+
}
|
|
146
|
+
componentDidLoad() {
|
|
147
|
+
const nylasAuthStore = this.baseProvider?.getStore('auth');
|
|
148
|
+
nylasAuthStore?.onChange('isAuthenticated', this.handleAuthChange);
|
|
149
|
+
this.baseProvider?.componentDidLoad();
|
|
150
|
+
}
|
|
151
|
+
componentDisconnected() {
|
|
152
|
+
this.baseProvider?.componentDisconnected();
|
|
153
|
+
}
|
|
154
|
+
async registerComponentHandler(event) {
|
|
155
|
+
this.baseProvider?.registerComponent(event.detail);
|
|
156
|
+
}
|
|
157
|
+
async unregisterComponentHandler(event) {
|
|
158
|
+
this.baseProvider?.unregisterComponent(event.detail);
|
|
159
|
+
}
|
|
160
|
+
async getNylasAuth() {
|
|
161
|
+
return this.nylasAuth;
|
|
162
|
+
}
|
|
163
|
+
async getNylasConnector() {
|
|
164
|
+
return this.nylasConnector;
|
|
165
|
+
}
|
|
166
|
+
async getMailboxStore() {
|
|
167
|
+
return this.baseProvider?.getStore('mailbox');
|
|
168
|
+
}
|
|
169
|
+
async getAuthStore() {
|
|
170
|
+
return this.baseProvider?.getStore('auth');
|
|
171
|
+
}
|
|
172
|
+
async getNylasSchedulerStore() {
|
|
173
|
+
return this.baseProvider?.getStore('scheduler');
|
|
174
|
+
}
|
|
175
|
+
render() {
|
|
176
|
+
return (index.h(index.Host, { key: 'ff2cfa488faf8587aae9b577b59f536921dc125a' }, index.h("slot", { key: 'a5faaff431a3140912330969ea744fbc1519c121' })));
|
|
177
|
+
}
|
|
178
|
+
get host() { return index.getElement(this); }
|
|
179
|
+
};
|
|
180
|
+
NylasProvider.style = NylasProviderStyle0;
|
|
181
|
+
|
|
182
|
+
exports.nylas_provider = NylasProvider;
|
|
183
|
+
|
|
184
|
+
//# sourceMappingURL=nylas-provider.cjs.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"nylas-provider.entry.cjs.js","mappings":";;;;;;;;;;;MAea,cAAc;IAczB,YACE,MAAuB,EACvB,SAAwB,EACxB,cAAkC,EAClC,iBAAwC,EACxC,mBAA4C,EAC5C,kBAA0B,6BAA6B;QAEvD,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,eAAe,GAAG,eAAe,CAAC;QACvC,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,cAAc,GAAG,cAAc,CAAC;QACrC,IAAI,CAAC,iBAAiB,GAAG,iBAAiB,CAAC;QAC3C,IAAI,CAAC,mBAAmB,GAAG,mBAAmB,CAAC;KAChD;IAEM,IAAI;QACTA,WAAK,CAAC,qBAAqB,CAAC,CAAC;KAC9B;IAED,IAAW,SAAS;QAClB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;KACH;;;;;;;","names":["debug","NylasAuthConnector","NylasThreadsConnector","NylasMessagesConnector","NylasFoldersConnector","NylaSchedulerAPIConnector","CreateNylasAuthStore","CreateNylasMailboxStore","CreateNylasSchedulerStore","NylasBaseProvider","HashRouter","NylasAuth","h","Host"],"sources":["src/connector/nylas-connector/index.ts","src/components/nylas-provider/nylas-provider.css?tag=nylas-provider&encapsulation=shadow","src/components/nylas-provider/nylas-provider.tsx"],"sourcesContent":["import { RouterInterface } from '@/routers/router-interface';\nimport { NylasAuthStoreType } from '@/stores/auth-store';\nimport { NylasMailboxStoreType } from '@/stores/mailbox-store';\nimport { NylasSchedulerStoreType } from '@/stores/scheduler-store';\nimport { debug } from '@/utils/utils';\nimport type { NylasAuthType } from '@nylas/core';\nimport { NylasConnectorInterface } from '../connector-interface';\nimport { NylasAuthConnector } from '../shared/api/auth';\nimport { NylasFoldersConnector } from '../shared/api/folders';\nimport { NylasMessagesConnector } from '../shared/api/messages';\nimport { NylaSchedulerAPIConnector } from '../shared/api/scheduler';\nimport { NylasThreadsConnector } from '../shared/api/threads';\n/**\n * Base class for the Nylas connector.\n */\nexport class NylasConnector implements NylasConnectorInterface {\n public router: RouterInterface;\n public nylasAuth: NylasAuthType;\n public nylasAuthStore: NylasAuthStoreType;\n public nylasMailboxStore: NylasMailboxStoreType;\n public nylasSchedulerStore: NylasSchedulerStoreType;\n public schedulerAPIURL: string;\n\n private _authConnector: NylasAuthConnector | undefined;\n private _threadConnector: NylasThreadsConnector | undefined;\n private _messageConnector: NylasMessagesConnector | undefined;\n private _schedulerAPIConnector: NylaSchedulerAPIConnector | undefined;\n private _foldersConnector: NylasFoldersConnector | undefined;\n\n constructor(\n router: RouterInterface,\n nylasAuth: NylasAuthType,\n nylasAuthStore: NylasAuthStoreType,\n nylasMailboxStore: NylasMailboxStoreType,\n nylasSchedulerStore: NylasSchedulerStoreType,\n schedulerAPIURL: string = 'https://scheduler.nylas.com',\n ) {\n this.router = router;\n this.schedulerAPIURL = schedulerAPIURL;\n this.nylasAuth = nylasAuth;\n this.nylasAuthStore = nylasAuthStore;\n this.nylasMailboxStore = nylasMailboxStore;\n this.nylasSchedulerStore = nylasSchedulerStore;\n }\n\n public init() {\n debug('NylasConnector init');\n }\n\n public get authStore() {\n return this.nylasAuthStore;\n }\n\n public get mailboxStore() {\n return this.nylasMailboxStore;\n }\n\n public get schedulerStore() {\n return this.nylasSchedulerStore;\n }\n\n public get auth() {\n if (this._authConnector) {\n return this._authConnector;\n }\n this._authConnector = new NylasAuthConnector(this.nylasAuth, this.nylasAuthStore);\n return this._authConnector;\n }\n\n public get threads() {\n if (this._threadConnector) {\n return this._threadConnector;\n }\n this._threadConnector = new NylasThreadsConnector(this.nylasAuth, this.nylasAuthStore, this.nylasMailboxStore, this.router);\n return this._threadConnector;\n }\n\n public get messages() {\n if (this._messageConnector) {\n return this._messageConnector;\n }\n this._messageConnector = new NylasMessagesConnector(this.nylasAuth, this.nylasAuthStore, this.nylasMailboxStore);\n return this._messageConnector;\n }\n\n public get folders() {\n if (this._foldersConnector) {\n return this._foldersConnector;\n }\n this._foldersConnector = new NylasFoldersConnector(this.nylasAuth, this.nylasAuthStore, this.nylasMailboxStore);\n return this._foldersConnector;\n }\n\n public get scheduler() {\n if (this._schedulerAPIConnector) {\n return this._schedulerAPIConnector;\n }\n this._schedulerAPIConnector = new NylaSchedulerAPIConnector({\n schedulerAPIURL: this.schedulerAPIURL,\n schedulerStore: this.schedulerStore,\n });\n return this._schedulerAPIConnector;\n }\n\n public getAuth() {\n return this.nylasAuth;\n }\n\n public resetStores() {\n this.nylasAuthStore.reset();\n this.nylasMailboxStore.reset();\n }\n\n public async logout() {\n await this.nylasAuth.logout();\n this.resetStores();\n }\n}\n\nexport type PublicMethods<T> = {\n [K in keyof T]: T[K] extends Function ? (string extends K ? never : K) : never;\n}[keyof T];\n\nexport type NylasConnectorPublicMethods = PublicMethods<NylasConnector>;\n",":host {\n display: contents;\n}\n","import { NylasBaseProvider } from '@/common/abstract-provider';\nimport { RegisteredComponent } from '@/common/register-component';\nimport { NylasConnector } from '@/connector/nylas-connector';\nimport { HashRouter } from '@/routers/hash-router';\nimport { CreateNylasAuthStore, NylasAuthStoreType } from '@/stores/auth-store';\nimport { CreateNylasMailboxStore, NylasMailboxStoreType } from '@/stores/mailbox-store';\nimport { CreateNylasSchedulerStore, NylasSchedulerStoreType } from '@/stores/scheduler-store';\nimport type { NylasAuthType } from '@nylas/core';\nimport { AuthConfg, NylasAuth } from '@nylas/core';\nimport { Component, Element, Event, EventEmitter, Host, Listen, Method, Prop, h } from '@stencil/core';\nimport type { EventOverride } from '@/common/component-types';\nimport { debug } from '@/utils/utils';\n\n/**\n * The Nylas Provider component.\n * This component is used to manage the Nylas Provider.\n * It is used to manage the Nylas Auth instance, the Nylas Connector instance,\n * and the Nylas Store instance.\n */\n@Component({\n tag: 'nylas-provider',\n styleUrl: 'nylas-provider.css',\n shadow: true,\n})\nexport class NylasProvider {\n /**\n * Stores to be used by the provider.\n */\n private stores?: {\n auth: NylasAuthStoreType;\n mailbox: NylasMailboxStoreType;\n scheduler: NylasSchedulerStoreType;\n };\n\n /**\n * This is a base provide that defines the common methods and properties\n * that all providers should have.\n *\n * Because stencil does not support abstract classes, we have to use a\n * property to store the base provider instance.\n */\n private baseProvider?: NylasBaseProvider<Exclude<typeof this.stores, undefined>>;\n\n /**\n * The Nylas Auth instance.\n * Used to manage all things authentication with Nylas.\n */\n private nylasAuth?: NylasAuthType;\n\n /**\n * The Nylas Mailbox Connector instance.\n * The branins of the provider. It manages data fetching and state synchronization.\n */\n private nylasConnector?: NylasConnector;\n\n /**\n * The host element.\n * Used to manage the host element of the provider.\n */\n @Element() private host!: HTMLNylasProviderElement;\n\n /**\n * The Nylas Auth configuration.\n * Used to manage all things authentication with Nylas.\n */\n @Prop({ attribute: 'auth-config' }) readonly authConfig?: AuthConfg;\n\n /**\n * This provides a way to override the default event handlers.\n */\n @Prop() eventOverrides: EventOverride<Exclude<typeof this.nylasConnector, undefined>> = {};\n\n /**\n * Automatically register components that have the `@RegisterComponent` decorator.\n * If this is set to false, you will need to manually register components using the\n * `registerComponent` method.\n * @default true\n */\n @Prop() automaticComponentRegistration: boolean = true;\n\n /**\n * This event is fired when the provider is initialized.\n * It can be used to set the initial state of the provider,\n * or to prevent the provider from firing some default behavior.\n */\n @Event({ cancelable: true }) init!: EventEmitter<HTMLNylasProviderElement>;\n\n /**\n * This event is fired when the the NyalsAuth isAuthenticated state changes\n * to true.\n */\n @Event({ cancelable: true }) loggedIn!: EventEmitter<HTMLNylasProviderElement>;\n\n /**\n * This event is fired when the the NyalsAuth isAuthenticated state changes\n * to true.\n */\n @Event({ cancelable: true }) loggedOut!: EventEmitter<HTMLNylasProviderElement>;\n\n connectedCallback() {\n debug('[nylas-provider] connectedCallback');\n }\n\n async componentWillLoad() {\n debug('[nylas-provider] componentWillLoad');\n\n this.stores = {\n auth: CreateNylasAuthStore(),\n mailbox: CreateNylasMailboxStore(),\n scheduler: CreateNylasSchedulerStore(),\n };\n this.baseProvider = new NylasBaseProvider(this.host, this.stores, this.automaticComponentRegistration, this.eventOverrides);\n\n const router = new HashRouter();\n\n /**\n * Create the NylasAuth instance.\n * This is used to manage all things authentication with Nylas.\n */\n this.nylasAuth = NylasAuth({\n apiUri: 'https://api.us.nylas.com',\n elementsApiUri: 'https://elements.us.nylas.com',\n storageType: 'indexeddb',\n clientId: 'YOUR_CLIENT_ID',\n defaultScopes: [],\n redirectURI: '/',\n ...this.authConfig,\n });\n\n const nylasMailboxStore = this.baseProvider?.getStore('mailbox');\n if (!nylasMailboxStore) {\n throw new Error('The mailbox store is not set');\n }\n\n const nylasAuthStore = this.baseProvider?.getStore('auth');\n if (!nylasAuthStore) {\n throw new Error('The auth store is not set');\n }\n\n const nylasSchedulerStore = this.baseProvider?.getStore('scheduler');\n if (!nylasSchedulerStore) {\n throw new Error('The scheduler store is not set');\n }\n\n this.nylasConnector = new NylasConnector(router, this.nylasAuth, nylasAuthStore, nylasMailboxStore, nylasSchedulerStore);\n\n const initEvent = this.init.emit(this.host);\n if (!initEvent.defaultPrevented) {\n /**\n * By default, on init, we will validate the session.\n * This will check if the user is logged in and if the session is still valid.\n * If the session is not valid, the user will be logged out.\n */\n await this.nylasConnector?.auth.validateSession();\n }\n\n /**\n * Listen for changes in the NylasAuth isAuthenticated state.\n * This is used to fire the loggedIn and loggedOut events.\n */\n this.handleAuthChange(nylasAuthStore.state.isAuthenticated);\n\n this.baseProvider?.componentWillLoad(this.nylasConnector);\n }\n\n componentDidLoad() {\n const nylasAuthStore = this.baseProvider?.getStore('auth');\n nylasAuthStore?.onChange('isAuthenticated', this.handleAuthChange);\n\n this.baseProvider?.componentDidLoad();\n }\n\n componentDisconnected() {\n this.baseProvider?.componentDisconnected();\n }\n\n /**\n * This is a custom event handler that is used to register a component with the provider.\n * It is used by components that have the `@RegisterComponent` decorator.\n * @param event A custom event that contains the component to register\n * @returns Promise<void>\n */\n @Listen('registerComponent')\n async registerComponentHandler(event: CustomEvent<RegisteredComponent<any, any>>): Promise<void> {\n this.baseProvider?.registerComponent(event.detail);\n }\n\n /**\n * This is a custom event handler that is used to unregister a component with the provider.\n * It is used by components that have the `@RegisterComponent` decorator.\n * @param event A custom event that contains the component to unregister\n * @returns Promise<void>\n */\n @Listen('unregisterComponent')\n async unregisterComponentHandler(event: CustomEvent<RegisteredComponent<any, any>>): Promise<void> {\n this.baseProvider?.unregisterComponent(event.detail);\n }\n\n /**\n * This method is used to handle changes in the NylasAuth isAuthenticated state\n * @param isAuthenticated isAuthenticated state\n * @returns void\n */\n private handleAuthChange = async (isAuthenticated: boolean) => {\n if (isAuthenticated) {\n this.loggedIn.emit(this.host);\n } else {\n this.loggedOut.emit(this.host);\n }\n };\n\n /**\n * This method is used to retrieve the NylasAuth instance\n * @returns The NylasAuth instance\n */\n @Method()\n async getNylasAuth(): Promise<NylasAuthType | undefined> {\n return this.nylasAuth;\n }\n\n /**\n * This method is used to retrieve the NylasConnector instance\n * @returns The NylasConnector instance\n */\n @Method()\n async getNylasConnector() {\n return this.nylasConnector;\n }\n\n /**\n * This method is used to retrieve the mailboxStore instance\n * @returns The mailboxStore instance\n */\n @Method()\n async getMailboxStore(): Promise<NylasMailboxStoreType | undefined> {\n return this.baseProvider?.getStore('mailbox');\n }\n\n /**\n * This method is used to retrieve the authStore instance\n * @returns The authStore instance\n */\n @Method()\n async getAuthStore(): Promise<NylasAuthStoreType | undefined> {\n return this.baseProvider?.getStore('auth');\n }\n\n /**\n * This method is used to retrieve the NylasScheduler instance\n * @returns The NylasScheduler instance\n */\n @Method()\n async getNylasSchedulerStore(): Promise<NylasSchedulerStoreType | undefined> {\n return this.baseProvider?.getStore('scheduler');\n }\n\n render() {\n return (\n <Host>\n <slot></slot>\n </Host>\n );\n }\n}\n"],"version":3}
|