@nylas/web-elements 1.1.0-canary.10 → 1.1.0-canary.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (226) hide show
  1. package/dist/cjs/add-circle-icon_21.cjs.entry.js +73 -40
  2. package/dist/cjs/add-circle-icon_21.cjs.entry.js.map +1 -1
  3. package/dist/cjs/google-logo-icon_4.cjs.entry.js +5 -4
  4. package/dist/cjs/google-logo-icon_4.cjs.entry.js.map +1 -1
  5. package/dist/cjs/loader.cjs.js +1 -1
  6. package/dist/cjs/nylas-api-request-05f1e068.js.map +1 -1
  7. package/dist/cjs/nylas-api-request-de316f1a.js.map +1 -1
  8. package/dist/cjs/nylas-availability-picker.cjs.entry.js +14 -7
  9. package/dist/cjs/nylas-availability-picker.cjs.entry.js.map +1 -1
  10. package/dist/cjs/nylas-booked-event-card.cjs.entry.js +1 -1
  11. package/dist/cjs/nylas-booked-event-card_10.cjs.entry.js +9 -9
  12. package/dist/cjs/nylas-booking-calendar-picker.cjs.entry.js.map +1 -1
  13. package/dist/cjs/nylas-booking-form.cjs.entry.js +3 -3
  14. package/dist/cjs/nylas-buffer-time.cjs.entry.js +7 -6
  15. package/dist/cjs/nylas-buffer-time.cjs.entry.js.map +1 -1
  16. package/dist/cjs/nylas-calendar-picker.cjs.entry.js.map +1 -1
  17. package/dist/cjs/nylas-date-picker.cjs.entry.js +1 -1
  18. package/dist/cjs/nylas-editor-tabs.cjs.entry.js +5 -4
  19. package/dist/cjs/nylas-editor-tabs.cjs.entry.js.map +1 -1
  20. package/dist/cjs/nylas-event-description.cjs.entry.js +2 -2
  21. package/dist/cjs/nylas-event-description.cjs.entry.js.map +1 -1
  22. package/dist/cjs/nylas-event-duration.cjs.entry.js +1 -1
  23. package/dist/cjs/nylas-event-duration.cjs.entry.js.map +1 -1
  24. package/dist/cjs/nylas-event-info.cjs.entry.js +1 -1
  25. package/dist/cjs/nylas-event-info.cjs.entry.js.map +1 -1
  26. package/dist/cjs/nylas-event-limits.cjs.entry.js +1 -1
  27. package/dist/cjs/nylas-event-limits.cjs.entry.js.map +1 -1
  28. package/dist/cjs/nylas-event-title.cjs.entry.js +2 -2
  29. package/dist/cjs/nylas-if-state.cjs.entry.js +1 -1
  30. package/dist/cjs/nylas-limit-future-bookings.cjs.entry.js +1 -1
  31. package/dist/cjs/nylas-limit-future-bookings.cjs.entry.js.map +1 -1
  32. package/dist/cjs/nylas-locale-switch.cjs.entry.js +3 -3
  33. package/dist/cjs/nylas-location-component.cjs.entry.js +4 -4
  34. package/dist/cjs/nylas-location-component.cjs.entry.js.map +1 -1
  35. package/dist/cjs/nylas-min-cancellation-notice.cjs.entry.js +1 -1
  36. package/dist/cjs/nylas-min-cancellation-notice.cjs.entry.js.map +1 -1
  37. package/dist/cjs/nylas-scheduler-editor.cjs.entry.js +1 -1
  38. package/dist/cjs/nylas-scheduler-editor.cjs.entry.js.map +1 -1
  39. package/dist/cjs/nylas-selected-event-card.cjs.entry.js +1 -1
  40. package/dist/cjs/nylas-time-window-picker.cjs.entry.js +39 -14
  41. package/dist/cjs/nylas-time-window-picker.cjs.entry.js.map +1 -1
  42. package/dist/cjs/nylas-web-elements.cjs.js +1 -1
  43. package/dist/cjs/scheduler-config-store-918c20d5.js.map +1 -1
  44. package/dist/cjs/scheduler-config-store-a5b7c08b.js.map +1 -1
  45. package/dist/collection/collection-manifest.json +3 -3
  46. package/dist/collection/common/nylas-api-request.js.map +1 -1
  47. package/dist/collection/components/nylas-if-state/nylas-if-state.js +1 -1
  48. package/dist/collection/components/scheduler/nylas-booked-event-card/nylas-booked-event-card.js +1 -1
  49. package/dist/collection/components/scheduler/nylas-booking-form/nylas-booking-form.js +3 -3
  50. package/dist/collection/components/scheduler/nylas-date-picker/nylas-date-picker.js +1 -1
  51. package/dist/collection/components/scheduler/nylas-locale-switch/nylas-locale-switch.js +3 -3
  52. package/dist/collection/components/scheduler/nylas-selected-event-card/nylas-selected-event-card.js +1 -1
  53. package/dist/collection/components/scheduler-editor/nylas-availability-picker/nylas-availability-picker.js +35 -14
  54. package/dist/collection/components/scheduler-editor/nylas-availability-picker/nylas-availability-picker.js.map +1 -1
  55. package/dist/collection/components/scheduler-editor/nylas-booking-calendar-picker/nylas-booking-calendar-picker.js +1 -1
  56. package/dist/collection/components/scheduler-editor/nylas-booking-calendar-picker/nylas-booking-calendar-picker.js.map +1 -1
  57. package/dist/collection/components/scheduler-editor/nylas-buffer-time/nylas-buffer-time.css +1 -1
  58. package/dist/collection/components/scheduler-editor/nylas-buffer-time/nylas-buffer-time.js +6 -5
  59. package/dist/collection/components/scheduler-editor/nylas-buffer-time/nylas-buffer-time.js.map +1 -1
  60. package/dist/collection/components/scheduler-editor/nylas-buffer-time/test/nylas-buffer-time.spec.js +2 -2
  61. package/dist/collection/components/scheduler-editor/nylas-buffer-time/test/nylas-buffer-time.spec.js.map +1 -1
  62. package/dist/collection/components/scheduler-editor/nylas-calendar-picker/nylas-calendar-picker.js +1 -1
  63. package/dist/collection/components/scheduler-editor/nylas-calendar-picker/nylas-calendar-picker.js.map +1 -1
  64. package/dist/collection/components/scheduler-editor/nylas-editor-tabs/nylas-editor-tabs.js +6 -5
  65. package/dist/collection/components/scheduler-editor/nylas-editor-tabs/nylas-editor-tabs.js.map +1 -1
  66. package/dist/collection/components/scheduler-editor/nylas-event-description/nylas-event-description.js +5 -5
  67. package/dist/collection/components/scheduler-editor/nylas-event-description/nylas-event-description.js.map +1 -1
  68. package/dist/collection/components/scheduler-editor/nylas-event-duration/nylas-event-duration.js +4 -4
  69. package/dist/collection/components/scheduler-editor/nylas-event-duration/nylas-event-duration.js.map +1 -1
  70. package/dist/collection/components/scheduler-editor/nylas-event-info/nylas-event-info.js +1 -1
  71. package/dist/collection/components/scheduler-editor/nylas-event-info/nylas-event-info.js.map +1 -1
  72. package/dist/collection/components/scheduler-editor/nylas-event-limits/nylas-event-limits.js +1 -1
  73. package/dist/collection/components/scheduler-editor/nylas-event-limits/nylas-event-limits.js.map +1 -1
  74. package/dist/collection/components/scheduler-editor/nylas-event-title/nylas-event-title.js +2 -2
  75. package/dist/collection/components/scheduler-editor/nylas-limit-future-bookings/nylas-limit-future-bookings.js +4 -4
  76. package/dist/collection/components/scheduler-editor/nylas-limit-future-bookings/nylas-limit-future-bookings.js.map +1 -1
  77. package/dist/collection/components/scheduler-editor/nylas-location-component/nylas-location-component.js +23 -23
  78. package/dist/collection/components/scheduler-editor/nylas-location-component/nylas-location-component.js.map +1 -1
  79. package/dist/collection/components/scheduler-editor/nylas-min-cancellation-notice/nylas-min-cancellation-notice.js +3 -3
  80. package/dist/collection/components/scheduler-editor/nylas-min-cancellation-notice/nylas-min-cancellation-notice.js.map +1 -1
  81. package/dist/collection/components/scheduler-editor/nylas-scheduler-editor/nylas-scheduler-editor.js +9 -9
  82. package/dist/collection/components/scheduler-editor/nylas-scheduler-editor/nylas-scheduler-editor.js.map +1 -1
  83. package/dist/collection/components/scheduler-editor/nylas-time-window-picker/nylas-time-window-picker.js +56 -57
  84. package/dist/collection/components/scheduler-editor/nylas-time-window-picker/nylas-time-window-picker.js.map +1 -1
  85. package/dist/collection/stores/scheduler-config-store.js.map +1 -1
  86. package/dist/collection/types/index.js +6 -0
  87. package/dist/collection/types/index.js.map +1 -0
  88. package/dist/components/nylas-api-request.js.map +1 -1
  89. package/dist/components/nylas-availability-picker2.js +15 -8
  90. package/dist/components/nylas-availability-picker2.js.map +1 -1
  91. package/dist/components/nylas-booked-event-card2.js +1 -1
  92. package/dist/components/nylas-booking-calendar-picker2.js.map +1 -1
  93. package/dist/components/nylas-booking-form2.js +3 -3
  94. package/dist/components/nylas-buffer-time2.js +7 -6
  95. package/dist/components/nylas-buffer-time2.js.map +1 -1
  96. package/dist/components/nylas-calendar-picker2.js.map +1 -1
  97. package/dist/components/nylas-date-picker2.js +1 -1
  98. package/dist/components/nylas-editor-tabs2.js +5 -4
  99. package/dist/components/nylas-editor-tabs2.js.map +1 -1
  100. package/dist/components/nylas-event-description2.js +2 -2
  101. package/dist/components/nylas-event-description2.js.map +1 -1
  102. package/dist/components/nylas-event-duration2.js +1 -1
  103. package/dist/components/nylas-event-duration2.js.map +1 -1
  104. package/dist/components/nylas-event-info2.js +1 -1
  105. package/dist/components/nylas-event-info2.js.map +1 -1
  106. package/dist/components/nylas-event-limits2.js +1 -1
  107. package/dist/components/nylas-event-limits2.js.map +1 -1
  108. package/dist/components/nylas-event-title2.js +2 -2
  109. package/dist/components/nylas-if-state.js +1 -1
  110. package/dist/components/nylas-limit-future-bookings2.js +1 -1
  111. package/dist/components/nylas-limit-future-bookings2.js.map +1 -1
  112. package/dist/components/nylas-locale-switch2.js +3 -3
  113. package/dist/components/nylas-location-component2.js +5 -5
  114. package/dist/components/nylas-location-component2.js.map +1 -1
  115. package/dist/components/nylas-min-cancellation-notice2.js +1 -1
  116. package/dist/components/nylas-min-cancellation-notice2.js.map +1 -1
  117. package/dist/components/nylas-scheduler-editor.js +1 -1
  118. package/dist/components/nylas-scheduler-editor.js.map +1 -1
  119. package/dist/components/nylas-selected-event-card2.js +1 -1
  120. package/dist/components/nylas-time-window-picker2.js +39 -16
  121. package/dist/components/nylas-time-window-picker2.js.map +1 -1
  122. package/dist/components/scheduler-config-store.js.map +1 -1
  123. package/dist/esm/add-circle-icon_21.entry.js +73 -40
  124. package/dist/esm/add-circle-icon_21.entry.js.map +1 -1
  125. package/dist/esm/google-logo-icon_4.entry.js +5 -4
  126. package/dist/esm/google-logo-icon_4.entry.js.map +1 -1
  127. package/dist/esm/loader.js +1 -1
  128. package/dist/esm/nylas-api-request-59738f8c.js.map +1 -1
  129. package/dist/esm/nylas-api-request-ff2869d7.js.map +1 -1
  130. package/dist/esm/nylas-availability-picker.entry.js +14 -7
  131. package/dist/esm/nylas-availability-picker.entry.js.map +1 -1
  132. package/dist/esm/nylas-booked-event-card.entry.js +1 -1
  133. package/dist/esm/nylas-booked-event-card_10.entry.js +9 -9
  134. package/dist/esm/nylas-booking-calendar-picker.entry.js.map +1 -1
  135. package/dist/esm/nylas-booking-form.entry.js +3 -3
  136. package/dist/esm/nylas-buffer-time.entry.js +7 -6
  137. package/dist/esm/nylas-buffer-time.entry.js.map +1 -1
  138. package/dist/esm/nylas-calendar-picker.entry.js.map +1 -1
  139. package/dist/esm/nylas-date-picker.entry.js +1 -1
  140. package/dist/esm/nylas-editor-tabs.entry.js +5 -4
  141. package/dist/esm/nylas-editor-tabs.entry.js.map +1 -1
  142. package/dist/esm/nylas-event-description.entry.js +2 -2
  143. package/dist/esm/nylas-event-description.entry.js.map +1 -1
  144. package/dist/esm/nylas-event-duration.entry.js +1 -1
  145. package/dist/esm/nylas-event-duration.entry.js.map +1 -1
  146. package/dist/esm/nylas-event-info.entry.js +1 -1
  147. package/dist/esm/nylas-event-info.entry.js.map +1 -1
  148. package/dist/esm/nylas-event-limits.entry.js +1 -1
  149. package/dist/esm/nylas-event-limits.entry.js.map +1 -1
  150. package/dist/esm/nylas-event-title.entry.js +2 -2
  151. package/dist/esm/nylas-if-state.entry.js +1 -1
  152. package/dist/esm/nylas-limit-future-bookings.entry.js +1 -1
  153. package/dist/esm/nylas-limit-future-bookings.entry.js.map +1 -1
  154. package/dist/esm/nylas-locale-switch.entry.js +3 -3
  155. package/dist/esm/nylas-location-component.entry.js +4 -4
  156. package/dist/esm/nylas-location-component.entry.js.map +1 -1
  157. package/dist/esm/nylas-min-cancellation-notice.entry.js +1 -1
  158. package/dist/esm/nylas-min-cancellation-notice.entry.js.map +1 -1
  159. package/dist/esm/nylas-scheduler-editor.entry.js +1 -1
  160. package/dist/esm/nylas-scheduler-editor.entry.js.map +1 -1
  161. package/dist/esm/nylas-selected-event-card.entry.js +1 -1
  162. package/dist/esm/nylas-time-window-picker.entry.js +39 -14
  163. package/dist/esm/nylas-time-window-picker.entry.js.map +1 -1
  164. package/dist/esm/nylas-web-elements.js +1 -1
  165. package/dist/esm/scheduler-config-store-8ccc8dc7.js.map +1 -1
  166. package/dist/esm/scheduler-config-store-ec3b6190.js.map +1 -1
  167. package/dist/nylas-web-elements/nylas-api-request-ff2869d7.js.map +1 -1
  168. package/dist/nylas-web-elements/nylas-availability-picker.entry.js +14 -7
  169. package/dist/nylas-web-elements/nylas-availability-picker.entry.js.map +1 -1
  170. package/dist/nylas-web-elements/nylas-booked-event-card.entry.js +1 -1
  171. package/dist/nylas-web-elements/nylas-booking-calendar-picker.entry.js.map +1 -1
  172. package/dist/nylas-web-elements/nylas-booking-form.entry.js +3 -3
  173. package/dist/nylas-web-elements/nylas-buffer-time.entry.js +7 -6
  174. package/dist/nylas-web-elements/nylas-buffer-time.entry.js.map +1 -1
  175. package/dist/nylas-web-elements/nylas-calendar-picker.entry.js.map +1 -1
  176. package/dist/nylas-web-elements/nylas-date-picker.entry.js +1 -1
  177. package/dist/nylas-web-elements/nylas-editor-tabs.entry.js +5 -4
  178. package/dist/nylas-web-elements/nylas-editor-tabs.entry.js.map +1 -1
  179. package/dist/nylas-web-elements/nylas-event-description.entry.js +2 -2
  180. package/dist/nylas-web-elements/nylas-event-description.entry.js.map +1 -1
  181. package/dist/nylas-web-elements/nylas-event-duration.entry.js +1 -1
  182. package/dist/nylas-web-elements/nylas-event-duration.entry.js.map +1 -1
  183. package/dist/nylas-web-elements/nylas-event-info.entry.js +1 -1
  184. package/dist/nylas-web-elements/nylas-event-info.entry.js.map +1 -1
  185. package/dist/nylas-web-elements/nylas-event-limits.entry.js +1 -1
  186. package/dist/nylas-web-elements/nylas-event-limits.entry.js.map +1 -1
  187. package/dist/nylas-web-elements/nylas-event-title.entry.js +2 -2
  188. package/dist/nylas-web-elements/nylas-if-state.entry.js +1 -1
  189. package/dist/nylas-web-elements/nylas-limit-future-bookings.entry.js +1 -1
  190. package/dist/nylas-web-elements/nylas-limit-future-bookings.entry.js.map +1 -1
  191. package/dist/nylas-web-elements/nylas-locale-switch.entry.js +3 -3
  192. package/dist/nylas-web-elements/nylas-location-component.entry.js +4 -4
  193. package/dist/nylas-web-elements/nylas-location-component.entry.js.map +1 -1
  194. package/dist/nylas-web-elements/nylas-min-cancellation-notice.entry.js +1 -1
  195. package/dist/nylas-web-elements/nylas-min-cancellation-notice.entry.js.map +1 -1
  196. package/dist/nylas-web-elements/nylas-scheduler-editor.entry.js +1 -1
  197. package/dist/nylas-web-elements/nylas-scheduler-editor.entry.js.map +1 -1
  198. package/dist/nylas-web-elements/nylas-selected-event-card.entry.js +1 -1
  199. package/dist/nylas-web-elements/nylas-time-window-picker.entry.js +39 -14
  200. package/dist/nylas-web-elements/nylas-time-window-picker.entry.js.map +1 -1
  201. package/dist/nylas-web-elements/nylas-web-elements.esm.js +1 -1
  202. package/dist/nylas-web-elements/p-0dabcb4d.js.map +1 -1
  203. package/dist/nylas-web-elements/{p-933c6d32.entry.js → p-181654f5.entry.js} +3 -3
  204. package/dist/nylas-web-elements/{p-933c6d32.entry.js.map → p-181654f5.entry.js.map} +1 -1
  205. package/dist/nylas-web-elements/{p-b1b3eb52.entry.js → p-1871c702.entry.js} +2 -2
  206. package/dist/nylas-web-elements/p-4f4e83d0.entry.js +2 -0
  207. package/dist/nylas-web-elements/p-4f4e83d0.entry.js.map +1 -0
  208. package/dist/nylas-web-elements/p-a219b2c7.entry.js +2 -0
  209. package/dist/nylas-web-elements/p-a219b2c7.entry.js.map +1 -0
  210. package/dist/nylas-web-elements/{p-a002b4cf.entry.js → p-e92690a2.entry.js} +2 -2
  211. package/dist/nylas-web-elements/p-ee91a2a0.js.map +1 -1
  212. package/dist/nylas-web-elements/scheduler-config-store-8ccc8dc7.js.map +1 -1
  213. package/dist/types/components/scheduler-editor/nylas-availability-picker/nylas-availability-picker.d.ts +10 -5
  214. package/dist/types/components/scheduler-editor/nylas-event-description/nylas-event-description.d.ts +2 -2
  215. package/dist/types/components/scheduler-editor/nylas-location-component/nylas-location-component.d.ts +2 -2
  216. package/dist/types/components/scheduler-editor/nylas-time-window-picker/nylas-time-window-picker.d.ts +8 -3
  217. package/dist/types/components.d.ts +125 -32
  218. package/dist/types/stores/scheduler-config-store.d.ts +5 -1
  219. package/dist/types/types/index.d.ts +73 -0
  220. package/package.json +4 -2
  221. package/dist/nylas-web-elements/p-74492776.entry.js +0 -2
  222. package/dist/nylas-web-elements/p-74492776.entry.js.map +0 -1
  223. package/dist/nylas-web-elements/p-76461af6.entry.js +0 -2
  224. package/dist/nylas-web-elements/p-76461af6.entry.js.map +0 -1
  225. /package/dist/nylas-web-elements/{p-b1b3eb52.entry.js.map → p-1871c702.entry.js.map} +0 -0
  226. /package/dist/nylas-web-elements/{p-a002b4cf.entry.js.map → p-e92690a2.entry.js.map} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"nylas-scheduler-editor.js","sourceRoot":"","sources":["../../../../src/components/scheduler-editor/nylas-scheduler-editor/nylas-scheduler-editor.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAE/D,OAAO,EAAY,2BAA2B,EAA8B,MAAM,4BAA4B,CAAC;AAE/G,OAAO,EAAE,6BAA6B,EAAE,MAAM,8CAA8C,CAAC;AAC7F,OAAO,EAAE,+BAA+B,EAAiE,MAAM,iCAAiC,CAAC;AACjJ,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAU,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AACrH,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAYhD,MAAM,OAAO,oBAAoB;;QAwRvB,sCAAiC,GAAG,CAAC,MAAa,EAAE,EAAE;YAC5D,IAAI,CAAC,2BAA2B,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACnD,CAAC,CAAC;QAOM,sBAAiB,GAAG,KAAK,EAAE,QAAiB,EAAE,EAAE;YAC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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { NylasBaseProvider } from '@/common/abstract-provider';\nimport type { SchedulerEditorEventOverride } from '@/common/component-types';\nimport { AuthArgs, NylasIdentityRequestWrapper, User, type NylasApiRequest } from '@/common/nylas-api-request';\nimport { RegisteredComponent } from '@/common/register-component';\nimport { NylasSchedulerConfigConnector } from '@/connector/nylas-scheduler-config-connector';\nimport { CreateNylasSchedulerConfigStore, NylasSchedulerConfigStoreState, NylasSchedulerConfigStoreType } from '@/stores/scheduler-config-store';\nimport { debug } from '@/utils/utils';\nimport { Config, NylasSessions } from '@nylas/identity';\nimport { Component, Element, Event, EventEmitter, Host, Listen, Method, Prop, State, Watch, h } from '@stencil/core';\nimport { LoginRequired } from './LoginRequired';\n\n/**\n * The `nylas-scheduler-editor` component is a form that allows users to configure the settings for the Nylas Scheduler.\n *\n * @slot login-required - This slot is used to display a message when the user is not logged in.\n */\n@Component({\n tag: 'nylas-scheduler-editor',\n styleUrl: 'nylas-scheduler-editor.scss',\n shadow: true,\n})\nexport class NylasSchedulerEditor {\n /**\n * Stores to be used by the provider.\n */\n private stores?: {\n schedulerConfig: NylasSchedulerConfigStoreType;\n };\n\n /**\n * This is a base provide that defines the common methods and properties\n * that all providers should have.\n *\n * Because stencil does not support abstract classes, we have to use a\n * property to store the base provider instance.\n */\n private baseProvider?: NylasBaseProvider<Exclude<typeof this.stores, undefined>>;\n\n /**\n * The Nylas Scheduler Config Connector instance.\n * The brains of the provider. It manages data fetching and state synchronization.\n */\n private nylasSchedulerConfigConnector?: NylasSchedulerConfigConnector;\n\n /**\n * The host element.\n * Used to manage the host element of the provider.\n */\n @Element() private host!: HTMLNylasSchedulerEditorElement;\n\n /**\n * The default require session auth flag to used to set the default value for the requireSessionAuth\n * property when creating a configuration. If set to true, then a session token must be provided\n * to the <nylas-scheduling/> component. If set to false, then a session token is not required\n * and the configuration id can passed to the <nylas-scheduling/> component instead.\n */\n @Prop() defaultRequiresSessionAuth: boolean = true;\n\n /***\n * The configuration id to use for the scheduler editor.\n * If provided, then the scheduler editor will try and fetch the configuration\n * with the provided id. If found, it will automatically load the editor\n * with the configuration settings for editing.\n */\n @Prop({ mutable: true }) configurationId?: string;\n\n /**\n * The Nylas Api Request instance.\n * Used to make requests to the Nylas API.\n */\n @Prop({ mutable: true }) nylasApiRequest?: NylasApiRequest;\n\n /**\n * The Nylas Sessions configuration.\n * Used to configure the Nylas Sessions instance.\n */\n @Prop() nylasSessionsConfig?: Config;\n\n /**\n * The default authentication arguments to use when authenticating a user.\n */\n @Prop() defaultAuthArgs?: AuthArgs;\n\n /**\n * This provides a way to override the default event handlers.\n */\n @Prop() eventOverrides: SchedulerEditorEventOverride = {};\n\n /**\n * The scheduler preview link to use when the user clicks on the preview button.\n * You can use a placeholder `{config.id}` to replace the configuration id anywhere in the link.\n */\n @Prop({ attribute: 'scheduler-preview-link' }) schedulerPreviewLink: string = '';\n\n /**\n * The default scheduler config store state.\n * Used to set the initial state of the scheduler config store.\n */\n @Prop({ attribute: 'default-scheduler-config-store-state' }) readonly defaultSchedulerConfigState?: Partial<NylasSchedulerConfigStoreState>;\n\n /**\n * The is used to set the mode for the scheduler config.\n * The mode can be 'app' or 'composable'.\n * The default mode is 'app'.\n */\n @Prop({ attribute: 'mode' }) readonly mode: 'app' | 'composable' = 'app';\n\n /**\n * This event is fired when the provider is initialized.\n * By default, this event handles determining if the user is logged in or not.\n * In addition, it fetches the provided configuration if a valid configuration id is provided.\n */\n @Event({ cancelable: true }) readonly init!: EventEmitter<HTMLNylasSchedulerEditorElement>;\n\n /**\n * This event is fired when the the NyalsAuth isAuthenticated state changes\n * to true.\n */\n @Event({ cancelable: true }) readonly loggedIn!: EventEmitter<HTMLNylasSchedulerEditorElement>;\n\n /**\n * This event is fired when the the NyalsAuth isAuthenticated state changes\n * to true.\n */\n @Event({ cancelable: true }) readonly loggedOut!: EventEmitter<HTMLNylasSchedulerEditorElement>;\n\n /**\n * This event is fired when the close button on scheduler config is clicked.\n */\n @Event({ cancelable: true }) readonly schedulerConfigCloseClicked!: EventEmitter<HTMLNylasSchedulerEditorElement>;\n\n /**\n * Automatically register components that have the `@RegisterComponent` decorator.\n * If this is set to false, you will need to manually register components using the\n * `registerComponent` method.\n * @default true\n */\n @State() automaticComponentRegistration: boolean = true;\n\n connectedCallback() {\n debug(`[nylas-scheduler-editor] connectedCallback`);\n }\n\n async componentWillLoad() {\n debug(`[nylas-scheduler-editor] componentWillLoad`);\n this.stores = {\n schedulerConfig: CreateNylasSchedulerConfigStore({\n ...this.defaultSchedulerConfigState,\n }),\n };\n\n if (!this.nylasApiRequest && this.nylasSessionsConfig) {\n const nylasSession = new NylasSessions(this.nylasSessionsConfig);\n\n // We must check if the user is logged in before continuing\n // otherwise, a PCKE code will not be generated and the user\n // will not be able to log in.\n await nylasSession.isLoggedIn();\n\n // Watch for login events so that we can automatically update the state\n nylasSession.onLoginSuccess(async () => {\n const currentUser = await this.nylasSchedulerConfigConnector?.schedulerConfig?.currentUser();\n if (currentUser) {\n this.loggedIn.emit(this.host);\n this.loggedInHandler(currentUser);\n }\n });\n\n // Watch for logout events so that we can automatically update the state\n nylasSession.onLoginFail(async () => {\n this.stores?.schedulerConfig?.set('currentUser', null);\n this.loggedOut.emit(this.host);\n });\n\n this.nylasApiRequest = new NylasIdentityRequestWrapper(nylasSession);\n }\n\n if (this.nylasApiRequest && this.defaultAuthArgs) {\n this.nylasApiRequest.setDefaultAuthArgs(this.defaultAuthArgs);\n }\n\n this.baseProvider = new NylasBaseProvider(this.host, this.stores, this.automaticComponentRegistration, this.eventOverrides);\n\n const nylasSchedulerConfigStore = this.baseProvider.getStore('schedulerConfig');\n this.nylasSchedulerConfigConnector = new NylasSchedulerConfigConnector({\n nylasApiRequest: this.nylasApiRequest,\n nylasSchedulerConfigStore: nylasSchedulerConfigStore,\n });\n\n const initEvent = this.init.emit(this.host);\n if (!initEvent.defaultPrevented) {\n const currentUser = await this.nylasSchedulerConfigConnector?.schedulerConfig?.currentUser();\n if (currentUser) {\n this.loggedIn.emit(this.host);\n await this.loggedInHandler(currentUser);\n } else {\n this.stores?.schedulerConfig?.set('currentUser', null);\n this.loggedOut.emit(this.host);\n }\n }\n\n // Watch for store changes\n this.stores?.schedulerConfig?.onChange('selectedConfiguration', async config => {\n if (config && config.id) {\n this.configurationId = config.id;\n }\n });\n\n this.baseProvider?.componentWillLoad(this.nylasSchedulerConfigConnector);\n }\n\n async componentDidLoad() {\n debug(`[nylas-scheduler-editor] componentDidLoad`);\n this.baseProvider?.componentDidLoad();\n }\n\n componentDisconnected() {\n this.baseProvider?.componentDisconnected();\n }\n\n /**\n * Watch for changes to the configuration id and automatically fetch the configuration\n * when the configuration id changes. If the configuration id is cleared, then the\n * configuration is cleared as well.\n * @param newConfigurationId The new configuration id\n */\n @Watch('configurationId')\n async configurationIdChanged(newConfigurationId: string) {\n if (newConfigurationId) {\n await this.nylasSchedulerConfigConnector?.schedulerConfig?.getConfigurationById(newConfigurationId);\n this.stores?.schedulerConfig?.set('action', 'edit');\n } else {\n // Clear the configuration\n this.stores?.schedulerConfig?.set('selectedConfiguration', {});\n this.stores?.schedulerConfig?.set('action', null);\n }\n }\n\n /**\n * This method is used to get the NylasSchedulerConfigStore instance.\n * You can use this instance to update or get the state of the store.\n * @returns Promise<NylasSchedulerConfigStoreType | undefined>\n */\n @Method()\n async store(): Promise<NylasSchedulerConfigStoreType | undefined> {\n return this.stores?.schedulerConfig;\n }\n\n /**\n * This method is used to get the NylasSchedulerConfigConnector instance.\n * You can use this instance to make requests to the Nylas API.\n * @returns Promise<NylasSchedulerConfigConnector | undefined>\n */\n @Method()\n async schedulerConnector(): Promise<NylasSchedulerConfigConnector | undefined> {\n return this.nylasSchedulerConfigConnector;\n }\n\n /**\n * This is a custom event handler that is used to register a component with the provider.\n * It is used by components that have the `@RegisterComponent` decorator.\n * @param event A custom event that contains the component to register\n * @returns Promise<void>\n */\n @Listen('registerComponent')\n async registerComponentHandler(event: CustomEvent<RegisteredComponent<any, any>>): Promise<void> {\n this.baseProvider?.registerComponent(event.detail);\n }\n\n /**\n * This is a custom event handler that is used to unregister a component with the provider.\n * It is used by components that have the `@RegisterComponent` decorator.\n * @param event A custom event that contains the component to unregister\n * @returns Promise<void>\n */\n @Listen('unregisterComponent')\n async unregisterComponentHandler(event: CustomEvent<RegisteredComponent<any, any>>): Promise<void> {\n this.baseProvider?.unregisterComponent(event.detail);\n }\n\n /**\n * Upon login, set the current user and fetch the configuration and calendars.\n * @param currentUser The current user that is logged in\n */\n private async loggedInHandler(currentUser: User) {\n this.stores?.schedulerConfig?.set('currentUser', currentUser);\n\n if (!this.nylasSchedulerConfigConnector) {\n return;\n }\n\n if (this.configurationId) {\n await this.nylasSchedulerConfigConnector.schedulerConfig?.getConfigurationById(this.configurationId);\n }\n\n await this.nylasSchedulerConfigConnector.schedulerConfig?.getCalendars();\n }\n\n /**\n * This is a custom event handler that is used to update the state of the provider.\n */\n private handleSchedulerConfigCloseClicked = (_event: Event) => {\n this.schedulerConfigCloseClicked.emit(this.host);\n };\n\n /**\n * This method is used to get the authentication URL for a provider.\n * @param provider The provider to get the authentication URL for (e.g. google, microsoft, etc.)\n * @returns Promise<string> The authentication URL to redirect the user for the provider\n */\n private authenticationUrl = async (provider?: string) => {\n if (!this.nylasApiRequest) {\n console.error(`[nylas-scheduler-editor] Nylas API Request is not initialized.`);\n return '';\n }\n const url = await this.nylasApiRequest.authenticationUrl({ provider });\n\n return url || '';\n };\n\n render() {\n return (\n <Host>\n <div class=\"scheduler-editor-header\" part=\"nse__header\">\n <h1 class=\"scheduler-editor-title\" part=\"nse__title\">\n <calendar-icon width=\"18\" height=\"18\" />\n Scheduler editor\n </h1>\n <button class=\"scheduler-editor-close\" onClick={e => this.handleSchedulerConfigCloseClicked(e)} part=\"nse__close-button\">\n <close-icon width=\"18\" height=\"18\" />\n </button>\n </div>\n {this.stores?.schedulerConfig?.state.currentUser && this.stores.schedulerConfig.state.action === null && (\n <div class=\"list-configurations\">\n <nylas-list-configurations></nylas-list-configurations>\n </div>\n )}\n {this.stores?.schedulerConfig?.state.currentUser && this.stores.schedulerConfig.state.action === 'create' && (\n // If the mode is 'app', then render the editor tabs in a composable mode with children for creating a new configuration (Express flow).\n <nylas-editor-tabs mode=\"composable\">\n <nylas-event-info>\n <div slot=\"inputs\">\n <nylas-event-title />\n <nylas-event-duration />\n <nylas-location-component />\n </div>\n </nylas-event-info>\n <nylas-booking-calendar-picker />\n </nylas-editor-tabs>\n )}\n {this.stores?.schedulerConfig?.state.currentUser && this.stores.schedulerConfig.state.action === 'edit' && (\n <nylas-editor-tabs mode={this.mode}>{this.mode === 'composable' && <slot />}</nylas-editor-tabs>\n )}\n {!this.stores?.schedulerConfig?.state.currentUser && (\n <slot name=\"login-required\">\n <LoginRequired authenticationUrl={this.authenticationUrl} />\n </slot>\n )}\n </Host>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"nylas-scheduler-editor.js","sourceRoot":"","sources":["../../../../src/components/scheduler-editor/nylas-scheduler-editor/nylas-scheduler-editor.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAE/D,OAAO,EAAY,2BAA2B,EAA8B,MAAM,4BAA4B,CAAC;AAE/G,OAAO,EAAE,6BAA6B,EAAE,MAAM,8CAA8C,CAAC;AAC7F,OAAO,EAAE,+BAA+B,EAAiE,MAAM,iCAAiC,CAAC;AACjJ,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAU,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AACrH,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAYhD,MA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { NylasBaseProvider } from '@/common/abstract-provider';\nimport type { SchedulerEditorEventOverride } from '@/common/component-types';\nimport { AuthArgs, NylasIdentityRequestWrapper, User, type NylasApiRequest } from '@/common/nylas-api-request';\nimport { RegisteredComponent } from '@/common/register-component';\nimport { NylasSchedulerConfigConnector } from '@/connector/nylas-scheduler-config-connector';\nimport { CreateNylasSchedulerConfigStore, NylasSchedulerConfigStoreState, NylasSchedulerConfigStoreType } from '@/stores/scheduler-config-store';\nimport { debug } from '@/utils/utils';\nimport { Config, NylasSessions } from '@nylas/identity';\nimport { Component, Element, Event, EventEmitter, Host, Listen, Method, Prop, State, Watch, h } from '@stencil/core';\nimport { LoginRequired } from './LoginRequired';\n\n/**\n * The `nylas-scheduler-editor` component is a form that allows users to configure the settings for the Nylas Scheduler.\n *\n * @slot login-required - This slot is used to display a message when the user is not logged in.\n */\n@Component({\n tag: 'nylas-scheduler-editor',\n styleUrl: 'nylas-scheduler-editor.scss',\n shadow: true,\n})\nexport class NylasSchedulerEditor {\n /**\n * Stores to be used by the provider.\n */\n private stores?: {\n schedulerConfig: NylasSchedulerConfigStoreType;\n };\n\n /**\n * This is a base provide that defines the common methods and properties\n * that all providers should have.\n *\n * Because stencil does not support abstract classes, we have to use a\n * property to store the base provider instance.\n */\n private baseProvider?: NylasBaseProvider<Exclude<typeof this.stores, undefined>>;\n\n /**\n * The Nylas Scheduler Config Connector instance.\n * The brains of the provider. It manages data fetching and state synchronization.\n */\n private nylasSchedulerConfigConnector?: NylasSchedulerConfigConnector;\n\n /**\n * The host element.\n * Used to manage the host element of the provider.\n */\n @Element() private host!: HTMLNylasSchedulerEditorElement;\n\n /**\n * The default requires_session_auth flag to use to set the default value for the requireSessionAuth\n * property when creating a configuration. If set to true, a session token must be provided\n * to the <nylas-scheduling/> component. If set to false, then a session token is not required,\n * and the configuration id can be passed to the <nylas-scheduling/> component instead.\n */\n @Prop() defaultRequiresSessionAuth: boolean = true;\n\n /***\n * The configuration id to use for the scheduler editor.\n * If provided, then the scheduler editor will try and fetch the configuration\n * with the provided id. If found, it will automatically load the editor\n * with the configuration settings for editing.\n */\n @Prop({ mutable: true }) configurationId?: string;\n\n /**\n * The Nylas Api Request instance.\n * Used to make requests to the Nylas API.\n */\n @Prop({ mutable: true }) nylasApiRequest?: NylasApiRequest;\n\n /**\n * The Nylas Sessions configuration.\n * Used to configure the Nylas Sessions instance.\n */\n @Prop() nylasSessionsConfig?: Config;\n\n /**\n * The default authentication arguments to use when authenticating a user.\n */\n @Prop() defaultAuthArgs?: AuthArgs;\n\n /**\n * This provides a way to override the default event handlers.\n */\n @Prop() eventOverrides: SchedulerEditorEventOverride = {};\n\n /**\n * The scheduler preview link to use when the user clicks on the preview button.\n * You can use the placeholder `{config.id}` to replace the configuration id anywhere in the link.\n */\n @Prop({ attribute: 'scheduler-preview-link' }) schedulerPreviewLink: string = '';\n\n /**\n * The default scheduler config store state.\n * Used to set the initial state of the scheduler config store.\n * This state can be used to pass defaults to newly created configurations.\n */\n @Prop({ attribute: 'default-scheduler-config-store-state' }) readonly defaultSchedulerConfigState?: Partial<NylasSchedulerConfigStoreState>;\n\n /**\n * This is used to set the mode for the scheduler config.\n * The mode can be 'app' or 'composable'.\n * The default mode is 'app'.\n */\n @Prop({ attribute: 'mode' }) readonly mode: 'app' | 'composable' = 'app';\n\n /**\n * This event is fired when the provider is initialized.\n * By default, this event handles determining if the user is logged in or not.\n * In addition, it fetches the provided configuration if a valid configuration id is provided.\n */\n @Event({ cancelable: true }) readonly init!: EventEmitter<HTMLNylasSchedulerEditorElement>;\n\n /**\n * This event is fired when the the NylasAuth isAuthenticated state changes\n * to true.\n */\n @Event({ cancelable: true }) readonly loggedIn!: EventEmitter<HTMLNylasSchedulerEditorElement>;\n\n /**\n * This event is fired when the the NylasAuth isAuthenticated state changes\n * to true.\n */\n @Event({ cancelable: true }) readonly loggedOut!: EventEmitter<HTMLNylasSchedulerEditorElement>;\n\n /**\n * This event is fired when the close button on scheduler config is clicked.\n */\n @Event({ cancelable: true }) readonly schedulerConfigCloseClicked!: EventEmitter<HTMLNylasSchedulerEditorElement>;\n\n /**\n * Automatically register components that have the `@RegisterComponent` decorator.\n * If this is set to false, you will need to manually register components using the\n * `registerComponent` method.\n * @default true\n */\n @State() automaticComponentRegistration: boolean = true;\n\n connectedCallback() {\n debug(`[nylas-scheduler-editor] connectedCallback`);\n }\n\n async componentWillLoad() {\n debug(`[nylas-scheduler-editor] componentWillLoad`);\n this.stores = {\n schedulerConfig: CreateNylasSchedulerConfigStore({\n ...this.defaultSchedulerConfigState,\n }),\n };\n\n if (!this.nylasApiRequest && this.nylasSessionsConfig) {\n const nylasSession = new NylasSessions(this.nylasSessionsConfig);\n\n // We must check if the user is logged in before continuing\n // otherwise, a PCKE code will not be generated and the user\n // will not be able to log in.\n await nylasSession.isLoggedIn();\n\n // Watch for login events so that we can automatically update the state\n nylasSession.onLoginSuccess(async () => {\n const currentUser = await this.nylasSchedulerConfigConnector?.schedulerConfig?.currentUser();\n if (currentUser) {\n this.loggedIn.emit(this.host);\n this.loggedInHandler(currentUser);\n }\n });\n\n // Watch for logout events so that we can automatically update the state\n nylasSession.onLoginFail(async () => {\n this.stores?.schedulerConfig?.set('currentUser', null);\n this.loggedOut.emit(this.host);\n });\n\n this.nylasApiRequest = new NylasIdentityRequestWrapper(nylasSession);\n }\n\n if (this.nylasApiRequest && this.defaultAuthArgs) {\n this.nylasApiRequest.setDefaultAuthArgs(this.defaultAuthArgs);\n }\n\n this.baseProvider = new NylasBaseProvider(this.host, this.stores, this.automaticComponentRegistration, this.eventOverrides);\n\n const nylasSchedulerConfigStore = this.baseProvider.getStore('schedulerConfig');\n this.nylasSchedulerConfigConnector = new NylasSchedulerConfigConnector({\n nylasApiRequest: this.nylasApiRequest,\n nylasSchedulerConfigStore: nylasSchedulerConfigStore,\n });\n\n const initEvent = this.init.emit(this.host);\n if (!initEvent.defaultPrevented) {\n const currentUser = await this.nylasSchedulerConfigConnector?.schedulerConfig?.currentUser();\n if (currentUser) {\n this.loggedIn.emit(this.host);\n await this.loggedInHandler(currentUser);\n } else {\n this.stores?.schedulerConfig?.set('currentUser', null);\n this.loggedOut.emit(this.host);\n }\n }\n\n // Watch for store changes\n this.stores?.schedulerConfig?.onChange('selectedConfiguration', async config => {\n if (config && config.id) {\n this.configurationId = config.id;\n }\n });\n\n this.baseProvider?.componentWillLoad(this.nylasSchedulerConfigConnector);\n }\n\n async componentDidLoad() {\n debug(`[nylas-scheduler-editor] componentDidLoad`);\n this.baseProvider?.componentDidLoad();\n }\n\n componentDisconnected() {\n this.baseProvider?.componentDisconnected();\n }\n\n /**\n * Watch for changes to the configuration id and automatically fetch the configuration\n * when the configuration id changes. If the configuration id is cleared, then the\n * configuration is cleared as well.\n * @param newConfigurationId The new configuration id\n */\n @Watch('configurationId')\n async configurationIdChanged(newConfigurationId: string) {\n if (newConfigurationId) {\n await this.nylasSchedulerConfigConnector?.schedulerConfig?.getConfigurationById(newConfigurationId);\n this.stores?.schedulerConfig?.set('action', 'edit');\n } else {\n // Clear the configuration\n this.stores?.schedulerConfig?.set('selectedConfiguration', {});\n this.stores?.schedulerConfig?.set('action', null);\n }\n }\n\n /**\n * This method is used to get the NylasSchedulerConfigStore instance.\n * You can use this instance to update or get the state of the store.\n * @returns Promise<NylasSchedulerConfigStoreType | undefined>\n */\n @Method()\n async store(): Promise<NylasSchedulerConfigStoreType | undefined> {\n return this.stores?.schedulerConfig;\n }\n\n /**\n * This method is used to get the NylasSchedulerConfigConnector instance.\n * You can use this instance to make requests to the Nylas API.\n * @returns Promise<NylasSchedulerConfigConnector | undefined>\n */\n @Method()\n async schedulerConnector(): Promise<NylasSchedulerConfigConnector | undefined> {\n return this.nylasSchedulerConfigConnector;\n }\n\n /**\n * This is a custom event handler that is used to register a component with the provider.\n * It is used by components that have the `@RegisterComponent` decorator.\n * @param event A custom event that contains the component to register\n * @returns Promise<void>\n */\n @Listen('registerComponent')\n async registerComponentHandler(event: CustomEvent<RegisteredComponent<any, any>>): Promise<void> {\n this.baseProvider?.registerComponent(event.detail);\n }\n\n /**\n * This is a custom event handler that is used to unregister a component with the provider.\n * It is used by components that have the `@RegisterComponent` decorator.\n * @param event A custom event that contains the component to unregister\n * @returns Promise<void>\n */\n @Listen('unregisterComponent')\n async unregisterComponentHandler(event: CustomEvent<RegisteredComponent<any, any>>): Promise<void> {\n this.baseProvider?.unregisterComponent(event.detail);\n }\n\n /**\n * Upon login, set the current user and fetch the configuration and calendars.\n * @param currentUser The current user that is logged in\n */\n private async loggedInHandler(currentUser: User) {\n this.stores?.schedulerConfig?.set('currentUser', currentUser);\n\n if (!this.nylasSchedulerConfigConnector) {\n return;\n }\n\n if (this.configurationId) {\n await this.nylasSchedulerConfigConnector.schedulerConfig?.getConfigurationById(this.configurationId);\n }\n\n await this.nylasSchedulerConfigConnector.schedulerConfig?.getCalendars();\n }\n\n /**\n * This is a custom event handler that is used to update the state of the provider.\n */\n private handleSchedulerConfigCloseClicked = (_event: Event) => {\n this.schedulerConfigCloseClicked.emit(this.host);\n };\n\n /**\n * This method is used to get the authentication URL for a provider.\n * @param provider The provider to get the authentication URL for (e.g. google, microsoft, etc.)\n * @returns Promise<string> The authentication URL to redirect the user for the provider\n */\n private authenticationUrl = async (provider?: string) => {\n if (!this.nylasApiRequest) {\n console.error(`[nylas-scheduler-editor] Nylas API Request is not initialized.`);\n return '';\n }\n const url = await this.nylasApiRequest.authenticationUrl({ provider });\n\n return url || '';\n };\n\n render() {\n return (\n <Host>\n <div class=\"scheduler-editor-header\" part=\"nse__header\">\n <h1 class=\"scheduler-editor-title\" part=\"nse__title\">\n <calendar-icon width=\"18\" height=\"18\" />\n Scheduler editor\n </h1>\n <button class=\"scheduler-editor-close\" onClick={e => this.handleSchedulerConfigCloseClicked(e)} part=\"nse__close-button\">\n <close-icon width=\"18\" height=\"18\" />\n </button>\n </div>\n {this.stores?.schedulerConfig?.state.currentUser && this.stores.schedulerConfig.state.action === null && (\n <div class=\"list-configurations\">\n <nylas-list-configurations></nylas-list-configurations>\n </div>\n )}\n {this.stores?.schedulerConfig?.state.currentUser && this.stores.schedulerConfig.state.action === 'create' && (\n // If the mode is 'app', then render the editor tabs in a composable mode with children for creating a new configuration (Express flow).\n <nylas-editor-tabs mode=\"composable\">\n <nylas-event-info>\n <div slot=\"inputs\">\n <nylas-event-title />\n <nylas-event-duration />\n <nylas-location-component />\n </div>\n </nylas-event-info>\n <nylas-booking-calendar-picker />\n </nylas-editor-tabs>\n )}\n {this.stores?.schedulerConfig?.state.currentUser && this.stores.schedulerConfig.state.action === 'edit' && (\n <nylas-editor-tabs mode={this.mode}>{this.mode === 'composable' && <slot />}</nylas-editor-tabs>\n )}\n {!this.stores?.schedulerConfig?.state.currentUser && (\n <slot name=\"login-required\">\n <LoginRequired authenticationUrl={this.authenticationUrl} />\n </slot>\n )}\n </Host>\n );\n }\n}\n"]}
@@ -8,10 +8,8 @@ export class TimeInput {
8
8
  this.time = undefined;
9
9
  this.minimumStartTime = null;
10
10
  this.placeholder = 'hh:mmam/pm';
11
- this.setTime = undefined;
12
11
  this.name = undefined;
13
12
  this.hasError = false;
14
- this.setFormError = undefined;
15
13
  this.err = '';
16
14
  this.showTimes = false;
17
15
  this.ariaActivedescendant = '';
@@ -41,7 +39,10 @@ export class TimeInput {
41
39
  let selectedTimeFormatted = dayjs(this.time, 'hh:mma');
42
40
  if (selectedTimeFormatted.isBefore(firstTime)) {
43
41
  this.err = 'Invalid';
44
- this.setFormError(null, 'Invalid');
42
+ this.formError.emit({
43
+ key: this.el.id,
44
+ message: 'Invalid',
45
+ });
45
46
  }
46
47
  }
47
48
  }
@@ -56,41 +57,64 @@ export class TimeInput {
56
57
  return;
57
58
  }
58
59
  }
59
- handleTimeChange(e, input) {
60
+ handleTimeChange(_e, input) {
60
61
  const timePart = input.split(':');
61
62
  if (timePart[0] === '00' && timePart[1].slice(-2) == 'pm') {
62
63
  this.err = 'Invalid';
63
- this.setFormError(e, 'Invalid');
64
+ this.formError.emit({
65
+ key: this.el.id,
66
+ message: 'Invalid',
67
+ });
64
68
  }
65
69
  if (!validateTimeFormatInput(input)) {
66
70
  this.err = 'Invalid';
67
- this.setFormError(e, 'Invalid');
71
+ this.formError.emit({
72
+ key: this.el.id,
73
+ message: 'Invalid',
74
+ });
68
75
  }
69
76
  else {
70
77
  this.err = '';
71
- this.setFormError(null);
78
+ this.formError.emit({
79
+ key: this.el.id,
80
+ message: '',
81
+ });
72
82
  }
73
- this.setTime(e, input);
74
- this.timeChange.emit(input);
83
+ this.timeChange.emit({
84
+ key: this.el.id,
85
+ value: input,
86
+ });
75
87
  }
76
88
  handleTimeAutocomplete(event) {
77
89
  const input = event.target?.value;
78
90
  if (!validateTimeFormatInput(input)) {
79
91
  this.err = 'Invalid';
80
- this.setFormError(event, 'Invalid');
92
+ this.formError.emit({
93
+ key: this.el.id,
94
+ message: 'Invalid',
95
+ });
81
96
  return;
82
97
  }
83
98
  if (input === '') {
84
99
  const newTime = roundToNearest15Minutes().format('hh:mma');
85
- this.setTime(event, newTime);
100
+ this.timeChange.emit({
101
+ key: this.el.id,
102
+ value: newTime,
103
+ });
86
104
  return;
87
105
  }
88
106
  if (!validateExactTimeFormat(input)) {
89
107
  const autocompletedTime = autocompleteTimeFormat(input);
90
- this.setTime(autocompletedTime);
108
+ this.timeChange.emit({
109
+ key: this.el.id,
110
+ value: autocompletedTime,
111
+ });
91
112
  return;
92
113
  }
93
- this.setTime(event, input);
114
+ this.timeChange.emit({
115
+ key: this.el.id,
116
+ value: input,
117
+ });
94
118
  }
95
119
  handleOnInput(event) {
96
120
  const input = event.target?.value;
@@ -230,7 +254,7 @@ export class TimeInput {
230
254
  }
231
255
  }
232
256
  render() {
233
- return (h(Host, { key: 'fe86daaa8256c8fb59ffe2dfcbf50220f3a7b746' }, h("div", { key: '8cffe49df87c5bf2b73cef66236c806b47d623d4', class: "time-picker", part: "time-picker" }, h("input", { key: '6f735244c63287b0ec0668b688bbb18bb405346b', type: "text", name: this.name, id: this.name, part: "time-input", class: {
257
+ return (h(Host, { key: '4a03bc9829bace5ed02129d99e12b6042f49386c' }, h("div", { key: 'ccc660e6cd8727226b7418ee20fe700812f7c70b', class: "time-picker", part: "time-picker" }, h("input", { key: '24be2b42322194545575045f5624ac78bf8c643e', type: "text", name: this.name, id: this.name, part: "time-input", class: {
234
258
  'time-input': true,
235
259
  'error': !!this.err || this.hasError,
236
260
  }, ref: el => (this.timeInput = el), value: this.time, onClick: () => {
@@ -311,26 +335,6 @@ export class TimeInput {
311
335
  "reflect": false,
312
336
  "defaultValue": "'hh:mmam/pm'"
313
337
  },
314
- "setTime": {
315
- "type": "unknown",
316
- "mutable": false,
317
- "complexType": {
318
- "original": "Function",
319
- "resolved": "Function",
320
- "references": {
321
- "Function": {
322
- "location": "global",
323
- "id": "global::Function"
324
- }
325
- }
326
- },
327
- "required": true,
328
- "optional": false,
329
- "docs": {
330
- "tags": [],
331
- "text": "The function to set the time in the parent component."
332
- }
333
- },
334
338
  "name": {
335
339
  "type": "string",
336
340
  "mutable": false,
@@ -365,26 +369,6 @@ export class TimeInput {
365
369
  "attribute": "has-error",
366
370
  "reflect": false,
367
371
  "defaultValue": "false"
368
- },
369
- "setFormError": {
370
- "type": "unknown",
371
- "mutable": false,
372
- "complexType": {
373
- "original": "Function",
374
- "resolved": "Function",
375
- "references": {
376
- "Function": {
377
- "location": "global",
378
- "id": "global::Function"
379
- }
380
- }
381
- },
382
- "required": true,
383
- "optional": false,
384
- "docs": {
385
- "tags": [],
386
- "text": "The function to set the form error in the parent component.\nThis is useful if the parent component wants to display an\nerror message or set form validity."
387
- }
388
372
  }
389
373
  };
390
374
  }
@@ -406,11 +390,26 @@ export class TimeInput {
406
390
  "composed": true,
407
391
  "docs": {
408
392
  "tags": [],
409
- "text": ""
393
+ "text": "This event is fired when the time is changed."
410
394
  },
411
395
  "complexType": {
412
- "original": "string",
413
- "resolved": "string",
396
+ "original": "{\n key: string;\n value: string;\n }",
397
+ "resolved": "{ key: string; value: string; }",
398
+ "references": {}
399
+ }
400
+ }, {
401
+ "method": "formError",
402
+ "name": "formError",
403
+ "bubbles": true,
404
+ "cancelable": true,
405
+ "composed": true,
406
+ "docs": {
407
+ "tags": [],
408
+ "text": "This event is fired when the form has an error. The parent component\ncan listen for this event and display an error message or set form validity."
409
+ },
410
+ "complexType": {
411
+ "original": "{\n key: string;\n message: string;\n }",
412
+ "resolved": "{ key: string; message: string; }",
414
413
  "references": {}
415
414
  }
416
415
  }];
@@ -1 +1 @@
1
- {"version":3,"file":"nylas-time-window-picker.js","sourceRoot":"","sources":["../../../../src/components/scheduler-editor/nylas-time-window-picker/nylas-time-window-picker.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,uBAAuB,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAClI,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAgB,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAC7G,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,iBAAiB,MAAM,gCAAgC,CAAC;AAE/D,KAAK,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC;AAehC,MAAM,OAAO,SAAS;;;gCAgBsB,IAAI;2BAKhB,YAAY;;;wBAYd,KAAK;;mBAWV,EAAE;yBAIK,KAAK;oCAMK,EAAE;qBACjB,IAAI,CAAC,aAAa,EAAE;gCACR,KAAK;;IAM1C,k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,IACnJ,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CACxB,UACE,QAAQ,EAAC,GAAG,EACZ,GAAG,EAAE,MAAM,CAAC,EAAE,EACd,EAAE,EAAE,MAAM,CAAC,EAAE,CAAC,QAAQ,EAAE,EACxB,KAAK,EAAE;4BACL,OAAO,EAAE,IAAI,CAAC,oBAAoB,KAAK,MAAM,CAAC,EAAE,CAAC,QAAQ,EAAE;yBAC5D,EACD,OAAO,EAAE,CAAC,CAAC,EAAE;4BACX,IAAI,CAAC,gBAAgB,CAAC,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC;4BACvC,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;4BACvB,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC;wBACzB,CAAC,EACD,IAAI,EAAC,QAAQ,IAEZ,GAAG,MAAM,CAAC,KAAK,EAAE,CACf,CACN,CAAC,CACC,CACD,CACP;gBACA,CAAC,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,GAAG,IAAI,CAC9B,SAAG,KAAK,EAAC,OAAO,EAAC,EAAE,EAAC,aAAa,IAC9B,IAAI,CAAC,GAAG,CACP,CACL,CACG,CACD,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { autocompleteTimeFormat, roundToNearest15Minutes, validateExactTimeFormat, validateTimeFormatInput } from '@/utils/utils';\nimport { Component, h, State, Prop, Event, EventEmitter, Listen, Element, Host, Watch } from '@stencil/core';\nimport dayjs from 'dayjs';\nimport customParseFormat from 'dayjs/plugin/customParseFormat';\n\ndayjs.extend(customParseFormat);\n\ntype Time = { id: number; value: string };\n\n/**\n * The `nylas-time-window-picker` component is a time picker that can be used to select a time.\n * @part time-picker - The time picker container\n * @part time-input - The time input\n * @part times - The list of times\n */\n@Component({\n tag: 'nylas-time-window-picker',\n styleUrl: 'nylas-time-window-picker.scss',\n shadow: true,\n})\nexport class TimeInput {\n @Element() el!: HTMLElement;\n private timeInput!: HTMLInputElement;\n private timeMenu!: HTMLElement;\n\n /**\n * The time to display in the input.\n * This is passed by the parent component and can be updated\n * using the setTime prop function provided by the parent component.\n */\n @Prop() time!: string;\n /**\n * This is the start time value if one is set by the parent component.\n * It is useful if this component is used to render an end time which\n * should not be before the start time, defining the earliest selectable time.\n */\n @Prop() minimumStartTime: string | null = null;\n\n /**\n * The placeholder text for the input.\n */\n @Prop() placeholder: string = 'hh:mmam/pm';\n /**\n * The function to set the time in the parent component.\n */\n @Prop() setTime!: Function;\n /**\n * The name of the input.\n */\n @Prop() name!: string;\n /**\n * This sets the error state of the input.\n */\n @Prop() hasError: boolean = false;\n /**\n * The function to set the form error in the parent component.\n * This is useful if the parent component wants to display an\n * error message or set form validity.\n */\n @Prop() setFormError!: Function;\n\n /**\n * The error message to display if the time is invalid.\n */\n @State() err: string = '';\n /**\n * Toggle to show the list of times.\n */\n @State() showTimes: boolean = false;\n /**\n * The aria-activedescendant attribute for the listbox element to indicate the currently active\n * option in the list box to screen readers. The value of aria-activedescendant is the ID of\n * the active option.\n */\n @State() ariaActivedescendant: string = '';\n @State() times: Time[] = this.generateTimes();\n @State() shouldAutoScroll: boolean = false;\n\n @Event() timeChange!: EventEmitter<string>;\n\n // Event listeners\n @Listen('click', { target: 'document' })\n handleOutsideClick(event: MouseEvent) {\n // Get the path of the event\n const path = event.composedPath();\n\n // Check if the path includes the host element\n const isClickInside = path.includes(this.el);\n\n if (!isClickInside && this.showTimes) {\n this.showTimes = false;\n }\n }\n\n @Watch('minimumStartTime')\n minimumStartTimeChangedHandler() {\n if (this.minimumStartTime) {\n let formattedTime = dayjs()\n .hour(parseInt(this.minimumStartTime))\n .minute(parseInt(this.minimumStartTime.slice(-4, -2)));\n if (this.minimumStartTime.slice(-2).toLowerCase() === 'pm' && parseInt(this.minimumStartTime) !== 12) {\n formattedTime = formattedTime.add(12, 'hour');\n } else if (this.minimumStartTime.slice(-2).toLowerCase() === 'am' && parseInt(this.minimumStartTime) === 12) {\n formattedTime = formattedTime.subtract(12, 'hour');\n }\n\n this.times = this.generateTimes();\n const firstTime = dayjs(this.times[0].value, 'hh:mma');\n let selectedTimeFormatted = dayjs(this.time, 'hh:mma');\n if (selectedTimeFormatted.isBefore(firstTime)) {\n this.err = 'Invalid';\n this.setFormError(null, 'Invalid');\n }\n }\n }\n\n componentDidRender() {\n if (this.showTimes && this.shouldAutoScroll) {\n const autocompletedTime = autocompleteTimeFormat(this.time);\n const optionIndex = this.times.findIndex(time => time.value === autocompletedTime);\n if (optionIndex > -1) {\n this.shouldAutoScroll = false;\n this.scrollToViewWithinParent(optionIndex);\n }\n return;\n }\n }\n\n private handleTimeChange(e: Event, input: string) {\n const timePart = input.split(':');\n if (timePart[0] === '00' && timePart[1].slice(-2) == 'pm') {\n this.err = 'Invalid';\n this.setFormError(e, 'Invalid');\n }\n if (!validateTimeFormatInput(input)) {\n this.err = 'Invalid';\n this.setFormError(e, 'Invalid');\n } else {\n this.err = '';\n this.setFormError(null);\n }\n this.setTime(e, input);\n this.timeChange.emit(input);\n }\n\n private handleTimeAutocomplete(event: Event) {\n const input = (event.target as HTMLInputElement)?.value;\n if (!validateTimeFormatInput(input)) {\n this.err = 'Invalid';\n this.setFormError(event, 'Invalid');\n return;\n }\n if (input === '') {\n const newTime = roundToNearest15Minutes().format('hh:mma');\n this.setTime(event, newTime);\n return;\n }\n if (!validateExactTimeFormat(input)) {\n const autocompletedTime = autocompleteTimeFormat(input);\n this.setTime(autocompletedTime);\n return;\n }\n this.setTime(event, input);\n }\n\n private handleOnInput(event: Event) {\n const input = (event.target as HTMLInputElement)?.value;\n if (!validateTimeFormatInput(input)) {\n return;\n }\n if (input === '') {\n const newTime = roundToNearest15Minutes().format('hh:mma');\n const optionIndex = this.times.findIndex(time => time.value === newTime);\n if (optionIndex > -1) {\n this.scrollToViewWithinParent(optionIndex);\n }\n return;\n }\n if (!validateExactTimeFormat(input)) {\n const autocompletedTime = autocompleteTimeFormat(input);\n const optionIndex = this.times.findIndex(time => time.value === autocompletedTime);\n if (optionIndex > -1) {\n this.scrollToViewWithinParent(optionIndex);\n }\n return;\n }\n }\n\n private generateTimes() {\n const times: Time[] = [];\n let startTime = dayjs().set('hour', 0).set('minute', 0).set('second', 0); // Set to 12:00 am\n if (this.minimumStartTime) {\n startTime = dayjs(this.minimumStartTime, 'hh:mma');\n }\n const diff = startTime.endOf('day').diff(startTime, 'minutes');\n const iterations = Math.round(diff / 15);\n for (let i = 0; i < iterations + 1; i++) {\n // 96 represents the total number of 15-minute increments in a day (24 hours * 60 minutes / 15 minutes)\n const time = startTime.add(i * 15, 'minute');\n if (i == iterations && time.format('hh:mma').includes('am')) {\n break;\n }\n times.push({ id: i, value: time.format('hh:mma') });\n }\n return times;\n }\n\n private handleComboboxKeyDown(event: KeyboardEvent): void {\n if (event.key === 'ArrowDown') {\n event.preventDefault();\n if (!this.showTimes) {\n this.showTimes = true;\n this.shouldAutoScroll = true;\n return;\n }\n if (this.ariaActivedescendant === '') {\n this.ariaActivedescendant = this.times[0].id.toString();\n this.focusOption(0);\n } else {\n const currentIndex = this.times.findIndex(time => time.id.toString() === this.ariaActivedescendant);\n const nextIndex = currentIndex + 1 < this.times.length ? currentIndex + 1 : 0;\n this.ariaActivedescendant = this.times[nextIndex].id.toString();\n this.focusOption(nextIndex);\n }\n } else if (event.key === 'ArrowUp') {\n event.preventDefault();\n if (this.ariaActivedescendant === '') {\n this.ariaActivedescendant = this.times[this.times.length - 1].id.toString();\n this.focusOption(this.times.length - 1);\n } else {\n const currentIndex = this.times.findIndex(time => time.id.toString() === this.ariaActivedescendant);\n const prevIndex = currentIndex - 1 >= 0 ? currentIndex - 1 : this.times.length - 1;\n this.ariaActivedescendant = this.times[prevIndex].id.toString();\n this.focusOption(prevIndex);\n }\n } else if (event.key === 'Escape') {\n this.showTimes = false;\n this.timeInput.focus();\n }\n }\n\n private handleListboxKeydown(e: KeyboardEvent) {\n const items = this.times;\n const currentIndex = items.findIndex(item => item.id.toString() === this.ariaActivedescendant);\n\n if (e.key === 'ArrowDown' || (e.key === 'Tab' && !e.shiftKey)) {\n e.preventDefault();\n const nextIndex = currentIndex + 1 < items.length ? currentIndex + 1 : 0;\n this.ariaActivedescendant = items[nextIndex].id.toString();\n this.focusOption(nextIndex);\n } else if (e.key === 'ArrowUp' || (e.key === 'Tab' && e.shiftKey)) {\n e.preventDefault();\n const prevIndex = currentIndex - 1 >= 0 ? currentIndex - 1 : items.length - 1;\n this.ariaActivedescendant = items[prevIndex].id.toString();\n this.focusOption(prevIndex);\n } else if (e.key === 'Enter') {\n e.preventDefault();\n if (this.ariaActivedescendant) {\n const option = items[currentIndex];\n this.handleTimeChange(e, option.value);\n this.showTimes = false;\n this.ariaActivedescendant = '';\n this.timeInput.focus();\n }\n } else if (e.key === 'Escape') {\n this.showTimes = false;\n this.timeInput.focus();\n }\n }\n\n scrollToViewWithinParent(optionIndex: number) {\n const option = this.times[optionIndex];\n const childElement = this.el.shadowRoot?.getElementById(option.id.toString()) as HTMLLIElement;\n const parentElement = this.timeMenu;\n\n this.ariaActivedescendant = option.id.toString();\n\n // Scroll child into view within parent\n const childRect = childElement.getBoundingClientRect();\n const parentRect = parentElement.getBoundingClientRect();\n\n if (childRect.top < parentRect.top) {\n // Child is above the visible area of the parent\n parentElement.scrollTop -= parentRect.top - childRect.top;\n } else if (childRect.bottom > parentRect.bottom) {\n // Child is below the visible area of the parent\n parentElement.scrollTop += childRect.bottom - parentRect.bottom;\n }\n\n if (childRect.left < parentRect.left) {\n // Child is to the left of the visible area of the parent\n parentElement.scrollLeft -= parentRect.left - childRect.left;\n } else if (childRect.right > parentRect.right) {\n // Child is to the right of the visible area of the parent\n parentElement.scrollLeft += childRect.right - parentRect.right;\n }\n }\n\n focusOption(index: number) {\n const option = this.times[index];\n if (!option) return; // Guard clause in case index is out of bounds\n\n const elementId = option.id.toString();\n const element = this.el.shadowRoot?.getElementById(elementId) as HTMLLIElement;\n\n if (element) {\n element.focus(); // Set focus on the element\n element.scrollIntoView({ behavior: 'smooth', block: 'nearest' });\n }\n }\n\n render() {\n return (\n <Host>\n <div class=\"time-picker\" part=\"time-picker\">\n <input\n type=\"text\"\n name={this.name}\n id={this.name}\n part=\"time-input\"\n class={{\n 'time-input': true,\n 'error': !!this.err || this.hasError,\n }}\n ref={el => (this.timeInput = el as HTMLInputElement)}\n value={this.time}\n onClick={() => {\n this.showTimes = true;\n this.shouldAutoScroll = true;\n }}\n aria-haspopup=\"listbox\"\n aria-label={this.name}\n aria-expanded={this.showTimes ? 'true' : 'false'}\n placeholder={this.placeholder}\n onKeyDown={e => this.handleComboboxKeyDown(e)}\n onInput={event => this.handleOnInput(event)}\n onBlur={event => this.handleTimeAutocomplete(event)}\n />\n {this.err && <div class=\"invalid-time-icon\">{/* Icon here */}</div>}\n {this.showTimes && (\n <div class=\"times\" part=\"times\" ref={el => (this.timeMenu = el as HTMLElement)}>\n <ul tabindex=\"-1\" role=\"listbox\" aria-label={this.name} aria-activedescendant={this.ariaActivedescendant} onKeyDown={e => this.handleListboxKeydown(e)}>\n {this.times.map(option => (\n <li\n tabindex=\"0\"\n key={option.id}\n id={option.id.toString()}\n class={{\n focused: this.ariaActivedescendant === option.id.toString(),\n }}\n onClick={e => {\n this.handleTimeChange(e, option.value);\n this.showTimes = false;\n this.timeInput.focus();\n }}\n role=\"option\"\n >\n {`${option.value}`}\n </li>\n ))}\n </ul>\n </div>\n )}\n {!this.showTimes && this.err && (\n <p class=\"error\" id=\"email-error\">\n {this.err}\n </p>\n )}\n </div>\n </Host>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"nylas-time-window-picker.js","sourceRoot":"","sources":["../../../../src/components/scheduler-edit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AAM,CAAC,EAAE,CAAC,CACxB,UACE,QAAQ,EAAC,GAAG,EACZ,GAAG,EAAE,MAAM,CAAC,EAAE,EACd,EAAE,EAAE,MAAM,CAAC,EAAE,CAAC,QAAQ,EAAE,EACxB,KAAK,EAAE;4BACL,OAAO,EAAE,IAAI,CAAC,oBAAoB,KAAK,MAAM,CAAC,EAAE,CAAC,QAAQ,EAAE;yBAC5D,EACD,OAAO,EAAE,CAAC,CAAC,EAAE;4BACX,IAAI,CAAC,gBAAgB,CAAC,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC;4BACvC,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;4BACvB,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC;wBACzB,CAAC,EACD,IAAI,EAAC,QAAQ,IAEZ,GAAG,MAAM,CAAC,KAAK,EAAE,CACf,CACN,CAAC,CACC,CACD,CACP;gBACA,CAAC,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,GAAG,IAAI,CAC9B,SAAG,KAAK,EAAC,OAAO,EAAC,EAAE,EAAC,aAAa,IAC9B,IAAI,CAAC,GAAG,CACP,CACL,CACG,CACD,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { autocompleteTimeFormat, roundToNearest15Minutes, validateExactTimeFormat, validateTimeFormatInput } from '@/utils/utils';\nimport { Component, h, State, Prop, Event, EventEmitter, Listen, Element, Host, Watch } from '@stencil/core';\nimport dayjs from 'dayjs';\nimport customParseFormat from 'dayjs/plugin/customParseFormat';\n\ndayjs.extend(customParseFormat);\n\ntype Time = { id: number; value: string };\n\n/**\n * The `nylas-time-window-picker` component is a time picker that can be used to select a time.\n * @part time-picker - The time picker container\n * @part time-input - The time input\n * @part times - The list of times\n */\n@Component({\n tag: 'nylas-time-window-picker',\n styleUrl: 'nylas-time-window-picker.scss',\n shadow: true,\n})\nexport class TimeInput {\n @Element() el!: HTMLElement;\n private timeInput!: HTMLInputElement;\n private timeMenu!: HTMLElement;\n\n /**\n * The time to display in the input.\n * This is passed by the parent component and can be updated\n * using the setTime prop function provided by the parent component.\n */\n @Prop() time!: string;\n /**\n * This is the start time value if one is set by the parent component.\n * It is useful if this component is used to render an end time which\n * should not be before the start time, defining the earliest selectable time.\n */\n @Prop() minimumStartTime: string | null = null;\n\n /**\n * The placeholder text for the input.\n */\n @Prop() placeholder: string = 'hh:mmam/pm';\n /**\n * The name of the input.\n */\n @Prop() name!: string;\n /**\n * This sets the error state of the input.\n */\n @Prop() hasError: boolean = false;\n\n /**\n * The error message to display if the time is invalid.\n */\n @State() err: string = '';\n /**\n * Toggle to show the list of times.\n */\n @State() showTimes: boolean = false;\n /**\n * The aria-activedescendant attribute for the listbox element to indicate the currently active\n * option in the list box to screen readers. The value of aria-activedescendant is the ID of\n * the active option.\n */\n @State() ariaActivedescendant: string = '';\n /**\n * The list of times to display in the dropdown.\n */\n @State() times: Time[] = this.generateTimes();\n /**\n * This is used to scroll to the selected time when the time is changed.\n */\n @State() shouldAutoScroll: boolean = false;\n\n /**\n * This event is fired when the time is changed.\n */\n @Event() timeChange!: EventEmitter<{\n key: string;\n value: string;\n }>;\n\n /**\n * This event is fired when the form has an error. The parent component\n * can listen for this event and display an error message or set form validity.\n */\n @Event() formError!: EventEmitter<{\n key: string;\n message: string;\n }>;\n\n // Event listeners\n @Listen('click', { target: 'document' })\n handleOutsideClick(event: MouseEvent) {\n // Get the path of the event\n const path = event.composedPath();\n\n // Check if the path includes the host element\n const isClickInside = path.includes(this.el);\n\n if (!isClickInside && this.showTimes) {\n this.showTimes = false;\n }\n }\n\n @Watch('minimumStartTime')\n minimumStartTimeChangedHandler() {\n if (this.minimumStartTime) {\n let formattedTime = dayjs()\n .hour(parseInt(this.minimumStartTime))\n .minute(parseInt(this.minimumStartTime.slice(-4, -2)));\n if (this.minimumStartTime.slice(-2).toLowerCase() === 'pm' && parseInt(this.minimumStartTime) !== 12) {\n formattedTime = formattedTime.add(12, 'hour');\n } else if (this.minimumStartTime.slice(-2).toLowerCase() === 'am' && parseInt(this.minimumStartTime) === 12) {\n formattedTime = formattedTime.subtract(12, 'hour');\n }\n\n this.times = this.generateTimes();\n const firstTime = dayjs(this.times[0].value, 'hh:mma');\n let selectedTimeFormatted = dayjs(this.time, 'hh:mma');\n if (selectedTimeFormatted.isBefore(firstTime)) {\n this.err = 'Invalid';\n this.formError.emit({\n key: this.el.id,\n message: 'Invalid',\n });\n }\n }\n }\n\n componentDidRender() {\n if (this.showTimes && this.shouldAutoScroll) {\n const autocompletedTime = autocompleteTimeFormat(this.time);\n const optionIndex = this.times.findIndex(time => time.value === autocompletedTime);\n if (optionIndex > -1) {\n this.shouldAutoScroll = false;\n this.scrollToViewWithinParent(optionIndex);\n }\n return;\n }\n }\n\n private handleTimeChange(_e: Event, input: string) {\n const timePart = input.split(':');\n if (timePart[0] === '00' && timePart[1].slice(-2) == 'pm') {\n this.err = 'Invalid';\n this.formError.emit({\n key: this.el.id,\n message: 'Invalid',\n });\n }\n if (!validateTimeFormatInput(input)) {\n this.err = 'Invalid';\n this.formError.emit({\n key: this.el.id,\n message: 'Invalid',\n });\n } else {\n this.err = '';\n this.formError.emit({\n key: this.el.id,\n message: '',\n });\n }\n this.timeChange.emit({\n key: this.el.id,\n value: input,\n });\n }\n\n private handleTimeAutocomplete(event: Event) {\n const input = (event.target as HTMLInputElement)?.value;\n if (!validateTimeFormatInput(input)) {\n this.err = 'Invalid';\n this.formError.emit({\n key: this.el.id,\n message: 'Invalid',\n });\n return;\n }\n if (input === '') {\n const newTime = roundToNearest15Minutes().format('hh:mma');\n this.timeChange.emit({\n key: this.el.id,\n value: newTime,\n });\n return;\n }\n if (!validateExactTimeFormat(input)) {\n const autocompletedTime = autocompleteTimeFormat(input);\n this.timeChange.emit({\n key: this.el.id,\n value: autocompletedTime,\n });\n return;\n }\n this.timeChange.emit({\n key: this.el.id,\n value: input,\n });\n }\n\n private handleOnInput(event: Event) {\n const input = (event.target as HTMLInputElement)?.value;\n if (!validateTimeFormatInput(input)) {\n return;\n }\n if (input === '') {\n const newTime = roundToNearest15Minutes().format('hh:mma');\n const optionIndex = this.times.findIndex(time => time.value === newTime);\n if (optionIndex > -1) {\n this.scrollToViewWithinParent(optionIndex);\n }\n return;\n }\n if (!validateExactTimeFormat(input)) {\n const autocompletedTime = autocompleteTimeFormat(input);\n const optionIndex = this.times.findIndex(time => time.value === autocompletedTime);\n if (optionIndex > -1) {\n this.scrollToViewWithinParent(optionIndex);\n }\n return;\n }\n }\n\n private generateTimes() {\n const times: Time[] = [];\n let startTime = dayjs().set('hour', 0).set('minute', 0).set('second', 0); // Set to 12:00 am\n if (this.minimumStartTime) {\n startTime = dayjs(this.minimumStartTime, 'hh:mma');\n }\n const diff = startTime.endOf('day').diff(startTime, 'minutes');\n const iterations = Math.round(diff / 15);\n for (let i = 0; i < iterations + 1; i++) {\n // 96 represents the total number of 15-minute increments in a day (24 hours * 60 minutes / 15 minutes)\n const time = startTime.add(i * 15, 'minute');\n if (i == iterations && time.format('hh:mma').includes('am')) {\n break;\n }\n times.push({ id: i, value: time.format('hh:mma') });\n }\n return times;\n }\n\n private handleComboboxKeyDown(event: KeyboardEvent): void {\n if (event.key === 'ArrowDown') {\n event.preventDefault();\n if (!this.showTimes) {\n this.showTimes = true;\n this.shouldAutoScroll = true;\n return;\n }\n if (this.ariaActivedescendant === '') {\n this.ariaActivedescendant = this.times[0].id.toString();\n this.focusOption(0);\n } else {\n const currentIndex = this.times.findIndex(time => time.id.toString() === this.ariaActivedescendant);\n const nextIndex = currentIndex + 1 < this.times.length ? currentIndex + 1 : 0;\n this.ariaActivedescendant = this.times[nextIndex].id.toString();\n this.focusOption(nextIndex);\n }\n } else if (event.key === 'ArrowUp') {\n event.preventDefault();\n if (this.ariaActivedescendant === '') {\n this.ariaActivedescendant = this.times[this.times.length - 1].id.toString();\n this.focusOption(this.times.length - 1);\n } else {\n const currentIndex = this.times.findIndex(time => time.id.toString() === this.ariaActivedescendant);\n const prevIndex = currentIndex - 1 >= 0 ? currentIndex - 1 : this.times.length - 1;\n this.ariaActivedescendant = this.times[prevIndex].id.toString();\n this.focusOption(prevIndex);\n }\n } else if (event.key === 'Escape') {\n this.showTimes = false;\n this.timeInput.focus();\n }\n }\n\n private handleListboxKeydown(e: KeyboardEvent) {\n const items = this.times;\n const currentIndex = items.findIndex(item => item.id.toString() === this.ariaActivedescendant);\n\n if (e.key === 'ArrowDown' || (e.key === 'Tab' && !e.shiftKey)) {\n e.preventDefault();\n const nextIndex = currentIndex + 1 < items.length ? currentIndex + 1 : 0;\n this.ariaActivedescendant = items[nextIndex].id.toString();\n this.focusOption(nextIndex);\n } else if (e.key === 'ArrowUp' || (e.key === 'Tab' && e.shiftKey)) {\n e.preventDefault();\n const prevIndex = currentIndex - 1 >= 0 ? currentIndex - 1 : items.length - 1;\n this.ariaActivedescendant = items[prevIndex].id.toString();\n this.focusOption(prevIndex);\n } else if (e.key === 'Enter') {\n e.preventDefault();\n if (this.ariaActivedescendant) {\n const option = items[currentIndex];\n this.handleTimeChange(e, option.value);\n this.showTimes = false;\n this.ariaActivedescendant = '';\n this.timeInput.focus();\n }\n } else if (e.key === 'Escape') {\n this.showTimes = false;\n this.timeInput.focus();\n }\n }\n\n scrollToViewWithinParent(optionIndex: number) {\n const option = this.times[optionIndex];\n const childElement = this.el.shadowRoot?.getElementById(option.id.toString()) as HTMLLIElement;\n const parentElement = this.timeMenu;\n\n this.ariaActivedescendant = option.id.toString();\n\n // Scroll child into view within parent\n const childRect = childElement.getBoundingClientRect();\n const parentRect = parentElement.getBoundingClientRect();\n\n if (childRect.top < parentRect.top) {\n // Child is above the visible area of the parent\n parentElement.scrollTop -= parentRect.top - childRect.top;\n } else if (childRect.bottom > parentRect.bottom) {\n // Child is below the visible area of the parent\n parentElement.scrollTop += childRect.bottom - parentRect.bottom;\n }\n\n if (childRect.left < parentRect.left) {\n // Child is to the left of the visible area of the parent\n parentElement.scrollLeft -= parentRect.left - childRect.left;\n } else if (childRect.right > parentRect.right) {\n // Child is to the right of the visible area of the parent\n parentElement.scrollLeft += childRect.right - parentRect.right;\n }\n }\n\n focusOption(index: number) {\n const option = this.times[index];\n if (!option) return; // Guard clause in case index is out of bounds\n\n const elementId = option.id.toString();\n const element = this.el.shadowRoot?.getElementById(elementId) as HTMLLIElement;\n\n if (element) {\n element.focus(); // Set focus on the element\n element.scrollIntoView({ behavior: 'smooth', block: 'nearest' });\n }\n }\n\n render() {\n return (\n <Host>\n <div class=\"time-picker\" part=\"time-picker\">\n <input\n type=\"text\"\n name={this.name}\n id={this.name}\n part=\"time-input\"\n class={{\n 'time-input': true,\n 'error': !!this.err || this.hasError,\n }}\n ref={el => (this.timeInput = el as HTMLInputElement)}\n value={this.time}\n onClick={() => {\n this.showTimes = true;\n this.shouldAutoScroll = true;\n }}\n aria-haspopup=\"listbox\"\n aria-label={this.name}\n aria-expanded={this.showTimes ? 'true' : 'false'}\n placeholder={this.placeholder}\n onKeyDown={e => this.handleComboboxKeyDown(e)}\n onInput={event => this.handleOnInput(event)}\n onBlur={event => this.handleTimeAutocomplete(event)}\n />\n {this.err && <div class=\"invalid-time-icon\">{/* Icon here */}</div>}\n {this.showTimes && (\n <div class=\"times\" part=\"times\" ref={el => (this.timeMenu = el as HTMLElement)}>\n <ul tabindex=\"-1\" role=\"listbox\" aria-label={this.name} aria-activedescendant={this.ariaActivedescendant} onKeyDown={e => this.handleListboxKeydown(e)}>\n {this.times.map(option => (\n <li\n tabindex=\"0\"\n key={option.id}\n id={option.id.toString()}\n class={{\n focused: this.ariaActivedescendant === option.id.toString(),\n }}\n onClick={e => {\n this.handleTimeChange(e, option.value);\n this.showTimes = false;\n this.timeInput.focus();\n }}\n role=\"option\"\n >\n {`${option.value}`}\n </li>\n ))}\n </ul>\n </div>\n )}\n {!this.showTimes && this.err && (\n <p class=\"error\" id=\"email-error\">\n {this.err}\n </p>\n )}\n </div>\n </Host>\n );\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"scheduler-config-store.js","sourceRoot":"","sources":["../../src/stores/scheduler-config-store.ts"],"names":[],"mappings":"AACA,OAAO,EAAiB,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAyC5D,MAAM,UAAU,+BAA+B,CAAC,eAAwD,EAAE;IACxG,MAAM,2BAA2B,GAAmC;QAClE,qBAAqB,EAAE,EAAE;QACzB,cAAc,EAAE,EAAE;QAClB,SAAS,EAAE,EAAE;QACb,WAAW,EAAE,IAAI;QACjB,MAAM,EAAE,IAAI;QACZ,GAAG,YAAY;KAChB,CAAC;IACF,MAAM,KAAK,GAAG,WAAW,CAAiC,2BAA2B,CAAC,CAAC;IAMvF,SAAS,0BAA0B;QACjC,KAAK,CAAC,GAAG,CAAC,uBAAuB,EAAE,EAAE,GAAG,YAAY,CAAC,uBAAuB,CAAC,EAAE,CAAC,CAAC;IACnF,CAAC;IAED,KAAK,CAAC,QAAQ,CAAC,QAAQ,EAAE,KAAK,EAAC,MAAM,EAAC,EAAE;QACtC,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,0BAA0B,EAAE,CAAC;QAC/B,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,OAAO;QACL,GAAG,KAAK;QACR,0BAA0B;KAC3B,CAAC;AACJ,CAAC","sourcesContent":["import { Calendar, Configuration } from '@nylas/core';\nimport { ObservableMap, createStore } from '@stencil/store';\nimport { User } from '@/common/nylas-api-request';\n\nexport interface NylasSchedulerConfigStoreState {\n /**\n * The selected configuration.\n * This is the configuration that is currently selected, use it to populate default values for new configurations.\n */\n selectedConfiguration: Partial<Configuration>;\n /**\n * The list of configurations.\n * This is the list of configurations that the user has created.\n */\n configurations: Configuration[];\n /**\n * The list of calendars.\n * This is the list of calendars that the user has access to.\n */\n calendars: Calendar[];\n /**\n * The current user.\n * This is the user that is currently logged in.\n */\n currentUser: User | null;\n /**\n * The current action.\n * This is the current action that the user is performing.\n */\n action: 'create' | 'edit' | null;\n}\n\nexport type NylasSchedulerConfigStoreType = ReturnType<typeof CreateNylasSchedulerConfigStore>;\n\nexport type CreateNylasSchedulerConfigStoreReturnType = ObservableMap<NylasSchedulerConfigStoreState> & {\n /**\n * Reset the selected configuration to the default state.\n * This is used to reset the selected configuration to the default state instead of setting it to an empty object.\n */\n resetSelectedConfiguration: () => void;\n};\n\nexport function CreateNylasSchedulerConfigStore(defaultState: Partial<NylasSchedulerConfigStoreState> = {}): CreateNylasSchedulerConfigStoreReturnType {\n const defaultSchedulerConfigState: NylasSchedulerConfigStoreState = {\n selectedConfiguration: {},\n configurations: [],\n calendars: [],\n currentUser: null,\n action: null,\n ...defaultState,\n };\n const store = createStore<NylasSchedulerConfigStoreState>(defaultSchedulerConfigState);\n\n /**\n * Reset the selected configuration to the default state.\n * This is used to reset the selected configuration to the default state instead of setting it to an empty object.\n */\n function resetSelectedConfiguration() {\n store.set('selectedConfiguration', { ...defaultState['selectedConfiguration'] });\n }\n\n store.onChange('action', async action => {\n if (!action) {\n resetSelectedConfiguration();\n }\n });\n\n return {\n ...store,\n resetSelectedConfiguration,\n };\n}\n"]}
1
+ {"version":3,"file":"scheduler-config-store.js","sourceRoot":"","sources":["../../src/stores/scheduler-config-store.ts"],"names":[],"mappings":"AACA,OAAO,EAAiB,WAAW,EAAE,MAAM,gBAAgB,CAAC;AA6C5D,MAAM,UAAU,+BAA+B,CAAC,eAAwD,EAAE;IACxG,MAAM,2BAA2B,GAAmC;QAClE,qBAAqB,EAAE,EAAE;QACzB,cAAc,EAAE,EAAE;QAClB,SAAS,EAAE,EAAE;QACb,WAAW,EAAE,IAAI;QACjB,MAAM,EAAE,IAAI;QACZ,GAAG,YAAY;KAChB,CAAC;IACF,MAAM,KAAK,GAAG,WAAW,CAAiC,2BAA2B,CAAC,CAAC;IAMvF,SAAS,0BAA0B;QACjC,KAAK,CAAC,GAAG,CAAC,uBAAuB,EAAE,EAAE,GAAG,YAAY,CAAC,uBAAuB,CAAC,EAAE,CAAC,CAAC;IACnF,CAAC;IAED,KAAK,CAAC,QAAQ,CAAC,QAAQ,EAAE,KAAK,EAAC,MAAM,EAAC,EAAE;QACtC,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,0BAA0B,EAAE,CAAC;QAC/B,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,OAAO;QACL,GAAG,KAAK;QACR,0BAA0B;KAC3B,CAAC;AACJ,CAAC","sourcesContent":["import { Calendar, Configuration } from '@nylas/core';\nimport { ObservableMap, createStore } from '@stencil/store';\nimport { User } from '@/common/nylas-api-request';\n\ntype RecursivePartial<T> = {\n [P in keyof T]?: T[P] extends (infer U)[] ? RecursivePartial<U>[] : T[P] extends object | undefined ? RecursivePartial<T[P]> : T[P];\n};\n\nexport interface NylasSchedulerConfigStoreState {\n /**\n * The selected configuration.\n * This is the configuration that is currently selected, use it to populate default values for new configurations.\n */\n selectedConfiguration: RecursivePartial<Configuration>;\n /**\n * The list of configurations.\n * This is the list of configurations that the user has created.\n */\n configurations: Configuration[];\n /**\n * The list of calendars.\n * This is the list of calendars that the user has access to.\n */\n calendars: Calendar[];\n /**\n * The current user.\n * This is the user that is currently logged in.\n */\n currentUser: User | null;\n /**\n * The current action.\n * This is the current action that the user is performing.\n */\n action: 'create' | 'edit' | null;\n}\n\nexport type NylasSchedulerConfigStoreType = ReturnType<typeof CreateNylasSchedulerConfigStore>;\n\nexport type CreateNylasSchedulerConfigStoreReturnType = ObservableMap<NylasSchedulerConfigStoreState> & {\n /**\n * Reset the selected configuration to the default state.\n * This is used to reset the selected configuration to the default state instead of setting it to an empty object.\n */\n resetSelectedConfiguration: () => void;\n};\n\nexport function CreateNylasSchedulerConfigStore(defaultState: Partial<NylasSchedulerConfigStoreState> = {}): CreateNylasSchedulerConfigStoreReturnType {\n const defaultSchedulerConfigState: NylasSchedulerConfigStoreState = {\n selectedConfiguration: {},\n configurations: [],\n calendars: [],\n currentUser: null,\n action: null,\n ...defaultState,\n };\n const store = createStore<NylasSchedulerConfigStoreState>(defaultSchedulerConfigState);\n\n /**\n * Reset the selected configuration to the default state.\n * This is used to reset the selected configuration to the default state instead of setting it to an empty object.\n */\n function resetSelectedConfiguration() {\n store.set('selectedConfiguration', { ...defaultState['selectedConfiguration'] });\n }\n\n store.onChange('action', async action => {\n if (!action) {\n resetSelectedConfiguration();\n }\n });\n\n return {\n ...store,\n resetSelectedConfiguration,\n };\n}\n"]}
@@ -0,0 +1,6 @@
1
+ export var BookingType;
2
+ (function (BookingType) {
3
+ BookingType["InstantBooking"] = "booking";
4
+ BookingType["PreBooking"] = "pre-booking";
5
+ })(BookingType || (BookingType = {}));
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAgFA,MAAM,CAAN,IAAY,WAGX;AAHD,WAAY,WAAW;IACrB,yCAA0B,CAAA;IAC1B,yCAA0B,CAAA;AAC5B,CAAC,EAHW,WAAW,KAAX,WAAW,QAGtB","sourcesContent":["export interface NylasResponse<Data = any> {\n request_id: string;\n data?: Data;\n error?: {\n message: string;\n type: string;\n };\n}\n\n// Avaliability\nexport interface OpenHours {\n days: number[];\n exDates: string[];\n timezone: string;\n start: string;\n end: string;\n}\n\nexport interface MeetingBuffer {\n before: number;\n after: number;\n}\n\nexport interface Rules {\n availability_method: 'max-fairness' | 'max-availability' | 'collective';\n buffer: MeetingBuffer;\n default_open_hours?: OpenHours[];\n round_robin_group_id: string;\n}\n\n// Scheduling\nexport interface Configuration {\n id: string;\n version: string;\n participants: Participant[];\n availability: Availability;\n event_booking: EventBooking;\n scheduler: Scheduler;\n}\n\nexport interface UpdateConfiguration extends Omit<Configuration, 'id'> {}\n\nexport interface Participant {\n name: string;\n email: string;\n is_organizer?: boolean;\n availability?: ParticipantAvailability;\n booking?: ParticipantBooking;\n}\n\nexport interface ParticipantAvailability {\n calendar_ids: string[];\n open_hours?: OpenHours[];\n}\n\nexport interface ParticipantBooking {\n calendar_id: string;\n}\n\nexport interface Availability {\n duration_minutes: number;\n interval_minutes?: number;\n round_to?: number;\n availability_rules?: Rules;\n}\n\nexport interface EventBooking {\n title: string;\n description?: string;\n location?: string;\n booking_type: BookingType;\n additional_fields?: { [key: string]: any };\n hide_participants: boolean;\n}\n\nexport interface Scheduler {\n available_days_in_future: number;\n min_cancellation_notice: number;\n}\n\nexport enum BookingType {\n InstantBooking = 'booking',\n PreBooking = 'pre-booking',\n}\n"]}
@@ -1 +1 @@
1
- {"file":"nylas-api-request.js","mappings":";;MA2CsB,eAAe;CAwBpC;MAOY,2BAA2B;IAqBtC,YAAY,OAAsB;QAN1B,oBAAe,GAAa,EAAE,CAAC;QAOrC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;KACxB;IAQD,gBAAgB,CAAC,OAAe;QAC9B,IAAI,CAAC,aAAa,GAAG,OAAO,CAAC;KAC9B;IAWD,MAAM,OAAO,CAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAoB;QAChE,IAAI;YACF,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,aAAa,IAAI,EAAE,EAAE;gBAC7D,MAAM;gBACN,OAAO,EAAE,OAAO,GAAG,IAAI,OAAO,CAAC,OAAO,CAAC,GAAG,SAAS;gBACnD,IAAI;gBACJ,IAAI,IAAI,CAAC,OAAO,CAAC,cAAc,EAAE,IAAI,IAAI,CAAC,aAAa,GAAG,EAAE,QAAQ,EAAE,IAAI,CAAC,aAAa,EAAE,GAAG,EAAE,CAAC;aACjG,CAAC,CAAC;YAIH,IAAI,OAAO,QAAQ,KAAK,WAAW,EAAE;gBACnC,MAAM,IAAI,KAAK,CAAC,uBAAuB,CAAC,CAAC;aAC1C;YAED,OAAO,YAAY,CAAC,QAAa,CAAC,CAAC;SACpC;QAAC,OAAO,KAAK,EAAE;YACd,OAAO,YAAY,CAAC,IAAS,EAAE;gBAC7B,OAAO,EAAE,MAAM,CAAC,KAAK,CAAC;aACvB,CAAC,CAAC;SACJ;KACF;IAOD,MAAM,WAAW;QACf,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,cAAc,EAAE,GAAG,IAAI,CAAC,aAAa,GAAG,SAAS,CAAC;QAC/E,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;QACvD,IAAI,CAAC,OAAO,EAAE;YACZ,OAAO,IAAI,CAAC;SACb;QAED,OAAO;YACL,EAAE,EAAE,OAAO,CAAC,GAAG;YACf,KAAK,EAAE,OAAO,CAAC,KAAK;YACpB,IAAI,EAAE,OAAO,CAAC,IAAI;SACnB,CAAC;KACH;IAOD,MAAM,iBAAiB,CAAC,QAAmB;QACzC,IAAI,IAAI,GAAG,IAAI,CAAC,eAAe,IAAI,EAAE,CAAC;QACtC,IAAI,QAAQ,EAAE;YACZ,IAAI,GAAG,EAAE,GAAG,IAAI,EAAE,GAAG,QAAQ,EAAE,CAAC;SACjC;QACD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;KAChC;IAMD,kBAAkB,CAAC,QAAkB;QACnC,IAAI,CAAC,eAAe,GAAG,QAAQ,CAAC;KACjC;;;;;","names":[],"sources":["src/common/nylas-api-request.ts"],"sourcesContent":["import { dataResponse } from '@/utils/utils';\nimport type { NylasSessions } from '@nylas/identity';\nimport { DataResponseReturnType } from './types';\n\n/**\n * Arguments for making a request to the Nylas API.\n */\nexport type NylasRequestArgs = {\n method: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH';\n path: string;\n body?: any;\n headers?: Record<string, string>;\n};\n\n/**\n * A model representing a user in the Nylas Identity system.\n */\nexport type User = {\n id: string;\n email: string;\n name?: string;\n};\n\n/**\n * Arguments for authenticating a user with the Nylas Identity system.\n */\nexport type AuthArgs = {\n provider?: string;\n scope?: Array<string>;\n loginHint?: string;\n includeGrantScopes?: boolean;\n prompt?: string;\n metadata?: string;\n state?: string;\n};\n\n/**\n * Interface for making requests to the Nylas API.\n *\n * This is an abstract class that is meant to be implemented by customers to provide their own\n * implementation of making requests to the Nylas API. This allows customers to use their own\n * authentication mechanism, or to use a different HTTP client library.\n */\nexport abstract class NylasApiRequest {\n /**\n * This method should make an authenticated request to the Nylas API.\n * Note: It should not throw an error if the request fails, but should return an object with the error\n * information as part of the tuple returned.\n * @param args NylasRequestArgs\n */\n abstract request<T = any>(args: NylasRequestArgs): Promise<DataResponseReturnType<T>>;\n\n /**\n * This method should return the current user's information.\n */\n\n abstract currentUser(): Promise<User | null>;\n\n /**\n * This method should set the default authentication arguments to use when authenticating the user.\n */\n abstract setDefaultAuthArgs(authArgs: AuthArgs): void;\n\n /**\n * This method should return the URL to redirect the user to for authentication.\n */\n abstract authenticationUrl(authArgs?: AuthArgs): Promise<string | undefined>;\n}\n\n/**\n * A wrapper around the Nylas Identity session that implements the NylasApiRequest interface.\n * This class is used by the Nylas Web Elements to make requests to the Nylas API if no custom\n * implementation of NylasApiRequest is provided.\n */\nexport class NylasIdentityRequestWrapper implements NylasApiRequest {\n /**\n * The Nylas Identity session instance.\n */\n private session: NylasSessions;\n\n /**\n * The grant_id to use for requests, if there is multi-account support\n * enabled in the Nylas Identity settings.\n */\n private activeGrantId?: string;\n\n /**\n * The default authentication arguments to use when authenticating the user.\n */\n private defaultAuthArgs: AuthArgs = {};\n\n /**\n * Constructor for the NylasIdentityRequestWrapper class.\n * @param session The Nylas Identity session instance.\n */\n constructor(session: NylasSessions) {\n this.session = session;\n }\n\n /**\n * This method sets the grant_id to use for requests.\n * This is used when there is multi-account support enabled in the Nylas Identity settings.\n *\n * @param grantId\n */\n setActiveGrantId(grantId: string) {\n this.activeGrantId = grantId;\n }\n\n /**\n * This method makes a request to the Nylas API, using the Nylas Identity's fetch method.\n *\n * The `grants/me/` prefix is added because all requests made from the browser to the Nylas API\n * must be made on behalf of the currently logged in user with a valid access token.\n *\n * @param NylasRequestArgs\n * @returns Promise<[T | null, NylasErrorResponse['error'] | null]>\n */\n async request<T>({ method, path, body, headers }: NylasRequestArgs): Promise<DataResponseReturnType<T>> {\n try {\n const response = await this.session.fetch(`grants/me/${path}`, {\n method,\n headers: headers ? new Headers(headers) : undefined,\n body,\n ...(this.session.isMultiAccount() && this.activeGrantId ? { grant_id: this.activeGrantId } : {}),\n });\n\n // Sometimes the Nylas identity session fetch method returns undefined.\n // Possibly due to CORS issues. In this case, we throw an error.\n if (typeof response === 'undefined') {\n throw new Error('Response is undefined');\n }\n\n return dataResponse(response as T);\n } catch (error) {\n return dataResponse(null as T, {\n message: String(error),\n });\n }\n }\n\n /**\n * This method returns the current (logged in) user's information.\n * If the user is not logged in, it returns null.\n * @returns Promise<User | null>\n */\n async currentUser(): Promise<User | null> {\n const grantId = this.session.isMultiAccount() ? this.activeGrantId : undefined;\n const idToken = await this.session.getProfile(grantId);\n if (!idToken) {\n return null;\n }\n\n return {\n id: idToken.sub,\n email: idToken.email,\n name: idToken.name,\n };\n }\n\n /**\n * This method returns the URL to redirect the user to for authentication.\n * @param authConfig authArgs\n * @returns Promise<string | undefined>\n */\n async authenticationUrl(authArgs?: AuthArgs): Promise<string | undefined> {\n let args = this.defaultAuthArgs || {};\n if (authArgs) {\n args = { ...args, ...authArgs };\n }\n return this.session.auth(args);\n }\n\n /**\n * This method sets the default authentication arguments to use when authenticating the user.\n * @param authArgs authArgs\n */\n setDefaultAuthArgs(authArgs: AuthArgs) {\n this.defaultAuthArgs = authArgs;\n }\n}\n"],"version":3}
1
+ {"file":"nylas-api-request.js","mappings":";;MAuDsB,eAAe;CAwBpC;MAOY,2BAA2B;IAqBtC,YAAY,OAAsB;QAN1B,oBAAe,GAAa,EAAE,CAAC;QAOrC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;KACxB;IAQD,gBAAgB,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,GAAG,IAAI,CAAC,eAAe,IAAI,EAAE,CAAC;QACtC,IAAI,QAAQ,EAAE;YACZ,IAAI,GAAG,EAAE,GAAG,IAAI,EAAE,GAAG,QAAQ,EAAE,CAAC;SACjC;QACD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;KAChC;IAMD,kBAAkB,CAAC,QAAkB;QACnC,IAAI,CAAC,eAAe,GAAG,QAAQ,CAAC;KACjC;;;;;","names":[],"sources":["src/common/nylas-api-request.ts"],"sourcesContent":["import { dataResponse } from '@/utils/utils';\nimport type { NylasSessions } from '@nylas/identity';\nimport { DataResponseReturnType } from './types';\n\n/**\n * Arguments for making a request to the Nylas API.\n */\nexport type NylasRequestArgs = {\n method: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH';\n path: string;\n body?: any;\n headers?: Record<string, string>;\n};\n\n/**\n * A model representing a user in the Nylas Identity system.\n */\nexport type User = {\n id: string;\n email: string;\n name?: string;\n};\n\n/**\n * Arguments for authenticating a user with the Nylas Identity system.\n */\nexport type AuthArgs = {\n /**\n * The provider of the user's email address.\n */\n provider?: string;\n /**\n * A list of permission scopes for the provider.\n */\n scope?: Array<string>;\n /**\n * The login hint associated with the user.\n */\n loginHint?: string;\n /**\n * Whether to include grant scopes in the auth exchange.\n */\n includeGrantScopes?: boolean;\n prompt?: string;\n metadata?: string;\n state?: string;\n};\n\n/**\n * Interface for making requests to the Nylas API.\n *\n * This is an abstract class that is meant to be implemented by customers to provide their own\n * implementation of making requests to the Nylas API. This allows customers to use their own\n * authentication mechanism, or to use a different HTTP client library.\n */\nexport abstract class NylasApiRequest {\n /**\n * This method should make an authenticated request to the Nylas API.\n * Note: It should not throw an error if the request fails, but should return an object with the error\n * information as part of the tuple returned.\n * @param args NylasRequestArgs\n */\n abstract request<T = any>(args: NylasRequestArgs): Promise<DataResponseReturnType<T>>;\n\n /**\n * This method should return the current user's information.\n */\n\n abstract currentUser(): Promise<User | null>;\n\n /**\n * This method should set the default authentication arguments to use when authenticating the user.\n */\n abstract setDefaultAuthArgs(authArgs: AuthArgs): void;\n\n /**\n * This method should return the URL to redirect the user to for authentication.\n */\n abstract authenticationUrl(authArgs?: AuthArgs): Promise<string | undefined>;\n}\n\n/**\n * A wrapper around the Nylas Identity session that implements the NylasApiRequest interface.\n * This class is used by the Nylas Web Elements to make requests to the Nylas API if no custom\n * implementation of NylasApiRequest is provided.\n */\nexport class NylasIdentityRequestWrapper implements NylasApiRequest {\n /**\n * The Nylas Identity session instance.\n */\n private session: NylasSessions;\n\n /**\n * The grant_id to use for requests, if there is multi-account support\n * enabled in the Nylas Identity settings.\n */\n private activeGrantId?: string;\n\n /**\n * The default authentication arguments to use when authenticating the user.\n */\n private defaultAuthArgs: AuthArgs = {};\n\n /**\n * Constructor for the NylasIdentityRequestWrapper class.\n * @param session The Nylas Identity session instance.\n */\n constructor(session: NylasSessions) {\n this.session = session;\n }\n\n /**\n * This method sets the grant_id to use for requests.\n * This is used when there is multi-account support enabled in the Nylas Identity settings.\n *\n * @param grantId\n */\n setActiveGrantId(grantId: string) {\n this.activeGrantId = grantId;\n }\n\n /**\n * This method makes a request to the Nylas API, using the Nylas Identity's fetch method.\n *\n * The `grants/me/` prefix is added because all requests made from the browser to the Nylas API\n * must be made on behalf of the currently logged in user with a valid access token.\n *\n * @param NylasRequestArgs\n * @returns Promise<[T | null, NylasErrorResponse['error'] | null]>\n */\n async request<T>({ method, path, body, headers }: NylasRequestArgs): Promise<DataResponseReturnType<T>> {\n try {\n const response = await this.session.fetch(`grants/me/${path}`, {\n method,\n headers: headers ? new Headers(headers) : undefined,\n body,\n ...(this.session.isMultiAccount() && this.activeGrantId ? { grant_id: this.activeGrantId } : {}),\n });\n\n // Sometimes the Nylas identity session fetch method returns undefined.\n // Possibly due to CORS issues. In this case, we throw an error.\n if (typeof response === 'undefined') {\n throw new Error('Response is undefined');\n }\n\n return dataResponse(response as T);\n } catch (error) {\n return dataResponse(null as T, {\n message: String(error),\n });\n }\n }\n\n /**\n * This method returns the current (logged in) user's information.\n * If the user is not logged in, it returns null.\n * @returns Promise<User | null>\n */\n async currentUser(): Promise<User | null> {\n const grantId = this.session.isMultiAccount() ? this.activeGrantId : undefined;\n const idToken = await this.session.getProfile(grantId);\n if (!idToken) {\n return null;\n }\n\n return {\n id: idToken.sub,\n email: idToken.email,\n name: idToken.name,\n };\n }\n\n /**\n * This method returns the URL to redirect the user to for authentication.\n * @param authConfig authArgs\n * @returns Promise<string | undefined>\n */\n async authenticationUrl(authArgs?: AuthArgs): Promise<string | undefined> {\n let args = this.defaultAuthArgs || {};\n if (authArgs) {\n args = { ...args, ...authArgs };\n }\n return this.session.auth(args);\n }\n\n /**\n * This method sets the default authentication arguments to use when authenticating the user.\n * @param authArgs authArgs\n */\n setDefaultAuthArgs(authArgs: AuthArgs) {\n this.defaultAuthArgs = authArgs;\n }\n}\n"],"version":3}
@@ -56,9 +56,9 @@ const NylasAvailabilityPicker = proxyCustomElement(class NylasAvailabilityPicker
56
56
  this.host.setAttribute('name', newValue);
57
57
  }
58
58
  configChangedHandler(newConfig) {
59
- const organizerParticipant = newConfig?.participants?.find(p => p.is_organizer);
60
- if (organizerParticipant && organizerParticipant?.availability?.open_hours) {
61
- this.openHoursToSchedule(organizerParticipant?.availability?.open_hours);
59
+ const organizer = newConfig?.participants?.find(p => p.is_organizer);
60
+ if (organizer && organizer?.availability?.open_hours) {
61
+ this.openHoursToSchedule(organizer?.availability?.open_hours);
62
62
  }
63
63
  }
64
64
  scheduleChanged(newValue, oldValue) {
@@ -207,7 +207,13 @@ const NylasAvailabilityPicker = proxyCustomElement(class NylasAvailabilityPicker
207
207
  this.schedule[day].splice(index, 1);
208
208
  this.schedule = { ...this.schedule };
209
209
  }
210
- setTime(key, _event, value) {
210
+ setTime(event) {
211
+ console.log('timeChanged', event);
212
+ const { key, value } = event.detail;
213
+ console.log({
214
+ key,
215
+ value,
216
+ });
211
217
  const [dayIndex, timeType] = key.split('_');
212
218
  const [day, index] = dayIndex.split(':');
213
219
  if (timeType === 'start') {
@@ -219,7 +225,8 @@ const NylasAvailabilityPicker = proxyCustomElement(class NylasAvailabilityPicker
219
225
  this.internals.setValidity({ customError: false });
220
226
  this.schedule = { ...this.schedule };
221
227
  }
222
- setFormError(key, _event, _errorMessage) {
228
+ setFormError(event) {
229
+ const { key } = event.detail;
223
230
  const [_, timeType] = key.split('_');
224
231
  const element = this.host.shadowRoot?.getElementById(key);
225
232
  if (element) {
@@ -301,7 +308,7 @@ const NylasAvailabilityPicker = proxyCustomElement(class NylasAvailabilityPicker
301
308
  label: TIMEZONE_MAP[key],
302
309
  value: key,
303
310
  }));
304
- return (h(Host, { key: 'ba1266dfd7debd6f7efa1f5ddc48052806e8f594' }, h("div", { key: '34a52a728438348052f5159d347ff43071742bd4', class: "nylas-availability-picker" }, h("div", { key: '3a5e39e6e3d3ceaef4ce85fba1d2b1e5e7a52cda', class: "header", part: "nap__header" }, h("h3", { key: '4aad60a39b816631b0c9cb89741ceca1da22e05b' }, "General availability"), h("p", { key: '71755be3b152af545828336c3601c24434f764b4' }, "Set your availability for scheduling meetings.")), h("div", { key: 'db86358f996a6b7f75572f65ad469c1c80dee5a2', class: "content" }, h("div", { key: '63a90d8094f600815e2b7e8a13c9cbd25a8a14c1', class: "select-timezone", part: "nap__select-timezone" }, h("h4", { key: '612b2808fe828cf8867c98ea0f80f5a3b3a5ab52', class: "sub-header" }, "Select timezone", h("span", { key: '467c6940b46b12101074211216c920d4c7db40af', class: "icon" }, h("tooltip-component", { key: '8f98c2efd0ebe318854857bcb5a0d56794f5d454' }, h("info-icon", { key: 'e35b77bdd317ff9f25e0c1157acfe734ea81541f', slot: "tooltip-icon" }), h("span", { key: '4fb700e4030ae345e872f2da8352ca00078b57a6', slot: "tooltip-content" }, "Select your timezone for displaying availability.")))), h("select-dropdown", { key: '78270f32b150107baf43fbd7b2a882221ecf33f6', name: "timezone", exportparts: "sd_dropdown: nap__timezone-container, sd_dropdown-button: nap__timezone-button, sd_dropdown-content: nap__timezone-dropdown-content", options: timezoneOptions, defaultSelectedOption: timezoneOptions.find(i => i.value === this.defaultTimezone) }, h("span", { key: '8c76fd5d2396e75a07a2b922d9b44a27a6b4baf0', slot: "select-icon" }, h("globe-icon", { key: '885b683dd6496ed199d576d6a8139609b04ad661', width: "20", height: "20" })))), h("div", { key: 'e6541508d6d99ab9ba7b752c5eb14be33bd517d9', class: "availability", part: "nap__availability" }, Object.keys(this.schedule).map(key => {
311
+ return (h(Host, { key: 'ebdf308b5d2e38cbbe9c01915a8704cdc137b56f' }, h("div", { key: '81557accec232465b3e86d5d0bdc1ae25aa8d6de', class: "nylas-availability-picker" }, h("div", { key: 'f5c2a5ef92fc59568672b536a9e604547561b8d6', class: "header", part: "nap__header" }, h("h3", { key: 'cbccae32847e68a5fe47f9f1f901e55546621c36' }, "General availability"), h("p", { key: '34600ddd459b5d681574458f4f4acdb5ed26f7ac' }, "Set your availability for scheduling meetings.")), h("div", { key: '65785316b94376cf4d79de9c875e39060226ca31', class: "content" }, h("div", { key: '5c30c0bd916460f668dc3f881b4b01a1792e59b0', class: "select-timezone", part: "nap__select-timezone" }, h("h4", { key: '0638898cae070a5d9eae8cd1dca83e39e5bb735f', class: "sub-header" }, "Select timezone", h("span", { key: 'd6746b3329ba92bf5c759895444d08924ba7769c', class: "icon" }, h("tooltip-component", { key: '76dbc460bd91fa0f33a65c65ce092ad966ce6535' }, h("info-icon", { key: '5778fb41c006172a125a4430186ad85d4cdbaf3c', slot: "tooltip-icon" }), h("span", { key: '76132f33db5dce9d7d7e5e111065ad9d1ec64d3f', slot: "tooltip-content" }, "Select your timezone for displaying availability.")))), h("select-dropdown", { key: '9a0a3702b4868109ccc8f77e1143727de1e3f1fa', name: "timezone", exportparts: "sd_dropdown: nap__timezone-container, sd_dropdown-button: nap__timezone-button, sd_dropdown-content: nap__timezone-dropdown-content", options: timezoneOptions, defaultSelectedOption: timezoneOptions.find(i => i.value === this.defaultTimezone) }, h("span", { key: 'ed0756090602c8a52ffdae493f09cfa7d61dd1e9', slot: "select-icon" }, h("globe-icon", { key: '6e5e5234210ba8cc50ef57338a2f4e926521cb70', width: "20", height: "20" })))), h("div", { key: 'eac4322bf2aa8f5ea84e4d7ccee293803c70b2ac', class: "availability", part: "nap__availability" }, Object.keys(this.schedule).map(key => {
305
312
  const day = key;
306
313
  const timeRanges = this.schedule[key];
307
314
  return (h("div", { class: "availability-day" }, h("div", { class: "day", part: "nap__day" }, h("input", { type: "checkbox", name: day, id: day, checked: timeRanges.length > 0, onClick: () => {
@@ -316,7 +323,7 @@ const NylasAvailabilityPicker = proxyCustomElement(class NylasAvailabilityPicker
316
323
  timeRanges.map((timeRange, timeRangeIndex) => {
317
324
  const startKey = `${key}:${timeRangeIndex}_start`;
318
325
  const endKey = `${key}:${timeRangeIndex}_end`;
319
- return (h("div", { class: "time-range", part: "nap__time-range" }, h("div", { class: "pickers" }, h("nylas-time-window-picker", { id: startKey, hasError: this.overlapDays[day]?.includes(timeRangeIndex), time: timeRange.start, name: startKey, key: startKey, exportparts: "time-picker: nap__time-picker-container, time-input: nap__time-picker-input, times: nap__time-picker-times", setTime: (event, additionalData) => this.setTime(startKey, event, additionalData), setFormError: (event, additionalData) => this.setFormError(startKey, event, additionalData) }), h("span", null, " - "), h("nylas-time-window-picker", { id: endKey, hasError: this.overlapDays[day]?.includes(timeRangeIndex), time: timeRange.end, name: endKey, key: endKey, minimumStartTime: timeRange.start, exportparts: "time-picker: nap__time-picker-container, time-input: nap__time-picker-input, times: nap__time-picker-times", setTime: (event, additionalData) => this.setTime(endKey, event, additionalData), setFormError: (event, additionalData) => this.setFormError(endKey, event, additionalData) })), h("button", { onClick: () => this.removeTimeRange(day, timeRangeIndex) }, h("close-icon", null))));
326
+ return (h("div", { class: "time-range", part: "nap__time-range" }, h("div", { class: "pickers" }, h("nylas-time-window-picker", { id: startKey, hasError: this.overlapDays[day]?.includes(timeRangeIndex), time: timeRange.start, name: startKey, key: startKey, exportparts: "time-picker: nap__time-picker-container, time-input: nap__time-picker-input, times: nap__time-picker-times" }), h("span", null, " - "), h("nylas-time-window-picker", { id: endKey, hasError: this.overlapDays[day]?.includes(timeRangeIndex), time: timeRange.end, name: endKey, key: endKey, minimumStartTime: timeRange.start, exportparts: "time-picker: nap__time-picker-container, time-input: nap__time-picker-input, times: nap__time-picker-times" })), h("button", { onClick: () => this.removeTimeRange(day, timeRangeIndex) }, h("close-icon", null))));
320
327
  }), h("p", { class: "error" }, this.overlapDays[day] ? 'Overlapping time ranges' : '')), h("div", null, timeRanges.length > 0 ? (h("button", { onClick: () => this.addTimeRange(day), part: "nap__add-time-range" }, h("add-circle-icon", null))) : null)));
321
328
  }))))));
322
329
  }
@@ -336,7 +343,7 @@ const NylasAvailabilityPicker = proxyCustomElement(class NylasAvailabilityPicker
336
343
  "schedule": [32],
337
344
  "timezone": [32],
338
345
  "overlapDays": [32]
339
- }, [[0, "selectedOptionChanged", "selectedOptionChangedHandler"]], {
346
+ }, [[0, "selectedOptionChanged", "selectedOptionChangedHandler"], [0, "timeChange", "setTime"], [0, "formError", "setFormError"]], {
340
347
  "name": ["elementNameChangedHandler"],
341
348
  "selectedConfiguration": ["configChangedHandler"],
342
349
  "schedule": ["scheduleChanged"]