@nylas/react 1.1.0-canary.12 → 1.1.0-canary.13
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_22.entry-26980c9f.cjs +1 -0
- package/dist/add-circle-icon_22.entry-a63de90d.js +1895 -0
- package/dist/{archive-icon_7.entry-e892a458.js → archive-icon_7.entry-561a5deb.js} +13 -13
- package/dist/{archive-icon_7.entry-59d9e24f.cjs → archive-icon_7.entry-97628ff8.cjs} +1 -1
- package/dist/{arrow-icon.entry-834b8066.cjs → arrow-icon.entry-68a3ba5b.cjs} +1 -1
- package/dist/arrow-icon.entry-c9b46bbc.js +15 -0
- package/dist/{bold-icon_3.entry-0f038db3.js → bold-icon_3.entry-e5a6fea9.js} +4 -4
- package/dist/{bold-icon_3.entry-eb0fcdaa.cjs → bold-icon_3.entry-f8473940.cjs} +1 -1
- package/dist/{calendar-cancel-icon.entry-27a6f628.cjs → calendar-cancel-icon.entry-1fd6b27a.cjs} +1 -1
- package/dist/{calendar-cancel-icon.entry-96156441.js → calendar-cancel-icon.entry-4bc3ceb1.js} +2 -2
- package/dist/{calendar-check-icon_2.entry-b6d6d220.cjs → calendar-check-icon_2.entry-3f734e43.cjs} +1 -1
- package/dist/{calendar-check-icon_2.entry-c7c13e3e.js → calendar-check-icon_2.entry-a7033bf7.js} +11 -11
- package/dist/{calendar-icon.entry-e7f6a9a8.cjs → calendar-icon.entry-2943ea63.cjs} +1 -1
- package/dist/{calendar-icon.entry-f088fb14.js → calendar-icon.entry-2f963a7d.js} +4 -4
- package/dist/{chevron-icon_3.entry-8c6e6f74.cjs → chevron-icon_3.entry-ac1be504.cjs} +1 -1
- package/dist/{chevron-icon_3.entry-90a3e89c.js → chevron-icon_3.entry-d10c854b.js} +5 -5
- package/dist/clock-icon_2.entry-7c576457.cjs +1 -0
- package/dist/clock-icon_2.entry-c8b0693e.js +25 -0
- package/dist/close-icon.entry-5cc5ae00.cjs +1 -0
- package/dist/close-icon.entry-e01b32cc.js +15 -0
- package/dist/{constants-f34b9c6e-593e21cc.cjs → constants-f34b9c6e-0e1cb070.cjs} +1 -1
- package/dist/{constants-f34b9c6e-91f6ad05.js → constants-f34b9c6e-ada541f4.js} +1 -1
- package/dist/{document-refresh-icon.entry-ca98d879.js → document-refresh-icon.entry-a18e5222.js} +5 -5
- package/dist/document-refresh-icon.entry-b0927573.cjs +1 -0
- package/dist/elements/index.d.ts +4 -1
- package/dist/{elements-dc5b338e-60f95088.cjs → elements-dc5b338e-272b5dff.cjs} +1 -1
- package/dist/{elements-dc5b338e-68eab1e5.js → elements-dc5b338e-d6cbe948.js} +1 -1
- package/dist/{focus-visible-e8093c16-a0869441.cjs → focus-visible-e8093c16-6991ac1b.cjs} +1 -1
- package/dist/{focus-visible-e8093c16-b5d785fc.js → focus-visible-e8093c16-d239362e.js} +1 -1
- package/dist/{forward-icon_6.entry-84ac76ac.js → forward-icon_6.entry-230c7ab2.js} +9 -9
- package/dist/{forward-icon_6.entry-4b321b9a.cjs → forward-icon_6.entry-ee238c52.cjs} +3 -3
- package/dist/{globe-icon.entry-ef04c8bf.cjs → globe-icon.entry-539f0052.cjs} +1 -1
- package/dist/{globe-icon.entry-14a60f32.js → globe-icon.entry-e8c272c0.js} +2 -2
- package/dist/{google-logo-icon_4.entry-4fa3cb8e.js → google-logo-icon_4.entry-0c46cddd.js} +103 -93
- package/dist/google-logo-icon_4.entry-a5add4b4.cjs +1 -0
- package/dist/index-53420959-71fdd6ef.js +5 -0
- package/dist/index-53420959-f15601a9.cjs +1 -0
- package/dist/index-553c0327.cjs +42 -0
- package/dist/index-cd0e2d77.js +4977 -0
- package/dist/index-ef01c714-839c3029.cjs +41 -0
- package/dist/index-ef01c714-d85134a4.js +4971 -0
- package/dist/{index.es-9190f785-60475c4c.cjs → index.es-74f70f7d-1d137fdb.cjs} +5 -5
- package/dist/{index.es-9190f785-69269065.js → index.es-74f70f7d-960f947f.js} +11 -12
- package/dist/{info-icon_2.entry-fb099090.cjs → info-icon_2.entry-00ea6504.cjs} +1 -1
- package/dist/{info-icon_2.entry-45f6f01f.js → info-icon_2.entry-42f77d4b.js} +5 -5
- package/dist/{loading-icon.entry-67c8b1fa.js → loading-icon.entry-0692e093.js} +4 -4
- package/dist/{loading-icon.entry-eaabff41.cjs → loading-icon.entry-fb7464c3.cjs} +1 -1
- package/dist/{mailbox-store-29139d89-dd9d3d1b.cjs → mailbox-store-050a2914-9c975586.cjs} +1 -1
- package/dist/{mailbox-store-29139d89-e3513416.js → mailbox-store-050a2914-cfb1b1c0.js} +2 -2
- package/dist/{nylas-additional-participants.entry-a1fb4ef4.js → nylas-additional-participants.entry-1d7bda06.js} +12 -12
- package/dist/{nylas-additional-participants.entry-6413fc87.cjs → nylas-additional-participants.entry-d97b8bb4.cjs} +1 -1
- package/dist/{nylas-booked-event-card_10.entry-e435ff63.js → nylas-booked-event-card_10.entry-041a10c7.js} +255 -252
- package/dist/nylas-booked-event-card_10.entry-dfec7c8d.cjs +1 -0
- package/dist/{nylas-custom-booking-flow.entry-3e690bb7.cjs → nylas-custom-booking-flow.entry-3ec838df.cjs} +1 -1
- package/dist/{nylas-custom-booking-flow.entry-56075ecd.js → nylas-custom-booking-flow.entry-ced72cc5.js} +3 -3
- package/dist/nylas-form-card.entry-8d594514.cjs +1 -0
- package/dist/nylas-form-card.entry-9b8176ad.js +57 -0
- package/dist/{nylas-if-state.entry-1e4b0a58.cjs → nylas-if-state.entry-445ec109.cjs} +1 -1
- package/dist/{nylas-if-state.entry-3d22bca7.js → nylas-if-state.entry-eb11630d.js} +3 -3
- package/dist/{nylas-list-folders.entry-3da37b1c.cjs → nylas-list-folders.entry-32a1e254.cjs} +1 -1
- package/dist/{nylas-list-folders.entry-e634780d.js → nylas-list-folders.entry-822436d4.js} +3 -3
- package/dist/{nylas-list-threads.entry-26dbb8ff.js → nylas-list-threads.entry-0186e9e7.js} +4 -4
- package/dist/{nylas-list-threads.entry-ef4743af.cjs → nylas-list-threads.entry-181872dd.cjs} +1 -1
- package/dist/{nylas-login.entry-a76e4aae.cjs → nylas-login.entry-0261e74e.cjs} +1 -1
- package/dist/{nylas-login.entry-ff7d9db5.js → nylas-login.entry-7460c1d4.js} +3 -3
- package/dist/{nylas-mailbox-pagination.entry-fcb3cc47.js → nylas-mailbox-pagination.entry-107b3fbc.js} +2 -2
- package/dist/{nylas-mailbox-pagination.entry-565ee29b.cjs → nylas-mailbox-pagination.entry-eaf08163.cjs} +1 -1
- package/dist/{nylas-mailbox-toolbar-button.entry-3a94b1e9.cjs → nylas-mailbox-toolbar-button.entry-23fc08a6.cjs} +1 -1
- package/dist/{nylas-mailbox-toolbar-button.entry-ae13c538.js → nylas-mailbox-toolbar-button.entry-40e8d9ad.js} +8 -8
- package/dist/{nylas-mailbox.entry-6d86abe9.js → nylas-mailbox.entry-2199a6b4.js} +9 -10
- package/dist/nylas-mailbox.entry-de8618eb.cjs +1 -0
- package/dist/nylas-provider.entry-11a95d86.cjs +1 -0
- package/dist/{nylas-provider.entry-01e0944e.js → nylas-provider.entry-a8f8bad2.js} +9 -10
- package/dist/nylas-scheduler-editor.entry-73794266.cjs +2 -0
- package/dist/{nylas-scheduler-editor.entry-8f62880a.js → nylas-scheduler-editor.entry-c58c813c.js} +28 -14
- package/dist/nylas-scheduling.entry-b449ab24.cjs +1 -0
- package/dist/{nylas-scheduling.entry-f15b3106.js → nylas-scheduling.entry-fe9d6b69.js} +91 -68
- package/dist/{nylas-threads-refresh.entry-d62d0574.cjs → nylas-threads-refresh.entry-4f17fa6c.cjs} +1 -1
- package/dist/{nylas-threads-refresh.entry-d7727ccb.js → nylas-threads-refresh.entry-c8438752.js} +4 -4
- package/dist/{nylas-threads-search.entry-eec50b1b.cjs → nylas-threads-search.entry-0ed36372.cjs} +1 -1
- package/dist/{nylas-threads-search.entry-4803d20b.js → nylas-threads-search.entry-b1f88916.js} +4 -4
- package/dist/{nylas-view-thread.entry-2b85f8e2.js → nylas-view-thread.entry-8dfe1352.js} +3 -3
- package/dist/{nylas-view-thread.entry-5da789da.cjs → nylas-view-thread.entry-c50bea78.cjs} +1 -1
- package/dist/{people-icon.entry-b6426fe6.cjs → people-icon.entry-0875cac0.cjs} +1 -1
- package/dist/{people-icon.entry-63f63064.js → people-icon.entry-8392a21c.js} +6 -6
- package/dist/{play-icon_2.entry-a3262db3.js → play-icon_2.entry-4a15f215.js} +8 -8
- package/dist/play-icon_2.entry-d6ff1cc3.cjs +1 -0
- package/dist/react.cjs +1 -1
- package/dist/react.js +87 -84
- package/dist/{refresh-icon.entry-542f680c.cjs → refresh-icon.entry-1ebb9376.cjs} +1 -1
- package/dist/{refresh-icon.entry-64679ef7.js → refresh-icon.entry-76b2d888.js} +4 -4
- package/dist/{register-component-83e24412-51af5293.js → register-component-e4dc8778-408dc241.js} +1 -1
- package/dist/{register-component-83e24412-d76a2962.cjs → register-component-e4dc8778-99eb91ca.cjs} +1 -1
- package/dist/{scheduler-config-store-ec3b6190-2710b76a.cjs → scheduler-config-store-ec3b6190-4abd56df.cjs} +1 -1
- package/dist/{scheduler-config-store-ec3b6190-df09ddc0.js → scheduler-config-store-ec3b6190-f292fe19.js} +1 -1
- package/dist/scheduler-store-3afbcda0-166e84ff.cjs +1 -0
- package/dist/{scheduler-store-dabdbc4f-6f6096d6.js → scheduler-store-3afbcda0-53680387.js} +130 -89
- package/dist/time-period-selector.entry-846b64bd.cjs +1 -0
- package/dist/{time-period-selector.entry-8e6954f5.js → time-period-selector.entry-f6128367.js} +3 -3
- package/dist/{translate-icon.entry-57dedacf.js → translate-icon.entry-84778350.js} +6 -6
- package/dist/{translate-icon.entry-49a653f0.cjs → translate-icon.entry-f3060124.cjs} +1 -1
- package/dist/warning-icon.entry-246eb6fb.cjs +1 -0
- package/dist/warning-icon.entry-eeaae1a7.js +15 -0
- package/package.json +2 -2
- package/dist/add-circle-icon_21.entry-172d31c3.js +0 -6726
- package/dist/add-circle-icon_21.entry-71af48f1.cjs +0 -41
- package/dist/arrow-icon.entry-060b9b4f.js +0 -15
- package/dist/close-icon.entry-175b9674.cjs +0 -1
- package/dist/close-icon.entry-e694948f.js +0 -15
- package/dist/document-refresh-icon.entry-a54c74b9.cjs +0 -1
- package/dist/global-37eeb0cd-6c5934cf.cjs +0 -1
- package/dist/global-37eeb0cd-b42e0abc.js +0 -4
- package/dist/google-logo-icon_4.entry-ffeec491.cjs +0 -1
- package/dist/index-3a004ec1.cjs +0 -37
- package/dist/index-4c7e8f2f.js +0 -4045
- package/dist/index-92989ac4-69175657.js +0 -902
- package/dist/index-92989ac4-6f32ff2a.cjs +0 -6
- package/dist/nylas-booked-event-card_10.entry-ce660783.cjs +0 -1
- package/dist/nylas-form-card.entry-33ff95e1.js +0 -54
- package/dist/nylas-form-card.entry-64d7be4d.cjs +0 -1
- package/dist/nylas-mailbox.entry-8f41c35a.cjs +0 -1
- package/dist/nylas-provider.entry-65f0f8da.cjs +0 -1
- package/dist/nylas-scheduler-editor.entry-7dc20e4d.cjs +0 -2
- package/dist/nylas-scheduling.entry-1b6628a3.cjs +0 -1
- package/dist/play-icon_2.entry-2b8094d7.cjs +0 -1
- package/dist/scheduler-store-dabdbc4f-404dc261.cjs +0 -1
- package/dist/time-period-selector.entry-c5faae46.cjs +0 -1
- package/dist/warning-icon.entry-a7977526.js +0 -15
- package/dist/warning-icon.entry-bce861bd.cjs +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { r as L, h as e, c as p,
|
|
2
|
-
import { R as
|
|
3
|
-
import { D as K } from "./constants-f34b9c6e-
|
|
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-cd0e2d77.js";
|
|
2
|
+
import { R as W } from "./register-component-e4dc8778-408dc241.js";
|
|
3
|
+
import { D as K } from "./constants-f34b9c6e-ada541f4.js";
|
|
4
4
|
import "react";
|
|
5
5
|
import "react-dom";
|
|
6
6
|
const Q = ".sc-google-logo-icon-h{display:flex}", X = Q, Y = class {
|
|
@@ -8,7 +8,7 @@ const Q = ".sc-google-logo-icon-h{display:flex}", X = Q, Y = class {
|
|
|
8
8
|
L(this, n), this.width = "24", this.height = "24";
|
|
9
9
|
}
|
|
10
10
|
render() {
|
|
11
|
-
return e("svg", { key: "
|
|
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
12
|
}
|
|
13
13
|
};
|
|
14
14
|
Y.style = X;
|
|
@@ -17,15 +17,15 @@ const tt = ".sc-microsoft-logo-icon-h{display:flex}", et = tt, nt = class {
|
|
|
17
17
|
L(this, n), this.width = "22", this.height = "22";
|
|
18
18
|
}
|
|
19
19
|
render() {
|
|
20
|
-
return e("svg", { key: "
|
|
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
21
|
}
|
|
22
22
|
};
|
|
23
23
|
nt.style = et;
|
|
24
|
-
function at({ id: n, formState: t, activeTab: a, calendars:
|
|
24
|
+
function at({ id: n, formState: t, activeTab: a, calendars: o }) {
|
|
25
25
|
var s;
|
|
26
26
|
switch (a) {
|
|
27
27
|
case "eventInfo":
|
|
28
|
-
const i = t.title, l = t.description,
|
|
28
|
+
const i = t.title, l = t.description, r = parseInt(t.duration), b = t.location;
|
|
29
29
|
return e(
|
|
30
30
|
"div",
|
|
31
31
|
{ key: n },
|
|
@@ -36,20 +36,20 @@ function at({ id: n, formState: t, activeTab: a, calendars: r }) {
|
|
|
36
36
|
"div",
|
|
37
37
|
{ slot: "inputs" },
|
|
38
38
|
e("nylas-event-title", { name: "title", eventTitle: i, exportparts: "net, net__title, net__dropdown-content" }),
|
|
39
|
-
e("nylas-event-duration", { name: "duration", eventDurationMinutes:
|
|
40
|
-
e("nylas-location
|
|
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
41
|
e("nylas-event-description", { name: "description", eventDescription: l, exportparts: "nedesc, nedesc__textarea" })
|
|
42
42
|
)
|
|
43
43
|
)
|
|
44
44
|
);
|
|
45
45
|
case "availability":
|
|
46
|
-
const
|
|
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
47
|
return e(
|
|
48
48
|
"div",
|
|
49
49
|
{ key: n },
|
|
50
|
-
e("nylas-booking-calendar-picker", { name: "booking-calendar", calendars:
|
|
51
|
-
e("nylas-calendar-picker", { name: "calendars", calendars:
|
|
52
|
-
e("nylas-availability-picker", { name: "availability", openHours:
|
|
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
53
|
);
|
|
54
54
|
case "bookingOptions":
|
|
55
55
|
return e(
|
|
@@ -70,37 +70,37 @@ function at({ id: n, formState: t, activeTab: a, calendars: r }) {
|
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
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,
|
|
74
|
-
var s = arguments.length, i = s < 3 ? t :
|
|
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
75
|
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
76
|
-
i = Reflect.decorate(n, t, a,
|
|
76
|
+
i = Reflect.decorate(n, t, a, o);
|
|
77
77
|
else
|
|
78
|
-
for (var
|
|
79
|
-
(l = n[
|
|
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
80
|
return s > 3 && i && Object.defineProperty(t, a, i), i;
|
|
81
|
-
},
|
|
81
|
+
}, B = function(n, t) {
|
|
82
82
|
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
83
83
|
return Reflect.metadata(n, t);
|
|
84
84
|
};
|
|
85
|
-
const
|
|
85
|
+
const G = class {
|
|
86
86
|
constructor(n) {
|
|
87
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
88
|
this.error = t.message;
|
|
89
89
|
}, this.formSubmissionHandler = async (t) => {
|
|
90
|
-
var _, w, S,
|
|
90
|
+
var _, w, S, H, I, T, F, E, O, P, R, j, V, M, N, U;
|
|
91
91
|
if (t.preventDefault(), this.formSubmitted.emit(), !this.formRef.checkValidity())
|
|
92
92
|
return;
|
|
93
93
|
this.isLoading = !0, this.hasUnsavedChanges = !1;
|
|
94
|
-
const
|
|
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
95
|
...((S = this.selectedConfiguration) == null ? void 0 : S.id) && { id: this.selectedConfiguration.id },
|
|
96
|
-
version: ((
|
|
96
|
+
version: ((H = this.selectedConfiguration) == null ? void 0 : H.version) ?? "1.0.0",
|
|
97
97
|
availability: {
|
|
98
98
|
duration_minutes: l ? parseInt(l) : 0,
|
|
99
99
|
interval_minutes: l ? parseInt(l) : 0,
|
|
100
100
|
availability_rules: {
|
|
101
|
-
availability_method: ((
|
|
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
102
|
buffer: y || { before: 0, after: 0 },
|
|
103
|
-
default_open_hours: ((
|
|
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
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
105
|
}
|
|
106
106
|
},
|
|
@@ -110,20 +110,20 @@ const J = class {
|
|
|
110
110
|
email: (c == null ? void 0 : c.email) ?? ((U = this.currentUser) == null ? void 0 : U.email) ?? "",
|
|
111
111
|
is_organizer: !0,
|
|
112
112
|
availability: {
|
|
113
|
-
calendar_ids:
|
|
114
|
-
open_hours: (
|
|
113
|
+
calendar_ids: b != null && b.length ? b : ["primary"],
|
|
114
|
+
open_hours: (r == null ? void 0 : r.openHours) ?? []
|
|
115
115
|
},
|
|
116
116
|
booking: {
|
|
117
|
-
calendar_id:
|
|
117
|
+
calendar_id: f && f !== "" ? f : "primary"
|
|
118
118
|
}
|
|
119
119
|
}
|
|
120
120
|
],
|
|
121
121
|
event_booking: {
|
|
122
122
|
title: (s == null ? void 0 : s.toString()) ?? "",
|
|
123
123
|
description: (i == null ? void 0 : i.toString()) ?? "",
|
|
124
|
-
location: (
|
|
125
|
-
booking_type: (
|
|
126
|
-
timezone: (
|
|
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
127
|
},
|
|
128
128
|
scheduler: {
|
|
129
129
|
available_days_in_future: g ?? 30,
|
|
@@ -138,42 +138,42 @@ const J = class {
|
|
|
138
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
139
|
}
|
|
140
140
|
configChangedHandler(n) {
|
|
141
|
-
|
|
141
|
+
d("[nylas-editor-tabs]", "configChangedHandler", n, this.selectedConfiguration), this.formState = {
|
|
142
142
|
...this.getFormStateFromConfig(n)
|
|
143
143
|
}, n.id ? this.action = "edit" : this.action = "create";
|
|
144
144
|
}
|
|
145
145
|
connectedCallback() {
|
|
146
|
-
|
|
146
|
+
d("[nylas-editor-tabs]", "connectedCallback");
|
|
147
147
|
}
|
|
148
148
|
componentWillLoad() {
|
|
149
|
-
|
|
149
|
+
d("[nylas-editor-tabs]", "componentWillLoad"), this.formState = this.getFormStateFromConfig(this.selectedConfiguration);
|
|
150
150
|
}
|
|
151
151
|
componentDidLoad() {
|
|
152
|
-
|
|
152
|
+
d("[nylas-editor-tabs]", "componentDidLoad");
|
|
153
153
|
}
|
|
154
154
|
disconnectedCallback() {
|
|
155
|
-
|
|
155
|
+
d("[nylas-editor-tabs]", "disconnectedCallback");
|
|
156
156
|
}
|
|
157
157
|
handleValueChanged(n) {
|
|
158
|
-
|
|
158
|
+
d("[nylas-editor-tabs]", "handleValueChanged", n);
|
|
159
159
|
const { name: t, value: a } = n.detail;
|
|
160
160
|
this.formState = { ...this.formState, [t]: a }, this.hasUnsavedChanges = !0, this.error = "";
|
|
161
161
|
}
|
|
162
162
|
getFormStateFromConfig(n) {
|
|
163
|
-
var a,
|
|
163
|
+
var a, o, s, i, l, r, b, f, h, u, y, g, m, c, v, C, k, x, _, w;
|
|
164
164
|
const t = (a = n == null ? void 0 : n.participants) == null ? void 0 : a.find((S) => S.is_organizer);
|
|
165
165
|
return {
|
|
166
|
-
title: ((
|
|
166
|
+
title: ((o = n == null ? void 0 : n.event_booking) == null ? void 0 : o.title) ?? "",
|
|
167
167
|
description: ((s = n == null ? void 0 : n.event_booking) == null ? void 0 : s.description) ?? "",
|
|
168
168
|
duration: ((l = (i = n == null ? void 0 : n.availability) == null ? void 0 : i.duration_minutes) == null ? void 0 : l.toString()) ?? "10",
|
|
169
169
|
availability: {
|
|
170
|
-
timezone: ((
|
|
171
|
-
open_hours: ((
|
|
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
172
|
},
|
|
173
|
-
calendarIds: ((
|
|
173
|
+
calendarIds: ((f = t == null ? void 0 : t.availability) == null ? void 0 : f.calendar_ids) ?? [],
|
|
174
174
|
participants: (n == null ? void 0 : n.participants) ?? [],
|
|
175
|
-
bookingCalendar: ((
|
|
176
|
-
location: ((y = (
|
|
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
177
|
bookingType: ((m = (g = this.selectedConfiguration) == null ? void 0 : g.event_booking) == null ? void 0 : m.booking_type) ?? "booking",
|
|
178
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
179
|
availableDaysInFuture: ((x = (k = this.selectedConfiguration) == null ? void 0 : k.scheduler) == null ? void 0 : x.available_days_in_future) ?? 30,
|
|
@@ -227,19 +227,19 @@ const J = class {
|
|
|
227
227
|
}
|
|
228
228
|
render() {
|
|
229
229
|
var n;
|
|
230
|
-
return
|
|
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
231
|
t.preventDefault(), this.previewButtonClicked.emit(this.host).defaultPrevented || window.open(Z(this.schedulerPreviewLink, this.selectedConfiguration), "_blank");
|
|
232
|
-
}, variant: "basic" }, "Preview")), e("div", { key: "
|
|
232
|
+
}, variant: "basic" }, "Preview")), e("div", { key: "e965241b0d1b44cf94ff56577e10d1d2d89628ac", class: "buttons" }, e("p", { key: "482ce16ace804a25fc28e37cdaa57f47cab4996b", class: {
|
|
233
233
|
"unsaved-changes": this.hasUnsavedChanges && !this.changesSaved,
|
|
234
234
|
"saved-changes": this.changesSaved,
|
|
235
235
|
error: this.error !== "",
|
|
236
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: "
|
|
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
238
|
t.preventDefault(), this.cancelButtonClick.emit(), this.error = "";
|
|
239
|
-
}, variant: "basic" }, "Cancel"), e("button-component", { key: "
|
|
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
240
|
}
|
|
241
241
|
get host() {
|
|
242
|
-
return
|
|
242
|
+
return $(this);
|
|
243
243
|
}
|
|
244
244
|
static get watchers() {
|
|
245
245
|
return {
|
|
@@ -248,7 +248,7 @@ const J = class {
|
|
|
248
248
|
}
|
|
249
249
|
};
|
|
250
250
|
ot([
|
|
251
|
-
|
|
251
|
+
W({
|
|
252
252
|
name: "nylas-editor-tabs",
|
|
253
253
|
stateToProps: /* @__PURE__ */ new Map([
|
|
254
254
|
["schedulerConfig.calendars", "calendars"],
|
|
@@ -257,58 +257,64 @@ ot([
|
|
|
257
257
|
]),
|
|
258
258
|
eventToProps: {
|
|
259
259
|
schedulerConfigChanged: async (n, t) => {
|
|
260
|
-
const { resetLoadingState: a, setError:
|
|
261
|
-
const [
|
|
262
|
-
!
|
|
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
263
|
};
|
|
264
264
|
if (s === "edit") {
|
|
265
|
-
const
|
|
266
|
-
l(
|
|
265
|
+
const r = await t.schedulerConfig.updateConfiguration(i);
|
|
266
|
+
l(r);
|
|
267
267
|
} else {
|
|
268
|
-
const
|
|
269
|
-
l(
|
|
268
|
+
const r = await t.schedulerConfig.createConfiguration(i);
|
|
269
|
+
l(r);
|
|
270
270
|
}
|
|
271
271
|
},
|
|
272
272
|
cancelButtonClick: async (n, t) => {
|
|
273
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);
|
|
274
280
|
}
|
|
275
281
|
},
|
|
276
282
|
localPropsToProp: /* @__PURE__ */ new Map([["schedulerPreviewLink", "schedulerPreviewLink"]]),
|
|
277
283
|
fireRegisterEvent: !0
|
|
278
284
|
}),
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
],
|
|
283
|
-
|
|
284
|
-
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}', lt = rt;
|
|
285
|
-
var ct = function(n, t, a,
|
|
286
|
-
var s = arguments.length, i = s < 3 ? t :
|
|
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;
|
|
287
293
|
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
288
|
-
i = Reflect.decorate(n, t, a,
|
|
294
|
+
i = Reflect.decorate(n, t, a, o);
|
|
289
295
|
else
|
|
290
|
-
for (var
|
|
291
|
-
(l = n[
|
|
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);
|
|
292
298
|
return s > 3 && i && Object.defineProperty(t, a, i), i;
|
|
293
|
-
},
|
|
299
|
+
}, D = function(n, t) {
|
|
294
300
|
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
295
301
|
return Reflect.metadata(n, t);
|
|
296
302
|
};
|
|
297
|
-
const
|
|
303
|
+
const J = class {
|
|
298
304
|
constructor(n) {
|
|
299
|
-
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 = "";
|
|
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;
|
|
300
306
|
}
|
|
301
307
|
connectedCallback() {
|
|
302
|
-
|
|
308
|
+
d("[nylas-list-configurations]", "connectedCallback");
|
|
303
309
|
}
|
|
304
310
|
componentWillLoad() {
|
|
305
|
-
|
|
311
|
+
d("[nylas-list-configurations]", "componentWillLoad"), this.configurations && this.configurations.length > 0 && (this.state = "loaded");
|
|
306
312
|
}
|
|
307
313
|
componentDidLoad() {
|
|
308
|
-
|
|
314
|
+
d("[nylas-list-configurations]", "componentDidLoad"), this.initListConfigurations.emit(this.host);
|
|
309
315
|
}
|
|
310
316
|
disconnectedCallback() {
|
|
311
|
-
|
|
317
|
+
d("[nylas-list-configurations]", "disconnectedCallback");
|
|
312
318
|
}
|
|
313
319
|
async getState() {
|
|
314
320
|
return this.state;
|
|
@@ -328,20 +334,24 @@ const $ = class {
|
|
|
328
334
|
hide: this.state === "loading" || this.configurations && this.configurations.length === 0
|
|
329
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: () => {
|
|
330
336
|
this.createButtonClick.emit(this.host);
|
|
331
|
-
} }, "Create new")))), this.state !== "loading" && this.configurations.map((n) => 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", clickHandler: (
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
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 });
|
|
337
347
|
} }, "Delete"))))))), this.state === "error" && e("div", { class: "error-container" }, e("p", { class: "error" }, this.error)));
|
|
338
348
|
}
|
|
339
349
|
get host() {
|
|
340
|
-
return
|
|
350
|
+
return $(this);
|
|
341
351
|
}
|
|
342
352
|
};
|
|
343
353
|
ct([
|
|
344
|
-
|
|
354
|
+
W({
|
|
345
355
|
name: "nylas-list-configurations",
|
|
346
356
|
stateToProps: /* @__PURE__ */ new Map([["schedulerConfig.configurations", "configurations"]]),
|
|
347
357
|
localPropsToProp: /* @__PURE__ */ new Map([["schedulerPreviewLink", "schedulerPreviewLink"]]),
|
|
@@ -349,8 +359,8 @@ ct([
|
|
|
349
359
|
initListConfigurations: async (n, t) => {
|
|
350
360
|
const a = n.detail;
|
|
351
361
|
await a.setState("loading");
|
|
352
|
-
const [
|
|
353
|
-
if (!
|
|
362
|
+
const [o, s] = await t.schedulerConfig.getConfigurations();
|
|
363
|
+
if (!o && s && s.message) {
|
|
354
364
|
await a.setState("error"), await a.setError(s.message);
|
|
355
365
|
return;
|
|
356
366
|
}
|
|
@@ -360,7 +370,7 @@ ct([
|
|
|
360
370
|
t.schedulerConfigStore.resetSelectedConfiguration(), t.schedulerConfigStore.state.action = "create";
|
|
361
371
|
},
|
|
362
372
|
deleteButtonClick: async (n, t) => {
|
|
363
|
-
const { host: a, configuration:
|
|
373
|
+
const { host: a, configuration: o } = n.detail, [s, i] = await t.schedulerConfig.deleteConfiguration(o.id);
|
|
364
374
|
!s && i && i.message && (await a.setState("error"), await a.setError(i.message));
|
|
365
375
|
},
|
|
366
376
|
editButtonClick: async (n, t) => {
|
|
@@ -370,14 +380,14 @@ ct([
|
|
|
370
380
|
},
|
|
371
381
|
fireRegisterEvent: !0
|
|
372
382
|
}),
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
],
|
|
377
|
-
|
|
383
|
+
D("design:type", Function),
|
|
384
|
+
D("design:paramtypes", []),
|
|
385
|
+
D("design:returntype", void 0)
|
|
386
|
+
], J.prototype, "render", null);
|
|
387
|
+
J.style = lt;
|
|
378
388
|
export {
|
|
379
389
|
Y as google_logo_icon,
|
|
380
390
|
nt as microsoft_logo_icon,
|
|
381
|
-
|
|
382
|
-
|
|
391
|
+
G as nylas_editor_tabs,
|
|
392
|
+
J as nylas_list_configurations
|
|
383
393
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-553c0327.cjs"),A=require("./register-component-e4dc8778-99eb91ca.cjs"),$=require("./constants-f34b9c6e-0e1cb070.cjs");require("react");require("react-dom");const q=".sc-google-logo-icon-h{display:flex}",W=q,Z=class{constructor(n){t.registerInstance(this,n),this.width="24",this.height="24"}render(){return t.h("svg",{key:"27c504c1f369e9516fefbb560b449cb2ca5ff188",width:this.width,height:this.height,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t.h("g",{key:"1d3f96ac0e9f1717d23704e667753a4dba3866a9","clip-path":"url(#clip0_959_12452)"},t.h("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"}),t.h("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"}),t.h("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"}),t.h("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"})),t.h("defs",{key:"f900310e535daa57a4b2abe6d8c77606f884a788"},t.h("clipPath",{key:"98c06d2826f0384cb24f48771ed6ce58b80288f8",id:"clip0_959_12452"},t.h("rect",{key:"79698f957db9ee94fdf08f3af7b8b9dc91de82dd",width:24,height:24,fill:"white"}))))}};Z.style=W;const G=".sc-microsoft-logo-icon-h{display:flex}",J=G,z=class{constructor(n){t.registerInstance(this,n),this.width="22",this.height="22"}render(){return t.h("svg",{key:"1223ece54fc605efae38fdc35141dc48811a28ba",width:this.width,height:this.height,viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t.h("path",{key:"ebe0278d1157e75a35414b2ed0b3759ad36d4026",d:"M0.043457 0.043457H10.4782V10.4782H0.043457V0.043457Z",fill:"#F35325"}),t.h("path",{key:"40b73df249604ca885e7928ecce681847f650ae8",d:"M11.5217 0.043457H21.9565V10.4782H11.5217V0.043457Z",fill:"#81BC06"}),t.h("path",{key:"8200751904bbe641b6951db6ee0fabf317ce43be",d:"M0.043457 11.5217H10.4782V21.9565H0.043457V11.5217Z",fill:"#05A6F0"}),t.h("path",{key:"6c7bc8725af9ba16da194784c66f7b17d7c91c12",d:"M11.5217 11.5217H21.9565V21.9565H11.5217V11.5217Z",fill:"#FFBA08"}))}};z.style=J;function K({id:n,formState:e,activeTab:a,calendars:o}){var s;switch(a){case"eventInfo":const i=e.title,l=e.description,r=parseInt(e.duration),d=e.location;return t.h("div",{key:n},t.h("nylas-event-info",null,t.h("div",{slot:"inputs"},t.h("nylas-event-title",{name:"title",eventTitle:i,exportparts:"net, net__title, net__dropdown-content"}),t.h("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"}),t.h("nylas-event-location",{name:"location",eventLocation:d,exportparts:"nel, nel__location, nel__dropdown, nel__dropdown-button, nel__dropdown-content"}),t.h("nylas-event-description",{name:"description",eventDescription:l,exportparts:"nedesc, nedesc__textarea"}))));case"availability":const h=e.availability.openHours,u=e.availability.timezone?e.availability.timezone:Intl.DateTimeFormat().resolvedOptions().timeZone,b=(s=e.participants)==null?void 0:s.find(c=>c.is_organizer),f=(b==null?void 0:b.email)??"primary",p=e.calendarIds.length>0?e.calendarIds:[f],y=e.bookingCalendar=="primary"?f:e.bookingCalendar;return t.h("div",{key:n},t.h("nylas-booking-calendar-picker",{name:"booking-calendar",calendars:o??[],defaultBookingCalendar:y,exportparts:"nbcp, nbcp__header, nbcp__input-label, nbcp__dropdown, nbcp__dropdown-button, nbcp__dropdown-content"}),t.h("nylas-calendar-picker",{name:"calendars",calendars:o??[],defaultSelectedCalendars:p,exportparts:"ncp ncp__header, ncp__dropdown, ncp__dropdown-button, ncp__dropdown-content"}),t.h("nylas-availability-picker",{name:"availability",openHours:h,defaultTimezone:u,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"}));case"bookingOptions":return t.h("div",{key:n},t.h("nylas-buffer-time",{name:"buffer-time",buffer:e.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"}),t.h("nylas-event-limits",null,t.h("div",{slot:"inputs"},t.h("nylas-limit-future-bookings",{name:"limit-future-bookings",availableDaysInFuture:e.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"}),t.h("nylas-min-cancellation-notice",{name:"min-cancellation-notice",minCancellationNotice:e.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"}))))}}const Q='.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}',X=Q;var Y=function(n,e,a,o){var s=arguments.length,i=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,a):o,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,a,o);else for(var r=n.length-1;r>=0;r--)(l=n[r])&&(i=(s<3?l(i):s>3?l(e,a,i):l(e,a))||i);return s>3&&i&&Object.defineProperty(e,a,i),i},x=function(n,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,e)};const L=class{constructor(n){t.registerInstance(this,n),this.schedulerConfigChanged=t.createEvent(this,"schedulerConfigChanged",7),this.cancelButtonClick=t.createEvent(this,"cancelButtonClick",7),this.formSubmitted=t.createEvent(this,"formSubmitted",7),this.previewButtonClicked=t.createEvent(this,"previewButtonClicked",7),this.setError=e=>{this.error=e.message},this.formSubmissionHandler=async e=>{var m,v,k,B,D,E,T,H,F,P,O,R,j,M,V,N;if(e.preventDefault(),this.formSubmitted.emit(),!this.formRef.checkValidity())return;this.isLoading=!0,this.hasUnsavedChanges=!1;const o=this.updateFormState(),{title:s,description:i,duration:l,availability:r,calendarIds:d,bookingCalendar:h,location:u,bookingType:b,buffer:f,availableDaysInFuture:p,minCancellationNotice:y}=o,c=(v=(m=this.selectedConfiguration)==null?void 0:m.participants)==null?void 0:v.find(U=>U.is_organizer),g={...((k=this.selectedConfiguration)==null?void 0:k.id)&&{id:this.selectedConfiguration.id},version:((B=this.selectedConfiguration)==null?void 0:B.version)??"1.0.0",availability:{duration_minutes:l?parseInt(l):0,interval_minutes:l?parseInt(l):0,availability_rules:{availability_method:((T=(E=(D=this.selectedConfiguration)==null?void 0:D.availability)==null?void 0:E.availability_rules)==null?void 0:T.availability_method)??"collective",buffer:f||{before:0,after:0},default_open_hours:((P=(F=(H=this.selectedConfiguration)==null?void 0:H.availability)==null?void 0:F.availability_rules)==null?void 0:P.default_open_hours)??$.DEFAULT_OPEN_HOURS,round_robin_group_id:((j=(R=(O=this.selectedConfiguration)==null?void 0:O.availability)==null?void 0:R.availability_rules)==null?void 0:j.round_robin_group_id)??""}},participants:[{name:(c==null?void 0:c.name)??(c==null?void 0:c.email)??((M=this.currentUser)==null?void 0:M.name)??((V=this.currentUser)==null?void 0:V.email)??"",email:(c==null?void 0:c.email)??((N=this.currentUser)==null?void 0:N.email)??"",is_organizer:!0,availability:{calendar_ids:d!=null&&d.length?d:["primary"],open_hours:(r==null?void 0:r.openHours)??[]},booking:{calendar_id:h&&h!==""?h:"primary"}}],event_booking:{title:(s==null?void 0:s.toString())??"",description:(i==null?void 0:i.toString())??"",location:(u==null?void 0:u.toString())??"",booking_type:(b==null?void 0:b.toString())??"booking",timezone:(r==null?void 0:r.timezone)??Intl.DateTimeFormat().resolvedOptions().timeZone},scheduler:{available_days_in_future:p??30,min_cancellation_notice:y??0}},_=t.mergeDeep(g,this.selectedConfiguration),w=this.action==="create"?_:g,C=U=>{this.isLoading=!1,this.changesSaved=!0,setTimeout(()=>{this.changesSaved=!1},5e3)};this.schedulerConfigChanged.emit({config:w,resetLoadingState:C,setError:this.setError,action:this.action})},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=""}configChangedHandler(n){t.debug("[nylas-editor-tabs]","configChangedHandler",n,this.selectedConfiguration),this.formState={...this.getFormStateFromConfig(n)},n.id?this.action="edit":this.action="create"}connectedCallback(){t.debug("[nylas-editor-tabs]","connectedCallback")}componentWillLoad(){t.debug("[nylas-editor-tabs]","componentWillLoad"),this.formState=this.getFormStateFromConfig(this.selectedConfiguration)}componentDidLoad(){t.debug("[nylas-editor-tabs]","componentDidLoad")}disconnectedCallback(){t.debug("[nylas-editor-tabs]","disconnectedCallback")}handleValueChanged(n){t.debug("[nylas-editor-tabs]","handleValueChanged",n);const{name:e,value:a}=n.detail;this.formState={...this.formState,[e]:a},this.hasUnsavedChanges=!0,this.error=""}getFormStateFromConfig(n){var a,o,s,i,l,r,d,h,u,b,f,p,y,c,g,_,w,C,m,v;const e=(a=n==null?void 0:n.participants)==null?void 0:a.find(k=>k.is_organizer);return{title:((o=n==null?void 0:n.event_booking)==null?void 0:o.title)??"",description:((s=n==null?void 0:n.event_booking)==null?void 0:s.description)??"",duration:((l=(i=n==null?void 0:n.availability)==null?void 0:i.duration_minutes)==null?void 0:l.toString())??"10",availability:{timezone:((r=n==null?void 0:n.event_booking)==null?void 0:r.timezone)??Intl.DateTimeFormat().resolvedOptions().timeZone,open_hours:((d=e==null?void 0:e.availability)==null?void 0:d.open_hours)??void 0},calendarIds:((h=e==null?void 0:e.availability)==null?void 0:h.calendar_ids)??[],participants:(n==null?void 0:n.participants)??[],bookingCalendar:((u=e==null?void 0:e.booking)==null?void 0:u.calendar_id)??(e==null?void 0:e.email)??"",location:((f=(b=this.selectedConfiguration)==null?void 0:b.event_booking)==null?void 0:f.location)??"",bookingType:((y=(p=this.selectedConfiguration)==null?void 0:p.event_booking)==null?void 0:y.booking_type)??"booking",buffer:((_=(g=(c=this.selectedConfiguration)==null?void 0:c.availability)==null?void 0:g.availability_rules)==null?void 0:_.buffer)??{before:0,after:0},availableDaysInFuture:((C=(w=this.selectedConfiguration)==null?void 0:w.scheduler)==null?void 0:C.available_days_in_future)??30,minCancellationNotice:((v=(m=this.selectedConfiguration)==null?void 0:m.scheduler)==null?void 0:v.min_cancellation_notice)??0}}updateFormState(){return new FormData(this.formRef).forEach((e,a)=>{switch(a){case"title":this.formState.title=e.toString();break;case"description":this.formState.description=e.toString();break;case"duration":this.formState.duration=e.toString();break;case"availability":this.formState.availability=JSON.parse(e.toString());break;case"participants":this.formState.participants=JSON.parse(e.toString());break;case"calendars":this.formState.calendarIds=e.toString().split(",");break;case"booking-calendar":this.formState.bookingCalendar=e.toString();break;case"location":this.formState.location=e.toString();break;case"booking-type":this.formState.bookingType=e.toString();break;case"buffer-time":this.formState.buffer=JSON.parse(e.toString());break;case"limit-future-bookings":this.formState.availableDaysInFuture=parseInt(e.toString());break;case"min-cancellation-notice":this.formState.minCancellationNotice=parseInt(e.toString());break}}),this.formState={...this.formState},this.formState}setActiveTab(n,e){n.preventDefault(),this.updateFormState(),this.activeTab=e}render(){var n;return t.debug("[nylas-editor-tabs]","render",this.formState),t.h(t.Host,{key:"3a15824595dbee9a62a39fe192b42b8289d122fb"},t.h("form",{key:"a4239f9ff55924bfef3166cd2084756e85172f6e",onSubmit:this.formSubmissionHandler,class:"scheduler-editor",ref:e=>this.formRef=e,noValidate:!0},this.mode==="app"?t.h("div",{class:"form-contents"},t.h("div",{class:"tabs"},t.h("button",{class:{tab:!0,active:this.activeTab=="eventInfo"},onClick:e=>this.setActiveTab(e,"eventInfo")},t.h("calendar-info-icon",{width:"16",height:"16"}),"Event Info"),t.h("button",{class:{tab:!0,active:this.activeTab=="availability"},onClick:e=>this.setActiveTab(e,"availability")},t.h("calendar-patterns-icon",{width:"16",height:"16"}),"Availability"),t.h("button",{class:{tab:!0,active:this.activeTab=="bookingOptions"},onClick:e=>this.setActiveTab(e,"bookingOptions")},t.h("flow-icon",{width:"16",height:"16"}),"Booking Options")),t.h("div",{class:"tab-content"},t.h(K,{formState:this.formState,activeTab:this.activeTab,calendars:this.calendars,id:((n=this.selectedConfiguration)==null?void 0:n.id)??"new"}))):t.h("slot",null),t.h("div",{key:"611af00bdae4a57a81d5e15b10338f0f73e2eb63",class:"footer"},t.h("div",{key:"a0b50b0dc68b6c9ac2b1b2f152b17494a092f5a5",class:"preview"},this.schedulerPreviewLink!==""&&this.action==="edit"&&t.h("button-component",{type:"button",disabled:this.isLoading,clickHandler:e=>{e.preventDefault(),this.previewButtonClicked.emit(this.host).defaultPrevented||window.open(t.parsePreviewLink(this.schedulerPreviewLink,this.selectedConfiguration),"_blank")},variant:"basic"},"Preview")),t.h("div",{key:"e965241b0d1b44cf94ff56577e10d1d2d89628ac",class:"buttons"},t.h("p",{key:"482ce16ace804a25fc28e37cdaa57f47cab4996b",class:{"unsaved-changes":this.hasUnsavedChanges&&!this.changesSaved,"saved-changes":this.changesSaved,error:this.error!=="","error-full-width":this.error!==""&&this.action==="create"}},this.error!==""?this.error:"",this.error==""&&this.hasUnsavedChanges&&!this.changesSaved?"Unsaved changes":this.error==""&&this.changesSaved?"Changes saved!":""),t.h("button-component",{key:"704dd4272d0f1a76584ecd0b42d5c0c0a4fd64d3",type:"button",disabled:this.isLoading,clickHandler:e=>{e.preventDefault(),this.cancelButtonClick.emit(),this.error=""},variant:"basic"},"Cancel"),t.h("button-component",{key:"68be33805f20229f35806be4c759cd8a00504fcc",type:"submit",disabled:this.isLoading},this.isLoading?t.h("span",null,"Saving",t.h("loading-icon",null)," "):this.action=="create"?"Create":"Save changes")))))}get host(){return t.getElement(this)}static get watchers(){return{selectedConfiguration:["configChangedHandler"]}}};Y([A.RegisterComponent({name:"nylas-editor-tabs",stateToProps:new Map([["schedulerConfig.calendars","calendars"],["schedulerConfig.selectedConfiguration","selectedConfiguration"],["schedulerConfig.currentUser","currentUser"]]),eventToProps:{schedulerConfigChanged:async(n,e)=>{const{resetLoadingState:a,setError:o,action:s,config:i}=n.detail,l=r=>{const[d,h]=r;!d&&h&&o&&o(h),a&&a(n)};if(s==="edit"){const r=await e.schedulerConfig.updateConfiguration(i);l(r)}else{const r=await e.schedulerConfig.createConfiguration(i);l(r)}},cancelButtonClick:async(n,e)=>{e.schedulerConfigStore.state.action=null},previewButtonClicked:async(n,e)=>{t.debug("[nylas-editor-tabs]","previewButtonClicked",e)},formSubmitted:async(n,e)=>{t.debug("[nylas-editor-tabs]","formSubmitted",e)}},localPropsToProp:new Map([["schedulerPreviewLink","schedulerPreviewLink"]]),fireRegisterEvent:!0}),x("design:type",Function),x("design:paramtypes",[]),x("design:returntype",void 0)],L.prototype,"render",null);L.style=X;const tt=':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}',et=tt;var nt=function(n,e,a,o){var s=arguments.length,i=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,a):o,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,a,o);else for(var r=n.length-1;r>=0;r--)(l=n[r])&&(i=(s<3?l(i):s>3?l(e,a,i):l(e,a))||i);return s>3&&i&&Object.defineProperty(e,a,i),i},S=function(n,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,e)};const I=class{constructor(n){t.registerInstance(this,n),this.initListConfigurations=t.createEvent(this,"initListConfigurations",7),this.createButtonClick=t.createEvent(this,"createButtonClick",7),this.editButtonClick=t.createEvent(this,"editButtonClick",7),this.deleteButtonClick=t.createEvent(this,"deleteButtonClick",7),this.configurations=[],this.schedulerPreviewLink="",this.state="loading",this.error="",this.copiedButtonIndex=-1}connectedCallback(){t.debug("[nylas-list-configurations]","connectedCallback")}componentWillLoad(){t.debug("[nylas-list-configurations]","componentWillLoad"),this.configurations&&this.configurations.length>0&&(this.state="loaded")}componentDidLoad(){t.debug("[nylas-list-configurations]","componentDidLoad"),this.initListConfigurations.emit(this.host)}disconnectedCallback(){t.debug("[nylas-list-configurations]","disconnectedCallback")}async getState(){return this.state}async setState(n){this.state=n}async setError(n){this.error=n}render(){return t.h(t.Host,null,t.h("div",{class:"header"},t.h("div",{class:"description"},t.h("h2",null,"All scheduling pages"),t.h("p",null,"Create, edit and manage all your scheduling pages.")),this.configurations&&this.configurations.length>0&&t.h("div",{class:"actions"},t.h("button-component",{clickHandler:()=>{this.createButtonClick.emit(this.host)}},"Create new"))),t.h("div",{class:"configurations"},t.h("table",{class:{"no-configurations":this.state!=="loading"&&(!this.configurations||this.configurations.length===0)}},t.h("tr",{class:{hide:this.state==="loading"||this.configurations&&this.configurations.length===0}},t.h("th",null,"Scheduling page event title"),t.h("th",null,"Duration"),t.h("th",{class:"actions-header"},"Actions")),this.state==="loading"&&t.h("tr",{class:"no-configurations"},t.h("td",{colSpan:3},t.h("div",null,t.h("h3",null,"Loading..."),t.h("p",null,"Please wait while we fetch the scheduling pages")))),this.state!=="loading"&&(!this.configurations||this.configurations.length===0)&&t.h("tr",{class:"no-configurations"},t.h("td",{colSpan:3},t.h("div",null,t.h("calendar-icon",{width:"48",height:"48"}),t.h("h3",null,"No scheduling pages found"),t.h("p",null,"Get started with creating your first scheduling page"),t.h("button-component",{clickHandler:()=>{this.createButtonClick.emit(this.host)}},"Create new")))),this.state!=="loading"&&this.configurations.map((n,e)=>t.h("tr",{key:n.id},t.h("td",null,t.h("div",{class:"title"},t.h("span",{class:"config-event-title"},n.event_booking.title),t.h("span",{class:"config-event-description"},n.event_booking.description))),t.h("td",null,t.h("div",null,n.availability.duration_minutes," mins")),t.h("td",null,t.h("div",{class:"actions"},t.h("button-component",{variant:"basic",id:"copy",key:`copy-${e}`,clickHandler:async a=>{a.preventDefault();const o=t.parsePreviewLink(this.schedulerPreviewLink,n);await navigator.clipboard.writeText(o),this.copiedButtonIndex=e,setTimeout(()=>{this.copiedButtonIndex=-1},3e3)}},this.copiedButtonIndex===e?"Copied!":"Copy link"),t.h("button-component",{variant:"basic",key:`edit-${e}`,clickHandler:a=>{a.preventDefault(),this.editButtonClick.emit({host:this.host,configuration:n})}},"Edit"),t.h("button-component",{variant:"basic",key:`delete-${e}`,clickHandler:a=>{a.preventDefault(),this.deleteButtonClick.emit({host:this.host,configuration:n})}},"Delete"))))))),this.state==="error"&&t.h("div",{class:"error-container"},t.h("p",{class:"error"},this.error)))}get host(){return t.getElement(this)}};nt([A.RegisterComponent({name:"nylas-list-configurations",stateToProps:new Map([["schedulerConfig.configurations","configurations"]]),localPropsToProp:new Map([["schedulerPreviewLink","schedulerPreviewLink"]]),eventToProps:{initListConfigurations:async(n,e)=>{const a=n.detail;await a.setState("loading");const[o,s]=await e.schedulerConfig.getConfigurations();if(!o&&s&&s.message){await a.setState("error"),await a.setError(s.message);return}await a.setState("loaded")},createButtonClick:async(n,e)=>{e.schedulerConfigStore.resetSelectedConfiguration(),e.schedulerConfigStore.state.action="create"},deleteButtonClick:async(n,e)=>{const{host:a,configuration:o}=n.detail,[s,i]=await e.schedulerConfig.deleteConfiguration(o.id);!s&&i&&i.message&&(await a.setState("error"),await a.setError(i.message))},editButtonClick:async(n,e)=>{const{configuration:a}=n.detail;e.schedulerConfigStore.state.selectedConfiguration=a,e.schedulerConfigStore.state.action="edit"}},fireRegisterEvent:!0}),S("design:type",Function),S("design:paramtypes",[]),S("design:returntype",void 0)],I.prototype,"render",null);I.style=et;exports.google_logo_icon=Z;exports.microsoft_logo_icon=z;exports.nylas_editor_tabs=L;exports.nylas_list_configurations=I;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const s=require("./index-553c0327.cjs");var e=s.commonjsGlobal.process;exports.process=e;
|