@nylas/react 1.0.2-prealpha1 → 1.1.0-canary.11
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-71e60262.js +1755 -0
- package/dist/add-circle-icon_21.entry-95dda099.cjs +1 -0
- package/dist/{archive-icon_7.entry-84d70dbf.cjs → archive-icon_7.entry-24f31e46.cjs} +1 -1
- package/dist/{archive-icon_7.entry-91aaa1aa.js → archive-icon_7.entry-3c5e3ccf.js} +19 -19
- package/dist/{arrow-icon.entry-400a08fa.cjs → arrow-icon.entry-562eb541.cjs} +1 -1
- package/dist/{arrow-icon.entry-8b2e96a6.js → arrow-icon.entry-813bffe9.js} +2 -2
- package/dist/{bold-icon_3.entry-4b2798a8.js → bold-icon_3.entry-c0e7d524.js} +4 -4
- package/dist/{bold-icon_3.entry-9ad35153.cjs → bold-icon_3.entry-e8b034fe.cjs} +1 -1
- package/dist/{calendar-cancel-icon.entry-83ba884a.js → calendar-cancel-icon.entry-0b0219cb.js} +5 -5
- package/dist/{calendar-cancel-icon.entry-fcb66929.cjs → calendar-cancel-icon.entry-7d4fdb1b.cjs} +1 -1
- package/dist/calendar-check-icon_2.entry-6ecd2faa.js +25 -0
- package/dist/calendar-check-icon_2.entry-88025f63.cjs +1 -0
- package/dist/{calendar-icon.entry-8f38af4a.js → calendar-icon.entry-34d8ef69.js} +5 -5
- package/dist/{calendar-icon.entry-7bae38d7.cjs → calendar-icon.entry-b753520f.cjs} +1 -1
- package/dist/chevron-icon_3.entry-0aeb4cfa.cjs +1 -0
- package/dist/chevron-icon_3.entry-ae55fd65.js +117 -0
- package/dist/close-icon.entry-ae66c827.js +15 -0
- package/dist/close-icon.entry-c80da833.cjs +1 -0
- package/dist/{nylas-booked-event-card_10.entry-ed515326.cjs → constants-f34b9c6e-b9f975af.cjs} +6 -6
- package/dist/{nylas-booked-event-card_10.entry-7e66a648.js → constants-f34b9c6e-d0f5cd19.js} +1665 -2374
- package/dist/document-refresh-icon.entry-36405467.cjs +1 -0
- package/dist/{document-refresh-icon.entry-9083a2e9.js → document-refresh-icon.entry-7d370f85.js} +5 -5
- package/dist/elements/index.d.ts +32 -2
- package/dist/{elements-dc5b338e-81a0319c.cjs → elements-dc5b338e-0dbb4f67.cjs} +1 -1
- package/dist/{elements-dc5b338e-fb5dbfb5.js → elements-dc5b338e-524cb111.js} +1 -1
- package/dist/{focus-visible-e8093c16-28fc08a0.js → focus-visible-e8093c16-17ab1557.js} +5 -3
- package/dist/focus-visible-e8093c16-7e94a4f3.cjs +1 -0
- package/dist/{forward-icon_6.entry-b60fcb35.js → forward-icon_6.entry-384cc3c5.js} +83 -85
- package/dist/forward-icon_6.entry-a479b39e.cjs +3 -0
- package/dist/{globe-icon.entry-8325e73e.cjs → globe-icon.entry-0c848856.cjs} +1 -1
- package/dist/{globe-icon.entry-e3fd373f.js → globe-icon.entry-58b9f3fc.js} +4 -4
- package/dist/google-logo-icon_4.entry-3dce1b83.js +388 -0
- package/dist/google-logo-icon_4.entry-e1e63fd0.cjs +1 -0
- package/dist/index-20ea5b0c.js +4042 -0
- package/dist/index-33f74306.cjs +37 -0
- package/dist/index.d.ts +3 -1
- package/dist/{index-b30d446a-a90f84b2.js → index.es-be19d2df-c2fdca63.js} +945 -1041
- package/dist/index.es-be19d2df-f732308a.cjs +7 -0
- package/dist/info-icon_2.entry-98965833.js +34 -0
- package/dist/info-icon_2.entry-dd0a0633.cjs +1 -0
- package/dist/{loading-icon.entry-b2096d2b.cjs → loading-icon.entry-46821f18.cjs} +1 -1
- package/dist/{loading-icon.entry-27410cf8.js → loading-icon.entry-abd81cea.js} +2 -2
- package/dist/mailbox-store-76540d24-7bf14e45.cjs +1 -0
- package/dist/{mailbox-store-19f0c6c9-e3e8b4e5.js → mailbox-store-76540d24-dfb53045.js} +2 -2
- package/dist/nylas-additional-participants.entry-d35d7af5.cjs +1 -0
- package/dist/nylas-additional-participants.entry-f6ed34d6.js +81 -0
- package/dist/nylas-booked-event-card_10.entry-534e587c.cjs +1 -0
- package/dist/nylas-booked-event-card_10.entry-8efe8335.js +805 -0
- package/dist/nylas-custom-booking-flow.entry-0e7b605d.js +106 -0
- package/dist/nylas-custom-booking-flow.entry-12d09496.cjs +1 -0
- package/dist/nylas-form-card.entry-7dd86dde.js +54 -0
- package/dist/nylas-form-card.entry-94579d1d.cjs +1 -0
- package/dist/nylas-if-state.entry-32ea90ea.cjs +1 -0
- package/dist/nylas-if-state.entry-92cbc0b9.js +94 -0
- package/dist/nylas-list-folders.entry-8595a9b7.cjs +1 -0
- package/dist/{nylas-list-folders.entry-a5437201.js → nylas-list-folders.entry-cab222c9.js} +10 -11
- package/dist/nylas-list-threads.entry-3fef6316.cjs +1 -0
- package/dist/{nylas-list-threads.entry-fd6cda61.js → nylas-list-threads.entry-8e9294a3.js} +5 -6
- package/dist/nylas-login.entry-bc885e04.cjs +1 -0
- package/dist/nylas-login.entry-bd1d5b6f.js +73 -0
- package/dist/{nylas-mailbox-pagination.entry-988214bc.js → nylas-mailbox-pagination.entry-58657a09.js} +7 -8
- package/dist/nylas-mailbox-pagination.entry-74d3b376.cjs +1 -0
- package/dist/nylas-mailbox-toolbar-button.entry-8b73b9f4.cjs +1 -0
- package/dist/{nylas-mailbox-toolbar-button.entry-c720e22a.js → nylas-mailbox-toolbar-button.entry-d7817b46.js} +15 -16
- package/dist/nylas-mailbox.entry-0bddc2fd.js +134 -0
- package/dist/nylas-mailbox.entry-762f5062.cjs +1 -0
- package/dist/{nylas-provider.entry-70721009.js → nylas-provider.entry-2e24192d.js} +40 -29
- package/dist/nylas-provider.entry-f8ba7a6e.cjs +1 -0
- package/dist/nylas-scheduler-editor.entry-8189b099.js +2269 -0
- package/dist/nylas-scheduler-editor.entry-a642f833.cjs +7 -0
- package/dist/nylas-scheduling.entry-13087b5f.cjs +1 -0
- package/dist/nylas-scheduling.entry-3f170361.js +248 -0
- package/dist/nylas-threads-refresh.entry-3b9f57c3.cjs +1 -0
- package/dist/{nylas-threads-refresh.entry-b7f9e93f.js → nylas-threads-refresh.entry-f2967405.js} +4 -5
- package/dist/nylas-threads-search.entry-3e0b4fdc.cjs +1 -0
- package/dist/{nylas-threads-search.entry-95afea9c.js → nylas-threads-search.entry-e70bbf70.js} +4 -5
- package/dist/{nylas-view-thread.entry-165173b1.js → nylas-view-thread.entry-4f39f045.js} +10 -11
- package/dist/nylas-view-thread.entry-b23080b7.cjs +1 -0
- package/dist/people-icon.entry-15cd7d77.cjs +1 -0
- package/dist/people-icon.entry-7f3b95e9.js +15 -0
- package/dist/play-icon_2.entry-13065065.js +25 -0
- package/dist/play-icon_2.entry-2172886a.cjs +1 -0
- package/dist/react.cjs +1 -1
- package/dist/react.js +94 -62
- package/dist/{refresh-icon.entry-601cac89.cjs → refresh-icon.entry-61067a7f.cjs} +1 -1
- package/dist/{refresh-icon.entry-e48a338f.js → refresh-icon.entry-fbfa185e.js} +5 -5
- package/dist/register-component-83e24412-445c6ad9.cjs +1 -0
- package/dist/{register-component-152c6ad2-a06f58c2.js → register-component-83e24412-b666e56b.js} +37 -33
- package/dist/scheduler-config-store-ec3b6190-8bde49c6.cjs +1 -0
- package/dist/scheduler-config-store-ec3b6190-fa81c492.js +23 -0
- package/dist/scheduler-store-8ca9003d-57b3f7a7.cjs +1 -0
- package/dist/scheduler-store-8ca9003d-8da2c12d.js +321 -0
- package/dist/time-period-selector.entry-5e083fd3.js +76 -0
- package/dist/time-period-selector.entry-febf55eb.cjs +1 -0
- package/dist/translate-icon.entry-10db7d36.js +15 -0
- package/dist/translate-icon.entry-8ce0a713.cjs +1 -0
- package/dist/warning-icon.entry-470e449d.js +15 -0
- package/dist/warning-icon.entry-b8217553.cjs +1 -0
- package/package.json +7 -4
- package/dist/_commonjsHelpers-57e89916-4a3ae7d8.cjs +0 -1
- package/dist/_commonjsHelpers-57e89916-af061c86.js +0 -19
- package/dist/add-circle-icon.entry-2ccb238b.cjs +0 -1
- package/dist/add-circle-icon.entry-35d6aa07.js +0 -15
- package/dist/calendar-check-icon_3.entry-903e2d82.js +0 -35
- package/dist/calendar-check-icon_3.entry-a16ce05e.cjs +0 -1
- package/dist/chevron-icon.entry-58366662.cjs +0 -1
- package/dist/chevron-icon.entry-5e11cef5.js +0 -15
- package/dist/close-icon_2.entry-011d9cf4.js +0 -25
- package/dist/close-icon_2.entry-83088b9a.cjs +0 -1
- package/dist/document-refresh-icon.entry-071ffd66.cjs +0 -1
- package/dist/duration-bddc4a13-05d3e3e2.cjs +0 -1
- package/dist/duration-bddc4a13-179ce826.js +0 -41
- package/dist/focus-visible-e8093c16-f380b705.cjs +0 -1
- package/dist/forward-icon_6.entry-3345af84.cjs +0 -3
- package/dist/index-3b6f5cd5.cjs +0 -30
- package/dist/index-630f4e87.js +0 -1498
- package/dist/index-b30d446a-cbbef925.cjs +0 -7
- package/dist/mailbox-store-19f0c6c9-a0cbfa97.cjs +0 -1
- package/dist/nylas-if-state_3.entry-504be976.cjs +0 -1
- package/dist/nylas-if-state_3.entry-e96d01f1.js +0 -291
- package/dist/nylas-list-folders.entry-866361cc.cjs +0 -1
- package/dist/nylas-list-threads.entry-04989295.cjs +0 -1
- package/dist/nylas-mailbox-pagination.entry-e0bd4aef.cjs +0 -1
- package/dist/nylas-mailbox-toolbar-button.entry-3d772b26.cjs +0 -1
- package/dist/nylas-open-hours-picker.entry-6bdc7c73.js +0 -186
- package/dist/nylas-open-hours-picker.entry-881b6db7.cjs +0 -1
- package/dist/nylas-provider.entry-8d9a844b.cjs +0 -1
- package/dist/nylas-scheduler.entry-7321e18f.js +0 -230
- package/dist/nylas-scheduler.entry-e82977fb.cjs +0 -1
- package/dist/nylas-threads-refresh.entry-477e68e4.cjs +0 -1
- package/dist/nylas-threads-search.entry-c5854641.cjs +0 -1
- package/dist/nylas-view-thread.entry-8b72cbdb.cjs +0 -1
- package/dist/play-icon_2.entry-ed5877e3.js +0 -25
- package/dist/play-icon_2.entry-f23ed6c1.cjs +0 -1
- package/dist/register-component-152c6ad2-0df7215b.cjs +0 -1
- package/dist/scheduler-store-7d48e682-0c0c3991.js +0 -289
- package/dist/scheduler-store-7d48e682-674705ef.cjs +0 -1
- package/dist/search-icon_3.entry-292138c3.js +0 -101
- package/dist/search-icon_3.entry-8e555357.cjs +0 -1
- package/dist/utils-5074a070-ce33ee6b.js +0 -119
- package/dist/utils-5074a070-d5ba6add.cjs +0 -2
|
@@ -1,22 +1,21 @@
|
|
|
1
|
-
import { r as f, h as l, H as
|
|
2
|
-
import { R as
|
|
3
|
-
import { d as c } from "./utils-5074a070-ce33ee6b.js";
|
|
1
|
+
import { r as f, d as c, h as l, H as y, g as u } from "./index-20ea5b0c.js";
|
|
2
|
+
import { R as m } from "./register-component-83e24412-b666e56b.js";
|
|
4
3
|
import "react";
|
|
5
4
|
import "react-dom";
|
|
6
|
-
const
|
|
5
|
+
const h = ":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}", p = h;
|
|
7
6
|
var g = function(t, o, e, n) {
|
|
8
|
-
var r = arguments.length, a = r < 3 ? o : n === null ? n = Object.getOwnPropertyDescriptor(o, e) : n,
|
|
7
|
+
var r = arguments.length, a = r < 3 ? o : n === null ? n = Object.getOwnPropertyDescriptor(o, e) : n, s;
|
|
9
8
|
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
10
9
|
a = Reflect.decorate(t, o, e, n);
|
|
11
10
|
else
|
|
12
|
-
for (var
|
|
13
|
-
(
|
|
11
|
+
for (var i = t.length - 1; i >= 0; i--)
|
|
12
|
+
(s = t[i]) && (a = (r < 3 ? s(a) : r > 3 ? s(o, e, a) : s(o, e)) || a);
|
|
14
13
|
return r > 3 && a && Object.defineProperty(o, e, a), a;
|
|
15
14
|
}, d = function(t, o) {
|
|
16
15
|
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
17
16
|
return Reflect.metadata(t, o);
|
|
18
17
|
};
|
|
19
|
-
const
|
|
18
|
+
const b = class {
|
|
20
19
|
constructor(t) {
|
|
21
20
|
f(this, t), this.onClick = async () => {
|
|
22
21
|
const o = this.method;
|
|
@@ -39,8 +38,8 @@ const y = class {
|
|
|
39
38
|
callMethod(t, o) {
|
|
40
39
|
const e = o.split(".");
|
|
41
40
|
let n = t;
|
|
42
|
-
for (const
|
|
43
|
-
if (n = n[
|
|
41
|
+
for (const s of e.slice(0, -1))
|
|
42
|
+
if (n = n[s], !n)
|
|
44
43
|
return;
|
|
45
44
|
const r = e[e.length - 1], a = n[r];
|
|
46
45
|
if (typeof a == "function")
|
|
@@ -61,14 +60,14 @@ const y = class {
|
|
|
61
60
|
t = this.dataState ? o.get(r) === "loading" : !1;
|
|
62
61
|
}
|
|
63
62
|
const e = t ? "state-loading" : "state-ready";
|
|
64
|
-
return l(
|
|
63
|
+
return l(y, { key: "2454ef2e4270d1642cabe57dacf53908fcdb34e6" }, l("sp-theme", { key: "97d71094fabc3466b87142dfdd1d0bb22659fd32", scale: "medium", color: "dark" }, l("sp-button", { onClick: this.onClick, disabled: t, key: e, "icon-only": this.iconOnly, label: this.renderByState(t) }, this.hasSlot("icon") && l("div", { slot: "icon", class: "slot" }, l("slot", { name: "icon" })), !this.iconOnly && this.renderByState(t))));
|
|
65
64
|
}
|
|
66
65
|
get host() {
|
|
67
|
-
return
|
|
66
|
+
return u(this);
|
|
68
67
|
}
|
|
69
68
|
};
|
|
70
69
|
g([
|
|
71
|
-
|
|
70
|
+
m({
|
|
72
71
|
name: "nylas-mailbox-toolbar-button",
|
|
73
72
|
connectorToProp: "mailboxConnector",
|
|
74
73
|
fireRegisterEvent: !0
|
|
@@ -76,8 +75,8 @@ g([
|
|
|
76
75
|
d("design:type", Function),
|
|
77
76
|
d("design:paramtypes", []),
|
|
78
77
|
d("design:returntype", void 0)
|
|
79
|
-
],
|
|
80
|
-
|
|
78
|
+
], b.prototype, "render", null);
|
|
79
|
+
b.style = p;
|
|
81
80
|
export {
|
|
82
|
-
|
|
81
|
+
b as nylas_mailbox_toolbar_button
|
|
83
82
|
};
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { r as p, c as l, d as S, h as f, H as M, g as _ } from "./index-20ea5b0c.js";
|
|
2
|
+
import { N as v, e as w } from "./index.es-be19d2df-c2fdca63.js";
|
|
3
|
+
import { C as P, a as N, H as I, N as E, b as L, c as O, d as R } from "./mailbox-store-76540d24-dfb53045.js";
|
|
4
|
+
import "react";
|
|
5
|
+
import "react-dom";
|
|
6
|
+
class T {
|
|
7
|
+
constructor(e, s, o, i) {
|
|
8
|
+
this.router = e, this.nylasAuth = s, this.nylasAuthStore = o, this.nylasMailboxStore = i;
|
|
9
|
+
}
|
|
10
|
+
init() {
|
|
11
|
+
S("NylasMailboxConnector init");
|
|
12
|
+
}
|
|
13
|
+
get mailboxStore() {
|
|
14
|
+
return this.nylasMailboxStore;
|
|
15
|
+
}
|
|
16
|
+
get authStore() {
|
|
17
|
+
return this.nylasAuthStore;
|
|
18
|
+
}
|
|
19
|
+
get auth() {
|
|
20
|
+
return this._authConnector ? this._authConnector : (this._authConnector = new E(this.nylasAuth, this.nylasAuthStore), this._authConnector);
|
|
21
|
+
}
|
|
22
|
+
get threads() {
|
|
23
|
+
return this._threadConnector ? this._threadConnector : (this._threadConnector = new L(this.nylasAuth, this.nylasAuthStore, this.nylasMailboxStore, this.router), this._threadConnector);
|
|
24
|
+
}
|
|
25
|
+
get messages() {
|
|
26
|
+
return this._messageConnector ? this._messageConnector : (this._messageConnector = new O(this.nylasAuth, this.nylasAuthStore, this.nylasMailboxStore), this._messageConnector);
|
|
27
|
+
}
|
|
28
|
+
get folders() {
|
|
29
|
+
return this._foldersConnector ? this._foldersConnector : (this._foldersConnector = new R(this.nylasAuth, this.nylasAuthStore, this.nylasMailboxStore), this._foldersConnector);
|
|
30
|
+
}
|
|
31
|
+
getAuth() {
|
|
32
|
+
return this.nylasAuth;
|
|
33
|
+
}
|
|
34
|
+
resetStores() {
|
|
35
|
+
this.nylasMailboxStore.reset(), this.nylasAuthStore.reset();
|
|
36
|
+
}
|
|
37
|
+
async logout() {
|
|
38
|
+
await this.nylasAuth.logout(), this.resetStores();
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
const H = ":host{display:contents}", k = H, D = class {
|
|
42
|
+
constructor(t) {
|
|
43
|
+
p(this, t), this.init = l(this, "init", 7), this.loggedIn = l(this, "loggedIn", 7), this.loggedOut = l(this, "loggedOut", 7), this.handleAuthChange = async (e) => {
|
|
44
|
+
var s;
|
|
45
|
+
e ? this.loggedIn.emit(this.host) : this.loggedOut.emit(this.host).defaultPrevented || await ((s = this.nylasMailboxConnector) == null ? void 0 : s.logout());
|
|
46
|
+
}, this.automaticComponentRegistration = !0, this.eventOverrides = {}, this.authConfig = void 0, this.defaultAuthStoreState = void 0, this.defaultMailboxStoreState = void 0;
|
|
47
|
+
}
|
|
48
|
+
connectedCallback() {
|
|
49
|
+
S("[nylas-mailbox] connectedCallback");
|
|
50
|
+
}
|
|
51
|
+
async componentWillLoad() {
|
|
52
|
+
var o, i, d, u, c, y, g;
|
|
53
|
+
this.stores = {
|
|
54
|
+
auth: P(this.defaultAuthStoreState),
|
|
55
|
+
mailbox: N(this.defaultMailboxStoreState)
|
|
56
|
+
}, this.baseProvider = new v(this.host, this.stores, this.automaticComponentRegistration, this.eventOverrides), this.router = new I(), this.nylasAuth = w({
|
|
57
|
+
apiUri: "https://api.us.nylas.com",
|
|
58
|
+
elementsApiUri: "https://elements.us.nylas.com",
|
|
59
|
+
storageType: "indexeddb",
|
|
60
|
+
clientId: "YOUR_CLIENT_ID",
|
|
61
|
+
defaultScopes: [],
|
|
62
|
+
redirectURI: "/",
|
|
63
|
+
...this.authConfig
|
|
64
|
+
});
|
|
65
|
+
const t = (o = this.baseProvider) == null ? void 0 : o.getStore("auth");
|
|
66
|
+
if (!t)
|
|
67
|
+
throw new Error("Auth store is not defined");
|
|
68
|
+
const e = (i = this.baseProvider) == null ? void 0 : i.getStore("mailbox");
|
|
69
|
+
if (!e)
|
|
70
|
+
throw new Error("Mailbox store is not defined");
|
|
71
|
+
this.nylasMailboxConnector = new T(this.router, this.nylasAuth, t, e), this.init.emit(this.host).defaultPrevented || await ((d = this.nylasMailboxConnector) == null ? void 0 : d.auth.validateSession()), (u = this.router) == null || u.addRouteChangeListener("/thread/:threadId", async (x, A, b) => {
|
|
72
|
+
var a, r;
|
|
73
|
+
const h = b.threadId, n = await ((a = this.nylasMailboxConnector) == null ? void 0 : a.threads.getThread(h));
|
|
74
|
+
n && ((r = this.nylasMailboxConnector) == null || r.mailboxStore.set("selectedThread", n));
|
|
75
|
+
}), (c = this.router) == null || c.addRouteChangeListener("/", async (x, A, b) => {
|
|
76
|
+
var n, a, r, C;
|
|
77
|
+
if (!t.state.isAuthenticated)
|
|
78
|
+
return;
|
|
79
|
+
(n = this.nylasMailboxConnector) == null || n.threads.unSelectThread(), (a = this.nylasMailboxConnector) == null || a.folders.getFolders();
|
|
80
|
+
const h = window.location.hash.split("?")[1];
|
|
81
|
+
if (h) {
|
|
82
|
+
const m = new URLSearchParams(h).get("query");
|
|
83
|
+
m && await ((r = this.nylasMailboxConnector) == null ? void 0 : r.threads.getThreads({
|
|
84
|
+
search_query_native: m,
|
|
85
|
+
page_token: void 0
|
|
86
|
+
}));
|
|
87
|
+
} else
|
|
88
|
+
(C = this.nylasMailboxConnector) == null || C.threads.getThreads();
|
|
89
|
+
}), (y = this.router) == null || y.init(), this.handleAuthChange(t.state.isAuthenticated), (g = this.baseProvider) == null || g.componentWillLoad(this.nylasMailboxConnector);
|
|
90
|
+
}
|
|
91
|
+
async componentDidLoad() {
|
|
92
|
+
var e, s;
|
|
93
|
+
const t = (e = this.baseProvider) == null ? void 0 : e.getStore("auth");
|
|
94
|
+
if (!t)
|
|
95
|
+
throw new Error("Auth store is not defined");
|
|
96
|
+
t.onChange("isAuthenticated", this.handleAuthChange), (s = this.baseProvider) == null || s.componentDidLoad();
|
|
97
|
+
}
|
|
98
|
+
componentDisconnected() {
|
|
99
|
+
var t;
|
|
100
|
+
(t = this.baseProvider) == null || t.componentDisconnected();
|
|
101
|
+
}
|
|
102
|
+
async registerComponentHandler(t) {
|
|
103
|
+
var e;
|
|
104
|
+
(e = this.baseProvider) == null || e.registerComponent(t.detail);
|
|
105
|
+
}
|
|
106
|
+
async unregisterComponentHandler(t) {
|
|
107
|
+
var e;
|
|
108
|
+
(e = this.baseProvider) == null || e.unregisterComponent(t.detail);
|
|
109
|
+
}
|
|
110
|
+
async getMailboxStore() {
|
|
111
|
+
var t;
|
|
112
|
+
return (t = this.baseProvider) == null ? void 0 : t.getStore("mailbox");
|
|
113
|
+
}
|
|
114
|
+
async getAuthStore() {
|
|
115
|
+
var t;
|
|
116
|
+
return (t = this.baseProvider) == null ? void 0 : t.getStore("auth");
|
|
117
|
+
}
|
|
118
|
+
async getNylasAuth() {
|
|
119
|
+
return this.nylasAuth;
|
|
120
|
+
}
|
|
121
|
+
async getNylasMailboxConnector() {
|
|
122
|
+
return this.nylasMailboxConnector;
|
|
123
|
+
}
|
|
124
|
+
render() {
|
|
125
|
+
return f(M, { key: "662c4d3f763c5cf9db31c4d2ba26bcdf47ead164" }, f("slot", { key: "5c2b75a569779dd2af6388648a4304721e82ba76" }));
|
|
126
|
+
}
|
|
127
|
+
get host() {
|
|
128
|
+
return _(this);
|
|
129
|
+
}
|
|
130
|
+
};
|
|
131
|
+
D.style = k;
|
|
132
|
+
export {
|
|
133
|
+
D as nylas_mailbox
|
|
134
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index-33f74306.cjs"),m=require("./index.es-be19d2df-f732308a.cjs"),n=require("./mailbox-store-76540d24-7bf14e45.cjs");require("react");require("react-dom");class v{constructor(e,o,r,l){this.router=e,this.nylasAuth=o,this.nylasAuthStore=r,this.nylasMailboxStore=l}init(){s.debug("NylasMailboxConnector init")}get mailboxStore(){return this.nylasMailboxStore}get authStore(){return this.nylasAuthStore}get auth(){return this._authConnector?this._authConnector:(this._authConnector=new n.NylasAuthConnector(this.nylasAuth,this.nylasAuthStore),this._authConnector)}get threads(){return this._threadConnector?this._threadConnector:(this._threadConnector=new n.NylasThreadsConnector(this.nylasAuth,this.nylasAuthStore,this.nylasMailboxStore,this.router),this._threadConnector)}get messages(){return this._messageConnector?this._messageConnector:(this._messageConnector=new n.NylasMessagesConnector(this.nylasAuth,this.nylasAuthStore,this.nylasMailboxStore),this._messageConnector)}get folders(){return this._foldersConnector?this._foldersConnector:(this._foldersConnector=new n.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 _=":host{display:contents}",p=_,x=class{constructor(t){s.registerInstance(this,t),this.init=s.createEvent(this,"init",7),this.loggedIn=s.createEvent(this,"loggedIn",7),this.loggedOut=s.createEvent(this,"loggedOut",7),this.handleAuthChange=async e=>{var o;e?this.loggedIn.emit(this.host):this.loggedOut.emit(this.host).defaultPrevented||await((o=this.nylasMailboxConnector)==null?void 0:o.logout())},this.automaticComponentRegistration=!0,this.eventOverrides={},this.authConfig=void 0,this.defaultAuthStoreState=void 0,this.defaultMailboxStoreState=void 0}connectedCallback(){s.debug("[nylas-mailbox] connectedCallback")}async componentWillLoad(){var r,l,u,c,y,g,b;this.stores={auth:n.CreateNylasAuthStore(this.defaultAuthStoreState),mailbox:n.CreateNylasMailboxStore(this.defaultMailboxStoreState)},this.baseProvider=new m.NylasBaseProvider(this.host,this.stores,this.automaticComponentRegistration,this.eventOverrides),this.router=new n.HashRouter,this.nylasAuth=m.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=(r=this.baseProvider)==null?void 0:r.getStore("auth");if(!t)throw new Error("Auth store is not defined");const e=(l=this.baseProvider)==null?void 0:l.getStore("mailbox");if(!e)throw new Error("Mailbox store is not defined");this.nylasMailboxConnector=new v(this.router,this.nylasAuth,t,e),this.init.emit(this.host).defaultPrevented||await((u=this.nylasMailboxConnector)==null?void 0:u.auth.validateSession()),(c=this.router)==null||c.addRouteChangeListener("/thread/:threadId",async(A,M,C)=>{var a,h;const d=C.threadId,i=await((a=this.nylasMailboxConnector)==null?void 0:a.threads.getThread(d));i&&((h=this.nylasMailboxConnector)==null||h.mailboxStore.set("selectedThread",i))}),(y=this.router)==null||y.addRouteChangeListener("/",async(A,M,C)=>{var i,a,h,S;if(!t.state.isAuthenticated)return;(i=this.nylasMailboxConnector)==null||i.threads.unSelectThread(),(a=this.nylasMailboxConnector)==null||a.folders.getFolders();const d=window.location.hash.split("?")[1];if(d){const f=new URLSearchParams(d).get("query");f&&await((h=this.nylasMailboxConnector)==null?void 0:h.threads.getThreads({search_query_native:f,page_token:void 0}))}else(S=this.nylasMailboxConnector)==null||S.threads.getThreads()}),(g=this.router)==null||g.init(),this.handleAuthChange(t.state.isAuthenticated),(b=this.baseProvider)==null||b.componentWillLoad(this.nylasMailboxConnector)}async componentDidLoad(){var e,o;const t=(e=this.baseProvider)==null?void 0:e.getStore("auth");if(!t)throw new Error("Auth store is not defined");t.onChange("isAuthenticated",this.handleAuthChange),(o=this.baseProvider)==null||o.componentDidLoad()}componentDisconnected(){var t;(t=this.baseProvider)==null||t.componentDisconnected()}async registerComponentHandler(t){var e;(e=this.baseProvider)==null||e.registerComponent(t.detail)}async unregisterComponentHandler(t){var e;(e=this.baseProvider)==null||e.unregisterComponent(t.detail)}async getMailboxStore(){var t;return(t=this.baseProvider)==null?void 0:t.getStore("mailbox")}async getAuthStore(){var t;return(t=this.baseProvider)==null?void 0:t.getStore("auth")}async getNylasAuth(){return this.nylasAuth}async getNylasMailboxConnector(){return this.nylasMailboxConnector}render(){return s.h(s.Host,{key:"662c4d3f763c5cf9db31c4d2ba26bcdf47ead164"},s.h("slot",{key:"5c2b75a569779dd2af6388648a4304721e82ba76"}))}get host(){return s.getElement(this)}};x.style=p;exports.nylas_mailbox=x;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { r as
|
|
2
|
-
import { N as
|
|
3
|
-
import {
|
|
4
|
-
import { C as
|
|
5
|
-
import { C as
|
|
1
|
+
import { r as C, c as h, d as a, h as g, H as S, g as m } from "./index-20ea5b0c.js";
|
|
2
|
+
import { N as b, e as f } from "./index.es-be19d2df-c2fdca63.js";
|
|
3
|
+
import { C as A, a as p, H as v, N as P, b as _, c as N, d as w } from "./mailbox-store-76540d24-dfb53045.js";
|
|
4
|
+
import { C as x, N as I } from "./scheduler-store-8ca9003d-8da2c12d.js";
|
|
5
|
+
import { C as M } from "./scheduler-config-store-ec3b6190-fa81c492.js";
|
|
6
6
|
import "react";
|
|
7
7
|
import "react-dom";
|
|
8
|
-
class
|
|
9
|
-
constructor(e, s, r,
|
|
10
|
-
this.router = e, this.schedulerAPIURL =
|
|
8
|
+
class E {
|
|
9
|
+
constructor(e, s, r, o, l, n, i = "https://api.us.nylas.com") {
|
|
10
|
+
this.router = e, this.schedulerAPIURL = i, this.nylasAuth = s, this.nylasAuthStore = r, this.nylasMailboxStore = o, this.nylasSchedulerStore = l, this.nylasSchedulerConfigStore = n;
|
|
11
11
|
}
|
|
12
12
|
init() {
|
|
13
13
|
a("NylasConnector init");
|
|
@@ -21,20 +21,23 @@ class x {
|
|
|
21
21
|
get schedulerStore() {
|
|
22
22
|
return this.nylasSchedulerStore;
|
|
23
23
|
}
|
|
24
|
+
get schedulerConfigStore() {
|
|
25
|
+
return this.nylasSchedulerConfigStore;
|
|
26
|
+
}
|
|
24
27
|
get auth() {
|
|
25
|
-
return this._authConnector ? this._authConnector : (this._authConnector = new
|
|
28
|
+
return this._authConnector ? this._authConnector : (this._authConnector = new P(this.nylasAuth, this.nylasAuthStore), this._authConnector);
|
|
26
29
|
}
|
|
27
30
|
get threads() {
|
|
28
|
-
return this._threadConnector ? this._threadConnector : (this._threadConnector = new
|
|
31
|
+
return this._threadConnector ? this._threadConnector : (this._threadConnector = new _(this.nylasAuth, this.nylasAuthStore, this.nylasMailboxStore, this.router), this._threadConnector);
|
|
29
32
|
}
|
|
30
33
|
get messages() {
|
|
31
|
-
return this._messageConnector ? this._messageConnector : (this._messageConnector = new
|
|
34
|
+
return this._messageConnector ? this._messageConnector : (this._messageConnector = new N(this.nylasAuth, this.nylasAuthStore, this.nylasMailboxStore), this._messageConnector);
|
|
32
35
|
}
|
|
33
36
|
get folders() {
|
|
34
|
-
return this._foldersConnector ? this._foldersConnector : (this._foldersConnector = new
|
|
37
|
+
return this._foldersConnector ? this._foldersConnector : (this._foldersConnector = new w(this.nylasAuth, this.nylasAuthStore, this.nylasMailboxStore), this._foldersConnector);
|
|
35
38
|
}
|
|
36
39
|
get scheduler() {
|
|
37
|
-
return this._schedulerAPIConnector ? this._schedulerAPIConnector : (this._schedulerAPIConnector = new
|
|
40
|
+
return this._schedulerAPIConnector ? this._schedulerAPIConnector : (this._schedulerAPIConnector = new I({
|
|
38
41
|
schedulerAPIURL: this.schedulerAPIURL,
|
|
39
42
|
schedulerStore: this.schedulerStore
|
|
40
43
|
}), this._schedulerAPIConnector);
|
|
@@ -49,9 +52,9 @@ class x {
|
|
|
49
52
|
await this.nylasAuth.logout(), this.resetStores();
|
|
50
53
|
}
|
|
51
54
|
}
|
|
52
|
-
const
|
|
55
|
+
const L = ":host{display:contents}", R = L, T = class {
|
|
53
56
|
constructor(t) {
|
|
54
|
-
|
|
57
|
+
C(this, t), this.init = h(this, "init", 7), this.loggedIn = h(this, "loggedIn", 7), this.loggedOut = h(this, "loggedOut", 7), this.handleAuthChange = async (e) => {
|
|
55
58
|
e ? this.loggedIn.emit(this.host) : this.loggedOut.emit(this.host);
|
|
56
59
|
}, this.authConfig = void 0, this.eventOverrides = {}, this.automaticComponentRegistration = !0;
|
|
57
60
|
}
|
|
@@ -59,14 +62,15 @@ const I = ":host{display:contents}", M = I, L = class {
|
|
|
59
62
|
a("[nylas-provider] connectedCallback");
|
|
60
63
|
}
|
|
61
64
|
async componentWillLoad() {
|
|
62
|
-
var
|
|
65
|
+
var n, i, c, d, u, y;
|
|
63
66
|
a("[nylas-provider] componentWillLoad"), this.stores = {
|
|
64
67
|
auth: A(),
|
|
65
|
-
mailbox:
|
|
66
|
-
scheduler:
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
68
|
+
mailbox: p(),
|
|
69
|
+
scheduler: x(),
|
|
70
|
+
schedulerConfig: M()
|
|
71
|
+
}, this.baseProvider = new b(this.host, this.stores, this.automaticComponentRegistration, this.eventOverrides);
|
|
72
|
+
const t = new v();
|
|
73
|
+
this.nylasAuth = f({
|
|
70
74
|
apiUri: "https://api.us.nylas.com",
|
|
71
75
|
elementsApiUri: "https://elements.us.nylas.com",
|
|
72
76
|
storageType: "indexeddb",
|
|
@@ -75,16 +79,19 @@ const I = ":host{display:contents}", M = I, L = class {
|
|
|
75
79
|
redirectURI: "/",
|
|
76
80
|
...this.authConfig
|
|
77
81
|
});
|
|
78
|
-
const e = (
|
|
82
|
+
const e = (n = this.baseProvider) == null ? void 0 : n.getStore("mailbox");
|
|
79
83
|
if (!e)
|
|
80
84
|
throw new Error("The mailbox store is not set");
|
|
81
|
-
const s = (
|
|
85
|
+
const s = (i = this.baseProvider) == null ? void 0 : i.getStore("auth");
|
|
82
86
|
if (!s)
|
|
83
87
|
throw new Error("The auth store is not set");
|
|
84
|
-
const r = (
|
|
88
|
+
const r = (c = this.baseProvider) == null ? void 0 : c.getStore("scheduler");
|
|
85
89
|
if (!r)
|
|
86
90
|
throw new Error("The scheduler store is not set");
|
|
87
|
-
|
|
91
|
+
const o = (d = this.baseProvider) == null ? void 0 : d.getStore("schedulerConfig");
|
|
92
|
+
if (!o)
|
|
93
|
+
throw new Error("The scheduler config store is not set");
|
|
94
|
+
this.nylasConnector = new E(t, this.nylasAuth, s, e, r, o), this.init.emit(this.host).defaultPrevented || await ((u = this.nylasConnector) == null ? void 0 : u.auth.validateSession()), this.handleAuthChange(s.state.isAuthenticated), (y = this.baseProvider) == null || y.componentWillLoad(this.nylasConnector);
|
|
88
95
|
}
|
|
89
96
|
componentDidLoad() {
|
|
90
97
|
var e, s;
|
|
@@ -121,14 +128,18 @@ const I = ":host{display:contents}", M = I, L = class {
|
|
|
121
128
|
var t;
|
|
122
129
|
return (t = this.baseProvider) == null ? void 0 : t.getStore("scheduler");
|
|
123
130
|
}
|
|
131
|
+
async getNylasSchedulerConfigStore() {
|
|
132
|
+
var t;
|
|
133
|
+
return (t = this.baseProvider) == null ? void 0 : t.getStore("schedulerConfig");
|
|
134
|
+
}
|
|
124
135
|
render() {
|
|
125
|
-
return
|
|
136
|
+
return g(S, { key: "782d47608825fb870d87153c8d43d778dc6c2b87" }, g("slot", { key: "2b01537d9d4a0cf4c81ad0b77ce3e6d761f3e1db" }));
|
|
126
137
|
}
|
|
127
138
|
get host() {
|
|
128
|
-
return
|
|
139
|
+
return m(this);
|
|
129
140
|
}
|
|
130
141
|
};
|
|
131
|
-
|
|
142
|
+
T.style = R;
|
|
132
143
|
export {
|
|
133
|
-
|
|
144
|
+
T as nylas_provider
|
|
134
145
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index-33f74306.cjs"),g=require("./index.es-be19d2df-f732308a.cjs"),o=require("./mailbox-store-76540d24-7bf14e45.cjs"),S=require("./scheduler-store-8ca9003d-57b3f7a7.cjs"),b=require("./scheduler-config-store-ec3b6190-8bde49c6.cjs");require("react");require("react-dom");class f{constructor(t,r,n,i,l,h,a="https://api.us.nylas.com"){this.router=t,this.schedulerAPIURL=a,this.nylasAuth=r,this.nylasAuthStore=n,this.nylasMailboxStore=i,this.nylasSchedulerStore=l,this.nylasSchedulerConfigStore=h}init(){s.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 o.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 S.NylaSchedulerAPIConnector({schedulerAPIURL:this.schedulerAPIURL,schedulerStore:this.schedulerStore}),this._schedulerAPIConnector)}getAuth(){return this.nylasAuth}resetStores(){this.nylasAuthStore.reset(),this.nylasMailboxStore.reset()}async logout(){await this.nylasAuth.logout(),this.resetStores()}}const m=":host{display:contents}",A=m,C=class{constructor(e){s.registerInstance(this,e),this.init=s.createEvent(this,"init",7),this.loggedIn=s.createEvent(this,"loggedIn",7),this.loggedOut=s.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(){s.debug("[nylas-provider] connectedCallback")}async componentWillLoad(){var h,a,c,u,d,y;s.debug("[nylas-provider] componentWillLoad"),this.stores={auth:o.CreateNylasAuthStore(),mailbox:o.CreateNylasMailboxStore(),scheduler:S.CreateNylasSchedulerStore(),schedulerConfig:b.CreateNylasSchedulerConfigStore()},this.baseProvider=new g.NylasBaseProvider(this.host,this.stores,this.automaticComponentRegistration,this.eventOverrides);const e=new o.HashRouter;this.nylasAuth=g.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 r=(a=this.baseProvider)==null?void 0:a.getStore("auth");if(!r)throw new Error("The auth store is not set");const n=(c=this.baseProvider)==null?void 0:c.getStore("scheduler");if(!n)throw new Error("The scheduler store is not set");const i=(u=this.baseProvider)==null?void 0:u.getStore("schedulerConfig");if(!i)throw new Error("The scheduler config store is not set");this.nylasConnector=new f(e,this.nylasAuth,r,t,n,i),this.init.emit(this.host).defaultPrevented||await((d=this.nylasConnector)==null?void 0:d.auth.validateSession()),this.handleAuthChange(r.state.isAuthenticated),(y=this.baseProvider)==null||y.componentWillLoad(this.nylasConnector)}componentDidLoad(){var t,r;const e=(t=this.baseProvider)==null?void 0:t.getStore("auth");e==null||e.onChange("isAuthenticated",this.handleAuthChange),(r=this.baseProvider)==null||r.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 s.h(s.Host,{key:"782d47608825fb870d87153c8d43d778dc6c2b87"},s.h("slot",{key:"2b01537d9d4a0cf4c81ad0b77ce3e6d761f3e1db"}))}get host(){return s.getElement(this)}};C.style=A;exports.nylas_provider=C;
|