@nylas/react 1.1.0-canary.8 → 1.1.0
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/README.md +110 -2
- package/dist/add-circle-icon_2.entry-7165bd0e.js +25 -0
- package/dist/add-circle-icon_2.entry-f1ddca18.cjs +1 -0
- package/dist/{archive-icon_7.entry-e2954750.js → archive-icon_7.entry-7411c224.js} +16 -16
- package/dist/archive-icon_7.entry-e3df60ed.cjs +1 -0
- package/dist/{arrow-icon.entry-548b027e.cjs → arrow-icon.entry-280e18b0.cjs} +1 -1
- package/dist/{arrow-icon.entry-03a85113.js → arrow-icon.entry-38949317.js} +4 -4
- package/dist/{bold-icon_3.entry-70ffa7f0.js → bold-icon_3.entry-5963945c.js} +4 -4
- package/dist/{bold-icon_3.entry-9a7b1869.cjs → bold-icon_3.entry-5dffbedd.cjs} +1 -1
- package/dist/button-component_2.entry-237733b4.js +26 -0
- package/dist/button-component_2.entry-b29d2873.cjs +1 -0
- package/dist/calendar-agenda-fill-icon_48.entry-9afba869.js +5105 -0
- package/dist/calendar-agenda-fill-icon_48.entry-d3830dbb.cjs +7 -0
- package/dist/{calendar-cancel-icon.entry-45388fdc.cjs → calendar-cancel-icon.entry-77ccf227.cjs} +1 -1
- package/dist/{calendar-cancel-icon.entry-6bbc119f.js → calendar-cancel-icon.entry-780723a6.js} +5 -5
- package/dist/{calendar-check-icon_2.entry-f633f7a6.js → calendar-check-icon_2.entry-2c89c230.js} +7 -7
- package/dist/{calendar-check-icon_2.entry-6628456c.cjs → calendar-check-icon_2.entry-b37ac7f0.cjs} +1 -1
- package/dist/{calendar-icon.entry-62b82c27.js → calendar-icon.entry-02dd3990.js} +4 -4
- package/dist/{calendar-icon.entry-379b1fa1.cjs → calendar-icon.entry-ffc93569.cjs} +1 -1
- package/dist/checkbox-component_2.entry-00b6a1e9.cjs +1 -0
- package/dist/checkbox-component_2.entry-ee9d0e6c.js +56 -0
- package/dist/chevron-icon_3.entry-468abc26.cjs +1 -0
- package/dist/chevron-icon_3.entry-f62e9ef1.js +129 -0
- package/dist/clock-icon_4.entry-766a1b23.js +45 -0
- package/dist/clock-icon_4.entry-7dc2cc4a.cjs +1 -0
- package/dist/{constants-f34b9c6e-95a17764.js → constants-50c3e067-8a40a5fe.js} +885 -751
- package/dist/{constants-f34b9c6e-e7137e51.cjs → constants-50c3e067-9f2a6372.cjs} +5 -5
- package/dist/copy-icon.entry-2a841508.js +15 -0
- package/dist/copy-icon.entry-e5251410.cjs +1 -0
- package/dist/delete-icon_2.entry-1a5c39dc.cjs +1 -0
- package/dist/delete-icon_2.entry-64555a2f.js +25 -0
- package/dist/{document-refresh-icon.entry-32c75418.js → document-refresh-icon.entry-4bf6398b.js} +4 -4
- package/dist/document-refresh-icon.entry-fdc7ddda.cjs +1 -0
- package/dist/elements/index.d.ts +47 -1
- package/dist/{elements-dc5b338e-62fe1cf3.js → elements-dc5b338e-2da1fe61.js} +1 -1
- package/dist/{elements-dc5b338e-1f23530f.cjs → elements-dc5b338e-c8016c3d.cjs} +1 -1
- package/dist/{focus-visible-e8093c16-f0f05815.cjs → focus-visible-e8093c16-0a38a184.cjs} +1 -1
- package/dist/{focus-visible-e8093c16-1f664070.js → focus-visible-e8093c16-9d0c98c0.js} +1 -1
- package/dist/{forward-icon_6.entry-7fab04d7.js → forward-icon_6.entry-390ef70a.js} +9 -9
- package/dist/{forward-icon_6.entry-ef5e2e0f.cjs → forward-icon_6.entry-7238ef38.cjs} +3 -3
- package/dist/{globe-icon.entry-398a9826.cjs → globe-icon.entry-81f42f89.cjs} +1 -1
- package/dist/{globe-icon.entry-b8e1efae.js → globe-icon.entry-8d106260.js} +5 -5
- package/dist/google-logo-icon_4.entry-aabd3886.js +680 -0
- package/dist/google-logo-icon_4.entry-fa2b8999.cjs +1 -0
- package/dist/index-53420959-5fc8ad2b.js +5 -0
- package/dist/index-53420959-fcf45780.cjs +1 -0
- package/dist/index-5ccfd9df.js +7859 -0
- package/dist/index-6d9eeb53-58c8980a.js +4971 -0
- package/dist/index-6d9eeb53-b2a6d09f.cjs +41 -0
- package/dist/index-eb33703c.cjs +42 -0
- package/dist/{index.es-df564f87-b773d34f.js → index.es-c9454237-00ccd1e6.js} +6 -8
- package/dist/{index.es-df564f87-e4a4092a.cjs → index.es-c9454237-b64161d1.cjs} +6 -6
- package/dist/{info-icon_2.entry-2eb70f49.cjs → info-icon_2.entry-b2e11336.cjs} +1 -1
- package/dist/{info-icon_2.entry-6bbfa6dc.js → info-icon_2.entry-bb8ed71c.js} +3 -3
- package/dist/input-component.entry-378b1ccc.cjs +1 -0
- package/dist/input-component.entry-cb86170f.js +65 -0
- package/dist/input-dropdown.entry-98954c93.cjs +1 -0
- package/dist/input-dropdown.entry-a76c339e.js +134 -0
- package/dist/{mailbox-store-69c5c5f6-631eddb5.cjs → mailbox-store-edc386fc-156b7236.cjs} +1 -1
- package/dist/{mailbox-store-69c5c5f6-8ab4670b.js → mailbox-store-edc386fc-8bc7558b.js} +2 -2
- package/dist/multi-select-dropdown.entry-40b855e1.cjs +1 -0
- package/dist/multi-select-dropdown.entry-6b686695.js +91 -0
- package/dist/nylas-booked-event-card_12.entry-9d693125.cjs +1 -0
- package/dist/nylas-booked-event-card_12.entry-e861bb16.js +1134 -0
- package/dist/nylas-form-card.entry-b158d789.js +57 -0
- package/dist/nylas-form-card.entry-ca4a8746.cjs +1 -0
- package/dist/{nylas-if-state.entry-f8abd025.js → nylas-if-state.entry-8e4d922c.js} +8 -8
- package/dist/{nylas-if-state.entry-276d61ad.cjs → nylas-if-state.entry-95fac42d.cjs} +1 -1
- package/dist/{nylas-list-folders.entry-78cc680e.js → nylas-list-folders.entry-83c39684.js} +8 -8
- package/dist/{nylas-list-folders.entry-afe02f0e.cjs → nylas-list-folders.entry-8a22e0c8.cjs} +1 -1
- package/dist/{nylas-list-threads.entry-6395c12f.cjs → nylas-list-threads.entry-54c582af.cjs} +1 -1
- package/dist/{nylas-list-threads.entry-217088de.js → nylas-list-threads.entry-7ea370e1.js} +4 -4
- package/dist/{nylas-login.entry-e4d57589.js → nylas-login.entry-9115fd81.js} +7 -7
- package/dist/{nylas-login.entry-ec81e21b.cjs → nylas-login.entry-fb627e40.cjs} +1 -1
- package/dist/{nylas-mailbox-pagination.entry-d4d929f1.cjs → nylas-mailbox-pagination.entry-04626d27.cjs} +1 -1
- package/dist/{nylas-mailbox-pagination.entry-069673aa.js → nylas-mailbox-pagination.entry-3ff02cf9.js} +2 -2
- package/dist/{nylas-mailbox-toolbar-button.entry-2b9e4431.cjs → nylas-mailbox-toolbar-button.entry-8d00c789.cjs} +1 -1
- package/dist/{nylas-mailbox-toolbar-button.entry-03c5f5c8.js → nylas-mailbox-toolbar-button.entry-f752e925.js} +4 -4
- package/dist/{nylas-mailbox.entry-7e6b4791.js → nylas-mailbox.entry-99c27b6c.js} +4 -4
- package/dist/{nylas-mailbox.entry-1342178d.cjs → nylas-mailbox.entry-b3974f4e.cjs} +1 -1
- package/dist/{nylas-provider.entry-0ae8e70a.cjs → nylas-provider.entry-a3ad02a5.cjs} +1 -1
- package/dist/{nylas-provider.entry-498a7be9.js → nylas-provider.entry-c206aa32.js} +39 -39
- package/dist/nylas-reminder-emails.entry-414ce6fe.js +129 -0
- package/dist/nylas-reminder-emails.entry-59c07bfe.cjs +4 -0
- package/dist/nylas-reminder-time_2.entry-197d83a0.js +105 -0
- package/dist/nylas-reminder-time_2.entry-d79dcd85.cjs +1 -0
- package/dist/nylas-scheduler-editor.entry-7f389982.js +1447 -0
- package/dist/nylas-scheduler-editor.entry-f1c6964a.cjs +2 -0
- package/dist/nylas-scheduling.entry-1a8bd6fc.cjs +1 -0
- package/dist/nylas-scheduling.entry-4fa5381d.js +345 -0
- package/dist/{nylas-threads-refresh.entry-fc2d8028.js → nylas-threads-refresh.entry-20602e7b.js} +4 -4
- package/dist/{nylas-threads-refresh.entry-d020c89e.cjs → nylas-threads-refresh.entry-56b53449.cjs} +1 -1
- package/dist/{nylas-threads-search.entry-f92f7e30.js → nylas-threads-search.entry-8872473c.js} +12 -12
- package/dist/{nylas-threads-search.entry-0abcbc10.cjs → nylas-threads-search.entry-8e0ec3ae.cjs} +1 -1
- package/dist/nylas-time-window-picker.entry-9ac542b7.js +316 -0
- package/dist/nylas-time-window-picker.entry-ca47f721.cjs +1 -0
- package/dist/{nylas-view-thread.entry-56080c89.cjs → nylas-view-thread.entry-1f758e43.cjs} +1 -1
- package/dist/{nylas-view-thread.entry-2f1474cf.js → nylas-view-thread.entry-dcd3d5be.js} +6 -6
- package/dist/person-icon.entry-63b28ace.cjs +1 -0
- package/dist/person-icon.entry-93130c05.js +15 -0
- package/dist/{play-icon_2.entry-24ffa01f.js → play-icon_2.entry-6a99c32d.js} +6 -6
- package/dist/play-icon_2.entry-b67fb649.cjs +1 -0
- package/dist/react.cjs +1 -1
- package/dist/react.js +136 -90
- package/dist/{refresh-icon.entry-8395104b.js → refresh-icon.entry-84783c91.js} +4 -4
- package/dist/{refresh-icon.entry-cf4416b8.cjs → refresh-icon.entry-b49792fc.cjs} +1 -1
- package/dist/{register-component-b9cfcbaf-d40e1f3c.cjs → register-component-887199a9-003f96c5.cjs} +1 -1
- package/dist/{register-component-b9cfcbaf-c0147194.js → register-component-887199a9-b41dfa7a.js} +1 -1
- package/dist/scheduler-config-store-2a3b403d-73610089.js +27 -0
- package/dist/scheduler-config-store-2a3b403d-a5e3433a.cjs +1 -0
- package/dist/scheduler-store-fe281404-bddb1b6a.js +469 -0
- package/dist/scheduler-store-fe281404-c3e477f6.cjs +1 -0
- package/dist/textarea-component.entry-28c4bc05.cjs +1 -0
- package/dist/textarea-component.entry-40e959e5.js +36 -0
- package/dist/time-period-selector.entry-af71523a.cjs +1 -0
- package/dist/time-period-selector.entry-da5d8652.js +93 -0
- package/dist/{translate-icon.entry-d847f706.js → translate-icon.entry-92b83635.js} +5 -5
- package/dist/{translate-icon.entry-66533238.cjs → translate-icon.entry-a2ed4f76.cjs} +1 -1
- package/dist/warning-icon.entry-19f721c3.js +15 -0
- package/dist/warning-icon.entry-3ab9a59e.cjs +1 -0
- package/package.json +3 -3
- package/dist/add-circle-icon_22.entry-080abc71.cjs +0 -1
- package/dist/add-circle-icon_22.entry-bda9be31.js +0 -1818
- package/dist/archive-icon_7.entry-ca20da59.cjs +0 -1
- package/dist/chevron-icon_3.entry-74425e1f.js +0 -117
- package/dist/chevron-icon_3.entry-7ff803ad.cjs +0 -1
- package/dist/close-icon.entry-18e140ed.cjs +0 -1
- package/dist/close-icon.entry-6a8ea4a7.js +0 -15
- package/dist/document-refresh-icon.entry-f15f795a.cjs +0 -1
- package/dist/google-logo-icon_4.entry-38d5c2f2.cjs +0 -1
- package/dist/google-logo-icon_4.entry-5eca9538.js +0 -381
- package/dist/index-93c50de4.cjs +0 -37
- package/dist/index-f93f6948.js +0 -4006
- package/dist/loading-icon.entry-b563b2e6.js +0 -15
- package/dist/loading-icon.entry-fb04b893.cjs +0 -1
- package/dist/nylas-additional-participants.entry-33a45477.cjs +0 -1
- package/dist/nylas-additional-participants.entry-4b214308.js +0 -81
- package/dist/nylas-booked-event-card_10.entry-3e225025.cjs +0 -1
- package/dist/nylas-booked-event-card_10.entry-e93bc290.js +0 -782
- package/dist/nylas-form-card.entry-0748fdd5.js +0 -54
- package/dist/nylas-form-card.entry-eb3607bc.cjs +0 -1
- package/dist/nylas-scheduler-editor.entry-4de2bb97.js +0 -2275
- package/dist/nylas-scheduler-editor.entry-72c91b7d.cjs +0 -7
- package/dist/nylas-scheduling.entry-1a004916.cjs +0 -1
- package/dist/nylas-scheduling.entry-4e18ab43.js +0 -235
- package/dist/people-icon.entry-431e5044.cjs +0 -1
- package/dist/people-icon.entry-b4778e15.js +0 -15
- package/dist/play-icon_2.entry-f97db395.cjs +0 -1
- package/dist/scheduler-config-store-07d98279-0610e42f.cjs +0 -1
- package/dist/scheduler-config-store-07d98279-3b70606c.js +0 -24
- package/dist/scheduler-store-24fd0e91-2dba20c2.cjs +0 -1
- package/dist/scheduler-store-24fd0e91-47098841.js +0 -302
- package/dist/time-period-selector.entry-1e849c2e.js +0 -76
- package/dist/time-period-selector.entry-d8f3462f.cjs +0 -1
- package/dist/warning-icon.entry-1f0f00ed.cjs +0 -1
- package/dist/warning-icon.entry-b5db0151.js +0 -15
package/dist/{nylas-threads-search.entry-f92f7e30.js → nylas-threads-search.entry-8872473c.js}
RENAMED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { r as u, c as y, d, h as i, H as f } from "./index-
|
|
2
|
-
import { R as p } from "./register-component-
|
|
1
|
+
import { r as u, c as y, d as h, h as i, H as f } from "./index-5ccfd9df.js";
|
|
2
|
+
import { R as p } from "./register-component-887199a9-b41dfa7a.js";
|
|
3
3
|
import "react";
|
|
4
4
|
import "react-dom";
|
|
5
|
-
const m = ":host{display:block}sp-search{width:100%;border:0}",
|
|
6
|
-
var
|
|
5
|
+
const m = ":host{display:block}sp-search{width:100%;border:0}", g = m;
|
|
6
|
+
var b = 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")
|
|
9
9
|
a = Reflect.decorate(t, e, n, r);
|
|
@@ -15,7 +15,7 @@ var g = function(t, e, n, r) {
|
|
|
15
15
|
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
16
16
|
return Reflect.metadata(t, e);
|
|
17
17
|
};
|
|
18
|
-
const
|
|
18
|
+
const d = class {
|
|
19
19
|
constructor(t) {
|
|
20
20
|
u(this, t), this.search = y(this, "search", 7), this.onSearch = async (e) => {
|
|
21
21
|
e.preventDefault(), e.stopPropagation();
|
|
@@ -28,16 +28,16 @@ const h = class {
|
|
|
28
28
|
disconnectedCallback() {
|
|
29
29
|
}
|
|
30
30
|
async componentWillLoad() {
|
|
31
|
-
|
|
31
|
+
h("[nylas-threads-search] Component will load");
|
|
32
32
|
}
|
|
33
33
|
async componentDidLoad() {
|
|
34
|
-
|
|
34
|
+
h("[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(f, { key: "
|
|
40
|
+
return i(f, { key: "b61eeaa00c7e01d06d5b867958ac4979169f20b6" }, i("sp-theme", { key: "52d3212dc5223063e1f3f26cd8a29d555eaa3fac", scale: "medium", color: "dark" }, i("sp-search", { key: "2a15f291ae4a2e118398a01c2ddf68f1912f13fb", quiet: !0, onSubmit: this.onSearch, onBlur: this.onSearch, value: this.internalQuery })));
|
|
41
41
|
}
|
|
42
42
|
static get watchers() {
|
|
43
43
|
return {
|
|
@@ -45,7 +45,7 @@ const h = class {
|
|
|
45
45
|
};
|
|
46
46
|
}
|
|
47
47
|
};
|
|
48
|
-
|
|
48
|
+
b([
|
|
49
49
|
p({
|
|
50
50
|
name: "nylas-pagination",
|
|
51
51
|
stateToProps: /* @__PURE__ */ new Map([["mailbox.searchQuery", "query"]]),
|
|
@@ -62,8 +62,8 @@ g([
|
|
|
62
62
|
l("design:type", Function),
|
|
63
63
|
l("design:paramtypes", []),
|
|
64
64
|
l("design:returntype", void 0)
|
|
65
|
-
],
|
|
66
|
-
|
|
65
|
+
], d.prototype, "render", null);
|
|
66
|
+
d.style = g;
|
|
67
67
|
export {
|
|
68
|
-
|
|
68
|
+
d as nylas_threads_search
|
|
69
69
|
};
|
package/dist/{nylas-threads-search.entry-0abcbc10.cjs → nylas-threads-search.entry-8e0ec3ae.cjs}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./index-eb33703c.cjs"),d=require("./register-component-887199a9-003f96c5.cjs");require("react");require("react-dom");const u=":host{display:block}sp-search{width:100%;border:0}",y=u;var f=function(t,e,s,n){var o=arguments.length,r=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,s):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(t,e,s,n);else for(var i=t.length-1;i>=0;i--)(c=t[i])&&(r=(o<3?c(r):o>3?c(e,s,r):c(e,s))||r);return o>3&&r&&Object.defineProperty(e,s,r),r},l=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)};const h=class{constructor(t){a.registerInstance(this,t),this.search=a.createEvent(this,"search",7),this.onSearch=async e=>{e.preventDefault(),e.stopPropagation();const n=e.target.value;n!==this.internalQuery&&(this.internalQuery=n,this.search.emit(this.internalQuery))},this.query="",this.internalQuery=""}connectedCallback(){}disconnectedCallback(){}async componentWillLoad(){a.debug("[nylas-threads-search] Component will load")}async componentDidLoad(){a.debug("[nylas-threads-search] Component did load")}onQueryChange(){this.internalQuery=this.query}render(){return a.h(a.Host,{key:"b61eeaa00c7e01d06d5b867958ac4979169f20b6"},a.h("sp-theme",{key:"52d3212dc5223063e1f3f26cd8a29d555eaa3fac",scale:"medium",color:"dark"},a.h("sp-search",{key:"2a15f291ae4a2e118398a01c2ddf68f1912f13fb",quiet:!0,onSubmit:this.onSearch,onBlur:this.onSearch,value:this.internalQuery})))}static get watchers(){return{query:["onQueryChange"]}}};f([d.RegisterComponent({name:"nylas-pagination",stateToProps:new Map([["mailbox.searchQuery","query"]]),eventToProps:{search:async(t,e)=>{await e.threads.getThreads({search_query_native:t.detail||void 0,page_token:void 0})}},fireRegisterEvent:!0}),l("design:type",Function),l("design:paramtypes",[]),l("design:returntype",void 0)],h.prototype,"render",null);h.style=y;exports.nylas_threads_search=h;
|
|
@@ -0,0 +1,316 @@
|
|
|
1
|
+
import { i as ae, W as C, r as oe, c as N, X as _, Y as B, Z as G, _ as q, h as k, H as he, g as me } from "./index-5ccfd9df.js";
|
|
2
|
+
import "react";
|
|
3
|
+
import "react-dom";
|
|
4
|
+
var J = { exports: {} };
|
|
5
|
+
(function(e, t) {
|
|
6
|
+
(function(n, i) {
|
|
7
|
+
e.exports = i();
|
|
8
|
+
})(ae, function() {
|
|
9
|
+
var n = { LTS: "h:mm:ss A", LT: "h:mm A", L: "MM/DD/YYYY", LL: "MMMM D, YYYY", LLL: "MMMM D, YYYY h:mm A", LLLL: "dddd, MMMM D, YYYY h:mm A" }, i = /(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|YYYY|YY?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g, r = /\d\d/, o = /\d\d?/, v = /\d*[^-_:/,()\s\d]+/, x = {}, V = function(s) {
|
|
10
|
+
return (s = +s) + (s > 68 ? 1900 : 2e3);
|
|
11
|
+
}, l = function(s) {
|
|
12
|
+
return function(a) {
|
|
13
|
+
this[s] = +a;
|
|
14
|
+
};
|
|
15
|
+
}, U = [/[+-]\d\d:?(\d\d)?|Z/, function(s) {
|
|
16
|
+
(this.zone || (this.zone = {})).offset = function(a) {
|
|
17
|
+
if (!a || a === "Z")
|
|
18
|
+
return 0;
|
|
19
|
+
var h = a.match(/([+-]|\d\d)/g), m = 60 * h[1] + (+h[2] || 0);
|
|
20
|
+
return m === 0 ? 0 : h[0] === "+" ? -m : m;
|
|
21
|
+
}(s);
|
|
22
|
+
}], P = function(s) {
|
|
23
|
+
var a = x[s];
|
|
24
|
+
return a && (a.indexOf ? a : a.s.concat(a.f));
|
|
25
|
+
}, X = function(s, a) {
|
|
26
|
+
var h, m = x.meridiem;
|
|
27
|
+
if (m) {
|
|
28
|
+
for (var f = 1; f <= 24; f += 1)
|
|
29
|
+
if (s.indexOf(m(f, 0, a)) > -1) {
|
|
30
|
+
h = f > 12;
|
|
31
|
+
break;
|
|
32
|
+
}
|
|
33
|
+
} else
|
|
34
|
+
h = s === (a ? "pm" : "PM");
|
|
35
|
+
return h;
|
|
36
|
+
}, Q = { A: [v, function(s) {
|
|
37
|
+
this.afternoon = X(s, !1);
|
|
38
|
+
}], a: [v, function(s) {
|
|
39
|
+
this.afternoon = X(s, !0);
|
|
40
|
+
}], S: [/\d/, function(s) {
|
|
41
|
+
this.milliseconds = 100 * +s;
|
|
42
|
+
}], SS: [r, function(s) {
|
|
43
|
+
this.milliseconds = 10 * +s;
|
|
44
|
+
}], SSS: [/\d{3}/, function(s) {
|
|
45
|
+
this.milliseconds = +s;
|
|
46
|
+
}], s: [o, l("seconds")], ss: [o, l("seconds")], m: [o, l("minutes")], mm: [o, l("minutes")], H: [o, l("hours")], h: [o, l("hours")], HH: [o, l("hours")], hh: [o, l("hours")], D: [o, l("day")], DD: [r, l("day")], Do: [v, function(s) {
|
|
47
|
+
var a = x.ordinal, h = s.match(/\d+/);
|
|
48
|
+
if (this.day = h[0], a)
|
|
49
|
+
for (var m = 1; m <= 31; m += 1)
|
|
50
|
+
a(m).replace(/\[|\]/g, "") === s && (this.day = m);
|
|
51
|
+
}], M: [o, l("month")], MM: [r, l("month")], MMM: [v, function(s) {
|
|
52
|
+
var a = P("months"), h = (P("monthsShort") || a.map(function(m) {
|
|
53
|
+
return m.slice(0, 3);
|
|
54
|
+
})).indexOf(s) + 1;
|
|
55
|
+
if (h < 1)
|
|
56
|
+
throw new Error();
|
|
57
|
+
this.month = h % 12 || h;
|
|
58
|
+
}], MMMM: [v, function(s) {
|
|
59
|
+
var a = P("months").indexOf(s) + 1;
|
|
60
|
+
if (a < 1)
|
|
61
|
+
throw new Error();
|
|
62
|
+
this.month = a % 12 || a;
|
|
63
|
+
}], Y: [/[+-]?\d+/, l("year")], YY: [r, function(s) {
|
|
64
|
+
this.year = V(s);
|
|
65
|
+
}], YYYY: [/\d{4}/, l("year")], Z: U, ZZ: U };
|
|
66
|
+
function ee(s) {
|
|
67
|
+
var a, h;
|
|
68
|
+
a = s, h = x && x.formats;
|
|
69
|
+
for (var m = (s = a.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g, function(S, b, u) {
|
|
70
|
+
var d = u && u.toUpperCase();
|
|
71
|
+
return b || h[u] || n[u] || h[d].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, function(w, T, D) {
|
|
72
|
+
return T || D.slice(1);
|
|
73
|
+
});
|
|
74
|
+
})).match(i), f = m.length, p = 0; p < f; p += 1) {
|
|
75
|
+
var L = m[p], I = Q[L], y = I && I[0], g = I && I[1];
|
|
76
|
+
m[p] = g ? { regex: y, parser: g } : L.replace(/^\[|\]$/g, "");
|
|
77
|
+
}
|
|
78
|
+
return function(S) {
|
|
79
|
+
for (var b = {}, u = 0, d = 0; u < f; u += 1) {
|
|
80
|
+
var w = m[u];
|
|
81
|
+
if (typeof w == "string")
|
|
82
|
+
d += w.length;
|
|
83
|
+
else {
|
|
84
|
+
var T = w.regex, D = w.parser, E = S.slice(d), A = T.exec(E)[0];
|
|
85
|
+
D.call(b, A), S = S.replace(A, "");
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
return function(M) {
|
|
89
|
+
var c = M.afternoon;
|
|
90
|
+
if (c !== void 0) {
|
|
91
|
+
var Y = M.hours;
|
|
92
|
+
c ? Y < 12 && (M.hours += 12) : Y === 12 && (M.hours = 0), delete M.afternoon;
|
|
93
|
+
}
|
|
94
|
+
}(b), b;
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
return function(s, a, h) {
|
|
98
|
+
h.p.customParseFormat = !0, s && s.parseTwoDigitYear && (V = s.parseTwoDigitYear);
|
|
99
|
+
var m = a.prototype, f = m.parse;
|
|
100
|
+
m.parse = function(p) {
|
|
101
|
+
var L = p.date, I = p.utc, y = p.args;
|
|
102
|
+
this.$u = I;
|
|
103
|
+
var g = y[1];
|
|
104
|
+
if (typeof g == "string") {
|
|
105
|
+
var S = y[2] === !0, b = y[3] === !0, u = S || b, d = y[2];
|
|
106
|
+
b && (d = y[2]), x = this.$locale(), !S && d && (x = h.Ls[d]), this.$d = function(E, A, M) {
|
|
107
|
+
try {
|
|
108
|
+
if (["x", "X"].indexOf(A) > -1)
|
|
109
|
+
return new Date((A === "X" ? 1e3 : 1) * E);
|
|
110
|
+
var c = ee(A)(E), Y = c.year, O = c.month, te = c.day, ie = c.hours, se = c.minutes, ne = c.seconds, re = c.milliseconds, j = c.zone, z = /* @__PURE__ */ new Date(), F = te || (Y || O ? 1 : z.getDate()), H = Y || z.getFullYear(), $ = 0;
|
|
111
|
+
Y && !O || ($ = O > 0 ? O - 1 : z.getMonth());
|
|
112
|
+
var K = ie || 0, Z = se || 0, R = ne || 0, W = re || 0;
|
|
113
|
+
return j ? new Date(Date.UTC(H, $, F, K, Z, R, W + 60 * j.offset * 1e3)) : M ? new Date(Date.UTC(H, $, F, K, Z, R, W)) : new Date(H, $, F, K, Z, R, W);
|
|
114
|
+
} catch {
|
|
115
|
+
return /* @__PURE__ */ new Date("");
|
|
116
|
+
}
|
|
117
|
+
}(L, g, I), this.init(), d && d !== !0 && (this.$L = this.locale(d).$L), u && L != this.format(g) && (this.$d = /* @__PURE__ */ new Date("")), x = {};
|
|
118
|
+
} else if (g instanceof Array)
|
|
119
|
+
for (var w = g.length, T = 1; T <= w; T += 1) {
|
|
120
|
+
y[1] = g[T - 1];
|
|
121
|
+
var D = h.apply(this, y);
|
|
122
|
+
if (D.isValid()) {
|
|
123
|
+
this.$d = D.$d, this.$L = D.$L, this.init();
|
|
124
|
+
break;
|
|
125
|
+
}
|
|
126
|
+
T === w && (this.$d = /* @__PURE__ */ new Date(""));
|
|
127
|
+
}
|
|
128
|
+
else
|
|
129
|
+
f.call(this, p);
|
|
130
|
+
};
|
|
131
|
+
};
|
|
132
|
+
});
|
|
133
|
+
})(J);
|
|
134
|
+
const le = J.exports, de = ':host{display:block;position:relative;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif}.time-picker{display:inline-block;width:150px;font-family:var(--nylas-font-family);position:relative}@media screen and (max-width: 768px){.time-picker{width:auto}}.time-picker input{width:150px;height:48px;text-align:center;font-size:16px;font-family:inherit;cursor:pointer;background:transparent;border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x)}@media screen and (max-width: 768px){.time-picker input{width:88px}}@media screen and (max-width: 504px){.time-picker input{width:68px;font-size:15px}}.time-picker input.focus{background:transparent}.time-picker input:hover,.time-picker input:active{border:1px solid var(--nylas-primary)}.time-picker input:active{outline:2px solid var(--nylas-primary)}.time-picker input span.open{transform:rotate(90deg)}.time-picker input span.closed{transform:rotate(270deg)}.time-picker input.error{border:1px solid var(--nylas-error)}.time-picker p.error{color:var(--nylas-error);font-size:0.875rem;margin:0}.times{display:block;margin-top:0.5rem;background-color:var(--nylas-base-0);width:100%;max-height:336px;overflow:auto;border:1px solid #ddd;z-index:1;border-radius:4px;position:absolute;box-shadow:0px 4px 6px -2px rgba(0, 0, 0, 0.0509803922);box-shadow:0px 10px 15px -3px rgba(0, 0, 0, 0.1019607843)}.times ul{padding:0;list-style-type:none;color:var(--nylas-base-900);max-height:336px}.times ul li{padding:16px, 12px, 16px, 12px;color:black;padding:12px 16px;text-decoration:none;display:block;font-family:inherit;font-size:14px;font-weight:400;line-height:20px;letter-spacing:0px;text-align:center;cursor:pointer}.times ul li.focused{background-color:var(--nylas-base-100)}.times ul li:hover,.times ul li:focus{background-color:var(--nylas-base-100)}.times ul li label{display:flex;align-items:center;gap:0.5rem}.times ul li label input{margin:0}', ce = de;
|
|
135
|
+
C.extend(le);
|
|
136
|
+
const ue = class {
|
|
137
|
+
constructor(e) {
|
|
138
|
+
oe(this, e), this.timeChange = N(this, "timeChange", 7), this.formError = N(this, "formError", 7), this.time = void 0, this.minimumStartTime = null, this.placeholder = "hh:mmam/pm", this.name = void 0, this.hasError = !1, this.err = "", this.showTimes = !1, this.ariaActivedescendant = "", this.times = this.generateTimes(), this.shouldAutoScroll = !1;
|
|
139
|
+
}
|
|
140
|
+
handleOutsideClick(e) {
|
|
141
|
+
!e.composedPath().includes(this.el) && this.showTimes && (this.showTimes = !1);
|
|
142
|
+
}
|
|
143
|
+
minimumStartTimeChangedHandler() {
|
|
144
|
+
if (this.minimumStartTime) {
|
|
145
|
+
let e = C().hour(parseInt(this.minimumStartTime)).minute(parseInt(this.minimumStartTime.slice(-4, -2)));
|
|
146
|
+
this.minimumStartTime.slice(-2).toLowerCase() === "pm" && parseInt(this.minimumStartTime) !== 12 ? e = e.add(12, "hour") : this.minimumStartTime.slice(-2).toLowerCase() === "am" && parseInt(this.minimumStartTime) === 12 && (e = e.subtract(12, "hour")), this.times = this.generateTimes();
|
|
147
|
+
const t = C(this.times[0].value, "hh:mma");
|
|
148
|
+
C(this.time, "hh:mma").isBefore(t) && (this.err = "Invalid", this.formError.emit({
|
|
149
|
+
key: this.el.id,
|
|
150
|
+
message: "Invalid"
|
|
151
|
+
}));
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
componentDidRender() {
|
|
155
|
+
if (this.showTimes && this.shouldAutoScroll) {
|
|
156
|
+
const e = _(this.time), t = this.times.findIndex((n) => n.value === e);
|
|
157
|
+
t > -1 && (this.shouldAutoScroll = !1, this.scrollToViewWithinParent(t));
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
handleTimeChange(e, t) {
|
|
162
|
+
const n = t.split(":");
|
|
163
|
+
n[0] === "00" && n[1].slice(-2) == "pm" && (this.err = "Invalid", this.formError.emit({
|
|
164
|
+
key: this.el.id,
|
|
165
|
+
message: "Invalid"
|
|
166
|
+
})), B(t) ? (this.err = "", this.formError.emit({
|
|
167
|
+
key: this.el.id,
|
|
168
|
+
message: ""
|
|
169
|
+
})) : (this.err = "Invalid", this.formError.emit({
|
|
170
|
+
key: this.el.id,
|
|
171
|
+
message: "Invalid"
|
|
172
|
+
})), this.timeChange.emit({
|
|
173
|
+
key: this.el.id,
|
|
174
|
+
value: t
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
handleTimeAutocomplete(e) {
|
|
178
|
+
var n;
|
|
179
|
+
const t = (n = e.target) == null ? void 0 : n.value;
|
|
180
|
+
if (!B(t)) {
|
|
181
|
+
this.err = "Invalid", this.formError.emit({
|
|
182
|
+
key: this.el.id,
|
|
183
|
+
message: "Invalid"
|
|
184
|
+
});
|
|
185
|
+
return;
|
|
186
|
+
}
|
|
187
|
+
if (t === "") {
|
|
188
|
+
const i = G().format("hh:mma");
|
|
189
|
+
this.timeChange.emit({
|
|
190
|
+
key: this.el.id,
|
|
191
|
+
value: i
|
|
192
|
+
});
|
|
193
|
+
return;
|
|
194
|
+
}
|
|
195
|
+
if (!q(t)) {
|
|
196
|
+
const i = _(t);
|
|
197
|
+
this.timeChange.emit({
|
|
198
|
+
key: this.el.id,
|
|
199
|
+
value: i
|
|
200
|
+
});
|
|
201
|
+
return;
|
|
202
|
+
}
|
|
203
|
+
this.timeChange.emit({
|
|
204
|
+
key: this.el.id,
|
|
205
|
+
value: t
|
|
206
|
+
});
|
|
207
|
+
}
|
|
208
|
+
handleOnInput(e) {
|
|
209
|
+
var n;
|
|
210
|
+
const t = (n = e.target) == null ? void 0 : n.value;
|
|
211
|
+
if (B(t)) {
|
|
212
|
+
if (t === "") {
|
|
213
|
+
const i = G().format("hh:mma"), r = this.times.findIndex((o) => o.value === i);
|
|
214
|
+
r > -1 && this.scrollToViewWithinParent(r);
|
|
215
|
+
return;
|
|
216
|
+
}
|
|
217
|
+
if (!q(t)) {
|
|
218
|
+
const i = _(t), r = this.times.findIndex((o) => o.value === i);
|
|
219
|
+
r > -1 && this.scrollToViewWithinParent(r);
|
|
220
|
+
return;
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
generateTimes() {
|
|
225
|
+
const e = [];
|
|
226
|
+
let t = C().set("hour", 0).set("minute", 0).set("second", 0);
|
|
227
|
+
this.minimumStartTime && (t = C(this.minimumStartTime, "hh:mma"));
|
|
228
|
+
const n = t.endOf("day").diff(t, "minutes"), i = Math.round(n / 15);
|
|
229
|
+
for (let r = 0; r < i + 1; r++) {
|
|
230
|
+
const o = t.add(r * 15, "minute");
|
|
231
|
+
if (r == i && o.format("hh:mma").includes("am"))
|
|
232
|
+
break;
|
|
233
|
+
e.push({ id: r, value: o.format("hh:mma") });
|
|
234
|
+
}
|
|
235
|
+
return e;
|
|
236
|
+
}
|
|
237
|
+
handleComboboxKeyDown(e) {
|
|
238
|
+
if (e.key === "ArrowDown") {
|
|
239
|
+
if (e.preventDefault(), !this.showTimes) {
|
|
240
|
+
this.showTimes = !0, this.shouldAutoScroll = !0;
|
|
241
|
+
return;
|
|
242
|
+
}
|
|
243
|
+
if (this.ariaActivedescendant === "")
|
|
244
|
+
this.ariaActivedescendant = this.times[0].id.toString(), this.focusOption(0);
|
|
245
|
+
else {
|
|
246
|
+
const t = this.times.findIndex((i) => i.id.toString() === this.ariaActivedescendant), n = t + 1 < this.times.length ? t + 1 : 0;
|
|
247
|
+
this.ariaActivedescendant = this.times[n].id.toString(), this.focusOption(n);
|
|
248
|
+
}
|
|
249
|
+
} else if (e.key === "ArrowUp")
|
|
250
|
+
if (e.preventDefault(), this.ariaActivedescendant === "")
|
|
251
|
+
this.ariaActivedescendant = this.times[this.times.length - 1].id.toString(), this.focusOption(this.times.length - 1);
|
|
252
|
+
else {
|
|
253
|
+
const t = this.times.findIndex((i) => i.id.toString() === this.ariaActivedescendant), n = t - 1 >= 0 ? t - 1 : this.times.length - 1;
|
|
254
|
+
this.ariaActivedescendant = this.times[n].id.toString(), this.focusOption(n);
|
|
255
|
+
}
|
|
256
|
+
else
|
|
257
|
+
e.key === "Escape" && (this.showTimes = !1, this.timeInput.focus());
|
|
258
|
+
}
|
|
259
|
+
handleListboxKeydown(e) {
|
|
260
|
+
const t = this.times, n = t.findIndex((i) => i.id.toString() === this.ariaActivedescendant);
|
|
261
|
+
if (e.key === "ArrowDown" || e.key === "Tab" && !e.shiftKey) {
|
|
262
|
+
e.preventDefault();
|
|
263
|
+
const i = n + 1 < t.length ? n + 1 : 0;
|
|
264
|
+
this.ariaActivedescendant = t[i].id.toString(), this.focusOption(i);
|
|
265
|
+
} else if (e.key === "ArrowUp" || e.key === "Tab" && e.shiftKey) {
|
|
266
|
+
e.preventDefault();
|
|
267
|
+
const i = n - 1 >= 0 ? n - 1 : t.length - 1;
|
|
268
|
+
this.ariaActivedescendant = t[i].id.toString(), this.focusOption(i);
|
|
269
|
+
} else if (e.key === "Enter") {
|
|
270
|
+
if (e.preventDefault(), this.ariaActivedescendant) {
|
|
271
|
+
const i = t[n];
|
|
272
|
+
this.handleTimeChange(e, i.value), this.showTimes = !1, this.ariaActivedescendant = "", this.timeInput.focus();
|
|
273
|
+
}
|
|
274
|
+
} else
|
|
275
|
+
e.key === "Escape" && (this.showTimes = !1, this.timeInput.focus());
|
|
276
|
+
}
|
|
277
|
+
scrollToViewWithinParent(e) {
|
|
278
|
+
var v;
|
|
279
|
+
const t = this.times[e], n = (v = this.el.shadowRoot) == null ? void 0 : v.getElementById(t.id.toString()), i = this.timeMenu;
|
|
280
|
+
this.ariaActivedescendant = t.id.toString();
|
|
281
|
+
const r = n.getBoundingClientRect(), o = i.getBoundingClientRect();
|
|
282
|
+
r.top < o.top ? i.scrollTop -= o.top - r.top : r.bottom > o.bottom && (i.scrollTop += r.bottom - o.bottom), r.left < o.left ? i.scrollLeft -= o.left - r.left : r.right > o.right && (i.scrollLeft += r.right - o.right);
|
|
283
|
+
}
|
|
284
|
+
focusOption(e) {
|
|
285
|
+
var r;
|
|
286
|
+
const t = this.times[e];
|
|
287
|
+
if (!t)
|
|
288
|
+
return;
|
|
289
|
+
const n = t.id.toString(), i = (r = this.el.shadowRoot) == null ? void 0 : r.getElementById(n);
|
|
290
|
+
i && (i.focus(), i.scrollIntoView({ behavior: "smooth", block: "nearest" }));
|
|
291
|
+
}
|
|
292
|
+
render() {
|
|
293
|
+
return k(he, { key: "f9e043d1053de00843aab2ba2fc790fa03710a6c" }, k("div", { key: "c94d6067be1848d766075088fc8b7b7b9f894302", class: "time-picker", part: "time-picker" }, k("input", { key: "4f9826a61fc6a5c39c9af5c17489be9d1b177c22", type: "text", name: this.name, id: this.name, part: "time-input", class: {
|
|
294
|
+
"time-input": !0,
|
|
295
|
+
error: !!this.err || this.hasError
|
|
296
|
+
}, ref: (e) => this.timeInput = e, value: this.time, onClick: () => {
|
|
297
|
+
this.showTimes = !this.showTimes, this.shouldAutoScroll = !0;
|
|
298
|
+
}, "aria-haspopup": "listbox", "aria-label": this.name, "aria-expanded": this.showTimes ? "true" : "false", placeholder: this.placeholder, onKeyDown: (e) => this.handleComboboxKeyDown(e), onInput: (e) => this.handleOnInput(e), onBlur: (e) => this.handleTimeAutocomplete(e) }), this.err && k("div", { class: "invalid-time-icon" }), this.showTimes && k("div", { class: "times", part: "times", ref: (e) => this.timeMenu = e }, k("ul", { tabindex: "-1", role: "listbox", "aria-label": this.name, "aria-activedescendant": this.ariaActivedescendant, onKeyDown: (e) => this.handleListboxKeydown(e) }, this.times.map((e) => k("li", { tabindex: "0", key: e.id, id: e.id.toString(), class: {
|
|
299
|
+
focused: this.ariaActivedescendant === e.id.toString()
|
|
300
|
+
}, onClick: (t) => {
|
|
301
|
+
this.handleTimeChange(t, e.value), this.showTimes = !1, this.timeInput.focus();
|
|
302
|
+
}, role: "option" }, `${e.value}`)))), !this.showTimes && this.err && k("p", { class: "error", id: "email-error" }, this.err)));
|
|
303
|
+
}
|
|
304
|
+
get el() {
|
|
305
|
+
return me(this);
|
|
306
|
+
}
|
|
307
|
+
static get watchers() {
|
|
308
|
+
return {
|
|
309
|
+
minimumStartTime: ["minimumStartTimeChangedHandler"]
|
|
310
|
+
};
|
|
311
|
+
}
|
|
312
|
+
};
|
|
313
|
+
ue.style = ce;
|
|
314
|
+
export {
|
|
315
|
+
ue as nylas_time_window_picker
|
|
316
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index-eb33703c.cjs");require("react");require("react-dom");var _={exports:{}};(function(e,t){(function(n,i){e.exports=i()})(r.commonjsGlobal,function(){var n={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},i=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|YYYY|YY?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,a=/\d\d/,h=/\d\d?/,x=/\d*[^-_:/,()\s\d]+/,b={},Z=function(s){return(s=+s)+(s>68?1900:2e3)},d=function(s){return function(o){this[s]=+o}},B=[/[+-]\d\d:?(\d\d)?|Z/,function(s){(this.zone||(this.zone={})).offset=function(o){if(!o||o==="Z")return 0;var m=o.match(/([+-]|\d\d)/g),l=60*m[1]+(+m[2]||0);return l===0?0:m[0]==="+"?-l:l}(s)}],F=function(s){var o=b[s];return o&&(o.indexOf?o:o.s.concat(o.f))},V=function(s,o){var m,l=b.meridiem;if(l){for(var p=1;p<=24;p+=1)if(s.indexOf(l(p,0,o))>-1){m=p>12;break}}else m=s===(o?"pm":"PM");return m},q={A:[x,function(s){this.afternoon=V(s,!1)}],a:[x,function(s){this.afternoon=V(s,!0)}],S:[/\d/,function(s){this.milliseconds=100*+s}],SS:[a,function(s){this.milliseconds=10*+s}],SSS:[/\d{3}/,function(s){this.milliseconds=+s}],s:[h,d("seconds")],ss:[h,d("seconds")],m:[h,d("minutes")],mm:[h,d("minutes")],H:[h,d("hours")],h:[h,d("hours")],HH:[h,d("hours")],hh:[h,d("hours")],D:[h,d("day")],DD:[a,d("day")],Do:[x,function(s){var o=b.ordinal,m=s.match(/\d+/);if(this.day=m[0],o)for(var l=1;l<=31;l+=1)o(l).replace(/\[|\]/g,"")===s&&(this.day=l)}],M:[h,d("month")],MM:[a,d("month")],MMM:[x,function(s){var o=F("months"),m=(F("monthsShort")||o.map(function(l){return l.slice(0,3)})).indexOf(s)+1;if(m<1)throw new Error;this.month=m%12||m}],MMMM:[x,function(s){var o=F("months").indexOf(s)+1;if(o<1)throw new Error;this.month=o%12||o}],Y:[/[+-]?\d+/,d("year")],YY:[a,function(s){this.year=Z(s)}],YYYY:[/\d{4}/,d("year")],Z:B,ZZ:B};function N(s){var o,m;o=s,m=b&&b.formats;for(var l=(s=o.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(S,T,f){var c=f&&f.toUpperCase();return T||m[f]||n[f]||m[c].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(w,k,M){return k||M.slice(1)})})).match(i),p=l.length,y=0;y<p;y+=1){var C=l[y],I=q[C],v=I&&I[0],g=I&&I[1];l[y]=g?{regex:v,parser:g}:C.replace(/^\[|\]$/g,"")}return function(S){for(var T={},f=0,c=0;f<p;f+=1){var w=l[f];if(typeof w=="string")c+=w.length;else{var k=w.regex,M=w.parser,L=S.slice(c),A=k.exec(L)[0];M.call(T,A),S=S.replace(A,"")}}return function(D){var u=D.afternoon;if(u!==void 0){var Y=D.hours;u?Y<12&&(D.hours+=12):Y===12&&(D.hours=0),delete D.afternoon}}(T),T}}return function(s,o,m){m.p.customParseFormat=!0,s&&s.parseTwoDigitYear&&(Z=s.parseTwoDigitYear);var l=o.prototype,p=l.parse;l.parse=function(y){var C=y.date,I=y.utc,v=y.args;this.$u=I;var g=v[1];if(typeof g=="string"){var S=v[2]===!0,T=v[3]===!0,f=S||T,c=v[2];T&&(c=v[2]),b=this.$locale(),!S&&c&&(b=m.Ls[c]),this.$d=function(L,A,D){try{if(["x","X"].indexOf(A)>-1)return new Date((A==="X"?1e3:1)*L);var u=N(A)(L),Y=u.year,E=u.month,X=u.day,G=u.hours,J=u.minutes,Q=u.seconds,ee=u.milliseconds,W=u.zone,$=new Date,P=X||(Y||E?1:$.getDate()),z=Y||$.getFullYear(),O=0;Y&&!E||(O=E>0?E-1:$.getMonth());var j=G||0,H=J||0,K=Q||0,R=ee||0;return W?new Date(Date.UTC(z,O,P,j,H,K,R+60*W.offset*1e3)):D?new Date(Date.UTC(z,O,P,j,H,K,R)):new Date(z,O,P,j,H,K,R)}catch{return new Date("")}}(C,g,I),this.init(),c&&c!==!0&&(this.$L=this.locale(c).$L),f&&C!=this.format(g)&&(this.$d=new Date("")),b={}}else if(g instanceof Array)for(var w=g.length,k=1;k<=w;k+=1){v[1]=g[k-1];var M=m.apply(this,v);if(M.isValid()){this.$d=M.$d,this.$L=M.$L,this.init();break}k===w&&(this.$d=new Date(""))}else p.call(this,y)}}})})(_);const te=_.exports,ie=':host{display:block;position:relative;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif}.time-picker{display:inline-block;width:150px;font-family:var(--nylas-font-family);position:relative}@media screen and (max-width: 768px){.time-picker{width:auto}}.time-picker input{width:150px;height:48px;text-align:center;font-size:16px;font-family:inherit;cursor:pointer;background:transparent;border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x)}@media screen and (max-width: 768px){.time-picker input{width:88px}}@media screen and (max-width: 504px){.time-picker input{width:68px;font-size:15px}}.time-picker input.focus{background:transparent}.time-picker input:hover,.time-picker input:active{border:1px solid var(--nylas-primary)}.time-picker input:active{outline:2px solid var(--nylas-primary)}.time-picker input span.open{transform:rotate(90deg)}.time-picker input span.closed{transform:rotate(270deg)}.time-picker input.error{border:1px solid var(--nylas-error)}.time-picker p.error{color:var(--nylas-error);font-size:0.875rem;margin:0}.times{display:block;margin-top:0.5rem;background-color:var(--nylas-base-0);width:100%;max-height:336px;overflow:auto;border:1px solid #ddd;z-index:1;border-radius:4px;position:absolute;box-shadow:0px 4px 6px -2px rgba(0, 0, 0, 0.0509803922);box-shadow:0px 10px 15px -3px rgba(0, 0, 0, 0.1019607843)}.times ul{padding:0;list-style-type:none;color:var(--nylas-base-900);max-height:336px}.times ul li{padding:16px, 12px, 16px, 12px;color:black;padding:12px 16px;text-decoration:none;display:block;font-family:inherit;font-size:14px;font-weight:400;line-height:20px;letter-spacing:0px;text-align:center;cursor:pointer}.times ul li.focused{background-color:var(--nylas-base-100)}.times ul li:hover,.times ul li:focus{background-color:var(--nylas-base-100)}.times ul li label{display:flex;align-items:center;gap:0.5rem}.times ul li label input{margin:0}',se=ie;r.dayjs.extend(te);const U=class{constructor(e){r.registerInstance(this,e),this.timeChange=r.createEvent(this,"timeChange",7),this.formError=r.createEvent(this,"formError",7),this.time=void 0,this.minimumStartTime=null,this.placeholder="hh:mmam/pm",this.name=void 0,this.hasError=!1,this.err="",this.showTimes=!1,this.ariaActivedescendant="",this.times=this.generateTimes(),this.shouldAutoScroll=!1}handleOutsideClick(e){!e.composedPath().includes(this.el)&&this.showTimes&&(this.showTimes=!1)}minimumStartTimeChangedHandler(){if(this.minimumStartTime){let e=r.dayjs().hour(parseInt(this.minimumStartTime)).minute(parseInt(this.minimumStartTime.slice(-4,-2)));this.minimumStartTime.slice(-2).toLowerCase()==="pm"&&parseInt(this.minimumStartTime)!==12?e=e.add(12,"hour"):this.minimumStartTime.slice(-2).toLowerCase()==="am"&&parseInt(this.minimumStartTime)===12&&(e=e.subtract(12,"hour")),this.times=this.generateTimes();const t=r.dayjs(this.times[0].value,"hh:mma");r.dayjs(this.time,"hh:mma").isBefore(t)&&(this.err="Invalid",this.formError.emit({key:this.el.id,message:"Invalid"}))}}componentDidRender(){if(this.showTimes&&this.shouldAutoScroll){const e=r.autocompleteTimeFormat(this.time),t=this.times.findIndex(n=>n.value===e);t>-1&&(this.shouldAutoScroll=!1,this.scrollToViewWithinParent(t));return}}handleTimeChange(e,t){const n=t.split(":");n[0]==="00"&&n[1].slice(-2)=="pm"&&(this.err="Invalid",this.formError.emit({key:this.el.id,message:"Invalid"})),r.validateTimeFormatInput(t)?(this.err="",this.formError.emit({key:this.el.id,message:""})):(this.err="Invalid",this.formError.emit({key:this.el.id,message:"Invalid"})),this.timeChange.emit({key:this.el.id,value:t})}handleTimeAutocomplete(e){var n;const t=(n=e.target)==null?void 0:n.value;if(!r.validateTimeFormatInput(t)){this.err="Invalid",this.formError.emit({key:this.el.id,message:"Invalid"});return}if(t===""){const i=r.roundToNearest15Minutes().format("hh:mma");this.timeChange.emit({key:this.el.id,value:i});return}if(!r.validateExactTimeFormat(t)){const i=r.autocompleteTimeFormat(t);this.timeChange.emit({key:this.el.id,value:i});return}this.timeChange.emit({key:this.el.id,value:t})}handleOnInput(e){var n;const t=(n=e.target)==null?void 0:n.value;if(r.validateTimeFormatInput(t)){if(t===""){const i=r.roundToNearest15Minutes().format("hh:mma"),a=this.times.findIndex(h=>h.value===i);a>-1&&this.scrollToViewWithinParent(a);return}if(!r.validateExactTimeFormat(t)){const i=r.autocompleteTimeFormat(t),a=this.times.findIndex(h=>h.value===i);a>-1&&this.scrollToViewWithinParent(a);return}}}generateTimes(){const e=[];let t=r.dayjs().set("hour",0).set("minute",0).set("second",0);this.minimumStartTime&&(t=r.dayjs(this.minimumStartTime,"hh:mma"));const n=t.endOf("day").diff(t,"minutes"),i=Math.round(n/15);for(let a=0;a<i+1;a++){const h=t.add(a*15,"minute");if(a==i&&h.format("hh:mma").includes("am"))break;e.push({id:a,value:h.format("hh:mma")})}return e}handleComboboxKeyDown(e){if(e.key==="ArrowDown"){if(e.preventDefault(),!this.showTimes){this.showTimes=!0,this.shouldAutoScroll=!0;return}if(this.ariaActivedescendant==="")this.ariaActivedescendant=this.times[0].id.toString(),this.focusOption(0);else{const t=this.times.findIndex(i=>i.id.toString()===this.ariaActivedescendant),n=t+1<this.times.length?t+1:0;this.ariaActivedescendant=this.times[n].id.toString(),this.focusOption(n)}}else if(e.key==="ArrowUp")if(e.preventDefault(),this.ariaActivedescendant==="")this.ariaActivedescendant=this.times[this.times.length-1].id.toString(),this.focusOption(this.times.length-1);else{const t=this.times.findIndex(i=>i.id.toString()===this.ariaActivedescendant),n=t-1>=0?t-1:this.times.length-1;this.ariaActivedescendant=this.times[n].id.toString(),this.focusOption(n)}else e.key==="Escape"&&(this.showTimes=!1,this.timeInput.focus())}handleListboxKeydown(e){const t=this.times,n=t.findIndex(i=>i.id.toString()===this.ariaActivedescendant);if(e.key==="ArrowDown"||e.key==="Tab"&&!e.shiftKey){e.preventDefault();const i=n+1<t.length?n+1:0;this.ariaActivedescendant=t[i].id.toString(),this.focusOption(i)}else if(e.key==="ArrowUp"||e.key==="Tab"&&e.shiftKey){e.preventDefault();const i=n-1>=0?n-1:t.length-1;this.ariaActivedescendant=t[i].id.toString(),this.focusOption(i)}else if(e.key==="Enter"){if(e.preventDefault(),this.ariaActivedescendant){const i=t[n];this.handleTimeChange(e,i.value),this.showTimes=!1,this.ariaActivedescendant="",this.timeInput.focus()}}else e.key==="Escape"&&(this.showTimes=!1,this.timeInput.focus())}scrollToViewWithinParent(e){var x;const t=this.times[e],n=(x=this.el.shadowRoot)==null?void 0:x.getElementById(t.id.toString()),i=this.timeMenu;this.ariaActivedescendant=t.id.toString();const a=n.getBoundingClientRect(),h=i.getBoundingClientRect();a.top<h.top?i.scrollTop-=h.top-a.top:a.bottom>h.bottom&&(i.scrollTop+=a.bottom-h.bottom),a.left<h.left?i.scrollLeft-=h.left-a.left:a.right>h.right&&(i.scrollLeft+=a.right-h.right)}focusOption(e){var a;const t=this.times[e];if(!t)return;const n=t.id.toString(),i=(a=this.el.shadowRoot)==null?void 0:a.getElementById(n);i&&(i.focus(),i.scrollIntoView({behavior:"smooth",block:"nearest"}))}render(){return r.h(r.Host,{key:"f9e043d1053de00843aab2ba2fc790fa03710a6c"},r.h("div",{key:"c94d6067be1848d766075088fc8b7b7b9f894302",class:"time-picker",part:"time-picker"},r.h("input",{key:"4f9826a61fc6a5c39c9af5c17489be9d1b177c22",type:"text",name:this.name,id:this.name,part:"time-input",class:{"time-input":!0,error:!!this.err||this.hasError},ref:e=>this.timeInput=e,value:this.time,onClick:()=>{this.showTimes=!this.showTimes,this.shouldAutoScroll=!0},"aria-haspopup":"listbox","aria-label":this.name,"aria-expanded":this.showTimes?"true":"false",placeholder:this.placeholder,onKeyDown:e=>this.handleComboboxKeyDown(e),onInput:e=>this.handleOnInput(e),onBlur:e=>this.handleTimeAutocomplete(e)}),this.err&&r.h("div",{class:"invalid-time-icon"}),this.showTimes&&r.h("div",{class:"times",part:"times",ref:e=>this.timeMenu=e},r.h("ul",{tabindex:"-1",role:"listbox","aria-label":this.name,"aria-activedescendant":this.ariaActivedescendant,onKeyDown:e=>this.handleListboxKeydown(e)},this.times.map(e=>r.h("li",{tabindex:"0",key:e.id,id:e.id.toString(),class:{focused:this.ariaActivedescendant===e.id.toString()},onClick:t=>{this.handleTimeChange(t,e.value),this.showTimes=!1,this.timeInput.focus()},role:"option"},`${e.value}`)))),!this.showTimes&&this.err&&r.h("p",{class:"error",id:"email-error"},this.err)))}get el(){return r.getElement(this)}static get watchers(){return{minimumStartTime:["minimumStartTimeChangedHandler"]}}};U.style=se;exports.nylas_time_window_picker=U;
|
|
@@ -1 +1 @@
|
|
|
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
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-eb33703c.cjs"),w=require("./register-component-887199a9-003f96c5.cjs");require("react");require("react-dom");function b(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=>b(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))},f=':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=f;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:"8ded7fac7238425d362b59a6754cc8c0ee36dc13"},e.h("sp-theme",{key:"709b8e7877cb108bb09199db5ba6306ea9b130a0",scale:"medium",color:"dark"},e.h("div",{key:"19d5912e09475417c50b27b24979e5337806b94c",class:"view-thread"},e.h("div",{key:"46c2022b7a45b8d05f8f23068828579b4294fee4",class:"header"},e.h("div",{key:"5e748e44ef6683d4215fbe0afff040f2091e376c",class:"subject"},(r=this.thread)==null?void 0:r.subject),e.h("div",{key:"3106d62c0ecf951ccf58fd32bb171ae4ce846909",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:"f2c2bfb336520c4dafa6597c417efee372648354",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,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,
|
|
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, q as D, a as S, s as g } from "./index-5ccfd9df.js";
|
|
2
|
+
import { R as T } from "./register-component-887199a9-b41dfa7a.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, w, f, 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 && ((w = e.data.from[0]) == null ? void 0 : w.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((f = e.data) != null && f.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: "8ded7fac7238425d362b59a6754cc8c0ee36dc13" }, a("sp-theme", { key: "709b8e7877cb108bb09199db5ba6306ea9b130a0", scale: "medium", color: "dark" }, a("div", { key: "19d5912e09475417c50b27b24979e5337806b94c", class: "view-thread" }, a("div", { key: "46c2022b7a45b8d05f8f23068828579b4294fee4", class: "header" }, a("div", { key: "5e748e44ef6683d4215fbe0afff040f2091e376c", class: "subject" }, (r = this.thread) == null ? void 0 : r.subject), a("div", { key: "3106d62c0ecf951ccf58fd32bb171ae4ce846909", 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: "f2c2bfb336520c4dafa6597c417efee372648354", 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
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-eb33703c.cjs");require("react");require("react-dom");const r=".sc-person-icon-h{display:flex}",i=r,t=class{constructor(s){e.registerInstance(this,s),this.width="14",this.height="16"}render(){return e.h("svg",{key:"954b500b6e68dff36be085c9ec1a347f1dffd216",width:this.width,height:this.height,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.h("path",{key:"22b3215ec25511a03ef33ead4a3d073b4c49a04b",d:"M7 0C4.79086 0 3 1.79086 3 4C3 6.20914 4.79086 8 7 8C9.20914 8 11 6.20914 11 4C11 1.79086 9.20914 0 7 0ZM4 4C4 2.34315 5.34315 1 7 1C8.65685 1 10 2.34315 10 4C10 5.65685 8.65685 7 7 7C5.34315 7 4 5.65685 4 4ZM2.00873 9C0.903151 9 0 9.88687 0 11C0 12.6912 0.83281 13.9663 2.13499 14.7966C3.41697 15.614 5.14526 16 7 16C8.85474 16 10.583 15.614 11.865 14.7966C13.1672 13.9663 14 12.6912 14 11C14 9.89557 13.1045 9.00001 12 9.00001L2.00873 9ZM1 11C1 10.4467 1.44786 10 2.00873 10L12 10C12.5522 10 13 10.4478 13 11C13 12.3088 12.3777 13.2837 11.3274 13.9534C10.2568 14.636 8.73511 15 7 15C5.26489 15 3.74318 14.636 2.67262 13.9534C1.62226 13.2837 1 12.3088 1 11Z",fill:"currentColor"}))}};t.style=i;exports.person_icon=t;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { r as s, h as t } from "./index-5ccfd9df.js";
|
|
2
|
+
import "react";
|
|
3
|
+
import "react-dom";
|
|
4
|
+
const o = ".sc-person-icon-h{display:flex}", r = o, C = class {
|
|
5
|
+
constructor(e) {
|
|
6
|
+
s(this, e), this.width = "14", this.height = "16";
|
|
7
|
+
}
|
|
8
|
+
render() {
|
|
9
|
+
return t("svg", { key: "954b500b6e68dff36be085c9ec1a347f1dffd216", width: this.width, height: this.height, fill: "none", xmlns: "http://www.w3.org/2000/svg" }, t("path", { key: "22b3215ec25511a03ef33ead4a3d073b4c49a04b", d: "M7 0C4.79086 0 3 1.79086 3 4C3 6.20914 4.79086 8 7 8C9.20914 8 11 6.20914 11 4C11 1.79086 9.20914 0 7 0ZM4 4C4 2.34315 5.34315 1 7 1C8.65685 1 10 2.34315 10 4C10 5.65685 8.65685 7 7 7C5.34315 7 4 5.65685 4 4ZM2.00873 9C0.903151 9 0 9.88687 0 11C0 12.6912 0.83281 13.9663 2.13499 14.7966C3.41697 15.614 5.14526 16 7 16C8.85474 16 10.583 15.614 11.865 14.7966C13.1672 13.9663 14 12.6912 14 11C14 9.89557 13.1045 9.00001 12 9.00001L2.00873 9ZM1 11C1 10.4467 1.44786 10 2.00873 10L12 10C12.5522 10 13 10.4478 13 11C13 12.3088 12.3777 13.2837 11.3274 13.9534C10.2568 14.636 8.73511 15 7 15C5.26489 15 3.74318 14.636 2.67262 13.9534C1.62226 13.2837 1 12.3088 1 11Z", fill: "currentColor" }));
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
C.style = r;
|
|
13
|
+
export {
|
|
14
|
+
C as person_icon
|
|
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-5ccfd9df.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, a = 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: "aaa15133933cb8ebd39db0754937bf24a9f1e2d5", width: this.width, height: this.height, viewBox: "0 0 24 24", fill: "auto", xmlns: "http://www.w3.org/2000/svg" }, t("path", { key: "f615374aabdfdf059536fb524668c0a157463020", d: "M21 12L3 21V3L21 12Z", stroke: "auto", "stroke-width": "1.5", "stroke-linecap": "round", "stroke-linejoin": "round" }));
|
|
10
10
|
}
|
|
11
11
|
};
|
|
12
|
-
|
|
12
|
+
a.style = i;
|
|
13
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: "77caaa680d7ca30d98feef3e16941734c4c289da", width: this.width, height: this.height, viewBox: "0 0 24 24", fill: "auto", xmlns: "http://www.w3.org/2000/svg" }, t("path", { key: "aad5a8ad1b0a98fa154a1eabbb3dfab69d09f5b2", d: "M4 4H20V20H4V4Z", stroke: "auto", "stroke-width": "1.5", "stroke-linecap": "round", "stroke-linejoin": "round" }));
|
|
19
19
|
}
|
|
20
20
|
};
|
|
21
21
|
r.style = n;
|
|
22
22
|
export {
|
|
23
|
-
|
|
23
|
+
a 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-eb33703c.cjs");require("react");require("react-dom");const o=".sc-play-icon-h{display:flex}",n=o,s=class{constructor(e){t.registerInstance(this,e),this.width="15",this.height="15"}render(){return t.h("svg",{key:"aaa15133933cb8ebd39db0754937bf24a9f1e2d5",width:this.width,height:this.height,viewBox:"0 0 24 24",fill:"auto",xmlns:"http://www.w3.org/2000/svg"},t.h("path",{key:"f615374aabdfdf059536fb524668c0a157463020",d:"M21 12L3 21V3L21 12Z",stroke:"auto","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}))}};s.style=n;const a=".sc-stop-icon-h{display:flex}",h=a,i=class{constructor(e){t.registerInstance(this,e),this.width="15",this.height="15"}render(){return t.h("svg",{key:"77caaa680d7ca30d98feef3e16941734c4c289da",width:this.width,height:this.height,viewBox:"0 0 24 24",fill:"auto",xmlns:"http://www.w3.org/2000/svg"},t.h("path",{key:"aad5a8ad1b0a98fa154a1eabbb3dfab69d09f5b2",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;
|