@nylas/react 1.1.0-canary.5 → 1.1.0-canary.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/add-circle-icon_22.entry-080abc71.cjs +1 -0
- package/dist/{add-circle-icon_22.entry-9f634efd.js → add-circle-icon_22.entry-bda9be31.js} +619 -532
- package/dist/{archive-icon_7.entry-6649ed76.cjs → archive-icon_7.entry-ca20da59.cjs} +1 -1
- package/dist/{archive-icon_7.entry-24bac466.js → archive-icon_7.entry-e2954750.js} +21 -21
- package/dist/arrow-icon.entry-03a85113.js +15 -0
- package/dist/{arrow-icon.entry-1fffd526.cjs → arrow-icon.entry-548b027e.cjs} +1 -1
- package/dist/{bold-icon_3.entry-72e585da.js → bold-icon_3.entry-70ffa7f0.js} +4 -4
- package/dist/{bold-icon_3.entry-5a01fecf.cjs → bold-icon_3.entry-9a7b1869.cjs} +1 -1
- package/dist/{calendar-cancel-icon.entry-0b52bdc9.cjs → calendar-cancel-icon.entry-45388fdc.cjs} +1 -1
- package/dist/{calendar-cancel-icon.entry-247b530c.js → calendar-cancel-icon.entry-6bbc119f.js} +5 -5
- package/dist/{calendar-check-icon_2.entry-d7bb76c7.cjs → calendar-check-icon_2.entry-6628456c.cjs} +1 -1
- package/dist/{calendar-check-icon_2.entry-dbb2df49.js → calendar-check-icon_2.entry-f633f7a6.js} +10 -10
- package/dist/{calendar-icon.entry-911773c4.cjs → calendar-icon.entry-379b1fa1.cjs} +1 -1
- package/dist/{calendar-icon.entry-d64cb3d3.js → calendar-icon.entry-62b82c27.js} +5 -5
- package/dist/{chevron-icon_3.entry-db9f8217.js → chevron-icon_3.entry-74425e1f.js} +11 -11
- package/dist/{chevron-icon_3.entry-b72f4cdb.cjs → chevron-icon_3.entry-7ff803ad.cjs} +1 -1
- package/dist/close-icon.entry-18e140ed.cjs +1 -0
- package/dist/close-icon.entry-6a8ea4a7.js +15 -0
- package/dist/{constants-6ee60d6d-d5928e79.js → constants-f34b9c6e-95a17764.js} +10 -1
- package/dist/{constants-6ee60d6d-09ee73d9.cjs → constants-f34b9c6e-e7137e51.cjs} +2 -2
- package/dist/{document-refresh-icon.entry-ee9632d7.js → document-refresh-icon.entry-32c75418.js} +2 -2
- package/dist/{document-refresh-icon.entry-5e8cc2f0.cjs → document-refresh-icon.entry-f15f795a.cjs} +1 -1
- package/dist/{elements-dc5b338e-29ef67ec.cjs → elements-dc5b338e-1f23530f.cjs} +1 -1
- package/dist/{elements-dc5b338e-e87f79b6.js → elements-dc5b338e-62fe1cf3.js} +1 -1
- package/dist/{focus-visible-e8093c16-e7357f74.js → focus-visible-e8093c16-1f664070.js} +1 -1
- package/dist/{focus-visible-e8093c16-61d506d2.cjs → focus-visible-e8093c16-f0f05815.cjs} +1 -1
- package/dist/{forward-icon_6.entry-f054ad9d.js → forward-icon_6.entry-7fab04d7.js} +9 -9
- package/dist/{forward-icon_6.entry-cac8473a.cjs → forward-icon_6.entry-ef5e2e0f.cjs} +2 -2
- package/dist/{globe-icon.entry-bc484551.cjs → globe-icon.entry-398a9826.cjs} +1 -1
- package/dist/{globe-icon.entry-2fde6ac4.js → globe-icon.entry-b8e1efae.js} +4 -4
- package/dist/google-logo-icon_4.entry-38d5c2f2.cjs +1 -0
- package/dist/google-logo-icon_4.entry-5eca9538.js +381 -0
- package/dist/{index-22f7e49c.cjs → index-93c50de4.cjs} +11 -11
- package/dist/{index-f9ba9aa8.js → index-f93f6948.js} +890 -855
- package/dist/{index.es-f57e612a-1d17c676.js → index.es-df564f87-b773d34f.js} +1 -1
- package/dist/{index.es-f57e612a-95ca3e17.cjs → index.es-df564f87-e4a4092a.cjs} +1 -1
- package/dist/{info-icon_2.entry-e67844eb.cjs → info-icon_2.entry-2eb70f49.cjs} +1 -1
- package/dist/{info-icon_2.entry-dbf3931a.js → info-icon_2.entry-6bbfa6dc.js} +5 -5
- package/dist/loading-icon.entry-b563b2e6.js +15 -0
- package/dist/loading-icon.entry-fb04b893.cjs +1 -0
- package/dist/{mailbox-store-47fc8a1a-cd3516a7.cjs → mailbox-store-69c5c5f6-631eddb5.cjs} +1 -1
- package/dist/{mailbox-store-47fc8a1a-2365f20f.js → mailbox-store-69c5c5f6-8ab4670b.js} +2 -2
- package/dist/{nylas-additional-participants.entry-7c568149.cjs → nylas-additional-participants.entry-33a45477.cjs} +1 -1
- package/dist/{nylas-additional-participants.entry-e8426256.js → nylas-additional-participants.entry-4b214308.js} +9 -9
- package/dist/{nylas-booked-event-card_10.entry-6a664889.cjs → nylas-booked-event-card_10.entry-3e225025.cjs} +1 -1
- package/dist/{nylas-booked-event-card_10.entry-ef767733.js → nylas-booked-event-card_10.entry-e93bc290.js} +7 -7
- package/dist/{nylas-form-card.entry-d8506b1f.js → nylas-form-card.entry-0748fdd5.js} +16 -16
- package/dist/{nylas-form-card.entry-e44169b6.cjs → nylas-form-card.entry-eb3607bc.cjs} +1 -1
- package/dist/{nylas-if-state.entry-044c49d2.cjs → nylas-if-state.entry-276d61ad.cjs} +1 -1
- package/dist/{nylas-if-state.entry-98a336df.js → nylas-if-state.entry-f8abd025.js} +2 -2
- package/dist/{nylas-list-folders.entry-55ce3403.js → nylas-list-folders.entry-78cc680e.js} +3 -3
- package/dist/{nylas-list-folders.entry-509f9be4.cjs → nylas-list-folders.entry-afe02f0e.cjs} +1 -1
- package/dist/{nylas-list-threads.entry-1f57382a.js → nylas-list-threads.entry-217088de.js} +4 -4
- package/dist/{nylas-list-threads.entry-c36e2cf3.cjs → nylas-list-threads.entry-6395c12f.cjs} +1 -1
- package/dist/{nylas-login.entry-76358c2f.js → nylas-login.entry-e4d57589.js} +7 -7
- package/dist/{nylas-login.entry-66f542b8.cjs → nylas-login.entry-ec81e21b.cjs} +1 -1
- package/dist/{nylas-mailbox-pagination.entry-5562257a.js → nylas-mailbox-pagination.entry-069673aa.js} +2 -2
- package/dist/{nylas-mailbox-pagination.entry-89b0dd99.cjs → nylas-mailbox-pagination.entry-d4d929f1.cjs} +1 -1
- package/dist/{nylas-mailbox-toolbar-button.entry-6b1b5b15.js → nylas-mailbox-toolbar-button.entry-03c5f5c8.js} +8 -8
- package/dist/{nylas-mailbox-toolbar-button.entry-573e0429.cjs → nylas-mailbox-toolbar-button.entry-2b9e4431.cjs} +1 -1
- package/dist/{nylas-mailbox.entry-e21a2f50.cjs → nylas-mailbox.entry-1342178d.cjs} +1 -1
- package/dist/{nylas-mailbox.entry-97c503f2.js → nylas-mailbox.entry-7e6b4791.js} +4 -4
- package/dist/{nylas-provider.entry-61899957.cjs → nylas-provider.entry-0ae8e70a.cjs} +1 -1
- package/dist/{nylas-provider.entry-07e1e26a.js → nylas-provider.entry-498a7be9.js} +16 -16
- package/dist/{nylas-scheduler-editor.entry-e326c9de.js → nylas-scheduler-editor.entry-4de2bb97.js} +66 -66
- package/dist/{nylas-scheduler-editor.entry-60fe38ce.cjs → nylas-scheduler-editor.entry-72c91b7d.cjs} +3 -3
- package/dist/{nylas-scheduling.entry-d88289db.cjs → nylas-scheduling.entry-1a004916.cjs} +1 -1
- package/dist/{nylas-scheduling.entry-be0cc090.js → nylas-scheduling.entry-4e18ab43.js} +3 -3
- package/dist/{nylas-threads-refresh.entry-c71ee775.cjs → nylas-threads-refresh.entry-d020c89e.cjs} +1 -1
- package/dist/{nylas-threads-refresh.entry-8201f8dd.js → nylas-threads-refresh.entry-fc2d8028.js} +11 -11
- package/dist/{nylas-threads-search.entry-912a90a4.cjs → nylas-threads-search.entry-0abcbc10.cjs} +1 -1
- package/dist/{nylas-threads-search.entry-fc477e01.js → nylas-threads-search.entry-f92f7e30.js} +12 -12
- package/dist/{nylas-view-thread.entry-d2953ea8.js → nylas-view-thread.entry-2f1474cf.js} +6 -6
- package/dist/{nylas-view-thread.entry-af418ddb.cjs → nylas-view-thread.entry-56080c89.cjs} +1 -1
- package/dist/{people-icon.entry-73cfa6f5.cjs → people-icon.entry-431e5044.cjs} +1 -1
- package/dist/{people-icon.entry-4b598fde.js → people-icon.entry-b4778e15.js} +7 -7
- package/dist/{play-icon_2.entry-d1c2f823.js → play-icon_2.entry-24ffa01f.js} +8 -8
- package/dist/play-icon_2.entry-f97db395.cjs +1 -0
- package/dist/react.cjs +1 -1
- package/dist/react.js +11 -11
- package/dist/{refresh-icon.entry-6aedfce6.js → refresh-icon.entry-8395104b.js} +4 -4
- package/dist/{refresh-icon.entry-42d543d0.cjs → refresh-icon.entry-cf4416b8.cjs} +1 -1
- package/dist/{register-component-cf5c8420-dc1bc0a4.js → register-component-b9cfcbaf-c0147194.js} +1 -1
- package/dist/{register-component-cf5c8420-d3fb6bf9.cjs → register-component-b9cfcbaf-d40e1f3c.cjs} +1 -1
- package/dist/scheduler-config-store-07d98279-0610e42f.cjs +1 -0
- package/dist/scheduler-config-store-07d98279-3b70606c.js +24 -0
- package/dist/scheduler-store-24fd0e91-2dba20c2.cjs +1 -0
- package/dist/{scheduler-store-39d37291-4e8e9ff9.js → scheduler-store-24fd0e91-47098841.js} +89 -80
- package/dist/{time-period-selector.entry-f1e27a00.js → time-period-selector.entry-1e849c2e.js} +2 -2
- package/dist/{time-period-selector.entry-fb3d0178.cjs → time-period-selector.entry-d8f3462f.cjs} +1 -1
- package/dist/{translate-icon.entry-0d44b6cb.cjs → translate-icon.entry-66533238.cjs} +1 -1
- package/dist/{translate-icon.entry-3db947f5.js → translate-icon.entry-d847f706.js} +5 -5
- package/dist/{warning-icon.entry-a20657e4.cjs → warning-icon.entry-1f0f00ed.cjs} +1 -1
- package/dist/warning-icon.entry-b5db0151.js +15 -0
- package/package.json +3 -3
- package/dist/add-circle-icon_22.entry-e7ec6c34.cjs +0 -1
- package/dist/arrow-icon.entry-82e59ce4.js +0 -15
- package/dist/close-icon.entry-9d141bb4.js +0 -15
- package/dist/close-icon.entry-da590fa2.cjs +0 -1
- package/dist/google-logo-icon_4.entry-a9848399.cjs +0 -1
- package/dist/google-logo-icon_4.entry-dca87e45.js +0 -349
- package/dist/loading-icon.entry-4566cba8.cjs +0 -1
- package/dist/loading-icon.entry-ae4c2d7e.js +0 -15
- package/dist/play-icon_2.entry-1a487abb.cjs +0 -1
- package/dist/scheduler-config-store-6222c0ed-000f1a4f.js +0 -18
- package/dist/scheduler-config-store-6222c0ed-758621fb.cjs +0 -1
- package/dist/scheduler-store-39d37291-b66c052c.cjs +0 -1
- package/dist/warning-icon.entry-a8ea0fe0.js +0 -15
package/dist/{nylas-threads-search.entry-fc477e01.js → nylas-threads-search.entry-f92f7e30.js}
RENAMED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { r as u, c as y, d
|
|
2
|
-
import { R as
|
|
1
|
+
import { r as u, c as y, d, h as i, H as f } from "./index-f93f6948.js";
|
|
2
|
+
import { R as p } from "./register-component-b9cfcbaf-c0147194.js";
|
|
3
3
|
import "react";
|
|
4
4
|
import "react-dom";
|
|
5
|
-
const
|
|
5
|
+
const m = ":host{display:block}sp-search{width:100%;border:0}", b = m;
|
|
6
6
|
var g = function(t, e, n, r) {
|
|
7
7
|
var s = arguments.length, a = s < 3 ? e : r === null ? r = Object.getOwnPropertyDescriptor(e, n) : r, o;
|
|
8
8
|
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
@@ -11,7 +11,7 @@ var g = function(t, e, n, r) {
|
|
|
11
11
|
for (var c = t.length - 1; c >= 0; c--)
|
|
12
12
|
(o = t[c]) && (a = (s < 3 ? o(a) : s > 3 ? o(e, n, a) : o(e, n)) || a);
|
|
13
13
|
return s > 3 && a && Object.defineProperty(e, n, a), a;
|
|
14
|
-
},
|
|
14
|
+
}, l = function(t, e) {
|
|
15
15
|
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
16
16
|
return Reflect.metadata(t, e);
|
|
17
17
|
};
|
|
@@ -28,16 +28,16 @@ const h = class {
|
|
|
28
28
|
disconnectedCallback() {
|
|
29
29
|
}
|
|
30
30
|
async componentWillLoad() {
|
|
31
|
-
|
|
31
|
+
d("[nylas-threads-search] Component will load");
|
|
32
32
|
}
|
|
33
33
|
async componentDidLoad() {
|
|
34
|
-
|
|
34
|
+
d("[nylas-threads-search] Component did load");
|
|
35
35
|
}
|
|
36
36
|
onQueryChange() {
|
|
37
37
|
this.internalQuery = this.query;
|
|
38
38
|
}
|
|
39
39
|
render() {
|
|
40
|
-
return i(
|
|
40
|
+
return i(f, { key: "9e91a330bea4dc84fa96070591e95926f52ee0bb" }, i("sp-theme", { key: "6d1df81ced09a5b721d8f161e40450633ae2cd98", scale: "medium", color: "dark" }, i("sp-search", { key: "cb81bba4b4f1d279f1fd48bda9a2fb003cb65fcd", quiet: !0, onSubmit: this.onSearch, onBlur: this.onSearch, value: this.internalQuery })));
|
|
41
41
|
}
|
|
42
42
|
static get watchers() {
|
|
43
43
|
return {
|
|
@@ -46,7 +46,7 @@ const h = class {
|
|
|
46
46
|
}
|
|
47
47
|
};
|
|
48
48
|
g([
|
|
49
|
-
|
|
49
|
+
p({
|
|
50
50
|
name: "nylas-pagination",
|
|
51
51
|
stateToProps: /* @__PURE__ */ new Map([["mailbox.searchQuery", "query"]]),
|
|
52
52
|
eventToProps: {
|
|
@@ -59,11 +59,11 @@ g([
|
|
|
59
59
|
},
|
|
60
60
|
fireRegisterEvent: !0
|
|
61
61
|
}),
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
62
|
+
l("design:type", Function),
|
|
63
|
+
l("design:paramtypes", []),
|
|
64
|
+
l("design:returntype", void 0)
|
|
65
65
|
], h.prototype, "render", null);
|
|
66
|
-
h.style =
|
|
66
|
+
h.style = b;
|
|
67
67
|
export {
|
|
68
68
|
h as nylas_threads_search
|
|
69
69
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { r as k, c as p, d, h as a, t as M, F as m, H as x, g as E, l as D, a as S, m as g } from "./index-
|
|
2
|
-
import { R as T } from "./register-component-
|
|
1
|
+
import { r as k, c as p, d, h as a, t as M, F as m, H as x, g as E, l as D, a as S, m as g } from "./index-f93f6948.js";
|
|
2
|
+
import { R as T } from "./register-component-b9cfcbaf-c0147194.js";
|
|
3
3
|
import "react";
|
|
4
4
|
import "react-dom";
|
|
5
5
|
function R(t, e, s, o, r) {
|
|
@@ -10,7 +10,7 @@ function R(t, e, s, o, r) {
|
|
|
10
10
|
n.message = t.data, n.parent = r, s.appendChild(n);
|
|
11
11
|
}
|
|
12
12
|
const u = ({ viewEmailElement: t, message: e, attachments: s, onMessageClick: o, onShowContactDataClick: r, parent: n }) => {
|
|
13
|
-
var l, i, c, v,
|
|
13
|
+
var l, i, c, v, f, w, b;
|
|
14
14
|
return a(
|
|
15
15
|
m,
|
|
16
16
|
null,
|
|
@@ -26,7 +26,7 @@ const u = ({ viewEmailElement: t, message: e, attachments: s, onMessageClick: o,
|
|
|
26
26
|
{ class: "from" },
|
|
27
27
|
a("span", { class: "name" }, e.data.from && ((v = e.data.from[0]) == null ? void 0 : v.name)),
|
|
28
28
|
" ",
|
|
29
|
-
a("span", { class: "email" }, e.data.from && ((
|
|
29
|
+
a("span", { class: "email" }, e.data.from && ((f = e.data.from[0]) == null ? void 0 : f.email))
|
|
30
30
|
),
|
|
31
31
|
a(
|
|
32
32
|
"div",
|
|
@@ -66,7 +66,7 @@ const u = ({ viewEmailElement: t, message: e, attachments: s, onMessageClick: o,
|
|
|
66
66
|
"div",
|
|
67
67
|
{ class: "address-info" },
|
|
68
68
|
a("div", { class: "label" }, "From"),
|
|
69
|
-
a("div", { class: "value" }, g((
|
|
69
|
+
a("div", { class: "value" }, g((w = e.data) != null && w.from ? (b = e == null ? void 0 : e.data) == null ? void 0 : b.from[0] : { name: "", email: "" })),
|
|
70
70
|
e.data.to && a(
|
|
71
71
|
m,
|
|
72
72
|
null,
|
|
@@ -162,7 +162,7 @@ const C = class {
|
|
|
162
162
|
render() {
|
|
163
163
|
var r, n, l;
|
|
164
164
|
const t = this.internalMessages.length > 2 ? this.internalMessages[0] : null, e = this.internalMessages.slice(this.internalMessages.length - 2, this.internalMessages.length), s = this.internalMessages.slice(1, this.internalMessages.length - 2), o = this.internalMessages[this.internalMessages.length - 1];
|
|
165
|
-
return a(x, { key: "
|
|
165
|
+
return a(x, { key: "08d6981bb00f24f18212060a784da5ec7129197e" }, a("sp-theme", { key: "0f7f54486f61beb490fc96a0f84753868ef384aa", scale: "medium", color: "dark" }, a("div", { key: "9aad086eae2344a6d0d28b1fb4fb39921dcf53f0", class: "view-thread" }, a("div", { key: "fcef6cd0bfed78b7d6f9df5a2a8719a32b1e294f", class: "header" }, a("div", { key: "0673aebc8626e082deb3f0a9b9eb9c18a1841349", class: "subject" }, (r = this.thread) == null ? void 0 : r.subject), a("div", { key: "10ee64da01595dcb658f99b9a8d90c1fe9237816", class: "folders" }, (l = (n = this.thread) == null ? void 0 : n.folders) == null ? void 0 : l.map((i) => a("sp-tag", { size: "s" }, M(i.replace("CATEGORY_", "").replace("_", " ")))))), a("div", { key: "469007a98202e151206e4ac329956882f069b618", class: "messages" }, t && a(u, { message: t, attachments: this.attachments.filter((i) => i.messageId === t.id), onMessageClick: this.onMessageClick, onShowContactDataClick: this.onShowContactDataClick, parent: this.host, viewEmailElement: this.nylasViewEmailElement, composerElement: this.nylasComposerElement }), s.length > 0 && this.messages.length > 1 && !this.showAllEmails && e.length > 0 && a(m, null, a("div", { class: "show-more" }, a("button", { type: "button", onClick: this.onShowAllEmailsClick }, a("span", { class: "avatar" }, s.length), " ", a("span", { class: "sr-only" }, "Show ", s.length, " more emails"))), a("hr", null)), s.length > 0 && this.showAllEmails && this.messages.length > 2 && s.map((i) => a(u, { message: i, attachments: this.attachments.filter((c) => c.messageId === (t == null ? void 0 : t.id)), onMessageClick: this.onMessageClick, onShowContactDataClick: this.onShowContactDataClick, parent: this.host, viewEmailElement: this.nylasViewEmailElement, composerElement: this.nylasComposerElement })), e.length > 0 && e.map((i) => a(u, { message: i, attachments: this.attachments.filter((c) => c.messageId === (t == null ? void 0 : t.id)), onMessageClick: this.onMessageClick, onShowContactDataClick: this.onShowContactDataClick, parent: this.host, viewEmailElement: this.nylasViewEmailElement, composerElement: this.nylasComposerElement }))), !(this.showComposer && o) && a("div", { class: "reply-buttons" }, a("sp-button", { variant: "cta", type: "button", onClick: this.showComposerClick }, a("span", { slot: "icon" }, a("reply-icon", null)), a("span", null, "Reply")), a("sp-button", { variant: "cta", type: "button" }, a("span", { slot: "icon" }, a("reply-all-icon", null)), a("span", null, "Reply All")), a("sp-button", { variant: "cta", type: "button" }, a("span", { slot: "icon" }, a("forward-icon", null)), a("span", null, "Forward"))), this.showComposer && o && a("div", { class: "composer" }, a("nylas-composer", { message: o.data, onClose: this.showComposerClick, onSend: (i) => {
|
|
166
166
|
d("[nylas-view-thread] Send event", { message: i.detail.message, replyBody: i.detail.replyBody });
|
|
167
167
|
} })))));
|
|
168
168
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-22f7e49c.cjs"),w=require("./register-component-cf5c8420-d3fb6bf9.cjs");require("react");require("react-dom");function f(t,a,s,o,r){if(!o||!s||s.children.length>0)return;e.debug("[nylas-view-thread] Rendering email",{message:t,attachments:a,viewEmailElement:o});const n=o.cloneNode(!0);n.message=t.data,n.parent=r,s.appendChild(n)}const c=({viewEmailElement:t,message:a,attachments:s,onMessageClick:o,onShowContactDataClick:r,parent:n})=>{var l,i,d,g,u,v,y;return e.h(e.Fragment,null,e.h("div",{key:a.id,class:"message"},e.h("div",{class:"sub-header","data-id":a.data.id,onClick:o},e.h("div",{class:"avatar"},a.data.from&&((l=a.data.from[0])==null?void 0:l.name)&&((d=(i=a.data.from[0])==null?void 0:i.name[0])==null?void 0:d.toUpperCase())),e.h("div",{class:"from"},e.h("span",{class:"name"},a.data.from&&((g=a.data.from[0])==null?void 0:g.name))," ",e.h("span",{class:"email"},a.data.from&&((u=a.data.from[0])==null?void 0:u.email))),e.h("div",{class:"date"},new Date(a.data.date*1e3).toLocaleTimeString(void 0,{timeStyle:"short"})," ","(",e.formatTimeAgo(new Date(a.data.date*1e3)),")"),e.h("sp-button-group",{class:"buttons"},e.h("nylas-summarize-message-button",{message:a.data})),a.collapse&&e.h("div",{class:"snippet"},a.data.snippet),!a.collapse&&a.data.to&&e.h("div",{class:"to"},e.h("span",null,"to")," ",e.formatParticipants(a.data.to)," ",e.h("button",{type:"button",value:a.data.id,onClick:r,class:{expand:!0,"expand--showContactData":a.showContactData}},e.h("chevron-icon",null)))),a.showContactData&&e.h("div",{class:"address-info"},e.h("div",{class:"label"},"From"),e.h("div",{class:"value"},e.formatRecipient((v=a.data)!=null&&v.from?(y=a==null?void 0:a.data)==null?void 0:y.from[0]:{name:"",email:""})),a.data.to&&e.h(e.Fragment,null,e.h("div",{class:"label"},"To"),e.h("div",{class:"value"},a.data.to.map(h=>e.h("div",null,e.formatRecipient(h))))),typeof a.data.cc<"u"&&a.data.cc.length>0&&e.h(e.Fragment,null,e.h("div",{class:"label"},"CC"),e.h("div",{class:"value"},a.data.cc.map(h=>e.h("div",null,e.formatRecipient(h)))))),!a.collapse&&t&&e.h("div",{key:a.id,ref:h=>f(a,s,h,t,n)}),!a.collapse&&!t&&e.h("nylas-view-email",{key:a.id,message:a.data,parent:n})),e.h("hr",null))},b=':host{display:block;font-size:inherit}.avatar{z-index:1;border-radius:100%;background-color:var(--nylas-color-primary-200);height:40px;width:40px;align-items:center;display:flex;justify-content:center;border:1px solid var(--nylas-color-primary-200)}.view-thread{display:grid;grid-auto-flow:row;width:100%}.view-thread .header{display:grid;grid-gap:1rem;align-items:center;margin-bottom:1rem}.view-thread .header .subject{font-size:1.25rem;font-weight:600;line-height:1.5rem}.view-thread .header .folders{display:grid;grid-auto-flow:column;grid-auto-columns:min-content;overflow-x:auto;gap:1rem}.view-thread .header .folders .folder{padding:0 0.5rem;font-size:0.9rem;color:var(--nylas-color-primary-900);background-color:var(--nylas-color-primary-300)}.view-thread .messages{display:grid;gap:1rem}.view-thread .messages hr{margin:0;width:100%;border:1px solid var(--nylas-color-primary-200)}.view-thread .messages hr:last-of-type{display:none}.view-thread .messages .message{display:grid;grid-auto-flow:row;gap:1rem}.view-thread .messages .message:last-of-type .sub-header{cursor:default}.view-thread .messages .message .sub-header{display:grid;grid-template:"avatar from date buttons" "avatar to to buttons";grid-column-gap:1rem;grid-template-columns:auto 1fr auto auto;cursor:pointer}.view-thread .messages .message .sub-header>*{pointer-events:none}.view-thread .messages .message .sub-header .avatar{grid-area:avatar}.view-thread .messages .message .sub-header .from{grid-area:from}.view-thread .messages .message .sub-header .from span.email{display:none;color:var(--nylas-color-primary-400);font-weight:600}.view-thread .messages .message .sub-header .buttons{grid-area:buttons;align-self:center}.view-thread .messages .message .sub-header .buttons *{pointer-events:all}.view-thread .messages .message .sub-header .date{grid-area:date;align-self:center;color:var(--nylas-color-primary-400)}.view-thread .messages .message .sub-header .snippet{width:90%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--nylas-color-primary-600)}.view-thread .messages .message .sub-header .to{grid-area:to;color:var(--nylas-color-primary-400)}.view-thread .messages .message .sub-header .to>span{color:var(--nylas-color-primary-400)}.view-thread .messages .message .sub-header .to button{border:0;background-color:transparent;cursor:pointer;pointer-events:all;padding:0;margin:0}.view-thread .messages .message .sub-header .to button>*{pointer-events:none}.view-thread .messages .message .sub-header .to button chevron-icon{display:inline-table;fill:var(--nylas-color-primary-400);width:15px;height:15px;vertical-align:middle}.view-thread .messages .message .sub-header .to button chevron-icon svg{width:15px;height:15px;transform:rotate(90deg)}.view-thread .messages .message .sub-header .to button.expand--showContactData chevron-icon svg{transform:rotate(270deg)}.view-thread .messages .message .address-info{display:grid;column-gap:1rem;row-gap:0.5rem;grid-template-columns:auto 1fr;grid-template-rows:1fr;padding:1rem 2rem;border-radius:var(--nylas-border-radius-2x);border:1px solid var(--nylas-color-primary-200);align-items:flex-start;color:var(--nylas-color-primary-600)}.view-thread .messages .message .address-info .label{color:var(--nylas-color-primary-400);font-weight:600}.show-more{position:relative;display:flex;width:100%}.show-more .sr-only{display:none}.show-more button{position:relative;display:inline-flex;width:100%;padding:0;border:0;background-color:transparent;cursor:pointer;text-align:left;overflow:hidden}.show-more button span{border:1px solid var(--nylas-color-primary-400)}.show-more button:hover span{background-color:var(--nylas-color-primary-700)}.show-more button::after{border-top:1px solid rgba(100, 121, 143, 0.122);border-bottom:1px solid rgba(100, 121, 143, 0.122);content:"";height:4px;width:100%;position:absolute;top:50%}.loading{position:absolute;width:100%;height:100%;background-color:var(--loading__background-color);top:0;bottom:0;left:0;z-index:1;display:grid;justify-content:center;align-items:center;font-weight:600;overflow:hidden}.reply-buttons{display:grid;grid-auto-flow:column;grid-auto-columns:min-content;gap:1rem;margin-top:1rem}.reply-buttons 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)}.reply-buttons sp-button:hover{background-color:var(--nylas-color-primary-500)}.reply-buttons sp-button:disabled{background-color:var(--nylas-color-primary-200);color:var(--nylas-color-primary-600);cursor:not-allowed}.reply-buttons sp-button chevron-icon{display:inline-block}@media only screen and (min-width: 768px){.view-thread .messages .message .sub-header .from span.email{display:inline}}',C=b;var k=function(t,a,s,o){var r=arguments.length,n=r<3?a:o===null?o=Object.getOwnPropertyDescriptor(a,s):o,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,a,s,o);else for(var i=t.length-1;i>=0;i--)(l=t[i])&&(n=(r<3?l(n):r>3?l(a,s,n):l(a,s))||n);return r>3&&n&&Object.defineProperty(a,s,n),n},m=function(t,a){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,a)};const p=class{constructor(t){e.registerInstance(this,t),this.threadSelected=e.createEvent(this,"threadSelected",7),this.showContactDataClicked=e.createEvent(this,"showContactDataClicked",7),this.messageClicked=e.createEvent(this,"messageClicked",7),this.nylasViewEmailElement=null,this.nylasComposerElement=null,this.onShowContactDataClick=a=>{a.stopPropagation();const o=a.target.value,r=this.internalMessages.find(l=>l.data.id===o);if(!r){e.debug(`[nylas-view-thread] Could not find message ${o}`);return}this.showContactDataClicked.emit(r.data).defaultPrevented||(r.showContactData=!r.showContactData,this.internalMessages=[...this.internalMessages]),e.debug(`[nylas-view-thread] show contact data clicked ${o} ${r.showContactData?"collapsed":"expanded"}`)},this.onMessageClick=a=>{var l;const o=a.target.dataset.id,r=this.internalMessages.find(i=>i.data.id===o);if(!r){e.debug(`[nylas-view-thread] Could not find message ${o}`);return}this.messageClicked.emit(r.data).defaultPrevented||(r.id!==((l=this.internalMessages[this.internalMessages.length-1])==null?void 0:l.id)&&(r.collapse=!r.collapse,r.collapse&&(r.showContactData=!1)),this.internalMessages=[...this.internalMessages]),e.debug(`[nylas-view-thread] message clicked ${o} ${r.collapse?"collapsed":"expanded"}`)},this.onShowAllEmailsClick=()=>{this.showAllEmails=!this.showAllEmails},this.showComposerClick=()=>{this.showComposer=!this.showComposer},this.draft=void 0,this.thread=void 0,this.messages=[],this.attachments=[],this.state="loading",this.internalMessages=[],this.showAllEmails=!1,this.showComposer=!1}connectedCallback(){}disconnectedCallback(){}async componentWillLoad(){e.debug("[nylas-view-thread] Component will load"),this.updateInternalMessages(this.messages);const t=this.host.querySelector("template.nylas-view-email");if(!t){e.debug("[nylas-view-thread] Could not find template");return}const a=document.importNode(t.content,!0);this.nylasViewEmailElement=a.querySelector("nylas-view-email");const s=this.host.querySelector("template.nylas-composer");if(!s){e.debug("[nylas-view-thread] Could not find composer template");return}const o=document.importNode(s.content,!0);this.nylasComposerElement=o.querySelector("nylas-composer")}async componentDidLoad(){e.debug("[nylas-view-thread] Component did load")}async threadChanged(t){e.debug("[nylas-view-thread] Thread changed",{thread:t}),this.internalMessages=[],this.threadSelected.emit(t).defaultPrevented||e.debug("[nylas-view-thread] Default event not prevented, initializing")}updateInternalMessages(t){e.debug("[nylas-view-thread] Updating internal messages",{messages:t});const a=t.sort((s,o)=>s.date>o.date?1:-1).map((s,o)=>({id:s.id,data:s,collapse:o!==t.length-1,showContactData:!1}));this.internalMessages=a}render(){var r,n,l;const t=this.internalMessages.length>2?this.internalMessages[0]:null,a=this.internalMessages.slice(this.internalMessages.length-2,this.internalMessages.length),s=this.internalMessages.slice(1,this.internalMessages.length-2),o=this.internalMessages[this.internalMessages.length-1];return e.h(e.Host,{key:"b9bcde80e7ee15061bfc217d99bb9422dfbe1d04"},e.h("sp-theme",{key:"965e53796323e3e13983447abb4ac1b3a8651daa",scale:"medium",color:"dark"},e.h("div",{key:"9efc644121efd09a2e837c23f9f8da80589f870b",class:"view-thread"},e.h("div",{key:"c1479929b6679a1b47f03dfe6d5cc1128484b703",class:"header"},e.h("div",{key:"00c6788a461f9f6ca4532fb2acb2bf08e0f0c118",class:"subject"},(r=this.thread)==null?void 0:r.subject),e.h("div",{key:"2e114754a9dd830e4a124cd9079ad4cf725908bd",class:"folders"},(l=(n=this.thread)==null?void 0:n.folders)==null?void 0:l.map(i=>e.h("sp-tag",{size:"s"},e.toTitleCase(i.replace("CATEGORY_","").replace("_"," ")))))),e.h("div",{key:"136d6a314c647991218dfe4090fa97c8d98b210d",class:"messages"},t&&e.h(c,{message:t,attachments:this.attachments.filter(i=>i.messageId===t.id),onMessageClick:this.onMessageClick,onShowContactDataClick:this.onShowContactDataClick,parent:this.host,viewEmailElement:this.nylasViewEmailElement,composerElement:this.nylasComposerElement}),s.length>0&&this.messages.length>1&&!this.showAllEmails&&a.length>0&&e.h(e.Fragment,null,e.h("div",{class:"show-more"},e.h("button",{type:"button",onClick:this.onShowAllEmailsClick},e.h("span",{class:"avatar"},s.length)," ",e.h("span",{class:"sr-only"},"Show ",s.length," more emails"))),e.h("hr",null)),s.length>0&&this.showAllEmails&&this.messages.length>2&&s.map(i=>e.h(c,{message:i,attachments:this.attachments.filter(d=>d.messageId===(t==null?void 0:t.id)),onMessageClick:this.onMessageClick,onShowContactDataClick:this.onShowContactDataClick,parent:this.host,viewEmailElement:this.nylasViewEmailElement,composerElement:this.nylasComposerElement})),a.length>0&&a.map(i=>e.h(c,{message:i,attachments:this.attachments.filter(d=>d.messageId===(t==null?void 0:t.id)),onMessageClick:this.onMessageClick,onShowContactDataClick:this.onShowContactDataClick,parent:this.host,viewEmailElement:this.nylasViewEmailElement,composerElement:this.nylasComposerElement}))),!(this.showComposer&&o)&&e.h("div",{class:"reply-buttons"},e.h("sp-button",{variant:"cta",type:"button",onClick:this.showComposerClick},e.h("span",{slot:"icon"},e.h("reply-icon",null)),e.h("span",null,"Reply")),e.h("sp-button",{variant:"cta",type:"button"},e.h("span",{slot:"icon"},e.h("reply-all-icon",null)),e.h("span",null,"Reply All")),e.h("sp-button",{variant:"cta",type:"button"},e.h("span",{slot:"icon"},e.h("forward-icon",null)),e.h("span",null,"Forward"))),this.showComposer&&o&&e.h("div",{class:"composer"},e.h("nylas-composer",{message:o.data,onClose:this.showComposerClick,onSend:i=>{e.debug("[nylas-view-thread] Send event",{message:i.detail.message,replyBody:i.detail.replyBody})}})))))}get host(){return e.getElement(this)}static get watchers(){return{thread:["threadChanged"],messages:["updateInternalMessages"]}}};k([w.RegisterComponent({name:"nylas-view-thread",stateToProps:new Map([["mailbox.selectedThread","thread"],["mailbox.messages","messages"],["mailbox.state","state"]]),eventToProps:{threadSelected:async(t,a)=>{e.debug("[nylas-view-thread] Nylas init event. Fetching thread messages.",{event:t});const s=t.detail;s&&s.id&&await a.messages.getThreadMessages(s.id)}},fireRegisterEvent:!0}),m("design:type",Function),m("design:paramtypes",[]),m("design:returntype",void 0)],p.prototype,"render",null);p.style=C;exports.nylas_view_thread=p;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-93c50de4.cjs"),f=require("./register-component-b9cfcbaf-d40e1f3c.cjs");require("react");require("react-dom");function w(t,a,s,o,r){if(!o||!s||s.children.length>0)return;e.debug("[nylas-view-thread] Rendering email",{message:t,attachments:a,viewEmailElement:o});const n=o.cloneNode(!0);n.message=t.data,n.parent=r,s.appendChild(n)}const c=({viewEmailElement:t,message:a,attachments:s,onMessageClick:o,onShowContactDataClick:r,parent:n})=>{var l,i,d,g,u,v,y;return e.h(e.Fragment,null,e.h("div",{key:a.id,class:"message"},e.h("div",{class:"sub-header","data-id":a.data.id,onClick:o},e.h("div",{class:"avatar"},a.data.from&&((l=a.data.from[0])==null?void 0:l.name)&&((d=(i=a.data.from[0])==null?void 0:i.name[0])==null?void 0:d.toUpperCase())),e.h("div",{class:"from"},e.h("span",{class:"name"},a.data.from&&((g=a.data.from[0])==null?void 0:g.name))," ",e.h("span",{class:"email"},a.data.from&&((u=a.data.from[0])==null?void 0:u.email))),e.h("div",{class:"date"},new Date(a.data.date*1e3).toLocaleTimeString(void 0,{timeStyle:"short"})," ","(",e.formatTimeAgo(new Date(a.data.date*1e3)),")"),e.h("sp-button-group",{class:"buttons"},e.h("nylas-summarize-message-button",{message:a.data})),a.collapse&&e.h("div",{class:"snippet"},a.data.snippet),!a.collapse&&a.data.to&&e.h("div",{class:"to"},e.h("span",null,"to")," ",e.formatParticipants(a.data.to)," ",e.h("button",{type:"button",value:a.data.id,onClick:r,class:{expand:!0,"expand--showContactData":a.showContactData}},e.h("chevron-icon",null)))),a.showContactData&&e.h("div",{class:"address-info"},e.h("div",{class:"label"},"From"),e.h("div",{class:"value"},e.formatRecipient((v=a.data)!=null&&v.from?(y=a==null?void 0:a.data)==null?void 0:y.from[0]:{name:"",email:""})),a.data.to&&e.h(e.Fragment,null,e.h("div",{class:"label"},"To"),e.h("div",{class:"value"},a.data.to.map(h=>e.h("div",null,e.formatRecipient(h))))),typeof a.data.cc<"u"&&a.data.cc.length>0&&e.h(e.Fragment,null,e.h("div",{class:"label"},"CC"),e.h("div",{class:"value"},a.data.cc.map(h=>e.h("div",null,e.formatRecipient(h)))))),!a.collapse&&t&&e.h("div",{key:a.id,ref:h=>w(a,s,h,t,n)}),!a.collapse&&!t&&e.h("nylas-view-email",{key:a.id,message:a.data,parent:n})),e.h("hr",null))},b=':host{display:block;font-size:inherit}.avatar{z-index:1;border-radius:100%;background-color:var(--nylas-color-primary-200);height:40px;width:40px;align-items:center;display:flex;justify-content:center;border:1px solid var(--nylas-color-primary-200)}.view-thread{display:grid;grid-auto-flow:row;width:100%}.view-thread .header{display:grid;grid-gap:1rem;align-items:center;margin-bottom:1rem}.view-thread .header .subject{font-size:1.25rem;font-weight:600;line-height:1.5rem}.view-thread .header .folders{display:grid;grid-auto-flow:column;grid-auto-columns:min-content;overflow-x:auto;gap:1rem}.view-thread .header .folders .folder{padding:0 0.5rem;font-size:0.9rem;color:var(--nylas-color-primary-900);background-color:var(--nylas-color-primary-300)}.view-thread .messages{display:grid;gap:1rem}.view-thread .messages hr{margin:0;width:100%;border:1px solid var(--nylas-color-primary-200)}.view-thread .messages hr:last-of-type{display:none}.view-thread .messages .message{display:grid;grid-auto-flow:row;gap:1rem}.view-thread .messages .message:last-of-type .sub-header{cursor:default}.view-thread .messages .message .sub-header{display:grid;grid-template:"avatar from date buttons" "avatar to to buttons";grid-column-gap:1rem;grid-template-columns:auto 1fr auto auto;cursor:pointer}.view-thread .messages .message .sub-header>*{pointer-events:none}.view-thread .messages .message .sub-header .avatar{grid-area:avatar}.view-thread .messages .message .sub-header .from{grid-area:from}.view-thread .messages .message .sub-header .from span.email{display:none;color:var(--nylas-color-primary-400);font-weight:600}.view-thread .messages .message .sub-header .buttons{grid-area:buttons;align-self:center}.view-thread .messages .message .sub-header .buttons *{pointer-events:all}.view-thread .messages .message .sub-header .date{grid-area:date;align-self:center;color:var(--nylas-color-primary-400)}.view-thread .messages .message .sub-header .snippet{width:90%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--nylas-color-primary-600)}.view-thread .messages .message .sub-header .to{grid-area:to;color:var(--nylas-color-primary-400)}.view-thread .messages .message .sub-header .to>span{color:var(--nylas-color-primary-400)}.view-thread .messages .message .sub-header .to button{border:0;background-color:transparent;cursor:pointer;pointer-events:all;padding:0;margin:0}.view-thread .messages .message .sub-header .to button>*{pointer-events:none}.view-thread .messages .message .sub-header .to button chevron-icon{display:inline-table;fill:var(--nylas-color-primary-400);width:15px;height:15px;vertical-align:middle}.view-thread .messages .message .sub-header .to button chevron-icon svg{width:15px;height:15px;transform:rotate(90deg)}.view-thread .messages .message .sub-header .to button.expand--showContactData chevron-icon svg{transform:rotate(270deg)}.view-thread .messages .message .address-info{display:grid;column-gap:1rem;row-gap:0.5rem;grid-template-columns:auto 1fr;grid-template-rows:1fr;padding:1rem 2rem;border-radius:var(--nylas-border-radius-2x);border:1px solid var(--nylas-color-primary-200);align-items:flex-start;color:var(--nylas-color-primary-600)}.view-thread .messages .message .address-info .label{color:var(--nylas-color-primary-400);font-weight:600}.show-more{position:relative;display:flex;width:100%}.show-more .sr-only{display:none}.show-more button{position:relative;display:inline-flex;width:100%;padding:0;border:0;background-color:transparent;cursor:pointer;text-align:left;overflow:hidden}.show-more button span{border:1px solid var(--nylas-color-primary-400)}.show-more button:hover span{background-color:var(--nylas-color-primary-700)}.show-more button::after{border-top:1px solid rgba(100, 121, 143, 0.122);border-bottom:1px solid rgba(100, 121, 143, 0.122);content:"";height:4px;width:100%;position:absolute;top:50%}.loading{position:absolute;width:100%;height:100%;background-color:var(--loading__background-color);top:0;bottom:0;left:0;z-index:1;display:grid;justify-content:center;align-items:center;font-weight:600;overflow:hidden}.reply-buttons{display:grid;grid-auto-flow:column;grid-auto-columns:min-content;gap:1rem;margin-top:1rem}.reply-buttons 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)}.reply-buttons sp-button:hover{background-color:var(--nylas-color-primary-500)}.reply-buttons sp-button:disabled{background-color:var(--nylas-color-primary-200);color:var(--nylas-color-primary-600);cursor:not-allowed}.reply-buttons sp-button chevron-icon{display:inline-block}@media only screen and (min-width: 768px){.view-thread .messages .message .sub-header .from span.email{display:inline}}',C=b;var k=function(t,a,s,o){var r=arguments.length,n=r<3?a:o===null?o=Object.getOwnPropertyDescriptor(a,s):o,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,a,s,o);else for(var i=t.length-1;i>=0;i--)(l=t[i])&&(n=(r<3?l(n):r>3?l(a,s,n):l(a,s))||n);return r>3&&n&&Object.defineProperty(a,s,n),n},m=function(t,a){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,a)};const p=class{constructor(t){e.registerInstance(this,t),this.threadSelected=e.createEvent(this,"threadSelected",7),this.showContactDataClicked=e.createEvent(this,"showContactDataClicked",7),this.messageClicked=e.createEvent(this,"messageClicked",7),this.nylasViewEmailElement=null,this.nylasComposerElement=null,this.onShowContactDataClick=a=>{a.stopPropagation();const o=a.target.value,r=this.internalMessages.find(l=>l.data.id===o);if(!r){e.debug(`[nylas-view-thread] Could not find message ${o}`);return}this.showContactDataClicked.emit(r.data).defaultPrevented||(r.showContactData=!r.showContactData,this.internalMessages=[...this.internalMessages]),e.debug(`[nylas-view-thread] show contact data clicked ${o} ${r.showContactData?"collapsed":"expanded"}`)},this.onMessageClick=a=>{var l;const o=a.target.dataset.id,r=this.internalMessages.find(i=>i.data.id===o);if(!r){e.debug(`[nylas-view-thread] Could not find message ${o}`);return}this.messageClicked.emit(r.data).defaultPrevented||(r.id!==((l=this.internalMessages[this.internalMessages.length-1])==null?void 0:l.id)&&(r.collapse=!r.collapse,r.collapse&&(r.showContactData=!1)),this.internalMessages=[...this.internalMessages]),e.debug(`[nylas-view-thread] message clicked ${o} ${r.collapse?"collapsed":"expanded"}`)},this.onShowAllEmailsClick=()=>{this.showAllEmails=!this.showAllEmails},this.showComposerClick=()=>{this.showComposer=!this.showComposer},this.draft=void 0,this.thread=void 0,this.messages=[],this.attachments=[],this.state="loading",this.internalMessages=[],this.showAllEmails=!1,this.showComposer=!1}connectedCallback(){}disconnectedCallback(){}async componentWillLoad(){e.debug("[nylas-view-thread] Component will load"),this.updateInternalMessages(this.messages);const t=this.host.querySelector("template.nylas-view-email");if(!t){e.debug("[nylas-view-thread] Could not find template");return}const a=document.importNode(t.content,!0);this.nylasViewEmailElement=a.querySelector("nylas-view-email");const s=this.host.querySelector("template.nylas-composer");if(!s){e.debug("[nylas-view-thread] Could not find composer template");return}const o=document.importNode(s.content,!0);this.nylasComposerElement=o.querySelector("nylas-composer")}async componentDidLoad(){e.debug("[nylas-view-thread] Component did load")}async threadChanged(t){e.debug("[nylas-view-thread] Thread changed",{thread:t}),this.internalMessages=[],this.threadSelected.emit(t).defaultPrevented||e.debug("[nylas-view-thread] Default event not prevented, initializing")}updateInternalMessages(t){e.debug("[nylas-view-thread] Updating internal messages",{messages:t});const a=t.sort((s,o)=>s.date>o.date?1:-1).map((s,o)=>({id:s.id,data:s,collapse:o!==t.length-1,showContactData:!1}));this.internalMessages=a}render(){var r,n,l;const t=this.internalMessages.length>2?this.internalMessages[0]:null,a=this.internalMessages.slice(this.internalMessages.length-2,this.internalMessages.length),s=this.internalMessages.slice(1,this.internalMessages.length-2),o=this.internalMessages[this.internalMessages.length-1];return e.h(e.Host,{key:"08d6981bb00f24f18212060a784da5ec7129197e"},e.h("sp-theme",{key:"0f7f54486f61beb490fc96a0f84753868ef384aa",scale:"medium",color:"dark"},e.h("div",{key:"9aad086eae2344a6d0d28b1fb4fb39921dcf53f0",class:"view-thread"},e.h("div",{key:"fcef6cd0bfed78b7d6f9df5a2a8719a32b1e294f",class:"header"},e.h("div",{key:"0673aebc8626e082deb3f0a9b9eb9c18a1841349",class:"subject"},(r=this.thread)==null?void 0:r.subject),e.h("div",{key:"10ee64da01595dcb658f99b9a8d90c1fe9237816",class:"folders"},(l=(n=this.thread)==null?void 0:n.folders)==null?void 0:l.map(i=>e.h("sp-tag",{size:"s"},e.toTitleCase(i.replace("CATEGORY_","").replace("_"," ")))))),e.h("div",{key:"469007a98202e151206e4ac329956882f069b618",class:"messages"},t&&e.h(c,{message:t,attachments:this.attachments.filter(i=>i.messageId===t.id),onMessageClick:this.onMessageClick,onShowContactDataClick:this.onShowContactDataClick,parent:this.host,viewEmailElement:this.nylasViewEmailElement,composerElement:this.nylasComposerElement}),s.length>0&&this.messages.length>1&&!this.showAllEmails&&a.length>0&&e.h(e.Fragment,null,e.h("div",{class:"show-more"},e.h("button",{type:"button",onClick:this.onShowAllEmailsClick},e.h("span",{class:"avatar"},s.length)," ",e.h("span",{class:"sr-only"},"Show ",s.length," more emails"))),e.h("hr",null)),s.length>0&&this.showAllEmails&&this.messages.length>2&&s.map(i=>e.h(c,{message:i,attachments:this.attachments.filter(d=>d.messageId===(t==null?void 0:t.id)),onMessageClick:this.onMessageClick,onShowContactDataClick:this.onShowContactDataClick,parent:this.host,viewEmailElement:this.nylasViewEmailElement,composerElement:this.nylasComposerElement})),a.length>0&&a.map(i=>e.h(c,{message:i,attachments:this.attachments.filter(d=>d.messageId===(t==null?void 0:t.id)),onMessageClick:this.onMessageClick,onShowContactDataClick:this.onShowContactDataClick,parent:this.host,viewEmailElement:this.nylasViewEmailElement,composerElement:this.nylasComposerElement}))),!(this.showComposer&&o)&&e.h("div",{class:"reply-buttons"},e.h("sp-button",{variant:"cta",type:"button",onClick:this.showComposerClick},e.h("span",{slot:"icon"},e.h("reply-icon",null)),e.h("span",null,"Reply")),e.h("sp-button",{variant:"cta",type:"button"},e.h("span",{slot:"icon"},e.h("reply-all-icon",null)),e.h("span",null,"Reply All")),e.h("sp-button",{variant:"cta",type:"button"},e.h("span",{slot:"icon"},e.h("forward-icon",null)),e.h("span",null,"Forward"))),this.showComposer&&o&&e.h("div",{class:"composer"},e.h("nylas-composer",{message:o.data,onClose:this.showComposerClick,onSend:i=>{e.debug("[nylas-view-thread] Send event",{message:i.detail.message,replyBody:i.detail.replyBody})}})))))}get host(){return e.getElement(this)}static get watchers(){return{thread:["threadChanged"],messages:["updateInternalMessages"]}}};k([f.RegisterComponent({name:"nylas-view-thread",stateToProps:new Map([["mailbox.selectedThread","thread"],["mailbox.messages","messages"],["mailbox.state","state"]]),eventToProps:{threadSelected:async(t,a)=>{e.debug("[nylas-view-thread] Nylas init event. Fetching thread messages.",{event:t});const s=t.detail;s&&s.id&&await a.messages.getThreadMessages(s.id)}},fireRegisterEvent:!0}),m("design:type",Function),m("design:paramtypes",[]),m("design:returntype",void 0)],p.prototype,"render",null);p.style=C;exports.nylas_view_thread=p;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-93c50de4.cjs");require("react");require("react-dom");const c=".sc-people-icon-h{display:flex}",a=c,t=class{constructor(i){e.registerInstance(this,i),this.width="20",this.height="20"}render(){return e.h("svg",{key:"8f73408ea9a46988a9f1a9f804fab7ddc87c64d1",xmlns:"http://www.w3.org/2000/svg",width:this.width,height:this.height,fill:"none",viewBox:"0 0 20 20"},e.h("path",{key:"d0a57fb5c109d50e01a113dd137edf66efccbb02",fill:"currentColor",d:"M11 10a2 2 0 0 1 2 2v1.5c0 2.054-2.088 3.5-5.5 3.5S2 15.554 2 13.5V12a2 2 0 0 1 2-2h7Zm0 1H4a1 1 0 0 0-1 1v1.5C3 14.907 4.579 16 7.5 16c2.921 0 4.5-1.093 4.5-2.5V12a1 1 0 0 0-1-1Zm5-1a2 2 0 0 1 2 2v.5c0 2.089-1.568 3.5-4.5 3.5-.141 0-.28-.003-.414-.01.208-.242.382-.502.522-.781l.097-.213h.039C15.976 14.931 17 13.96 17 12.5V12a1 1 0 0 0-1-1h-2.171a3 3 0 0 0-.594-1H16ZM7.5 2a3.5 3.5 0 1 1 0 7 3.5 3.5 0 0 1 0-7Zm7 2a2.5 2.5 0 1 1 0 5 2.5 2.5 0 0 1 0-5Zm-7-1a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5Zm7 2a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3Z"}))}};t.style=a;exports.people_icon=t;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { r as
|
|
1
|
+
import { r as a, h as e } from "./index-f93f6948.js";
|
|
2
2
|
import "react";
|
|
3
3
|
import "react-dom";
|
|
4
|
-
const
|
|
5
|
-
constructor(
|
|
6
|
-
|
|
4
|
+
const o = ".sc-people-icon-h{display:flex}", s = o, c = class {
|
|
5
|
+
constructor(t) {
|
|
6
|
+
a(this, t), this.width = "20", this.height = "20";
|
|
7
7
|
}
|
|
8
8
|
render() {
|
|
9
|
-
return
|
|
9
|
+
return e("svg", { key: "8f73408ea9a46988a9f1a9f804fab7ddc87c64d1", xmlns: "http://www.w3.org/2000/svg", width: this.width, height: this.height, fill: "none", viewBox: "0 0 20 20" }, e("path", { key: "d0a57fb5c109d50e01a113dd137edf66efccbb02", fill: "currentColor", d: "M11 10a2 2 0 0 1 2 2v1.5c0 2.054-2.088 3.5-5.5 3.5S2 15.554 2 13.5V12a2 2 0 0 1 2-2h7Zm0 1H4a1 1 0 0 0-1 1v1.5C3 14.907 4.579 16 7.5 16c2.921 0 4.5-1.093 4.5-2.5V12a1 1 0 0 0-1-1Zm5-1a2 2 0 0 1 2 2v.5c0 2.089-1.568 3.5-4.5 3.5-.141 0-.28-.003-.414-.01.208-.242.382-.502.522-.781l.097-.213h.039C15.976 14.931 17 13.96 17 12.5V12a1 1 0 0 0-1-1h-2.171a3 3 0 0 0-.594-1H16ZM7.5 2a3.5 3.5 0 1 1 0 7 3.5 3.5 0 0 1 0-7Zm7 2a2.5 2.5 0 1 1 0 5 2.5 2.5 0 0 1 0-5Zm-7-1a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5Zm7 2a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3Z" }));
|
|
10
10
|
}
|
|
11
11
|
};
|
|
12
|
-
|
|
12
|
+
c.style = s;
|
|
13
13
|
export {
|
|
14
|
-
|
|
14
|
+
c as people_icon
|
|
15
15
|
};
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { r as o, h as t } from "./index-
|
|
1
|
+
import { r as o, h as t } from "./index-f93f6948.js";
|
|
2
2
|
import "react";
|
|
3
3
|
import "react-dom";
|
|
4
|
-
const e = ".sc-play-icon-h{display:flex}", i = e,
|
|
4
|
+
const e = ".sc-play-icon-h{display:flex}", i = e, c = class {
|
|
5
5
|
constructor(s) {
|
|
6
6
|
o(this, s), this.width = "15", this.height = "15";
|
|
7
7
|
}
|
|
8
8
|
render() {
|
|
9
|
-
return t("svg", { key: "
|
|
9
|
+
return t("svg", { key: "01461bf1925b9c4a5b755ee500c5c9d9ea9a4c9c", width: this.width, height: this.height, viewBox: "0 0 24 24", fill: "auto", xmlns: "http://www.w3.org/2000/svg" }, t("path", { key: "c60c140ea197f53c9f5df04e3a2ef0e8736787c2", d: "M21 12L3 21V3L21 12Z", stroke: "auto", "stroke-width": "1.5", "stroke-linecap": "round", "stroke-linejoin": "round" }));
|
|
10
10
|
}
|
|
11
11
|
};
|
|
12
|
-
|
|
13
|
-
const
|
|
12
|
+
c.style = i;
|
|
13
|
+
const h = ".sc-stop-icon-h{display:flex}", n = h, r = class {
|
|
14
14
|
constructor(s) {
|
|
15
15
|
o(this, s), this.width = "15", this.height = "15";
|
|
16
16
|
}
|
|
17
17
|
render() {
|
|
18
|
-
return t("svg", { key: "
|
|
18
|
+
return t("svg", { key: "f6149723fe23e788bd2a2b7fb075fb929222cb31", width: this.width, height: this.height, viewBox: "0 0 24 24", fill: "auto", xmlns: "http://www.w3.org/2000/svg" }, t("path", { key: "4f6c453999391dae9f8271f341c9ffac4458fd79", d: "M4 4H20V20H4V4Z", stroke: "auto", "stroke-width": "1.5", "stroke-linecap": "round", "stroke-linejoin": "round" }));
|
|
19
19
|
}
|
|
20
20
|
};
|
|
21
|
-
r.style =
|
|
21
|
+
r.style = n;
|
|
22
22
|
export {
|
|
23
|
-
|
|
23
|
+
c as play_icon,
|
|
24
24
|
r as stop_icon
|
|
25
25
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-93c50de4.cjs");require("react");require("react-dom");const o=".sc-play-icon-h{display:flex}",c=o,s=class{constructor(e){t.registerInstance(this,e),this.width="15",this.height="15"}render(){return t.h("svg",{key:"01461bf1925b9c4a5b755ee500c5c9d9ea9a4c9c",width:this.width,height:this.height,viewBox:"0 0 24 24",fill:"auto",xmlns:"http://www.w3.org/2000/svg"},t.h("path",{key:"c60c140ea197f53c9f5df04e3a2ef0e8736787c2",d:"M21 12L3 21V3L21 12Z",stroke:"auto","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}))}};s.style=c;const n=".sc-stop-icon-h{display:flex}",h=n,i=class{constructor(e){t.registerInstance(this,e),this.width="15",this.height="15"}render(){return t.h("svg",{key:"f6149723fe23e788bd2a2b7fb075fb929222cb31",width:this.width,height:this.height,viewBox:"0 0 24 24",fill:"auto",xmlns:"http://www.w3.org/2000/svg"},t.h("path",{key:"4f6c453999391dae9f8271f341c9ffac4458fd79",d:"M4 4H20V20H4V4Z",stroke:"auto","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}))}};i.style=h;exports.play_icon=s;exports.stop_icon=i;
|
package/dist/react.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index-93c50de4.cjs");require("react");require("react-dom");exports.AddCircleIcon=o.AddCircleIcon;exports.ArchiveIcon=o.ArchiveIcon;exports.ArrowIcon=o.ArrowIcon;exports.BoldIcon=o.BoldIcon;exports.ButtonComponent=o.ButtonComponent;exports.CalendarCancelIcon=o.CalendarCancelIcon;exports.CalendarCheckIcon=o.CalendarCheckIcon;exports.CalendarIcon=o.CalendarIcon;exports.CalendarInfoIcon=o.CalendarInfoIcon;exports.CalendarPatternsIcon=o.CalendarPatternsIcon;exports.CheckmarkCircleIcon=o.CheckmarkCircleIcon;exports.ChevronIcon=o.ChevronIcon;exports.CloseIcon=o.CloseIcon;exports.DocumentRefreshIcon=o.DocumentRefreshIcon;exports.FlowIcon=o.FlowIcon;exports.FolderIcon=o.FolderIcon;exports.ForwardIcon=o.ForwardIcon;exports.GlobeIcon=o.GlobeIcon;exports.GoogleLogoIcon=o.GoogleLogoIcon;exports.InboxIcon=o.InboxIcon;exports.InfoIcon=o.InfoIcon;exports.ItalicIcon=o.ItalicIcon;exports.LoadingIcon=o.LoadingIcon;exports.LocationIcon=o.LocationIcon;exports.LocationOffIcon=o.LocationOffIcon;exports.MicrosoftLogoIcon=o.MicrosoftLogoIcon;exports.MultiSelectDropdown=o.MultiSelectDropdown;exports.NylasAdditionalParticipants=o.NylasAdditionalParticipants;exports.NylasAvailabilityPicker=o.NylasAvailabilityPicker;exports.NylasBookedEventCard=o.NylasBookedEventCard;exports.NylasBookingCalendarPicker=o.NylasBookingCalendarPicker;exports.NylasBookingForm=o.NylasBookingForm;exports.NylasBufferTime=o.NylasBufferTime;exports.NylasCalendarPicker=o.NylasCalendarPicker;exports.NylasCancelBookingForm=o.NylasCancelBookingForm;exports.NylasCancelledEventCard=o.NylasCancelledEventCard;exports.NylasComposer=o.NylasComposer;exports.NylasCustomBookingFlow=o.NylasCustomBookingFlow;exports.NylasDatePicker=o.NylasDatePicker;exports.NylasEditorTabs=o.NylasEditorTabs;exports.NylasEventDescription=o.NylasEventDescription;exports.NylasEventDuration=o.NylasEventDuration;exports.NylasEventInfo=o.NylasEventInfo;exports.NylasEventLimits=o.NylasEventLimits;exports.NylasEventTitle=o.NylasEventTitle;exports.NylasFormCard=o.NylasFormCard;exports.NylasIdentityRequestWrapper=o.NylasIdentityRequestWrapper;exports.NylasIfState=o.NylasIfState;exports.NylasLimitFutureBookings=o.NylasLimitFutureBookings;exports.NylasListConfigurations=o.NylasListConfigurations;exports.NylasListFolders=o.NylasListFolders;exports.NylasListThreads=o.NylasListThreads;exports.NylasLocaleSwitch=o.NylasLocaleSwitch;exports.NylasLocationComponent=o.NylasLocationComponent;exports.NylasLogin=o.NylasLogin;exports.NylasLogo=o.NylasLogo;exports.NylasMailbox=o.NylasMailbox;exports.NylasMailboxPagination=o.NylasMailboxPagination;exports.NylasMailboxToolbarButton=o.NylasMailboxToolbarButton;exports.NylasMinCancellationNotice=o.NylasMinCancellationNotice;exports.NylasNotification=o.NylasNotification;exports.NylasProvider=o.NylasProvider;exports.NylasSchedulerEditor=o.NylasSchedulerEditor;exports.NylasScheduling=o.NylasScheduling;exports.NylasSelectedEventCard=o.NylasSelectedEventCard;exports.NylasSummarizeMessageButton=o.NylasSummarizeMessageButton;exports.NylasThreadsRefresh=o.NylasThreadsRefresh;exports.NylasThreadsSearch=o.NylasThreadsSearch;exports.NylasTimeWindowPicker=o.NylasTimeWindowPicker;exports.NylasTimeslotPicker=o.NylasTimeslotPicker;exports.NylasViewEmail=o.NylasViewEmail;exports.NylasViewThread=o.NylasViewThread;exports.PeopleIcon=o.PeopleIcon;exports.PlayIcon=o.PlayIcon;exports.RefreshIcon=o.RefreshIcon;exports.ReplyAllIcon=o.ReplyAllIcon;exports.ReplyIcon=o.ReplyIcon;exports.SearchIcon=o.SearchIcon;exports.SelectDropdown=o.SelectDropdown;exports.SentIcon=o.SentIcon;exports.SpamIcon=o.SpamIcon;exports.StarIcon=o.StarIcon;exports.StopIcon=o.StopIcon;exports.TimePeriodSelector=o.TimePeriodSelector;exports.TooltipComponent=o.TooltipComponent;exports.TranslateIcon=o.TranslateIcon;exports.TrashIcon=o.TrashIcon;exports.UnderlineIcon=o.UnderlineIcon;exports.WarningIcon=o.WarningIcon;exports.applyPolyfills=o.applyPolyfills;exports.defineCustomElements=o.defineCustomElements;exports.setNonce=o.setNonce;exports.useNylasMailboxElement=o.useNylasMailboxElement;
|
package/dist/react.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { T as n, U as l, V as i, W as c, X as t, Y as r, Z as y, _ as N, $ as I, a0 as d, a1 as C, a2 as m, a3 as b, a4 as p, a5 as f, a6 as h, a7 as u, a8 as g, a9 as S, aa as k, ab as P, ac as T, ad as L, ae as E, af as v, ag as B, ah as w, ai as F, aj as M, ak as R, al as x, am as A, an as D, ao as W, ap as V, aq as G, ar as U, as as q, at as z, au as O, av as Q, aw as X, ax as Y, ay as Z, az as _, aA as $, N as j, aB as H, aC as J, aD as K, aE as aa, aF as sa, aG as oa, aH as ea, aI as na, aJ as la, aK as ia, aL as ca, aM as ta, aN as ra, aO as ya, aP as Na, aQ as Ia, aR as da, aS as Ca, aT as ma, aU as ba, aV as pa, aW as fa, aX as ha, aY as ua, aZ as ga, a_ as Sa, a$ as ka, b0 as Pa, b1 as Ta, b2 as La, b3 as Ea, b4 as va, b5 as Ba, b6 as wa, b7 as Fa, b8 as Ma, b9 as Ra, ba as xa, bb as Aa, bc as Da, bd as Wa, be as Va, Q as Ga, R as Ua, S as qa, P as za } from "./index-f93f6948.js";
|
|
2
2
|
import "react";
|
|
3
3
|
import "react-dom";
|
|
4
4
|
export {
|
|
5
|
-
|
|
5
|
+
n as AddCircleIcon,
|
|
6
6
|
l as ArchiveIcon,
|
|
7
7
|
i as ArrowIcon,
|
|
8
8
|
c as BoldIcon,
|
|
@@ -38,10 +38,10 @@ export {
|
|
|
38
38
|
W as NylasCalendarPicker,
|
|
39
39
|
V as NylasCancelBookingForm,
|
|
40
40
|
G as NylasCancelledEventCard,
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
41
|
+
U as NylasComposer,
|
|
42
|
+
q as NylasCustomBookingFlow,
|
|
43
|
+
z as NylasDatePicker,
|
|
44
|
+
O as NylasEditorTabs,
|
|
45
45
|
Q as NylasEventDescription,
|
|
46
46
|
X as NylasEventDuration,
|
|
47
47
|
Y as NylasEventInfo,
|
|
@@ -55,8 +55,8 @@ export {
|
|
|
55
55
|
aa as NylasListFolders,
|
|
56
56
|
sa as NylasListThreads,
|
|
57
57
|
oa as NylasLocaleSwitch,
|
|
58
|
-
|
|
59
|
-
|
|
58
|
+
ea as NylasLocationComponent,
|
|
59
|
+
na as NylasLogin,
|
|
60
60
|
la as NylasLogo,
|
|
61
61
|
ia as NylasMailbox,
|
|
62
62
|
ca as NylasMailboxPagination,
|
|
@@ -92,7 +92,7 @@ export {
|
|
|
92
92
|
Wa as UnderlineIcon,
|
|
93
93
|
Va as WarningIcon,
|
|
94
94
|
Ga as applyPolyfills,
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
95
|
+
Ua as defineCustomElements,
|
|
96
|
+
qa as setNonce,
|
|
97
|
+
za as useNylasMailboxElement
|
|
98
98
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { r as
|
|
1
|
+
import { r as s, h as c } from "./index-f93f6948.js";
|
|
2
2
|
import "react";
|
|
3
3
|
import "react-dom";
|
|
4
4
|
const t = ".sc-refresh-icon-h{display:flex}", l = t, h = class {
|
|
5
|
-
constructor(
|
|
6
|
-
|
|
5
|
+
constructor(e) {
|
|
6
|
+
s(this, e), this.width = "15", this.height = "15";
|
|
7
7
|
}
|
|
8
8
|
render() {
|
|
9
|
-
return c("svg", { key: "
|
|
9
|
+
return c("svg", { key: "aee09fcff1a6eff44a8ab2dd03b53d016bd807f7", fill: "auto", width: this.width, height: this.height, viewBox: "0 0 32 32", version: "1.1", xmlns: "http://www.w3.org/2000/svg" }, c("path", { key: "ead150b54eb753b97fd36ef63a3d96545a92245a", d: "M15.544 28.080c-0.002-0.006-0.008-0.010-0.012-0.015l-2.873-4.489c-0.204-0.335-0.646-0.454-0.992-0.266l-0.256 0.157c-0.344 0.188-0.337 0.673-0.133 1.008l1.841 2.857c-0.157-0.035-0.316-0.063-0.471-0.103-3.224-0.843-5.953-3.026-7.485-5.988-1.448-2.797-1.72-5.99-0.766-8.992s3.118-5.452 5.915-6.899c0.476-0.247 0.662-0.832 0.416-1.308-0.246-0.477-0.832-0.663-1.308-0.416-3.258 1.686-5.763 4.54-6.874 8.036s-0.794 7.215 0.892 10.473c1.786 3.448 4.963 5.989 8.72 6.973 0.043 0.011 0.087 0.017 0.13 0.028l-2.541 1.288c-0.344 0.189-0.458 0.613-0.254 0.948l0.098 0.256c0.205 0.335 0.557 0.454 0.9 0.266l4.651-2.381c0.006-0.004 0.012-0.003 0.018-0.007l0.312-0.171c0.172-0.095 0.287-0.249 0.332-0.422 0.047-0.172 0.025-0.364-0.076-0.531zM28.559 10.025c-1.783-3.447-4.862-5.988-8.618-6.972-0.267-0.070-0.541-0.124-0.814-0.179l2.494-1.265c0.344-0.189 0.549-0.614 0.345-0.949l-0.099-0.255c-0.205-0.336-0.648-0.454-0.991-0.267l-4.651 2.381c-0.006 0.003-0.012 0.002-0.018 0.006l-0.312 0.171c-0.173 0.095-0.287 0.249-0.332 0.422-0.047 0.172-0.025 0.364 0.077 0.53l0.185 0.304c0.003 0.006 0.008 0.010 0.012 0.016l2.873 4.489c0.203 0.335 0.646 0.454 0.991 0.266l0.226-0.157c0.344-0.188 0.366-0.673 0.163-1.008l-1.85-2.87c0.407 0.063 0.811 0.138 1.207 0.242 3.226 0.845 5.856 3.027 7.387 5.986 1.448 2.797 1.72 5.99 0.765 8.991s-3.020 5.451-5.818 6.901c-0.476 0.247-0.662 0.831-0.415 1.308 0.172 0.332 0.511 0.524 0.863 0.524 0.15 0 0.302-0.035 0.446-0.109 3.259-1.686 5.664-4.54 6.776-8.035 1.111-3.497 0.794-7.217-0.893-10.473z" }));
|
|
10
10
|
}
|
|
11
11
|
};
|
|
12
12
|
h.style = l;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-93c50de4.cjs");require("react");require("react-dom");const t=".sc-refresh-icon-h{display:flex}",i=t,c=class{constructor(s){e.registerInstance(this,s),this.width="15",this.height="15"}render(){return e.h("svg",{key:"aee09fcff1a6eff44a8ab2dd03b53d016bd807f7",fill:"auto",width:this.width,height:this.height,viewBox:"0 0 32 32",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},e.h("path",{key:"ead150b54eb753b97fd36ef63a3d96545a92245a",d:"M15.544 28.080c-0.002-0.006-0.008-0.010-0.012-0.015l-2.873-4.489c-0.204-0.335-0.646-0.454-0.992-0.266l-0.256 0.157c-0.344 0.188-0.337 0.673-0.133 1.008l1.841 2.857c-0.157-0.035-0.316-0.063-0.471-0.103-3.224-0.843-5.953-3.026-7.485-5.988-1.448-2.797-1.72-5.99-0.766-8.992s3.118-5.452 5.915-6.899c0.476-0.247 0.662-0.832 0.416-1.308-0.246-0.477-0.832-0.663-1.308-0.416-3.258 1.686-5.763 4.54-6.874 8.036s-0.794 7.215 0.892 10.473c1.786 3.448 4.963 5.989 8.72 6.973 0.043 0.011 0.087 0.017 0.13 0.028l-2.541 1.288c-0.344 0.189-0.458 0.613-0.254 0.948l0.098 0.256c0.205 0.335 0.557 0.454 0.9 0.266l4.651-2.381c0.006-0.004 0.012-0.003 0.018-0.007l0.312-0.171c0.172-0.095 0.287-0.249 0.332-0.422 0.047-0.172 0.025-0.364-0.076-0.531zM28.559 10.025c-1.783-3.447-4.862-5.988-8.618-6.972-0.267-0.070-0.541-0.124-0.814-0.179l2.494-1.265c0.344-0.189 0.549-0.614 0.345-0.949l-0.099-0.255c-0.205-0.336-0.648-0.454-0.991-0.267l-4.651 2.381c-0.006 0.003-0.012 0.002-0.018 0.006l-0.312 0.171c-0.173 0.095-0.287 0.249-0.332 0.422-0.047 0.172-0.025 0.364 0.077 0.53l0.185 0.304c0.003 0.006 0.008 0.010 0.012 0.016l2.873 4.489c0.203 0.335 0.646 0.454 0.991 0.266l0.226-0.157c0.344-0.188 0.366-0.673 0.163-1.008l-1.85-2.87c0.407 0.063 0.811 0.138 1.207 0.242 3.226 0.845 5.856 3.027 7.387 5.986 1.448 2.797 1.72 5.99 0.765 8.991s-3.020 5.451-5.818 6.901c-0.476 0.247-0.662 0.831-0.415 1.308 0.172 0.332 0.511 0.524 0.863 0.524 0.15 0 0.302-0.035 0.446-0.109 3.259-1.686 5.664-4.54 6.776-8.035 1.111-3.497 0.794-7.217-0.893-10.473z"}))}};c.style=i;exports.refresh_icon=c;
|
package/dist/{register-component-cf5c8420-d3fb6bf9.cjs → register-component-b9cfcbaf-d40e1f3c.cjs}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const s=require("./index-
|
|
1
|
+
"use strict";const s=require("./index-93c50de4.cjs");function m(e,o,u="registerComponent"){return new CustomEvent(u,{bubbles:!0,composed:!0,detail:o})}function P(e,o,u="unregisterComponent"){return new CustomEvent(u,{bubbles:!0,composed:!0,detail:o})}function b(e){return(o,u)=>{const r=e.name;s.debug(`[${r}] Registering component ${r} being called on ${u}`);const l=o.componentWillLoad;if(!l){s.error(`[${r}] componentWillLoad lifecycle method in ${r} missing. Required for RegisterComponent decorator.`);return}const p=o.connectedCallback;if(!p){s.error(`[${r}] connectedCallback lifecycle method in ${r} missing. Required for RegisterComponent decorator.`);return}const a=o.disconnectedCallback;if(!a){s.error(`[${r}] disconnectedCallback lifecycle method in ${r} missing. Required for RegisterComponent decorator.`);return}if(e.storeToProps&&e.stateToProps){const n=Array.from(e.storeToProps.values()),t=Array.from(e.stateToProps.values()),i=n.filter(c=>t.includes(c));if(i.length>0){s.error(`[${r}] Overlapping prop keys detected in ${r} for storeToProps and stateToProps. Make sure to only define them once. Overlapping keys: ${i.join(", ")}`);return}}const d=new Map;e.eventToProps&&Object.keys(e.eventToProps).forEach(n=>{var t;d.set(n,(t=e.eventToProps)==null?void 0:t[n])}),o.connectedCallback=function(){s.debug(`[~${r}] connectedCallback called`);const n=p==null?void 0:p.call(this),t=s.getElement(this);return t.dataset.nylasId||(Object.defineProperty(t,"registerNylasComponent",{get(){return!0},enumerable:!0}),Object.defineProperty(t,"stateToProps",{get(){return e.stateToProps},enumerable:!0}),Object.defineProperty(t,"getStoresToProp",{get(){return e.getStoresToProp},enumerable:!0}),Object.defineProperty(t,"storeToProps",{get(){return e.storeToProps},enumerable:!0}),Object.defineProperty(t,"eventToProps",{get(){return d},enumerable:!0}),Object.defineProperty(t,"authToProp",{get(){return e.authToProp},enumerable:!0}),Object.defineProperty(t,"connectorToProp",{get(){return e.connectorToProp},enumerable:!0}),Object.defineProperty(t,"localPropsToProp",{get(){return e.localPropsToProp},enumerable:!0})),n},e.fireRegisterEvent&&(o.componentWillLoad=function(){const n=l==null?void 0:l.call(this),t=s.getElement(this),i={element:t,...e,eventToProps:d},c=m(o,i,e.registrationEventName);return t.dispatchEvent(c)&&s.debug(`[${r}] Component ${r} successfully fired registration event`),n},o.disconnectedCallback=function(){const n=a==null?void 0:a.call(this),t=s.getElement(this),i={element:t,...e,eventToProps:d},c=P(o,i,e.unregistrationEventName);return t.dispatchEvent(c)&&s.debug(`[${r}] Component ${r} successfully fired unregistration event`),n})}}exports.RegisterComponent=b;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const i=require("./index-93c50de4.cjs");function s(t={}){const r={selectedConfiguration:{},configurations:[],calendars:[],currentUser:null,action:null,defaultRequiresSessionAuth:!0,...t},e=i.createStore(r);function n(){e.set("selectedConfiguration",{...t.selectedConfiguration})}return e.onChange("action",async o=>{o||n()}),{...e,resetSelectedConfiguration:n}}exports.CreateNylasSchedulerConfigStore=s;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { e as i } from "./index-f93f6948.js";
|
|
2
|
+
function a(t = {}) {
|
|
3
|
+
const o = {
|
|
4
|
+
selectedConfiguration: {},
|
|
5
|
+
configurations: [],
|
|
6
|
+
calendars: [],
|
|
7
|
+
currentUser: null,
|
|
8
|
+
action: null,
|
|
9
|
+
defaultRequiresSessionAuth: !0,
|
|
10
|
+
...t
|
|
11
|
+
}, e = i(o);
|
|
12
|
+
function n() {
|
|
13
|
+
e.set("selectedConfiguration", { ...t.selectedConfiguration });
|
|
14
|
+
}
|
|
15
|
+
return e.onChange("action", async (r) => {
|
|
16
|
+
r || n();
|
|
17
|
+
}), {
|
|
18
|
+
...e,
|
|
19
|
+
resetSelectedConfiguration: n
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
export {
|
|
23
|
+
a as C
|
|
24
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const v=require("./index-93c50de4.cjs");exports.ErrorCategory=void 0;(function(r){r.Component="component",r.Api="api",r.Auth="auth"})(exports.ErrorCategory||(exports.ErrorCategory={}));var I;(function(r){r.endtime_not_in_future="endtime_not_in_future",r.no_booking_info="no_booking_info",r.no_timeslot_selected="no_timeslot_selected",r.no_timezone_selected="no_timezone_selected",r.no_booking_id="no_booking_id",r.invalid_start_time="invalid_start_time",r.invalid_end_time="invalid_end_time",r.invalid_timezone="invalid_timezone"})(I||(I={}));var b;(function(r){r.invalid_session="invalid_session",r.general_error="general_error",r.internal_error="internal_error",r.invalid_request_error="invalid_request_error",r.timeslot_not_available="timeslot_not_available"})(b||(b={}));class z{constructor(){this.component=t=>{const e=exports.ErrorCategory.Component,s=`${t} error`;return{endtime_not_in_future:(i='"endtime" can not be in the future')=>({title:s,message:i,category:e}),no_booking_info:(i="No booking info provided")=>({title:s,message:i,category:e}),no_timeslot_selected:(i="No timeslot selected")=>({title:s,message:i,category:e}),no_timezone_selected:(i="No timezone selected")=>({title:s,message:i,category:e}),no_booking_id:(i="No booking id provided")=>({title:s,message:i,category:e}),invalid_start_time:(i="Invalid start time")=>({title:s,message:i,category:e}),invalid_end_time:(i="Invalid end time")=>({title:s,message:i,category:e}),invalid_timezone:(i="Invalid timezone")=>({title:s,message:i,category:e})}},this.api=t=>{const e=exports.ErrorCategory.Api,s=`${t} error`;return{invalid_session:i=>({title:s,message:i,category:e}),general_error:i=>({title:s,message:i,category:e}),internal_error:i=>({title:s,message:i,category:e}),invalid_request_error:i=>({title:s,message:i,category:e}),timeslot_not_available:i=>({title:s,message:i,category:e})}}}}class D{constructor({schedulerAPIURL:t,schedulerStore:e,sessionId:s,configId:i}){this.errors=new z,this.schedulerStore=e,this.schedulerAPIURL=t,this.sessionId=s,this.configId=i}getHeaders(){return this.configId?{}:{Authorization:`Bearer ${this.sessionId}`}}async makeAPIRequest(t,e,s,i={}){try{const n=new URL(this.schedulerAPIURL);return n.pathname=t,await(await fetch(decodeURIComponent(n.toString()),{method:e,headers:{"Content-Type":"application/json",...i},body:s})).json()}catch(n){return{error:{message:n.message,title:"API request failed",type:"api"}}}}selectDate(t){this.schedulerStore.set("selectedDate",t),this.schedulerStore.set("selectedTimeslot",null)}selectTime(t){this.schedulerStore.set("selectedTimeslot",t)}selectTimezone(t){this.schedulerStore.set("selectedTimezone",t)}toggleAdditionalData(t){this.schedulerStore.set("showBookingForm",t)}setParticipantName(t){const{bookingInfo:e}=this.schedulerStore.state;this.schedulerStore.set("bookingInfo",{...e,primaryParticipant:{...e==null?void 0:e.primaryParticipant,name:t}})}setParticipantEmail(t){const{bookingInfo:e}=this.schedulerStore.state;this.schedulerStore.set("bookingInfo",{...e,primaryParticipant:{...e==null?void 0:e.primaryParticipant,email:t}})}async setReschedule(t){const e=new Date;this.schedulerStore.set("rescheduleBookingId",t),this.schedulerStore.set("selectedTimeslot",null),this.schedulerStore.set("eventInfo",null),this.schedulerStore.set("showBookingForm",!1);const s=new Date(e.getFullYear(),e.getMonth(),1).getTime()/1e3,i=new Date(e.getFullYear(),e.getMonth()+1,1).getTime()/1e3,n=await this.getAvailability(s,i),l=this.schedulerStore.get("availability").find(a=>new Date(a.start_time)>new Date);let d=e;return l&&(d=l.start_time),this.schedulerStore.set("selectedDate",d),n}async setCancel(t){this.schedulerStore.set("cancelBookingId",t)}async bookTimeslot(t){var c;this.schedulerStore.set("isLoading",!0);const{selectedTimeslot:e,selectedTimezone:s,bookingInfo:i}=this.schedulerStore.state;if(!t&&!i)return{error:this.errors.component("Booking").no_booking_info()};const n=(t==null?void 0:t.timeslot)||e;if(!n)return{error:this.errors.component("Create Booking").no_timeslot_selected()};const l=t&&(t!=null&&t.timezone)?t==null?void 0:t.timezone:s;if(!l)return{error:this.errors.component("Create Booking").no_timezone_selected()};const d=t?t==null?void 0:t.primaryParticipant:i==null?void 0:i.primaryParticipant,a=t?(t==null?void 0:t.guests)||[]:(i==null?void 0:i.guests)||[],h=t?{...t==null?void 0:t.additionalFields,guests:a}:{...i==null?void 0:i.additionalFields,guests:a},p=this.getHeaders(),_=`/v3/scheduling/bookings${this.configId?`?configuration_id=${this.configId}`:""}`,o=await this.makeAPIRequest(decodeURIComponent(_),"POST",JSON.stringify({additional_fields:h,guest:{...d},start_time:n.start_time.getTime()/1e3,end_time:n.end_time.getTime()/1e3,timezone:l}),p);if("error"in o){this.schedulerStore.set("isLoading",!1);const u=(c=o.error)==null?void 0:c.type;let m=o.error;return u&&u in this.errors.api("Create Booking")&&(m=this.errors.api("Create Booking")[u]((m==null?void 0:m.message)||(m==null?void 0:m.title)||"Something went wrong")),{error:m}}return"data"in o&&this.schedulerStore.set("eventInfo",o==null?void 0:o.data),this.schedulerStore.set("isLoading",!1),o}async getAvailability(t=0,e=0){var p,S,_;this.schedulerStore.set("isLoading",!0);const s=new URLSearchParams,i=new Date,n=i.getTime();if(e&&e<n/1e3)return this.schedulerStore.set("isLoading",!1),{error:this.errors.component("Get Availability").endtime_not_in_future()};if(!t){const o=new Date(i.getFullYear(),i.getMonth(),1);t=Math.floor(o.getTime()/1e3)}if(!e){const o=new Date(i.getFullYear(),i.getMonth()+1,0);e=Math.floor(o.getTime()/1e3)}s.append("start_time",encodeURIComponent(t.toString())),s.append("end_time",encodeURIComponent(e.toString())),this.configId&&s.append("configuration_id",encodeURIComponent(this.configId));const l=s.toString(),d=`/v3/scheduling/availability${l?`?${l}`:""}`,a=this.getHeaders(),h=await this.makeAPIRequest(decodeURIComponent(d),"GET",void 0,a);if("error"in h){this.schedulerStore.set("availability",[]),this.schedulerStore.set("isLoading",!1);const o=(p=h.error)==null?void 0:p.type;let c=h.error;return o&&o in this.errors.api("Get Availability")&&(c=this.errors.api("Get Availability")[o]((c==null?void 0:c.message)||(c==null?void 0:c.title)||"Something went wrong")),{error:c}}if("data"in h){const c=(((_=(S=h.data)==null?void 0:S.time_slots)==null?void 0:_.map(u=>({...u,start_time:new Date(u.start_time*1e3),end_time:new Date(u.end_time*1e3)})))||[]).filter(u=>u.start_time.getTime()>n);this.schedulerStore.set("availability",c)}return this.schedulerStore.set("isLoading",!1),h}async cancelBooking(t){var l;if(this.schedulerStore.set("isLoading",!0),!t)return{error:this.errors.component("Cancel Booking").no_booking_id()};const e=this.configId?`?configuration_id=${this.configId}`:"",s=`/v3/scheduling/bookings/${t}${e}`,i=this.getHeaders(),n=await this.makeAPIRequest(decodeURIComponent(s),"DELETE",JSON.stringify({action:"cancel"}),i);if("error"in n){this.schedulerStore.set("isLoading",!1);const d=(l=n.error)==null?void 0:l.type;let a=n.error;return d&&d in this.errors.api("Cancel Booking")&&(a=this.errors.api("Cancel Booking")[d]((a==null?void 0:a.message)||(a==null?void 0:a.title)||"Something went wrong")),{error:a}}return this.schedulerStore.set("cancelledEventInfo",{booking_id:t}),this.schedulerStore.set("isLoading",!1),n}async rescheduleBooking(t,e){var w;if(this.schedulerStore.set("isLoading",!0),!t)return{error:this.errors.component("Reschedule Booking").no_booking_id()};const s=this.errors.api("Reschedule Booking"),i=this.errors.component("Reschedule Booking"),{bookingInfo:n,selectedTimeslot:l,selectedTimezone:d}=this.schedulerStore.state,{startTime:a,endTime:h,timezone:p}=e,S=a||(l==null?void 0:l.start_time);if(!S)return{error:i.invalid_start_time('Please pass "startTime" in data or set "selectedTimeslot" in the defaultSchedulerState.')};const _=h||(l==null?void 0:l.end_time);if(!_)return{error:i.invalid_end_time('Please pass "endTime" in data or set "selectedTimeslot" in the defaultSchedulerState.')};const o=p||d;if(!o)return{error:i.invalid_timezone('Please pass "timezone" in data or set "selectedTimezone" in the defaultSchedulerState.')};const c=e?e==null?void 0:e.primaryParticipant:n==null?void 0:n.primaryParticipant,u=e?(e==null?void 0:e.guests)||[]:(n==null?void 0:n.guests)||[],m=e?{...e==null?void 0:e.additionalFields,guests:u}:{...n==null?void 0:n.additionalFields,guests:u},P=this.configId?`?configuration_id=${this.configId}`:"",k=`/v3/scheduling/bookings/${t}${P}`,T=this.getHeaders(),g=await this.makeAPIRequest(decodeURIComponent(k),"PATCH",JSON.stringify({start_time:S.getTime()/1e3,end_time:_.getTime()/1e3,time_zone:o,additional_fields:m,guest:{...c}}),T);if("error"in g){this.schedulerStore.set("isLoading",!1);const y=(w=g.error)==null?void 0:w.type;let f=g.error;y&&y in s&&(f=s[y]((f==null?void 0:f.message)||(f==null?void 0:f.title)||"Something went wrong"))}return"data"in g&&this.schedulerStore.set("eventInfo",g==null?void 0:g.data),this.schedulerStore.set("isLoading",!1),g}}function C(r={}){const t={selectedDate:null,selectedLanguage:navigator.language,selectedTimezone:Intl.DateTimeFormat().resolvedOptions().timeZone,selectedTimeslot:null,showBookingForm:!1,selectableDates:null,availability:[],state:"ready",eventInfo:null,cancelledEventInfo:null,isLoading:!1,nylasBranding:!0,...r};v.debug("[defaultNylasStoreState]: ",t);const e=v.createStore(t);return e.onChange("availability",s=>{v.debug("[availability]: ",s);const i=s.map(n=>n.start_time);v.debug("[selectableDates]: ",i),e.set("selectableDates",i)}),e.reset=()=>{for(const s in t){const i=t[s];e.set(s,i)}},e}exports.CreateNylasSchedulerStore=C;exports.NylaSchedulerAPIConnector=D;
|