@nylas/react 1.1.0-canary.14 → 1.1.0-canary.15
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/add-circle-icon_2.entry-00dc2c13.cjs +1 -0
- package/dist/add-circle-icon_2.entry-3f834b47.js +26 -0
- package/dist/{archive-icon_7.entry-60311199.cjs → archive-icon_7.entry-25d8b2f0.cjs} +1 -1
- package/dist/{archive-icon_7.entry-0dfc9782.js → archive-icon_7.entry-ca8262ff.js} +15 -15
- package/dist/{arrow-icon.entry-eb53c4cb.cjs → arrow-icon.entry-01192ecf.cjs} +1 -1
- package/dist/{arrow-icon.entry-f38f3014.js → arrow-icon.entry-991ba7cd.js} +2 -2
- package/dist/{bold-icon_3.entry-20e74265.js → bold-icon_3.entry-81a3ff1e.js} +10 -10
- package/dist/{bold-icon_3.entry-d5100ffa.cjs → bold-icon_3.entry-e94dcf5b.cjs} +1 -1
- package/dist/{calendar-cancel-icon.entry-e5d1bc0a.cjs → calendar-cancel-icon.entry-9088fa8b.cjs} +1 -1
- package/dist/{calendar-cancel-icon.entry-0bdee178.js → calendar-cancel-icon.entry-f646c147.js} +5 -5
- package/dist/{calendar-check-icon_2.entry-10af2017.cjs → calendar-check-icon_2.entry-4dc1391a.cjs} +1 -1
- package/dist/{calendar-check-icon_2.entry-f18a2ddb.js → calendar-check-icon_2.entry-a7e4d0e6.js} +7 -7
- package/dist/{calendar-icon.entry-12ca0ae4.js → calendar-icon.entry-1658930c.js} +2 -2
- package/dist/{calendar-icon.entry-bc6f0808.cjs → calendar-icon.entry-1e2acd5c.cjs} +1 -1
- package/dist/{add-circle-icon_22.entry-ab0d5ede.js → calendar-info-icon_25.entry-493c5547.js} +966 -704
- package/dist/calendar-info-icon_25.entry-7513d798.cjs +1 -0
- package/dist/chevron-icon_3.entry-52b97043.cjs +1 -0
- package/dist/chevron-icon_3.entry-b3c7eb44.js +126 -0
- package/dist/{clock-icon_2.entry-ffc9e057.js → clock-icon_2.entry-58f07042.js} +3 -3
- package/dist/{clock-icon_2.entry-7cddf901.cjs → clock-icon_2.entry-882249ee.cjs} +1 -1
- package/dist/close-icon.entry-4a39816a.js +15 -0
- package/dist/close-icon.entry-f1166251.cjs +1 -0
- package/dist/{constants-f34b9c6e-108993e8.cjs → constants-f34b9c6e-1da5094b.cjs} +1 -1
- package/dist/{constants-f34b9c6e-37cabe82.js → constants-f34b9c6e-628beaa8.js} +1 -1
- package/dist/{document-refresh-icon.entry-d1f6259a.cjs → document-refresh-icon.entry-4f581bf4.cjs} +1 -1
- package/dist/{document-refresh-icon.entry-e4636c8e.js → document-refresh-icon.entry-b53316b4.js} +2 -2
- package/dist/elements/index.d.ts +9 -0
- package/dist/{elements-dc5b338e-a37a0510.cjs → elements-dc5b338e-3284591d.cjs} +1 -1
- package/dist/{elements-dc5b338e-c6f2806c.js → elements-dc5b338e-7abe37c6.js} +1 -1
- package/dist/{focus-visible-e8093c16-b62197ad.cjs → focus-visible-e8093c16-cb6c97b1.cjs} +1 -1
- package/dist/{focus-visible-e8093c16-b0821d89.js → focus-visible-e8093c16-d6612604.js} +1 -1
- package/dist/{forward-icon_6.entry-2a694e7c.js → forward-icon_6.entry-d54244f7.js} +9 -9
- package/dist/{forward-icon_6.entry-b81b22f6.cjs → forward-icon_6.entry-e402ad1e.cjs} +2 -2
- package/dist/{globe-icon.entry-c037589b.cjs → globe-icon.entry-db7377d9.cjs} +1 -1
- package/dist/{globe-icon.entry-e794eb52.js → globe-icon.entry-e83c79c2.js} +4 -4
- package/dist/google-logo-icon_4.entry-8818686b.js +429 -0
- package/dist/google-logo-icon_4.entry-fa65ae29.cjs +1 -0
- package/dist/{index-d61429c6.js → index-2d032bec.js} +1288 -1265
- package/dist/index-53420959-41ed02ae.js +5 -0
- package/dist/index-53420959-a76f0327.cjs +1 -0
- package/dist/{index-ef01c714-1e2feefc.js → index-6d9eeb53-91d36348.js} +2 -2
- package/dist/{index-ef01c714-54e17405.cjs → index-6d9eeb53-f478270c.cjs} +1 -1
- package/dist/index-9c04361d.cjs +42 -0
- package/dist/{index.es-74f70f7d-a22eba35.cjs → index.es-9cc0eb3c-2242baf6.cjs} +1 -1
- package/dist/{index.es-74f70f7d-da0e7fcf.js → index.es-9cc0eb3c-ee2ebbe1.js} +1 -1
- package/dist/{info-icon_2.entry-23e3fa8a.cjs → info-icon_2.entry-4b257e73.cjs} +1 -1
- package/dist/{info-icon_2.entry-647915bb.js → info-icon_2.entry-74eb7415.js} +5 -5
- package/dist/input-component.entry-3ef7ce2c.cjs +1 -0
- package/dist/input-component.entry-6bb4a5e8.js +45 -0
- package/dist/input-dropdown_2.entry-a87714fc.cjs +1 -0
- package/dist/input-dropdown_2.entry-f71e4c01.js +209 -0
- package/dist/{loading-icon.entry-1ddd0244.js → loading-icon.entry-30724cb0.js} +2 -2
- package/dist/{loading-icon.entry-98d65a5d.cjs → loading-icon.entry-bb250f1c.cjs} +1 -1
- package/dist/{mailbox-store-050a2914-6fef25fb.js → mailbox-store-64b4ef7c-202f1afd.js} +2 -2
- package/dist/{mailbox-store-050a2914-bd0a86bb.cjs → mailbox-store-64b4ef7c-74f959be.cjs} +1 -1
- package/dist/{nylas-additional-participants.entry-3c598863.cjs → nylas-additional-participants.entry-567c7c2a.cjs} +1 -1
- package/dist/{nylas-additional-participants.entry-0f93e24e.js → nylas-additional-participants.entry-7961be04.js} +5 -5
- package/dist/nylas-booked-event-card_10.entry-c2f889ba.cjs +1 -0
- package/dist/{nylas-booked-event-card_10.entry-9f7869af.js → nylas-booked-event-card_10.entry-ddfcff5e.js} +371 -299
- package/dist/{nylas-custom-booking-flow.entry-877cac85.cjs → nylas-custom-booking-flow.entry-63ed387e.cjs} +1 -1
- package/dist/{nylas-custom-booking-flow.entry-69638c50.js → nylas-custom-booking-flow.entry-a1f66d05.js} +10 -10
- package/dist/{nylas-form-card.entry-4349d07d.cjs → nylas-form-card.entry-6fece0ff.cjs} +1 -1
- package/dist/{nylas-form-card.entry-b2da5266.js → nylas-form-card.entry-ea1153b9.js} +11 -11
- package/dist/{nylas-if-state.entry-62474acb.js → nylas-if-state.entry-05f8f66f.js} +3 -3
- package/dist/{nylas-if-state.entry-9eade180.cjs → nylas-if-state.entry-b75320f0.cjs} +1 -1
- package/dist/{nylas-list-folders.entry-348a784b.js → nylas-list-folders.entry-bd5a1b1d.js} +7 -7
- package/dist/{nylas-list-folders.entry-b32ec92a.cjs → nylas-list-folders.entry-edc61b97.cjs} +1 -1
- package/dist/{nylas-list-threads.entry-7e8044b2.cjs → nylas-list-threads.entry-79ad0944.cjs} +1 -1
- package/dist/{nylas-list-threads.entry-ec1c5fb6.js → nylas-list-threads.entry-f3cd80de.js} +3 -3
- package/dist/{nylas-login.entry-0495d0b5.cjs → nylas-login.entry-68873357.cjs} +1 -1
- package/dist/{nylas-login.entry-f6f1e306.js → nylas-login.entry-b3207e82.js} +7 -7
- package/dist/{nylas-mailbox-pagination.entry-24c82c53.js → nylas-mailbox-pagination.entry-22c5b9ca.js} +2 -2
- package/dist/{nylas-mailbox-pagination.entry-22385ead.cjs → nylas-mailbox-pagination.entry-2ef5b88a.cjs} +1 -1
- package/dist/{nylas-mailbox-toolbar-button.entry-b13b2a58.js → nylas-mailbox-toolbar-button.entry-95bb58b5.js} +9 -9
- package/dist/{nylas-mailbox-toolbar-button.entry-e8e52474.cjs → nylas-mailbox-toolbar-button.entry-f2fa3a8e.cjs} +1 -1
- package/dist/{nylas-mailbox.entry-77f4c37e.cjs → nylas-mailbox.entry-4b1d320f.cjs} +1 -1
- package/dist/{nylas-mailbox.entry-0365fbb0.js → nylas-mailbox.entry-4ef7d18d.js} +6 -6
- package/dist/{nylas-provider.entry-11239372.js → nylas-provider.entry-7f7e098a.js} +6 -6
- package/dist/{nylas-provider.entry-d454a4d1.cjs → nylas-provider.entry-b629340a.cjs} +1 -1
- package/dist/{nylas-scheduler-editor.entry-16473950.cjs → nylas-scheduler-editor.entry-19a29c4c.cjs} +2 -2
- package/dist/{nylas-scheduler-editor.entry-c4d38853.js → nylas-scheduler-editor.entry-2d19593f.js} +13 -7
- package/dist/nylas-scheduling.entry-70454242.cjs +1 -0
- package/dist/{nylas-scheduling.entry-cc2535a9.js → nylas-scheduling.entry-753cb746.js} +61 -61
- package/dist/{nylas-threads-refresh.entry-725ef87d.cjs → nylas-threads-refresh.entry-0a832631.cjs} +1 -1
- package/dist/{nylas-threads-refresh.entry-5a6378fe.js → nylas-threads-refresh.entry-5a774ad7.js} +4 -4
- package/dist/{nylas-threads-search.entry-5e7b6a03.js → nylas-threads-search.entry-451c6d5c.js} +9 -9
- package/dist/nylas-threads-search.entry-5b57688b.cjs +1 -0
- package/dist/{nylas-view-thread.entry-98f8e35b.cjs → nylas-view-thread.entry-7b273955.cjs} +1 -1
- package/dist/{nylas-view-thread.entry-249f0b65.js → nylas-view-thread.entry-e0af8998.js} +3 -3
- package/dist/{people-icon.entry-0ab4b752.cjs → people-icon.entry-c7fb7f6c.cjs} +1 -1
- package/dist/{people-icon.entry-0ed95db0.js → people-icon.entry-de3fada0.js} +6 -6
- package/dist/{play-icon_2.entry-433a8722.js → play-icon_2.entry-58592b64.js} +5 -5
- package/dist/play-icon_2.entry-5b22a7ca.cjs +1 -0
- package/dist/react.cjs +1 -1
- package/dist/react.js +98 -89
- package/dist/{refresh-icon.entry-508a246d.cjs → refresh-icon.entry-876b8aea.cjs} +1 -1
- package/dist/{refresh-icon.entry-b5bee0f4.js → refresh-icon.entry-90756bc6.js} +4 -4
- package/dist/{register-component-e4dc8778-7812a275.cjs → register-component-a5a9ca5d-1fbb27d2.cjs} +1 -1
- package/dist/{register-component-e4dc8778-53fe0729.js → register-component-a5a9ca5d-8bede801.js} +1 -1
- package/dist/{scheduler-config-store-ec3b6190-435c84ca.cjs → scheduler-config-store-ec3b6190-104df545.cjs} +1 -1
- package/dist/{scheduler-config-store-ec3b6190-01892765.js → scheduler-config-store-ec3b6190-cbc40d60.js} +1 -1
- package/dist/scheduler-store-f02ce045-1d93c571.js +390 -0
- package/dist/scheduler-store-f02ce045-712c600c.cjs +1 -0
- package/dist/textarea-component.entry-3ea161d6.js +35 -0
- package/dist/textarea-component.entry-9d6b5cdc.cjs +1 -0
- package/dist/toggle-switch.entry-10aa0c1a.cjs +1 -0
- package/dist/toggle-switch.entry-a08c1027.js +25 -0
- package/dist/{translate-icon.entry-f77cfd3d.cjs → translate-icon.entry-04dde6b1.cjs} +1 -1
- package/dist/{translate-icon.entry-c34bad94.js → translate-icon.entry-be9c3401.js} +6 -6
- package/dist/{warning-icon.entry-f781a623.js → warning-icon.entry-347d77af.js} +5 -5
- package/dist/{warning-icon.entry-f73b31bf.cjs → warning-icon.entry-84121a43.cjs} +1 -1
- package/package.json +3 -3
- package/dist/add-circle-icon_22.entry-c165f0de.cjs +0 -1
- package/dist/chevron-icon_3.entry-55eb864f.js +0 -117
- package/dist/chevron-icon_3.entry-a18c373d.cjs +0 -1
- package/dist/close-icon.entry-7c67181c.js +0 -15
- package/dist/close-icon.entry-918dd254.cjs +0 -1
- package/dist/google-logo-icon_4.entry-748af8c3.cjs +0 -1
- package/dist/google-logo-icon_4.entry-b4464873.js +0 -393
- package/dist/index-53420959-31867ccf.js +0 -5
- package/dist/index-53420959-535906ce.cjs +0 -1
- package/dist/index-6a4ee4f8.cjs +0 -42
- package/dist/nylas-booked-event-card_10.entry-912e4a89.cjs +0 -1
- package/dist/nylas-scheduling.entry-5b156a28.cjs +0 -1
- package/dist/nylas-threads-search.entry-a2553cbe.cjs +0 -1
- package/dist/play-icon_2.entry-f9c0b647.cjs +0 -1
- package/dist/scheduler-store-04e15f8a-5d06eaf3.cjs +0 -1
- package/dist/scheduler-store-04e15f8a-69eb8d7a.js +0 -376
- package/dist/time-period-selector.entry-77a6debf.cjs +0 -1
- package/dist/time-period-selector.entry-a29c8ffa.js +0 -76
|
@@ -1,393 +0,0 @@
|
|
|
1
|
-
import { r as L, h as e, c as p, x as q, d, y as Z, H as z, g as $ } from "./index-d61429c6.js";
|
|
2
|
-
import { R as W } from "./register-component-e4dc8778-53fe0729.js";
|
|
3
|
-
import { D as K } from "./constants-f34b9c6e-37cabe82.js";
|
|
4
|
-
import "react";
|
|
5
|
-
import "react-dom";
|
|
6
|
-
const Q = ".sc-google-logo-icon-h{display:flex}", X = Q, Y = class {
|
|
7
|
-
constructor(n) {
|
|
8
|
-
L(this, n), this.width = "24", this.height = "24";
|
|
9
|
-
}
|
|
10
|
-
render() {
|
|
11
|
-
return e("svg", { key: "27c504c1f369e9516fefbb560b449cb2ca5ff188", width: this.width, height: this.height, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, e("g", { key: "1d3f96ac0e9f1717d23704e667753a4dba3866a9", "clip-path": "url(#clip0_959_12452)" }, e("path", { key: "6089bfc08268d9514c1e4de2c3566083f1b8288f", d: "M23.745 12.27C23.745 11.48 23.675 10.73 23.555 10H12.255V14.51H18.725C18.435 15.99 17.585 17.24 16.325 18.09V21.09H20.185C22.445 19 23.745 15.92 23.745 12.27Z", fill: "#4285F4" }), e("path", { key: "d83b0ae2592680d39ed7576d35f609d8beee7a9f", d: "M12.255 24C15.495 24 18.205 22.92 20.185 21.09L16.325 18.09C15.245 18.81 13.875 19.25 12.255 19.25C9.12504 19.25 6.47505 17.14 5.52505 14.29H1.54504V17.38C3.51504 21.3 7.56504 24 12.255 24Z", fill: "#34A853" }), e("path", { key: "88c1165ba356350d4e28c76a9e936700d7289f6f", d: "M5.52501 14.2901C5.27501 13.5701 5.145 12.8001 5.145 12.0001C5.145 11.2001 5.28501 10.4301 5.52501 9.71012V6.62012H1.545C0.725004 8.24012 0.255005 10.0601 0.255005 12.0001C0.255005 13.9401 0.725004 15.7601 1.545 17.3801L5.52501 14.2901Z", fill: "#FBBC05" }), e("path", { key: "32f6f142412100a001a8d0b71a72b3731130f9a5", d: "M12.255 4.75C14.025 4.75 15.605 5.36 16.855 6.55L20.275 3.13C18.205 1.19 15.495 0 12.255 0C7.56504 0 3.51504 2.7 1.54504 6.62L5.52505 9.71C6.47505 6.86 9.12504 4.75 12.255 4.75Z", fill: "#EA4335" })), e("defs", { key: "f900310e535daa57a4b2abe6d8c77606f884a788" }, e("clipPath", { key: "98c06d2826f0384cb24f48771ed6ce58b80288f8", id: "clip0_959_12452" }, e("rect", { key: "79698f957db9ee94fdf08f3af7b8b9dc91de82dd", width: 24, height: 24, fill: "white" }))));
|
|
12
|
-
}
|
|
13
|
-
};
|
|
14
|
-
Y.style = X;
|
|
15
|
-
const tt = ".sc-microsoft-logo-icon-h{display:flex}", et = tt, nt = class {
|
|
16
|
-
constructor(n) {
|
|
17
|
-
L(this, n), this.width = "22", this.height = "22";
|
|
18
|
-
}
|
|
19
|
-
render() {
|
|
20
|
-
return e("svg", { key: "1223ece54fc605efae38fdc35141dc48811a28ba", width: this.width, height: this.height, viewBox: "0 0 22 22", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, e("path", { key: "ebe0278d1157e75a35414b2ed0b3759ad36d4026", d: "M0.043457 0.043457H10.4782V10.4782H0.043457V0.043457Z", fill: "#F35325" }), e("path", { key: "40b73df249604ca885e7928ecce681847f650ae8", d: "M11.5217 0.043457H21.9565V10.4782H11.5217V0.043457Z", fill: "#81BC06" }), e("path", { key: "8200751904bbe641b6951db6ee0fabf317ce43be", d: "M0.043457 11.5217H10.4782V21.9565H0.043457V11.5217Z", fill: "#05A6F0" }), e("path", { key: "6c7bc8725af9ba16da194784c66f7b17d7c91c12", d: "M11.5217 11.5217H21.9565V21.9565H11.5217V11.5217Z", fill: "#FFBA08" }));
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
|
-
nt.style = et;
|
|
24
|
-
function at({ id: n, formState: t, activeTab: a, calendars: o }) {
|
|
25
|
-
var s;
|
|
26
|
-
switch (a) {
|
|
27
|
-
case "eventInfo":
|
|
28
|
-
const i = t.title, l = t.description, r = parseInt(t.duration), b = t.location;
|
|
29
|
-
return e(
|
|
30
|
-
"div",
|
|
31
|
-
{ key: n },
|
|
32
|
-
e(
|
|
33
|
-
"nylas-event-info",
|
|
34
|
-
null,
|
|
35
|
-
e(
|
|
36
|
-
"div",
|
|
37
|
-
{ slot: "inputs" },
|
|
38
|
-
e("nylas-event-title", { name: "title", eventTitle: i, exportparts: "net, net__title, net__dropdown-content" }),
|
|
39
|
-
e("nylas-event-duration", { name: "duration", eventDurationMinutes: r, exportparts: "ned, ned__dropdown, ned__dropdown-button, ned__dropdown-content, ned__input_dropdown, ned__input_dropdown-input, ned__input_dropdown-content" }),
|
|
40
|
-
e("nylas-event-location", { name: "location", eventLocation: b, exportparts: "nel, nel__location, nel__dropdown, nel__dropdown-button, nel__dropdown-content" }),
|
|
41
|
-
e("nylas-event-description", { name: "description", eventDescription: l, exportparts: "nedesc, nedesc__textarea" })
|
|
42
|
-
)
|
|
43
|
-
)
|
|
44
|
-
);
|
|
45
|
-
case "availability":
|
|
46
|
-
const f = t.availability.openHours, h = t.availability.timezone ? t.availability.timezone : Intl.DateTimeFormat().resolvedOptions().timeZone, u = (s = t.participants) == null ? void 0 : s.find((c) => c.is_organizer), y = (u == null ? void 0 : u.email) ?? "primary", g = t.calendarIds.length > 0 ? t.calendarIds : [y], m = t.bookingCalendar == "primary" ? y : t.bookingCalendar;
|
|
47
|
-
return e(
|
|
48
|
-
"div",
|
|
49
|
-
{ key: n },
|
|
50
|
-
e("nylas-booking-calendar-picker", { name: "booking-calendar", calendars: o ?? [], defaultBookingCalendar: m, exportparts: "nbcp, nbcp__header, nbcp__input-label, nbcp__dropdown, nbcp__dropdown-button, nbcp__dropdown-content" }),
|
|
51
|
-
e("nylas-calendar-picker", { name: "calendars", calendars: o ?? [], defaultSelectedCalendars: g, exportparts: "ncp ncp__header, ncp__dropdown, ncp__dropdown-button, ncp__dropdown-content" }),
|
|
52
|
-
e("nylas-availability-picker", { name: "availability", openHours: f, defaultTimezone: h, exportparts: "nap__header, nap__select-timezone, nap__select-timezone-button, nap__select-timezone-dropdown-content, nap__availability, nap__day, nap__time-ranges, nap__time-range, nap__add-time-range, nap__time-picker-container, nap__time-picker-input, nap__time-picker-times" })
|
|
53
|
-
);
|
|
54
|
-
case "bookingOptions":
|
|
55
|
-
return e(
|
|
56
|
-
"div",
|
|
57
|
-
{ key: n },
|
|
58
|
-
e("nylas-buffer-time", { name: "buffer-time", buffer: t.buffer, exportparts: "nbt, nbt__header, nbt__body, nbt__dropdown-before, nbt__dropdown-button-before, nbt__dropdown-content-before, nbt__dropdown-after, nbt__dropdown-button-after, nbt__dropdown-content-after, nbt__preview" }),
|
|
59
|
-
e(
|
|
60
|
-
"nylas-event-limits",
|
|
61
|
-
null,
|
|
62
|
-
e(
|
|
63
|
-
"div",
|
|
64
|
-
{ slot: "inputs" },
|
|
65
|
-
e("nylas-limit-future-bookings", { name: "limit-future-bookings", availableDaysInFuture: t.availableDaysInFuture, exportparts: "nlfb, nlfb__number-dropdown, nlfb__number-dropdown-button, nlfb__number-dropdown-content, nlfb__period-dropdown, nlfb__period-dropdown-button, nlfb__period-dropdown-content" }),
|
|
66
|
-
e("nylas-min-cancellation-notice", { name: "min-cancellation-notice", minCancellationNotice: t.minCancellationNotice, exportparts: "nmcn, nmcn__number-dropdown, nmcn__number-dropdown-button, nmcn__number-dropdown-content, nmcn__period-dropdown, nmcn__period-dropdown-button, nmcn__period-dropdown-content" })
|
|
67
|
-
)
|
|
68
|
-
)
|
|
69
|
-
);
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
const it = '.sc-nylas-editor-tabs-h{display:block;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif}.scheduler-editor.sc-nylas-editor-tabs{display:flex;flex-direction:column}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs{height:554px;display:grid;grid-template-columns:minmax(224px, 25%) 1fr}@media screen and (max-width: 768px){.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs{display:table-column-group;height:auto}}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tabs.sc-nylas-editor-tabs{display:flex;flex-direction:column;border-right:1px solid var(--nylas-base-200);background-color:var(--nylas-base-25)}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tabs.sc-nylas-editor-tabs .tab.sc-nylas-editor-tabs{display:flex;align-items:center;gap:0.5rem;padding:0.5rem 1rem;color:var(--nylas-base-900);background:var(--nylas-base-0);border:none;height:56px;font-family:var(--nylas-font-family);font-size:16px;font-weight:500;line-height:24px;cursor:pointer}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tabs.sc-nylas-editor-tabs .tab.sc-nylas-editor-tabs:not(:first-of-type){margin-top:0.25rem}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tabs.sc-nylas-editor-tabs .tab.active.sc-nylas-editor-tabs{font-weight:600;background:var(--nylas-base-0);color:var(--nylas-primary);border-left:4px solid var(--nylas-primary);box-shadow:0px 1px 2px 0px rgba(0, 0, 0, 0.0588235294);box-shadow:0px 1px 3px 0px rgba(0, 0, 0, 0.1019607843)}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tab-content.sc-nylas-editor-tabs{max-width:692px;overflow-y:auto}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tab-content.sc-nylas-editor-tabs nylas-event-info.sc-nylas-editor-tabs,.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tab-content.sc-nylas-editor-tabs nylas-event-limits.sc-nylas-editor-tabs{width:inherit}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tab-content.sc-nylas-editor-tabs nylas-event-info.sc-nylas-editor-tabs div[slot=inputs].sc-nylas-editor-tabs,.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tab-content.sc-nylas-editor-tabs nylas-event-limits.sc-nylas-editor-tabs div[slot=inputs].sc-nylas-editor-tabs{display:flex;flex-direction:column;gap:1rem}.footer.sc-nylas-editor-tabs{display:flex;justify-content:space-between;align-items:center;gap:1rem;min-height:80px;padding:0 1rem;border-top:1px solid var(--nylas-base-200)}@media screen and (max-width: 768px){.footer.sc-nylas-editor-tabs{flex-direction:column;height:auto}}@media screen and (max-width: 768px){.footer.sc-nylas-editor-tabs .preview.sc-nylas-editor-tabs{margin-top:1rem;width:100%}}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs{display:flex;justify-content:flex-end;align-items:center;justify-self:flex-end;gap:1rem}@media screen and (max-width: 768px){.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs{flex-direction:column-reverse;width:100%}}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs p.sc-nylas-editor-tabs{max-width:524px}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs p.unsaved-changes.sc-nylas-editor-tabs{color:var(--nylas-base-600)}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs p.saved-changes.sc-nylas-editor-tabs{color:var(--nylas-success)}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs p.error.sc-nylas-editor-tabs{color:var(--nylas-error)}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs p.error-full-width.sc-nylas-editor-tabs{max-width:660px}@media screen and (max-width: 768px){.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs button-component.sc-nylas-editor-tabs{width:100%}}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs button.sc-nylas-editor-tabs{background:var(--nylas-primary);color:var(--nylas-base-0);height:48px;border:none;border-radius:var(--nylas-border-radius-2x);font-size:1rem;line-height:24px;padding:0 1rem;cursor:pointer;width:148px}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs button.sc-nylas-editor-tabs:hover{background:var(--nylas-base-600)}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs button.sc-nylas-editor-tabs:active{background:var(--nylas-base-800)}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs button.sc-nylas-editor-tabs:disabled{background:var(--nylas-base-300);cursor:not-allowed}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs button.sc-nylas-editor-tabs span.sc-nylas-editor-tabs{display:flex;align-items:center;justify-content:center;gap:0.5rem}', st = it;
|
|
73
|
-
var ot = function(n, t, a, o) {
|
|
74
|
-
var s = arguments.length, i = s < 3 ? t : o === null ? o = Object.getOwnPropertyDescriptor(t, a) : o, l;
|
|
75
|
-
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
76
|
-
i = Reflect.decorate(n, t, a, o);
|
|
77
|
-
else
|
|
78
|
-
for (var r = n.length - 1; r >= 0; r--)
|
|
79
|
-
(l = n[r]) && (i = (s < 3 ? l(i) : s > 3 ? l(t, a, i) : l(t, a)) || i);
|
|
80
|
-
return s > 3 && i && Object.defineProperty(t, a, i), i;
|
|
81
|
-
}, B = function(n, t) {
|
|
82
|
-
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
83
|
-
return Reflect.metadata(n, t);
|
|
84
|
-
};
|
|
85
|
-
const G = class {
|
|
86
|
-
constructor(n) {
|
|
87
|
-
L(this, n), this.schedulerConfigChanged = p(this, "schedulerConfigChanged", 7), this.cancelButtonClick = p(this, "cancelButtonClick", 7), this.formSubmitted = p(this, "formSubmitted", 7), this.previewButtonClicked = p(this, "previewButtonClicked", 7), this.setError = (t) => {
|
|
88
|
-
this.error = t.message;
|
|
89
|
-
}, this.formSubmissionHandler = async (t) => {
|
|
90
|
-
var _, w, S, H, I, T, F, E, O, P, R, j, V, M, N, U;
|
|
91
|
-
if (t.preventDefault(), this.formSubmitted.emit(), !this.formRef.checkValidity())
|
|
92
|
-
return;
|
|
93
|
-
this.isLoading = !0, this.hasUnsavedChanges = !1;
|
|
94
|
-
const o = this.updateFormState(), { title: s, description: i, duration: l, availability: r, calendarIds: b, bookingCalendar: f, location: h, bookingType: u, buffer: y, availableDaysInFuture: g, minCancellationNotice: m } = o, c = (w = (_ = this.selectedConfiguration) == null ? void 0 : _.participants) == null ? void 0 : w.find((A) => A.is_organizer), v = {
|
|
95
|
-
...((S = this.selectedConfiguration) == null ? void 0 : S.id) && { id: this.selectedConfiguration.id },
|
|
96
|
-
version: ((H = this.selectedConfiguration) == null ? void 0 : H.version) ?? "1.0.0",
|
|
97
|
-
availability: {
|
|
98
|
-
duration_minutes: l ? parseInt(l) : 0,
|
|
99
|
-
interval_minutes: l ? parseInt(l) : 0,
|
|
100
|
-
availability_rules: {
|
|
101
|
-
availability_method: ((F = (T = (I = this.selectedConfiguration) == null ? void 0 : I.availability) == null ? void 0 : T.availability_rules) == null ? void 0 : F.availability_method) ?? "collective",
|
|
102
|
-
buffer: y || { before: 0, after: 0 },
|
|
103
|
-
default_open_hours: ((P = (O = (E = this.selectedConfiguration) == null ? void 0 : E.availability) == null ? void 0 : O.availability_rules) == null ? void 0 : P.default_open_hours) ?? K,
|
|
104
|
-
round_robin_group_id: ((V = (j = (R = this.selectedConfiguration) == null ? void 0 : R.availability) == null ? void 0 : j.availability_rules) == null ? void 0 : V.round_robin_group_id) ?? ""
|
|
105
|
-
}
|
|
106
|
-
},
|
|
107
|
-
participants: [
|
|
108
|
-
{
|
|
109
|
-
name: (c == null ? void 0 : c.name) ?? (c == null ? void 0 : c.email) ?? ((M = this.currentUser) == null ? void 0 : M.name) ?? ((N = this.currentUser) == null ? void 0 : N.email) ?? "",
|
|
110
|
-
email: (c == null ? void 0 : c.email) ?? ((U = this.currentUser) == null ? void 0 : U.email) ?? "",
|
|
111
|
-
is_organizer: !0,
|
|
112
|
-
availability: {
|
|
113
|
-
calendar_ids: b != null && b.length ? b : ["primary"],
|
|
114
|
-
open_hours: (r == null ? void 0 : r.openHours) ?? []
|
|
115
|
-
},
|
|
116
|
-
booking: {
|
|
117
|
-
calendar_id: f && f !== "" ? f : "primary"
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
],
|
|
121
|
-
event_booking: {
|
|
122
|
-
title: (s == null ? void 0 : s.toString()) ?? "",
|
|
123
|
-
description: (i == null ? void 0 : i.toString()) ?? "",
|
|
124
|
-
location: (h == null ? void 0 : h.toString()) ?? "",
|
|
125
|
-
booking_type: (u == null ? void 0 : u.toString()) ?? "booking",
|
|
126
|
-
timezone: (r == null ? void 0 : r.timezone) ?? Intl.DateTimeFormat().resolvedOptions().timeZone
|
|
127
|
-
},
|
|
128
|
-
scheduler: {
|
|
129
|
-
available_days_in_future: g ?? 30,
|
|
130
|
-
min_cancellation_notice: m ?? 0
|
|
131
|
-
}
|
|
132
|
-
}, C = q(v, this.selectedConfiguration), k = this.action === "create" ? C : v, x = (A) => {
|
|
133
|
-
this.isLoading = !1, this.changesSaved = !0, setTimeout(() => {
|
|
134
|
-
this.changesSaved = !1;
|
|
135
|
-
}, 5e3);
|
|
136
|
-
};
|
|
137
|
-
this.schedulerConfigChanged.emit({ config: k, resetLoadingState: x, setError: this.setError, action: this.action });
|
|
138
|
-
}, this.calendars = void 0, this.selectedConfiguration = void 0, this.currentUser = void 0, this.schedulerPreviewLink = "", this.mode = "app", this.action = "create", this.activeTab = "eventInfo", this.isLoading = !1, this.hasUnsavedChanges = !1, this.changesSaved = !1, this.formState = {}, this.error = "";
|
|
139
|
-
}
|
|
140
|
-
configChangedHandler(n) {
|
|
141
|
-
d("[nylas-editor-tabs]", "configChangedHandler", n, this.selectedConfiguration), this.formState = {
|
|
142
|
-
...this.getFormStateFromConfig(n)
|
|
143
|
-
}, n.id ? this.action = "edit" : this.action = "create";
|
|
144
|
-
}
|
|
145
|
-
connectedCallback() {
|
|
146
|
-
d("[nylas-editor-tabs]", "connectedCallback");
|
|
147
|
-
}
|
|
148
|
-
componentWillLoad() {
|
|
149
|
-
d("[nylas-editor-tabs]", "componentWillLoad"), this.formState = this.getFormStateFromConfig(this.selectedConfiguration);
|
|
150
|
-
}
|
|
151
|
-
componentDidLoad() {
|
|
152
|
-
d("[nylas-editor-tabs]", "componentDidLoad");
|
|
153
|
-
}
|
|
154
|
-
disconnectedCallback() {
|
|
155
|
-
d("[nylas-editor-tabs]", "disconnectedCallback");
|
|
156
|
-
}
|
|
157
|
-
handleValueChanged(n) {
|
|
158
|
-
d("[nylas-editor-tabs]", "handleValueChanged", n);
|
|
159
|
-
const { name: t, value: a } = n.detail;
|
|
160
|
-
this.formState = { ...this.formState, [t]: a }, this.hasUnsavedChanges = !0, this.error = "";
|
|
161
|
-
}
|
|
162
|
-
getFormStateFromConfig(n) {
|
|
163
|
-
var a, o, s, i, l, r, b, f, h, u, y, g, m, c, v, C, k, x, _, w;
|
|
164
|
-
const t = (a = n == null ? void 0 : n.participants) == null ? void 0 : a.find((S) => S.is_organizer);
|
|
165
|
-
return {
|
|
166
|
-
title: ((o = n == null ? void 0 : n.event_booking) == null ? void 0 : o.title) ?? "",
|
|
167
|
-
description: ((s = n == null ? void 0 : n.event_booking) == null ? void 0 : s.description) ?? "",
|
|
168
|
-
duration: ((l = (i = n == null ? void 0 : n.availability) == null ? void 0 : i.duration_minutes) == null ? void 0 : l.toString()) ?? "10",
|
|
169
|
-
availability: {
|
|
170
|
-
timezone: ((r = n == null ? void 0 : n.event_booking) == null ? void 0 : r.timezone) ?? Intl.DateTimeFormat().resolvedOptions().timeZone,
|
|
171
|
-
open_hours: ((b = t == null ? void 0 : t.availability) == null ? void 0 : b.open_hours) ?? void 0
|
|
172
|
-
},
|
|
173
|
-
calendarIds: ((f = t == null ? void 0 : t.availability) == null ? void 0 : f.calendar_ids) ?? [],
|
|
174
|
-
participants: (n == null ? void 0 : n.participants) ?? [],
|
|
175
|
-
bookingCalendar: ((h = t == null ? void 0 : t.booking) == null ? void 0 : h.calendar_id) ?? (t == null ? void 0 : t.email) ?? "",
|
|
176
|
-
location: ((y = (u = this.selectedConfiguration) == null ? void 0 : u.event_booking) == null ? void 0 : y.location) ?? "",
|
|
177
|
-
bookingType: ((m = (g = this.selectedConfiguration) == null ? void 0 : g.event_booking) == null ? void 0 : m.booking_type) ?? "booking",
|
|
178
|
-
buffer: ((C = (v = (c = this.selectedConfiguration) == null ? void 0 : c.availability) == null ? void 0 : v.availability_rules) == null ? void 0 : C.buffer) ?? { before: 0, after: 0 },
|
|
179
|
-
availableDaysInFuture: ((x = (k = this.selectedConfiguration) == null ? void 0 : k.scheduler) == null ? void 0 : x.available_days_in_future) ?? 30,
|
|
180
|
-
minCancellationNotice: ((w = (_ = this.selectedConfiguration) == null ? void 0 : _.scheduler) == null ? void 0 : w.min_cancellation_notice) ?? 0
|
|
181
|
-
};
|
|
182
|
-
}
|
|
183
|
-
updateFormState() {
|
|
184
|
-
return new FormData(this.formRef).forEach((t, a) => {
|
|
185
|
-
switch (a) {
|
|
186
|
-
case "title":
|
|
187
|
-
this.formState.title = t.toString();
|
|
188
|
-
break;
|
|
189
|
-
case "description":
|
|
190
|
-
this.formState.description = t.toString();
|
|
191
|
-
break;
|
|
192
|
-
case "duration":
|
|
193
|
-
this.formState.duration = t.toString();
|
|
194
|
-
break;
|
|
195
|
-
case "availability":
|
|
196
|
-
this.formState.availability = JSON.parse(t.toString());
|
|
197
|
-
break;
|
|
198
|
-
case "participants":
|
|
199
|
-
this.formState.participants = JSON.parse(t.toString());
|
|
200
|
-
break;
|
|
201
|
-
case "calendars":
|
|
202
|
-
this.formState.calendarIds = t.toString().split(",");
|
|
203
|
-
break;
|
|
204
|
-
case "booking-calendar":
|
|
205
|
-
this.formState.bookingCalendar = t.toString();
|
|
206
|
-
break;
|
|
207
|
-
case "location":
|
|
208
|
-
this.formState.location = t.toString();
|
|
209
|
-
break;
|
|
210
|
-
case "booking-type":
|
|
211
|
-
this.formState.bookingType = t.toString();
|
|
212
|
-
break;
|
|
213
|
-
case "buffer-time":
|
|
214
|
-
this.formState.buffer = JSON.parse(t.toString());
|
|
215
|
-
break;
|
|
216
|
-
case "limit-future-bookings":
|
|
217
|
-
this.formState.availableDaysInFuture = parseInt(t.toString());
|
|
218
|
-
break;
|
|
219
|
-
case "min-cancellation-notice":
|
|
220
|
-
this.formState.minCancellationNotice = parseInt(t.toString());
|
|
221
|
-
break;
|
|
222
|
-
}
|
|
223
|
-
}), this.formState = { ...this.formState }, this.formState;
|
|
224
|
-
}
|
|
225
|
-
setActiveTab(n, t) {
|
|
226
|
-
n.preventDefault(), this.updateFormState(), this.activeTab = t;
|
|
227
|
-
}
|
|
228
|
-
render() {
|
|
229
|
-
var n;
|
|
230
|
-
return d("[nylas-editor-tabs]", "render", this.formState), e(z, { key: "3a15824595dbee9a62a39fe192b42b8289d122fb" }, e("form", { key: "a4239f9ff55924bfef3166cd2084756e85172f6e", onSubmit: this.formSubmissionHandler, class: "scheduler-editor", ref: (t) => this.formRef = t, noValidate: !0 }, this.mode === "app" ? e("div", { class: "form-contents" }, e("div", { class: "tabs" }, e("button", { class: { tab: !0, active: this.activeTab == "eventInfo" }, onClick: (t) => this.setActiveTab(t, "eventInfo") }, e("calendar-info-icon", { width: "16", height: "16" }), "Event Info"), e("button", { class: { tab: !0, active: this.activeTab == "availability" }, onClick: (t) => this.setActiveTab(t, "availability") }, e("calendar-patterns-icon", { width: "16", height: "16" }), "Availability"), e("button", { class: { tab: !0, active: this.activeTab == "bookingOptions" }, onClick: (t) => this.setActiveTab(t, "bookingOptions") }, e("flow-icon", { width: "16", height: "16" }), "Booking Options")), e("div", { class: "tab-content" }, e(at, { formState: this.formState, activeTab: this.activeTab, calendars: this.calendars, id: ((n = this.selectedConfiguration) == null ? void 0 : n.id) ?? "new" }))) : e("slot", null), e("div", { key: "611af00bdae4a57a81d5e15b10338f0f73e2eb63", class: "footer" }, e("div", { key: "a0b50b0dc68b6c9ac2b1b2f152b17494a092f5a5", class: "preview" }, this.schedulerPreviewLink !== "" && this.action === "edit" && e("button-component", { type: "button", disabled: this.isLoading, clickHandler: (t) => {
|
|
231
|
-
t.preventDefault(), this.previewButtonClicked.emit(this.host).defaultPrevented || window.open(Z(this.schedulerPreviewLink, this.selectedConfiguration), "_blank");
|
|
232
|
-
}, variant: "basic" }, "Preview")), e("div", { key: "e965241b0d1b44cf94ff56577e10d1d2d89628ac", class: "buttons" }, e("p", { key: "482ce16ace804a25fc28e37cdaa57f47cab4996b", class: {
|
|
233
|
-
"unsaved-changes": this.hasUnsavedChanges && !this.changesSaved,
|
|
234
|
-
"saved-changes": this.changesSaved,
|
|
235
|
-
error: this.error !== "",
|
|
236
|
-
"error-full-width": this.error !== "" && this.action === "create"
|
|
237
|
-
} }, this.error !== "" ? this.error : "", this.error == "" && this.hasUnsavedChanges && !this.changesSaved ? "Unsaved changes" : this.error == "" && this.changesSaved ? "Changes saved!" : ""), e("button-component", { key: "704dd4272d0f1a76584ecd0b42d5c0c0a4fd64d3", type: "button", disabled: this.isLoading, clickHandler: (t) => {
|
|
238
|
-
t.preventDefault(), this.cancelButtonClick.emit(), this.error = "";
|
|
239
|
-
}, variant: "basic" }, "Cancel"), e("button-component", { key: "68be33805f20229f35806be4c759cd8a00504fcc", type: "submit", disabled: this.isLoading }, this.isLoading ? e("span", null, "Saving", e("loading-icon", null), " ") : this.action == "create" ? "Create" : "Save changes")))));
|
|
240
|
-
}
|
|
241
|
-
get host() {
|
|
242
|
-
return $(this);
|
|
243
|
-
}
|
|
244
|
-
static get watchers() {
|
|
245
|
-
return {
|
|
246
|
-
selectedConfiguration: ["configChangedHandler"]
|
|
247
|
-
};
|
|
248
|
-
}
|
|
249
|
-
};
|
|
250
|
-
ot([
|
|
251
|
-
W({
|
|
252
|
-
name: "nylas-editor-tabs",
|
|
253
|
-
stateToProps: /* @__PURE__ */ new Map([
|
|
254
|
-
["schedulerConfig.calendars", "calendars"],
|
|
255
|
-
["schedulerConfig.selectedConfiguration", "selectedConfiguration"],
|
|
256
|
-
["schedulerConfig.currentUser", "currentUser"]
|
|
257
|
-
]),
|
|
258
|
-
eventToProps: {
|
|
259
|
-
schedulerConfigChanged: async (n, t) => {
|
|
260
|
-
const { resetLoadingState: a, setError: o, action: s, config: i } = n.detail, l = (r) => {
|
|
261
|
-
const [b, f] = r;
|
|
262
|
-
!b && f && o && o(f), a && a(n);
|
|
263
|
-
};
|
|
264
|
-
if (s === "edit") {
|
|
265
|
-
const r = await t.schedulerConfig.updateConfiguration(i);
|
|
266
|
-
l(r);
|
|
267
|
-
} else {
|
|
268
|
-
const r = await t.schedulerConfig.createConfiguration(i);
|
|
269
|
-
l(r);
|
|
270
|
-
}
|
|
271
|
-
},
|
|
272
|
-
cancelButtonClick: async (n, t) => {
|
|
273
|
-
t.schedulerConfigStore.state.action = null;
|
|
274
|
-
},
|
|
275
|
-
previewButtonClicked: async (n, t) => {
|
|
276
|
-
d("[nylas-editor-tabs]", "previewButtonClicked", t);
|
|
277
|
-
},
|
|
278
|
-
formSubmitted: async (n, t) => {
|
|
279
|
-
d("[nylas-editor-tabs]", "formSubmitted", t);
|
|
280
|
-
}
|
|
281
|
-
},
|
|
282
|
-
localPropsToProp: /* @__PURE__ */ new Map([["schedulerPreviewLink", "schedulerPreviewLink"]]),
|
|
283
|
-
fireRegisterEvent: !0
|
|
284
|
-
}),
|
|
285
|
-
B("design:type", Function),
|
|
286
|
-
B("design:paramtypes", []),
|
|
287
|
-
B("design:returntype", void 0)
|
|
288
|
-
], G.prototype, "render", null);
|
|
289
|
-
G.style = st;
|
|
290
|
-
const rt = ':host{display:grid;grid-auto-flow:row;width:100%;font-family:inherit;font-optical-sizing:auto;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif}.header{display:flex;align-items:center;justify-content:space-between;margin-bottom:1rem;gap:1rem}@media screen and (max-width: 768px){.header{flex-direction:column;gap:0.5rem;align-items:unset}}.header h2{margin:0;font-size:1.25rem;color:var(--nylas-base-900);font-weight:600}.header p{margin:0;font-size:1rem;color:var(--nylas-base-700)}.header .actions{justify-self:end}@media screen and (max-width: 768px){.header .actions{width:100%}}.configurations{border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x);background:var(--nylas-base-0);height:100%;display:flex;overflow-y:auto}.configurations table{width:100%;border-spacing:0;border-collapse:collapse;font-family:inherit;height:max-content}.configurations table.no-configurations{height:100%}.configurations table tr{color:var(--nylas-base-800);border-bottom:1px solid var(--nylas-base-200);font-family:inherit}.configurations table tr:last-of-type{border-bottom:0}.configurations table tr.hide{display:none}.configurations table th{font-weight:600;text-transform:uppercase}.configurations table th.actions-header{text-align:right}.configurations table tr.no-configurations td>div{display:flex;height:100%;justify-content:center;align-items:center;flex-direction:column;padding:var(--nylas-border-radius-3x)}.configurations table tr.no-configurations td>div h3{margin:0 0 1rem 0;color:var(--nylas-base-700)}.configurations table tr.no-configurations td>div p{margin:0 0 1rem 0;color:var(--nylas-base-600)}.configurations table tr.no-configurations td>div calendar-icon{margin-bottom:1rem;color:var(--nylas-base-200)}.configurations table th,.configurations table td{text-align:left;padding:1rem;font-family:inherit}.configurations table .actions{text-align:right}.configurations table .actions{display:flex;justify-content:flex-end;gap:1rem}@media screen and (max-width: 768px){.configurations table .actions{flex-direction:column;gap:0.5rem}}.configurations table .title{display:flex;flex-direction:column}.configurations table .title .config-event-title{font-weight:600}.configurations table .title .config-event-description{font-size:0.75rem}.error-container{margin-top:1.5rem}.error-container .error{color:var(--nylas-error);padding:0.5rem 0;margin:1rem 0 0}button-component#copy button{width:108px}', lt = rt;
|
|
291
|
-
var ct = function(n, t, a, o) {
|
|
292
|
-
var s = arguments.length, i = s < 3 ? t : o === null ? o = Object.getOwnPropertyDescriptor(t, a) : o, l;
|
|
293
|
-
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
294
|
-
i = Reflect.decorate(n, t, a, o);
|
|
295
|
-
else
|
|
296
|
-
for (var r = n.length - 1; r >= 0; r--)
|
|
297
|
-
(l = n[r]) && (i = (s < 3 ? l(i) : s > 3 ? l(t, a, i) : l(t, a)) || i);
|
|
298
|
-
return s > 3 && i && Object.defineProperty(t, a, i), i;
|
|
299
|
-
}, D = function(n, t) {
|
|
300
|
-
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
301
|
-
return Reflect.metadata(n, t);
|
|
302
|
-
};
|
|
303
|
-
const J = class {
|
|
304
|
-
constructor(n) {
|
|
305
|
-
L(this, n), this.initListConfigurations = p(this, "initListConfigurations", 7), this.createButtonClick = p(this, "createButtonClick", 7), this.editButtonClick = p(this, "editButtonClick", 7), this.deleteButtonClick = p(this, "deleteButtonClick", 7), this.configurations = [], this.schedulerPreviewLink = "", this.state = "loading", this.error = "", this.copiedButtonIndex = -1;
|
|
306
|
-
}
|
|
307
|
-
connectedCallback() {
|
|
308
|
-
d("[nylas-list-configurations]", "connectedCallback");
|
|
309
|
-
}
|
|
310
|
-
componentWillLoad() {
|
|
311
|
-
d("[nylas-list-configurations]", "componentWillLoad"), this.configurations && this.configurations.length > 0 && (this.state = "loaded");
|
|
312
|
-
}
|
|
313
|
-
componentDidLoad() {
|
|
314
|
-
d("[nylas-list-configurations]", "componentDidLoad"), this.initListConfigurations.emit(this.host);
|
|
315
|
-
}
|
|
316
|
-
disconnectedCallback() {
|
|
317
|
-
d("[nylas-list-configurations]", "disconnectedCallback");
|
|
318
|
-
}
|
|
319
|
-
async getState() {
|
|
320
|
-
return this.state;
|
|
321
|
-
}
|
|
322
|
-
async setState(n) {
|
|
323
|
-
this.state = n;
|
|
324
|
-
}
|
|
325
|
-
async setError(n) {
|
|
326
|
-
this.error = n;
|
|
327
|
-
}
|
|
328
|
-
render() {
|
|
329
|
-
return e(z, null, e("div", { class: "header" }, e("div", { class: "description" }, e("h2", null, "All scheduling pages"), e("p", null, "Create, edit and manage all your scheduling pages.")), this.configurations && this.configurations.length > 0 && e("div", { class: "actions" }, e("button-component", { clickHandler: () => {
|
|
330
|
-
this.createButtonClick.emit(this.host);
|
|
331
|
-
} }, "Create new"))), e("div", { class: "configurations" }, e("table", { class: {
|
|
332
|
-
"no-configurations": this.state !== "loading" && (!this.configurations || this.configurations.length === 0)
|
|
333
|
-
} }, e("tr", { class: {
|
|
334
|
-
hide: this.state === "loading" || this.configurations && this.configurations.length === 0
|
|
335
|
-
} }, e("th", null, "Scheduling page event title"), e("th", null, "Duration"), e("th", { class: "actions-header" }, "Actions")), this.state === "loading" && e("tr", { class: "no-configurations" }, e("td", { colSpan: 3 }, e("div", null, e("h3", null, "Loading..."), e("p", null, "Please wait while we fetch the scheduling pages")))), this.state !== "loading" && (!this.configurations || this.configurations.length === 0) && e("tr", { class: "no-configurations" }, e("td", { colSpan: 3 }, e("div", null, e("calendar-icon", { width: "48", height: "48" }), e("h3", null, "No scheduling pages found"), e("p", null, "Get started with creating your first scheduling page"), e("button-component", { clickHandler: () => {
|
|
336
|
-
this.createButtonClick.emit(this.host);
|
|
337
|
-
} }, "Create new")))), this.state !== "loading" && this.configurations.map((n, t) => e("tr", { key: n.id }, e("td", null, e("div", { class: "title" }, e("span", { class: "config-event-title" }, n.event_booking.title), e("span", { class: "config-event-description" }, n.event_booking.description))), e("td", null, e("div", null, n.availability.duration_minutes, " mins")), e("td", null, e("div", { class: "actions" }, e("button-component", { variant: "basic", id: "copy", key: `copy-${t}`, clickHandler: async (a) => {
|
|
338
|
-
a.preventDefault();
|
|
339
|
-
const o = Z(this.schedulerPreviewLink, n);
|
|
340
|
-
await navigator.clipboard.writeText(o), this.copiedButtonIndex = t, setTimeout(() => {
|
|
341
|
-
this.copiedButtonIndex = -1;
|
|
342
|
-
}, 3e3);
|
|
343
|
-
} }, this.copiedButtonIndex === t ? "Copied!" : "Copy link"), e("button-component", { variant: "basic", key: `edit-${t}`, clickHandler: (a) => {
|
|
344
|
-
a.preventDefault(), this.editButtonClick.emit({ host: this.host, configuration: n });
|
|
345
|
-
} }, "Edit"), e("button-component", { variant: "basic", key: `delete-${t}`, clickHandler: (a) => {
|
|
346
|
-
a.preventDefault(), this.deleteButtonClick.emit({ host: this.host, configuration: n });
|
|
347
|
-
} }, "Delete"))))))), this.state === "error" && e("div", { class: "error-container" }, e("p", { class: "error" }, this.error)));
|
|
348
|
-
}
|
|
349
|
-
get host() {
|
|
350
|
-
return $(this);
|
|
351
|
-
}
|
|
352
|
-
};
|
|
353
|
-
ct([
|
|
354
|
-
W({
|
|
355
|
-
name: "nylas-list-configurations",
|
|
356
|
-
stateToProps: /* @__PURE__ */ new Map([["schedulerConfig.configurations", "configurations"]]),
|
|
357
|
-
localPropsToProp: /* @__PURE__ */ new Map([["schedulerPreviewLink", "schedulerPreviewLink"]]),
|
|
358
|
-
eventToProps: {
|
|
359
|
-
initListConfigurations: async (n, t) => {
|
|
360
|
-
const a = n.detail;
|
|
361
|
-
await a.setState("loading");
|
|
362
|
-
const [o, s] = await t.schedulerConfig.getConfigurations();
|
|
363
|
-
if (!o && s && s.message) {
|
|
364
|
-
await a.setState("error"), await a.setError(s.message);
|
|
365
|
-
return;
|
|
366
|
-
}
|
|
367
|
-
await a.setState("loaded");
|
|
368
|
-
},
|
|
369
|
-
createButtonClick: async (n, t) => {
|
|
370
|
-
t.schedulerConfigStore.resetSelectedConfiguration(), t.schedulerConfigStore.state.action = "create";
|
|
371
|
-
},
|
|
372
|
-
deleteButtonClick: async (n, t) => {
|
|
373
|
-
const { host: a, configuration: o } = n.detail, [s, i] = await t.schedulerConfig.deleteConfiguration(o.id);
|
|
374
|
-
!s && i && i.message && (await a.setState("error"), await a.setError(i.message));
|
|
375
|
-
},
|
|
376
|
-
editButtonClick: async (n, t) => {
|
|
377
|
-
const { configuration: a } = n.detail;
|
|
378
|
-
t.schedulerConfigStore.state.selectedConfiguration = a, t.schedulerConfigStore.state.action = "edit";
|
|
379
|
-
}
|
|
380
|
-
},
|
|
381
|
-
fireRegisterEvent: !0
|
|
382
|
-
}),
|
|
383
|
-
D("design:type", Function),
|
|
384
|
-
D("design:paramtypes", []),
|
|
385
|
-
D("design:returntype", void 0)
|
|
386
|
-
], J.prototype, "render", null);
|
|
387
|
-
J.style = lt;
|
|
388
|
-
export {
|
|
389
|
-
Y as google_logo_icon,
|
|
390
|
-
nt as microsoft_logo_icon,
|
|
391
|
-
G as nylas_editor_tabs,
|
|
392
|
-
J as nylas_list_configurations
|
|
393
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const s=require("./index-6a4ee4f8.cjs");var e=s.commonjsGlobal.process;exports.process=e;
|