@nylas/react 1.0.2-canary.2 → 1.1.0-canary.10
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_21.entry-125b87a0.js +1719 -0
- package/dist/add-circle-icon_21.entry-1a699a29.cjs +1 -0
- package/dist/{archive-icon_7.entry-0e34d6e7.js → archive-icon_7.entry-70efea56.js} +13 -13
- package/dist/{archive-icon_7.entry-052ac074.cjs → archive-icon_7.entry-a69d3d98.cjs} +1 -1
- package/dist/{arrow-icon.entry-93f21385.cjs → arrow-icon.entry-0a07d7cc.cjs} +1 -1
- package/dist/{arrow-icon.entry-2afd9ea9.js → arrow-icon.entry-c9230436.js} +1 -1
- package/dist/{bold-icon_3.entry-88ce1d25.js → bold-icon_3.entry-54ff7799.js} +7 -7
- package/dist/bold-icon_3.entry-f7df4331.cjs +1 -0
- package/dist/{calendar-cancel-icon.entry-574c8aa4.cjs → calendar-cancel-icon.entry-71cc68e2.cjs} +1 -1
- package/dist/{calendar-cancel-icon.entry-e9c692fa.js → calendar-cancel-icon.entry-e5157332.js} +1 -1
- package/dist/{calendar-check-icon_2.entry-b0476bca.cjs → calendar-check-icon_2.entry-f02bf0fe.cjs} +1 -1
- package/dist/{calendar-check-icon_2.entry-d461c713.js → calendar-check-icon_2.entry-f75ef95e.js} +1 -1
- package/dist/{calendar-icon.entry-1ca202a4.js → calendar-icon.entry-67aa69f5.js} +1 -1
- package/dist/{calendar-icon.entry-98936e6d.cjs → calendar-icon.entry-a164e957.cjs} +1 -1
- package/dist/chevron-icon_3.entry-7687ca7a.cjs +1 -0
- package/dist/chevron-icon_3.entry-81c68946.js +117 -0
- package/dist/{close-icon.entry-8d6e9816.cjs → close-icon.entry-147b4d47.cjs} +1 -1
- package/dist/{close-icon.entry-37e8361f.js → close-icon.entry-3325a08e.js} +1 -1
- package/dist/{constants-b6bf6671-49a0f1f2.js → constants-f34b9c6e-21ac1910.js} +11 -2
- package/dist/{constants-b6bf6671-27e2557d.cjs → constants-f34b9c6e-99030371.cjs} +2 -2
- package/dist/{document-refresh-icon.entry-faea08ce.js → document-refresh-icon.entry-1b076630.js} +1 -1
- package/dist/{document-refresh-icon.entry-fcb33921.cjs → document-refresh-icon.entry-dea23e07.cjs} +1 -1
- package/dist/elements/index.d.ts +8 -0
- package/dist/{elements-dc5b338e-81a0319c.cjs → elements-dc5b338e-83c23e9b.cjs} +1 -1
- package/dist/{elements-dc5b338e-fb5dbfb5.js → elements-dc5b338e-c69d1f8a.js} +1 -1
- package/dist/focus-visible-e8093c16-3082af2c.cjs +1 -0
- package/dist/{focus-visible-e8093c16-28fc08a0.js → focus-visible-e8093c16-a6aff071.js} +5 -3
- package/dist/{forward-icon_6.entry-8da1f65d.js → forward-icon_6.entry-55fce1ca.js} +9 -11
- package/dist/forward-icon_6.entry-59c7a975.cjs +3 -0
- package/dist/{globe-icon.entry-4720304b.js → globe-icon.entry-25145785.js} +1 -1
- package/dist/{globe-icon.entry-90a0b9c9.cjs → globe-icon.entry-904f180f.cjs} +1 -1
- package/dist/google-logo-icon_4.entry-1f7b9522.js +387 -0
- package/dist/google-logo-icon_4.entry-feb7a561.cjs +1 -0
- package/dist/index-5f0940e0.cjs +37 -0
- package/dist/index-fd39ea9d.js +4042 -0
- package/dist/index.d.ts +4 -2
- package/dist/index.es-be19d2df-9ba9a7a6.cjs +7 -0
- package/dist/{index-10914bc1-346f04fa.js → index.es-be19d2df-ff4f0a10.js} +945 -1041
- package/dist/{info-icon_2.entry-9307db18.js → info-icon_2.entry-0e2105da.js} +3 -3
- package/dist/{info-icon_2.entry-81e95048.cjs → info-icon_2.entry-808e6516.cjs} +1 -1
- package/dist/loading-icon.entry-17efa7ca.cjs +1 -0
- package/dist/loading-icon.entry-a3b845bf.js +15 -0
- package/dist/{mailbox-store-e721b17c-cf9a43dd.js → mailbox-store-76540d24-5f0d1dff.js} +121 -59
- package/dist/mailbox-store-76540d24-ad0e366a.cjs +1 -0
- package/dist/{nylas-additional-participants.entry-1653dec7.js → nylas-additional-participants.entry-4120ea2e.js} +13 -15
- package/dist/nylas-additional-participants.entry-7e2446cb.cjs +1 -0
- package/dist/nylas-booked-event-card_10.entry-44812e35.cjs +1 -0
- package/dist/{nylas-booked-event-card_10.entry-aa971e8a.js → nylas-booked-event-card_10.entry-5e87b199.js} +294 -273
- package/dist/nylas-custom-booking-flow.entry-cbff44c8.js +106 -0
- package/dist/nylas-custom-booking-flow.entry-da5e66bb.cjs +1 -0
- package/dist/{nylas-form-card.entry-c4e78f88.js → nylas-form-card.entry-1c608edd.js} +13 -15
- package/dist/nylas-form-card.entry-2e629e36.cjs +1 -0
- package/dist/nylas-if-state.entry-2c0d8724.js +94 -0
- package/dist/nylas-if-state.entry-61771f3d.cjs +1 -0
- package/dist/{nylas-list-folders.entry-995fa819.js → nylas-list-folders.entry-d6e085b0.js} +6 -8
- package/dist/nylas-list-folders.entry-fa8e8ce9.cjs +1 -0
- package/dist/{nylas-list-threads.entry-21466eb3.js → nylas-list-threads.entry-4dd2de0a.js} +5 -7
- package/dist/nylas-list-threads.entry-99fc0baa.cjs +1 -0
- package/dist/nylas-login.entry-0ec0813c.cjs +1 -0
- package/dist/nylas-login.entry-6730e226.js +73 -0
- package/dist/{nylas-mailbox-pagination.entry-02d40186.js → nylas-mailbox-pagination.entry-5310880c.js} +7 -9
- package/dist/nylas-mailbox-pagination.entry-e3e52f42.cjs +1 -0
- package/dist/{nylas-mailbox-toolbar-button.entry-dbad44b4.js → nylas-mailbox-toolbar-button.entry-028075db.js} +15 -17
- package/dist/nylas-mailbox-toolbar-button.entry-4c377337.cjs +1 -0
- package/dist/nylas-mailbox.entry-87304850.cjs +1 -0
- package/dist/nylas-mailbox.entry-ab92780c.js +134 -0
- package/dist/nylas-provider.entry-3fb60fe4.cjs +1 -0
- package/dist/{nylas-provider.entry-bbee8c99.js → nylas-provider.entry-678a9fe7.js} +48 -58
- package/dist/nylas-scheduler-editor.entry-a0de0ae6.js +2269 -0
- package/dist/nylas-scheduler-editor.entry-cf19391e.cjs +7 -0
- package/dist/nylas-scheduling.entry-d8bb2648.cjs +1 -0
- package/dist/nylas-scheduling.entry-e38c3870.js +248 -0
- package/dist/nylas-threads-refresh.entry-79c8a061.cjs +1 -0
- package/dist/{nylas-threads-refresh.entry-414d8740.js → nylas-threads-refresh.entry-fcb2175f.js} +2 -4
- package/dist/{nylas-threads-search.entry-a19dc90f.js → nylas-threads-search.entry-7565bdf8.js} +13 -15
- package/dist/nylas-threads-search.entry-f2d5d0fb.cjs +1 -0
- package/dist/{nylas-view-thread.entry-38149162.js → nylas-view-thread.entry-1772e0c4.js} +10 -12
- package/dist/nylas-view-thread.entry-6a2ccece.cjs +1 -0
- package/dist/{people-icon.entry-4b682757.cjs → people-icon.entry-3218a267.cjs} +1 -1
- package/dist/{people-icon.entry-5c244c8d.js → people-icon.entry-bc2c70cf.js} +5 -5
- package/dist/play-icon_2.entry-450a7fa6.cjs +1 -0
- package/dist/play-icon_2.entry-b4dc4e6d.js +25 -0
- package/dist/react.cjs +1 -1
- package/dist/react.js +88 -78
- package/dist/{refresh-icon.entry-59fff3d4.cjs → refresh-icon.entry-030dda82.cjs} +1 -1
- package/dist/{refresh-icon.entry-63456c9a.js → refresh-icon.entry-d30c7264.js} +5 -5
- package/dist/register-component-83e24412-0b25de7f.cjs +1 -0
- package/dist/{register-component-d056a880-f3003d6c.js → register-component-83e24412-35c484c4.js} +37 -33
- package/dist/scheduler-config-store-ec3b6190-6d8cef0f.cjs +1 -0
- package/dist/scheduler-config-store-ec3b6190-d5edbae5.js +23 -0
- package/dist/scheduler-store-8ca9003d-38cca5ba.js +321 -0
- package/dist/scheduler-store-8ca9003d-c2aa3522.cjs +1 -0
- package/dist/time-period-selector.entry-b366ba86.js +76 -0
- package/dist/time-period-selector.entry-b3d04e93.cjs +1 -0
- package/dist/{translate-icon.entry-1784c18e.cjs → translate-icon.entry-03ab2513.cjs} +1 -1
- package/dist/{translate-icon.entry-35999e70.js → translate-icon.entry-b3c21ae9.js} +5 -5
- package/dist/warning-icon.entry-602d459b.js +15 -0
- package/dist/{warning-icon.entry-3a702d1d.cjs → warning-icon.entry-65ecfdf0.cjs} +1 -1
- package/package.json +3 -3
- package/dist/_commonjsHelpers-57e89916-4a3ae7d8.cjs +0 -1
- package/dist/_commonjsHelpers-57e89916-af061c86.js +0 -19
- package/dist/add-circle-icon_18.entry-b66b6343.cjs +0 -1
- package/dist/add-circle-icon_18.entry-f86ae88d.js +0 -1527
- package/dist/auth-store-69ac49c7-5a0bbb90.cjs +0 -1
- package/dist/auth-store-69ac49c7-cbfda055.js +0 -66
- package/dist/bold-icon_3.entry-8f55a9e7.cjs +0 -1
- package/dist/chevron-icon_3.entry-830f52c2.js +0 -105
- package/dist/chevron-icon_3.entry-f7801467.cjs +0 -1
- package/dist/focus-visible-e8093c16-f380b705.cjs +0 -1
- package/dist/forward-icon_6.entry-c4b37cb1.cjs +0 -3
- package/dist/index-10914bc1-c8c3a2f3.cjs +0 -7
- package/dist/index-457dcf0b.cjs +0 -30
- package/dist/index-ce40ad47.js +0 -1570
- package/dist/loading-icon.entry-06d37ef0.cjs +0 -1
- package/dist/loading-icon.entry-dc518df4.js +0 -15
- package/dist/mailbox-store-e721b17c-4e97e07d.cjs +0 -1
- package/dist/nylas-additional-participants.entry-ff8bf378.cjs +0 -1
- package/dist/nylas-booked-event-card_10.entry-06bc3c51.cjs +0 -1
- package/dist/nylas-editor-tabs.entry-49b5a3ab.cjs +0 -1
- package/dist/nylas-editor-tabs.entry-9d0959bf.js +0 -181
- package/dist/nylas-form-card.entry-69d2095b.cjs +0 -1
- package/dist/nylas-if-state_3.entry-2eb3f385.js +0 -293
- package/dist/nylas-if-state_3.entry-5baf6d6f.cjs +0 -1
- package/dist/nylas-list-folders.entry-3b24d92d.cjs +0 -1
- package/dist/nylas-list-threads.entry-fda42ded.cjs +0 -1
- package/dist/nylas-mailbox-pagination.entry-9dcd4901.cjs +0 -1
- package/dist/nylas-mailbox-toolbar-button.entry-d1099fab.cjs +0 -1
- package/dist/nylas-provider.entry-78e2fa30.cjs +0 -1
- package/dist/nylas-scheduler-editor.entry-550d3c59.cjs +0 -1
- package/dist/nylas-scheduler-editor.entry-8f7ecf3b.js +0 -111
- package/dist/nylas-scheduling.entry-22b5ad07.js +0 -236
- package/dist/nylas-scheduling.entry-30a63738.cjs +0 -1
- package/dist/nylas-threads-refresh.entry-05258b36.cjs +0 -1
- package/dist/nylas-threads-search.entry-ff21fc65.cjs +0 -1
- package/dist/nylas-view-thread.entry-5da81e99.cjs +0 -1
- package/dist/play-icon_2.entry-ccdc6b9c.cjs +0 -1
- package/dist/play-icon_2.entry-f36d6d55.js +0 -25
- package/dist/register-component-d056a880-2be11c56.cjs +0 -1
- package/dist/scheduler-config-store-4d035001-0256b40c.cjs +0 -1
- package/dist/scheduler-config-store-4d035001-db9dc78a.js +0 -33
- package/dist/scheduler-store-0fbe642c-14466305.js +0 -293
- package/dist/scheduler-store-0fbe642c-410fdbf4.cjs +0 -1
- package/dist/utils-0cd66d04-89ab163d.js +0 -2111
- package/dist/utils-0cd66d04-94b9c3b6.cjs +0 -8
- package/dist/warning-icon.entry-73de08c3.js +0 -15
|
@@ -1,293 +0,0 @@
|
|
|
1
|
-
import { r as p, h as i, H as b, c as m, g as N } from "./index-ce40ad47.js";
|
|
2
|
-
import { R as A } from "./register-component-d056a880-f3003d6c.js";
|
|
3
|
-
import { d as h } from "./utils-0cd66d04-89ab163d.js";
|
|
4
|
-
import { N as P, e as L } from "./index-10914bc1-346f04fa.js";
|
|
5
|
-
import { C as T, N as O } from "./auth-store-69ac49c7-cbfda055.js";
|
|
6
|
-
import { C as I, H, N as E, a as B, b as $ } from "./mailbox-store-e721b17c-cf9a43dd.js";
|
|
7
|
-
import "react";
|
|
8
|
-
import "react-dom";
|
|
9
|
-
import "./_commonjsHelpers-57e89916-af061c86.js";
|
|
10
|
-
const D = ":host{display:block}div{height:inherit}@keyframes fadeIn{0%{opacity:0}100%{opacity:1}}@keyframes fadeOut{0%{opacity:1}100%{opacity:0}}.fade-in{animation:fadeIn 1.5s}.fade-out{animation:fadeOut 1.5s}@keyframes slideIn{0%{transform:translateY(100%)}100%{transform:translateY(0)}}@keyframes slideOut{0%{transform:translateY(0)}100%{transform:translateY(100%)}}.slide-in{animation:slideIn 1.5s}.slide-out{animation:slideOut 1.5s}@keyframes swipeIn{0%{transform:translateX(100%)}100%{transform:translateX(0)}}@keyframes swipeOut{0%{transform:translateX(0)}100%{transform:translateX(100%)}}.swipe-in{animation:swipeIn 1.5s}.swipe-out{animation:swipeOut 1.5s}", F = D;
|
|
11
|
-
var U = function(e, t, o, n) {
|
|
12
|
-
var s = arguments.length, a = s < 3 ? t : n === null ? n = Object.getOwnPropertyDescriptor(t, o) : n, r;
|
|
13
|
-
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
14
|
-
a = Reflect.decorate(e, t, o, n);
|
|
15
|
-
else
|
|
16
|
-
for (var l = e.length - 1; l >= 0; l--)
|
|
17
|
-
(r = e[l]) && (a = (s < 3 ? r(a) : s > 3 ? r(t, o, a) : r(t, o)) || a);
|
|
18
|
-
return s > 3 && a && Object.defineProperty(t, o, a), a;
|
|
19
|
-
}, y = function(e, t) {
|
|
20
|
-
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
21
|
-
return Reflect.metadata(e, t);
|
|
22
|
-
};
|
|
23
|
-
const M = class {
|
|
24
|
-
constructor(e) {
|
|
25
|
-
p(this, e), this.state = void 0, this.isStateSet = void 0, this.isBoolean = void 0, this.getStore = void 0, this.transition = "none", this.show = !1, this.classes = {}, this.initTransition = this.initTransition.bind(this);
|
|
26
|
-
}
|
|
27
|
-
connectedCallback() {
|
|
28
|
-
}
|
|
29
|
-
disconnectedCallback() {
|
|
30
|
-
}
|
|
31
|
-
async componentWillLoad() {
|
|
32
|
-
h("[nylas-if-state] Component will load"), this.watchStore(!0);
|
|
33
|
-
}
|
|
34
|
-
async componentDidLoad() {
|
|
35
|
-
h("[nylas-if-state] Component did load");
|
|
36
|
-
}
|
|
37
|
-
shouldRender() {
|
|
38
|
-
const [e, t] = this.state ? this.state.split(".") : ["", ""], o = this.getStore;
|
|
39
|
-
if (typeof o > "u")
|
|
40
|
-
return h(`[nylas-if-state] Store name: ${e} | State name: ${t}`, { getStore: o }), !1;
|
|
41
|
-
const n = o(e);
|
|
42
|
-
if (typeof n > "u")
|
|
43
|
-
return h(`[nylas-if-state] Store name: ${e} | State name: ${t}`, { store: n }), !1;
|
|
44
|
-
const s = n.state[t];
|
|
45
|
-
return typeof this.isStateSet == "boolean" ? this.isStateSet === !1 && (typeof s > "u" || s === null || s.length === 0) || this.isStateSet === !0 && typeof s < "u" && s !== null : typeof this.isBoolean == "boolean" ? this.isBoolean === !0 && typeof s < "u" && s === !0 || this.isBoolean === !1 && typeof s < "u" && s === !1 : !1;
|
|
46
|
-
}
|
|
47
|
-
onGetStoreChange() {
|
|
48
|
-
this.watchStore(!0);
|
|
49
|
-
}
|
|
50
|
-
watchStore(e = !1) {
|
|
51
|
-
const [t, o] = this.state ? this.state.split(".") : ["", ""], n = this.getStore;
|
|
52
|
-
if (typeof n > "u")
|
|
53
|
-
return h(`[nylas-if-state] Store name: ${t} | State name: ${o}`, { getStore: n }), null;
|
|
54
|
-
const s = n(t);
|
|
55
|
-
if (typeof s > "u")
|
|
56
|
-
return h(`[nylas-if-state] Store name: ${t} | State name: ${o}`, { store: s }), null;
|
|
57
|
-
e === !0 && this.initTransition(), s.onChange(o, this.initTransition);
|
|
58
|
-
}
|
|
59
|
-
initTransition() {
|
|
60
|
-
const e = this.shouldRender();
|
|
61
|
-
switch (this.transition) {
|
|
62
|
-
case "fade":
|
|
63
|
-
case "slide":
|
|
64
|
-
case "swipe":
|
|
65
|
-
this.classes = {
|
|
66
|
-
[`${this.transition}-in`]: e,
|
|
67
|
-
[`${this.transition}-out`]: !e
|
|
68
|
-
}, setTimeout(() => {
|
|
69
|
-
this.show = e;
|
|
70
|
-
}, 150);
|
|
71
|
-
break;
|
|
72
|
-
default:
|
|
73
|
-
this.show = this.shouldRender();
|
|
74
|
-
break;
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
render() {
|
|
78
|
-
return i(b, { key: "91d17bc89a09742106ef3bd9365c5ce48cf14e86" }, i("div", { key: "9d0070be4bf5d9a5f405fc4a0733e6d832fa669a", class: this.classes }, this.show && i("slot", null)));
|
|
79
|
-
}
|
|
80
|
-
static get watchers() {
|
|
81
|
-
return {
|
|
82
|
-
getStore: ["onGetStoreChange"]
|
|
83
|
-
};
|
|
84
|
-
}
|
|
85
|
-
};
|
|
86
|
-
U([
|
|
87
|
-
A({
|
|
88
|
-
name: "nylas-if-state",
|
|
89
|
-
getStoresToProp: "getStore",
|
|
90
|
-
fireRegisterEvent: !0
|
|
91
|
-
}),
|
|
92
|
-
y("design:type", Function),
|
|
93
|
-
y("design:paramtypes", []),
|
|
94
|
-
y("design:returntype", void 0)
|
|
95
|
-
], M.prototype, "render", null);
|
|
96
|
-
M.style = F;
|
|
97
|
-
const j = ":host{font-family:'Arial', sans-serif;background:var(--nylas-color-primary-50);color:var(--nylas-color-primary-800);margin:0;display:contents}input{box-sizing:border-box}.login-container{display:flex;justify-content:center;align-items:center;height:100%}.login-box{width:300px;padding:20px;box-shadow:0 4px 8px rgba(0, 0, 0, 0.1);border-radius:var(--nylas-border-radius-2x);background:var(--nylas-color-primary-50);text-align:center}.login-box h1{margin-top:0;margin-bottom:0.5em}.login-box p{margin-bottom:1em}.login-methods button{display:block;width:100%;padding:10px 10px 10px 50px;margin-bottom:10px;border:none;border-radius:var(--nylas-border-radius);border:1px solid var(--nylas-color-primary-300);background:var(--nylas-color-primary-100);color:var(--nylas-color-primary-600);cursor:pointer;transition:background 0.3s ease;position:relative;text-align:left}.login-methods button svg{position:absolute;left:16px;top:50%;transform:translateY(-50%)}.login-methods button:hover{background:var(--nylas-color-primary-200);}.login-form label{display:block;margin-bottom:5px;text-align:left}.login-form input{width:100%;padding:10px;margin-bottom:10px;border:1px solid var(--nylas-color-primary-200);border-radius:var(--nylas-border-radius);background:var(--nylas-color-primary-100);color:var(--nylas-color-primary-800);}.login-form button{width:100%;padding:10px;border:none;border-radius:var(--nylas-border-radius);background:var(--nylas-color-primary-500);color:var(--nylas-color-primary-50);cursor:pointer;transition:background 0.3s ease}.login-form button:hover{background:var(--nylas-color-primary-600);}", z = j;
|
|
98
|
-
var W = function(e, t, o, n) {
|
|
99
|
-
var s = arguments.length, a = s < 3 ? t : n === null ? n = Object.getOwnPropertyDescriptor(t, o) : n, r;
|
|
100
|
-
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
101
|
-
a = Reflect.decorate(e, t, o, n);
|
|
102
|
-
else
|
|
103
|
-
for (var l = e.length - 1; l >= 0; l--)
|
|
104
|
-
(r = e[l]) && (a = (s < 3 ? r(a) : s > 3 ? r(t, o, a) : r(t, o)) || a);
|
|
105
|
-
return s > 3 && a && Object.defineProperty(t, o, a), a;
|
|
106
|
-
}, g = function(e, t) {
|
|
107
|
-
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
108
|
-
return Reflect.metadata(e, t);
|
|
109
|
-
};
|
|
110
|
-
const _ = class {
|
|
111
|
-
constructor(e) {
|
|
112
|
-
p(this, e), this.buttonClick = m(this, "buttonClick", 7), this._handleLoginRedirect = async () => {
|
|
113
|
-
var n;
|
|
114
|
-
const t = await ((n = this.nylasConnector) == null ? void 0 : n.auth.getHostedAuthRedirectURL(this.scopes));
|
|
115
|
-
this.buttonClick.emit({ url: t }).defaultPrevented || t && (window.location.href = t);
|
|
116
|
-
}, this._onGoogleButtonClick = async (t) => {
|
|
117
|
-
var n;
|
|
118
|
-
t.preventDefault();
|
|
119
|
-
const o = await ((n = this.nylasConnector) == null ? void 0 : n.auth.getHostedAuthRedirectURL(this.scopes, void 0, "google"));
|
|
120
|
-
o && (window.location.href = o);
|
|
121
|
-
}, this._onMicrosoftButtonClick = async (t) => {
|
|
122
|
-
var n;
|
|
123
|
-
t.preventDefault();
|
|
124
|
-
const o = await ((n = this.nylasConnector) == null ? void 0 : n.auth.getHostedAuthRedirectURL(this.scopes, void 0, "microsoft"));
|
|
125
|
-
o && (window.location.href = o);
|
|
126
|
-
}, this._onFormSubmit = async (t) => {
|
|
127
|
-
var n;
|
|
128
|
-
t.preventDefault();
|
|
129
|
-
const o = await ((n = this.nylasConnector) == null ? void 0 : n.auth.getHostedAuthRedirectURL(this.scopes, this.email));
|
|
130
|
-
o && (window.location.href = o);
|
|
131
|
-
}, this.isAuthenticated = !1, this.nylasConnector = void 0, this.scopes = void 0, this.loginMethod = "redirect", this.companyName = "Nylas", this.logoUrl = "https://www.nylas.com/wp-content/uploads/main-logo.svg", this.logoWidth = "min-content", this.providers = "google,microsoft", this.buttonText = "Login", this.email = "";
|
|
132
|
-
}
|
|
133
|
-
connectedCallback() {
|
|
134
|
-
}
|
|
135
|
-
disconnectedCallback() {
|
|
136
|
-
}
|
|
137
|
-
componentWillLoad() {
|
|
138
|
-
}
|
|
139
|
-
async componentDidLoad() {
|
|
140
|
-
var t;
|
|
141
|
-
await ((t = this.nylasConnector) == null ? void 0 : t.auth.manageHostedAuthCodeExchange(window.location.href)) && window.history.replaceState({}, document.title, window.location.pathname);
|
|
142
|
-
}
|
|
143
|
-
render() {
|
|
144
|
-
var t;
|
|
145
|
-
const e = ((t = this.providers) == null ? void 0 : t.split(",")) || [];
|
|
146
|
-
return i(b, { key: "2dc6992f3244d7af9e06b5a1ea8c2c83bed2dbb4" }, this.loginMethod === "redirect" && i("div", { class: "redirect-container" }, !this.isAuthenticated && i("sp-button", { part: "button", onClick: this._handleLoginRedirect }, this.buttonText)), this.loginMethod === "emebded" && i("main", { class: "login-container" }, i("section", { class: "login-box" }, i("header", null, i("img", { src: this.logoUrl, alt: `${this.companyName} logo`, width: "100%", style: {
|
|
147
|
-
minWidth: this.logoWidth
|
|
148
|
-
} }), i("h1", null, "Welcome")), i("p", null, "Log in to your account to continue to ", this.companyName), i("div", { class: "login-methods" }, e.includes("google") && i("button", { class: "login-google", onClick: this._onGoogleButtonClick }, i("svg", { xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true", role: "img", width: "18", height: "18", preserveAspectRatio: "xMidYMid meet", viewBox: "0 0 256 262" }, i("path", { fill: "#4285F4", d: "M255.6 131.6c0-8.2-.8-16.2-2.2-23.9H130v45.3h70.3c-3 16.1-12.4 29.7-26.3 38.9v32.4h42.6c25-23 39.4-56.7 39.4-97.7z" }), i("path", { fill: "#34A853", d: "M130 262c35.3 0 64.9-11.7 86.5-31.7l-42.6-32.4c-11.7 7.9-26.7 12.6-43.9 12.6-33.7 0-62.3-22.7-72.5-53.4H14.5v33.3A130.3 130.3 0 00130 262z" }), i("path", { fill: "#FBBC05", d: "M57.5 158.1a72.7 72.7 0 010-54.2V70.6H14.5a130.4 130.4 0 000 120.8l43-33.3z" }), i("path", { fill: "#EA4335", d: "M130 51.6c19 0 36 6.5 49.4 19.2l37-36C195 13.1 165.2 0 130 0A130.3 130.3 0 0014.5 70.6l43 33.3c10.2-30.7 38.8-53.3 72.5-53.3z" })), "Continue with Google"), e.includes("microsoft") && i("button", { class: "login-microsoft", onClick: this._onMicrosoftButtonClick }, i("svg", { xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true", role: "img", width: "18", height: "18", preserveAspectRatio: "xMidYMid meet", viewBox: "0 0 448 512" }, i("path", { fill: "#F3F3F3", d: "M0 32v192h192V32H0zm256 0v192h192V32H256zm192 256v192h-192V288h192zM0 224v192h192V224H0z" })), "Continue with Microsoft")), i("form", { class: "login-form", method: "POST", onSubmit: this._onFormSubmit }, i("label", { htmlFor: "email" }, "Email"), i("input", { type: "email", id: "email", name: "email", required: !0, value: this.email }), i("button", { type: "submit" }, "Next")))));
|
|
149
|
-
}
|
|
150
|
-
};
|
|
151
|
-
W([
|
|
152
|
-
A({
|
|
153
|
-
name: "nylas-login",
|
|
154
|
-
connectorToProp: "nylasConnector",
|
|
155
|
-
stateToProps: /* @__PURE__ */ new Map([["auth.isAuthenticated", "isAuthenticated"]]),
|
|
156
|
-
fireRegisterEvent: !0
|
|
157
|
-
}),
|
|
158
|
-
g("design:type", Function),
|
|
159
|
-
g("design:paramtypes", []),
|
|
160
|
-
g("design:returntype", void 0)
|
|
161
|
-
], _.prototype, "render", null);
|
|
162
|
-
_.style = z;
|
|
163
|
-
class Y {
|
|
164
|
-
constructor(t, o, n, s) {
|
|
165
|
-
this.router = t, this.nylasAuth = o, this.nylasAuthStore = n, this.nylasMailboxStore = s;
|
|
166
|
-
}
|
|
167
|
-
init() {
|
|
168
|
-
h("NylasMailboxConnector init");
|
|
169
|
-
}
|
|
170
|
-
get mailboxStore() {
|
|
171
|
-
return this.nylasMailboxStore;
|
|
172
|
-
}
|
|
173
|
-
get authStore() {
|
|
174
|
-
return this.nylasAuthStore;
|
|
175
|
-
}
|
|
176
|
-
get auth() {
|
|
177
|
-
return this._authConnector ? this._authConnector : (this._authConnector = new O(this.nylasAuth, this.nylasAuthStore), this._authConnector);
|
|
178
|
-
}
|
|
179
|
-
get threads() {
|
|
180
|
-
return this._threadConnector ? this._threadConnector : (this._threadConnector = new E(this.nylasAuth, this.nylasAuthStore, this.nylasMailboxStore, this.router), this._threadConnector);
|
|
181
|
-
}
|
|
182
|
-
get messages() {
|
|
183
|
-
return this._messageConnector ? this._messageConnector : (this._messageConnector = new B(this.nylasAuth, this.nylasAuthStore, this.nylasMailboxStore), this._messageConnector);
|
|
184
|
-
}
|
|
185
|
-
get folders() {
|
|
186
|
-
return this._foldersConnector ? this._foldersConnector : (this._foldersConnector = new $(this.nylasAuth, this.nylasAuthStore, this.nylasMailboxStore), this._foldersConnector);
|
|
187
|
-
}
|
|
188
|
-
getAuth() {
|
|
189
|
-
return this.nylasAuth;
|
|
190
|
-
}
|
|
191
|
-
resetStores() {
|
|
192
|
-
this.nylasMailboxStore.reset(), this.nylasAuthStore.reset();
|
|
193
|
-
}
|
|
194
|
-
async logout() {
|
|
195
|
-
await this.nylasAuth.logout(), this.resetStores();
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
const G = ":host{display:contents}", V = G, q = class {
|
|
199
|
-
constructor(e) {
|
|
200
|
-
p(this, e), this.init = m(this, "init", 7), this.loggedIn = m(this, "loggedIn", 7), this.loggedOut = m(this, "loggedOut", 7), this.handleAuthChange = async (t) => {
|
|
201
|
-
var o;
|
|
202
|
-
t ? this.loggedIn.emit(this.host) : this.loggedOut.emit(this.host).defaultPrevented || await ((o = this.nylasMailboxConnector) == null ? void 0 : o.logout());
|
|
203
|
-
}, this.automaticComponentRegistration = !0, this.eventOverrides = {}, this.authConfig = void 0, this.defaultAuthStoreState = void 0, this.defaultMailboxStoreState = void 0;
|
|
204
|
-
}
|
|
205
|
-
connectedCallback() {
|
|
206
|
-
h("[nylas-mailbox] connectedCallback");
|
|
207
|
-
}
|
|
208
|
-
async componentWillLoad() {
|
|
209
|
-
var n, s, a, r, l, C, v;
|
|
210
|
-
this.stores = {
|
|
211
|
-
auth: T(this.defaultAuthStoreState),
|
|
212
|
-
mailbox: I(this.defaultMailboxStoreState)
|
|
213
|
-
}, this.baseProvider = new P(this.host, this.stores, this.automaticComponentRegistration, this.eventOverrides), this.router = new H(), this.nylasAuth = L({
|
|
214
|
-
apiUri: "https://api.us.nylas.com",
|
|
215
|
-
elementsApiUri: "https://elements.us.nylas.com",
|
|
216
|
-
storageType: "indexeddb",
|
|
217
|
-
clientId: "YOUR_CLIENT_ID",
|
|
218
|
-
defaultScopes: [],
|
|
219
|
-
redirectURI: "/",
|
|
220
|
-
...this.authConfig
|
|
221
|
-
});
|
|
222
|
-
const e = (n = this.baseProvider) == null ? void 0 : n.getStore("auth");
|
|
223
|
-
if (!e)
|
|
224
|
-
throw new Error("Auth store is not defined");
|
|
225
|
-
const t = (s = this.baseProvider) == null ? void 0 : s.getStore("mailbox");
|
|
226
|
-
if (!t)
|
|
227
|
-
throw new Error("Mailbox store is not defined");
|
|
228
|
-
this.nylasMailboxConnector = new Y(this.router, this.nylasAuth, e, t), this.init.emit(this.host).defaultPrevented || await ((a = this.nylasMailboxConnector) == null ? void 0 : a.auth.validateSession()), (r = this.router) == null || r.addRouteChangeListener("/thread/:threadId", async (R, k, w) => {
|
|
229
|
-
var c, u;
|
|
230
|
-
const f = w.threadId, d = await ((c = this.nylasMailboxConnector) == null ? void 0 : c.threads.getThread(f));
|
|
231
|
-
d && ((u = this.nylasMailboxConnector) == null || u.mailboxStore.set("selectedThread", d));
|
|
232
|
-
}), (l = this.router) == null || l.addRouteChangeListener("/", async (R, k, w) => {
|
|
233
|
-
var d, c, u, S;
|
|
234
|
-
if (!e.state.isAuthenticated)
|
|
235
|
-
return;
|
|
236
|
-
(d = this.nylasMailboxConnector) == null || d.threads.unSelectThread(), (c = this.nylasMailboxConnector) == null || c.folders.getFolders();
|
|
237
|
-
const f = window.location.hash.split("?")[1];
|
|
238
|
-
if (f) {
|
|
239
|
-
const x = new URLSearchParams(f).get("query");
|
|
240
|
-
x && await ((u = this.nylasMailboxConnector) == null ? void 0 : u.threads.getThreads({
|
|
241
|
-
search_query_native: x,
|
|
242
|
-
page_token: void 0
|
|
243
|
-
}));
|
|
244
|
-
} else
|
|
245
|
-
(S = this.nylasMailboxConnector) == null || S.threads.getThreads();
|
|
246
|
-
}), (C = this.router) == null || C.init(), this.handleAuthChange(e.state.isAuthenticated), (v = this.baseProvider) == null || v.componentWillLoad(this.nylasMailboxConnector);
|
|
247
|
-
}
|
|
248
|
-
async componentDidLoad() {
|
|
249
|
-
var t, o;
|
|
250
|
-
const e = (t = this.baseProvider) == null ? void 0 : t.getStore("auth");
|
|
251
|
-
if (!e)
|
|
252
|
-
throw new Error("Auth store is not defined");
|
|
253
|
-
e.onChange("isAuthenticated", this.handleAuthChange), (o = this.baseProvider) == null || o.componentDidLoad();
|
|
254
|
-
}
|
|
255
|
-
componentDisconnected() {
|
|
256
|
-
var e;
|
|
257
|
-
(e = this.baseProvider) == null || e.componentDisconnected();
|
|
258
|
-
}
|
|
259
|
-
async registerComponentHandler(e) {
|
|
260
|
-
var t;
|
|
261
|
-
(t = this.baseProvider) == null || t.registerComponent(e.detail);
|
|
262
|
-
}
|
|
263
|
-
async unregisterComponentHandler(e) {
|
|
264
|
-
var t;
|
|
265
|
-
(t = this.baseProvider) == null || t.unregisterComponent(e.detail);
|
|
266
|
-
}
|
|
267
|
-
async getMailboxStore() {
|
|
268
|
-
var e;
|
|
269
|
-
return (e = this.baseProvider) == null ? void 0 : e.getStore("mailbox");
|
|
270
|
-
}
|
|
271
|
-
async getAuthStore() {
|
|
272
|
-
var e;
|
|
273
|
-
return (e = this.baseProvider) == null ? void 0 : e.getStore("auth");
|
|
274
|
-
}
|
|
275
|
-
async getNylasAuth() {
|
|
276
|
-
return this.nylasAuth;
|
|
277
|
-
}
|
|
278
|
-
async getNylasMailboxConnector() {
|
|
279
|
-
return this.nylasMailboxConnector;
|
|
280
|
-
}
|
|
281
|
-
render() {
|
|
282
|
-
return i(b, { key: "662c4d3f763c5cf9db31c4d2ba26bcdf47ead164" }, i("slot", { key: "5c2b75a569779dd2af6388648a4304721e82ba76" }));
|
|
283
|
-
}
|
|
284
|
-
get host() {
|
|
285
|
-
return N(this);
|
|
286
|
-
}
|
|
287
|
-
};
|
|
288
|
-
q.style = V;
|
|
289
|
-
export {
|
|
290
|
-
M as nylas_if_state,
|
|
291
|
-
_ as nylas_login,
|
|
292
|
-
q as nylas_mailbox
|
|
293
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index-457dcf0b.cjs"),M=require("./register-component-d056a880-2be11c56.cjs"),h=require("./utils-0cd66d04-94b9c3b6.cjs"),A=require("./index-10914bc1-c8c3a2f3.cjs"),_=require("./auth-store-69ac49c7-5a0bbb90.cjs"),f=require("./mailbox-store-e721b17c-4e97e07d.cjs");require("react");require("react-dom");require("./_commonjsHelpers-57e89916-4a3ae7d8.cjs");const N=":host{display:block}div{height:inherit}@keyframes fadeIn{0%{opacity:0}100%{opacity:1}}@keyframes fadeOut{0%{opacity:1}100%{opacity:0}}.fade-in{animation:fadeIn 1.5s}.fade-out{animation:fadeOut 1.5s}@keyframes slideIn{0%{transform:translateY(100%)}100%{transform:translateY(0)}}@keyframes slideOut{0%{transform:translateY(0)}100%{transform:translateY(100%)}}.slide-in{animation:slideIn 1.5s}.slide-out{animation:slideOut 1.5s}@keyframes swipeIn{0%{transform:translateX(100%)}100%{transform:translateX(0)}}@keyframes swipeOut{0%{transform:translateX(0)}100%{transform:translateX(100%)}}.swipe-in{animation:swipeIn 1.5s}.swipe-out{animation:swipeOut 1.5s}",L=N;var T=function(e,t,n,s){var i=arguments.length,a=i<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,n):s,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,n,s);else for(var l=e.length-1;l>=0;l--)(r=e[l])&&(a=(i<3?r(a):i>3?r(t,n,a):r(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},y=function(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)};const p=class{constructor(e){o.registerInstance(this,e),this.state=void 0,this.isStateSet=void 0,this.isBoolean=void 0,this.getStore=void 0,this.transition="none",this.show=!1,this.classes={},this.initTransition=this.initTransition.bind(this)}connectedCallback(){}disconnectedCallback(){}async componentWillLoad(){h.debug("[nylas-if-state] Component will load"),this.watchStore(!0)}async componentDidLoad(){h.debug("[nylas-if-state] Component did load")}shouldRender(){const[e,t]=this.state?this.state.split("."):["",""],n=this.getStore;if(typeof n>"u")return h.debug(`[nylas-if-state] Store name: ${e} | State name: ${t}`,{getStore:n}),!1;const s=n(e);if(typeof s>"u")return h.debug(`[nylas-if-state] Store name: ${e} | State name: ${t}`,{store:s}),!1;const i=s.state[t];return typeof this.isStateSet=="boolean"?this.isStateSet===!1&&(typeof i>"u"||i===null||i.length===0)||this.isStateSet===!0&&typeof i<"u"&&i!==null:typeof this.isBoolean=="boolean"?this.isBoolean===!0&&typeof i<"u"&&i===!0||this.isBoolean===!1&&typeof i<"u"&&i===!1:!1}onGetStoreChange(){this.watchStore(!0)}watchStore(e=!1){const[t,n]=this.state?this.state.split("."):["",""],s=this.getStore;if(typeof s>"u")return h.debug(`[nylas-if-state] Store name: ${t} | State name: ${n}`,{getStore:s}),null;const i=s(t);if(typeof i>"u")return h.debug(`[nylas-if-state] Store name: ${t} | State name: ${n}`,{store:i}),null;e===!0&&this.initTransition(),i.onChange(n,this.initTransition)}initTransition(){const e=this.shouldRender();switch(this.transition){case"fade":case"slide":case"swipe":this.classes={[`${this.transition}-in`]:e,[`${this.transition}-out`]:!e},setTimeout(()=>{this.show=e},150);break;default:this.show=this.shouldRender();break}}render(){return o.h(o.Host,{key:"91d17bc89a09742106ef3bd9365c5ce48cf14e86"},o.h("div",{key:"9d0070be4bf5d9a5f405fc4a0733e6d832fa669a",class:this.classes},this.show&&o.h("slot",null)))}static get watchers(){return{getStore:["onGetStoreChange"]}}};T([M.RegisterComponent({name:"nylas-if-state",getStoresToProp:"getStore",fireRegisterEvent:!0}),y("design:type",Function),y("design:paramtypes",[]),y("design:returntype",void 0)],p.prototype,"render",null);p.style=L;const I=":host{font-family:'Arial', sans-serif;background:var(--nylas-color-primary-50);color:var(--nylas-color-primary-800);margin:0;display:contents}input{box-sizing:border-box}.login-container{display:flex;justify-content:center;align-items:center;height:100%}.login-box{width:300px;padding:20px;box-shadow:0 4px 8px rgba(0, 0, 0, 0.1);border-radius:var(--nylas-border-radius-2x);background:var(--nylas-color-primary-50);text-align:center}.login-box h1{margin-top:0;margin-bottom:0.5em}.login-box p{margin-bottom:1em}.login-methods button{display:block;width:100%;padding:10px 10px 10px 50px;margin-bottom:10px;border:none;border-radius:var(--nylas-border-radius);border:1px solid var(--nylas-color-primary-300);background:var(--nylas-color-primary-100);color:var(--nylas-color-primary-600);cursor:pointer;transition:background 0.3s ease;position:relative;text-align:left}.login-methods button svg{position:absolute;left:16px;top:50%;transform:translateY(-50%)}.login-methods button:hover{background:var(--nylas-color-primary-200);}.login-form label{display:block;margin-bottom:5px;text-align:left}.login-form input{width:100%;padding:10px;margin-bottom:10px;border:1px solid var(--nylas-color-primary-200);border-radius:var(--nylas-border-radius);background:var(--nylas-color-primary-100);color:var(--nylas-color-primary-800);}.login-form button{width:100%;padding:10px;border:none;border-radius:var(--nylas-border-radius);background:var(--nylas-color-primary-500);color:var(--nylas-color-primary-50);cursor:pointer;transition:background 0.3s ease}.login-form button:hover{background:var(--nylas-color-primary-600);}",O=I;var E=function(e,t,n,s){var i=arguments.length,a=i<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,n):s,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,n,s);else for(var l=e.length-1;l>=0;l--)(r=e[l])&&(a=(i<3?r(a):i>3?r(t,n,a):r(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},m=function(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)};const b=class{constructor(e){o.registerInstance(this,e),this.buttonClick=o.createEvent(this,"buttonClick",7),this._handleLoginRedirect=async()=>{var s;const t=await((s=this.nylasConnector)==null?void 0:s.auth.getHostedAuthRedirectURL(this.scopes));this.buttonClick.emit({url:t}).defaultPrevented||t&&(window.location.href=t)},this._onGoogleButtonClick=async t=>{var s;t.preventDefault();const n=await((s=this.nylasConnector)==null?void 0:s.auth.getHostedAuthRedirectURL(this.scopes,void 0,"google"));n&&(window.location.href=n)},this._onMicrosoftButtonClick=async t=>{var s;t.preventDefault();const n=await((s=this.nylasConnector)==null?void 0:s.auth.getHostedAuthRedirectURL(this.scopes,void 0,"microsoft"));n&&(window.location.href=n)},this._onFormSubmit=async t=>{var s;t.preventDefault();const n=await((s=this.nylasConnector)==null?void 0:s.auth.getHostedAuthRedirectURL(this.scopes,this.email));n&&(window.location.href=n)},this.isAuthenticated=!1,this.nylasConnector=void 0,this.scopes=void 0,this.loginMethod="redirect",this.companyName="Nylas",this.logoUrl="https://www.nylas.com/wp-content/uploads/main-logo.svg",this.logoWidth="min-content",this.providers="google,microsoft",this.buttonText="Login",this.email=""}connectedCallback(){}disconnectedCallback(){}componentWillLoad(){}async componentDidLoad(){var t;await((t=this.nylasConnector)==null?void 0:t.auth.manageHostedAuthCodeExchange(window.location.href))&&window.history.replaceState({},document.title,window.location.pathname)}render(){var t;const e=((t=this.providers)==null?void 0:t.split(","))||[];return o.h(o.Host,{key:"2dc6992f3244d7af9e06b5a1ea8c2c83bed2dbb4"},this.loginMethod==="redirect"&&o.h("div",{class:"redirect-container"},!this.isAuthenticated&&o.h("sp-button",{part:"button",onClick:this._handleLoginRedirect},this.buttonText)),this.loginMethod==="emebded"&&o.h("main",{class:"login-container"},o.h("section",{class:"login-box"},o.h("header",null,o.h("img",{src:this.logoUrl,alt:`${this.companyName} logo`,width:"100%",style:{minWidth:this.logoWidth}}),o.h("h1",null,"Welcome")),o.h("p",null,"Log in to your account to continue to ",this.companyName),o.h("div",{class:"login-methods"},e.includes("google")&&o.h("button",{class:"login-google",onClick:this._onGoogleButtonClick},o.h("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",role:"img",width:"18",height:"18",preserveAspectRatio:"xMidYMid meet",viewBox:"0 0 256 262"},o.h("path",{fill:"#4285F4",d:"M255.6 131.6c0-8.2-.8-16.2-2.2-23.9H130v45.3h70.3c-3 16.1-12.4 29.7-26.3 38.9v32.4h42.6c25-23 39.4-56.7 39.4-97.7z"}),o.h("path",{fill:"#34A853",d:"M130 262c35.3 0 64.9-11.7 86.5-31.7l-42.6-32.4c-11.7 7.9-26.7 12.6-43.9 12.6-33.7 0-62.3-22.7-72.5-53.4H14.5v33.3A130.3 130.3 0 00130 262z"}),o.h("path",{fill:"#FBBC05",d:"M57.5 158.1a72.7 72.7 0 010-54.2V70.6H14.5a130.4 130.4 0 000 120.8l43-33.3z"}),o.h("path",{fill:"#EA4335",d:"M130 51.6c19 0 36 6.5 49.4 19.2l37-36C195 13.1 165.2 0 130 0A130.3 130.3 0 0014.5 70.6l43 33.3c10.2-30.7 38.8-53.3 72.5-53.3z"})),"Continue with Google"),e.includes("microsoft")&&o.h("button",{class:"login-microsoft",onClick:this._onMicrosoftButtonClick},o.h("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",role:"img",width:"18",height:"18",preserveAspectRatio:"xMidYMid meet",viewBox:"0 0 448 512"},o.h("path",{fill:"#F3F3F3",d:"M0 32v192h192V32H0zm256 0v192h192V32H256zm192 256v192h-192V288h192zM0 224v192h192V224H0z"})),"Continue with Microsoft")),o.h("form",{class:"login-form",method:"POST",onSubmit:this._onFormSubmit},o.h("label",{htmlFor:"email"},"Email"),o.h("input",{type:"email",id:"email",name:"email",required:!0,value:this.email}),o.h("button",{type:"submit"},"Next")))))}};E([M.RegisterComponent({name:"nylas-login",connectorToProp:"nylasConnector",stateToProps:new Map([["auth.isAuthenticated","isAuthenticated"]]),fireRegisterEvent:!0}),m("design:type",Function),m("design:paramtypes",[]),m("design:returntype",void 0)],b.prototype,"render",null);b.style=O;class H{constructor(t,n,s,i){this.router=t,this.nylasAuth=n,this.nylasAuthStore=s,this.nylasMailboxStore=i}init(){h.debug("NylasMailboxConnector init")}get mailboxStore(){return this.nylasMailboxStore}get authStore(){return this.nylasAuthStore}get auth(){return this._authConnector?this._authConnector:(this._authConnector=new _.NylasAuthConnector(this.nylasAuth,this.nylasAuthStore),this._authConnector)}get threads(){return this._threadConnector?this._threadConnector:(this._threadConnector=new f.NylasThreadsConnector(this.nylasAuth,this.nylasAuthStore,this.nylasMailboxStore,this.router),this._threadConnector)}get messages(){return this._messageConnector?this._messageConnector:(this._messageConnector=new f.NylasMessagesConnector(this.nylasAuth,this.nylasAuthStore,this.nylasMailboxStore),this._messageConnector)}get folders(){return this._foldersConnector?this._foldersConnector:(this._foldersConnector=new f.NylasFoldersConnector(this.nylasAuth,this.nylasAuthStore,this.nylasMailboxStore),this._foldersConnector)}getAuth(){return this.nylasAuth}resetStores(){this.nylasMailboxStore.reset(),this.nylasAuthStore.reset()}async logout(){await this.nylasAuth.logout(),this.resetStores()}}const q=":host{display:contents}",B=q,R=class{constructor(e){o.registerInstance(this,e),this.init=o.createEvent(this,"init",7),this.loggedIn=o.createEvent(this,"loggedIn",7),this.loggedOut=o.createEvent(this,"loggedOut",7),this.handleAuthChange=async t=>{var n;t?this.loggedIn.emit(this.host):this.loggedOut.emit(this.host).defaultPrevented||await((n=this.nylasMailboxConnector)==null?void 0:n.logout())},this.automaticComponentRegistration=!0,this.eventOverrides={},this.authConfig=void 0,this.defaultAuthStoreState=void 0,this.defaultMailboxStoreState=void 0}connectedCallback(){h.debug("[nylas-mailbox] connectedCallback")}async componentWillLoad(){var s,i,a,r,l,v,C;this.stores={auth:_.CreateNylasAuthStore(this.defaultAuthStoreState),mailbox:f.CreateNylasMailboxStore(this.defaultMailboxStoreState)},this.baseProvider=new A.NylasBaseProvider(this.host,this.stores,this.automaticComponentRegistration,this.eventOverrides),this.router=new f.HashRouter,this.nylasAuth=A.es({apiUri:"https://api.us.nylas.com",elementsApiUri:"https://elements.us.nylas.com",storageType:"indexeddb",clientId:"YOUR_CLIENT_ID",defaultScopes:[],redirectURI:"/",...this.authConfig});const e=(s=this.baseProvider)==null?void 0:s.getStore("auth");if(!e)throw new Error("Auth store is not defined");const t=(i=this.baseProvider)==null?void 0:i.getStore("mailbox");if(!t)throw new Error("Mailbox store is not defined");this.nylasMailboxConnector=new H(this.router,this.nylasAuth,e,t),this.init.emit(this.host).defaultPrevented||await((a=this.nylasMailboxConnector)==null?void 0:a.auth.validateSession()),(r=this.router)==null||r.addRouteChangeListener("/thread/:threadId",async(k,P,S)=>{var d,u;const g=S.threadId,c=await((d=this.nylasMailboxConnector)==null?void 0:d.threads.getThread(g));c&&((u=this.nylasMailboxConnector)==null||u.mailboxStore.set("selectedThread",c))}),(l=this.router)==null||l.addRouteChangeListener("/",async(k,P,S)=>{var c,d,u,w;if(!e.state.isAuthenticated)return;(c=this.nylasMailboxConnector)==null||c.threads.unSelectThread(),(d=this.nylasMailboxConnector)==null||d.folders.getFolders();const g=window.location.hash.split("?")[1];if(g){const x=new URLSearchParams(g).get("query");x&&await((u=this.nylasMailboxConnector)==null?void 0:u.threads.getThreads({search_query_native:x,page_token:void 0}))}else(w=this.nylasMailboxConnector)==null||w.threads.getThreads()}),(v=this.router)==null||v.init(),this.handleAuthChange(e.state.isAuthenticated),(C=this.baseProvider)==null||C.componentWillLoad(this.nylasMailboxConnector)}async componentDidLoad(){var t,n;const e=(t=this.baseProvider)==null?void 0:t.getStore("auth");if(!e)throw new Error("Auth store is not defined");e.onChange("isAuthenticated",this.handleAuthChange),(n=this.baseProvider)==null||n.componentDidLoad()}componentDisconnected(){var e;(e=this.baseProvider)==null||e.componentDisconnected()}async registerComponentHandler(e){var t;(t=this.baseProvider)==null||t.registerComponent(e.detail)}async unregisterComponentHandler(e){var t;(t=this.baseProvider)==null||t.unregisterComponent(e.detail)}async getMailboxStore(){var e;return(e=this.baseProvider)==null?void 0:e.getStore("mailbox")}async getAuthStore(){var e;return(e=this.baseProvider)==null?void 0:e.getStore("auth")}async getNylasAuth(){return this.nylasAuth}async getNylasMailboxConnector(){return this.nylasMailboxConnector}render(){return o.h(o.Host,{key:"662c4d3f763c5cf9db31c4d2ba26bcdf47ead164"},o.h("slot",{key:"5c2b75a569779dd2af6388648a4304721e82ba76"}))}get host(){return o.getElement(this)}};R.style=B;exports.nylas_if_state=p;exports.nylas_login=b;exports.nylas_mailbox=R;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./index-457dcf0b.cjs"),u=require("./register-component-d056a880-2be11c56.cjs"),a=require("./utils-0cd66d04-94b9c3b6.cjs");require("react");require("react-dom");require("./_commonjsHelpers-57e89916-4a3ae7d8.cjs");const h=":host{display:block}.folders{display:flex;flex-direction:column;align-items:self-start}.folders .folder{border:1px solid var(--nylas-color-primary-100);padding:0.5rem 0.75rem;margin-bottom:0.5rem;justify-content:left;width:100%;min-width:200px;border-radius:var(--nylas-border-radius);background-color:var(--nylas-color-primary-50)}.folders .folder:last-child{margin-bottom:0}.folders .folder.selected{background-color:var(--nylas-color-primary-100)}.folders .folder .icon{margin-right:0.5rem;stroke:var(--nylas-color-primary-900);fill:none}hr{width:100%;margin:1rem 0;border:0;border-top:1px solid var(--nylas-color-primary-100)}",m=h;var p=function(t,r,e,o){var s=arguments.length,n=s<3?r:o===null?o=Object.getOwnPropertyDescriptor(r,e):o,d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,r,e,o);else for(var i=t.length-1;i>=0;i--)(d=t[i])&&(n=(s<3?d(n):s>3?d(r,e,n):d(r,e))||n);return s>3&&n&&Object.defineProperty(r,e,n),n},c=function(t,r){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,r)};const f=class{constructor(t){l.registerInstance(this,t),this.folderSelected=l.createEvent(this,"folderSelected",7),this.folderSelectedHandler=r=>{var e;(e=this.folderSelected)==null||e.emit(r)},this.folders=void 0,this.selectedFolder=void 0,this.defaultFolders=void 0,this.otherFolders=void 0}connectedCallback(){}disconnectedCallback(){}async componentWillLoad(){a.debug("[nylas-list-folders] Component will load")}async componentDidLoad(){a.debug("[nylas-list-folders] Component did load")}watchFolders(t){a.debug("[nylas-list-folders] watchFolders",{newFolders:t});const r=["inbox","drafts","sent","starred","spam","archive","trash"];this.defaultFolders=r.filter(e=>t.find(o=>{var s;return((s=o.name)==null?void 0:s.toLowerCase())===e.toLowerCase()})).map(e=>t.find(o=>{var s;return((s=o.name)==null?void 0:s.toLowerCase())===e.toLowerCase()})).filter(e=>typeof e<"u").sort((e,o)=>r.indexOf((e==null?void 0:e.name)??"")-r.indexOf((o==null?void 0:o.name)??"")),this.otherFolders=t.filter(e=>!r.find(o=>{var s;return((s=e.name)==null?void 0:s.toLowerCase())===o.toLowerCase()})).sort((e,o)=>(e.name??"").localeCompare(o.name??""))}formatFolderName(t){var r;return a.toTitleCase(((r=t.name)==null?void 0:r.replace("CATEGORY_",""))??"Unknown")}getFolderIcon(t){var r;switch((r=t.name)==null?void 0:r.toLowerCase()){case"inbox":return l.h("inbox-icon",null);case"drafts":return l.h("drafts-icon",null);case"sent":return l.h("sent-icon",null);case"starred":return l.h("star-icon",null);case"spam":return l.h("spam-icon",null);case"archive":return l.h("archive-icon",null);case"trash":return l.h("trash-icon",null);default:return l.h("folder-icon",null)}}render(){var t,r;return l.h(l.Host,{key:"623ace703b229e8db585ae1beb784e439335c59b"},l.h("div",{key:"88888e9a75ca8357a11148b126c4e287d1240bb2",class:"folders"},(t=this.defaultFolders)==null?void 0:t.map(e=>{var o;return l.h("sp-button",{onClick:()=>this.folderSelectedHandler(e),class:{folder:!0,selected:a.formatFolderName(e.name??"inbox").toLowerCase()===((o=this.selectedFolder)==null?void 0:o.toLowerCase())}},l.h("div",{slot:"icon",class:"icon"},this.getFolderIcon(e)),this.formatFolderName(e))})),this.otherFolders&&l.h(l.Fragment,null,l.h("hr",null),l.h("div",{class:"folders"},(r=this.otherFolders)==null?void 0:r.map(e=>{var o;return l.h("sp-button",{onClick:()=>this.folderSelectedHandler(e),class:{folder:!0,selected:a.formatFolderName(e.name??"inbox").toLowerCase()===((o=this.selectedFolder)==null?void 0:o.toLowerCase())}},l.h("div",{slot:"icon",class:"icon"},this.getFolderIcon(e)),this.formatFolderName(e))}))))}static get watchers(){return{folders:["watchFolders"]}}};p([u.RegisterComponent({name:"nylas-pagination",stateToProps:new Map([["mailbox.folders","folders"],["mailbox.selectedFolder","selectedFolder"]]),eventToProps:{folderSelected:async(t,r)=>{a.debug("[nylas-list-folders] folderSelected event",{_event:t}),await r.threads.getThreads({page_token:void 0,in:a.formatFolderName(t.detail.id??"inbox")})}},fireRegisterEvent:!0}),c("design:type",Function),c("design:paramtypes",[]),c("design:returntype",void 0)],f.prototype,"render",null);f.style=m;exports.nylas_list_folders=f;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./index-457dcf0b.cjs"),u=require("./register-component-d056a880-2be11c56.cjs"),i=require("./utils-0cd66d04-94b9c3b6.cjs");require("react");require("react-dom");require("./_commonjsHelpers-57e89916-4a3ae7d8.cjs");const h=':host{display:block;font-size:var(--nylas-font-size, inherit);font-family:var(--nylas-font-family, inherit)}.list-thread{display:grid;grid-auto-flow:row;color:var(--nylas-color-primary-800);width:100%}.thread{position:relative;width:100%;display:grid;padding:0.5rem 1rem;column-gap:0.25rem;grid-template-areas:"........ from count ....... date actions" "checkbox subject subject subject subject actions" "........ snippet snippet snippet snippet actions";grid-template-columns:auto auto auto auto auto auto;margin-bottom:0.75rem;border-radius:var(--nylas-border-radius-2x);color:var(--nylas-color-primary-00);background-color:var(--nylas-color-primary-50);border:0;box-sizing:border-box;text-align:left;cursor:pointer;box-shadow:1px 1px 3px 0px rgba(0, 0, 0, 0.3);font-size:inherit;font-family:inherit}.thread.loading{animation:pulsate 1.5s infinite ease-in-out;width:100%;height:90px}.thread:last-of-type{margin-bottom:0}.thread.selected{box-shadow:0 2px 0 0 var(--nylas-color-primary-200);background-color:var(--nylas-color-primary-100)}.thread:hover{box-shadow:0 2px 0 0 var(--nylas-color-primary-200);background-color:var(--nylas-color-primary-100)}.thread>div{align-self:center;pointer-events:all !important}.thread .actions{grid-area:actions}.thread .actions sp-action-menu{pointer-events:initial !important}.thread .actions sp-action-button{pointer-events:initial !important}.thread .actions sp-menu-item{pointer-events:initial !important}.thread .checkbox{grid-area:checkbox;margin-right:0.5rem;pointer-events:initial !important}.thread .checkbox sp-checkbox{pointer-events:initial !important}.thread .star{grid-area:star;justify-self:end}.thread .from{grid-area:from;color:var(--nylas-color-primary-600)}.thread .count{grid-area:count;color:var(--nylas-color-primary-600)}.thread .subject{grid-area:subject;color:var(--nylas-color-primary-600)}.thread .snippet{grid-area:snippet;color:var(--nylas-color-primary-500)}.thread .date{grid-area:date;align-self:center;color:var(--nylas-color-primary-500)}.thread.unread .from,.thread.unread .count,.thread.unread .subject,.thread.unread .date{font-weight:600;color:var(--nylas-color-primary-800)}.thread.unread .snippet{color:var(--nylas-color-primary-700)}.thread .from{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.thread .snippet{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.thread .subject{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}@media only screen and (min-width: 768px){.thread{column-gap:1rem;grid-template-areas:"checkbox from count subject snippet date actions";grid-template-columns:auto minmax(auto, 200px) auto auto 1fr auto auto;margin-bottom:0.5rem;border:1px solid var(--nylas-color-primary-100)}.thread.no-checkbox{grid-template-areas:"from count subject snippet date actions";grid-template-columns:minmax(auto, 200px) auto auto 1fr auto auto}.thread .checkbox{margin-right:0}}@keyframes pulsate{0%{background-color:var(--nylas-color-primary-50)}50%{background-color:var(--nylas-color-primary-100)}100%{background-color:var(--nylas-color-primary-50)}}',m=h;var f=function(e,t,r,s){var n=arguments.length,o=n<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,r):s,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(e,t,r,s);else for(var c=e.length-1;c>=0;c--)(l=e[c])&&(o=(n<3?l(o):n>3?l(t,r,o):l(t,r))||o);return n>3&&o&&Object.defineProperty(t,r,o),o},d=function(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)};const p=class{constructor(e){a.registerInstance(this,e),this.threadSelected=a.createEvent(this,"threadSelected",7),this.handleThreadSelected=async t=>{i.debug("[nylas-list-threads] Thread selected",{thread:t}),this.threadSelected.emit(t).defaultPrevented||i.debug("[nylas-list-threads] Default event not prevented, selecting thread")},this.handleCheckboxClick=async t=>{i.debug("[nylas-list-threads] Checkbox clicked",{event:t}),t.stopPropagation()},this.threads=[],this.isAuthenticated=!1,this.tokenInfo=void 0,this.state="ready",this.showCheckbox=!1}connectedCallback(){}disconnectedCallback(){}async componentWillLoad(){i.debug("[nylas-list-threads] Component will load")}async componentDidLoad(){i.debug("[nylas-list-threads] Component did load",{isAuthenticated:this.isAuthenticated})}render(){return a.h(a.Host,{key:"e69436f25ffaffa05fd3c4a57de1745ad9e75107"},a.h("div",{key:"d9b0daf46aff4d2ef699ddf2c71fb8f83c89b8b3",class:"list-thread",part:"list-thread"},this.state==="loading"&&new Array(10).fill(0).map((e,t)=>a.h("div",{class:"thread loading",style:{animationDelay:`${t*20}ms`}})),this.state==="ready"&&this.threads.map(e=>{var t,r,s,n;return a.h("button",{key:e==null?void 0:e.id,class:{thread:!0,unread:(e==null?void 0:e.unread)===!0,"no-checkbox":this.showCheckbox===!1},part:"thread","aria-label":`Thread with subject ${e==null?void 0:e.subject}`,onClick:()=>this.handleThreadSelected(e)},this.showCheckbox&&a.h("div",{class:"checkbox",part:"checkbox"},a.h("sp-checkbox",{size:"s",value:e==null?void 0:e.id,onClick:this.handleCheckboxClick})),a.h("div",{class:"from",part:"from"},i.formatParticipants(e.participants??[],(t=this.tokenInfo)==null?void 0:t.email,((r=e==null?void 0:e.message_ids)==null?void 0:r.length)||1,1)),a.h("div",{class:"subject",part:"subject"},e==null?void 0:e.subject),a.h("div",{class:"count",part:"count"},((s=e==null?void 0:e.message_ids)==null?void 0:s.length)||1),a.h("div",{class:"snippet",part:"snippet"},(n=e==null?void 0:e.snippet)==null?void 0:n.trim()),e.latest_message_received_date&&a.h("div",{class:"date","aria-label":`${Intl.DateTimeFormat(void 0,{dateStyle:"full"}).format(new Date(e.latest_message_received_date*1e3))}`,part:"date"},i.formatDateTime(e.latest_message_received_date)))})))}};f([u.RegisterComponent({name:"nylas-list-threads",stateToProps:new Map([["auth.isAuthenticated","isAuthenticated"],["auth.tokenInfo","tokenInfo"],["mailbox.threads","threads"],["mailbox.state","state"]]),eventToProps:{threadSelected:async(e,t)=>{i.debug("[nylas-list-threads] Thread selected",{event:e}),await t.threads.selectThread(e.detail)}},fireRegisterEvent:!0}),d("design:type",Function),d("design:paramtypes",[]),d("design:returntype",void 0)],p.prototype,"render",null);p.style=m;exports.nylas_list_threads=p;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-457dcf0b.cjs"),g=require("./register-component-d056a880-2be11c56.cjs"),a=require("./utils-0cd66d04-94b9c3b6.cjs");require("react");require("react-dom");require("./_commonjsHelpers-57e89916-4a3ae7d8.cjs");const p=":host{display:contents}.container{height:var(--container-height, 100dvh);overflow-y:var(--container-overflow-y, auto)}.pagination{display:flex;justify-content:center;align-items:center;margin:0 auto;padding:0;list-style:none;font-size:0.875rem;font-weight:600;color:var(--nylas-color-primary-600)}.pagination sp-button svg{animation:rotate 1s linear infinite}sp-button{border-radius:var(--nylas-border-radius);background-color:var(--nylas-color-primary-400);color:var(--nylas-color-primary-900);fill:var(--nylas-color-primary-900)}sp-button:hover{background-color:var(--nylas-color-primary-500)}sp-button:disabled{background-color:var(--nylas-color-primary-200);color:var(--nylas-color-primary-600);cursor:not-allowed}sp-button chevron-icon svg{width:15px;height:15px}.next chevron-icon{transform:rotate(180deg)}@keyframes rotate{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}",u=p;var m=function(t,n,i,r){var s=arguments.length,o=s<3?n:r===null?r=Object.getOwnPropertyDescriptor(n,i):r,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,n,i,r);else for(var h=t.length-1;h>=0;h--)(l=t[h])&&(o=(s<3?l(o):s>3?l(n,i,o):l(n,i))||o);return s>3&&o&&Object.defineProperty(n,i,o),o},c=function(t,n){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,n)};const d=class{constructor(t){e.registerInstance(this,t),this.next=e.createEvent(this,"next",7),this.previous=e.createEvent(this,"previous",7),this.state="ready",this.hasNextPage=!1,this.hasPreviousPage=!1,this.scrollTarget="container",this.mobileOnlyInfiniteScroll=!0,this.mobileViewPortWidth=768,a.debug("[nylas-pagination] Constructed"),this.isScrollAtContainerBottom=this.isScrollAtContainerBottom.bind(this),this.isScrollAtPageBottom=this.isScrollAtPageBottom.bind(this),this.nextPage=this.nextPage.bind(this),this.previousPage=this.previousPage.bind(this),this.handlePageScroll=this.handlePageScroll.bind(this),this.handleContainerScroll=this.handleContainerScroll.bind(this)}connectedCallback(){a.debug("[nylas-pagination] Component connected")}async componentWillLoad(){a.debug("[nylas-pagination] Component will load")}async componentDidLoad(){a.debug("[nylas-pagination] Component did load"),this.containerElement&&this.containerElement.addEventListener("scroll",this.handleContainerScroll)}async componentWillRender(){a.debug("[nylas-pagination] Component will render")}disconnectedCallback(){a.debug("[nylas-pagination] Component disconnected"),this.containerElement&&this.containerElement.removeEventListener("scroll",this.handleContainerScroll)}handlePageScroll(t){this.isScrollAtPageBottom()&&this.canScroll&&this.scrollTarget==="page"&&this.nextPage()}async nextPage(){const t=this.host.children.length>0;this.next.emit({hasChildren:t})}async previousPage(){const t=this.host.children.length>0;this.previous.emit({hasChildren:t})}handleContainerScroll(t){this.isScrollAtContainerBottom()&&this.canScroll&&this.scrollTarget==="container"&&this.nextPage()}isScrollAtContainerBottom(){return this.containerElement?this.containerElement&&this.containerElement.scrollTop+this.containerElement.clientHeight>=this.containerElement.scrollHeight:!1}isScrollAtPageBottom(){return window.innerHeight+window.scrollY>=document.body.offsetHeight}get canScroll(){const t=this.host.children.length>0;return this.state==="ready"&&t&&(!this.mobileOnlyInfiniteScroll||window.innerWidth<this.mobileViewPortWidth)}render(){return this.host.children.length>0?e.h(e.Host,null,e.h("div",{class:"container",ref:n=>this.containerElement=n},e.h("slot",null),this.canScroll&&e.h("div",{class:"pagination"},e.h("sp-theme",{scale:"medium",color:"dark"},this.state==="ready"&&this.hasNextPage&&e.h("sp-button",{onClick:this.nextPage},e.h("div",{slot:"icon"},e.h("refresh-icon",{class:"refres-icon"}))," ","Load more..."))))):e.h(e.Host,null,e.h("sp-theme",{scale:"medium",color:"dark"},this.hasPreviousPage&&e.h("sp-button",{class:"previous",parr:"previous",onClick:this.previousPage},e.h("div",{slot:"icon"},e.h("chevron-icon",{class:"previous-icon"}))," ","Previous"),this.hasPreviousPage&&this.hasNextPage&&" ",this.hasNextPage&&e.h("sp-button",{class:"next",parr:"next",onClick:this.nextPage},e.h("div",{slot:"icon"},e.h("chevron-icon",{class:"next-icon"}))," ","Next")))}get host(){return e.getElement(this)}};m([g.RegisterComponent({name:"nylas-pagination",stateToProps:new Map([["mailbox.hasNextThreadPage","hasNextPage"],["mailbox.hasPreviousThreadPage","hasPreviousPage"],["mailbox.state","state"]]),eventToProps:{next:async(t,n)=>{a.debug("[nylas-pagination] Next page event fired");const{hasChildren:i}=t.detail;await n.threads.nextThreadPage(i?"append":"overwrite",!i)},previous:async(t,n)=>{a.debug("[nylas-pagination] Previous page event fired");const{hasChildren:i}=t.detail;await n.threads.previousThreadPage(i?"append":"overwrite",!i)}},fireRegisterEvent:!0}),c("design:type",Function),c("design:paramtypes",[]),c("design:returntype",void 0)],d.prototype,"render",null);d.style=u;exports.nylas_mailbox_pagination=d;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./index-457dcf0b.cjs"),b=require("./register-component-d056a880-2be11c56.cjs"),c=require("./utils-0cd66d04-94b9c3b6.cjs");require("react");require("react-dom");require("./_commonjsHelpers-57e89916-4a3ae7d8.cjs");const y=":host{display:block}sp-button{border-radius:var(--nylas-border-radius);background-color:var(--nylas-color-primary-400);color:var(--nylas-color-primary-900);fill:var(--nylas-color-primary-900)}sp-button:hover{background-color:var(--nylas-color-primary-500)}sp-button:disabled{background-color:var(--nylas-color-primary-200);color:var(--nylas-color-primary-600);cursor:not-allowed}",f=y;var h=function(t,o,e,n){var l=arguments.length,r=l<3?o:n===null?n=Object.getOwnPropertyDescriptor(o,e):n,i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(t,o,e,n);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(r=(l<3?i(r):l>3?i(o,e,r):i(o,e))||r);return l>3&&r&&Object.defineProperty(o,e,r),r},d=function(t,o){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,o)};const u=class{constructor(t){a.registerInstance(this,t),this.onClick=async()=>{const o=this.method;if(c.debug("[nylas-mailbox-toolbar-button] onClick",{method:o,mailboxConnector:this.mailboxConnector}),this.mailboxConnector&&o){const e=this.callMethod(this.mailboxConnector,o);e&&await e()}},this.method=void 0,this.dataState=void 0,this.iconOnly=!1,this.mailboxConnector=void 0}connectedCallback(){}disconnectedCallback(){}async componentWillLoad(){c.debug("[nylas-if-state] Component will load")}async componentDidLoad(){c.debug("[nylas-if-state] Component did load")}callMethod(t,o){const e=o.split(".");let n=t;for(const i of e.slice(0,-1))if(n=n[i],!n)return;const l=e[e.length-1],r=n[l];if(typeof r=="function")return r.bind(n)}renderByState(t){return t?a.h("slot",{name:"loading"},"Loading..."):a.h("slot",null,"Click")}hasSlot(t){return!!this.host.querySelector(`[slot="${t}"]`)}render(){var n;let t=!1;const o=(n=this.mailboxConnector)==null?void 0:n.nylasMailboxStore;if(typeof o<"u"){const l=String(this.dataState);t=this.dataState?o.get(l)==="loading":!1}const e=t?"state-loading":"state-ready";return a.h(a.Host,{key:"2454ef2e4270d1642cabe57dacf53908fcdb34e6"},a.h("sp-theme",{key:"97d71094fabc3466b87142dfdd1d0bb22659fd32",scale:"medium",color:"dark"},a.h("sp-button",{onClick:this.onClick,disabled:t,key:e,"icon-only":this.iconOnly,label:this.renderByState(t)},this.hasSlot("icon")&&a.h("div",{slot:"icon",class:"slot"},a.h("slot",{name:"icon"})),!this.iconOnly&&this.renderByState(t))))}get host(){return a.getElement(this)}};h([b.RegisterComponent({name:"nylas-mailbox-toolbar-button",connectorToProp:"mailboxConnector",fireRegisterEvent:!0}),d("design:type",Function),d("design:paramtypes",[]),d("design:returntype",void 0)],u.prototype,"render",null);u.style=f;exports.nylas_mailbox_toolbar_button=u;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index-457dcf0b.cjs"),C=require("./index-10914bc1-c8c3a2f3.cjs"),l=require("./utils-0cd66d04-94b9c3b6.cjs"),S=require("./auth-store-69ac49c7-5a0bbb90.cjs"),o=require("./mailbox-store-e721b17c-4e97e07d.cjs"),f=require("./scheduler-store-0fbe642c-410fdbf4.cjs"),b=require("./scheduler-config-store-4d035001-0256b40c.cjs");require("react");require("react-dom");require("./_commonjsHelpers-57e89916-4a3ae7d8.cjs");class m{constructor(t,s,n,i,c,h,a="https://api.us.nylas.com"){this.router=t,this.schedulerAPIURL=a,this.nylasAuth=s,this.nylasAuthStore=n,this.nylasMailboxStore=i,this.nylasSchedulerStore=c,this.nylasSchedulerConfigStore=h}init(){l.debug("NylasConnector init")}get authStore(){return this.nylasAuthStore}get mailboxStore(){return this.nylasMailboxStore}get schedulerStore(){return this.nylasSchedulerStore}get schedulerConfigStore(){return this.nylasSchedulerConfigStore}get auth(){return this._authConnector?this._authConnector:(this._authConnector=new S.NylasAuthConnector(this.nylasAuth,this.nylasAuthStore),this._authConnector)}get threads(){return this._threadConnector?this._threadConnector:(this._threadConnector=new o.NylasThreadsConnector(this.nylasAuth,this.nylasAuthStore,this.nylasMailboxStore,this.router),this._threadConnector)}get messages(){return this._messageConnector?this._messageConnector:(this._messageConnector=new o.NylasMessagesConnector(this.nylasAuth,this.nylasAuthStore,this.nylasMailboxStore),this._messageConnector)}get folders(){return this._foldersConnector?this._foldersConnector:(this._foldersConnector=new o.NylasFoldersConnector(this.nylasAuth,this.nylasAuthStore,this.nylasMailboxStore),this._foldersConnector)}get scheduler(){return this._schedulerAPIConnector?this._schedulerAPIConnector:(this._schedulerAPIConnector=new f.NylaSchedulerAPIConnector({schedulerAPIURL:this.schedulerAPIURL,schedulerStore:this.schedulerStore}),this._schedulerAPIConnector)}get schedulerConfig(){return this._schedulerConfigConnector?this._schedulerConfigConnector:(this._schedulerConfigConnector=new b.NylasSchedulerConfigAPIConnector({nylasAuth:this.nylasAuth,nylasAuthStore:this.nylasAuthStore,nylasSchedulerConfigStore:this.nylasSchedulerConfigStore}),this._schedulerConfigConnector)}getAuth(){return this.nylasAuth}resetStores(){this.nylasAuthStore.reset(),this.nylasMailboxStore.reset()}async logout(){await this.nylasAuth.logout(),this.resetStores()}}const v=":host{display:contents}",P=v,A=class{constructor(e){r.registerInstance(this,e),this.init=r.createEvent(this,"init",7),this.loggedIn=r.createEvent(this,"loggedIn",7),this.loggedOut=r.createEvent(this,"loggedOut",7),this.handleAuthChange=async t=>{t?this.loggedIn.emit(this.host):this.loggedOut.emit(this.host)},this.authConfig=void 0,this.eventOverrides={},this.automaticComponentRegistration=!0}connectedCallback(){l.debug("[nylas-provider] connectedCallback")}async componentWillLoad(){var h,a,u,d,g,y;l.debug("[nylas-provider] componentWillLoad"),this.stores={auth:S.CreateNylasAuthStore(),mailbox:o.CreateNylasMailboxStore(),scheduler:f.CreateNylasSchedulerStore(),schedulerConfig:b.CreateNylasSchedulerConfigStore()},this.baseProvider=new C.NylasBaseProvider(this.host,this.stores,this.automaticComponentRegistration,this.eventOverrides);const e=new o.HashRouter;this.nylasAuth=C.es({apiUri:"https://api.us.nylas.com",elementsApiUri:"https://elements.us.nylas.com",storageType:"indexeddb",clientId:"YOUR_CLIENT_ID",defaultScopes:[],redirectURI:"/",...this.authConfig});const t=(h=this.baseProvider)==null?void 0:h.getStore("mailbox");if(!t)throw new Error("The mailbox store is not set");const s=(a=this.baseProvider)==null?void 0:a.getStore("auth");if(!s)throw new Error("The auth store is not set");const n=(u=this.baseProvider)==null?void 0:u.getStore("scheduler");if(!n)throw new Error("The scheduler store is not set");const i=(d=this.baseProvider)==null?void 0:d.getStore("schedulerConfig");if(!i)throw new Error("The scheduler config store is not set");this.nylasConnector=new m(e,this.nylasAuth,s,t,n,i),this.init.emit(this.host).defaultPrevented||await((g=this.nylasConnector)==null?void 0:g.auth.validateSession()),this.handleAuthChange(s.state.isAuthenticated),(y=this.baseProvider)==null||y.componentWillLoad(this.nylasConnector)}componentDidLoad(){var t,s;const e=(t=this.baseProvider)==null?void 0:t.getStore("auth");e==null||e.onChange("isAuthenticated",this.handleAuthChange),(s=this.baseProvider)==null||s.componentDidLoad()}componentDisconnected(){var e;(e=this.baseProvider)==null||e.componentDisconnected()}async registerComponentHandler(e){var t;(t=this.baseProvider)==null||t.registerComponent(e.detail)}async unregisterComponentHandler(e){var t;(t=this.baseProvider)==null||t.unregisterComponent(e.detail)}async getNylasAuth(){return this.nylasAuth}async getNylasConnector(){return this.nylasConnector}async getMailboxStore(){var e;return(e=this.baseProvider)==null?void 0:e.getStore("mailbox")}async getAuthStore(){var e;return(e=this.baseProvider)==null?void 0:e.getStore("auth")}async getNylasSchedulerStore(){var e;return(e=this.baseProvider)==null?void 0:e.getStore("scheduler")}async getNylasSchedulerConfigStore(){var e;return(e=this.baseProvider)==null?void 0:e.getStore("schedulerConfig")}render(){return r.h(r.Host,{key:"c70dbacf5502b79a6306f27b969dd9a9f841f5a0"},r.h("slot",{key:"031e85b2e755d2e4b7f925982a47e32daa5f8200"}))}get host(){return r.getElement(this)}};A.style=P;exports.nylas_provider=A;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-457dcf0b.cjs"),d=require("./index-10914bc1-c8c3a2f3.cjs"),c=require("./auth-store-69ac49c7-5a0bbb90.cjs"),r=require("./utils-0cd66d04-94b9c3b6.cjs"),u=require("./scheduler-config-store-4d035001-0256b40c.cjs");require("react");require("react-dom");require("./_commonjsHelpers-57e89916-4a3ae7d8.cjs");class y{constructor({nylasAuth:e,nylasAuthStore:n,nylasSchedulerConfigStore:o}){this.nylasAuth=e,this.nylasAuthStore=n,this.nylasSchedulerConfigStore=o}init(){r.debug("NylasSchedulerConfigConnector init")}get authStore(){return this.nylasAuthStore}get auth(){return this._authConnector?this._authConnector:(this._authConnector=new c.NylasAuthConnector(this.nylasAuth,this.nylasAuthStore),this._authConnector)}get schedulerConfigStore(){return this.nylasSchedulerConfigStore}get schedulerConfig(){return this._schedulerConfigConnector?this._schedulerConfigConnector:(this._schedulerConfigConnector=new u.NylasSchedulerConfigAPIConnector({nylasAuth:this.nylasAuth,nylasAuthStore:this.nylasAuthStore,nylasSchedulerConfigStore:this.nylasSchedulerConfigStore}),this._schedulerConfigConnector)}getAuth(){return this.nylasAuth}getTokenInfo(){return this.nylasAuth.getTokenInfo()}resetStores(){r.debug("NylasSchedulerConfigConnector resetStores"),this.nylasAuthStore.reset(),this.nylasSchedulerConfigStore.reset()}async logout(){r.debug("NylasSchedulerConfigConnector logout"),await this.auth.logout(),this.resetStores()}}const f=':host{display:flex;flex-direction:column;overflow:visible;border-radius:var(--nylas-border-radius-2x);width:fit-content;background:var(--nylas-base-0);position:relative;box-shadow:0px 4px 6px -2px rgba(0, 0, 0, 0.05), 0px 10px 15px -3px rgba(0, 0, 0, 0.1);--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}@media screen and (max-width: 768px){:host{width:auto;min-width:325px}}div.scheduler-editor-header{display:flex;align-items:center;justify-content:space-between;padding:1rem;border-bottom:1px solid var(--nylas-base-200);color:var(--nylas-base-900)}div.scheduler-editor-header h1.scheduler-editor-title{display:flex;align-items:center;gap:0.5rem;width:858px;margin:0;font-size:18px;line-height:24px;font-weight:600}@media screen and (max-width: 768px){div.scheduler-editor-header h1.scheduler-editor-title{width:auto;min-width:calc(325px - 1rem)}}div.scheduler-editor-header button{background:transparent;border:none;cursor:pointer}div.scheduler-editor-header button:hover,div.scheduler-editor-header button:active{color:var(--nylas-primary)}div.scheduler-editor-header button:disabled{cursor:not-allowed}nylas-editor-tabs{width:100%}',C=f,g=class{constructor(s){t.registerInstance(this,s),this.init=t.createEvent(this,"init",7),this.loggedIn=t.createEvent(this,"loggedIn",7),this.loggedOut=t.createEvent(this,"loggedOut",7),this.schedulerConfigCloseClicked=t.createEvent(this,"schedulerConfigCloseClicked",7),this.handleAuthChange=async e=>{var n;e?this.loggedIn.emit(this.host):this.loggedOut.emit(this.host).defaultPrevented||await((n=this.nylasSchedulerConfigConnector)==null?void 0:n.logout())},this.handleSchedulerConfigCloseClicked=e=>{this.schedulerConfigCloseClicked.emit(this.host)},this.authConfig=void 0,this.eventOverrides={},this.defaultAuthStoreState=void 0,this.defaultSchedulerConfigStoreState=void 0,this.mode="app",this.automaticComponentRegistration=!0,this.loggedInUser=""}connectedCallback(){r.debug("[nylas-scheduler-editor] connectedCallback")}async componentWillLoad(){var o,i,a,l;r.debug("[nylas-scheduler-editor] componentWillLoad"),this.stores={auth:c.CreateNylasAuthStore(this.defaultAuthStoreState),schedulerConfig:u.CreateNylasSchedulerConfigStore({...this.defaultSchedulerConfigStoreState})},this.baseProvider=new d.NylasBaseProvider(this.host,this.stores,this.automaticComponentRegistration,this.eventOverrides),this.nylasAuth=d.es({apiUri:"https://api.us.nylas.com",elementsApiUri:"https://elements.us.nylas.com",storageType:"indexeddb",clientId:"YOUR_CLIENT_ID",defaultScopes:[],redirectURI:"/",...this.authConfig});const s=(o=this.baseProvider)==null?void 0:o.getStore("auth"),e=this.baseProvider.getStore("schedulerConfig");if(this.nylasSchedulerConfigConnector=new y({nylasAuth:this.nylasAuth,nylasAuthStore:this.stores.auth,nylasSchedulerConfigStore:e}),!this.init.emit(this.host).defaultPrevented){await((i=this.nylasSchedulerConfigConnector)==null?void 0:i.auth.validateSession());const h=await((a=this.nylasSchedulerConfigConnector)==null?void 0:a.auth.getTokenInfo());h&&(this.loggedInUser=h.email)}this.handleAuthChange(s.state.isAuthenticated),(l=this.baseProvider)==null||l.componentWillLoad(this.nylasSchedulerConfigConnector)}async componentDidLoad(){var s,e,n;r.debug("[nylas-scheduler-editor] componentDidLoad"),(s=this.baseProvider)==null||s.componentDidLoad(),await((n=(e=this.nylasSchedulerConfigConnector)==null?void 0:e.schedulerConfig)==null?void 0:n.getCalendars())}componentDisconnected(){var s;(s=this.baseProvider)==null||s.componentDisconnected()}async registerComponentHandler(s){var e;(e=this.baseProvider)==null||e.registerComponent(s.detail)}async unregisterComponentHandler(s){var e;(e=this.baseProvider)==null||e.unregisterComponent(s.detail)}render(){return this.mode==="app"?t.h(t.Host,null,t.h("div",{class:"scheduler-editor-header"},t.h("h1",{class:"scheduler-editor-title"},t.h("calendar-icon",{width:"18",height:"18"}),"Schedule editor"),t.h("button",{class:"scheduler-editor-close",onClick:e=>this.handleSchedulerConfigCloseClicked(e),part:"nsc-close-button"},t.h("close-icon",{width:"18",height:"18"}))),t.h("nylas-editor-tabs",null)):t.h(t.Host,null,t.h("slot",null))}get host(){return t.getElement(this)}};g.style=C;exports.nylas_scheduler_editor=g;
|
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
import { r as u, c as i, h as s, H as c, g } from "./index-ce40ad47.js";
|
|
2
|
-
import { N as f, e as y } from "./index-10914bc1-346f04fa.js";
|
|
3
|
-
import { C, N as p } from "./auth-store-69ac49c7-cbfda055.js";
|
|
4
|
-
import { d as o } from "./utils-0cd66d04-89ab163d.js";
|
|
5
|
-
import { C as S, N as b } from "./scheduler-config-store-4d035001-db9dc78a.js";
|
|
6
|
-
import "react";
|
|
7
|
-
import "react-dom";
|
|
8
|
-
import "./_commonjsHelpers-57e89916-af061c86.js";
|
|
9
|
-
class m {
|
|
10
|
-
constructor({ nylasAuth: e, nylasAuthStore: n, nylasSchedulerConfigStore: r }) {
|
|
11
|
-
this.nylasAuth = e, this.nylasAuthStore = n, this.nylasSchedulerConfigStore = r;
|
|
12
|
-
}
|
|
13
|
-
init() {
|
|
14
|
-
o("NylasSchedulerConfigConnector init");
|
|
15
|
-
}
|
|
16
|
-
get authStore() {
|
|
17
|
-
return this.nylasAuthStore;
|
|
18
|
-
}
|
|
19
|
-
get auth() {
|
|
20
|
-
return this._authConnector ? this._authConnector : (this._authConnector = new p(this.nylasAuth, this.nylasAuthStore), this._authConnector);
|
|
21
|
-
}
|
|
22
|
-
get schedulerConfigStore() {
|
|
23
|
-
return this.nylasSchedulerConfigStore;
|
|
24
|
-
}
|
|
25
|
-
get schedulerConfig() {
|
|
26
|
-
return this._schedulerConfigConnector ? this._schedulerConfigConnector : (this._schedulerConfigConnector = new b({
|
|
27
|
-
nylasAuth: this.nylasAuth,
|
|
28
|
-
nylasAuthStore: this.nylasAuthStore,
|
|
29
|
-
nylasSchedulerConfigStore: this.nylasSchedulerConfigStore
|
|
30
|
-
}), this._schedulerConfigConnector);
|
|
31
|
-
}
|
|
32
|
-
getAuth() {
|
|
33
|
-
return this.nylasAuth;
|
|
34
|
-
}
|
|
35
|
-
getTokenInfo() {
|
|
36
|
-
return this.nylasAuth.getTokenInfo();
|
|
37
|
-
}
|
|
38
|
-
resetStores() {
|
|
39
|
-
o("NylasSchedulerConfigConnector resetStores"), this.nylasAuthStore.reset(), this.nylasSchedulerConfigStore.reset();
|
|
40
|
-
}
|
|
41
|
-
async logout() {
|
|
42
|
-
o("NylasSchedulerConfigConnector logout"), await this.auth.logout(), this.resetStores();
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
const v = ':host{display:flex;flex-direction:column;overflow:visible;border-radius:var(--nylas-border-radius-2x);width:fit-content;background:var(--nylas-base-0);position:relative;box-shadow:0px 4px 6px -2px rgba(0, 0, 0, 0.05), 0px 10px 15px -3px rgba(0, 0, 0, 0.1);--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}@media screen and (max-width: 768px){:host{width:auto;min-width:325px}}div.scheduler-editor-header{display:flex;align-items:center;justify-content:space-between;padding:1rem;border-bottom:1px solid var(--nylas-base-200);color:var(--nylas-base-900)}div.scheduler-editor-header h1.scheduler-editor-title{display:flex;align-items:center;gap:0.5rem;width:858px;margin:0;font-size:18px;line-height:24px;font-weight:600}@media screen and (max-width: 768px){div.scheduler-editor-header h1.scheduler-editor-title{width:auto;min-width:calc(325px - 1rem)}}div.scheduler-editor-header button{background:transparent;border:none;cursor:pointer}div.scheduler-editor-header button:hover,div.scheduler-editor-header button:active{color:var(--nylas-primary)}div.scheduler-editor-header button:disabled{cursor:not-allowed}nylas-editor-tabs{width:100%}', x = v, w = class {
|
|
46
|
-
constructor(t) {
|
|
47
|
-
u(this, t), this.init = i(this, "init", 7), this.loggedIn = i(this, "loggedIn", 7), this.loggedOut = i(this, "loggedOut", 7), this.schedulerConfigCloseClicked = i(this, "schedulerConfigCloseClicked", 7), this.handleAuthChange = async (e) => {
|
|
48
|
-
var n;
|
|
49
|
-
e ? this.loggedIn.emit(this.host) : this.loggedOut.emit(this.host).defaultPrevented || await ((n = this.nylasSchedulerConfigConnector) == null ? void 0 : n.logout());
|
|
50
|
-
}, this.handleSchedulerConfigCloseClicked = (e) => {
|
|
51
|
-
this.schedulerConfigCloseClicked.emit(this.host);
|
|
52
|
-
}, this.authConfig = void 0, this.eventOverrides = {}, this.defaultAuthStoreState = void 0, this.defaultSchedulerConfigStoreState = void 0, this.mode = "app", this.automaticComponentRegistration = !0, this.loggedInUser = "";
|
|
53
|
-
}
|
|
54
|
-
connectedCallback() {
|
|
55
|
-
o("[nylas-scheduler-editor] connectedCallback");
|
|
56
|
-
}
|
|
57
|
-
async componentWillLoad() {
|
|
58
|
-
var r, a, l, h;
|
|
59
|
-
o("[nylas-scheduler-editor] componentWillLoad"), this.stores = {
|
|
60
|
-
auth: C(this.defaultAuthStoreState),
|
|
61
|
-
schedulerConfig: S({
|
|
62
|
-
...this.defaultSchedulerConfigStoreState
|
|
63
|
-
})
|
|
64
|
-
}, this.baseProvider = new f(this.host, this.stores, this.automaticComponentRegistration, this.eventOverrides), this.nylasAuth = y({
|
|
65
|
-
apiUri: "https://api.us.nylas.com",
|
|
66
|
-
elementsApiUri: "https://elements.us.nylas.com",
|
|
67
|
-
storageType: "indexeddb",
|
|
68
|
-
clientId: "YOUR_CLIENT_ID",
|
|
69
|
-
defaultScopes: [],
|
|
70
|
-
redirectURI: "/",
|
|
71
|
-
...this.authConfig
|
|
72
|
-
});
|
|
73
|
-
const t = (r = this.baseProvider) == null ? void 0 : r.getStore("auth"), e = this.baseProvider.getStore("schedulerConfig");
|
|
74
|
-
if (this.nylasSchedulerConfigConnector = new m({
|
|
75
|
-
nylasAuth: this.nylasAuth,
|
|
76
|
-
nylasAuthStore: this.stores.auth,
|
|
77
|
-
nylasSchedulerConfigStore: e
|
|
78
|
-
}), !this.init.emit(this.host).defaultPrevented) {
|
|
79
|
-
await ((a = this.nylasSchedulerConfigConnector) == null ? void 0 : a.auth.validateSession());
|
|
80
|
-
const d = await ((l = this.nylasSchedulerConfigConnector) == null ? void 0 : l.auth.getTokenInfo());
|
|
81
|
-
d && (this.loggedInUser = d.email);
|
|
82
|
-
}
|
|
83
|
-
this.handleAuthChange(t.state.isAuthenticated), (h = this.baseProvider) == null || h.componentWillLoad(this.nylasSchedulerConfigConnector);
|
|
84
|
-
}
|
|
85
|
-
async componentDidLoad() {
|
|
86
|
-
var t, e, n;
|
|
87
|
-
o("[nylas-scheduler-editor] componentDidLoad"), (t = this.baseProvider) == null || t.componentDidLoad(), await ((n = (e = this.nylasSchedulerConfigConnector) == null ? void 0 : e.schedulerConfig) == null ? void 0 : n.getCalendars());
|
|
88
|
-
}
|
|
89
|
-
componentDisconnected() {
|
|
90
|
-
var t;
|
|
91
|
-
(t = this.baseProvider) == null || t.componentDisconnected();
|
|
92
|
-
}
|
|
93
|
-
async registerComponentHandler(t) {
|
|
94
|
-
var e;
|
|
95
|
-
(e = this.baseProvider) == null || e.registerComponent(t.detail);
|
|
96
|
-
}
|
|
97
|
-
async unregisterComponentHandler(t) {
|
|
98
|
-
var e;
|
|
99
|
-
(e = this.baseProvider) == null || e.unregisterComponent(t.detail);
|
|
100
|
-
}
|
|
101
|
-
render() {
|
|
102
|
-
return this.mode === "app" ? s(c, null, s("div", { class: "scheduler-editor-header" }, s("h1", { class: "scheduler-editor-title" }, s("calendar-icon", { width: "18", height: "18" }), "Schedule editor"), s("button", { class: "scheduler-editor-close", onClick: (e) => this.handleSchedulerConfigCloseClicked(e), part: "nsc-close-button" }, s("close-icon", { width: "18", height: "18" }))), s("nylas-editor-tabs", null)) : s(c, null, s("slot", null));
|
|
103
|
-
}
|
|
104
|
-
get host() {
|
|
105
|
-
return g(this);
|
|
106
|
-
}
|
|
107
|
-
};
|
|
108
|
-
w.style = x;
|
|
109
|
-
export {
|
|
110
|
-
w as nylas_scheduler_editor
|
|
111
|
-
};
|