@nylas/web-elements 2.0.1 → 2.0.3

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 (241) hide show
  1. package/dist/cdn/nylas-scheduler-editor/nylas-scheduler-editor.es.js +191 -95
  2. package/dist/cdn/nylas-scheduling/nylas-scheduling.es.js +10418 -10260
  3. package/dist/cjs/{abstract-provider-ca4f7e4f.js → abstract-provider-f84a6735.js} +2 -2
  4. package/dist/cjs/{abstract-provider-ca4f7e4f.js.map → abstract-provider-f84a6735.js.map} +1 -1
  5. package/dist/cjs/app-globals-ee500b74.js.map +1 -1
  6. package/dist/cjs/calendar-agenda-fill-icon_36.cjs.entry.js +36 -21
  7. package/dist/cjs/calendar-agenda-fill-icon_36.cjs.entry.js.map +1 -1
  8. package/dist/cjs/{calendar-check-icon_2.cjs.entry.js → calendar-check-icon.cjs.entry.js} +3 -19
  9. package/dist/cjs/calendar-check-icon.cjs.entry.js.map +1 -0
  10. package/dist/cjs/checkbox-component_2.cjs.entry.js +1 -1
  11. package/dist/cjs/checkbox-group_4.cjs.entry.js +3 -3
  12. package/dist/cjs/checkmark-circle-icon.cjs.entry.js +24 -0
  13. package/dist/cjs/checkmark-circle-icon.cjs.entry.js.map +1 -0
  14. package/dist/cjs/checkmark-icon_15.cjs.entry.js +11 -7
  15. package/dist/cjs/checkmark-icon_15.cjs.entry.js.map +1 -1
  16. package/dist/cjs/{customParseFormat-bb3a23c5.js → customParseFormat-95790293.js} +2 -2
  17. package/dist/cjs/{customParseFormat-bb3a23c5.js.map → customParseFormat-95790293.js.map} +1 -1
  18. package/dist/cjs/{feedbackSync-1c5ec9aa.js → feedbackSync-4ed99749.js} +2 -2
  19. package/dist/cjs/{feedbackSync-1c5ec9aa.js.map → feedbackSync-4ed99749.js.map} +1 -1
  20. package/dist/cjs/globe-icon_2.cjs.entry.js +2 -2
  21. package/dist/cjs/google-logo-icon_6.cjs.entry.js +8 -8
  22. package/dist/cjs/index-e07e3a7e.js +6 -2
  23. package/dist/cjs/index.cjs.js +2 -2
  24. package/dist/cjs/{index.es-c563f3ba.js → index.es-62161daa.js} +2 -2
  25. package/dist/cjs/{index.es-c563f3ba.js.map → index.es-62161daa.js.map} +1 -1
  26. package/dist/cjs/input-component.cjs.entry.js +1 -1
  27. package/dist/cjs/input-dropdown_2.cjs.entry.js +1 -1
  28. package/dist/cjs/loader.cjs.js +1 -1
  29. package/dist/cjs/multi-select-dropdown.cjs.entry.js +1 -1
  30. package/dist/cjs/{nylas-api-request-4d148ff1.js → nylas-api-request-03d7f604.js} +2 -2
  31. package/dist/cjs/{nylas-api-request-4d148ff1.js.map → nylas-api-request-03d7f604.js.map} +1 -1
  32. package/dist/cjs/nylas-booked-event-card_11.cjs.entry.js +82 -25
  33. package/dist/cjs/nylas-booked-event-card_11.cjs.entry.js.map +1 -1
  34. package/dist/cjs/nylas-form-card.cjs.entry.js +2 -2
  35. package/dist/cjs/nylas-notification_2.cjs.entry.js +1 -1
  36. package/dist/cjs/nylas-scheduler-editor.cjs.entry.js +6 -6
  37. package/dist/cjs/nylas-scheduling.cjs.entry.js +42 -14
  38. package/dist/cjs/nylas-scheduling.cjs.entry.js.map +1 -1
  39. package/dist/cjs/nylas-web-elements.cjs.js +1 -1
  40. package/dist/cjs/{register-component-70744713.js → register-component-f4ad9751.js} +2 -2
  41. package/dist/cjs/{register-component-70744713.js.map → register-component-f4ad9751.js.map} +1 -1
  42. package/dist/cjs/textarea-component.cjs.entry.js +1 -1
  43. package/dist/cjs/{utils-dd3b6f4c.js → utils-03b13826.js} +154 -55
  44. package/dist/cjs/utils-03b13826.js.map +1 -0
  45. package/dist/collection/components/scheduler/nylas-booked-event-card/nylas-booked-event-card.js +11 -3
  46. package/dist/collection/components/scheduler/nylas-booked-event-card/nylas-booked-event-card.js.map +1 -1
  47. package/dist/collection/components/scheduler/nylas-booking-form/nylas-booking-form.js +49 -4
  48. package/dist/collection/components/scheduler/nylas-booking-form/nylas-booking-form.js.map +1 -1
  49. package/dist/collection/components/scheduler/nylas-booking-form/test/nylas-booking-form.spec.js +3 -3
  50. package/dist/collection/components/scheduler/nylas-booking-form/test/nylas-booking-form.spec.js.map +1 -1
  51. package/dist/collection/components/scheduler/nylas-cancel-booking-form/nylas-cancel-booking-form.js +37 -1
  52. package/dist/collection/components/scheduler/nylas-cancel-booking-form/nylas-cancel-booking-form.js.map +1 -1
  53. package/dist/collection/components/scheduler/nylas-cancelled-event-card/nylas-cancelled-event-card.js +34 -2
  54. package/dist/collection/components/scheduler/nylas-cancelled-event-card/nylas-cancelled-event-card.js.map +1 -1
  55. package/dist/collection/components/scheduler/nylas-confirmed-event-card/nylas-confirmed-event-card.css +1 -1
  56. package/dist/collection/components/scheduler/nylas-confirmed-event-card/nylas-confirmed-event-card.js +34 -1
  57. package/dist/collection/components/scheduler/nylas-confirmed-event-card/nylas-confirmed-event-card.js.map +1 -1
  58. package/dist/collection/components/scheduler/nylas-date-picker/nylas-date-picker.js +10 -4
  59. package/dist/collection/components/scheduler/nylas-date-picker/nylas-date-picker.js.map +1 -1
  60. package/dist/collection/components/scheduler/nylas-organizer-confirmation-card/nylas-organizer-confirmation-card.js +10 -2
  61. package/dist/collection/components/scheduler/nylas-organizer-confirmation-card/nylas-organizer-confirmation-card.js.map +1 -1
  62. package/dist/collection/components/scheduler/nylas-scheduling/nylas-scheduling.css +13 -0
  63. package/dist/collection/components/scheduler/nylas-scheduling/nylas-scheduling.js +66 -7
  64. package/dist/collection/components/scheduler/nylas-scheduling/nylas-scheduling.js.map +1 -1
  65. package/dist/collection/components/scheduler/nylas-scheduling/test/nylas-scheduling.spec.js +33 -0
  66. package/dist/collection/components/scheduler/nylas-scheduling/test/nylas-scheduling.spec.js.map +1 -1
  67. package/dist/collection/components/scheduler/nylas-selected-event-card/nylas-selected-event-card.js +20 -5
  68. package/dist/collection/components/scheduler/nylas-selected-event-card/nylas-selected-event-card.js.map +1 -1
  69. package/dist/collection/components/scheduler/nylas-timeslot-picker/nylas-timeslot-picker.js.map +1 -1
  70. package/dist/collection/components/scheduler-editor/nylas-additional-participants/nylas-additional-participants.js +12 -6
  71. package/dist/collection/components/scheduler-editor/nylas-additional-participants/nylas-additional-participants.js.map +1 -1
  72. package/dist/collection/components/scheduler-editor/nylas-availability-picker/nylas-availability-picker.js +1 -1
  73. package/dist/collection/components/scheduler-editor/nylas-booking-confirmation-redirect/nylas-booking-confirmation-redirect.js +12 -6
  74. package/dist/collection/components/scheduler-editor/nylas-booking-confirmation-redirect/nylas-booking-confirmation-redirect.js.map +1 -1
  75. package/dist/collection/components/scheduler-editor/nylas-confirmation-email/nylas-confirmation-email.js +6 -3
  76. package/dist/collection/components/scheduler-editor/nylas-confirmation-email/nylas-confirmation-email.js.map +1 -1
  77. package/dist/collection/components/scheduler-editor/nylas-custom-event-slug/nylas-custom-event-slug.js +14 -8
  78. package/dist/collection/components/scheduler-editor/nylas-custom-event-slug/nylas-custom-event-slug.js.map +1 -1
  79. package/dist/collection/components/scheduler-editor/nylas-editor-tabs/nylas-editor-tabs.js +3 -3
  80. package/dist/collection/components/scheduler-editor/nylas-event-calendar/nylas-event-calendar.js +1 -1
  81. package/dist/collection/components/scheduler-editor/nylas-reminder-emails/nylas-reminder-emails.js +8 -4
  82. package/dist/collection/components/scheduler-editor/nylas-reminder-emails/nylas-reminder-emails.js.map +1 -1
  83. package/dist/components/index.js.map +1 -1
  84. package/dist/components/nylas-additional-participants2.js +12 -6
  85. package/dist/components/nylas-additional-participants2.js.map +1 -1
  86. package/dist/components/nylas-booked-event-card2.js +13 -6
  87. package/dist/components/nylas-booked-event-card2.js.map +1 -1
  88. package/dist/components/nylas-booking-confirmation-redirect2.js +12 -6
  89. package/dist/components/nylas-booking-confirmation-redirect2.js.map +1 -1
  90. package/dist/components/nylas-booking-form2.js +28 -6
  91. package/dist/components/nylas-booking-form2.js.map +1 -1
  92. package/dist/components/nylas-cancel-booking-form2.js +13 -3
  93. package/dist/components/nylas-cancel-booking-form2.js.map +1 -1
  94. package/dist/components/nylas-cancelled-event-card2.js +12 -3
  95. package/dist/components/nylas-cancelled-event-card2.js.map +1 -1
  96. package/dist/components/nylas-confirmation-email2.js +6 -3
  97. package/dist/components/nylas-confirmation-email2.js.map +1 -1
  98. package/dist/components/nylas-confirmed-event-card2.js +18 -8
  99. package/dist/components/nylas-confirmed-event-card2.js.map +1 -1
  100. package/dist/components/nylas-custom-event-slug2.js +15 -9
  101. package/dist/components/nylas-custom-event-slug2.js.map +1 -1
  102. package/dist/components/nylas-date-picker2.js +1 -1
  103. package/dist/components/nylas-date-picker2.js.map +1 -1
  104. package/dist/components/nylas-editor-tabs-group2.js +2 -2
  105. package/dist/components/nylas-editor-tabs2.js +2 -2
  106. package/dist/components/nylas-organizer-confirmation-card2.js +12 -5
  107. package/dist/components/nylas-organizer-confirmation-card2.js.map +1 -1
  108. package/dist/components/nylas-reminder-emails2.js +8 -4
  109. package/dist/components/nylas-reminder-emails2.js.map +1 -1
  110. package/dist/components/nylas-scheduler-editor.js +2 -2
  111. package/dist/components/nylas-scheduling.js +42 -12
  112. package/dist/components/nylas-scheduling.js.map +1 -1
  113. package/dist/components/nylas-selected-event-card2.js +12 -5
  114. package/dist/components/nylas-selected-event-card2.js.map +1 -1
  115. package/dist/components/nylas-timeslot-picker2.js.map +1 -1
  116. package/dist/components/utils.js +153 -54
  117. package/dist/components/utils.js.map +1 -1
  118. package/dist/esm/{abstract-provider-efe136bd.js → abstract-provider-bdb7d9b4.js} +2 -2
  119. package/dist/esm/{abstract-provider-efe136bd.js.map → abstract-provider-bdb7d9b4.js.map} +1 -1
  120. package/dist/esm/app-globals-295a87be.js.map +1 -1
  121. package/dist/esm/calendar-agenda-fill-icon_36.entry.js +36 -21
  122. package/dist/esm/calendar-agenda-fill-icon_36.entry.js.map +1 -1
  123. package/dist/esm/{calendar-check-icon_2.entry.js → calendar-check-icon.entry.js} +4 -19
  124. package/dist/esm/calendar-check-icon.entry.js.map +1 -0
  125. package/dist/esm/checkbox-component_2.entry.js +1 -1
  126. package/dist/esm/checkbox-group_4.entry.js +3 -3
  127. package/dist/esm/checkmark-circle-icon.entry.js +20 -0
  128. package/dist/esm/checkmark-circle-icon.entry.js.map +1 -0
  129. package/dist/esm/checkmark-icon_15.entry.js +11 -7
  130. package/dist/esm/checkmark-icon_15.entry.js.map +1 -1
  131. package/dist/esm/{customParseFormat-edc38d83.js → customParseFormat-f0d21eb3.js} +2 -2
  132. package/dist/esm/{customParseFormat-edc38d83.js.map → customParseFormat-f0d21eb3.js.map} +1 -1
  133. package/dist/esm/{feedbackSync-e4378c0b.js → feedbackSync-b9c9e719.js} +2 -2
  134. package/dist/esm/{feedbackSync-e4378c0b.js.map → feedbackSync-b9c9e719.js.map} +1 -1
  135. package/dist/esm/globe-icon_2.entry.js +2 -2
  136. package/dist/esm/google-logo-icon_6.entry.js +8 -8
  137. package/dist/esm/index-091600eb.js +6 -2
  138. package/dist/esm/{index.es-6a9d55cf.js → index.es-ccb2a286.js} +2 -2
  139. package/dist/esm/{index.es-6a9d55cf.js.map → index.es-ccb2a286.js.map} +1 -1
  140. package/dist/esm/index.js +2 -2
  141. package/dist/esm/input-component.entry.js +1 -1
  142. package/dist/esm/input-dropdown_2.entry.js +1 -1
  143. package/dist/esm/loader.js +1 -1
  144. package/dist/esm/multi-select-dropdown.entry.js +1 -1
  145. package/dist/esm/{nylas-api-request-f2e4e9b6.js → nylas-api-request-7d702661.js} +2 -2
  146. package/dist/esm/{nylas-api-request-f2e4e9b6.js.map → nylas-api-request-7d702661.js.map} +1 -1
  147. package/dist/esm/nylas-booked-event-card_11.entry.js +82 -25
  148. package/dist/esm/nylas-booked-event-card_11.entry.js.map +1 -1
  149. package/dist/esm/nylas-form-card.entry.js +2 -2
  150. package/dist/esm/nylas-notification_2.entry.js +1 -1
  151. package/dist/esm/nylas-scheduler-editor.entry.js +6 -6
  152. package/dist/esm/nylas-scheduling.entry.js +43 -15
  153. package/dist/esm/nylas-scheduling.entry.js.map +1 -1
  154. package/dist/esm/nylas-web-elements.js +1 -1
  155. package/dist/esm/{register-component-a1c3d7b4.js → register-component-9d4ceee5.js} +2 -2
  156. package/dist/esm/{register-component-a1c3d7b4.js.map → register-component-9d4ceee5.js.map} +1 -1
  157. package/dist/esm/textarea-component.entry.js +1 -1
  158. package/dist/esm/{utils-b7f9cbcc.js → utils-fb8a9ce4.js} +154 -55
  159. package/dist/esm/utils-fb8a9ce4.js.map +1 -0
  160. package/dist/nylas-web-elements/index.esm.js +1 -1
  161. package/dist/nylas-web-elements/nylas-web-elements.esm.js +1 -1
  162. package/dist/nylas-web-elements/nylas-web-elements.esm.js.map +1 -1
  163. package/dist/nylas-web-elements/{p-3ce8e281.js → p-094be30f.js} +2 -2
  164. package/dist/nylas-web-elements/p-18c58ea1.entry.js +2 -0
  165. package/dist/nylas-web-elements/p-18c58ea1.entry.js.map +1 -0
  166. package/dist/nylas-web-elements/{p-c12c18b2.entry.js → p-1dbaf879.entry.js} +2 -2
  167. package/dist/nylas-web-elements/p-2830522f.entry.js +2 -0
  168. package/dist/nylas-web-elements/p-2830522f.entry.js.map +1 -0
  169. package/dist/nylas-web-elements/{p-35297f33.entry.js → p-3b56d656.entry.js} +2 -2
  170. package/dist/nylas-web-elements/{p-8e7882a1.js → p-3c8b7ba1.js} +2 -2
  171. package/dist/nylas-web-elements/{p-3204882f.entry.js → p-3f5e1e6b.entry.js} +2 -2
  172. package/dist/nylas-web-elements/{p-5aae729f.js → p-4c1fafb4.js} +2 -2
  173. package/dist/nylas-web-elements/p-522270a2.entry.js +2 -0
  174. package/dist/nylas-web-elements/p-522270a2.entry.js.map +1 -0
  175. package/dist/nylas-web-elements/p-67e936ce.entry.js +2 -0
  176. package/dist/nylas-web-elements/p-67e936ce.entry.js.map +1 -0
  177. package/dist/nylas-web-elements/{p-9e11eb2c.js → p-6d8e2c6b.js} +2 -2
  178. package/dist/nylas-web-elements/{p-3362cf82.entry.js → p-8f82f281.entry.js} +2 -2
  179. package/dist/nylas-web-elements/p-920812bd.entry.js +8 -0
  180. package/dist/nylas-web-elements/p-920812bd.entry.js.map +1 -0
  181. package/dist/nylas-web-elements/{p-b40f7a77.entry.js → p-a42f41f7.entry.js} +2 -2
  182. package/dist/nylas-web-elements/p-a6e2e49c.js.map +1 -1
  183. package/dist/nylas-web-elements/{p-8340d845.entry.js → p-aad611b4.entry.js} +2 -2
  184. package/dist/nylas-web-elements/{p-6e56eb3f.js → p-ab88518b.js} +2 -2
  185. package/dist/nylas-web-elements/{p-5cf6301e.entry.js → p-b3500bf1.entry.js} +2 -2
  186. package/dist/nylas-web-elements/{p-4d8f9740.entry.js → p-b6d863e0.entry.js} +2 -2
  187. package/dist/nylas-web-elements/{p-50c255fa.entry.js → p-b8cf836f.entry.js} +2 -2
  188. package/dist/nylas-web-elements/{p-996c827d.entry.js → p-bf37be06.entry.js} +2 -2
  189. package/dist/nylas-web-elements/p-de4b01ac.entry.js +2 -0
  190. package/dist/nylas-web-elements/p-de4b01ac.entry.js.map +1 -0
  191. package/dist/nylas-web-elements/{p-308e7adb.entry.js → p-f42e87c6.entry.js} +3 -3
  192. package/dist/nylas-web-elements/{p-dea32251.js → p-f4825eb1.js} +2 -2
  193. package/dist/nylas-web-elements/p-faa30369.js +14 -0
  194. package/dist/nylas-web-elements/{p-59e4ab2d.js.map → p-faa30369.js.map} +1 -1
  195. package/dist/types/components/scheduler/nylas-booked-event-card/nylas-booked-event-card.d.ts +2 -0
  196. package/dist/types/components/scheduler/nylas-booking-form/nylas-booking-form.d.ts +7 -0
  197. package/dist/types/components/scheduler/nylas-cancel-booking-form/nylas-cancel-booking-form.d.ts +3 -0
  198. package/dist/types/components/scheduler/nylas-cancelled-event-card/nylas-cancelled-event-card.d.ts +3 -1
  199. package/dist/types/components/scheduler/nylas-confirmed-event-card/nylas-confirmed-event-card.d.ts +3 -1
  200. package/dist/types/components/scheduler/nylas-date-picker/nylas-date-picker.d.ts +2 -1
  201. package/dist/types/components/scheduler/nylas-organizer-confirmation-card/nylas-organizer-confirmation-card.d.ts +2 -0
  202. package/dist/types/components/scheduler/nylas-scheduling/nylas-scheduling.d.ts +6 -0
  203. package/dist/types/components/scheduler/nylas-selected-event-card/nylas-selected-event-card.d.ts +3 -1
  204. package/dist/types/components/scheduler/nylas-timeslot-picker/nylas-timeslot-picker.d.ts +2 -1
  205. package/dist/types/components/scheduler-editor/nylas-additional-participants/nylas-additional-participants.d.ts +2 -0
  206. package/dist/types/components/scheduler-editor/nylas-booking-confirmation-redirect/nylas-booking-confirmation-redirect.d.ts +2 -0
  207. package/dist/types/components/scheduler-editor/nylas-custom-event-slug/nylas-custom-event-slug.d.ts +2 -0
  208. package/dist/types/components.d.ts +46 -6
  209. package/package.json +3 -5
  210. package/dist/cjs/calendar-check-icon_2.cjs.entry.js.map +0 -1
  211. package/dist/cjs/utils-dd3b6f4c.js.map +0 -1
  212. package/dist/esm/calendar-check-icon_2.entry.js.map +0 -1
  213. package/dist/esm/utils-b7f9cbcc.js.map +0 -1
  214. package/dist/nylas-web-elements/p-2b52b854.entry.js +0 -2
  215. package/dist/nylas-web-elements/p-2b52b854.entry.js.map +0 -1
  216. package/dist/nylas-web-elements/p-59e4ab2d.js +0 -14
  217. package/dist/nylas-web-elements/p-8a3965ba.entry.js +0 -2
  218. package/dist/nylas-web-elements/p-8a3965ba.entry.js.map +0 -1
  219. package/dist/nylas-web-elements/p-97128be4.entry.js +0 -8
  220. package/dist/nylas-web-elements/p-97128be4.entry.js.map +0 -1
  221. package/dist/nylas-web-elements/p-d69f9d47.entry.js +0 -2
  222. package/dist/nylas-web-elements/p-d69f9d47.entry.js.map +0 -1
  223. package/dist/nylas-web-elements/p-dcc8ca35.entry.js +0 -2
  224. package/dist/nylas-web-elements/p-dcc8ca35.entry.js.map +0 -1
  225. /package/dist/nylas-web-elements/{p-3ce8e281.js.map → p-094be30f.js.map} +0 -0
  226. /package/dist/nylas-web-elements/{p-c12c18b2.entry.js.map → p-1dbaf879.entry.js.map} +0 -0
  227. /package/dist/nylas-web-elements/{p-35297f33.entry.js.map → p-3b56d656.entry.js.map} +0 -0
  228. /package/dist/nylas-web-elements/{p-8e7882a1.js.map → p-3c8b7ba1.js.map} +0 -0
  229. /package/dist/nylas-web-elements/{p-3204882f.entry.js.map → p-3f5e1e6b.entry.js.map} +0 -0
  230. /package/dist/nylas-web-elements/{p-5aae729f.js.map → p-4c1fafb4.js.map} +0 -0
  231. /package/dist/nylas-web-elements/{p-9e11eb2c.js.map → p-6d8e2c6b.js.map} +0 -0
  232. /package/dist/nylas-web-elements/{p-3362cf82.entry.js.map → p-8f82f281.entry.js.map} +0 -0
  233. /package/dist/nylas-web-elements/{p-b40f7a77.entry.js.map → p-a42f41f7.entry.js.map} +0 -0
  234. /package/dist/nylas-web-elements/{p-8340d845.entry.js.map → p-aad611b4.entry.js.map} +0 -0
  235. /package/dist/nylas-web-elements/{p-6e56eb3f.js.map → p-ab88518b.js.map} +0 -0
  236. /package/dist/nylas-web-elements/{p-5cf6301e.entry.js.map → p-b3500bf1.entry.js.map} +0 -0
  237. /package/dist/nylas-web-elements/{p-4d8f9740.entry.js.map → p-b6d863e0.entry.js.map} +0 -0
  238. /package/dist/nylas-web-elements/{p-50c255fa.entry.js.map → p-b8cf836f.entry.js.map} +0 -0
  239. /package/dist/nylas-web-elements/{p-996c827d.entry.js.map → p-bf37be06.entry.js.map} +0 -0
  240. /package/dist/nylas-web-elements/{p-308e7adb.entry.js.map → p-f42e87c6.entry.js.map} +0 -0
  241. /package/dist/nylas-web-elements/{p-dea32251.js.map → p-f4825eb1.js.map} +0 -0
@@ -7,7 +7,7 @@ import { addDaysToCurrentDate, capitalizeFirstLetter, compactStringToUUIDs, debu
7
7
  import { SchedulerView } from "./scheduler-view";
8
8
  import { MessageBanner } from "./message-banner";
9
9
  import i18next from "../../../utils/i18n";
10
- import { LANGUAGE_CODE } from "../../../common/constants";
10
+ import { LANGUAGE_CODE, LANGUAGE_MAP } from "../../../common/constants";
11
11
  import * as Sentry from "@sentry/browser";
12
12
  import { ErrorCategory } from "../../../types/index";
13
13
  const genericError = { title: i18next.t('genericErrorTitle'), type: NotificationType.Error, category: ErrorCategory.Component };
@@ -29,6 +29,7 @@ export class NylasScheduling {
29
29
  this.isLoading = undefined;
30
30
  this.themeConfig = undefined;
31
31
  this.localization = undefined;
32
+ this.defaultLanguage = undefined;
32
33
  this.showNotification = true;
33
34
  this.enableUserFeedback = true;
34
35
  this.hour12 = undefined;
@@ -68,12 +69,16 @@ export class NylasScheduling {
68
69
  return;
69
70
  }
70
71
  }
72
+ const urlParams = new URLSearchParams(window.location.search);
73
+ const langFromUrl = urlParams.get('lang');
74
+ const validLanguageFromUrl = langFromUrl && Object.values(LANGUAGE_CODE).includes(langFromUrl) ? langFromUrl : null;
71
75
  this.stores = {
72
76
  scheduler: CreateNylasSchedulerStore({
73
77
  bookingInfo: this.bookingInfo,
74
78
  nylasBranding: this.nylasBranding,
75
79
  themeConfig: this.themeConfig,
76
80
  hour12: this.hour12,
81
+ selectedLanguage: validLanguageFromUrl || this.defaultLanguage || this.bookingInfo?.language || LANGUAGE_CODE.en,
77
82
  ...this.defaultSchedulerState,
78
83
  }),
79
84
  };
@@ -205,6 +210,9 @@ export class NylasScheduling {
205
210
  }
206
211
  bookingInfoChanged(newVal) {
207
212
  this.stores?.scheduler.set('bookingInfo', newVal);
213
+ if (newVal?.language && !this.defaultLanguage) {
214
+ this.stores?.scheduler.set('selectedLanguage', newVal.language);
215
+ }
208
216
  }
209
217
  rescheduleBookingRefChanged(newVal) {
210
218
  if (newVal) {
@@ -241,6 +249,12 @@ export class NylasScheduling {
241
249
  i18next.addResourceBundle(lang, 'translation', newVal[lang], false, true);
242
250
  });
243
251
  }
252
+ defaultLanguageChanged(newVal) {
253
+ if (newVal) {
254
+ this.stores?.scheduler.set('selectedLanguage', newVal);
255
+ i18next.changeLanguage(newVal);
256
+ }
257
+ }
244
258
  themeConfigChanged(newVal) {
245
259
  this.baseProvider?.getStore('scheduler')?.set('themeConfig', newVal);
246
260
  this.applyThemeConfig(newVal);
@@ -476,6 +490,14 @@ export class NylasScheduling {
476
490
  redirectToCustomUrl(url) {
477
491
  window.location.assign(url);
478
492
  }
493
+ nylasFormDropdownChangedHandler(event) {
494
+ const { name, value } = event.detail;
495
+ if (name === 'language') {
496
+ const selectedLanguage = LANGUAGE_CODE[value];
497
+ i18next.changeLanguage(selectedLanguage);
498
+ this.stores?.scheduler?.set('selectedLanguage', selectedLanguage);
499
+ }
500
+ }
479
501
  render() {
480
502
  const showDefaultScheduler = this.mode === 'app';
481
503
  const nylasSchedulerStore = this.baseProvider?.getStore('scheduler');
@@ -493,17 +515,22 @@ export class NylasScheduling {
493
515
  const redirectUrl = nylasSchedulerStore?.get('configSettings')?.scheduler?.confirmation_redirect_url;
494
516
  this.selectedDateLabel =
495
517
  selectedDate && this.language ? capitalizeFirstLetter(selectedDate.toLocaleDateString(this.language, { dateStyle: 'full' })) : `${i18next.t('noDateSelected')}`;
518
+ const languageOptions = Object.keys(LANGUAGE_MAP).map(key => ({
519
+ label: LANGUAGE_MAP[key],
520
+ value: key,
521
+ }));
522
+ const selectedLanguage = nylasSchedulerStore?.get('selectedLanguage') || this.defaultLanguage || navigator.language || LANGUAGE_CODE.en;
496
523
  if (showDefaultScheduler && (cancelBookingId || rejectBookingId) && !cancelledEventInfo) {
497
- return (h(Host, null, h(SchedulerView, { version: this.version, nylasBranding: nylasBranding, isLoading: this.isLoading, showNotification: this.showNotification }, h("div", { class: "cancel-flow-page", part: "cancel-flow-page" }, h("nylas-cancel-booking-form", { selectedTimeslot: selectedTimeslot, cancelBookingId: cancelBookingId, rejectBookingId: rejectBookingId, exportparts: "ncbf, ncbf__icon, ncbf__title, ncbf__description, ncbf__reason-textarea, ncbf__button-cta, ncbf__button-outline, ncbf__card" }))), this.enableUserFeedback && (h("button-component", { id: "report-issue", variant: 'basic', onClick: e => this.onFeedbackClick(e) }, h("feedback-icon", null))), this.showFeedbackModal && h("nylas-feedback-form", null)));
524
+ return (h(Host, null, h(SchedulerView, { version: this.version, nylasBranding: nylasBranding, isLoading: this.isLoading, showNotification: this.showNotification }, h("div", { class: "cancel-flow-page", part: "cancel-flow-page" }, h("nylas-cancel-booking-form", { selectedTimeslot: selectedTimeslot, cancelBookingId: cancelBookingId, rejectBookingId: rejectBookingId, exportparts: "ncbf, ncbf__icon, ncbf__title, ncbf__description, ncbf__reason-textarea, ncbf__button-cta, ncbf__button-outline, ncbf__card" }))), h("div", { class: "language-feedback-container" }, this.enableUserFeedback && (h("button-component", { id: "report-issue", variant: 'basic', onClick: e => this.onFeedbackClick(e) }, h("feedback-icon", null))), h("select-dropdown", { name: "language", searchPlaceholder: i18next.t('search'), options: languageOptions, withChevron: false, defaultSelectedOption: languageOptions.find(lang => lang.value == selectedLanguage), exportparts: "sd_dropdown: nse__language-dropdown, sd_dropdown-button: nse__language-drop-button, sd_dropdown-content: nse__language-drop-content, sd_dropdown_label: nse__language-drop-label" }, h("span", { slot: "select-icon" }, h("translate-icon", { width: "20", height: "20" })))), this.showFeedbackModal && h("nylas-feedback-form", null)));
498
525
  }
499
526
  if (showDefaultScheduler && organizerConfirmationBookingId) {
500
- return (h(Host, null, h(SchedulerView, null, h("div", { class: "manual-confirmation-page", part: "manual-confirmation-page" }, h("nylas-organizer-confirmation-card", { organizerConfirmationBookingId: organizerConfirmationBookingId, exportparts: "nmcc, nmcc__title, nmcc__description, nmcc__button-cta, nmcc__button-outline" }))), this.enableUserFeedback && (h("button-component", { id: "report-issue", variant: 'basic', onClick: e => this.onFeedbackClick(e) }, h("feedback-icon", null))), this.showFeedbackModal && h("nylas-feedback-form", null)));
527
+ return (h(Host, null, h(SchedulerView, null, h("div", { class: "manual-confirmation-page", part: "manual-confirmation-page" }, h("nylas-organizer-confirmation-card", { organizerConfirmationBookingId: organizerConfirmationBookingId, exportparts: "nmcc, nmcc__title, nmcc__description, nmcc__button-cta, nmcc__button-outline" }))), h("div", { class: "language-feedback-container" }, this.enableUserFeedback && (h("button-component", { id: "report-issue", variant: 'basic', onClick: e => this.onFeedbackClick(e) }, h("feedback-icon", null))), h("select-dropdown", { name: "language", searchPlaceholder: i18next.t('search'), options: languageOptions, withChevron: false, defaultSelectedOption: languageOptions.find(lang => lang.value == selectedLanguage), exportparts: "sd_dropdown: nse__language-dropdown, sd_dropdown-button: nse__language-drop-button, sd_dropdown-content: nse__language-drop-content, sd_dropdown_label: nse__language-drop-label" }, h("span", { slot: "select-icon" }, h("translate-icon", { width: "20", height: "20" })))), this.showFeedbackModal && h("nylas-feedback-form", null)));
501
528
  }
502
529
  if (showDefaultScheduler && cancelledEventInfo) {
503
- return (h(Host, null, h(SchedulerView, { version: this.version, nylasBranding: nylasBranding, isLoading: this.isLoading, showNotification: this.showNotification }, h("div", { class: "cancelled-event-page", part: "cancelled-event-page" }, h("nylas-cancelled-event-card", { cancelledEventInfo: cancelledEventInfo, exportparts: "ncec, ncec__icon, ncec__title, ncec__description, ncec__button-outline, ncec__card" }))), this.enableUserFeedback && (h("button-component", { id: "report-issue", variant: 'basic', onClick: e => this.onFeedbackClick(e) }, h("feedback-icon", null))), this.showFeedbackModal && h("nylas-feedback-form", null)));
530
+ return (h(Host, null, h(SchedulerView, { version: this.version, nylasBranding: nylasBranding, isLoading: this.isLoading, showNotification: this.showNotification }, h("div", { class: "cancelled-event-page", part: "cancelled-event-page" }, h("nylas-cancelled-event-card", { cancelledEventInfo: cancelledEventInfo, exportparts: "ncec, ncec__icon, ncec__title, ncec__description, ncec__button-outline, ncec__card" }))), h("div", { class: "language-feedback-container" }, this.enableUserFeedback && (h("button-component", { id: "report-issue", variant: 'basic', onClick: e => this.onFeedbackClick(e) }, h("feedback-icon", null))), h("select-dropdown", { name: "language", searchPlaceholder: i18next.t('search'), options: languageOptions, withChevron: false, defaultSelectedOption: languageOptions.find(lang => lang.value == selectedLanguage), exportparts: "sd_dropdown: nse__language-dropdown, sd_dropdown-button: nse__language-drop-button, sd_dropdown-content: nse__language-drop-content, sd_dropdown_label: nse__language-drop-label" }, h("span", { slot: "select-icon" }, h("translate-icon", { width: "20", height: "20" })))), this.showFeedbackModal && h("nylas-feedback-form", null)));
504
531
  }
505
532
  if (showDefaultScheduler && confirmedEventInfo) {
506
- return (h(Host, null, h(SchedulerView, { version: this.version, nylasBranding: nylasBranding, isLoading: this.isLoading, showNotification: this.showNotification }, h("div", { class: "cancelled-event-page", part: "confirmed-event-page" }, h("nylas-confirmed-event-card", { confirmedEventInfo: confirmedEventInfo, exportparts: "ncec, ncec__icon, ncec__title, ncec__description, ncec__button-outline, ncec__card" }))), this.enableUserFeedback && (h("button-component", { id: "report-issue", variant: 'basic', onClick: e => this.onFeedbackClick(e) }, h("feedback-icon", null))), this.showFeedbackModal && h("nylas-feedback-form", null)));
533
+ return (h(Host, null, h(SchedulerView, { version: this.version, nylasBranding: nylasBranding, isLoading: this.isLoading, showNotification: this.showNotification }, h("div", { class: "cancelled-event-page", part: "confirmed-event-page" }, h("nylas-confirmed-event-card", { confirmedEventInfo: confirmedEventInfo, exportparts: "ncec, ncec__icon, ncec__title, ncec__description, ncec__button-outline, ncec__card" }))), h("div", { class: "language-feedback-container" }, this.enableUserFeedback && (h("button-component", { id: "report-issue", variant: 'basic', onClick: e => this.onFeedbackClick(e) }, h("feedback-icon", null))), h("select-dropdown", { name: "language", searchPlaceholder: i18next.t('search'), options: languageOptions, withChevron: false, defaultSelectedOption: languageOptions.find(lang => lang.value == selectedLanguage), exportparts: "sd_dropdown: nse__language-dropdown, sd_dropdown-button: nse__language-drop-button, sd_dropdown-content: nse__language-drop-content, sd_dropdown_label: nse__language-drop-label" }, h("span", { slot: "select-icon" }, h("translate-icon", { width: "20", height: "20" })))), this.showFeedbackModal && h("nylas-feedback-form", null)));
507
534
  }
508
535
  if (showDefaultScheduler && eventInfo && redirectUrl) {
509
536
  const recipient = this.bookingInfoConfirmed?.primaryParticipant;
@@ -541,14 +568,14 @@ export class NylasScheduling {
541
568
  return;
542
569
  }
543
570
  if (showDefaultScheduler && eventInfo) {
544
- return (h(Host, null, h(SchedulerView, { version: this.version, nylasBranding: nylasBranding, isLoading: this.isLoading, showNotification: this.showNotification }, h("div", { class: "booked-event-page", part: "booked-event-page ns_booked-event-page" }, h("nylas-booked-event-card", { selectedTimeslot: selectedTimeslot, eventInfo: eventInfo, exportparts: "nbec, nbec__title, nbec__card, nbec__description, nbec__button-outline, nbec__cancel-cta, nbec__reschedule-cta" }))), this.enableUserFeedback && (h("button-component", { id: "report-issue", variant: 'basic', onClick: e => this.onFeedbackClick(e) }, h("feedback-icon", null))), this.showFeedbackModal && h("nylas-feedback-form", null)));
571
+ return (h(Host, null, h(SchedulerView, { version: this.version, nylasBranding: nylasBranding, isLoading: this.isLoading, showNotification: this.showNotification }, h("div", { class: "booked-event-page", part: "booked-event-page ns_booked-event-page" }, h("nylas-booked-event-card", { selectedTimeslot: selectedTimeslot, eventInfo: eventInfo, exportparts: "nbec, nbec__title, nbec__card, nbec__description, nbec__button-outline, nbec__cancel-cta, nbec__reschedule-cta" }))), h("div", { class: "language-feedback-container" }, this.enableUserFeedback && (h("button-component", { id: "report-issue", variant: 'basic', onClick: e => this.onFeedbackClick(e) }, h("feedback-icon", null))), h("select-dropdown", { name: "language", searchPlaceholder: i18next.t('search'), options: languageOptions, withChevron: false, defaultSelectedOption: languageOptions.find(lang => lang.value == selectedLanguage), exportparts: "sd_dropdown: nse__language-dropdown, sd_dropdown-button: nse__language-drop-button, sd_dropdown-content: nse__language-drop-content, sd_dropdown_label: nse__language-drop-label" }, h("span", { slot: "select-icon" }, h("translate-icon", { width: "20", height: "20" })))), this.showFeedbackModal && h("nylas-feedback-form", null)));
545
572
  }
546
573
  if (showDefaultScheduler && (!eventInfo || !!rescheduleBookingId) && !showBookingForm) {
547
574
  const timeslotPickerCTALabel = this.host.querySelector('[slot="timeslot-picker-cta-label"]');
548
575
  return (h(Host, null, h(SchedulerView, { version: this.version, nylasBranding: nylasBranding, isLoading: this.isLoading, showNotification: this.showNotification }, rescheduleBookingId && h(MessageBanner, null, `${i18next.t('rescheduleTitle')}`), h("div", { class: "select-date-page", part: "select-date-page ns_select-date-page" }, h("div", { class: "left-panel", part: "ns_left-panel" }, h("nylas-date-picker", { exportparts: "ndp, ndp__title, ndp__month-header, ndp__month-button, ndp__day, ndp__date, ndp__date--disabled, ndp__date--selected, ndp__date--current-day, ndp__date--current-month" }), h("nylas-locale-switch", { exportparts: "nls, nls__timezone, nls__timezone-dropdown, nls__timezone-drop-button, nls__timezone-drop-button-selected-label, nls__timezone-drop-content, nls__timezone-drop-label, nls__language, nls__language-dropdown, nls__language-drop-button, nls__language-drop-content, nls__language-drop-label" })), h("div", { class: `right-panel ${rescheduleBookingId ? 'reschedule' : ''}`, part: `ns_right-panel ${rescheduleBookingId ? 'ns_reschedule' : ''}` }, h("h2", { part: "ns_right-panel__title" }, h("calendar-icon", { part: "ns_right-panel__calendar-icon" }), h("span", { id: "selectedDate", part: "ns_right-panel__selected-date" }, this.selectedDateLabel)), h("nylas-timeslot-picker", { exportparts: "ntp, ntp__time-picker-wrapper, ntp__timeslots, ntp__timeslot, ntp__timeslot--selected, ntp__button-primary" }, timeslotPickerCTALabel && (h("span", { slot: "timeslot-picker-cta-label" }, h("slot", { name: "timeslot-picker-cta-label" }))))))), this.enableUserFeedback && (h("button-component", { id: "report-issue", variant: 'basic', onClick: e => this.onFeedbackClick(e) }, h("feedback-icon", null))), this.showFeedbackModal && h("nylas-feedback-form", null)));
549
576
  }
550
577
  if (showDefaultScheduler && !eventInfo && showBookingForm) {
551
- return (h(Host, null, h(SchedulerView, { version: this.version, nylasBranding: nylasBranding, isLoading: this.isLoading, showNotification: this.showNotification }, rescheduleBookingId && h(MessageBanner, null, `${i18next.t('rescheduleTitle')}`), h("div", { class: "additional-data-page", part: "additional-data-page ns_additional-data-page" }, h("div", { class: "left-panel ns_left-panel", part: "ns_left-panel" }, h("div", { class: "wrapper", part: "ns_left-panel__wrapper" }, h("nylas-selected-event-card", { exportparts: "nsec, nsec__card, nsec__icon, nsec__date, nsec__time, nsec__timezone" }))), h("div", { class: `right-panel ${rescheduleBookingId ? 'reschedule' : ''}`, part: `ns_right-panel ${rescheduleBookingId ? 'ns_reschedule' : ''}` }, h("nylas-booking-form", { exportparts: "nbf, nbf__input-textfield, nbf__button-ghost, nbf__button-outline, nbf__button-primary, nbf__input-wrapper, nbf__checkbox-component, nbf__radio-button-group, nbf__textarea-component, nbf__dropdown, nbf__dropdown-button, nbf__dropdown-content" })))), this.enableUserFeedback && (h("button-component", { id: "report-issue", variant: 'basic', onClick: e => this.onFeedbackClick(e) }, h("feedback-icon", null))), this.showFeedbackModal && h("nylas-feedback-form", null)));
578
+ return (h(Host, null, h(SchedulerView, { version: this.version, nylasBranding: nylasBranding, isLoading: this.isLoading, showNotification: this.showNotification }, rescheduleBookingId && h(MessageBanner, null, `${i18next.t('rescheduleTitle')}`), h("div", { class: "additional-data-page", part: "additional-data-page ns_additional-data-page" }, h("div", { class: "left-panel ns_left-panel", part: "ns_left-panel" }, h("div", { class: "wrapper", part: "ns_left-panel__wrapper" }, h("nylas-selected-event-card", { exportparts: "nsec, nsec__card, nsec__icon, nsec__date, nsec__time, nsec__timezone" }))), h("div", { class: `right-panel ${rescheduleBookingId ? 'reschedule' : ''}`, part: `ns_right-panel ${rescheduleBookingId ? 'ns_reschedule' : ''}` }, h("nylas-booking-form", { exportparts: "nbf, nbf__input-textfield, nbf__button-ghost, nbf__button-outline, nbf__button-primary, nbf__input-wrapper, nbf__checkbox-component, nbf__radio-button-group, nbf__textarea-component, nbf__dropdown, nbf__dropdown-button, nbf__dropdown-content" })))), h("div", { class: "language-feedback-container" }, this.enableUserFeedback && (h("button-component", { id: "report-issue", variant: 'basic', onClick: e => this.onFeedbackClick(e) }, h("feedback-icon", null))), h("select-dropdown", { name: "language", searchPlaceholder: i18next.t('search'), options: languageOptions, withChevron: false, defaultSelectedOption: languageOptions.find(lang => lang.value == selectedLanguage), exportparts: "sd_dropdown: nse__language-dropdown, sd_dropdown-button: nse__language-drop-button, sd_dropdown-content: nse__language-drop-content, sd_dropdown_label: nse__language-drop-label" }, h("span", { slot: "select-icon" }, h("translate-icon", { width: "20", height: "20" })))), this.showFeedbackModal && h("nylas-feedback-form", null)));
552
579
  }
553
580
  return (h(Host, null, h("slot", null)));
554
581
  }
@@ -879,6 +906,29 @@ export class NylasScheduling {
879
906
  "text": "This prop will allow to override the default localization strings for each language.\nNylas scheduling page currently support the following language codes: en, es, fr, de, sv, zh, ja, nl."
880
907
  }
881
908
  },
909
+ "defaultLanguage": {
910
+ "type": "string",
911
+ "mutable": false,
912
+ "complexType": {
913
+ "original": "LANGUAGE_CODE",
914
+ "resolved": "LANGUAGE_CODE.de | LANGUAGE_CODE.en | LANGUAGE_CODE.es | LANGUAGE_CODE.fr | LANGUAGE_CODE.ja | LANGUAGE_CODE.ko | LANGUAGE_CODE.nl | LANGUAGE_CODE.sv | LANGUAGE_CODE.zh | undefined",
915
+ "references": {
916
+ "LANGUAGE_CODE": {
917
+ "location": "import",
918
+ "path": "@/common/constants",
919
+ "id": "src/common/constants.ts::LANGUAGE_CODE"
920
+ }
921
+ }
922
+ },
923
+ "required": false,
924
+ "optional": true,
925
+ "docs": {
926
+ "tags": [],
927
+ "text": "This prop will allow to set a default language for the Nylas scheduling page."
928
+ },
929
+ "attribute": "default-language",
930
+ "reflect": false
931
+ },
882
932
  "showNotification": {
883
933
  "type": "boolean",
884
934
  "mutable": false,
@@ -1222,6 +1272,9 @@ export class NylasScheduling {
1222
1272
  }, {
1223
1273
  "propName": "localization",
1224
1274
  "methodName": "localizationChanged"
1275
+ }, {
1276
+ "propName": "defaultLanguage",
1277
+ "methodName": "defaultLanguageChanged"
1225
1278
  }, {
1226
1279
  "propName": "themeConfig",
1227
1280
  "methodName": "themeConfigChanged"
@@ -1306,6 +1359,12 @@ export class NylasScheduling {
1306
1359
  "target": undefined,
1307
1360
  "capture": false,
1308
1361
  "passive": false
1362
+ }, {
1363
+ "name": "nylasFormDropdownChanged",
1364
+ "method": "nylasFormDropdownChangedHandler",
1365
+ "target": undefined,
1366
+ "capture": false,
1367
+ "passive": false
1309
1368
  }];
1310
1369
  }
1311
1370
  }