@nylas/web-elements 2.0.1 → 2.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cdn/nylas-scheduler-editor/nylas-scheduler-editor.es.js +191 -95
- package/dist/cdn/nylas-scheduling/nylas-scheduling.es.js +10418 -10260
- package/dist/cjs/{abstract-provider-ca4f7e4f.js → abstract-provider-f84a6735.js} +2 -2
- package/dist/cjs/{abstract-provider-ca4f7e4f.js.map → abstract-provider-f84a6735.js.map} +1 -1
- package/dist/cjs/calendar-agenda-fill-icon_36.cjs.entry.js +36 -21
- package/dist/cjs/calendar-agenda-fill-icon_36.cjs.entry.js.map +1 -1
- package/dist/cjs/{calendar-check-icon_2.cjs.entry.js → calendar-check-icon.cjs.entry.js} +3 -19
- package/dist/cjs/calendar-check-icon.cjs.entry.js.map +1 -0
- package/dist/cjs/checkbox-component_2.cjs.entry.js +1 -1
- package/dist/cjs/checkbox-group_4.cjs.entry.js +3 -3
- package/dist/cjs/checkmark-circle-icon.cjs.entry.js +24 -0
- package/dist/cjs/checkmark-circle-icon.cjs.entry.js.map +1 -0
- package/dist/cjs/checkmark-icon_15.cjs.entry.js +11 -7
- package/dist/cjs/checkmark-icon_15.cjs.entry.js.map +1 -1
- package/dist/cjs/{customParseFormat-bb3a23c5.js → customParseFormat-95790293.js} +2 -2
- package/dist/cjs/{customParseFormat-bb3a23c5.js.map → customParseFormat-95790293.js.map} +1 -1
- package/dist/cjs/{feedbackSync-1c5ec9aa.js → feedbackSync-4ed99749.js} +2 -2
- package/dist/cjs/{feedbackSync-1c5ec9aa.js.map → feedbackSync-4ed99749.js.map} +1 -1
- package/dist/cjs/globe-icon_2.cjs.entry.js +2 -2
- package/dist/cjs/google-logo-icon_6.cjs.entry.js +8 -8
- package/dist/cjs/index-e07e3a7e.js +6 -2
- package/dist/cjs/index.cjs.js +2 -2
- package/dist/cjs/{index.es-c563f3ba.js → index.es-62161daa.js} +2 -2
- package/dist/cjs/{index.es-c563f3ba.js.map → index.es-62161daa.js.map} +1 -1
- package/dist/cjs/input-component.cjs.entry.js +1 -1
- package/dist/cjs/input-dropdown_2.cjs.entry.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/multi-select-dropdown.cjs.entry.js +1 -1
- package/dist/cjs/{nylas-api-request-4d148ff1.js → nylas-api-request-03d7f604.js} +2 -2
- package/dist/cjs/{nylas-api-request-4d148ff1.js.map → nylas-api-request-03d7f604.js.map} +1 -1
- package/dist/cjs/nylas-booked-event-card_11.cjs.entry.js +82 -25
- package/dist/cjs/nylas-booked-event-card_11.cjs.entry.js.map +1 -1
- package/dist/cjs/nylas-form-card.cjs.entry.js +2 -2
- package/dist/cjs/nylas-notification_2.cjs.entry.js +1 -1
- package/dist/cjs/nylas-scheduler-editor.cjs.entry.js +6 -6
- package/dist/cjs/nylas-scheduling.cjs.entry.js +42 -14
- package/dist/cjs/nylas-scheduling.cjs.entry.js.map +1 -1
- package/dist/cjs/nylas-web-elements.cjs.js +1 -1
- package/dist/cjs/{register-component-70744713.js → register-component-f4ad9751.js} +2 -2
- package/dist/cjs/{register-component-70744713.js.map → register-component-f4ad9751.js.map} +1 -1
- package/dist/cjs/textarea-component.cjs.entry.js +1 -1
- package/dist/cjs/{utils-dd3b6f4c.js → utils-03b13826.js} +154 -55
- package/dist/cjs/utils-03b13826.js.map +1 -0
- package/dist/collection/components/scheduler/nylas-booked-event-card/nylas-booked-event-card.js +11 -3
- package/dist/collection/components/scheduler/nylas-booked-event-card/nylas-booked-event-card.js.map +1 -1
- package/dist/collection/components/scheduler/nylas-booking-form/nylas-booking-form.js +49 -4
- package/dist/collection/components/scheduler/nylas-booking-form/nylas-booking-form.js.map +1 -1
- package/dist/collection/components/scheduler/nylas-booking-form/test/nylas-booking-form.spec.js +3 -3
- package/dist/collection/components/scheduler/nylas-booking-form/test/nylas-booking-form.spec.js.map +1 -1
- package/dist/collection/components/scheduler/nylas-cancel-booking-form/nylas-cancel-booking-form.js +37 -1
- package/dist/collection/components/scheduler/nylas-cancel-booking-form/nylas-cancel-booking-form.js.map +1 -1
- package/dist/collection/components/scheduler/nylas-cancelled-event-card/nylas-cancelled-event-card.js +34 -2
- package/dist/collection/components/scheduler/nylas-cancelled-event-card/nylas-cancelled-event-card.js.map +1 -1
- package/dist/collection/components/scheduler/nylas-confirmed-event-card/nylas-confirmed-event-card.css +1 -1
- package/dist/collection/components/scheduler/nylas-confirmed-event-card/nylas-confirmed-event-card.js +34 -1
- package/dist/collection/components/scheduler/nylas-confirmed-event-card/nylas-confirmed-event-card.js.map +1 -1
- package/dist/collection/components/scheduler/nylas-date-picker/nylas-date-picker.js +10 -4
- package/dist/collection/components/scheduler/nylas-date-picker/nylas-date-picker.js.map +1 -1
- package/dist/collection/components/scheduler/nylas-organizer-confirmation-card/nylas-organizer-confirmation-card.js +10 -2
- package/dist/collection/components/scheduler/nylas-organizer-confirmation-card/nylas-organizer-confirmation-card.js.map +1 -1
- package/dist/collection/components/scheduler/nylas-scheduling/nylas-scheduling.css +13 -0
- package/dist/collection/components/scheduler/nylas-scheduling/nylas-scheduling.js +66 -7
- package/dist/collection/components/scheduler/nylas-scheduling/nylas-scheduling.js.map +1 -1
- package/dist/collection/components/scheduler/nylas-scheduling/test/nylas-scheduling.spec.js +33 -0
- package/dist/collection/components/scheduler/nylas-scheduling/test/nylas-scheduling.spec.js.map +1 -1
- package/dist/collection/components/scheduler/nylas-selected-event-card/nylas-selected-event-card.js +20 -5
- package/dist/collection/components/scheduler/nylas-selected-event-card/nylas-selected-event-card.js.map +1 -1
- package/dist/collection/components/scheduler/nylas-timeslot-picker/nylas-timeslot-picker.js.map +1 -1
- package/dist/collection/components/scheduler-editor/nylas-additional-participants/nylas-additional-participants.js +12 -6
- package/dist/collection/components/scheduler-editor/nylas-additional-participants/nylas-additional-participants.js.map +1 -1
- package/dist/collection/components/scheduler-editor/nylas-booking-confirmation-redirect/nylas-booking-confirmation-redirect.js +12 -6
- package/dist/collection/components/scheduler-editor/nylas-booking-confirmation-redirect/nylas-booking-confirmation-redirect.js.map +1 -1
- package/dist/collection/components/scheduler-editor/nylas-confirmation-email/nylas-confirmation-email.js +6 -3
- package/dist/collection/components/scheduler-editor/nylas-confirmation-email/nylas-confirmation-email.js.map +1 -1
- package/dist/collection/components/scheduler-editor/nylas-custom-event-slug/nylas-custom-event-slug.js +14 -8
- package/dist/collection/components/scheduler-editor/nylas-custom-event-slug/nylas-custom-event-slug.js.map +1 -1
- package/dist/collection/components/scheduler-editor/nylas-reminder-emails/nylas-reminder-emails.js +8 -4
- package/dist/collection/components/scheduler-editor/nylas-reminder-emails/nylas-reminder-emails.js.map +1 -1
- package/dist/components/nylas-additional-participants2.js +12 -6
- package/dist/components/nylas-additional-participants2.js.map +1 -1
- package/dist/components/nylas-booked-event-card2.js +13 -6
- package/dist/components/nylas-booked-event-card2.js.map +1 -1
- package/dist/components/nylas-booking-confirmation-redirect2.js +12 -6
- package/dist/components/nylas-booking-confirmation-redirect2.js.map +1 -1
- package/dist/components/nylas-booking-form2.js +28 -6
- package/dist/components/nylas-booking-form2.js.map +1 -1
- package/dist/components/nylas-cancel-booking-form2.js +13 -3
- package/dist/components/nylas-cancel-booking-form2.js.map +1 -1
- package/dist/components/nylas-cancelled-event-card2.js +12 -3
- package/dist/components/nylas-cancelled-event-card2.js.map +1 -1
- package/dist/components/nylas-confirmation-email2.js +6 -3
- package/dist/components/nylas-confirmation-email2.js.map +1 -1
- package/dist/components/nylas-confirmed-event-card2.js +18 -8
- package/dist/components/nylas-confirmed-event-card2.js.map +1 -1
- package/dist/components/nylas-custom-event-slug2.js +15 -9
- package/dist/components/nylas-custom-event-slug2.js.map +1 -1
- package/dist/components/nylas-date-picker2.js +1 -1
- package/dist/components/nylas-date-picker2.js.map +1 -1
- package/dist/components/nylas-editor-tabs-group2.js +2 -2
- package/dist/components/nylas-editor-tabs2.js +2 -2
- package/dist/components/nylas-organizer-confirmation-card2.js +12 -5
- package/dist/components/nylas-organizer-confirmation-card2.js.map +1 -1
- package/dist/components/nylas-reminder-emails2.js +8 -4
- package/dist/components/nylas-reminder-emails2.js.map +1 -1
- package/dist/components/nylas-scheduler-editor.js +2 -2
- package/dist/components/nylas-scheduling.js +42 -12
- package/dist/components/nylas-scheduling.js.map +1 -1
- package/dist/components/nylas-selected-event-card2.js +12 -5
- package/dist/components/nylas-selected-event-card2.js.map +1 -1
- package/dist/components/nylas-timeslot-picker2.js.map +1 -1
- package/dist/components/utils.js +153 -54
- package/dist/components/utils.js.map +1 -1
- package/dist/esm/{abstract-provider-efe136bd.js → abstract-provider-bdb7d9b4.js} +2 -2
- package/dist/esm/{abstract-provider-efe136bd.js.map → abstract-provider-bdb7d9b4.js.map} +1 -1
- package/dist/esm/calendar-agenda-fill-icon_36.entry.js +36 -21
- package/dist/esm/calendar-agenda-fill-icon_36.entry.js.map +1 -1
- package/dist/esm/{calendar-check-icon_2.entry.js → calendar-check-icon.entry.js} +4 -19
- package/dist/esm/calendar-check-icon.entry.js.map +1 -0
- package/dist/esm/checkbox-component_2.entry.js +1 -1
- package/dist/esm/checkbox-group_4.entry.js +3 -3
- package/dist/esm/checkmark-circle-icon.entry.js +20 -0
- package/dist/esm/checkmark-circle-icon.entry.js.map +1 -0
- package/dist/esm/checkmark-icon_15.entry.js +11 -7
- package/dist/esm/checkmark-icon_15.entry.js.map +1 -1
- package/dist/esm/{customParseFormat-edc38d83.js → customParseFormat-f0d21eb3.js} +2 -2
- package/dist/esm/{customParseFormat-edc38d83.js.map → customParseFormat-f0d21eb3.js.map} +1 -1
- package/dist/esm/{feedbackSync-e4378c0b.js → feedbackSync-b9c9e719.js} +2 -2
- package/dist/esm/{feedbackSync-e4378c0b.js.map → feedbackSync-b9c9e719.js.map} +1 -1
- package/dist/esm/globe-icon_2.entry.js +2 -2
- package/dist/esm/google-logo-icon_6.entry.js +8 -8
- package/dist/esm/index-091600eb.js +6 -2
- package/dist/esm/{index.es-6a9d55cf.js → index.es-ccb2a286.js} +2 -2
- package/dist/esm/{index.es-6a9d55cf.js.map → index.es-ccb2a286.js.map} +1 -1
- package/dist/esm/index.js +2 -2
- package/dist/esm/input-component.entry.js +1 -1
- package/dist/esm/input-dropdown_2.entry.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/multi-select-dropdown.entry.js +1 -1
- package/dist/esm/{nylas-api-request-f2e4e9b6.js → nylas-api-request-7d702661.js} +2 -2
- package/dist/esm/{nylas-api-request-f2e4e9b6.js.map → nylas-api-request-7d702661.js.map} +1 -1
- package/dist/esm/nylas-booked-event-card_11.entry.js +82 -25
- package/dist/esm/nylas-booked-event-card_11.entry.js.map +1 -1
- package/dist/esm/nylas-form-card.entry.js +2 -2
- package/dist/esm/nylas-notification_2.entry.js +1 -1
- package/dist/esm/nylas-scheduler-editor.entry.js +6 -6
- package/dist/esm/nylas-scheduling.entry.js +43 -15
- package/dist/esm/nylas-scheduling.entry.js.map +1 -1
- package/dist/esm/nylas-web-elements.js +1 -1
- package/dist/esm/{register-component-a1c3d7b4.js → register-component-9d4ceee5.js} +2 -2
- package/dist/esm/{register-component-a1c3d7b4.js.map → register-component-9d4ceee5.js.map} +1 -1
- package/dist/esm/textarea-component.entry.js +1 -1
- package/dist/esm/{utils-b7f9cbcc.js → utils-fb8a9ce4.js} +154 -55
- package/dist/esm/utils-fb8a9ce4.js.map +1 -0
- package/dist/nylas-web-elements/index.esm.js +1 -1
- package/dist/nylas-web-elements/nylas-web-elements.esm.js +1 -1
- package/dist/nylas-web-elements/nylas-web-elements.esm.js.map +1 -1
- package/dist/nylas-web-elements/{p-3ce8e281.js → p-094be30f.js} +2 -2
- package/dist/nylas-web-elements/p-18c58ea1.entry.js +2 -0
- package/dist/nylas-web-elements/p-18c58ea1.entry.js.map +1 -0
- package/dist/nylas-web-elements/{p-c12c18b2.entry.js → p-1dbaf879.entry.js} +2 -2
- package/dist/nylas-web-elements/p-2830522f.entry.js +2 -0
- package/dist/nylas-web-elements/p-2830522f.entry.js.map +1 -0
- package/dist/nylas-web-elements/{p-35297f33.entry.js → p-3b56d656.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-8e7882a1.js → p-3c8b7ba1.js} +2 -2
- package/dist/nylas-web-elements/{p-3204882f.entry.js → p-3f5e1e6b.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-5aae729f.js → p-4c1fafb4.js} +2 -2
- package/dist/nylas-web-elements/p-522270a2.entry.js +2 -0
- package/dist/nylas-web-elements/p-522270a2.entry.js.map +1 -0
- package/dist/nylas-web-elements/p-67e936ce.entry.js +2 -0
- package/dist/nylas-web-elements/p-67e936ce.entry.js.map +1 -0
- package/dist/nylas-web-elements/{p-9e11eb2c.js → p-6d8e2c6b.js} +2 -2
- package/dist/nylas-web-elements/{p-3362cf82.entry.js → p-8f82f281.entry.js} +2 -2
- package/dist/nylas-web-elements/p-920812bd.entry.js +8 -0
- package/dist/nylas-web-elements/p-920812bd.entry.js.map +1 -0
- package/dist/nylas-web-elements/{p-b40f7a77.entry.js → p-a42f41f7.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-8340d845.entry.js → p-aad611b4.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-6e56eb3f.js → p-ab88518b.js} +2 -2
- package/dist/nylas-web-elements/{p-5cf6301e.entry.js → p-b3500bf1.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-4d8f9740.entry.js → p-b6d863e0.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-50c255fa.entry.js → p-b8cf836f.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-996c827d.entry.js → p-bf37be06.entry.js} +2 -2
- package/dist/nylas-web-elements/p-de4b01ac.entry.js +2 -0
- package/dist/nylas-web-elements/p-de4b01ac.entry.js.map +1 -0
- package/dist/nylas-web-elements/{p-308e7adb.entry.js → p-f42e87c6.entry.js} +3 -3
- package/dist/nylas-web-elements/{p-dea32251.js → p-f4825eb1.js} +2 -2
- package/dist/nylas-web-elements/p-faa30369.js +14 -0
- package/dist/nylas-web-elements/{p-59e4ab2d.js.map → p-faa30369.js.map} +1 -1
- package/dist/types/components/scheduler/nylas-booked-event-card/nylas-booked-event-card.d.ts +2 -0
- package/dist/types/components/scheduler/nylas-booking-form/nylas-booking-form.d.ts +7 -0
- package/dist/types/components/scheduler/nylas-cancel-booking-form/nylas-cancel-booking-form.d.ts +3 -0
- package/dist/types/components/scheduler/nylas-cancelled-event-card/nylas-cancelled-event-card.d.ts +3 -1
- package/dist/types/components/scheduler/nylas-confirmed-event-card/nylas-confirmed-event-card.d.ts +3 -1
- package/dist/types/components/scheduler/nylas-date-picker/nylas-date-picker.d.ts +2 -1
- package/dist/types/components/scheduler/nylas-organizer-confirmation-card/nylas-organizer-confirmation-card.d.ts +2 -0
- package/dist/types/components/scheduler/nylas-scheduling/nylas-scheduling.d.ts +6 -0
- package/dist/types/components/scheduler/nylas-selected-event-card/nylas-selected-event-card.d.ts +3 -1
- package/dist/types/components/scheduler/nylas-timeslot-picker/nylas-timeslot-picker.d.ts +2 -1
- package/dist/types/components/scheduler-editor/nylas-additional-participants/nylas-additional-participants.d.ts +2 -0
- package/dist/types/components/scheduler-editor/nylas-booking-confirmation-redirect/nylas-booking-confirmation-redirect.d.ts +2 -0
- package/dist/types/components/scheduler-editor/nylas-custom-event-slug/nylas-custom-event-slug.d.ts +2 -0
- package/dist/types/components.d.ts +46 -6
- package/package.json +1 -1
- package/dist/cjs/calendar-check-icon_2.cjs.entry.js.map +0 -1
- package/dist/cjs/utils-dd3b6f4c.js.map +0 -1
- package/dist/esm/calendar-check-icon_2.entry.js.map +0 -1
- package/dist/esm/utils-b7f9cbcc.js.map +0 -1
- package/dist/nylas-web-elements/p-2b52b854.entry.js +0 -2
- package/dist/nylas-web-elements/p-2b52b854.entry.js.map +0 -1
- package/dist/nylas-web-elements/p-59e4ab2d.js +0 -14
- package/dist/nylas-web-elements/p-8a3965ba.entry.js +0 -2
- package/dist/nylas-web-elements/p-8a3965ba.entry.js.map +0 -1
- package/dist/nylas-web-elements/p-97128be4.entry.js +0 -8
- package/dist/nylas-web-elements/p-97128be4.entry.js.map +0 -1
- package/dist/nylas-web-elements/p-d69f9d47.entry.js +0 -2
- package/dist/nylas-web-elements/p-d69f9d47.entry.js.map +0 -1
- package/dist/nylas-web-elements/p-dcc8ca35.entry.js +0 -2
- package/dist/nylas-web-elements/p-dcc8ca35.entry.js.map +0 -1
- /package/dist/nylas-web-elements/{p-3ce8e281.js.map → p-094be30f.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-c12c18b2.entry.js.map → p-1dbaf879.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-35297f33.entry.js.map → p-3b56d656.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-8e7882a1.js.map → p-3c8b7ba1.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-3204882f.entry.js.map → p-3f5e1e6b.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-5aae729f.js.map → p-4c1fafb4.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-9e11eb2c.js.map → p-6d8e2c6b.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-3362cf82.entry.js.map → p-8f82f281.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-b40f7a77.entry.js.map → p-a42f41f7.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-8340d845.entry.js.map → p-aad611b4.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-6e56eb3f.js.map → p-ab88518b.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-5cf6301e.entry.js.map → p-b3500bf1.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-4d8f9740.entry.js.map → p-b6d863e0.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-50c255fa.entry.js.map → p-b8cf836f.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-996c827d.entry.js.map → p-bf37be06.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-308e7adb.entry.js.map → p-f42e87c6.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-dea32251.js.map → p-f4825eb1.js.map} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nylas-additional-participants.js","sourceRoot":"","sources":["../../../../src/components/scheduler-editor/nylas-additional-participants/nylas-additional-participants.tsx"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAEhE,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,EAAE,OAAO,EAAE,MAAM,EAAgB,MAAM,eAAe,CAAC;AAEvH,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAGtC,OAAO,OAAO,MAAM,cAAc,CAAC;AACnC,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAoCnD,MAAM,OAAO,2BAA2B;;oBAMf,cAAc;;;;;;;;4BAqCE,IAAI,CAAC,iBAAiB,IAAI,EAAE;iCACX,EAAE;6CACR,IAAI;kCACf,KAAK;qBACnB,EAAE;;IAgB3B,yBAAyB,CAAC,QAAgB;QACxC,KAAK,CAAC,+BAA+B,EAAE,2BAA2B,EAAE,QAAQ,CAAC,CAAC;QAC9E,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IAC3C,CAAC;IAID,iDAAiD,CAAC,QAAiB,EAAE,SAAkB,EAAE,QAAgB;QACvG,KAAK,CAAC,+BAA+B,EAAE,mDAAmD,EAAE,QAAQ,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;QAExH,IAAI,QAAQ,KAAK,uBAAuB,EAAE,CAAC;YACzC,IAAI,CAAC,WAAW,CAAC,QAAyB,EAAE,IAAI,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC;QACvE,CAAC;aAAM,IAAI,QAAQ,KAAK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C,CAAC,CAAC,4CAA4C,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,CAC5E,CACA,CACL,CACU,CACb,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF;AA1GC;IAZC,iBAAiB,CAAiH;QACjI,IAAI,EAAE,+BAA+B;QACrC,YAAY,EAAE,IAAI,GAAG,CAAC;YACpB,CAAC,wCAAwC,EAAE,oBAAoB,CAAC;YAChE,CAAC,uCAAuC,EAAE,uBAAuB,CAAC;YAClE,CAAC,6BAA6B,EAAE,aAAa,CAAC;YAC9C,CAAC,2BAA2B,EAAE,sBAAsB,CAAC;YACrD,CAAC,kCAAkC,EAAE,kBAAkB,CAAC;SACzD,CAAC;QACF,YAAY,EAAE,EAAE;QAChB,iBAAiB,EAAE,IAAI;KACxB,CAAC;;;;yDA0GD","sourcesContent":["import { RegisterComponent } from '@/common/register-component';\nimport { NylasSchedulerConfigConnector } from '@/connector/nylas-scheduler-config-connector';\nimport { debug } from '@/utils/utils';\nimport { AttachInternals, Component, Host, Prop, State, Watch, h, Element, Listen, EventEmitter } from '@stencil/core';\nimport { NylasSchedulerEditor } from '../nylas-scheduler-editor/nylas-scheduler-editor';\nimport { Event } from '@stencil/core';\nimport { AdditionalParticipant, Calendar, Configuration } from '@nylas/core';\nimport { User } from '@/common/nylas-api-request';\nimport i18next from '@/utils/i18n';\nimport { LANGUAGE_CODE } from '@/common/constants';\n\ntype Participant = {\n name?: string;\n email: string;\n is_valid?: boolean;\n is_organizer?: boolean;\n availability?: Availability;\n booking?: Booking;\n};\ntype Availability = {\n calendar_ids: string[];\n};\ntype Booking = {\n calendar_id: string;\n};\n\n/**\n * The `nylas-additional-participants` component is a form input for adding additional participants to an event.\n *\n * @part nadtnlpart__title - The title of the component.\n * @part nadtnlpart__subtitle - The subtitle of the component.\n * @part nadtnlpart__content - The content of the component.\n * @part nadtnlpart__input_group - The input group of the component.\n * @part nadtnlpart__input_wrapper - The input wrapper of the component.\n * @part nadtnlpart__input - The input of the component.\n * @part nadtnlpart__remove-participant - The remove participant button of the component.\n * @part nadtnlpart__add-participant - The add participant button of the component.\n *\n */\n@Component({\n tag: 'nylas-additional-participants',\n styleUrl: 'nylas-additional-participants.scss',\n shadow: true,\n formAssociated: true,\n})\nexport class NylasAdditionalParticipants {\n @Element() host!: HTMLNylasAdditionalParticipantsElement;\n /**\n * @standalone\n * The name of the component\n */\n @Prop() name: string = 'participants';\n /**\n * @standalone\n * The selected config\n */\n @Prop() selectedConfiguration?: Configuration;\n /**\n * @standalone\n * The logged in user\n */\n @Prop() currentUser?: User;\n /**\n * @standalone\n * The list of user's calendars.\n */\n @Prop() currentUserCalendars?: Calendar[];\n /**\n * @standalone\n * The additional participants options from the config\n */\n @Prop() participantOptions?: AdditionalParticipant[];\n /**\n * @standalone\n * The event participants\n */\n @Prop() eventParticipants?: Participant[];\n /**\n * @standalone\n * If the config is round robin\n */\n @Prop() roundRobinConfig?: boolean;\n /**\n * The selected language.\n */\n @Prop() selectedLanguage?: LANGUAGE_CODE;\n\n @AttachInternals() internals!: ElementInternals;\n @State() participants: Participant[] = this.eventParticipants ?? [];\n @State() participantErrors: { [key: string]: string } = {};\n @State() includeOrganizerAsParticipant: boolean = true;\n @State() isRoundRobinConfig: boolean = false;\n @State() error: string = '';\n\n /**\n * This event is fired when the selected participants change.\n */\n @Event() valueChanged!: EventEmitter<{\n value: string;\n name: string;\n }>;\n\n /**\n * When a name prop is passed, stencil does not automatically set the name attribute on the host element.\n * Since this component is form-associated, the name attribute is required for form submission.\n * This is a workaround to ensure that the name attribute is set on the host element.\n */\n @Watch('name')\n elementNameChangedHandler(newValue: string) {\n debug('nylas-additional-participants', 'elementNameChangedHandler', newValue);\n this.host.setAttribute('name', newValue);\n }\n\n @Watch('currentUser')\n @Watch('selectedConfiguration')\n selectedConfigurationAndCurrentUserChangedHandler(newValue: unknown, _oldValue: unknown, propName: string) {\n debug('nylas-additional-participants', 'selectedConfigurationAndCurrentUserChangedHandler', newValue, this.currentUser);\n\n if (propName === 'selectedConfiguration') {\n this.updateState(newValue as Configuration, this.currentUser, false);\n } else if (propName === 'currentUser') {\n this.updateState(this.selectedConfiguration, newValue as User, false);\n }\n }\n\n @Watch('selectedLanguage')\n selectedLanguageChangedHandler(newVal: LANGUAGE_CODE, oldVal: LANGUAGE_CODE) {\n if (newVal === oldVal) return;\n i18next.changeLanguage(newVal);\n if (this.error) {\n this.error = i18next.t('nylasAdditionalParticipants.error');\n }\n }\n\n connectedCallback() {\n debug('nylas-additional-participants', 'connectedCallback');\n }\n\n componentWillLoad() {\n debug('nylas-additional-participants', 'componentWillLoad');\n this.host.setAttribute('name', this.name);\n }\n\n componentDidLoad() {\n debug('nylas-additional-participants', 'componentDidLoad');\n if (this.selectedConfiguration) {\n this.updateState(this.selectedConfiguration, this.currentUser, false);\n } else if (this.eventParticipants) {\n this.participants = this.eventParticipants || [];\n this.isRoundRobinConfig = this.roundRobinConfig || false;\n this.updateFormValue(true);\n }\n }\n\n disconnectedCallback() {\n debug('nylas-additional-participants', 'disconnectedCallback');\n }\n\n private updateState(selectedConfig?: Configuration, currentUser?: User, valueChanged: boolean = true) {\n this.isRoundRobinConfig = selectedConfig?.availability?.availability_rules?.availability_method\n ? selectedConfig?.availability?.availability_rules?.availability_method !== 'collective'\n : false;\n this.participants = selectedConfig?.participants || this.eventParticipants || [];\n this.includeOrganizerAsParticipant = this.isRoundRobinConfig && this.participants.find(p => p.email === currentUser?.email) ? true : false;\n this.updateOrganizerAsParticipant(valueChanged);\n }\n\n /**\n * This method is essentially a workaround to check if the internals are available because\n * the unit tests in stencil do not support the internals.\n * @returns boolean\n */\n get isInternalsAvailable() {\n return this.internals !== undefined && typeof this.internals.setFormValue === 'function' && typeof this.internals.setValidity === 'function';\n }\n\n @Listen('inputOptionChanged')\n onInputOptionChanged(event: CustomEvent<{ value: string; name: string }>) {\n debug('nylas-additional-participants', 'onInputOptionChanged');\n const EMAIL_REGEX = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$/;\n const index = event.detail.name;\n const participant = this.participantOptions?.find(participant => participant.email === event.detail.value);\n\n if (!participant && this.isRoundRobinConfig) {\n this.isInternalsAvailable && this.internals.setValidity({ customError: true }, 'For round robin configuration, participant should be selected from the dropdown.');\n this.participantErrors[index] = 'For round robin page, participant should be selected from the dropdown.';\n this.participants[index].is_valid = false;\n this.participants = [...this.participants];\n return;\n } else if (!participant && !EMAIL_REGEX.test(event.detail.value)) {\n this.isInternalsAvailable && this.internals.setValidity({ customError: true }, 'Please enter a valid email address');\n this.participantErrors[index] = 'Please enter a valid email address';\n this.participants[index].is_valid = false;\n this.participants = [...this.participants];\n return;\n } else {\n this.participantErrors[index] = '';\n this.participants[index].is_valid = true;\n this.isInternalsAvailable && this.internals.setValidity({});\n }\n this.participants[index].email = event.detail.value;\n // Default to the is_primary calendar if available, otherwise first calendar for all participants\n const primaryCalendar = participant?.calendars?.find(calendar => calendar.is_primary);\n this.participants[index].availability =\n participant && primaryCalendar?.id ? { calendar_ids: [primaryCalendar.id] } : participant?.calendars[0]?.id ? { calendar_ids: [participant.calendars[0].id] } : undefined;\n // If round-robin config, set booking calendar to is_primary if available, otherwise first calendar for all participants\n this.participants[index].booking =\n participant && this.isRoundRobinConfig && primaryCalendar?.id\n ? { calendar_id: primaryCalendar.id }\n : this.isRoundRobinConfig && participant?.calendars[0]?.id\n ? { calendar_id: participant.calendars[0].id }\n : undefined;\n this.participants[index].name = participant?.name || event.detail.value;\n this.participants = [...this.participants];\n this.updateFormValue();\n }\n\n updateOrganizerAsParticipant(valueChanged: boolean = true) {\n const findCurrentUserInParticipants = this.participants.find(p => p.email === this.currentUser?.email);\n if (this.isRoundRobinConfig && !findCurrentUserInParticipants && this.currentUser?.email) {\n const bookingCalendarDefault = this.currentUserCalendars?.find(calendar => calendar.is_primary)?.id || this.currentUserCalendars?.[0]?.id || 'primary';\n this.participants = [\n {\n name: this.currentUser?.name,\n email: this.currentUser?.email,\n is_organizer: true,\n availability: {\n calendar_ids: [bookingCalendarDefault],\n },\n booking: {\n calendar_id: bookingCalendarDefault,\n },\n },\n ...this.participants,\n ];\n }\n this.updateFormValue(valueChanged);\n }\n\n addParticipant() {\n debug('nylas-additional-participants', 'addParticipant');\n this.participants = [...this.participants, { name: '', email: '', is_organizer: false }];\n this.updateFormValue();\n }\n removeParticipant(index: number) {\n debug('nylas-additional-participants', 'removeParticipant');\n this.participants = this.participants.filter((_, i) => i !== index);\n this.updateFormValue();\n }\n\n updateFormValue(valueChanged = true) {\n debug('nylas-additional-participants', 'updateFormValue');\n const participants = this.isRoundRobinConfig ? (this.includeOrganizerAsParticipant ? this.participants : this.participants.filter(p => !p.is_organizer)) : this.participants;\n if (participants.length === 0) {\n this.error = i18next.t('nylasAdditionalParticipants.error');\n this.isInternalsAvailable && this.internals.setValidity({ customError: true }, this.error);\n } else {\n this.isInternalsAvailable && this.internals.setValidity({});\n this.error = '';\n this.isInternalsAvailable && this.internals.setFormValue(JSON.stringify(participants), this.name);\n if (valueChanged) {\n this.valueChanged.emit({ value: JSON.stringify(participants), name: this.name });\n }\n }\n }\n\n // Filter out the participants that are already added\n getArrayDifference(array1: AdditionalParticipant[], array2: Participant[]) {\n const filtered = array1.filter(participant1 => !array2.some(participant2 => participant1.email === participant2.email));\n return filtered.map(participant => {\n return { value: participant.email, label: participant.email };\n });\n }\n\n @RegisterComponent<NylasAdditionalParticipants, NylasSchedulerConfigConnector, Exclude<NylasSchedulerEditor['stores'], undefined>>({\n name: 'nylas-additional-participants',\n stateToProps: new Map([\n ['schedulerConfig.additionalParticipants', 'participantOptions'],\n ['schedulerConfig.selectedConfiguration', 'selectedConfiguration'],\n ['schedulerConfig.currentUser', 'currentUser'],\n ['schedulerConfig.calendars', 'currentUserCalendars'],\n ['schedulerConfig.selectedLanguage', 'selectedLanguage'],\n ]),\n eventToProps: {},\n fireRegisterEvent: true,\n })\n render() {\n return (\n <Host part=\"nadtnlpart\">\n <nylas-form-card exportparts=\"nfc, nfc__header\">\n <h3 slot=\"header-title\" class=\"nylas-additional-participants__title\" part=\"nadtnlpart__title\">\n {i18next.t('nylasAdditionalParticipants.headerTitle')}\n </h3>\n <p slot=\"header-subtitle\" class=\"nylas-additional-participants__subtitle\" part=\"nadtnlpart__subtitle\">\n {i18next.t('nylasAdditionalParticipants.headerSubTitle')}\n </p>\n <div slot=\"content\" class=\"nylas-additional-participants__content\" part=\"nadtnlpart__content\">\n <div>\n {this.participants.map((participant, index) => {\n return (\n <div class={'nylas-additional-participants__input_group'} part=\"nadtnlpart__input_group\">\n {!participant.is_organizer && <label>{`${i18next.t('nylasAdditionalParticipants.participant')} ${index}`}</label>}\n <div\n part=\"nadtnlpart__input_wrapper\"\n class={{\n 'nylas-additional-participants__input_wrapper': true,\n 'nylas-additional-participants__input_wrapper_organizer': participant?.is_organizer === true,\n 'nylas-additional-participants__input_wrapper_invalid': participant.is_valid === false,\n 'error': participant.is_valid === false,\n }}\n >\n <div class={{ 'nylas-additional-participants__input': true, 'organizer': participant?.is_organizer === true }} part=\"nadtnlpart__input\">\n {participant.is_organizer ? (\n <input-component\n class={'label-input'}\n name={`${index}`}\n key={index}\n label={i18next.t('nylasAdditionalParticipants.organizer')}\n required={false}\n readOnly={participant.is_organizer}\n defaultValue={participant.email}\n >\n {this.isRoundRobinConfig && (\n <div class=\"required-input\" slot=\"additional-input\">\n <input\n type=\"checkbox\"\n name={`organizer_participant`}\n id={`organizer_participant`}\n onClick={() => {\n this.includeOrganizerAsParticipant = !this.includeOrganizerAsParticipant;\n this.updateFormValue();\n }}\n checked={this.includeOrganizerAsParticipant}\n />\n <label htmlFor={`organizer_participant`} aria-label=\"Include as participant\">\n <span class=\"org-as-participant\" part=\"nadtnlpart__org-as-participant\">\n {i18next.t('nylasAdditionalParticipants.organizerAsParticipant')}\n </span>\n <tooltip-component id=\"organizer_participant_tooltip\">\n <info-icon slot=\"tooltip-icon\" />\n <span slot=\"tooltip-content\">\n <strong>{i18next.t('nylasAdditionalParticipants.tooltip.includeOrganizer')}:</strong>{' '}\n {i18next.t('nylasAdditionalParticipants.tooltip.includeOrganizerDesc')} <br />\n <strong>{i18next.t('nylasAdditionalParticipants.tooltip.excludeOrganizer')}:</strong>{' '}\n {i18next.t('nylasAdditionalParticipants.tooltip.excludeOrganizerDesc')}\n </span>\n </tooltip-component>\n </label>\n </div>\n )}\n </input-component>\n ) : (\n <input-dropdown\n id={`${index}`}\n name={`${index}`}\n filterable={true}\n inputValue={participant.email}\n options={this.getArrayDifference(this.participantOptions || [], this.participants)}\n />\n )}\n {!participant.is_organizer && (\n <button onClick={() => this.removeParticipant(index)} part=\"nadtnlpart__remove-participant\">\n <close-icon />\n </button>\n )}\n </div>\n </div>\n {!participant.is_valid && (\n <p class=\"nylas-additional-participants__error\" part=\"nadtnlpart__error\">\n {this.participantErrors[index]}\n </p>\n )}\n </div>\n );\n })}\n <p class=\"nylas-additional-participants__error\" part=\"nadtnlpart__error\">\n {this.error}\n </p>\n </div>\n <button class=\"nylas-additional-participants__add\" part=\"nadtnlpart__add-participant\" onClick={() => this.addParticipant()}>\n <add-circle-icon />{' '}\n <span>\n {this.participants.length > 1\n ? i18next.t('nylasAdditionalParticipants.addParticipant', { context: 'next' })\n : i18next.t('nylasAdditionalParticipants.addParticipant', { context: 'first' })}\n </span>\n </button>\n </div>\n </nylas-form-card>\n </Host>\n );\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"nylas-additional-participants.js","sourceRoot":"","sources":["../../../../src/components/scheduler-editor/nylas-additional-participants/nylas-additional-participants.tsx"],"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AAG,EAAE,CAAC,IAAI,CAAC,cAAc,EAAE;wBACxH,yEAAmB;wBAAC,GAAG;wBACvB,+DACG,IAAI,CAAC,YAAY,CAAC,MAAM,GAAG,CAAC;4BAC3B,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,4CAA4C,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC;4BAC9E,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,4CAA4C,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,CAC5E,CACA,CACL,CACU,CACb,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF;AA5GC;IAZC,iBAAiB,CAAiH;QACjI,IAAI,EAAE,+BAA+B;QACrC,YAAY,EAAE,IAAI,GAAG,CAAC;YACpB,CAAC,wCAAwC,EAAE,oBAAoB,CAAC;YAChE,CAAC,uCAAuC,EAAE,uBAAuB,CAAC;YAClE,CAAC,6BAA6B,EAAE,aAAa,CAAC;YAC9C,CAAC,2BAA2B,EAAE,sBAAsB,CAAC;YACrD,CAAC,kCAAkC,EAAE,kBAAkB,CAAC;SACzD,CAAC;QACF,YAAY,EAAE,EAAE;QAChB,iBAAiB,EAAE,IAAI;KACxB,CAAC;;;;yDA4GD","sourcesContent":["import { RegisterComponent } from '@/common/register-component';\nimport { NylasSchedulerConfigConnector } from '@/connector/nylas-scheduler-config-connector';\nimport { debug } from '@/utils/utils';\nimport { AttachInternals, Component, Host, Prop, State, Watch, h, Element, Listen, EventEmitter } from '@stencil/core';\nimport { NylasSchedulerEditor } from '../nylas-scheduler-editor/nylas-scheduler-editor';\nimport { Event } from '@stencil/core';\nimport { AdditionalParticipant, Calendar, Configuration } from '@nylas/core';\nimport { User } from '@/common/nylas-api-request';\nimport i18next from '@/utils/i18n';\nimport { LANGUAGE_CODE } from '@/common/constants';\n\ntype Participant = {\n name?: string;\n email: string;\n is_valid?: boolean;\n is_organizer?: boolean;\n availability?: Availability;\n booking?: Booking;\n};\ntype Availability = {\n calendar_ids: string[];\n};\ntype Booking = {\n calendar_id: string;\n};\n\n/**\n * The `nylas-additional-participants` component is a form input for adding additional participants to an event.\n *\n * @part nadtnlpart__title - The title of the component.\n * @part nadtnlpart__subtitle - The subtitle of the component.\n * @part nadtnlpart__content - The content of the component.\n * @part nadtnlpart__input_group - The input group of the component.\n * @part nadtnlpart__input_wrapper - The input wrapper of the component.\n * @part nadtnlpart__input - The input of the component.\n * @part nadtnlpart__remove-participant - The remove participant button of the component.\n * @part nadtnlpart__add-participant - The add participant button of the component.\n *\n */\n@Component({\n tag: 'nylas-additional-participants',\n styleUrl: 'nylas-additional-participants.scss',\n shadow: true,\n formAssociated: true,\n})\nexport class NylasAdditionalParticipants {\n @Element() host!: HTMLNylasAdditionalParticipantsElement;\n /**\n * @standalone\n * The name of the component\n */\n @Prop() name: string = 'participants';\n /**\n * @standalone\n * The selected config\n */\n @Prop() selectedConfiguration?: Configuration;\n /**\n * @standalone\n * The logged in user\n */\n @Prop() currentUser?: User;\n /**\n * @standalone\n * The list of user's calendars.\n */\n @Prop() currentUserCalendars?: Calendar[];\n /**\n * @standalone\n * The additional participants options from the config\n */\n @Prop() participantOptions?: AdditionalParticipant[];\n /**\n * @standalone\n * The event participants\n */\n @Prop() eventParticipants?: Participant[];\n /**\n * @standalone\n * If the config is round robin\n */\n @Prop() roundRobinConfig?: boolean;\n /**\n * The selected language.\n */\n @Prop() selectedLanguage?: LANGUAGE_CODE;\n\n @AttachInternals() internals!: ElementInternals;\n @State() participants: Participant[] = this.eventParticipants ?? [];\n @State() participantErrors: { [key: string]: string } = {};\n @State() includeOrganizerAsParticipant: boolean = true;\n @State() isRoundRobinConfig: boolean = false;\n @State() error: string = '';\n @State() requiredError: string = '';\n @State() patternError: string = '';\n\n /**\n * This event is fired when the selected participants change.\n */\n @Event() valueChanged!: EventEmitter<{\n value: string;\n name: string;\n }>;\n\n /**\n * When a name prop is passed, stencil does not automatically set the name attribute on the host element.\n * Since this component is form-associated, the name attribute is required for form submission.\n * This is a workaround to ensure that the name attribute is set on the host element.\n */\n @Watch('name')\n elementNameChangedHandler(newValue: string) {\n debug('nylas-additional-participants', 'elementNameChangedHandler', newValue);\n this.host.setAttribute('name', newValue);\n }\n\n @Watch('currentUser')\n @Watch('selectedConfiguration')\n selectedConfigurationAndCurrentUserChangedHandler(newValue: unknown, _oldValue: unknown, propName: string) {\n debug('nylas-additional-participants', 'selectedConfigurationAndCurrentUserChangedHandler', newValue, this.currentUser);\n\n if (propName === 'selectedConfiguration') {\n this.updateState(newValue as Configuration, this.currentUser, false);\n } else if (propName === 'currentUser') {\n this.updateState(this.selectedConfiguration, newValue as User, false);\n }\n }\n\n @Watch('selectedLanguage')\n selectedLanguageChangedHandler(newVal: LANGUAGE_CODE, oldVal: LANGUAGE_CODE) {\n if (newVal === oldVal) return;\n i18next.changeLanguage(newVal);\n this.requiredError = i18next.t('fieldRequired', { field: i18next.t('email') });\n this.patternError = i18next.t('invalidInputFormat', { field: i18next.t('email') });\n if (this.error) {\n this.error = i18next.t('nylasAdditionalParticipants.error');\n }\n }\n\n connectedCallback() {\n debug('nylas-additional-participants', 'connectedCallback');\n }\n\n componentWillLoad() {\n debug('nylas-additional-participants', 'componentWillLoad');\n this.host.setAttribute('name', this.name);\n }\n\n componentDidLoad() {\n debug('nylas-additional-participants', 'componentDidLoad');\n if (this.selectedConfiguration) {\n this.updateState(this.selectedConfiguration, this.currentUser, false);\n } else if (this.eventParticipants) {\n this.participants = this.eventParticipants || [];\n this.isRoundRobinConfig = this.roundRobinConfig || false;\n this.updateFormValue(true);\n }\n }\n\n disconnectedCallback() {\n debug('nylas-additional-participants', 'disconnectedCallback');\n }\n\n private updateState(selectedConfig?: Configuration, currentUser?: User, valueChanged: boolean = true) {\n this.isRoundRobinConfig = selectedConfig?.availability?.availability_rules?.availability_method\n ? selectedConfig?.availability?.availability_rules?.availability_method !== 'collective'\n : false;\n this.participants = selectedConfig?.participants || this.eventParticipants || [];\n this.includeOrganizerAsParticipant = this.isRoundRobinConfig && this.participants.find(p => p.email === currentUser?.email) ? true : false;\n this.updateOrganizerAsParticipant(valueChanged);\n }\n\n /**\n * This method is essentially a workaround to check if the internals are available because\n * the unit tests in stencil do not support the internals.\n * @returns boolean\n */\n get isInternalsAvailable() {\n return this.internals !== undefined && typeof this.internals.setFormValue === 'function' && typeof this.internals.setValidity === 'function';\n }\n\n @Listen('inputOptionChanged')\n onInputOptionChanged(event: CustomEvent<{ value: string; name: string }>) {\n debug('nylas-additional-participants', 'onInputOptionChanged');\n const EMAIL_REGEX = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$/;\n const index = event.detail.name;\n const participant = this.participantOptions?.find(participant => participant.email === event.detail.value);\n\n if (!participant && this.isRoundRobinConfig) {\n this.isInternalsAvailable && this.internals.setValidity({ customError: true }, 'For round robin configuration, participant should be selected from the dropdown.');\n this.participantErrors[index] = 'For round robin page, participant should be selected from the dropdown.';\n this.participants[index].is_valid = false;\n this.participants = [...this.participants];\n return;\n } else if (!participant && !EMAIL_REGEX.test(event.detail.value)) {\n this.isInternalsAvailable && this.internals.setValidity({ customError: true }, i18next.t('nylasAdditionalParticipants.error_email'));\n this.participantErrors[index] = i18next.t('nylasAdditionalParticipants.error_email');\n this.participants[index].is_valid = false;\n this.participants = [...this.participants];\n return;\n } else {\n this.participantErrors[index] = '';\n this.participants[index].is_valid = true;\n this.isInternalsAvailable && this.internals.setValidity({});\n }\n this.participants[index].email = event.detail.value;\n // Default to the is_primary calendar if available, otherwise first calendar for all participants\n const primaryCalendar = participant?.calendars?.find(calendar => calendar.is_primary);\n this.participants[index].availability =\n participant && primaryCalendar?.id ? { calendar_ids: [primaryCalendar.id] } : participant?.calendars[0]?.id ? { calendar_ids: [participant.calendars[0].id] } : undefined;\n // If round-robin config, set booking calendar to is_primary if available, otherwise first calendar for all participants\n this.participants[index].booking =\n participant && this.isRoundRobinConfig && primaryCalendar?.id\n ? { calendar_id: primaryCalendar.id }\n : this.isRoundRobinConfig && participant?.calendars[0]?.id\n ? { calendar_id: participant.calendars[0].id }\n : undefined;\n this.participants[index].name = participant?.name || event.detail.value;\n this.participants = [...this.participants];\n this.updateFormValue();\n }\n\n updateOrganizerAsParticipant(valueChanged: boolean = true) {\n const findCurrentUserInParticipants = this.participants.find(p => p.email === this.currentUser?.email);\n if (this.isRoundRobinConfig && !findCurrentUserInParticipants && this.currentUser?.email) {\n const bookingCalendarDefault = this.currentUserCalendars?.find(calendar => calendar.is_primary)?.id || this.currentUserCalendars?.[0]?.id || 'primary';\n this.participants = [\n {\n name: this.currentUser?.name,\n email: this.currentUser?.email,\n is_organizer: true,\n availability: {\n calendar_ids: [bookingCalendarDefault],\n },\n booking: {\n calendar_id: bookingCalendarDefault,\n },\n },\n ...this.participants,\n ];\n }\n this.updateFormValue(valueChanged);\n }\n\n addParticipant() {\n debug('nylas-additional-participants', 'addParticipant');\n this.participants = [...this.participants, { name: '', email: '', is_organizer: false }];\n this.updateFormValue();\n }\n removeParticipant(index: number) {\n debug('nylas-additional-participants', 'removeParticipant');\n this.participants = this.participants.filter((_, i) => i !== index);\n this.updateFormValue();\n }\n\n updateFormValue(valueChanged = true) {\n debug('nylas-additional-participants', 'updateFormValue');\n const participants = this.isRoundRobinConfig ? (this.includeOrganizerAsParticipant ? this.participants : this.participants.filter(p => !p.is_organizer)) : this.participants;\n if (participants.length === 0) {\n this.error = i18next.t('nylasAdditionalParticipants.error');\n this.isInternalsAvailable && this.internals.setValidity({ customError: true }, this.error);\n } else {\n this.isInternalsAvailable && this.internals.setValidity({});\n this.error = '';\n this.isInternalsAvailable && this.internals.setFormValue(JSON.stringify(participants), this.name);\n if (valueChanged) {\n this.valueChanged.emit({ value: JSON.stringify(participants), name: this.name });\n }\n }\n }\n\n // Filter out the participants that are already added\n getArrayDifference(array1: AdditionalParticipant[], array2: Participant[]) {\n const filtered = array1.filter(participant1 => !array2.some(participant2 => participant1.email === participant2.email));\n return filtered.map(participant => {\n return { value: participant.email, label: participant.email };\n });\n }\n\n @RegisterComponent<NylasAdditionalParticipants, NylasSchedulerConfigConnector, Exclude<NylasSchedulerEditor['stores'], undefined>>({\n name: 'nylas-additional-participants',\n stateToProps: new Map([\n ['schedulerConfig.additionalParticipants', 'participantOptions'],\n ['schedulerConfig.selectedConfiguration', 'selectedConfiguration'],\n ['schedulerConfig.currentUser', 'currentUser'],\n ['schedulerConfig.calendars', 'currentUserCalendars'],\n ['schedulerConfig.selectedLanguage', 'selectedLanguage'],\n ]),\n eventToProps: {},\n fireRegisterEvent: true,\n })\n render() {\n return (\n <Host part=\"nadtnlpart\">\n <nylas-form-card exportparts=\"nfc, nfc__header\">\n <h3 slot=\"header-title\" class=\"nylas-additional-participants__title\" part=\"nadtnlpart__title\">\n {i18next.t('nylasAdditionalParticipants.headerTitle')}\n </h3>\n <p slot=\"header-subtitle\" class=\"nylas-additional-participants__subtitle\" part=\"nadtnlpart__subtitle\">\n {i18next.t('nylasAdditionalParticipants.headerSubTitle')}\n </p>\n <div slot=\"content\" class=\"nylas-additional-participants__content\" part=\"nadtnlpart__content\">\n <div>\n {this.participants.map((participant, index) => {\n return (\n <div class={'nylas-additional-participants__input_group'} part=\"nadtnlpart__input_group\">\n {!participant.is_organizer && <label>{`${i18next.t('nylasAdditionalParticipants.participant')} ${index}`}</label>}\n <div\n part=\"nadtnlpart__input_wrapper\"\n class={{\n 'nylas-additional-participants__input_wrapper': true,\n 'nylas-additional-participants__input_wrapper_organizer': participant?.is_organizer === true,\n 'nylas-additional-participants__input_wrapper_invalid': participant.is_valid === false,\n 'error': participant.is_valid === false,\n }}\n >\n <div class={{ 'nylas-additional-participants__input': true, 'organizer': participant?.is_organizer === true }} part=\"nadtnlpart__input\">\n {participant.is_organizer ? (\n <input-component\n class={'label-input'}\n name={`${index}`}\n key={index}\n label={i18next.t('nylasAdditionalParticipants.organizer')}\n required={false}\n requiredError={this.requiredError}\n patternError={this.patternError}\n readOnly={participant.is_organizer}\n defaultValue={participant.email}\n >\n {this.isRoundRobinConfig && (\n <div class=\"required-input\" slot=\"additional-input\">\n <input\n type=\"checkbox\"\n name={`organizer_participant`}\n id={`organizer_participant`}\n onClick={() => {\n this.includeOrganizerAsParticipant = !this.includeOrganizerAsParticipant;\n this.updateFormValue();\n }}\n checked={this.includeOrganizerAsParticipant}\n />\n <label htmlFor={`organizer_participant`} aria-label=\"Include as participant\">\n <span class=\"org-as-participant\" part=\"nadtnlpart__org-as-participant\">\n {i18next.t('nylasAdditionalParticipants.organizerAsParticipant')}\n </span>\n <tooltip-component id=\"organizer_participant_tooltip\">\n <info-icon slot=\"tooltip-icon\" />\n <span slot=\"tooltip-content\">\n <strong>{i18next.t('nylasAdditionalParticipants.tooltip.includeOrganizer')}:</strong>{' '}\n {i18next.t('nylasAdditionalParticipants.tooltip.includeOrganizerDesc')} <br />\n <strong>{i18next.t('nylasAdditionalParticipants.tooltip.excludeOrganizer')}:</strong>{' '}\n {i18next.t('nylasAdditionalParticipants.tooltip.excludeOrganizerDesc')}\n </span>\n </tooltip-component>\n </label>\n </div>\n )}\n </input-component>\n ) : (\n <input-dropdown\n id={`${index}`}\n name={`${index}`}\n filterable={true}\n inputValue={participant.email}\n options={this.getArrayDifference(this.participantOptions || [], this.participants)}\n />\n )}\n {!participant.is_organizer && (\n <button onClick={() => this.removeParticipant(index)} part=\"nadtnlpart__remove-participant\">\n <close-icon />\n </button>\n )}\n </div>\n </div>\n {!participant.is_valid && (\n <p class=\"nylas-additional-participants__error\" part=\"nadtnlpart__error\">\n {this.participantErrors[index]}\n </p>\n )}\n </div>\n );\n })}\n <p class=\"nylas-additional-participants__error\" part=\"nadtnlpart__error\">\n {this.error}\n </p>\n </div>\n <button class=\"nylas-additional-participants__add\" part=\"nadtnlpart__add-participant\" onClick={() => this.addParticipant()}>\n <add-circle-icon />{' '}\n <span>\n {this.participants.length > 1\n ? i18next.t('nylasAdditionalParticipants.addParticipant', { context: 'next' })\n : i18next.t('nylasAdditionalParticipants.addParticipant', { context: 'first' })}\n </span>\n </button>\n </div>\n </nylas-form-card>\n </Host>\n );\n }\n}\n"]}
|
|
@@ -27,6 +27,8 @@ export class NylasBookingConfirmationRedirect {
|
|
|
27
27
|
this.currentRedirectUrl = '';
|
|
28
28
|
this.acceptUrl = undefined;
|
|
29
29
|
this.componentLoaded = false;
|
|
30
|
+
this.requiredError = '';
|
|
31
|
+
this.patternError = '';
|
|
30
32
|
}
|
|
31
33
|
elementNameChangedHandler(newValue) {
|
|
32
34
|
debug('nylas-booking-confirmation-redirect', 'elementNameChangedHandler', newValue);
|
|
@@ -43,6 +45,8 @@ export class NylasBookingConfirmationRedirect {
|
|
|
43
45
|
if (newVal === oldVal)
|
|
44
46
|
return;
|
|
45
47
|
i18next.changeLanguage(newVal);
|
|
48
|
+
this.requiredError = i18next.t('fieldRequired', { field: i18next.t('redirectUrl') });
|
|
49
|
+
this.patternError = i18next.t('invalidInputFormat', { field: i18next.t('redirectUrl') });
|
|
46
50
|
}
|
|
47
51
|
connectedCallback() {
|
|
48
52
|
debug('nylas-booking-confirmation-redirect', 'connectedCallback');
|
|
@@ -100,8 +104,8 @@ export class NylasBookingConfirmationRedirect {
|
|
|
100
104
|
if (this.acceptUrl && name === 'confirmation-redirect') {
|
|
101
105
|
this.redirectUrlErrorMessage = '';
|
|
102
106
|
if (!isValidUrl(this.currentRedirectUrl)) {
|
|
103
|
-
this.internals.setValidity({ customError: true }, '
|
|
104
|
-
this.redirectUrlErrorMessage = '
|
|
107
|
+
this.internals.setValidity({ customError: true }, i18next.t('nylasBookingConfirmationRedirect.customRedirectUrlErrorMessage'));
|
|
108
|
+
this.redirectUrlErrorMessage = i18next.t('nylasBookingConfirmationRedirect.customRedirectUrlErrorMessage');
|
|
105
109
|
return;
|
|
106
110
|
}
|
|
107
111
|
this.internals.setValidity({});
|
|
@@ -114,8 +118,8 @@ export class NylasBookingConfirmationRedirect {
|
|
|
114
118
|
}
|
|
115
119
|
formSubmittedHandler(_event) {
|
|
116
120
|
if (this.acceptUrl && !isValidUrl(this.currentRedirectUrl)) {
|
|
117
|
-
this.internals.setValidity({ customError: true }, '
|
|
118
|
-
this.redirectUrlErrorMessage = '
|
|
121
|
+
this.internals.setValidity({ customError: true }, i18next.t('nylasBookingConfirmationRedirect.customRedirectUrlErrorMessage'));
|
|
122
|
+
this.redirectUrlErrorMessage = i18next.t('nylasBookingConfirmationRedirect.customRedirectUrlErrorMessage');
|
|
119
123
|
}
|
|
120
124
|
else {
|
|
121
125
|
this.internals.setValidity({});
|
|
@@ -132,7 +136,7 @@ export class NylasBookingConfirmationRedirect {
|
|
|
132
136
|
value: 'custom',
|
|
133
137
|
},
|
|
134
138
|
];
|
|
135
|
-
return (h(Host, { key: '
|
|
139
|
+
return (h(Host, { key: '3f0b860be075b40c1c4c128b3300de4ecccd8057' }, h("div", { key: '75bd98cf98b22ede61543e1c6d4cb3e1a2fab868', class: "nylas-booking-confirmation-redirect", part: "nbcr" }, redirectOptions.length > 0 && (h("div", { class: "nylas-booking-confirmation-redirect__dropdown" }, h("span", { class: "label" }, i18next.t('nylasBookingConfirmationRedirect.dropdownLabel'), h("tooltip-component", null, h("info-icon", { slot: "tooltip-icon" }), h("span", { slot: "tooltip-content" }, i18next.t('nylasBookingConfirmationRedirect.tooltip.desc')))), this.componentLoaded && (h("select-dropdown", { name: "confirmation-redirect-dropdown", options: redirectOptions, withSearch: false, defaultSelectedOption: redirectOptions.find(option => option.value === (this.acceptUrl ? 'custom' : 'default')), exportparts: "sd_dropdown: nbcr__dropdown, sd_dropdown-button: nbcr__dropdown-button, sd_dropdown-content: nbcr__dropdown-content" })), this.acceptUrl && (h("div", null, h("input-component", { name: "confirmation-redirect", id: "confirmation-redirect", type: "text", placeholder: i18next.t('nylasBookingConfirmationRedirect.customRedirectUrlPlaceholder'), required: false, part: "ic__input_wrapper: nbcr__input-textfield", requiredError: this.requiredError, patternError: this.patternError, defaultValue: this.currentRedirectUrl }), this.redirectUrlErrorMessage && h("span", { class: "error-message" }, this.redirectUrlErrorMessage))))))));
|
|
136
140
|
}
|
|
137
141
|
static get is() { return "nylas-booking-confirmation-redirect"; }
|
|
138
142
|
static get encapsulation() { return "shadow"; }
|
|
@@ -265,7 +269,9 @@ export class NylasBookingConfirmationRedirect {
|
|
|
265
269
|
return {
|
|
266
270
|
"currentRedirectUrl": {},
|
|
267
271
|
"acceptUrl": {},
|
|
268
|
-
"componentLoaded": {}
|
|
272
|
+
"componentLoaded": {},
|
|
273
|
+
"requiredError": {},
|
|
274
|
+
"patternError": {}
|
|
269
275
|
};
|
|
270
276
|
}
|
|
271
277
|
static get events() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nylas-booking-confirmation-redirect.js","sourceRoot":"","sources":["../../../../src/components/scheduler-editor/nylas-booking-confirmation-redirect/nylas-booking-confirmation-redirect.tsx"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAEhE,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAE9H,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,OAAO,MAAM,cAAc,CAAC;AACnC,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAiBnD,MAAM,OAAO,gCAAgC;;;oBAWpB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BACE,uBACE,IAAI,EAAC,uBAAuB,EAC5B,EAAE,EAAC,uBAAuB,EAC1B,IAAI,EAAC,MAAM,EACX,WAAW,EAAC,2BAA2B,EACvC,QAAQ,EAAE,KAAK,EACf,IAAI,EAAC,0CAA0C,EAC/C,YAAY,EAAE,IAAI,CAAC,kBAAkB,GACrC;oBACD,IAAI,CAAC,uBAAuB,IAAI,YAAM,KAAK,EAAC,eAAe,IAAE,IAAI,CAAC,uBAAuB,CAAQ,CAC9F,CACP,CACG,CACP,CACG,CACD,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF;AArDC;IApBC,iBAAiB,CAAsH;QACtI,IAAI,EAAE,qCAAqC;QAC3C,YAAY,EAAE,IAAI,GAAG,CAAC;YACpB,CAAC,uCAAuC,EAAE,uBAAuB,CAAC;YAClE,CAAC,kCAAkC,EAAE,kBAAkB,CAAC;SACzD,CAAC;QACF,YAAY,EAAE;YACZ,YAAY,EAAE,KAAK,EACjB,KAAiI,EACjI,8BAA6D,EAC7D,EAAE;gBACF,MAAM,EAAE,YAAY,EAAE,GAAG,KAAK,CAAC,MAAM,CAAC;gBAEtC,IAAI,YAAY,EAAE,CAAC;oBACjB,YAAY,CAAC,KAAK,CAAC,CAAC;gBACtB,CAAC;YACH,CAAC;SACF;QACD,iBAAiB,EAAE,IAAI;KACxB,CAAC;;;;8DAqDD","sourcesContent":["import { RegisterComponent } from '@/common/register-component';\nimport { NylasSchedulerConfigConnector } from '@/connector/nylas-scheduler-config-connector';\nimport { debug } from '@/utils/utils';\nimport { AttachInternals, Component, Element, Event, EventEmitter, Host, Listen, Prop, State, Watch, h } from '@stencil/core';\nimport { NylasSchedulerEditor } from '../nylas-scheduler-editor/nylas-scheduler-editor';\nimport { isValidUrl } from '@/utils/utils';\nimport { Configuration } from '@nylas/core';\nimport i18next from '@/utils/i18n';\nimport { LANGUAGE_CODE } from '@/common/constants';\n\n/**\n * The `nylas-booking-confirmation-redirect` component is a UI component that allows the user to choose a custom redirect URL after a booking is confirmed.\n * @part nbcr - The booking redirect container\n * @part nbcr__header - The header of the booking redirect\n * @part nbcr__dropdown - The dropdown container\n * @part nbcr__dropdown-button - The dropdown button\n * @part nbcr__dropdown-content - The dropdown content\n * @part nbcr__input-textfield - The input field content\n */\n@Component({\n tag: 'nylas-booking-confirmation-redirect',\n styleUrl: 'nylas-booking-confirmation-redirect.scss',\n shadow: true,\n formAssociated: true,\n})\nexport class NylasBookingConfirmationRedirect {\n @Element() host!: HTMLNylasBookingConfirmationRedirectElement;\n /**\n * @standalone\n * The selected config\n */\n @Prop() selectedConfiguration?: Configuration;\n /**\n * @standalone\n * The name of the confirmation redirect link.\n */\n @Prop() name: string = 'confirmation-redirect';\n /**\n * @standalone\n * The custom redirect URL.\n */\n @Prop() redirectUrl: string = '';\n /**\n * @standalone\n * The custom redirect URL error message\n */\n @Prop() redirectUrlErrorMessage: string = '';\n /**\n * The selected language.\n */\n @Prop() selectedLanguage?: LANGUAGE_CODE;\n /**\n * The element internals.\n */\n @AttachInternals() internals!: ElementInternals;\n\n /**\n * The current redirect URL.\n */\n @State() currentRedirectUrl: string = '';\n /**\n * The state for whether a custom URL can be added.\n */\n @State() acceptUrl!: boolean;\n\n @State() componentLoaded: boolean = false;\n\n /**\n * This event is fired when the current redirect URL changes and is valid.\n */\n @Event() valueChanged!: EventEmitter<{\n value: string;\n name: string;\n valueChanged?: (event: CustomEvent<{ value: string; name: string }>) => void;\n }>;\n\n /**\n * When a name prop is passed, stencil does not automatically set the name attribute on the host element.\n * Since this component is form-associated, the name attribute is required for form submission.\n * This is a workaround to ensure that the name attribute is set on the host element.\n */\n @Watch('name')\n elementNameChangedHandler(newValue: string) {\n debug('nylas-booking-confirmation-redirect', 'elementNameChangedHandler', newValue);\n this.host.setAttribute('name', newValue);\n }\n\n @Watch('selectedConfiguration')\n selectedConfigurationChangedHandler(newValue: Configuration) {\n debug('nylas-booking-confirmation-redirect', 'selectedConfigurationChangedHandler', newValue);\n if (newValue?.scheduler?.confirmation_redirect_url) {\n this.currentRedirectUrl = newValue?.scheduler?.confirmation_redirect_url;\n this.acceptUrl = newValue?.scheduler?.confirmation_redirect_url !== '';\n }\n }\n\n @Watch('selectedLanguage')\n selectedLanguageChangedHandler(newVal: LANGUAGE_CODE, oldVal: LANGUAGE_CODE) {\n if (newVal === oldVal) return;\n i18next.changeLanguage(newVal);\n }\n\n // Lifecycle methods\n connectedCallback() {\n debug('nylas-booking-confirmation-redirect', 'connectedCallback');\n }\n\n disconnectedCallback() {\n debug('nylas-booking-confirmation-redirect', 'disconnectedCallback');\n }\n\n componentWillLoad() {\n debug('nylas-booking-confirmation-redirect', 'componentWillLoad');\n // See comment in the @Watch('name') decorator for more information.\n this.host.setAttribute('name', this.name);\n }\n\n componentDidLoad() {\n debug('nylas-booking-confirmation-redirect', 'componentDidLoad');\n if (this.selectedConfiguration) {\n this.selectedConfigurationChangedHandler(this.selectedConfiguration);\n } else {\n this.currentRedirectUrl = this.redirectUrl;\n this.acceptUrl = this.redirectUrl !== '';\n }\n this.componentLoaded = true;\n if (typeof this.internals.setFormValue === 'function') {\n this.internals.setFormValue(this.currentRedirectUrl.toString(), this.name);\n }\n }\n\n componentWillUpdate() {\n debug('nylas-booking-confirmation-redirect', 'componentWillUpdate');\n }\n\n componentDidUpdate() {\n debug('nylas-booking-confirmation-redirect', 'componentDidUpdate');\n }\n\n componentWillRender() {\n debug('nylas-booking-confirmation-redirect', 'componentWillRender');\n }\n\n componentDidRender() {\n debug('nylas-booking-confirmation-redirect', 'componentDidRender');\n }\n\n @Listen('nylasFormDropdownChanged')\n nylasFormDropdownChangedHandler(event: CustomEvent<{ value: string; name: string }>) {\n debug('nylas-booking-confirmation-redirect', 'nylasFormDropdownChangedHandler', event.detail);\n\n const { name, value } = event.detail;\n\n if (name === 'confirmation-redirect-dropdown') {\n if (value === 'custom') {\n this.acceptUrl = true;\n } else {\n this.acceptUrl = false;\n\n // Submit empty string to clear redirect URL\n this.internals.setFormValue('', this.name);\n this.valueChanged.emit({ name: this.name, value: '' });\n }\n }\n }\n\n @Listen('nylasFormInputBlurred')\n nylasFormInputBlurHandler(event: CustomEvent<{ value: string; name: string }>) {\n const { name, value } = event.detail;\n this.currentRedirectUrl = value;\n\n if (this.acceptUrl && name === 'confirmation-redirect') {\n this.redirectUrlErrorMessage = '';\n\n if (!isValidUrl(this.currentRedirectUrl)) {\n this.internals.setValidity({ customError: true }, 'Please enter a valid URL.');\n this.redirectUrlErrorMessage = 'Please enter a valid URL.';\n return;\n }\n this.internals.setValidity({});\n\n // Pass as handler so that if event.defaultPrevented by parent app, this will be skipped.\n const valueChanged = (event: CustomEvent<{ value: string; name: string }>) => {\n const { value } = event.detail;\n this.internals.setFormValue(value.toString(), this.name);\n };\n this.valueChanged.emit({ ...event.detail, valueChanged });\n }\n }\n\n @Listen('formSubmitted', { target: 'document' })\n formSubmittedHandler(_event: CustomEvent) {\n if (this.acceptUrl && !isValidUrl(this.currentRedirectUrl)) {\n this.internals.setValidity({ customError: true }, 'Please enter a valid URL.');\n this.redirectUrlErrorMessage = 'Please enter a valid URL.';\n } else {\n this.internals.setValidity({});\n }\n }\n\n @RegisterComponent<NylasBookingConfirmationRedirect, NylasSchedulerConfigConnector, Exclude<NylasSchedulerEditor['stores'], undefined>>({\n name: 'nylas-booking-confirmation-redirect',\n stateToProps: new Map([\n ['schedulerConfig.selectedConfiguration', 'selectedConfiguration'],\n ['schedulerConfig.selectedLanguage', 'selectedLanguage'],\n ]),\n eventToProps: {\n valueChanged: async (\n event: CustomEvent<{ value: string; name: string; valueChanged?: (event: CustomEvent<{ value: string; name: string }>) => void }>,\n _nylasSchedulerConfigConnector: NylasSchedulerConfigConnector,\n ) => {\n const { valueChanged } = event.detail;\n // If a handler is passed, call it.\n if (valueChanged) {\n valueChanged(event);\n }\n },\n },\n fireRegisterEvent: true,\n })\n render() {\n const redirectOptions = [\n {\n label: i18next.t('nylasBookingConfirmationRedirect.redirectOption', { context: 'default' }),\n value: 'default',\n },\n {\n label: i18next.t('nylasBookingConfirmationRedirect.redirectOption', { context: 'custom' }),\n value: 'custom',\n },\n ];\n\n return (\n <Host>\n <div class=\"nylas-booking-confirmation-redirect\" part=\"nbcr\">\n {redirectOptions.length > 0 && (\n <div class=\"nylas-booking-confirmation-redirect__dropdown\">\n <span class=\"label\">\n {i18next.t('nylasBookingConfirmationRedirect.dropdownLabel')}\n <tooltip-component>\n <info-icon slot=\"tooltip-icon\" />\n <span slot=\"tooltip-content\">{i18next.t('nylasBookingConfirmationRedirect.tooltip.desc')}</span>\n </tooltip-component>\n </span>\n {this.componentLoaded && (\n <select-dropdown\n name=\"confirmation-redirect-dropdown\"\n options={redirectOptions}\n withSearch={false}\n defaultSelectedOption={redirectOptions.find(option => option.value === (this.acceptUrl ? 'custom' : 'default'))}\n exportparts=\"sd_dropdown: nbcr__dropdown, sd_dropdown-button: nbcr__dropdown-button, sd_dropdown-content: nbcr__dropdown-content\"\n />\n )}\n {this.acceptUrl && (\n <div>\n <input-component\n name=\"confirmation-redirect\"\n id=\"confirmation-redirect\"\n type=\"text\"\n placeholder=\"Enter custom redirect URL\"\n required={false}\n part=\"ic__input_wrapper: nbcr__input-textfield\"\n defaultValue={this.currentRedirectUrl}\n />\n {this.redirectUrlErrorMessage && <span class=\"error-message\">{this.redirectUrlErrorMessage}</span>}\n </div>\n )}\n </div>\n )}\n </div>\n </Host>\n );\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"nylas-booking-confirmation-redirect.js","sourceRoot":"","sources":["../../../../src/components/scheduler-editor/nylas-booking-confirmation-redirect/nylas-booking-confirmation-redirect.tsx"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,iB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,CAAQ,CAC9F,CACP,CACG,CACP,CACG,CACD,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF;AAvDC;IApBC,iBAAiB,CAAsH;QACtI,IAAI,EAAE,qCAAqC;QAC3C,YAAY,EAAE,IAAI,GAAG,CAAC;YACpB,CAAC,uCAAuC,EAAE,uBAAuB,CAAC;YAClE,CAAC,kCAAkC,EAAE,kBAAkB,CAAC;SACzD,CAAC;QACF,YAAY,EAAE;YACZ,YAAY,EAAE,KAAK,EACjB,KAAiI,EACjI,8BAA6D,EAC7D,EAAE;gBACF,MAAM,EAAE,YAAY,EAAE,GAAG,KAAK,CAAC,MAAM,CAAC;gBAEtC,IAAI,YAAY,EAAE,CAAC;oBACjB,YAAY,CAAC,KAAK,CAAC,CAAC;gBACtB,CAAC;YACH,CAAC;SACF;QACD,iBAAiB,EAAE,IAAI;KACxB,CAAC;;;;8DAuDD","sourcesContent":["import { RegisterComponent } from '@/common/register-component';\nimport { NylasSchedulerConfigConnector } from '@/connector/nylas-scheduler-config-connector';\nimport { debug } from '@/utils/utils';\nimport { AttachInternals, Component, Element, Event, EventEmitter, Host, Listen, Prop, State, Watch, h } from '@stencil/core';\nimport { NylasSchedulerEditor } from '../nylas-scheduler-editor/nylas-scheduler-editor';\nimport { isValidUrl } from '@/utils/utils';\nimport { Configuration } from '@nylas/core';\nimport i18next from '@/utils/i18n';\nimport { LANGUAGE_CODE } from '@/common/constants';\n\n/**\n * The `nylas-booking-confirmation-redirect` component is a UI component that allows the user to choose a custom redirect URL after a booking is confirmed.\n * @part nbcr - The booking redirect container\n * @part nbcr__header - The header of the booking redirect\n * @part nbcr__dropdown - The dropdown container\n * @part nbcr__dropdown-button - The dropdown button\n * @part nbcr__dropdown-content - The dropdown content\n * @part nbcr__input-textfield - The input field content\n */\n@Component({\n tag: 'nylas-booking-confirmation-redirect',\n styleUrl: 'nylas-booking-confirmation-redirect.scss',\n shadow: true,\n formAssociated: true,\n})\nexport class NylasBookingConfirmationRedirect {\n @Element() host!: HTMLNylasBookingConfirmationRedirectElement;\n /**\n * @standalone\n * The selected config\n */\n @Prop() selectedConfiguration?: Configuration;\n /**\n * @standalone\n * The name of the confirmation redirect link.\n */\n @Prop() name: string = 'confirmation-redirect';\n /**\n * @standalone\n * The custom redirect URL.\n */\n @Prop() redirectUrl: string = '';\n /**\n * @standalone\n * The custom redirect URL error message\n */\n @Prop() redirectUrlErrorMessage: string = '';\n /**\n * The selected language.\n */\n @Prop() selectedLanguage?: LANGUAGE_CODE;\n /**\n * The element internals.\n */\n @AttachInternals() internals!: ElementInternals;\n\n /**\n * The current redirect URL.\n */\n @State() currentRedirectUrl: string = '';\n /**\n * The state for whether a custom URL can be added.\n */\n @State() acceptUrl!: boolean;\n\n @State() componentLoaded: boolean = false;\n\n @State() requiredError: string = '';\n @State() patternError: string = '';\n\n /**\n * This event is fired when the current redirect URL changes and is valid.\n */\n @Event() valueChanged!: EventEmitter<{\n value: string;\n name: string;\n valueChanged?: (event: CustomEvent<{ value: string; name: string }>) => void;\n }>;\n\n /**\n * When a name prop is passed, stencil does not automatically set the name attribute on the host element.\n * Since this component is form-associated, the name attribute is required for form submission.\n * This is a workaround to ensure that the name attribute is set on the host element.\n */\n @Watch('name')\n elementNameChangedHandler(newValue: string) {\n debug('nylas-booking-confirmation-redirect', 'elementNameChangedHandler', newValue);\n this.host.setAttribute('name', newValue);\n }\n\n @Watch('selectedConfiguration')\n selectedConfigurationChangedHandler(newValue: Configuration) {\n debug('nylas-booking-confirmation-redirect', 'selectedConfigurationChangedHandler', newValue);\n if (newValue?.scheduler?.confirmation_redirect_url) {\n this.currentRedirectUrl = newValue?.scheduler?.confirmation_redirect_url;\n this.acceptUrl = newValue?.scheduler?.confirmation_redirect_url !== '';\n }\n }\n\n @Watch('selectedLanguage')\n selectedLanguageChangedHandler(newVal: LANGUAGE_CODE, oldVal: LANGUAGE_CODE) {\n if (newVal === oldVal) return;\n i18next.changeLanguage(newVal);\n this.requiredError = i18next.t('fieldRequired', { field: i18next.t('redirectUrl') });\n this.patternError = i18next.t('invalidInputFormat', { field: i18next.t('redirectUrl') });\n }\n\n // Lifecycle methods\n connectedCallback() {\n debug('nylas-booking-confirmation-redirect', 'connectedCallback');\n }\n\n disconnectedCallback() {\n debug('nylas-booking-confirmation-redirect', 'disconnectedCallback');\n }\n\n componentWillLoad() {\n debug('nylas-booking-confirmation-redirect', 'componentWillLoad');\n // See comment in the @Watch('name') decorator for more information.\n this.host.setAttribute('name', this.name);\n }\n\n componentDidLoad() {\n debug('nylas-booking-confirmation-redirect', 'componentDidLoad');\n if (this.selectedConfiguration) {\n this.selectedConfigurationChangedHandler(this.selectedConfiguration);\n } else {\n this.currentRedirectUrl = this.redirectUrl;\n this.acceptUrl = this.redirectUrl !== '';\n }\n this.componentLoaded = true;\n if (typeof this.internals.setFormValue === 'function') {\n this.internals.setFormValue(this.currentRedirectUrl.toString(), this.name);\n }\n }\n\n componentWillUpdate() {\n debug('nylas-booking-confirmation-redirect', 'componentWillUpdate');\n }\n\n componentDidUpdate() {\n debug('nylas-booking-confirmation-redirect', 'componentDidUpdate');\n }\n\n componentWillRender() {\n debug('nylas-booking-confirmation-redirect', 'componentWillRender');\n }\n\n componentDidRender() {\n debug('nylas-booking-confirmation-redirect', 'componentDidRender');\n }\n\n @Listen('nylasFormDropdownChanged')\n nylasFormDropdownChangedHandler(event: CustomEvent<{ value: string; name: string }>) {\n debug('nylas-booking-confirmation-redirect', 'nylasFormDropdownChangedHandler', event.detail);\n\n const { name, value } = event.detail;\n\n if (name === 'confirmation-redirect-dropdown') {\n if (value === 'custom') {\n this.acceptUrl = true;\n } else {\n this.acceptUrl = false;\n\n // Submit empty string to clear redirect URL\n this.internals.setFormValue('', this.name);\n this.valueChanged.emit({ name: this.name, value: '' });\n }\n }\n }\n\n @Listen('nylasFormInputBlurred')\n nylasFormInputBlurHandler(event: CustomEvent<{ value: string; name: string }>) {\n const { name, value } = event.detail;\n this.currentRedirectUrl = value;\n\n if (this.acceptUrl && name === 'confirmation-redirect') {\n this.redirectUrlErrorMessage = '';\n\n if (!isValidUrl(this.currentRedirectUrl)) {\n this.internals.setValidity({ customError: true }, i18next.t('nylasBookingConfirmationRedirect.customRedirectUrlErrorMessage'));\n this.redirectUrlErrorMessage = i18next.t('nylasBookingConfirmationRedirect.customRedirectUrlErrorMessage');\n return;\n }\n this.internals.setValidity({});\n\n // Pass as handler so that if event.defaultPrevented by parent app, this will be skipped.\n const valueChanged = (event: CustomEvent<{ value: string; name: string }>) => {\n const { value } = event.detail;\n this.internals.setFormValue(value.toString(), this.name);\n };\n this.valueChanged.emit({ ...event.detail, valueChanged });\n }\n }\n\n @Listen('formSubmitted', { target: 'document' })\n formSubmittedHandler(_event: CustomEvent) {\n if (this.acceptUrl && !isValidUrl(this.currentRedirectUrl)) {\n this.internals.setValidity({ customError: true }, i18next.t('nylasBookingConfirmationRedirect.customRedirectUrlErrorMessage'));\n this.redirectUrlErrorMessage = i18next.t('nylasBookingConfirmationRedirect.customRedirectUrlErrorMessage');\n } else {\n this.internals.setValidity({});\n }\n }\n\n @RegisterComponent<NylasBookingConfirmationRedirect, NylasSchedulerConfigConnector, Exclude<NylasSchedulerEditor['stores'], undefined>>({\n name: 'nylas-booking-confirmation-redirect',\n stateToProps: new Map([\n ['schedulerConfig.selectedConfiguration', 'selectedConfiguration'],\n ['schedulerConfig.selectedLanguage', 'selectedLanguage'],\n ]),\n eventToProps: {\n valueChanged: async (\n event: CustomEvent<{ value: string; name: string; valueChanged?: (event: CustomEvent<{ value: string; name: string }>) => void }>,\n _nylasSchedulerConfigConnector: NylasSchedulerConfigConnector,\n ) => {\n const { valueChanged } = event.detail;\n // If a handler is passed, call it.\n if (valueChanged) {\n valueChanged(event);\n }\n },\n },\n fireRegisterEvent: true,\n })\n render() {\n const redirectOptions = [\n {\n label: i18next.t('nylasBookingConfirmationRedirect.redirectOption', { context: 'default' }),\n value: 'default',\n },\n {\n label: i18next.t('nylasBookingConfirmationRedirect.redirectOption', { context: 'custom' }),\n value: 'custom',\n },\n ];\n\n return (\n <Host>\n <div class=\"nylas-booking-confirmation-redirect\" part=\"nbcr\">\n {redirectOptions.length > 0 && (\n <div class=\"nylas-booking-confirmation-redirect__dropdown\">\n <span class=\"label\">\n {i18next.t('nylasBookingConfirmationRedirect.dropdownLabel')}\n <tooltip-component>\n <info-icon slot=\"tooltip-icon\" />\n <span slot=\"tooltip-content\">{i18next.t('nylasBookingConfirmationRedirect.tooltip.desc')}</span>\n </tooltip-component>\n </span>\n {this.componentLoaded && (\n <select-dropdown\n name=\"confirmation-redirect-dropdown\"\n options={redirectOptions}\n withSearch={false}\n defaultSelectedOption={redirectOptions.find(option => option.value === (this.acceptUrl ? 'custom' : 'default'))}\n exportparts=\"sd_dropdown: nbcr__dropdown, sd_dropdown-button: nbcr__dropdown-button, sd_dropdown-content: nbcr__dropdown-content\"\n />\n )}\n {this.acceptUrl && (\n <div>\n <input-component\n name=\"confirmation-redirect\"\n id=\"confirmation-redirect\"\n type=\"text\"\n placeholder={i18next.t('nylasBookingConfirmationRedirect.customRedirectUrlPlaceholder')}\n required={false}\n part=\"ic__input_wrapper: nbcr__input-textfield\"\n requiredError={this.requiredError}\n patternError={this.patternError}\n defaultValue={this.currentRedirectUrl}\n />\n {this.redirectUrlErrorMessage && <span class=\"error-message\">{this.redirectUrlErrorMessage}</span>}\n </div>\n )}\n </div>\n )}\n </div>\n </Host>\n );\n }\n}\n"]}
|
|
@@ -143,11 +143,14 @@ export class NylasConfirmationEmail {
|
|
|
143
143
|
render() {
|
|
144
144
|
const organizer = this.participantsState.find(p => p.is_organizer);
|
|
145
145
|
const organizerName = organizer?.name || organizer?.email;
|
|
146
|
-
return (h(Host, { key: 'f97ea75387183c592ff2d7c125c1749cd5786540' }, h("div", { key: '9a28805654e4c8fb4778d821b92c45cb8c616730', class: "nylas-confirmation-email", part: "nce" }, h("div", { key: '3c9f7313a008cfbe506a211b46b361da4447a481', class: "header", part: "nce__header" }, h("div", { key: '4c980155e1b10a49b50202a6c34e45c3d8882e22' }, h("h3", { key: 'e56be66a98d11404875372d40ea1bca5564c1ba1' }, this.confirmationEmail?.booking_confirmed?.title ||
|
|
147
|
-
i18next.t('nylasConfirmationEmail.
|
|
146
|
+
return (h(Host, { key: 'f97ea75387183c592ff2d7c125c1749cd5786540' }, h("div", { key: '9a28805654e4c8fb4778d821b92c45cb8c616730', class: "nylas-confirmation-email", part: "nce" }, h("div", { key: '3c9f7313a008cfbe506a211b46b361da4447a481', class: "header", part: "nce__header" }, h("div", { key: '4c980155e1b10a49b50202a6c34e45c3d8882e22' }, h("h3", { key: 'e56be66a98d11404875372d40ea1bca5564c1ba1' }, this.confirmationEmail?.booking_confirmed?.title || organizerName
|
|
147
|
+
? i18next.t('nylasConfirmationEmail.headerTitle_withOrganizer', { organizerName: organizerName })
|
|
148
|
+
: i18next.t('nylasConfirmationEmail.headerTitle')), h("p", { key: 'bf710ceb827923da51a2ab5e79217491d39cbc66' }, i18next.t('nylasConfirmationEmail.headerSubTitle'))), this.isConfirmationEmailOpen ? (h("div", { class: "confirmation-email-toggle", part: "nce__confirmation-email-toggle--container" }, h("span", { class: `chevron ${this.isConfirmationEmailOpen ? 'open' : 'closed'} `, onClick: () => this.toggleConfirmationEmail() }, h("chevron-icon", { width: "24", height: "24" })))) : (h("button-component", { variant: 'basic', clickHandler: event => {
|
|
148
149
|
event.preventDefault();
|
|
149
150
|
this.toggleConfirmationEmail();
|
|
150
|
-
} }, h("edit-icon", { width: "16", height: "16" }), i18next.t('nylasConfirmationEmail.editButtonText')))), this.isConfirmationEmailOpen ? (h("div", { class: "nylas-confirmation-email__body", part: "nce__body" }, h("div", { class: "nylas-confirmation-email__section" }, this.nylasBranding && (h("div", { class: "nylas-confirmation-email__row" }, h("label", null, i18next.t('nylasConfirmationEmail.nylasBranding.label'), h("span", { class: "label-icon" }, h("tooltip-component", null, h("info-icon", { slot: "tooltip-icon" }), h("span", { slot: "tooltip-content" }, i18next.t('nylasConfirmationEmail.nylasBranding.tooltip.desc'))))), h("toggle-switch", { exportparts: "ts_label: nce__toggle-label, ts_input: nce_toggle-input, ts_slider: nce_toggle-slider", name: `confirmation-email-show-branding`, checked: this.confirmationEmail?.show_nylas_branding }))), h("div", { class: "nylas-confirmation-email__row" }, h("div", { class: "subsection" }, h("div", { class: "input-container" }, h("label", null, i18next.t('nylasConfirmationEmail.companyLogoUrl.label'), h("span", { class: "label-icon" }, h("tooltip-component", null, h("info-icon", { slot: "tooltip-icon" }), h("span", { slot: "tooltip-content" }, i18next.t('nylasConfirmationEmail.companyLogoUrl.tooltip.desc'))))), this.confirmationEmail && (h("input-image-url", { name: "confirmation-email-logo", exportparts: "iiu__logo-input-textfield: nce__input-image-url", errorMessage: this.invalidImageErrorMessage, imageUrl: this.confirmationEmail?.logo ?? '' }))))), h("div", { class: "nylas-confirmation-email__row full-width-col" }, h("div", { class: "subsection" }, h("h3", null, i18next.t('nylasConfirmationEmail.emailMessage.header')), h("div", { class: "input-container" }, h("label", { htmlFor: "title" }, i18next.t('nylasConfirmationEmail.emailMessage.label'), h("span", { class: "label-icon" }, h("tooltip-component", null, h("info-icon", { slot: "tooltip-icon" }), h("span", { slot: "tooltip-content" }, i18next.t('nylasConfirmationEmail.emailMessage.tooltip.desc'))))), h("input-component", { name: "confirmation-email-title", maxLength: 60, placeholder:
|
|
151
|
+
} }, h("edit-icon", { width: "16", height: "16" }), i18next.t('nylasConfirmationEmail.editButtonText')))), this.isConfirmationEmailOpen ? (h("div", { class: "nylas-confirmation-email__body", part: "nce__body" }, h("div", { class: "nylas-confirmation-email__section" }, this.nylasBranding && (h("div", { class: "nylas-confirmation-email__row" }, h("label", null, i18next.t('nylasConfirmationEmail.nylasBranding.label'), h("span", { class: "label-icon" }, h("tooltip-component", null, h("info-icon", { slot: "tooltip-icon" }), h("span", { slot: "tooltip-content" }, i18next.t('nylasConfirmationEmail.nylasBranding.tooltip.desc'))))), h("toggle-switch", { exportparts: "ts_label: nce__toggle-label, ts_input: nce_toggle-input, ts_slider: nce_toggle-slider", name: `confirmation-email-show-branding`, checked: this.confirmationEmail?.show_nylas_branding }))), h("div", { class: "nylas-confirmation-email__row" }, h("div", { class: "subsection" }, h("div", { class: "input-container" }, h("label", null, i18next.t('nylasConfirmationEmail.companyLogoUrl.label'), h("span", { class: "label-icon" }, h("tooltip-component", null, h("info-icon", { slot: "tooltip-icon" }), h("span", { slot: "tooltip-content" }, i18next.t('nylasConfirmationEmail.companyLogoUrl.tooltip.desc'))))), this.confirmationEmail && (h("input-image-url", { name: "confirmation-email-logo", exportparts: "iiu__logo-input-textfield: nce__input-image-url", errorMessage: this.invalidImageErrorMessage, imageUrl: this.confirmationEmail?.logo ?? '' }))))), h("div", { class: "nylas-confirmation-email__row full-width-col" }, h("div", { class: "subsection" }, h("h3", null, i18next.t('nylasConfirmationEmail.emailMessage.header')), h("div", { class: "input-container" }, h("label", { htmlFor: "title" }, i18next.t('nylasConfirmationEmail.emailMessage.label'), h("span", { class: "label-icon" }, h("tooltip-component", null, h("info-icon", { slot: "tooltip-icon" }), h("span", { slot: "tooltip-content" }, i18next.t('nylasConfirmationEmail.emailMessage.tooltip.desc'))))), h("input-component", { name: "confirmation-email-title", maxLength: 60, placeholder: organizerName
|
|
152
|
+
? i18next.t('nylasConfirmationEmail.headerTitle_withOrganizer', { organizerName: organizerName })
|
|
153
|
+
: i18next.t('nylasConfirmationEmail.headerTitle'), defaultValue: this.confirmationEmail?.booking_confirmed?.title ?? '' })), h("div", { class: "input-container" }, h("textarea-component", { label: i18next.t('nylasConfirmationEmail.emailMessage.additionalInfoLabel'), name: "confirmation-email-body", id: "confirmation-email-body", placeholder: i18next.t('nylasConfirmationEmail.emailMessage.additionalInfoPlaceholder'), tooltip: i18next.t('nylasConfirmationEmail.emailMessage.additionalInfoTooltip'), maxLength: 500, defaultValue: this.confirmationEmail?.booking_confirmed?.body ?? '' }))))))) : (h("div", { class: "nylas-confirmation-email__summary", part: "nce__summary" }, h("p", null, h("span", { class: "summary-icon" }, h("person-clipboard-icon", null)), i18next.t('nylasConfirmationEmail.allHosts')), h("p", null, h("span", { class: "summary-icon" }, h("clock-icon", null)), i18next.t('nylasConfirmationEmail.immediatelyUponBooking')))))));
|
|
151
154
|
}
|
|
152
155
|
static get is() { return "nylas-confirmation-email"; }
|
|
153
156
|
static get encapsulation() { return "shadow"; }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nylas-confirmation-email.js","sourceRoot":"","sources":["../../../../src/components/scheduler-editor/nylas-confirmation-email/nylas-confirmation-email.tsx"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAEhE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAG9H,OAAO,OAAO,MAAM,cAAc,CAAC;AACnC,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAmBnD,MAAM,OAAO,sBAAsB;;;yCAWkB,EAAmB;4BAKhC,EAAE;oBAKjB,6BAA6B;6BAKnB,IAAI;sBAIX,KAAK;;;uCAkBa,IAAI,CAAC,MAAM;iCAKX,IAAI,CAAC,YAAY;wCAKjB,OAAO,CAAC,CAAC,CAAC,8CAA8C,CAAC;;IAYrG,iBAAiB;QACf,KAAK,CAAC,0BAA0B,EAAE,mBAAmB,CAAC,CAAC;IACzD,CAAC;IAED,oBAAoB;QAClB,KA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AAiB,EAAE,IAAI;KACxB,CAAC;;;;oDAmJD","sourcesContent":["import { RegisterComponent } from '@/common/register-component';\nimport { NylasSchedulerConfigConnector } from '@/connector/nylas-scheduler-config-connector';\nimport { debug, sanitize } from '@/utils/utils';\nimport { AttachInternals, Component, Element, Event, EventEmitter, Host, Listen, Prop, State, Watch, h } from '@stencil/core';\nimport { NylasSchedulerEditor } from '../nylas-scheduler-editor/nylas-scheduler-editor';\nimport { Configuration, EmailTemplate, Participant } from '@nylas/core';\nimport i18next from '@/utils/i18n';\nimport { LANGUAGE_CODE } from '@/common/constants';\n\n/**\n * The `nylas-confirmation-email` component is a UI component that allows users to set buffer time before and after an event.\n *\n * @part nce__tab-heading - The nylas-confirmation-email main tab heading\n * @part nce - The nylas-confirmation-email container\n * @part nce__header - The header of the event communication section\n * @part nce__body - The body of the event communication section\n * @part nce__confirmation-email-toggle--container - The confirmation email drawer toggle container\n * @part nce__input-image-url - The input image URL container\n * @part nce__summary - The confirmation card summary container\n */\n@Component({\n tag: 'nylas-confirmation-email',\n styleUrl: 'nylas-confirmation-email.scss',\n shadow: true,\n formAssociated: true,\n})\nexport class NylasConfirmationEmail {\n @Element() host!: HTMLNylasConfirmationEmailElement;\n /**\n * @standalone\n * The selected config\n */\n @Prop() selectedConfiguration?: Configuration;\n /**\n * @standalone\n * The confirmation email template data to display\n */\n @Prop() confirmationEmailTemplate: EmailTemplate = {} as EmailTemplate;\n /**\n * @standalone\n * List of participants\n */\n @Prop() participants: Participant[] = [];\n /**\n * @standalone\n * The name of the component\n */\n @Prop() name: string = 'confirmation-email-template';\n /**\n * @standalone\n * The nylas branding\n */\n @Prop() nylasBranding: boolean = true;\n /**\n * Is the confirmation email card open\n */\n @Prop() isOpen: boolean = false;\n /**\n * The selected language.\n */\n @Prop() selectedLanguage?: LANGUAGE_CODE;\n /**\n * The element internals.\n */\n @AttachInternals() internals!: ElementInternals;\n\n /**\n * The confirmation email template state.\n */\n @State() confirmationEmail!: EmailTemplate;\n\n /**\n * The internal state to store the isOpen state.\n */\n @State() isConfirmationEmailOpen: boolean = this.isOpen;\n\n /**\n * The internal state to store the participants.\n */\n @State() participantsState: Participant[] = this.participants;\n\n /**\n * The error message to display when the image URL is invalid.\n */\n @State() invalidImageErrorMessage: string = i18next.t('nylasConfirmationEmail.error.invalidImageUrl');\n\n /**\n * This event is fired when the email reminders change.\n */\n @Event() valueChanged!: EventEmitter<{\n value: string;\n name: string;\n valueChanged?: (event: CustomEvent<{ value: string; name: string }>) => void;\n }>;\n\n // Lifecycle methods\n connectedCallback() {\n debug('nylas-confirmation-email', 'connectedCallback');\n }\n\n disconnectedCallback() {\n debug('nylas-confirmation-email', 'disconnectedCallback');\n }\n\n componentWillLoad() {\n debug('nylas-confirmation-email', 'componentWillLoad');\n // See comment in the @Watch('name') decorator for more information.\n this.host.setAttribute('name', this.name);\n }\n\n componentDidLoad() {\n debug('nylas-confirmation-email', 'componentDidLoad');\n if (this.selectedConfiguration) {\n this.selectedConfigurationChangedHandler(this.selectedConfiguration);\n } else {\n this.confirmationEmail = { ...this.confirmationEmailTemplate };\n if (typeof this.confirmationEmail?.show_nylas_branding === 'undefined' && this.nylasBranding) {\n this.confirmationEmail = { ...this.confirmationEmail, show_nylas_branding: true };\n } else if (!this.nylasBranding) {\n this.confirmationEmail = { ...this.confirmationEmail, show_nylas_branding: false };\n }\n this.isConfirmationEmailOpen = this.isOpen;\n this.participantsState = this.participants;\n }\n }\n\n /**\n * When a name prop is passed, stencil does not automatically set the name attribute on the host element.\n * Since this component is form-associated, the name attribute is required for form submission.\n * This is a workaround to ensure that the name attribute is set on the host element.\n */\n @Watch('name')\n elementNameChangedHandler(newValue: string) {\n debug('nylas-confirmation-email', 'elementNameChangedHandler', newValue);\n this.host.setAttribute('name', newValue);\n }\n\n @Watch('selectedConfiguration')\n selectedConfigurationChangedHandler(newValue: Configuration) {\n debug('nylas-confirmation-email', 'selectedConfigurationChangedHandler', newValue);\n this.confirmationEmail = { ...(newValue?.scheduler?.email_template || this.confirmationEmailTemplate) };\n if (typeof this.confirmationEmail?.show_nylas_branding === 'undefined' && this.nylasBranding) {\n this.confirmationEmail = { ...this.confirmationEmail, show_nylas_branding: true };\n } else if (!this.nylasBranding) {\n this.confirmationEmail = { ...this.confirmationEmail, show_nylas_branding: false };\n }\n this.isConfirmationEmailOpen = !newValue?.event_booking?.reminders?.length;\n this.participantsState = newValue?.participants || this.participants;\n }\n\n @Watch('nylasBranding')\n nylasBrandingChangedHandler(newValue: boolean) {\n debug('nylas-confirmation-email', 'nylasBrandingChangedHandler', newValue);\n if (typeof this.confirmationEmail?.show_nylas_branding === 'undefined' && newValue) {\n this.confirmationEmail = { ...this.confirmationEmail, show_nylas_branding: true };\n } else if (!newValue) {\n this.confirmationEmail = { ...this.confirmationEmail, show_nylas_branding: false };\n }\n }\n\n @Watch('selectedLanguage')\n selectedLanguageChangedHandler(newVal: LANGUAGE_CODE, oldVal: LANGUAGE_CODE) {\n if (newVal === oldVal) return;\n this.invalidImageErrorMessage = i18next.t('nylasConfirmationEmail.error.invalidImageUrl');\n i18next.changeLanguage(newVal);\n }\n\n @Listen('nylasFormInputChanged')\n async nylasFormInputChangeHandler(event: CustomEvent<{ value: string; name: string; type?: string }>) {\n const { name, value } = event.detail;\n const type = event.detail?.type;\n if (name === 'confirmation-email-title') {\n this.confirmationEmail = { ...this.confirmationEmail, booking_confirmed: { ...(this.confirmationEmail?.booking_confirmed || {}), title: value } };\n this.internals.setFormValue(JSON.stringify(this.confirmationEmail), this.name);\n this.valueChanged.emit({ value: JSON.stringify(this.confirmationEmail), name: this.name });\n } else if (name === 'confirmation-email-body' && type === 'multi_line_text') {\n this.handleEmailBodyChange(event);\n }\n }\n\n @Listen('valueChanged')\n valueChangedHandler(event: CustomEvent<{ value: string; name: string }>) {\n debug('nylas-confirmation-email', 'valueChangedHandler', event.detail);\n const { value, name } = event.detail;\n\n if (name === 'confirmation-email-logo') {\n this.confirmationEmail = { ...this.confirmationEmail, logo: value };\n this.valueChanged.emit({ value: JSON.stringify(this.confirmationEmail), name: this.name });\n if (typeof this.internals.setValidity === 'function' && typeof this.internals.setFormValue === 'function') {\n this.internals.setFormValue(JSON.stringify(this.confirmationEmail), this.name);\n this.internals.setValidity({});\n }\n }\n }\n\n @Listen('nylasFormInputImageUrlInvalid')\n async nylasFormInputImageUrlInvalidHandler(event: CustomEvent<{ value: string; name: string }>) {\n const { value, name } = event.detail;\n if (name === 'confirmation-email-logo' && typeof this.internals.setValidity === 'function') {\n this.internals.setValidity({ customError: true }, i18next.t('nylasConfirmationEmail.error.invalidImageUrl') || value);\n }\n }\n\n @Listen('nylasFormSwitchToggled')\n nyalsFormSwitchToggledHandler(event: CustomEvent<{ checked: boolean; name: string; label: boolean }>) {\n debug('nylas-confirmation-email', 'nyalsFormSwitchToggledHandler', event.detail);\n if (event.detail.name === 'confirmation-email-show-branding') {\n this.confirmationEmail = { ...this.confirmationEmail, show_nylas_branding: event.detail.checked };\n this.internals.setFormValue(JSON.stringify(this.confirmationEmail), this.name);\n this.valueChanged.emit({ value: JSON.stringify(this.confirmationEmail), name: this.name });\n }\n }\n\n updateConfirmationFormValue() {\n debug('nylas-confirmation-email', 'updateConfirmationFormValue');\n this.internals.setFormValue(JSON.stringify(this.confirmationEmail), this.name);\n this.valueChanged.emit({ value: JSON.stringify(this.confirmationEmail), name: this.name });\n }\n\n toggleConfirmationEmail() {\n this.isConfirmationEmailOpen = !this.isConfirmationEmailOpen;\n }\n\n handleEmailBodyChange(event) {\n const value = sanitize(event.detail.value);\n this.confirmationEmail = { ...this.confirmationEmail, booking_confirmed: { ...(this.confirmationEmail?.booking_confirmed || {}), body: value } };\n this.internals.setFormValue(JSON.stringify(this.confirmationEmail), this.name);\n this.valueChanged.emit({ value: JSON.stringify(this.confirmationEmail), name: this.name });\n }\n\n @RegisterComponent<NylasConfirmationEmail, NylasSchedulerConfigConnector, Exclude<NylasSchedulerEditor['stores'], undefined>>({\n name: 'nylas-confirmation-email',\n stateToProps: new Map([\n ['schedulerConfig.selectedConfiguration', 'selectedConfiguration'],\n ['schedulerConfig.selectedLanguage', 'selectedLanguage'],\n ['schedulerConfig.nylasBranding', 'nylasBranding'],\n ]),\n eventToProps: {\n valueChanged: async (\n event: CustomEvent<{ value: string; name: string; valueChanged?: (event: CustomEvent<{ value: string; name: string }>) => void }>,\n _nylasSchedulerConfigConnector: NylasSchedulerConfigConnector,\n ) => {\n const { valueChanged } = event.detail;\n // If a handler is passed, call it.\n if (valueChanged) {\n valueChanged(event);\n }\n },\n },\n fireRegisterEvent: true,\n })\n render() {\n const organizer = this.participantsState.find(p => p.is_organizer);\n const organizerName = organizer?.name || organizer?.email;\n\n return (\n <Host>\n <div class=\"nylas-confirmation-email\" part=\"nce\">\n <div class=\"header\" part=\"nce__header\">\n <div>\n <h3>\n {this.confirmationEmail?.booking_confirmed?.title ||\n i18next.t('nylasConfirmationEmail.headerTitle', { organizerName: `${organizerName ? ` with ${organizerName}` : ''}` })}\n </h3>\n <p>{i18next.t('nylasConfirmationEmail.headerSubTitle')}</p>\n </div>\n {this.isConfirmationEmailOpen ? (\n <div class=\"confirmation-email-toggle\" part=\"nce__confirmation-email-toggle--container\">\n <span class={`chevron ${this.isConfirmationEmailOpen ? 'open' : 'closed'} `} onClick={() => this.toggleConfirmationEmail()}>\n <chevron-icon width=\"24\" height=\"24\" />\n </span>\n </div>\n ) : (\n <button-component\n variant={'basic'}\n clickHandler={event => {\n event.preventDefault();\n this.toggleConfirmationEmail();\n }}\n >\n <edit-icon width=\"16\" height=\"16\"></edit-icon>\n {i18next.t('nylasConfirmationEmail.editButtonText')}\n </button-component>\n )}\n </div>\n\n {this.isConfirmationEmailOpen ? (\n <div class=\"nylas-confirmation-email__body\" part=\"nce__body\">\n <div class=\"nylas-confirmation-email__section\">\n {this.nylasBranding && (\n <div class=\"nylas-confirmation-email__row\">\n <label>\n {i18next.t('nylasConfirmationEmail.nylasBranding.label')}\n <span class=\"label-icon\">\n <tooltip-component>\n <info-icon slot=\"tooltip-icon\" />\n <span slot=\"tooltip-content\">{i18next.t('nylasConfirmationEmail.nylasBranding.tooltip.desc')}</span>\n </tooltip-component>\n </span>\n </label>\n <toggle-switch\n exportparts=\"ts_label: nce__toggle-label, ts_input: nce_toggle-input, ts_slider: nce_toggle-slider\"\n name={`confirmation-email-show-branding`}\n checked={this.confirmationEmail?.show_nylas_branding}\n />\n </div>\n )}\n <div class=\"nylas-confirmation-email__row\">\n <div class=\"subsection\">\n <div class=\"input-container\">\n <label>\n {i18next.t('nylasConfirmationEmail.companyLogoUrl.label')}\n <span class=\"label-icon\">\n <tooltip-component>\n <info-icon slot=\"tooltip-icon\" />\n <span slot=\"tooltip-content\">{i18next.t('nylasConfirmationEmail.companyLogoUrl.tooltip.desc')}</span>\n </tooltip-component>\n </span>\n </label>\n\n {this.confirmationEmail && (\n <input-image-url\n name=\"confirmation-email-logo\"\n exportparts=\"iiu__logo-input-textfield: nce__input-image-url\"\n errorMessage={this.invalidImageErrorMessage}\n imageUrl={this.confirmationEmail?.logo ?? ''}\n />\n )}\n </div>\n </div>\n </div>\n <div class=\"nylas-confirmation-email__row full-width-col\">\n <div class=\"subsection\">\n <h3>{i18next.t('nylasConfirmationEmail.emailMessage.header')}</h3>\n <div class=\"input-container\">\n <label htmlFor=\"title\">\n {i18next.t('nylasConfirmationEmail.emailMessage.label')}\n <span class=\"label-icon\">\n <tooltip-component>\n <info-icon slot=\"tooltip-icon\" />\n <span slot=\"tooltip-content\">{i18next.t('nylasConfirmationEmail.emailMessage.tooltip.desc')}</span>\n </tooltip-component>\n </span>\n </label>\n <input-component\n name=\"confirmation-email-title\"\n maxLength={60}\n placeholder={i18next.t('nylasConfirmationEmail.headerTitle', { organizerName: `${organizerName ? ` with ${organizerName}` : ''}` })}\n defaultValue={this.confirmationEmail?.booking_confirmed?.title ?? ''}\n ></input-component>\n </div>\n <div class=\"input-container\">\n {/* <label htmlFor=\"title\">Email body</label> */}\n <textarea-component\n label={i18next.t('nylasConfirmationEmail.emailMessage.additionalInfoLabel')}\n name=\"confirmation-email-body\"\n id=\"confirmation-email-body\"\n placeholder={i18next.t('nylasConfirmationEmail.emailMessage.additionalInfoPlaceholder')}\n tooltip={i18next.t('nylasConfirmationEmail.emailMessage.additionalInfoTooltip')}\n maxLength={500}\n defaultValue={this.confirmationEmail?.booking_confirmed?.body ?? ''}\n ></textarea-component>\n\n {/* <textarea\n id=\"description\"\n part=\"nrt__textarea\"\n name=\"confirmation-email-body\"\n placeholder='Default body'\n value={this.confirmationEmail?.booking_confirmed?.body ?? ''}\n maxlength=\"500\"\n rows={2}\n onInput={e => this.handleEmailBodyChange(e)}\n ></textarea> */}\n </div>\n </div>\n </div>\n </div>\n </div>\n ) : (\n <div class=\"nylas-confirmation-email__summary\" part=\"nce__summary\">\n <p>\n <span class=\"summary-icon\">\n <person-clipboard-icon></person-clipboard-icon>\n </span>\n {i18next.t('nylasConfirmationEmail.allHosts')}\n </p>\n <p>\n <span class=\"summary-icon\">\n <clock-icon></clock-icon>\n </span>\n {i18next.t('nylasConfirmationEmail.immediatelyUponBooking')}\n </p>\n </div>\n )}\n </div>\n </Host>\n );\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"nylas-confirmation-email.js","sourceRoot":"","sources":["../../../../src/components/scheduler-editor/nylas-confirmation-email/nylas-confirmation-email.tsx"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAEhE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAG9H,OAAO,OAAO,MAAM,cAAc,CAAC;AACnC,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAmBnD,MAAM,OAAO,sBAAsB;;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xD,CAAC,+BAA+B,EAAE,eAAe,CAAC;SACnD,CAAC;QACF,YAAY,EAAE;YACZ,YAAY,EAAE,KAAK,EACjB,KAAiI,EACjI,8BAA6D,EAC7D,EAAE;gBACF,MAAM,EAAE,YAAY,EAAE,GAAG,KAAK,CAAC,MAAM,CAAC;gBAEtC,IAAI,YAAY,EAAE,CAAC;oBACjB,YAAY,CAAC,KAAK,CAAC,CAAC;gBACtB,CAAC;YACH,CAAC;SACF;QACD,iBAAiB,EAAE,IAAI;KACxB,CAAC;;;;oDAwJD","sourcesContent":["import { RegisterComponent } from '@/common/register-component';\nimport { NylasSchedulerConfigConnector } from '@/connector/nylas-scheduler-config-connector';\nimport { debug, sanitize } from '@/utils/utils';\nimport { AttachInternals, Component, Element, Event, EventEmitter, Host, Listen, Prop, State, Watch, h } from '@stencil/core';\nimport { NylasSchedulerEditor } from '../nylas-scheduler-editor/nylas-scheduler-editor';\nimport { Configuration, EmailTemplate, Participant } from '@nylas/core';\nimport i18next from '@/utils/i18n';\nimport { LANGUAGE_CODE } from '@/common/constants';\n\n/**\n * The `nylas-confirmation-email` component is a UI component that allows users to set buffer time before and after an event.\n *\n * @part nce__tab-heading - The nylas-confirmation-email main tab heading\n * @part nce - The nylas-confirmation-email container\n * @part nce__header - The header of the event communication section\n * @part nce__body - The body of the event communication section\n * @part nce__confirmation-email-toggle--container - The confirmation email drawer toggle container\n * @part nce__input-image-url - The input image URL container\n * @part nce__summary - The confirmation card summary container\n */\n@Component({\n tag: 'nylas-confirmation-email',\n styleUrl: 'nylas-confirmation-email.scss',\n shadow: true,\n formAssociated: true,\n})\nexport class NylasConfirmationEmail {\n @Element() host!: HTMLNylasConfirmationEmailElement;\n /**\n * @standalone\n * The selected config\n */\n @Prop() selectedConfiguration?: Configuration;\n /**\n * @standalone\n * The confirmation email template data to display\n */\n @Prop() confirmationEmailTemplate: EmailTemplate = {} as EmailTemplate;\n /**\n * @standalone\n * List of participants\n */\n @Prop() participants: Participant[] = [];\n /**\n * @standalone\n * The name of the component\n */\n @Prop() name: string = 'confirmation-email-template';\n /**\n * @standalone\n * The nylas branding\n */\n @Prop() nylasBranding: boolean = true;\n /**\n * Is the confirmation email card open\n */\n @Prop() isOpen: boolean = false;\n /**\n * The selected language.\n */\n @Prop() selectedLanguage?: LANGUAGE_CODE;\n /**\n * The element internals.\n */\n @AttachInternals() internals!: ElementInternals;\n\n /**\n * The confirmation email template state.\n */\n @State() confirmationEmail!: EmailTemplate;\n\n /**\n * The internal state to store the isOpen state.\n */\n @State() isConfirmationEmailOpen: boolean = this.isOpen;\n\n /**\n * The internal state to store the participants.\n */\n @State() participantsState: Participant[] = this.participants;\n\n /**\n * The error message to display when the image URL is invalid.\n */\n @State() invalidImageErrorMessage: string = i18next.t('nylasConfirmationEmail.error.invalidImageUrl');\n\n /**\n * This event is fired when the email reminders change.\n */\n @Event() valueChanged!: EventEmitter<{\n value: string;\n name: string;\n valueChanged?: (event: CustomEvent<{ value: string; name: string }>) => void;\n }>;\n\n // Lifecycle methods\n connectedCallback() {\n debug('nylas-confirmation-email', 'connectedCallback');\n }\n\n disconnectedCallback() {\n debug('nylas-confirmation-email', 'disconnectedCallback');\n }\n\n componentWillLoad() {\n debug('nylas-confirmation-email', 'componentWillLoad');\n // See comment in the @Watch('name') decorator for more information.\n this.host.setAttribute('name', this.name);\n }\n\n componentDidLoad() {\n debug('nylas-confirmation-email', 'componentDidLoad');\n if (this.selectedConfiguration) {\n this.selectedConfigurationChangedHandler(this.selectedConfiguration);\n } else {\n this.confirmationEmail = { ...this.confirmationEmailTemplate };\n if (typeof this.confirmationEmail?.show_nylas_branding === 'undefined' && this.nylasBranding) {\n this.confirmationEmail = { ...this.confirmationEmail, show_nylas_branding: true };\n } else if (!this.nylasBranding) {\n this.confirmationEmail = { ...this.confirmationEmail, show_nylas_branding: false };\n }\n this.isConfirmationEmailOpen = this.isOpen;\n this.participantsState = this.participants;\n }\n }\n\n /**\n * When a name prop is passed, stencil does not automatically set the name attribute on the host element.\n * Since this component is form-associated, the name attribute is required for form submission.\n * This is a workaround to ensure that the name attribute is set on the host element.\n */\n @Watch('name')\n elementNameChangedHandler(newValue: string) {\n debug('nylas-confirmation-email', 'elementNameChangedHandler', newValue);\n this.host.setAttribute('name', newValue);\n }\n\n @Watch('selectedConfiguration')\n selectedConfigurationChangedHandler(newValue: Configuration) {\n debug('nylas-confirmation-email', 'selectedConfigurationChangedHandler', newValue);\n this.confirmationEmail = { ...(newValue?.scheduler?.email_template || this.confirmationEmailTemplate) };\n if (typeof this.confirmationEmail?.show_nylas_branding === 'undefined' && this.nylasBranding) {\n this.confirmationEmail = { ...this.confirmationEmail, show_nylas_branding: true };\n } else if (!this.nylasBranding) {\n this.confirmationEmail = { ...this.confirmationEmail, show_nylas_branding: false };\n }\n this.isConfirmationEmailOpen = !newValue?.event_booking?.reminders?.length;\n this.participantsState = newValue?.participants || this.participants;\n }\n\n @Watch('nylasBranding')\n nylasBrandingChangedHandler(newValue: boolean) {\n debug('nylas-confirmation-email', 'nylasBrandingChangedHandler', newValue);\n if (typeof this.confirmationEmail?.show_nylas_branding === 'undefined' && newValue) {\n this.confirmationEmail = { ...this.confirmationEmail, show_nylas_branding: true };\n } else if (!newValue) {\n this.confirmationEmail = { ...this.confirmationEmail, show_nylas_branding: false };\n }\n }\n\n @Watch('selectedLanguage')\n selectedLanguageChangedHandler(newVal: LANGUAGE_CODE, oldVal: LANGUAGE_CODE) {\n if (newVal === oldVal) return;\n this.invalidImageErrorMessage = i18next.t('nylasConfirmationEmail.error.invalidImageUrl');\n i18next.changeLanguage(newVal);\n }\n\n @Listen('nylasFormInputChanged')\n async nylasFormInputChangeHandler(event: CustomEvent<{ value: string; name: string; type?: string }>) {\n const { name, value } = event.detail;\n const type = event.detail?.type;\n if (name === 'confirmation-email-title') {\n this.confirmationEmail = { ...this.confirmationEmail, booking_confirmed: { ...(this.confirmationEmail?.booking_confirmed || {}), title: value } };\n this.internals.setFormValue(JSON.stringify(this.confirmationEmail), this.name);\n this.valueChanged.emit({ value: JSON.stringify(this.confirmationEmail), name: this.name });\n } else if (name === 'confirmation-email-body' && type === 'multi_line_text') {\n this.handleEmailBodyChange(event);\n }\n }\n\n @Listen('valueChanged')\n valueChangedHandler(event: CustomEvent<{ value: string; name: string }>) {\n debug('nylas-confirmation-email', 'valueChangedHandler', event.detail);\n const { value, name } = event.detail;\n\n if (name === 'confirmation-email-logo') {\n this.confirmationEmail = { ...this.confirmationEmail, logo: value };\n this.valueChanged.emit({ value: JSON.stringify(this.confirmationEmail), name: this.name });\n if (typeof this.internals.setValidity === 'function' && typeof this.internals.setFormValue === 'function') {\n this.internals.setFormValue(JSON.stringify(this.confirmationEmail), this.name);\n this.internals.setValidity({});\n }\n }\n }\n\n @Listen('nylasFormInputImageUrlInvalid')\n async nylasFormInputImageUrlInvalidHandler(event: CustomEvent<{ value: string; name: string }>) {\n const { value, name } = event.detail;\n if (name === 'confirmation-email-logo' && typeof this.internals.setValidity === 'function') {\n this.internals.setValidity({ customError: true }, i18next.t('nylasConfirmationEmail.error.invalidImageUrl') || value);\n }\n }\n\n @Listen('nylasFormSwitchToggled')\n nyalsFormSwitchToggledHandler(event: CustomEvent<{ checked: boolean; name: string; label: boolean }>) {\n debug('nylas-confirmation-email', 'nyalsFormSwitchToggledHandler', event.detail);\n if (event.detail.name === 'confirmation-email-show-branding') {\n this.confirmationEmail = { ...this.confirmationEmail, show_nylas_branding: event.detail.checked };\n this.internals.setFormValue(JSON.stringify(this.confirmationEmail), this.name);\n this.valueChanged.emit({ value: JSON.stringify(this.confirmationEmail), name: this.name });\n }\n }\n\n updateConfirmationFormValue() {\n debug('nylas-confirmation-email', 'updateConfirmationFormValue');\n this.internals.setFormValue(JSON.stringify(this.confirmationEmail), this.name);\n this.valueChanged.emit({ value: JSON.stringify(this.confirmationEmail), name: this.name });\n }\n\n toggleConfirmationEmail() {\n this.isConfirmationEmailOpen = !this.isConfirmationEmailOpen;\n }\n\n handleEmailBodyChange(event) {\n const value = sanitize(event.detail.value);\n this.confirmationEmail = { ...this.confirmationEmail, booking_confirmed: { ...(this.confirmationEmail?.booking_confirmed || {}), body: value } };\n this.internals.setFormValue(JSON.stringify(this.confirmationEmail), this.name);\n this.valueChanged.emit({ value: JSON.stringify(this.confirmationEmail), name: this.name });\n }\n\n @RegisterComponent<NylasConfirmationEmail, NylasSchedulerConfigConnector, Exclude<NylasSchedulerEditor['stores'], undefined>>({\n name: 'nylas-confirmation-email',\n stateToProps: new Map([\n ['schedulerConfig.selectedConfiguration', 'selectedConfiguration'],\n ['schedulerConfig.selectedLanguage', 'selectedLanguage'],\n ['schedulerConfig.nylasBranding', 'nylasBranding'],\n ]),\n eventToProps: {\n valueChanged: async (\n event: CustomEvent<{ value: string; name: string; valueChanged?: (event: CustomEvent<{ value: string; name: string }>) => void }>,\n _nylasSchedulerConfigConnector: NylasSchedulerConfigConnector,\n ) => {\n const { valueChanged } = event.detail;\n // If a handler is passed, call it.\n if (valueChanged) {\n valueChanged(event);\n }\n },\n },\n fireRegisterEvent: true,\n })\n render() {\n const organizer = this.participantsState.find(p => p.is_organizer);\n const organizerName = organizer?.name || organizer?.email;\n\n return (\n <Host>\n <div class=\"nylas-confirmation-email\" part=\"nce\">\n <div class=\"header\" part=\"nce__header\">\n <div>\n <h3>\n {this.confirmationEmail?.booking_confirmed?.title || organizerName\n ? i18next.t('nylasConfirmationEmail.headerTitle_withOrganizer', { organizerName: organizerName })\n : i18next.t('nylasConfirmationEmail.headerTitle')}\n </h3>\n <p>{i18next.t('nylasConfirmationEmail.headerSubTitle')}</p>\n </div>\n {this.isConfirmationEmailOpen ? (\n <div class=\"confirmation-email-toggle\" part=\"nce__confirmation-email-toggle--container\">\n <span class={`chevron ${this.isConfirmationEmailOpen ? 'open' : 'closed'} `} onClick={() => this.toggleConfirmationEmail()}>\n <chevron-icon width=\"24\" height=\"24\" />\n </span>\n </div>\n ) : (\n <button-component\n variant={'basic'}\n clickHandler={event => {\n event.preventDefault();\n this.toggleConfirmationEmail();\n }}\n >\n <edit-icon width=\"16\" height=\"16\"></edit-icon>\n {i18next.t('nylasConfirmationEmail.editButtonText')}\n </button-component>\n )}\n </div>\n\n {this.isConfirmationEmailOpen ? (\n <div class=\"nylas-confirmation-email__body\" part=\"nce__body\">\n <div class=\"nylas-confirmation-email__section\">\n {this.nylasBranding && (\n <div class=\"nylas-confirmation-email__row\">\n <label>\n {i18next.t('nylasConfirmationEmail.nylasBranding.label')}\n <span class=\"label-icon\">\n <tooltip-component>\n <info-icon slot=\"tooltip-icon\" />\n <span slot=\"tooltip-content\">{i18next.t('nylasConfirmationEmail.nylasBranding.tooltip.desc')}</span>\n </tooltip-component>\n </span>\n </label>\n <toggle-switch\n exportparts=\"ts_label: nce__toggle-label, ts_input: nce_toggle-input, ts_slider: nce_toggle-slider\"\n name={`confirmation-email-show-branding`}\n checked={this.confirmationEmail?.show_nylas_branding}\n />\n </div>\n )}\n <div class=\"nylas-confirmation-email__row\">\n <div class=\"subsection\">\n <div class=\"input-container\">\n <label>\n {i18next.t('nylasConfirmationEmail.companyLogoUrl.label')}\n <span class=\"label-icon\">\n <tooltip-component>\n <info-icon slot=\"tooltip-icon\" />\n <span slot=\"tooltip-content\">{i18next.t('nylasConfirmationEmail.companyLogoUrl.tooltip.desc')}</span>\n </tooltip-component>\n </span>\n </label>\n\n {this.confirmationEmail && (\n <input-image-url\n name=\"confirmation-email-logo\"\n exportparts=\"iiu__logo-input-textfield: nce__input-image-url\"\n errorMessage={this.invalidImageErrorMessage}\n imageUrl={this.confirmationEmail?.logo ?? ''}\n />\n )}\n </div>\n </div>\n </div>\n <div class=\"nylas-confirmation-email__row full-width-col\">\n <div class=\"subsection\">\n <h3>{i18next.t('nylasConfirmationEmail.emailMessage.header')}</h3>\n <div class=\"input-container\">\n <label htmlFor=\"title\">\n {i18next.t('nylasConfirmationEmail.emailMessage.label')}\n <span class=\"label-icon\">\n <tooltip-component>\n <info-icon slot=\"tooltip-icon\" />\n <span slot=\"tooltip-content\">{i18next.t('nylasConfirmationEmail.emailMessage.tooltip.desc')}</span>\n </tooltip-component>\n </span>\n </label>\n <input-component\n name=\"confirmation-email-title\"\n maxLength={60}\n placeholder={\n organizerName\n ? i18next.t('nylasConfirmationEmail.headerTitle_withOrganizer', { organizerName: organizerName })\n : i18next.t('nylasConfirmationEmail.headerTitle')\n }\n defaultValue={this.confirmationEmail?.booking_confirmed?.title ?? ''}\n ></input-component>\n </div>\n <div class=\"input-container\">\n {/* <label htmlFor=\"title\">Email body</label> */}\n <textarea-component\n label={i18next.t('nylasConfirmationEmail.emailMessage.additionalInfoLabel')}\n name=\"confirmation-email-body\"\n id=\"confirmation-email-body\"\n placeholder={i18next.t('nylasConfirmationEmail.emailMessage.additionalInfoPlaceholder')}\n tooltip={i18next.t('nylasConfirmationEmail.emailMessage.additionalInfoTooltip')}\n maxLength={500}\n defaultValue={this.confirmationEmail?.booking_confirmed?.body ?? ''}\n ></textarea-component>\n\n {/* <textarea\n id=\"description\"\n part=\"nrt__textarea\"\n name=\"confirmation-email-body\"\n placeholder='Default body'\n value={this.confirmationEmail?.booking_confirmed?.body ?? ''}\n maxlength=\"500\"\n rows={2}\n onInput={e => this.handleEmailBodyChange(e)}\n ></textarea> */}\n </div>\n </div>\n </div>\n </div>\n </div>\n ) : (\n <div class=\"nylas-confirmation-email__summary\" part=\"nce__summary\">\n <p>\n <span class=\"summary-icon\">\n <person-clipboard-icon></person-clipboard-icon>\n </span>\n {i18next.t('nylasConfirmationEmail.allHosts')}\n </p>\n <p>\n <span class=\"summary-icon\">\n <clock-icon></clock-icon>\n </span>\n {i18next.t('nylasConfirmationEmail.immediatelyUponBooking')}\n </p>\n </div>\n )}\n </div>\n </Host>\n );\n }\n}\n"]}
|
|
@@ -28,6 +28,8 @@ export class NylasCustomEventSlug {
|
|
|
28
28
|
this.urlSlug = undefined;
|
|
29
29
|
this.focus = false;
|
|
30
30
|
this.copied = false;
|
|
31
|
+
this.requiredError = i18next.t('fieldRequired', { field: 'Slug' });
|
|
32
|
+
this.patternError = i18next.t('invalidInputFormat', { field: 'Slug' });
|
|
31
33
|
}
|
|
32
34
|
connectedCallback() {
|
|
33
35
|
debug('nylas-custom-event-slug', 'connectedCallback');
|
|
@@ -73,6 +75,8 @@ export class NylasCustomEventSlug {
|
|
|
73
75
|
if (newVal === oldVal)
|
|
74
76
|
return;
|
|
75
77
|
i18next.changeLanguage(newVal);
|
|
78
|
+
this.requiredError = i18next.t('fieldRequired', { field: 'Slug' });
|
|
79
|
+
this.patternError = i18next.t('invalidInputFormat', { field: 'Slug' });
|
|
76
80
|
}
|
|
77
81
|
async nylasFormInputChangeHandler(event) {
|
|
78
82
|
const { name, value } = event.detail;
|
|
@@ -90,14 +94,14 @@ export class NylasCustomEventSlug {
|
|
|
90
94
|
this.slugErrorMessage = '';
|
|
91
95
|
this.internals.setValidity({});
|
|
92
96
|
this.focus = false;
|
|
93
|
-
if (this.requiresSlug && this.urlSlug === '') {
|
|
94
|
-
this.internals.setValidity({ customError: true }, '
|
|
95
|
-
this.slugErrorMessage = '
|
|
97
|
+
if (this.requiresSlug && this.urlSlug.trim() === '') {
|
|
98
|
+
this.internals.setValidity({ customError: true }, i18next.t('nylasCustomEventSlug.slugRequiredErrorMessage'));
|
|
99
|
+
this.slugErrorMessage = i18next.t('nylasCustomEventSlug.slugRequiredErrorMessage');
|
|
96
100
|
return;
|
|
97
101
|
}
|
|
98
|
-
if (!/^[A-Za-z0-
|
|
99
|
-
this.internals.setValidity({ customError: true }, '
|
|
100
|
-
this.slugErrorMessage = '
|
|
102
|
+
if (!/^[A-Za-z0-9._-]*$/.test(this.urlSlug.trim())) {
|
|
103
|
+
this.internals.setValidity({ customError: true }, i18next.t('nylasCustomEventSlug.slugErrorMessage'));
|
|
104
|
+
this.slugErrorMessage = i18next.t('nylasCustomEventSlug.slugErrorMessage');
|
|
101
105
|
}
|
|
102
106
|
}
|
|
103
107
|
formSubmittedHandler(event) {
|
|
@@ -123,7 +127,7 @@ export class NylasCustomEventSlug {
|
|
|
123
127
|
if (!this.requiresSlug)
|
|
124
128
|
return null;
|
|
125
129
|
const isComponentReady = typeof this.urlSlug !== 'undefined';
|
|
126
|
-
return (h(Host, null, h("div", { class: "nylas-custom-event-slug", part: "nces" }, h("div", { class: "header", part: "nces__header" }, h("div", null, h("h3", null, i18next.t('nylasCustomEventSlug.headerTitle')), h("p", null, i18next.t('nylasCustomEventSlug.headerSubTitle'))), h("div", { class: "drawer-toggle", part: "nces__drawer-toggle--container" }, h("span", { class: `chevron ${this.isOpen ? 'open' : 'closed'} `, onClick: () => this.toggleDrawer() }, h("chevron-icon", { width: "24", height: "24" })))), this.isOpen && (h("div", { class: "nylas-custom-event-slug__body", part: "nces__body" }, h("div", { class: "nylas-custom-event-slug__section" }, h("div", { class: "nylas-custom-event-slug__row" }, h("div", { class: "input-container" }, h("label", null, i18next.t('nylasCustomEventSlug.eventSlugLabel'), h("span", { class: "label-icon" }, h("tooltip-component", null, h("info-icon", { slot: "tooltip-icon" }), h("span", { slot: "tooltip-content" }, i18next.t('nylasCustomEventSlug.tooltip.desc'))))), h("div", { class: { 'nylas-custom-event-slug__input-wrapper': true, 'focus': this.focus, 'error': !!this.slugErrorMessage } }, h("div", { slot: "prefix", class: "prefix" }, "/"), isComponentReady && (h("input-component", { name: "event-slug", id: "event-slug", type: "text", required: false, placeholder: "my-link-name", exportparts: "ic_input: nces__input-textfield", defaultValue: this.urlSlug })), h("div", { slot: "icon", class: { icon: true, disabled: !this.urlSlug }, onClick: () => !this.copied && !!this.urlSlug && this.copyToClipboard() }, this.copied ? (h("div", { class: "copied" }, h("checkmark-icon", { width: "12", height: "18" }), " ", i18next.t('nylasCustomEventSlug.copied'))) : (h("copy-icon", { width: "12", height: "18" })))), this.slugErrorMessage && h("span", { class: "error-message" }, this.slugErrorMessage)))))))));
|
|
130
|
+
return (h(Host, null, h("div", { class: "nylas-custom-event-slug", part: "nces" }, h("div", { class: "header", part: "nces__header" }, h("div", null, h("h3", null, i18next.t('nylasCustomEventSlug.headerTitle')), h("p", null, i18next.t('nylasCustomEventSlug.headerSubTitle'))), h("div", { class: "drawer-toggle", part: "nces__drawer-toggle--container" }, h("span", { class: `chevron ${this.isOpen ? 'open' : 'closed'} `, onClick: () => this.toggleDrawer() }, h("chevron-icon", { width: "24", height: "24" })))), this.isOpen && (h("div", { class: "nylas-custom-event-slug__body", part: "nces__body" }, h("div", { class: "nylas-custom-event-slug__section" }, h("div", { class: "nylas-custom-event-slug__row" }, h("div", { class: "input-container" }, h("label", null, i18next.t('nylasCustomEventSlug.eventSlugLabel'), h("span", { class: "label-icon" }, h("tooltip-component", null, h("info-icon", { slot: "tooltip-icon" }), h("span", { slot: "tooltip-content" }, i18next.t('nylasCustomEventSlug.tooltip.desc'))))), h("div", { class: { 'nylas-custom-event-slug__input-wrapper': true, 'focus': this.focus, 'error': !!this.slugErrorMessage } }, h("div", { slot: "prefix", class: "prefix" }, "/"), isComponentReady && (h("input-component", { name: "event-slug", id: "event-slug", type: "text", required: false, placeholder: "my-link-name", exportparts: "ic_input: nces__input-textfield", defaultValue: this.urlSlug, requiredError: this.requiredError, patternError: this.patternError })), h("div", { slot: "icon", class: { icon: true, disabled: !this.urlSlug }, onClick: () => !this.copied && !!this.urlSlug && this.copyToClipboard() }, this.copied ? (h("div", { class: "copied" }, h("checkmark-icon", { width: "12", height: "18" }), " ", i18next.t('nylasCustomEventSlug.copied'))) : (h("copy-icon", { width: "12", height: "18" })))), this.slugErrorMessage && h("span", { class: "error-message" }, this.slugErrorMessage)))))))));
|
|
127
131
|
}
|
|
128
132
|
static get is() { return "nylas-custom-event-slug"; }
|
|
129
133
|
static get encapsulation() { return "shadow"; }
|
|
@@ -279,7 +283,9 @@ export class NylasCustomEventSlug {
|
|
|
279
283
|
return {
|
|
280
284
|
"urlSlug": {},
|
|
281
285
|
"focus": {},
|
|
282
|
-
"copied": {}
|
|
286
|
+
"copied": {},
|
|
287
|
+
"requiredError": {},
|
|
288
|
+
"patternError": {}
|
|
283
289
|
};
|
|
284
290
|
}
|
|
285
291
|
static get events() {
|