@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,182 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
4
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else
|
|
6
|
+
for (var i = decorators.length - 1; i >= 0; i--)
|
|
7
|
+
if (d = decorators[i])
|
|
8
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
9
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
10
|
+
};
|
|
11
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
12
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
13
|
+
return Reflect.metadata(k, v);
|
|
14
|
+
};
|
|
15
|
+
import { RegisterComponent } from "../../../common/register-component";
|
|
16
|
+
import { debug } from "../../../utils/utils";
|
|
17
|
+
import { Host, h } from "@stencil/core";
|
|
18
|
+
export class NylasMailboxToolbarButton {
|
|
19
|
+
constructor() {
|
|
20
|
+
this.onClick = async () => {
|
|
21
|
+
const method = this.method;
|
|
22
|
+
debug(`[nylas-mailbox-toolbar-button] onClick`, { method, mailboxConnector: this.mailboxConnector });
|
|
23
|
+
if (this.mailboxConnector && method) {
|
|
24
|
+
const methodToCall = this.callMethod(this.mailboxConnector, method);
|
|
25
|
+
if (methodToCall) {
|
|
26
|
+
await methodToCall();
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
this.method = undefined;
|
|
31
|
+
this.dataState = undefined;
|
|
32
|
+
this.iconOnly = false;
|
|
33
|
+
this.mailboxConnector = undefined;
|
|
34
|
+
}
|
|
35
|
+
connectedCallback() { }
|
|
36
|
+
disconnectedCallback() { }
|
|
37
|
+
async componentWillLoad() {
|
|
38
|
+
debug(`[nylas-if-state] Component will load`);
|
|
39
|
+
}
|
|
40
|
+
async componentDidLoad() {
|
|
41
|
+
debug(`[nylas-if-state] Component did load`);
|
|
42
|
+
}
|
|
43
|
+
callMethod(obj, accessString) {
|
|
44
|
+
const parts = accessString.split('.');
|
|
45
|
+
let current = obj;
|
|
46
|
+
for (const part of parts.slice(0, -1)) {
|
|
47
|
+
current = current[part];
|
|
48
|
+
if (!current) {
|
|
49
|
+
return undefined;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
const methodName = parts[parts.length - 1];
|
|
53
|
+
const method = current[methodName];
|
|
54
|
+
if (typeof method === 'function') {
|
|
55
|
+
return method.bind(current);
|
|
56
|
+
}
|
|
57
|
+
return undefined;
|
|
58
|
+
}
|
|
59
|
+
renderByState(state) {
|
|
60
|
+
return state ? h("slot", { name: "loading" }, "Loading...") : h("slot", null, "Click");
|
|
61
|
+
}
|
|
62
|
+
hasSlot(name) {
|
|
63
|
+
return !!this.host.querySelector(`[slot="${name}"]`);
|
|
64
|
+
}
|
|
65
|
+
render() {
|
|
66
|
+
let state = false;
|
|
67
|
+
const store = this.mailboxConnector?.nylasMailboxStore;
|
|
68
|
+
if (typeof store !== 'undefined') {
|
|
69
|
+
const storeKey = String(this.dataState);
|
|
70
|
+
state = this.dataState ? store.get(storeKey) === 'loading' : false;
|
|
71
|
+
}
|
|
72
|
+
const key = state ? `state-loading` : 'state-ready';
|
|
73
|
+
return (h(Host, { key: '8885d53e61f2fb52afc9a8b795a71de850b2fbe7' }, h("sp-theme", { key: '7b7d856caa9e2389eaaff33381d374092572f922', scale: "medium", color: "dark" }, h("sp-button", { onClick: this.onClick, disabled: state, key: key, "icon-only": this.iconOnly, label: this.renderByState(state) }, this.hasSlot('icon') && (h("div", { slot: "icon", class: 'slot' }, h("slot", { name: "icon" }))), !this.iconOnly && this.renderByState(state)))));
|
|
74
|
+
}
|
|
75
|
+
static get is() { return "nylas-mailbox-toolbar-button"; }
|
|
76
|
+
static get encapsulation() { return "shadow"; }
|
|
77
|
+
static get originalStyleUrls() {
|
|
78
|
+
return {
|
|
79
|
+
"$": ["nylas-mailbox-toolbar-button.scss"]
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
static get styleUrls() {
|
|
83
|
+
return {
|
|
84
|
+
"$": ["nylas-mailbox-toolbar-button.css"]
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
static get properties() {
|
|
88
|
+
return {
|
|
89
|
+
"method": {
|
|
90
|
+
"type": "string",
|
|
91
|
+
"mutable": false,
|
|
92
|
+
"complexType": {
|
|
93
|
+
"original": "MethodsOfNylasMailboxConnector",
|
|
94
|
+
"resolved": "\"init\" | \"resetStores\" | \"logout\" | \"auth.isAuthenticated\" | \"messages.getMessages\" | \"messages.getThreadMessages\" | \"messages.downloadMessageAttachments\" | \"messages.summarizeText\" | \"messages.textToSpeech\" | \"threads.back\" | \"threads.getThreads\" | \"threads.getThread\" | \"threads.nextThreadPage\" | \"threads.previousThreadPage\" | \"threads.updateThreadQueryParams\" | \"threads.unSelectThread\" | \"threads.selectThread\" | \"threads.markThreadAsRead\" | \"threads.updateThread\" | \"folders.getFolders\" | \"folders.selectFolder\" | \"nylasAuth.isAuthenticated\" | \"nylasAuth.logout\" | \"nylasAuth.getHostedAuthRedirectURL\" | \"nylasAuth.nylasAPIRequest\" | \"nylasAuth.exchangeAuthCodeForTokenInfo\" | \"nylasAuth.nylasDownloadFileRequest\" | \"nylasAuth.getTokenInfo\" | \"nylasAuth.isAccessTokenValid\" | \"nylasAuth.refreshAccessToken\" | \"nylasAuth.hasScopeByType\" | \"nylasAuth.hasScope\" | `nylasAuth.config.${string}` | \"nylasMailboxStore.set\" | \"nylasMailboxStore.use\" | \"nylasMailboxStore.reset\" | \"nylasMailboxStore.get\" | \"nylasMailboxStore.on\" | \"nylasMailboxStore.onChange\" | \"nylasMailboxStore.dispose\" | \"nylasMailboxStore.forceUpdate\" | `nylasMailboxStore.state.${string}` | \"nylasAuthStore.set\" | \"nylasAuthStore.use\" | \"nylasAuthStore.reset\" | \"nylasAuthStore.get\" | \"nylasAuthStore.on\" | \"nylasAuthStore.onChange\" | \"nylasAuthStore.dispose\" | \"nylasAuthStore.forceUpdate\" | \"nylasAuthStore.state.state.\" | \"nylasAuthStore.state.isAuthenticated.\" | \"nylasAuthStore.state.tokenInfo.\" | \"nylasAuthStore.state.tokenInfo.email.\" | \"nylasAuthStore.state.tokenInfo.grant_id.\" | \"nylasAuthStore.state.tokenInfo.expires_in.\" | \"nylasAuthStore.state.tokenInfo.id_token.\" | \"nylasAuthStore.state.tokenInfo.token_type.\" | \"nylasAuthStore.state.tokenInfo.scope.\" | \"nylasAuthStore.state.tokenInfo.refresh_token.\" | \"router.init\" | \"router.addRouteChangeListener\" | \"router.setRoute\" | \"router.navigate\" | \"router.getRoute\" | \"router.getBasePath\" | \"router.matchRoute\" | \"mailboxStore.set\" | \"mailboxStore.use\" | \"mailboxStore.reset\" | \"mailboxStore.get\" | \"mailboxStore.on\" | \"mailboxStore.onChange\" | \"mailboxStore.dispose\" | \"mailboxStore.forceUpdate\" | `mailboxStore.state.${string}` | \"authStore.set\" | \"authStore.use\" | \"authStore.reset\" | \"authStore.get\" | \"authStore.on\" | \"authStore.onChange\" | \"authStore.dispose\" | \"authStore.forceUpdate\" | \"authStore.state.state.\" | \"authStore.state.isAuthenticated.\" | \"authStore.state.tokenInfo.\" | \"authStore.state.tokenInfo.email.\" | \"authStore.state.tokenInfo.grant_id.\" | \"authStore.state.tokenInfo.expires_in.\" | \"authStore.state.tokenInfo.id_token.\" | \"authStore.state.tokenInfo.token_type.\" | \"authStore.state.tokenInfo.scope.\" | \"authStore.state.tokenInfo.refresh_token.\" | \"auth.logout\" | \"auth.getHostedAuthRedirectURL\" | \"auth.getTokenInfo\" | \"auth.isAccessTokenValid\" | \"auth.validateSession\" | \"auth.manageHostedAuthCodeExchange\"",
|
|
95
|
+
"references": {
|
|
96
|
+
"MethodsOfNylasMailboxConnector": {
|
|
97
|
+
"location": "local",
|
|
98
|
+
"path": "/Users/aarondemello/Developer/nylas/nylas/packages/nylas-web-elements/src/components/mailbox/nylas-mailbox-toolbar-button/nylas-mailbox-toolbar-button.tsx",
|
|
99
|
+
"id": "src/components/mailbox/nylas-mailbox-toolbar-button/nylas-mailbox-toolbar-button.tsx::MethodsOfNylasMailboxConnector"
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
"required": true,
|
|
104
|
+
"optional": false,
|
|
105
|
+
"docs": {
|
|
106
|
+
"tags": [],
|
|
107
|
+
"text": "The name of the mailbox connector method to call."
|
|
108
|
+
},
|
|
109
|
+
"attribute": "method",
|
|
110
|
+
"reflect": false
|
|
111
|
+
},
|
|
112
|
+
"dataState": {
|
|
113
|
+
"type": "string",
|
|
114
|
+
"mutable": false,
|
|
115
|
+
"complexType": {
|
|
116
|
+
"original": "string",
|
|
117
|
+
"resolved": "string | undefined",
|
|
118
|
+
"references": {}
|
|
119
|
+
},
|
|
120
|
+
"required": false,
|
|
121
|
+
"optional": true,
|
|
122
|
+
"docs": {
|
|
123
|
+
"tags": [],
|
|
124
|
+
"text": "The value of the state to compare against to check if the data is loading, error, or ready."
|
|
125
|
+
},
|
|
126
|
+
"attribute": "data-state",
|
|
127
|
+
"reflect": false
|
|
128
|
+
},
|
|
129
|
+
"iconOnly": {
|
|
130
|
+
"type": "boolean",
|
|
131
|
+
"mutable": false,
|
|
132
|
+
"complexType": {
|
|
133
|
+
"original": "boolean",
|
|
134
|
+
"resolved": "boolean",
|
|
135
|
+
"references": {}
|
|
136
|
+
},
|
|
137
|
+
"required": false,
|
|
138
|
+
"optional": false,
|
|
139
|
+
"docs": {
|
|
140
|
+
"tags": [],
|
|
141
|
+
"text": "If true, then the component will render the icon only."
|
|
142
|
+
},
|
|
143
|
+
"attribute": "icon-only",
|
|
144
|
+
"reflect": false,
|
|
145
|
+
"defaultValue": "false"
|
|
146
|
+
},
|
|
147
|
+
"mailboxConnector": {
|
|
148
|
+
"type": "unknown",
|
|
149
|
+
"mutable": false,
|
|
150
|
+
"complexType": {
|
|
151
|
+
"original": "NylasMailboxConnectorInterface",
|
|
152
|
+
"resolved": "NylasMailboxConnectorInterface | undefined",
|
|
153
|
+
"references": {
|
|
154
|
+
"NylasMailboxConnectorInterface": {
|
|
155
|
+
"location": "import",
|
|
156
|
+
"path": "@/connector/connector-interface",
|
|
157
|
+
"id": "src/connector/connector-interface.ts::NylasMailboxConnectorInterface"
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
},
|
|
161
|
+
"required": false,
|
|
162
|
+
"optional": true,
|
|
163
|
+
"docs": {
|
|
164
|
+
"tags": [],
|
|
165
|
+
"text": "If true, then the component will render if the state is true.\nThis prop is used with the `state` prop."
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
static get elementRef() { return "host"; }
|
|
171
|
+
}
|
|
172
|
+
__decorate([
|
|
173
|
+
RegisterComponent({
|
|
174
|
+
name: 'nylas-mailbox-toolbar-button',
|
|
175
|
+
connectorToProp: 'mailboxConnector',
|
|
176
|
+
fireRegisterEvent: true,
|
|
177
|
+
}),
|
|
178
|
+
__metadata("design:type", Function),
|
|
179
|
+
__metadata("design:paramtypes", []),
|
|
180
|
+
__metadata("design:returntype", void 0)
|
|
181
|
+
], NylasMailboxToolbarButton.prototype, "render", null);
|
|
182
|
+
//# sourceMappingURL=nylas-mailbox-toolbar-button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nylas-mailbox-toolbar-button.js","sourceRoot":"","sources":["../../../../src/components/mailbox/nylas-mailbox-toolbar-button/nylas-mailbox-toolbar-button.tsx"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAGhE,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAiBlE,MAAM,OAAO,yBAAyB;IAwBpC;QAiBQ,YAAO,GAAG,KAAK,IAAI,EAAE;YAC3B,MAAM,MAAM,GAAG,IAAI,CAAC,MAA2B,CAAC;YAChD,KAAK,CAAC,wCAAwC,EAAE,EAAE,MAAM,EAAE,gBAAgB,EAAE,IAAI,CAAC,gBAAgB,EAAE,CAAC,CAAC;YACrG,IAAI,IAAI,CAAC,gBAAgB,IAAI,MAAM,EAAE,CAAC;gBACpC,MAAM,YAAY,GAAG,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,gBAAgB,EAAE,MAAM,CAAC,CAAC;gBACpE,IAAI,YAAY,EAAE,CAAC;oBACjB,MAAM,YAAY,EAAE,CAA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import { MethodKeys } from '@/common/types';\nimport { NylasMailboxConnectorInterface } from '@/connector/connector-interface';\nimport { debug } from '@/utils/utils';\nimport { Component, Element, Host, Prop, h } from '@stencil/core';\nimport { ObservableMap } from '@stencil/store';\n\nexport type Stores = Record<string, ObservableMap<any>>;\nexport type PublicMethodsOfNylasMailboxConnector = Pick<NylasMailboxConnectorInterface, MethodKeys<NylasMailboxConnectorInterface>>;\nexport type PropertyPaths<T> = T extends object\n ? {\n [K in keyof T]: T[K] extends Function ? `${K & string}` : `${K & string}.${PropertyPaths<T[K]>}`;\n }[keyof T]\n : '';\nexport type MethodsOfNylasMailboxConnector = PropertyPaths<NylasMailboxConnectorInterface>;\n\n@Component({\n tag: 'nylas-mailbox-toolbar-button',\n styleUrl: 'nylas-mailbox-toolbar-button.scss',\n shadow: true,\n})\nexport class NylasMailboxToolbarButton {\n @Element() private host!: HTMLNylasMailboxToolbarButtonElement;\n\n /**\n * The name of the mailbox connector method to call.\n */\n @Prop({ attribute: 'method' }) readonly method!: MethodsOfNylasMailboxConnector;\n\n /**\n * The value of the state to compare against to check if the data is loading, error, or ready.\n */\n @Prop({ attribute: 'data-state' }) readonly dataState?: string;\n\n /**\n * If true, then the component will render the icon only.\n */\n @Prop() readonly iconOnly: boolean = false;\n\n /**\n * If true, then the component will render if the state is true.\n * This prop is used with the `state` prop.\n */\n @Prop() readonly mailboxConnector?: NylasMailboxConnectorInterface;\n\n constructor() {}\n\n connectedCallback() {}\n\n disconnectedCallback() {}\n\n async componentWillLoad() {\n debug(`[nylas-if-state] Component will load`);\n }\n\n async componentDidLoad() {\n debug(`[nylas-if-state] Component did load`);\n }\n\n /**\n * The click handler for the button.\n */\n private onClick = async () => {\n const method = this.method as unknown as string;\n debug(`[nylas-mailbox-toolbar-button] onClick`, { method, mailboxConnector: this.mailboxConnector });\n if (this.mailboxConnector && method) {\n const methodToCall = this.callMethod(this.mailboxConnector, method);\n if (methodToCall) {\n await methodToCall();\n }\n }\n };\n\n /**\n * Traverses the object to find the method.\n * @param obj The object to traverse.\n * @param accessString The string to access the method.\n * @returns The method if it exists, undefined otherwise.\n */\n private callMethod(obj: any, accessString: string): (() => void) | undefined {\n // Split the string into parts\n const parts = accessString.split('.');\n\n // Traverse the object to find the method\n let current = obj;\n for (const part of parts.slice(0, -1)) {\n current = current[part];\n if (!current) {\n return undefined;\n }\n }\n\n // Get the method\n const methodName = parts[parts.length - 1];\n const method = current[methodName];\n\n // Check if the method is a function\n if (typeof method === 'function') {\n return method.bind(current);\n }\n\n return undefined;\n }\n\n /**\n * Renders the slot based on the state.\n * @param state The state of the data.\n */\n private renderByState(state: boolean) {\n return state ? <slot name=\"loading\">Loading...</slot> : <slot>Click</slot>;\n }\n\n /**\n * Checks if the slot exists.\n * @param name The name of the slot.\n * @returns True if the slot exists, false otherwise.\n */\n private hasSlot(name: string) {\n return !!this.host.querySelector(`[slot=\"${name}\"]`);\n }\n\n @RegisterComponent({\n name: 'nylas-mailbox-toolbar-button',\n connectorToProp: 'mailboxConnector',\n fireRegisterEvent: true,\n })\n render() {\n let state = false;\n const store = this.mailboxConnector?.nylasMailboxStore;\n if (typeof store !== 'undefined') {\n const storeKey = String(this.dataState) as keyof typeof store.state;\n state = this.dataState ? store.get(storeKey) === 'loading' : false;\n }\n const key = state ? `state-loading` : 'state-ready';\n return (\n <Host>\n <sp-theme scale=\"medium\" color=\"dark\">\n <sp-button onClick={this.onClick} disabled={state} key={key} icon-only={this.iconOnly} label={this.renderByState(state)}>\n {this.hasSlot('icon') && (\n <div slot=\"icon\" class={'slot'}>\n <slot name=\"icon\" />\n </div>\n )}\n {!this.iconOnly && this.renderByState(state)}\n </sp-button>\n </sp-theme>\n </Host>\n );\n }\n}\n"]}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
display: block;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
sp-button {
|
|
6
|
+
padding: 0;
|
|
7
|
+
border: 0;
|
|
8
|
+
border-radius: var(--nylas-border-radius);
|
|
9
|
+
min-block-size: 50%;
|
|
10
|
+
min-inline-size: 2rem;
|
|
11
|
+
background-color: var(--nylas-color-primary-300);
|
|
12
|
+
fill: var(--nylas-color-primary-800);
|
|
13
|
+
}
|
|
14
|
+
sp-button:hover {
|
|
15
|
+
background-color: var(--nylas-color-primary-400);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.summarize-button.stopped {
|
|
19
|
+
animation: none;
|
|
20
|
+
}
|
|
21
|
+
.summarize-button.playing {
|
|
22
|
+
animation: pulse 2s infinite;
|
|
23
|
+
}
|
|
24
|
+
.summarize-button.loading {
|
|
25
|
+
display: flex;
|
|
26
|
+
align-content: center;
|
|
27
|
+
height: 1.5rem;
|
|
28
|
+
width: 2rem;
|
|
29
|
+
vertical-align: middle;
|
|
30
|
+
animation: pulse 2s infinite;
|
|
31
|
+
flex-wrap: wrap;
|
|
32
|
+
}
|
|
33
|
+
.summarize-button.loading loading-icon {
|
|
34
|
+
--dot-color: var(--nylas-color-primary-600);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
@keyframes pulse {
|
|
38
|
+
0% {
|
|
39
|
+
transform: scale(1);
|
|
40
|
+
box-shadow: 0 0 0 0 var(--nylas-color-primary-300);
|
|
41
|
+
}
|
|
42
|
+
70% {
|
|
43
|
+
transform: scale(1.05);
|
|
44
|
+
box-shadow: 0 0 0 10px rgba(255, 69, 0, 0);
|
|
45
|
+
}
|
|
46
|
+
100% {
|
|
47
|
+
transform: scale(1);
|
|
48
|
+
box-shadow: 0 0 0 0 rgba(255, 69, 0, 0);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
@keyframes wave {
|
|
52
|
+
0% {
|
|
53
|
+
transform: translateX(0);
|
|
54
|
+
}
|
|
55
|
+
50% {
|
|
56
|
+
transform: translateX(100%);
|
|
57
|
+
}
|
|
58
|
+
100% {
|
|
59
|
+
transform: translateX(0);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
@@ -0,0 +1,329 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
4
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else
|
|
6
|
+
for (var i = decorators.length - 1; i >= 0; i--)
|
|
7
|
+
if (d = decorators[i])
|
|
8
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
9
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
10
|
+
};
|
|
11
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
12
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
13
|
+
return Reflect.metadata(k, v);
|
|
14
|
+
};
|
|
15
|
+
import { Host, h } from "@stencil/core";
|
|
16
|
+
import { debug, htmlToPlainText } from "../../../utils/utils";
|
|
17
|
+
import { RegisterComponent } from "../../../common/register-component";
|
|
18
|
+
export class NylasSummarizeMessageButton {
|
|
19
|
+
constructor() {
|
|
20
|
+
this.abortController = new AbortController();
|
|
21
|
+
this.onClick = async (event) => {
|
|
22
|
+
event.preventDefault();
|
|
23
|
+
event.stopPropagation();
|
|
24
|
+
if (this.state === 'stopped') {
|
|
25
|
+
if (this.message) {
|
|
26
|
+
this.abortController = new AbortController();
|
|
27
|
+
const event = this.summarize.emit({
|
|
28
|
+
abortController: this.abortController,
|
|
29
|
+
playAudio: this.playAudio,
|
|
30
|
+
message: this.message,
|
|
31
|
+
updateState: this.updateState,
|
|
32
|
+
});
|
|
33
|
+
if (!event.defaultPrevented) {
|
|
34
|
+
debug(`[nylas-summarize-message-button] Default event not prevented, summarizing message`);
|
|
35
|
+
if (this.audioRef) {
|
|
36
|
+
await this.audioRef
|
|
37
|
+
.play()
|
|
38
|
+
.then(() => this.audioRef?.pause())
|
|
39
|
+
.catch(error => console.error('Error playing audio:', error));
|
|
40
|
+
await this.audioRef.play().catch(error => console.error('Error playing audio:', error));
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
else if (this.state === 'playing') {
|
|
46
|
+
this.abortController?.abort();
|
|
47
|
+
this.audioRef?.pause();
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
this.state = 'stopped';
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
this.message = undefined;
|
|
54
|
+
this.state = 'stopped';
|
|
55
|
+
this.playAudio = this.playAudio.bind(this);
|
|
56
|
+
this.updateState = this.updateState.bind(this);
|
|
57
|
+
}
|
|
58
|
+
connectedCallback() { }
|
|
59
|
+
disconnectedCallback() { }
|
|
60
|
+
async componentWillLoad() {
|
|
61
|
+
debug(`[nylas-summarize-message-button] Component will load`);
|
|
62
|
+
}
|
|
63
|
+
async componentDidLoad() {
|
|
64
|
+
debug(`[nylas-summarize-message-button] Component did load`);
|
|
65
|
+
}
|
|
66
|
+
async updateState(state) {
|
|
67
|
+
this.state = state;
|
|
68
|
+
}
|
|
69
|
+
async playAudio(ttsResponseBody) {
|
|
70
|
+
if (!this.audioRef) {
|
|
71
|
+
this.state = 'stopped';
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
if (!ttsResponseBody) {
|
|
75
|
+
this.state = 'stopped';
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
const audioElement = this.audioRef;
|
|
79
|
+
if (!('MediaSource' in window)) {
|
|
80
|
+
const rb = await ttsResponseBody;
|
|
81
|
+
if (rb == null) {
|
|
82
|
+
throw new Error('ReadableStream not yet supported in this browser.');
|
|
83
|
+
}
|
|
84
|
+
const reader = rb.getReader();
|
|
85
|
+
const chunks = [];
|
|
86
|
+
await this.readChunk(reader, chunks);
|
|
87
|
+
const blob = new Blob(chunks, { type: 'audio/mpeg' });
|
|
88
|
+
const blobUrl = URL.createObjectURL(blob);
|
|
89
|
+
audioElement.src = blobUrl;
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
const mediaSource = new MediaSource();
|
|
93
|
+
let sourceBuffer;
|
|
94
|
+
let sourceDone = false;
|
|
95
|
+
audioElement.src = URL.createObjectURL(mediaSource);
|
|
96
|
+
mediaSource.addEventListener('sourceopen', onMediaSourceOpen);
|
|
97
|
+
async function onMediaSourceOpen() {
|
|
98
|
+
sourceBuffer = mediaSource.addSourceBuffer('audio/mpeg');
|
|
99
|
+
sourceBuffer.addEventListener('updateend', onUpdateEnd);
|
|
100
|
+
const rb = await ttsResponseBody;
|
|
101
|
+
if (rb == null) {
|
|
102
|
+
throw new Error('ReadableStream not yet supported in this browser.');
|
|
103
|
+
}
|
|
104
|
+
const reader = rb.getReader();
|
|
105
|
+
const pump = () => {
|
|
106
|
+
reader
|
|
107
|
+
.read()
|
|
108
|
+
.then(({ done, value }) => {
|
|
109
|
+
if (done) {
|
|
110
|
+
sourceDone = true;
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
if (!sourceBuffer.updating) {
|
|
114
|
+
sourceBuffer.appendBuffer(value);
|
|
115
|
+
}
|
|
116
|
+
pump();
|
|
117
|
+
})
|
|
118
|
+
.catch(error => {
|
|
119
|
+
console.error('Error while fetching and appending chunks:', error);
|
|
120
|
+
});
|
|
121
|
+
};
|
|
122
|
+
pump();
|
|
123
|
+
if (audioElement.paused) {
|
|
124
|
+
audioElement.play().catch(error => console.error('Error playing audio:', error));
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
function onUpdateEnd() {
|
|
128
|
+
if (sourceDone) {
|
|
129
|
+
mediaSource.endOfStream();
|
|
130
|
+
mediaSource.removeEventListener('sourceopen', onMediaSourceOpen);
|
|
131
|
+
mediaSource.removeEventListener('sourceclose', () => {
|
|
132
|
+
debug(`[nylas-summarize-message-button] Source closed`);
|
|
133
|
+
});
|
|
134
|
+
sourceBuffer.removeEventListener('updateend', onUpdateEnd);
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
async readChunk(reader, chunks) {
|
|
140
|
+
return reader.read().then(({ done, value }) => {
|
|
141
|
+
if (done) {
|
|
142
|
+
return chunks;
|
|
143
|
+
}
|
|
144
|
+
chunks.push(value);
|
|
145
|
+
return this.readChunk(reader, chunks);
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
render() {
|
|
149
|
+
return (h(Host, { key: '507fa8a1d6570be296501c8e154ef8b85cda0871' }, h("sp-theme", { key: '2db0d8c57e95c758f240a0e9328c26ec4e3d2e77', scale: "medium", color: "dark" }, h("sp-button", { key: 'df8bb0eb9069456125bd570eb280f018e0ebb9e3', label: "Summarize email", "icon-only": true, onClickCapture: this.onClick, class: {
|
|
150
|
+
'summarize-button': true,
|
|
151
|
+
'stopped': this.state === 'stopped',
|
|
152
|
+
'loading': this.state === 'loading',
|
|
153
|
+
'playing': this.state === 'playing',
|
|
154
|
+
} }, this.state === 'stopped' && h("play-icon", null), this.state === 'loading' && h("loading-icon", null), this.state === 'playing' && h("stop-icon", null)), h("audio", { key: '3bc2427c264410ae9c68f1aec3d3b0c675ae108b', ref: r => (this.audioRef = r), autoPlay: true, onPlaying: () => (this.state = 'playing'), onPause: () => (this.state = 'stopped'), onEnded: () => {
|
|
155
|
+
this.state = 'stopped';
|
|
156
|
+
debug(`[nylas-summarize-message-button] Audio ended`);
|
|
157
|
+
} }))));
|
|
158
|
+
}
|
|
159
|
+
static get is() { return "nylas-summarize-message-button"; }
|
|
160
|
+
static get encapsulation() { return "shadow"; }
|
|
161
|
+
static get originalStyleUrls() {
|
|
162
|
+
return {
|
|
163
|
+
"$": ["nylas-summarize-message-button.scss"]
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
static get styleUrls() {
|
|
167
|
+
return {
|
|
168
|
+
"$": ["nylas-summarize-message-button.css"]
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
static get properties() {
|
|
172
|
+
return {
|
|
173
|
+
"message": {
|
|
174
|
+
"type": "unknown",
|
|
175
|
+
"mutable": false,
|
|
176
|
+
"complexType": {
|
|
177
|
+
"original": "Message",
|
|
178
|
+
"resolved": "Message | undefined",
|
|
179
|
+
"references": {
|
|
180
|
+
"Message": {
|
|
181
|
+
"location": "import",
|
|
182
|
+
"path": "@nylas/core",
|
|
183
|
+
"id": "../nylas-js-core/dist/index.d.ts::Message"
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
},
|
|
187
|
+
"required": false,
|
|
188
|
+
"optional": true,
|
|
189
|
+
"docs": {
|
|
190
|
+
"tags": [],
|
|
191
|
+
"text": "The message to summarize"
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
static get states() {
|
|
197
|
+
return {
|
|
198
|
+
"state": {}
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
static get events() {
|
|
202
|
+
return [{
|
|
203
|
+
"method": "summarize",
|
|
204
|
+
"name": "summarize",
|
|
205
|
+
"bubbles": true,
|
|
206
|
+
"cancelable": true,
|
|
207
|
+
"composed": true,
|
|
208
|
+
"docs": {
|
|
209
|
+
"tags": [],
|
|
210
|
+
"text": "The on summarize event handler"
|
|
211
|
+
},
|
|
212
|
+
"complexType": {
|
|
213
|
+
"original": "SummarizeEvent",
|
|
214
|
+
"resolved": "{ playAudio: (ttsResponseBody: Promise<ReadableStream<Uint8Array> | null>) => Promise<void>; updateState: (state: \"loading\" | \"playing\" | \"stopped\") => Promise<void>; abortController: AbortController; message: Message; }",
|
|
215
|
+
"references": {
|
|
216
|
+
"SummarizeEvent": {
|
|
217
|
+
"location": "local",
|
|
218
|
+
"path": "/Users/aarondemello/Developer/nylas/nylas/packages/nylas-web-elements/src/components/mailbox/nylas-summarize-message-button/nylas-summarize-message-button.tsx",
|
|
219
|
+
"id": "src/components/mailbox/nylas-summarize-message-button/nylas-summarize-message-button.tsx::SummarizeEvent"
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
}];
|
|
224
|
+
}
|
|
225
|
+
static get methods() {
|
|
226
|
+
return {
|
|
227
|
+
"updateState": {
|
|
228
|
+
"complexType": {
|
|
229
|
+
"signature": "(state: 'loading' | 'playing' | 'stopped') => Promise<void>",
|
|
230
|
+
"parameters": [{
|
|
231
|
+
"name": "state",
|
|
232
|
+
"type": "\"loading\" | \"playing\" | \"stopped\"",
|
|
233
|
+
"docs": "The new state"
|
|
234
|
+
}],
|
|
235
|
+
"references": {
|
|
236
|
+
"Promise": {
|
|
237
|
+
"location": "global",
|
|
238
|
+
"id": "global::Promise"
|
|
239
|
+
}
|
|
240
|
+
},
|
|
241
|
+
"return": "Promise<void>"
|
|
242
|
+
},
|
|
243
|
+
"docs": {
|
|
244
|
+
"text": "Update the state of the summarize button",
|
|
245
|
+
"tags": [{
|
|
246
|
+
"name": "param",
|
|
247
|
+
"text": "state The new state"
|
|
248
|
+
}, {
|
|
249
|
+
"name": "returns",
|
|
250
|
+
"text": "Promise<void>"
|
|
251
|
+
}]
|
|
252
|
+
}
|
|
253
|
+
},
|
|
254
|
+
"playAudio": {
|
|
255
|
+
"complexType": {
|
|
256
|
+
"signature": "(ttsResponseBody: Promise<ReadableStream<Uint8Array> | null>) => Promise<void>",
|
|
257
|
+
"parameters": [{
|
|
258
|
+
"name": "ttsResponseBody",
|
|
259
|
+
"type": "Promise<ReadableStream<Uint8Array> | null>",
|
|
260
|
+
"docs": "Text to speech response body"
|
|
261
|
+
}],
|
|
262
|
+
"references": {
|
|
263
|
+
"Promise": {
|
|
264
|
+
"location": "global",
|
|
265
|
+
"id": "global::Promise"
|
|
266
|
+
},
|
|
267
|
+
"ReadableStream": {
|
|
268
|
+
"location": "global",
|
|
269
|
+
"id": "global::ReadableStream"
|
|
270
|
+
},
|
|
271
|
+
"Uint8Array": {
|
|
272
|
+
"location": "global",
|
|
273
|
+
"id": "global::Uint8Array"
|
|
274
|
+
},
|
|
275
|
+
"HTMLAudioElement": {
|
|
276
|
+
"location": "global",
|
|
277
|
+
"id": "global::HTMLAudioElement"
|
|
278
|
+
},
|
|
279
|
+
"ReadableStreamDefaultReader": {
|
|
280
|
+
"location": "global",
|
|
281
|
+
"id": "global::ReadableStreamDefaultReader"
|
|
282
|
+
},
|
|
283
|
+
"SourceBuffer": {
|
|
284
|
+
"location": "global",
|
|
285
|
+
"id": "global::SourceBuffer"
|
|
286
|
+
}
|
|
287
|
+
},
|
|
288
|
+
"return": "Promise<void>"
|
|
289
|
+
},
|
|
290
|
+
"docs": {
|
|
291
|
+
"text": "Play audio",
|
|
292
|
+
"tags": [{
|
|
293
|
+
"name": "param",
|
|
294
|
+
"text": "ttsResponseBody Text to speech response body"
|
|
295
|
+
}, {
|
|
296
|
+
"name": "param",
|
|
297
|
+
"text": "audioRef Audio element"
|
|
298
|
+
}]
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
};
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
__decorate([
|
|
305
|
+
RegisterComponent({
|
|
306
|
+
name: 'nylas-summarize-message-button',
|
|
307
|
+
eventToProps: {
|
|
308
|
+
summarize: async (event, nylasConnector) => {
|
|
309
|
+
const { playAudio, updateState, abortController, message } = event.detail;
|
|
310
|
+
const text = htmlToPlainText(message.body || '');
|
|
311
|
+
await updateState('loading');
|
|
312
|
+
try {
|
|
313
|
+
const summary = await nylasConnector.messages.summarizeText(text);
|
|
314
|
+
const ttsResponseBody = nylasConnector.messages.textToSpeech(summary, abortController);
|
|
315
|
+
await playAudio(ttsResponseBody);
|
|
316
|
+
}
|
|
317
|
+
catch (error) {
|
|
318
|
+
await updateState('stopped');
|
|
319
|
+
console.error('Error summarizing message:', error);
|
|
320
|
+
}
|
|
321
|
+
},
|
|
322
|
+
},
|
|
323
|
+
fireRegisterEvent: true,
|
|
324
|
+
}),
|
|
325
|
+
__metadata("design:type", Function),
|
|
326
|
+
__metadata("design:paramtypes", []),
|
|
327
|
+
__metadata("design:returntype", void 0)
|
|
328
|
+
], NylasSummarizeMessageButton.prototype, "render", null);
|
|
329
|
+
//# sourceMappingURL=nylas-summarize-message-button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nylas-summarize-message-button.js","sourceRoot":"","sources":["../../../../src/components/mailbox/nylas-summarize-message-button/nylas-summarize-message-button.tsx"],"names":[],"mappings":";;;;;;;;;AACA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAgB,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAE7F,OAAO,EAAE,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAehE,MAAM,OAAO,2BAA2B;IA0BtC;QAFQ,oBAAe,GAAoB,IAAI,eAAe,EAAE,CAAC;QAuBzD,YAAO,GAAG,KAAK,EAAE,KAAY,EAAE,EAAE;YACvC,KAAK,CAAC,cAAc,EAAE,CAAC;YACvB,KAAK,CAAC,eAAe,EAAE,CAAC;YAExB,IAAI,IAAI,CAAC,KAAK,KAAK,SAAS,EAAE,CAAC;gBAC7B,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;oBACjB,IAAI,CAAC,eAAe,GAAG,IAAI,eAAe,EAAE,CAAC;oBAC7C,MAAM,KAAK,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;wBAChC,eAAe,EAAE,IAAI,CAAC,eAAe;wBACrC,SAAS,EAAE,IAAI,CAAC,SAAS;wBACzB,OAAO,EAAE,IAAI,CAAC,OAAO;wBACrB,WAAW,EAAE,IAAI,CAAC,WAAW;qBAC9B,CAAC,CAAC;oBAEH,IAAI,CAAC,KAAK,CAAC,gBAAgB,EAAE,CAAC;wBAC5B,KAAK,CAAC,mFAAmF,CAAC,CAAC;wBAE3F,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;4BAClB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from '@nylas/core';\nimport { Component, Event, EventEmitter, Host, Method, Prop, State, h } from '@stencil/core';\nimport { NylasMailboxConnector } from '../../../components';\nimport { debug, htmlToPlainText } from '@/utils/utils';\nimport { RegisterComponent } from '@/common/register-component';\nimport { NylasMailbox } from '../nylas-mailbox/nylas-mailbox';\n\nexport type SummarizeEvent = {\n playAudio: (ttsResponseBody: Promise<ReadableStream<Uint8Array> | null>) => Promise<void>;\n updateState: (state: 'loading' | 'playing' | 'stopped') => Promise<void>;\n abortController: AbortController;\n message: Message;\n};\n\n@Component({\n tag: 'nylas-summarize-message-button',\n styleUrl: 'nylas-summarize-message-button.scss',\n shadow: true,\n})\nexport class NylasSummarizeMessageButton {\n /**\n * The message to summarize\n */\n @Prop() readonly message?: Message;\n\n /**\n * The on summarize event handler\n */\n @Event() readonly summarize!: EventEmitter<SummarizeEvent>;\n\n /**\n * The state of the summarize button\n */\n @State() state: 'loading' | 'playing' | 'stopped' = 'stopped';\n\n /**\n * The audio element used to play the summary\n */\n private audioRef?: HTMLAudioElement;\n\n /**\n * The AbortController used to cancel the summarize request\n */\n private abortController: AbortController = new AbortController();\n\n constructor() {\n this.playAudio = this.playAudio.bind(this);\n this.updateState = this.updateState.bind(this);\n }\n\n connectedCallback() {}\n\n disconnectedCallback() {}\n\n async componentWillLoad() {\n debug(`[nylas-summarize-message-button] Component will load`);\n }\n\n async componentDidLoad() {\n debug(`[nylas-summarize-message-button] Component did load`);\n }\n\n /**\n * Handle summarize button click\n * @param event Click event\n */\n private onClick = async (event: Event) => {\n event.preventDefault();\n event.stopPropagation();\n\n if (this.state === 'stopped') {\n if (this.message) {\n this.abortController = new AbortController();\n const event = this.summarize.emit({\n abortController: this.abortController,\n playAudio: this.playAudio,\n message: this.message,\n updateState: this.updateState,\n });\n\n if (!event.defaultPrevented) {\n debug(`[nylas-summarize-message-button] Default event not prevented, summarizing message`);\n\n if (this.audioRef) {\n await this.audioRef\n .play()\n .then(() => this.audioRef?.pause())\n .catch(error => console.error('Error playing audio:', error));\n await this.audioRef.play().catch(error => console.error('Error playing audio:', error));\n }\n }\n }\n } else if (this.state === 'playing') {\n this.abortController?.abort();\n this.audioRef?.pause();\n } else {\n this.state = 'stopped';\n }\n };\n\n /**\n * Update the state of the summarize button\n * @param state The new state\n * @returns Promise<void>\n */\n @Method()\n public async updateState(state: 'loading' | 'playing' | 'stopped') {\n this.state = state;\n }\n\n /**\n * Play audio\n * @param ttsResponseBody Text to speech response body\n * @param audioRef Audio element\n */\n @Method()\n public async playAudio(ttsResponseBody: Promise<ReadableStream<Uint8Array> | null>) {\n if (!this.audioRef) {\n this.state = 'stopped';\n return;\n }\n\n if (!ttsResponseBody) {\n this.state = 'stopped';\n return;\n }\n\n const audioElement: HTMLAudioElement = this.audioRef;\n\n // If no MediaSource support, use a blob URL\n if (!('MediaSource' in window)) {\n const rb = await ttsResponseBody;\n\n if (rb == null) {\n throw new Error('ReadableStream not yet supported in this browser.');\n }\n\n const reader: ReadableStreamDefaultReader<Uint8Array> = rb.getReader();\n const chunks: Uint8Array[] = [];\n\n // Start reading chunks\n await this.readChunk(reader, chunks);\n\n // Create a blob from the chunks\n const blob = new Blob(chunks, { type: 'audio/mpeg' });\n const blobUrl = URL.createObjectURL(blob);\n audioElement.src = blobUrl;\n return;\n }\n\n const mediaSource = new MediaSource();\n let sourceBuffer: SourceBuffer;\n\n let sourceDone: boolean = false;\n\n audioElement.src = URL.createObjectURL(mediaSource);\n mediaSource.addEventListener('sourceopen', onMediaSourceOpen);\n\n async function onMediaSourceOpen() {\n sourceBuffer = mediaSource.addSourceBuffer('audio/mpeg');\n sourceBuffer.addEventListener('updateend', onUpdateEnd);\n const rb = await ttsResponseBody;\n\n if (rb == null) {\n throw new Error('ReadableStream not yet supported in this browser.');\n }\n\n const reader = rb.getReader();\n const pump = () => {\n reader\n .read()\n .then(({ done, value }) => {\n if (done) {\n sourceDone = true;\n return;\n }\n if (!sourceBuffer.updating) {\n sourceBuffer.appendBuffer(value);\n }\n pump();\n })\n .catch(error => {\n console.error('Error while fetching and appending chunks:', error);\n });\n };\n\n pump();\n\n if (audioElement.paused) {\n audioElement.play().catch(error => console.error('Error playing audio:', error));\n }\n }\n\n function onUpdateEnd() {\n if (sourceDone) {\n mediaSource.endOfStream();\n mediaSource.removeEventListener('sourceopen', onMediaSourceOpen);\n mediaSource.removeEventListener('sourceclose', () => {\n debug(`[nylas-summarize-message-button] Source closed`);\n });\n sourceBuffer.removeEventListener('updateend', onUpdateEnd);\n return;\n }\n }\n }\n\n /**\n * Read chunks from the ReadableStream\n * @param reader The reader to read chunks from for the TTS audio\n * @param chunks The chunks array to append the chunks to\n * @returns Promise<Uint8Array[]>\n */\n private async readChunk(reader: ReadableStreamDefaultReader<Uint8Array>, chunks: Uint8Array[]): Promise<Uint8Array[]> {\n return reader.read().then(({ done, value }) => {\n if (done) {\n // All chunks have been read, return the chunks array\n return chunks;\n }\n chunks.push(value);\n return this.readChunk(reader, chunks); // Read the next chunk\n });\n }\n\n @RegisterComponent<NylasSummarizeMessageButton, NylasMailboxConnector, Exclude<NylasMailbox['stores'], undefined>>({\n name: 'nylas-summarize-message-button',\n eventToProps: {\n summarize: async (event: CustomEvent<SummarizeEvent>, nylasConnector: NylasMailboxConnector) => {\n const { playAudio, updateState, abortController, message } = event.detail;\n const text = htmlToPlainText(message.body || '');\n await updateState('loading');\n try {\n const summary = await nylasConnector.messages.summarizeText(text);\n const ttsResponseBody = nylasConnector.messages.textToSpeech(summary, abortController);\n await playAudio(ttsResponseBody);\n } catch (error) {\n await updateState('stopped');\n console.error('Error summarizing message:', error);\n }\n },\n },\n fireRegisterEvent: true,\n })\n render() {\n return (\n <Host>\n <sp-theme scale=\"medium\" color=\"dark\">\n <sp-button\n label=\"Summarize email\"\n icon-only\n onClickCapture={this.onClick}\n class={{\n 'summarize-button': true,\n 'stopped': this.state === 'stopped',\n 'loading': this.state === 'loading',\n 'playing': this.state === 'playing',\n }}\n >\n {this.state === 'stopped' && <play-icon />}\n {this.state === 'loading' && <loading-icon />}\n {this.state === 'playing' && <stop-icon />}\n </sp-button>\n <audio\n ref={r => (this.audioRef = r)}\n autoPlay={true}\n onPlaying={() => (this.state = 'playing')}\n onPause={() => (this.state = 'stopped')}\n onEnded={() => {\n this.state = 'stopped';\n debug(`[nylas-summarize-message-button] Audio ended`);\n }}\n ></audio>\n </sp-theme>\n </Host>\n );\n }\n}\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { newE2EPage } from "@stencil/core/testing";
|
|
2
|
+
describe('nylas-summarize-message-button', () => {
|
|
3
|
+
it('renders', async () => {
|
|
4
|
+
const page = await newE2EPage();
|
|
5
|
+
await page.setContent('<nylas-summarize-message-button></nylas-summarize-message-button>');
|
|
6
|
+
const element = await page.find('nylas-summarize-message-button');
|
|
7
|
+
expect(element).toHaveClass('hydrated');
|
|
8
|
+
});
|
|
9
|
+
});
|
|
10
|
+
//# sourceMappingURL=nylas-summarize-message-button.e2e.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nylas-summarize-message-button.e2e.js","sourceRoot":"","sources":["../../../../../src/components/mailbox/nylas-summarize-message-button/test/nylas-summarize-message-button.e2e.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD,QAAQ,CAAC,gCAAgC,EAAE,GAAG,EAAE;IAC9C,EAAE,CAAC,SAAS,EAAE,KAAK,IAAI,EAAE;QACvB,MAAM,IAAI,GAAG,MAAM,UAAU,EAAE,CAAC;QAChC,MAAM,IAAI,CAAC,UAAU,CAAC,mEAAmE,CAAC,CAAC;QAE3F,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,gCAAgC,CAAC,CAAC;QAClE,MAAM,CAAC,OAAO,CAAC,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;IAC1C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { newE2EPage } from '@stencil/core/testing';\n\ndescribe('nylas-summarize-message-button', () => {\n it('renders', async () => {\n const page = await newE2EPage();\n await page.setContent('<nylas-summarize-message-button></nylas-summarize-message-button>');\n\n const element = await page.find('nylas-summarize-message-button');\n expect(element).toHaveClass('hydrated');\n });\n});\n"]}
|