@nylas/react 1.1.0-canary.4 → 1.1.0-canary.7
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/elements/index.d.ts +1 -0
- package/dist/{elements-dc5b338e-fb5dbfb5.js → elements-dc5b338e-6078b875.js} +1 -1
- package/dist/{elements-dc5b338e-81a0319c.cjs → elements-dc5b338e-96e197ca.cjs} +1 -1
- package/dist/focus-visible-e8093c16-018ffd63.cjs +1 -0
- package/dist/{focus-visible-e8093c16-28fc08a0.js → focus-visible-e8093c16-ab01d60a.js} +5 -3
- package/dist/index-1fd24ccf.js +3582 -0
- package/dist/index-823fdc6f.cjs +36 -0
- package/dist/react.cjs +1 -1
- package/dist/react.js +53 -52
- package/package.json +3 -3
- package/dist/_commonjsHelpers-57e89916-4a3ae7d8.cjs +0 -1
- package/dist/_commonjsHelpers-57e89916-af061c86.js +0 -19
- package/dist/add-circle-icon_22.entry-077661c3.cjs +0 -1
- package/dist/add-circle-icon_22.entry-f699d91e.js +0 -1733
- package/dist/archive-icon_7.entry-40b7ef3b.js +0 -75
- package/dist/archive-icon_7.entry-e8630de9.cjs +0 -1
- package/dist/arrow-icon.entry-58246303.js +0 -15
- package/dist/arrow-icon.entry-ffa53114.cjs +0 -1
- package/dist/bold-icon_3.entry-106a4e77.cjs +0 -1
- package/dist/bold-icon_3.entry-f5f1643d.js +0 -35
- package/dist/calendar-cancel-icon.entry-6ae0fd0f.cjs +0 -1
- package/dist/calendar-cancel-icon.entry-75b15b19.js +0 -15
- package/dist/calendar-check-icon_2.entry-57339318.js +0 -25
- package/dist/calendar-check-icon_2.entry-c57f83f3.cjs +0 -1
- package/dist/calendar-icon.entry-2069fec6.js +0 -15
- package/dist/calendar-icon.entry-492c2630.cjs +0 -1
- package/dist/chevron-icon_3.entry-83df50c3.js +0 -117
- package/dist/chevron-icon_3.entry-878ff6df.cjs +0 -1
- package/dist/close-icon.entry-480c199d.js +0 -15
- package/dist/close-icon.entry-8015ca05.cjs +0 -1
- package/dist/constants-6ee60d6d-4cd16450.js +0 -3740
- package/dist/constants-6ee60d6d-6c0540db.cjs +0 -15
- package/dist/document-refresh-icon.entry-06f7972b.cjs +0 -1
- package/dist/document-refresh-icon.entry-09870b14.js +0 -15
- package/dist/focus-visible-e8093c16-f380b705.cjs +0 -1
- package/dist/forward-icon_6.entry-8bb201eb.js +0 -955
- package/dist/forward-icon_6.entry-eeecf2a2.cjs +0 -3
- package/dist/globe-icon.entry-a690028c.cjs +0 -1
- package/dist/globe-icon.entry-d515cbfa.js +0 -15
- package/dist/google-logo-icon_3.entry-2164cec1.js +0 -258
- package/dist/google-logo-icon_3.entry-b2b85284.cjs +0 -1
- package/dist/index-2b8437d6.cjs +0 -30
- package/dist/index-db0c5017.js +0 -1824
- package/dist/index.es-2578c6a5-098d48d0.cjs +0 -7
- package/dist/index.es-2578c6a5-71441142.js +0 -3133
- package/dist/info-icon_2.entry-300ef196.js +0 -34
- package/dist/info-icon_2.entry-e286aaa5.cjs +0 -1
- package/dist/loading-icon.entry-6d8adaa4.js +0 -15
- package/dist/loading-icon.entry-dc40e97d.cjs +0 -1
- package/dist/mailbox-store-bb21512c-649a374c.js +0 -381
- package/dist/mailbox-store-bb21512c-fc3c8c03.cjs +0 -1
- package/dist/nylas-additional-participants.entry-4afba192.js +0 -83
- package/dist/nylas-additional-participants.entry-db05e510.cjs +0 -1
- package/dist/nylas-booked-event-card_10.entry-1ebbe0c0.js +0 -784
- package/dist/nylas-booked-event-card_10.entry-6b6fdfae.cjs +0 -1
- package/dist/nylas-form-card.entry-70b20571.cjs +0 -1
- package/dist/nylas-form-card.entry-7bc23695.js +0 -56
- package/dist/nylas-if-state.entry-3829cb3d.js +0 -96
- package/dist/nylas-if-state.entry-ebeffe22.cjs +0 -1
- package/dist/nylas-list-folders.entry-191688f2.cjs +0 -1
- package/dist/nylas-list-folders.entry-7347e78d.js +0 -122
- package/dist/nylas-list-threads.entry-432a8d8c.js +0 -72
- package/dist/nylas-list-threads.entry-44658578.cjs +0 -1
- package/dist/nylas-login.entry-5311f0a7.js +0 -75
- package/dist/nylas-login.entry-db17a3d2.cjs +0 -1
- package/dist/nylas-mailbox-pagination.entry-20150fb2.js +0 -103
- package/dist/nylas-mailbox-pagination.entry-9d3f5baa.cjs +0 -1
- package/dist/nylas-mailbox-toolbar-button.entry-6c0f7299.cjs +0 -1
- package/dist/nylas-mailbox-toolbar-button.entry-eec426d5.js +0 -84
- package/dist/nylas-mailbox.entry-b6c758b9.js +0 -136
- package/dist/nylas-mailbox.entry-d41401e0.cjs +0 -1
- package/dist/nylas-provider.entry-271cafd2.js +0 -147
- package/dist/nylas-provider.entry-6173b721.cjs +0 -1
- package/dist/nylas-scheduler-editor.entry-0c75d39e.cjs +0 -7
- package/dist/nylas-scheduler-editor.entry-b51ad4b1.js +0 -2192
- package/dist/nylas-scheduling.entry-081c8825.cjs +0 -1
- package/dist/nylas-scheduling.entry-0a8d1da8.js +0 -237
- package/dist/nylas-threads-refresh.entry-72dd854e.js +0 -76
- package/dist/nylas-threads-refresh.entry-c3509e6a.cjs +0 -1
- package/dist/nylas-threads-search.entry-16a59ef6.cjs +0 -1
- package/dist/nylas-threads-search.entry-4750a187.js +0 -71
- package/dist/nylas-view-thread.entry-27df3349.cjs +0 -1
- package/dist/nylas-view-thread.entry-c6adce43.js +0 -205
- package/dist/people-icon.entry-342be0c8.js +0 -15
- package/dist/people-icon.entry-35252ca9.cjs +0 -1
- package/dist/play-icon_2.entry-0787352c.js +0 -25
- package/dist/play-icon_2.entry-f83fa92a.cjs +0 -1
- package/dist/refresh-icon.entry-8fbabfe7.js +0 -15
- package/dist/refresh-icon.entry-ddbc5446.cjs +0 -1
- package/dist/register-component-dc659dc3-e43e8fae.js +0 -105
- package/dist/register-component-dc659dc3-fb85ee68.cjs +0 -1
- package/dist/scheduler-config-store-51ee4f42-66f8c2ac.js +0 -14
- package/dist/scheduler-config-store-51ee4f42-d7d9c25d.cjs +0 -1
- package/dist/scheduler-store-72116723-ce4c7a69.cjs +0 -1
- package/dist/scheduler-store-72116723-e5f87122.js +0 -294
- package/dist/time-period-selector.entry-333942a8.js +0 -78
- package/dist/time-period-selector.entry-78d5b3c2.cjs +0 -1
- package/dist/translate-icon.entry-87a62108.js +0 -15
- package/dist/translate-icon.entry-cb19864c.cjs +0 -1
- package/dist/utils-c00bdc3c-89ab163d.js +0 -2111
- package/dist/utils-c00bdc3c-94b9c3b6.cjs +0 -8
- package/dist/warning-icon.entry-50755d91.cjs +0 -1
- package/dist/warning-icon.entry-7a72e24a.js +0 -15
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import { r as h, c as p, h as o, H as u } from "./index-db0c5017.js";
|
|
2
|
-
import { R as m } from "./register-component-dc659dc3-e43e8fae.js";
|
|
3
|
-
import "./utils-c00bdc3c-89ab163d.js";
|
|
4
|
-
import "react";
|
|
5
|
-
import "react-dom";
|
|
6
|
-
import "./_commonjsHelpers-57e89916-af061c86.js";
|
|
7
|
-
const g = ":host{font-family:'Arial', sans-serif;background:var(--nylas-color-primary-50);color:var(--nylas-color-primary-800);margin:0;display:contents}input{box-sizing:border-box}.login-container{display:flex;justify-content:center;align-items:center;height:100%}.login-box{width:300px;padding:20px;box-shadow:0 4px 8px rgba(0, 0, 0, 0.1);border-radius:var(--nylas-border-radius-2x);background:var(--nylas-color-primary-50);text-align:center}.login-box h1{margin-top:0;margin-bottom:0.5em}.login-box p{margin-bottom:1em}.login-methods button{display:block;width:100%;padding:10px 10px 10px 50px;margin-bottom:10px;border:none;border-radius:var(--nylas-border-radius);border:1px solid var(--nylas-color-primary-300);background:var(--nylas-color-primary-100);color:var(--nylas-color-primary-600);cursor:pointer;transition:background 0.3s ease;position:relative;text-align:left}.login-methods button svg{position:absolute;left:16px;top:50%;transform:translateY(-50%)}.login-methods button:hover{background:var(--nylas-color-primary-200);}.login-form label{display:block;margin-bottom:5px;text-align:left}.login-form input{width:100%;padding:10px;margin-bottom:10px;border:1px solid var(--nylas-color-primary-200);border-radius:var(--nylas-border-radius);background:var(--nylas-color-primary-100);color:var(--nylas-color-primary-800);}.login-form button{width:100%;padding:10px;border:none;border-radius:var(--nylas-border-radius);background:var(--nylas-color-primary-500);color:var(--nylas-color-primary-50);cursor:pointer;transition:background 0.3s ease}.login-form button:hover{background:var(--nylas-color-primary-600);}", f = g;
|
|
8
|
-
var y = function(n, t, i, e) {
|
|
9
|
-
var a = arguments.length, r = a < 3 ? t : e === null ? e = Object.getOwnPropertyDescriptor(t, i) : e, s;
|
|
10
|
-
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
11
|
-
r = Reflect.decorate(n, t, i, e);
|
|
12
|
-
else
|
|
13
|
-
for (var l = n.length - 1; l >= 0; l--)
|
|
14
|
-
(s = n[l]) && (r = (a < 3 ? s(r) : a > 3 ? s(t, i, r) : s(t, i)) || r);
|
|
15
|
-
return a > 3 && r && Object.defineProperty(t, i, r), r;
|
|
16
|
-
}, c = function(n, t) {
|
|
17
|
-
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
18
|
-
return Reflect.metadata(n, t);
|
|
19
|
-
};
|
|
20
|
-
const d = class {
|
|
21
|
-
constructor(n) {
|
|
22
|
-
h(this, n), this.buttonClick = p(this, "buttonClick", 7), this._handleLoginRedirect = async () => {
|
|
23
|
-
var e;
|
|
24
|
-
const t = await ((e = this.nylasConnector) == null ? void 0 : e.auth.getHostedAuthRedirectURL(this.scopes));
|
|
25
|
-
this.buttonClick.emit({ url: t }).defaultPrevented || t && (window.location.href = t);
|
|
26
|
-
}, this._onGoogleButtonClick = async (t) => {
|
|
27
|
-
var e;
|
|
28
|
-
t.preventDefault();
|
|
29
|
-
const i = await ((e = this.nylasConnector) == null ? void 0 : e.auth.getHostedAuthRedirectURL(this.scopes, void 0, "google"));
|
|
30
|
-
i && (window.location.href = i);
|
|
31
|
-
}, this._onMicrosoftButtonClick = async (t) => {
|
|
32
|
-
var e;
|
|
33
|
-
t.preventDefault();
|
|
34
|
-
const i = await ((e = this.nylasConnector) == null ? void 0 : e.auth.getHostedAuthRedirectURL(this.scopes, void 0, "microsoft"));
|
|
35
|
-
i && (window.location.href = i);
|
|
36
|
-
}, this._onFormSubmit = async (t) => {
|
|
37
|
-
var e;
|
|
38
|
-
t.preventDefault();
|
|
39
|
-
const i = await ((e = this.nylasConnector) == null ? void 0 : e.auth.getHostedAuthRedirectURL(this.scopes, this.email));
|
|
40
|
-
i && (window.location.href = i);
|
|
41
|
-
}, this.isAuthenticated = !1, this.nylasConnector = void 0, this.scopes = void 0, this.loginMethod = "redirect", this.companyName = "Nylas", this.logoUrl = "https://www.nylas.com/wp-content/uploads/main-logo.svg", this.logoWidth = "min-content", this.providers = "google,microsoft", this.buttonText = "Login", this.email = "";
|
|
42
|
-
}
|
|
43
|
-
connectedCallback() {
|
|
44
|
-
}
|
|
45
|
-
disconnectedCallback() {
|
|
46
|
-
}
|
|
47
|
-
componentWillLoad() {
|
|
48
|
-
}
|
|
49
|
-
async componentDidLoad() {
|
|
50
|
-
var t;
|
|
51
|
-
await ((t = this.nylasConnector) == null ? void 0 : t.auth.manageHostedAuthCodeExchange(window.location.href)) && window.history.replaceState({}, document.title, window.location.pathname);
|
|
52
|
-
}
|
|
53
|
-
render() {
|
|
54
|
-
var t;
|
|
55
|
-
const n = ((t = this.providers) == null ? void 0 : t.split(",")) || [];
|
|
56
|
-
return o(u, { key: "bff99d93c49f3a70e4e8f28ea97082853af37be0" }, this.loginMethod === "redirect" && o("div", { class: "redirect-container" }, !this.isAuthenticated && o("sp-button", { part: "button", onClick: this._handleLoginRedirect }, this.buttonText)), this.loginMethod === "emebded" && o("main", { class: "login-container" }, o("section", { class: "login-box" }, o("header", null, o("img", { src: this.logoUrl, alt: `${this.companyName} logo`, width: "100%", style: {
|
|
57
|
-
minWidth: this.logoWidth
|
|
58
|
-
} }), o("h1", null, "Welcome")), o("p", null, "Log in to your account to continue to ", this.companyName), o("div", { class: "login-methods" }, n.includes("google") && o("button", { class: "login-google", onClick: this._onGoogleButtonClick }, o("svg", { xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true", role: "img", width: "18", height: "18", preserveAspectRatio: "xMidYMid meet", viewBox: "0 0 256 262" }, o("path", { fill: "#4285F4", d: "M255.6 131.6c0-8.2-.8-16.2-2.2-23.9H130v45.3h70.3c-3 16.1-12.4 29.7-26.3 38.9v32.4h42.6c25-23 39.4-56.7 39.4-97.7z" }), o("path", { fill: "#34A853", d: "M130 262c35.3 0 64.9-11.7 86.5-31.7l-42.6-32.4c-11.7 7.9-26.7 12.6-43.9 12.6-33.7 0-62.3-22.7-72.5-53.4H14.5v33.3A130.3 130.3 0 00130 262z" }), o("path", { fill: "#FBBC05", d: "M57.5 158.1a72.7 72.7 0 010-54.2V70.6H14.5a130.4 130.4 0 000 120.8l43-33.3z" }), o("path", { fill: "#EA4335", d: "M130 51.6c19 0 36 6.5 49.4 19.2l37-36C195 13.1 165.2 0 130 0A130.3 130.3 0 0014.5 70.6l43 33.3c10.2-30.7 38.8-53.3 72.5-53.3z" })), "Continue with Google"), n.includes("microsoft") && o("button", { class: "login-microsoft", onClick: this._onMicrosoftButtonClick }, o("svg", { xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true", role: "img", width: "18", height: "18", preserveAspectRatio: "xMidYMid meet", viewBox: "0 0 448 512" }, o("path", { fill: "#F3F3F3", d: "M0 32v192h192V32H0zm256 0v192h192V32H256zm192 256v192h-192V288h192zM0 224v192h192V224H0z" })), "Continue with Microsoft")), o("form", { class: "login-form", method: "POST", onSubmit: this._onFormSubmit }, o("label", { htmlFor: "email" }, "Email"), o("input", { type: "email", id: "email", name: "email", required: !0, value: this.email }), o("button", { type: "submit" }, "Next")))));
|
|
59
|
-
}
|
|
60
|
-
};
|
|
61
|
-
y([
|
|
62
|
-
m({
|
|
63
|
-
name: "nylas-login",
|
|
64
|
-
connectorToProp: "nylasConnector",
|
|
65
|
-
stateToProps: /* @__PURE__ */ new Map([["auth.isAuthenticated", "isAuthenticated"]]),
|
|
66
|
-
fireRegisterEvent: !0
|
|
67
|
-
}),
|
|
68
|
-
c("design:type", Function),
|
|
69
|
-
c("design:paramtypes", []),
|
|
70
|
-
c("design:returntype", void 0)
|
|
71
|
-
], d.prototype, "render", null);
|
|
72
|
-
d.style = f;
|
|
73
|
-
export {
|
|
74
|
-
d as nylas_login
|
|
75
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-2b8437d6.cjs"),h=require("./register-component-dc659dc3-fb85ee68.cjs");require("./utils-c00bdc3c-94b9c3b6.cjs");require("react");require("react-dom");require("./_commonjsHelpers-57e89916-4a3ae7d8.cjs");const u=":host{font-family:'Arial', sans-serif;background:var(--nylas-color-primary-50);color:var(--nylas-color-primary-800);margin:0;display:contents}input{box-sizing:border-box}.login-container{display:flex;justify-content:center;align-items:center;height:100%}.login-box{width:300px;padding:20px;box-shadow:0 4px 8px rgba(0, 0, 0, 0.1);border-radius:var(--nylas-border-radius-2x);background:var(--nylas-color-primary-50);text-align:center}.login-box h1{margin-top:0;margin-bottom:0.5em}.login-box p{margin-bottom:1em}.login-methods button{display:block;width:100%;padding:10px 10px 10px 50px;margin-bottom:10px;border:none;border-radius:var(--nylas-border-radius);border:1px solid var(--nylas-color-primary-300);background:var(--nylas-color-primary-100);color:var(--nylas-color-primary-600);cursor:pointer;transition:background 0.3s ease;position:relative;text-align:left}.login-methods button svg{position:absolute;left:16px;top:50%;transform:translateY(-50%)}.login-methods button:hover{background:var(--nylas-color-primary-200);}.login-form label{display:block;margin-bottom:5px;text-align:left}.login-form input{width:100%;padding:10px;margin-bottom:10px;border:1px solid var(--nylas-color-primary-200);border-radius:var(--nylas-border-radius);background:var(--nylas-color-primary-100);color:var(--nylas-color-primary-800);}.login-form button{width:100%;padding:10px;border:none;border-radius:var(--nylas-border-radius);background:var(--nylas-color-primary-500);color:var(--nylas-color-primary-50);cursor:pointer;transition:background 0.3s ease}.login-form button:hover{background:var(--nylas-color-primary-600);}",p=u;var g=function(n,o,i,e){var a=arguments.length,r=a<3?o:e===null?e=Object.getOwnPropertyDescriptor(o,i):e,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,o,i,e);else for(var l=n.length-1;l>=0;l--)(s=n[l])&&(r=(a<3?s(r):a>3?s(o,i,r):s(o,i))||r);return a>3&&r&&Object.defineProperty(o,i,r),r},c=function(n,o){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,o)};const d=class{constructor(n){t.registerInstance(this,n),this.buttonClick=t.createEvent(this,"buttonClick",7),this._handleLoginRedirect=async()=>{var e;const o=await((e=this.nylasConnector)==null?void 0:e.auth.getHostedAuthRedirectURL(this.scopes));this.buttonClick.emit({url:o}).defaultPrevented||o&&(window.location.href=o)},this._onGoogleButtonClick=async o=>{var e;o.preventDefault();const i=await((e=this.nylasConnector)==null?void 0:e.auth.getHostedAuthRedirectURL(this.scopes,void 0,"google"));i&&(window.location.href=i)},this._onMicrosoftButtonClick=async o=>{var e;o.preventDefault();const i=await((e=this.nylasConnector)==null?void 0:e.auth.getHostedAuthRedirectURL(this.scopes,void 0,"microsoft"));i&&(window.location.href=i)},this._onFormSubmit=async o=>{var e;o.preventDefault();const i=await((e=this.nylasConnector)==null?void 0:e.auth.getHostedAuthRedirectURL(this.scopes,this.email));i&&(window.location.href=i)},this.isAuthenticated=!1,this.nylasConnector=void 0,this.scopes=void 0,this.loginMethod="redirect",this.companyName="Nylas",this.logoUrl="https://www.nylas.com/wp-content/uploads/main-logo.svg",this.logoWidth="min-content",this.providers="google,microsoft",this.buttonText="Login",this.email=""}connectedCallback(){}disconnectedCallback(){}componentWillLoad(){}async componentDidLoad(){var o;await((o=this.nylasConnector)==null?void 0:o.auth.manageHostedAuthCodeExchange(window.location.href))&&window.history.replaceState({},document.title,window.location.pathname)}render(){var o;const n=((o=this.providers)==null?void 0:o.split(","))||[];return t.h(t.Host,{key:"bff99d93c49f3a70e4e8f28ea97082853af37be0"},this.loginMethod==="redirect"&&t.h("div",{class:"redirect-container"},!this.isAuthenticated&&t.h("sp-button",{part:"button",onClick:this._handleLoginRedirect},this.buttonText)),this.loginMethod==="emebded"&&t.h("main",{class:"login-container"},t.h("section",{class:"login-box"},t.h("header",null,t.h("img",{src:this.logoUrl,alt:`${this.companyName} logo`,width:"100%",style:{minWidth:this.logoWidth}}),t.h("h1",null,"Welcome")),t.h("p",null,"Log in to your account to continue to ",this.companyName),t.h("div",{class:"login-methods"},n.includes("google")&&t.h("button",{class:"login-google",onClick:this._onGoogleButtonClick},t.h("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",role:"img",width:"18",height:"18",preserveAspectRatio:"xMidYMid meet",viewBox:"0 0 256 262"},t.h("path",{fill:"#4285F4",d:"M255.6 131.6c0-8.2-.8-16.2-2.2-23.9H130v45.3h70.3c-3 16.1-12.4 29.7-26.3 38.9v32.4h42.6c25-23 39.4-56.7 39.4-97.7z"}),t.h("path",{fill:"#34A853",d:"M130 262c35.3 0 64.9-11.7 86.5-31.7l-42.6-32.4c-11.7 7.9-26.7 12.6-43.9 12.6-33.7 0-62.3-22.7-72.5-53.4H14.5v33.3A130.3 130.3 0 00130 262z"}),t.h("path",{fill:"#FBBC05",d:"M57.5 158.1a72.7 72.7 0 010-54.2V70.6H14.5a130.4 130.4 0 000 120.8l43-33.3z"}),t.h("path",{fill:"#EA4335",d:"M130 51.6c19 0 36 6.5 49.4 19.2l37-36C195 13.1 165.2 0 130 0A130.3 130.3 0 0014.5 70.6l43 33.3c10.2-30.7 38.8-53.3 72.5-53.3z"})),"Continue with Google"),n.includes("microsoft")&&t.h("button",{class:"login-microsoft",onClick:this._onMicrosoftButtonClick},t.h("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",role:"img",width:"18",height:"18",preserveAspectRatio:"xMidYMid meet",viewBox:"0 0 448 512"},t.h("path",{fill:"#F3F3F3",d:"M0 32v192h192V32H0zm256 0v192h192V32H256zm192 256v192h-192V288h192zM0 224v192h192V224H0z"})),"Continue with Microsoft")),t.h("form",{class:"login-form",method:"POST",onSubmit:this._onFormSubmit},t.h("label",{htmlFor:"email"},"Email"),t.h("input",{type:"email",id:"email",name:"email",required:!0,value:this.email}),t.h("button",{type:"submit"},"Next")))))}};g([h.RegisterComponent({name:"nylas-login",connectorToProp:"nylasConnector",stateToProps:new Map([["auth.isAuthenticated","isAuthenticated"]]),fireRegisterEvent:!0}),c("design:type",Function),c("design:paramtypes",[]),c("design:returntype",void 0)],d.prototype,"render",null);d.style=p;exports.nylas_login=d;
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
import { r as m, c as d, h as e, H as p, g as u } from "./index-db0c5017.js";
|
|
2
|
-
import { R as v } from "./register-component-dc659dc3-e43e8fae.js";
|
|
3
|
-
import { d as a } from "./utils-c00bdc3c-89ab163d.js";
|
|
4
|
-
import "react";
|
|
5
|
-
import "react-dom";
|
|
6
|
-
import "./_commonjsHelpers-57e89916-af061c86.js";
|
|
7
|
-
const y = ":host{display:contents}.container{height:var(--container-height, 100dvh);overflow-y:var(--container-overflow-y, auto)}.pagination{display:flex;justify-content:center;align-items:center;margin:0 auto;padding:0;list-style:none;font-size:0.875rem;font-weight:600;color:var(--nylas-color-primary-600)}.pagination sp-button svg{animation:rotate 1s linear infinite}sp-button{border-radius:var(--nylas-border-radius);background-color:var(--nylas-color-primary-400);color:var(--nylas-color-primary-900);fill:var(--nylas-color-primary-900)}sp-button:hover{background-color:var(--nylas-color-primary-500)}sp-button:disabled{background-color:var(--nylas-color-primary-200);color:var(--nylas-color-primary-600);cursor:not-allowed}sp-button chevron-icon svg{width:15px;height:15px}.next chevron-icon{transform:rotate(180deg)}@keyframes rotate{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}", f = y;
|
|
8
|
-
var P = function(t, n, i, r) {
|
|
9
|
-
var s = arguments.length, o = s < 3 ? n : r === null ? r = Object.getOwnPropertyDescriptor(n, i) : r, l;
|
|
10
|
-
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
11
|
-
o = Reflect.decorate(t, n, i, r);
|
|
12
|
-
else
|
|
13
|
-
for (var c = t.length - 1; c >= 0; c--)
|
|
14
|
-
(l = t[c]) && (o = (s < 3 ? l(o) : s > 3 ? l(n, i, o) : l(n, i)) || o);
|
|
15
|
-
return s > 3 && o && Object.defineProperty(n, i, o), o;
|
|
16
|
-
}, h = function(t, n) {
|
|
17
|
-
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
18
|
-
return Reflect.metadata(t, n);
|
|
19
|
-
};
|
|
20
|
-
const g = class {
|
|
21
|
-
constructor(t) {
|
|
22
|
-
m(this, t), this.next = d(this, "next", 7), this.previous = d(this, "previous", 7), this.state = "ready", this.hasNextPage = !1, this.hasPreviousPage = !1, this.scrollTarget = "container", this.mobileOnlyInfiniteScroll = !0, this.mobileViewPortWidth = 768, a("[nylas-pagination] Constructed"), this.isScrollAtContainerBottom = this.isScrollAtContainerBottom.bind(this), this.isScrollAtPageBottom = this.isScrollAtPageBottom.bind(this), this.nextPage = this.nextPage.bind(this), this.previousPage = this.previousPage.bind(this), this.handlePageScroll = this.handlePageScroll.bind(this), this.handleContainerScroll = this.handleContainerScroll.bind(this);
|
|
23
|
-
}
|
|
24
|
-
connectedCallback() {
|
|
25
|
-
a("[nylas-pagination] Component connected");
|
|
26
|
-
}
|
|
27
|
-
async componentWillLoad() {
|
|
28
|
-
a("[nylas-pagination] Component will load");
|
|
29
|
-
}
|
|
30
|
-
async componentDidLoad() {
|
|
31
|
-
a("[nylas-pagination] Component did load"), this.containerElement && this.containerElement.addEventListener("scroll", this.handleContainerScroll);
|
|
32
|
-
}
|
|
33
|
-
async componentWillRender() {
|
|
34
|
-
a("[nylas-pagination] Component will render");
|
|
35
|
-
}
|
|
36
|
-
disconnectedCallback() {
|
|
37
|
-
a("[nylas-pagination] Component disconnected"), this.containerElement && this.containerElement.removeEventListener("scroll", this.handleContainerScroll);
|
|
38
|
-
}
|
|
39
|
-
handlePageScroll(t) {
|
|
40
|
-
this.isScrollAtPageBottom() && this.canScroll && this.scrollTarget === "page" && this.nextPage();
|
|
41
|
-
}
|
|
42
|
-
async nextPage() {
|
|
43
|
-
const t = this.host.children.length > 0;
|
|
44
|
-
this.next.emit({
|
|
45
|
-
hasChildren: t
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
async previousPage() {
|
|
49
|
-
const t = this.host.children.length > 0;
|
|
50
|
-
this.previous.emit({
|
|
51
|
-
hasChildren: t
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
handleContainerScroll(t) {
|
|
55
|
-
this.isScrollAtContainerBottom() && this.canScroll && this.scrollTarget === "container" && this.nextPage();
|
|
56
|
-
}
|
|
57
|
-
isScrollAtContainerBottom() {
|
|
58
|
-
return this.containerElement ? this.containerElement && this.containerElement.scrollTop + this.containerElement.clientHeight >= this.containerElement.scrollHeight : !1;
|
|
59
|
-
}
|
|
60
|
-
isScrollAtPageBottom() {
|
|
61
|
-
return window.innerHeight + window.scrollY >= document.body.offsetHeight;
|
|
62
|
-
}
|
|
63
|
-
get canScroll() {
|
|
64
|
-
const t = this.host.children.length > 0;
|
|
65
|
-
return this.state === "ready" && t && (!this.mobileOnlyInfiniteScroll || window.innerWidth < this.mobileViewPortWidth);
|
|
66
|
-
}
|
|
67
|
-
render() {
|
|
68
|
-
return this.host.children.length > 0 ? e(p, null, e("div", { class: "container", ref: (n) => this.containerElement = n }, e("slot", null), this.canScroll && e("div", { class: "pagination" }, e("sp-theme", { scale: "medium", color: "dark" }, this.state === "ready" && this.hasNextPage && e("sp-button", { onClick: this.nextPage }, e("div", { slot: "icon" }, e("refresh-icon", { class: "refres-icon" })), " ", "Load more..."))))) : e(p, null, e("sp-theme", { scale: "medium", color: "dark" }, this.hasPreviousPage && e("sp-button", { class: "previous", parr: "previous", onClick: this.previousPage }, e("div", { slot: "icon" }, e("chevron-icon", { class: "previous-icon" })), " ", "Previous"), this.hasPreviousPage && this.hasNextPage && " ", this.hasNextPage && e("sp-button", { class: "next", parr: "next", onClick: this.nextPage }, e("div", { slot: "icon" }, e("chevron-icon", { class: "next-icon" })), " ", "Next")));
|
|
69
|
-
}
|
|
70
|
-
get host() {
|
|
71
|
-
return u(this);
|
|
72
|
-
}
|
|
73
|
-
};
|
|
74
|
-
P([
|
|
75
|
-
v({
|
|
76
|
-
name: "nylas-pagination",
|
|
77
|
-
stateToProps: /* @__PURE__ */ new Map([
|
|
78
|
-
["mailbox.hasNextThreadPage", "hasNextPage"],
|
|
79
|
-
["mailbox.hasPreviousThreadPage", "hasPreviousPage"],
|
|
80
|
-
["mailbox.state", "state"]
|
|
81
|
-
]),
|
|
82
|
-
eventToProps: {
|
|
83
|
-
next: async (t, n) => {
|
|
84
|
-
a("[nylas-pagination] Next page event fired");
|
|
85
|
-
const { hasChildren: i } = t.detail;
|
|
86
|
-
await n.threads.nextThreadPage(i ? "append" : "overwrite", !i);
|
|
87
|
-
},
|
|
88
|
-
previous: async (t, n) => {
|
|
89
|
-
a("[nylas-pagination] Previous page event fired");
|
|
90
|
-
const { hasChildren: i } = t.detail;
|
|
91
|
-
await n.threads.previousThreadPage(i ? "append" : "overwrite", !i);
|
|
92
|
-
}
|
|
93
|
-
},
|
|
94
|
-
fireRegisterEvent: !0
|
|
95
|
-
}),
|
|
96
|
-
h("design:type", Function),
|
|
97
|
-
h("design:paramtypes", []),
|
|
98
|
-
h("design:returntype", void 0)
|
|
99
|
-
], g.prototype, "render", null);
|
|
100
|
-
g.style = f;
|
|
101
|
-
export {
|
|
102
|
-
g as nylas_mailbox_pagination
|
|
103
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-2b8437d6.cjs"),g=require("./register-component-dc659dc3-fb85ee68.cjs"),a=require("./utils-c00bdc3c-94b9c3b6.cjs");require("react");require("react-dom");require("./_commonjsHelpers-57e89916-4a3ae7d8.cjs");const p=":host{display:contents}.container{height:var(--container-height, 100dvh);overflow-y:var(--container-overflow-y, auto)}.pagination{display:flex;justify-content:center;align-items:center;margin:0 auto;padding:0;list-style:none;font-size:0.875rem;font-weight:600;color:var(--nylas-color-primary-600)}.pagination sp-button svg{animation:rotate 1s linear infinite}sp-button{border-radius:var(--nylas-border-radius);background-color:var(--nylas-color-primary-400);color:var(--nylas-color-primary-900);fill:var(--nylas-color-primary-900)}sp-button:hover{background-color:var(--nylas-color-primary-500)}sp-button:disabled{background-color:var(--nylas-color-primary-200);color:var(--nylas-color-primary-600);cursor:not-allowed}sp-button chevron-icon svg{width:15px;height:15px}.next chevron-icon{transform:rotate(180deg)}@keyframes rotate{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}",u=p;var m=function(t,n,i,r){var s=arguments.length,o=s<3?n:r===null?r=Object.getOwnPropertyDescriptor(n,i):r,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,n,i,r);else for(var c=t.length-1;c>=0;c--)(l=t[c])&&(o=(s<3?l(o):s>3?l(n,i,o):l(n,i))||o);return s>3&&o&&Object.defineProperty(n,i,o),o},h=function(t,n){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,n)};const d=class{constructor(t){e.registerInstance(this,t),this.next=e.createEvent(this,"next",7),this.previous=e.createEvent(this,"previous",7),this.state="ready",this.hasNextPage=!1,this.hasPreviousPage=!1,this.scrollTarget="container",this.mobileOnlyInfiniteScroll=!0,this.mobileViewPortWidth=768,a.debug("[nylas-pagination] Constructed"),this.isScrollAtContainerBottom=this.isScrollAtContainerBottom.bind(this),this.isScrollAtPageBottom=this.isScrollAtPageBottom.bind(this),this.nextPage=this.nextPage.bind(this),this.previousPage=this.previousPage.bind(this),this.handlePageScroll=this.handlePageScroll.bind(this),this.handleContainerScroll=this.handleContainerScroll.bind(this)}connectedCallback(){a.debug("[nylas-pagination] Component connected")}async componentWillLoad(){a.debug("[nylas-pagination] Component will load")}async componentDidLoad(){a.debug("[nylas-pagination] Component did load"),this.containerElement&&this.containerElement.addEventListener("scroll",this.handleContainerScroll)}async componentWillRender(){a.debug("[nylas-pagination] Component will render")}disconnectedCallback(){a.debug("[nylas-pagination] Component disconnected"),this.containerElement&&this.containerElement.removeEventListener("scroll",this.handleContainerScroll)}handlePageScroll(t){this.isScrollAtPageBottom()&&this.canScroll&&this.scrollTarget==="page"&&this.nextPage()}async nextPage(){const t=this.host.children.length>0;this.next.emit({hasChildren:t})}async previousPage(){const t=this.host.children.length>0;this.previous.emit({hasChildren:t})}handleContainerScroll(t){this.isScrollAtContainerBottom()&&this.canScroll&&this.scrollTarget==="container"&&this.nextPage()}isScrollAtContainerBottom(){return this.containerElement?this.containerElement&&this.containerElement.scrollTop+this.containerElement.clientHeight>=this.containerElement.scrollHeight:!1}isScrollAtPageBottom(){return window.innerHeight+window.scrollY>=document.body.offsetHeight}get canScroll(){const t=this.host.children.length>0;return this.state==="ready"&&t&&(!this.mobileOnlyInfiniteScroll||window.innerWidth<this.mobileViewPortWidth)}render(){return this.host.children.length>0?e.h(e.Host,null,e.h("div",{class:"container",ref:n=>this.containerElement=n},e.h("slot",null),this.canScroll&&e.h("div",{class:"pagination"},e.h("sp-theme",{scale:"medium",color:"dark"},this.state==="ready"&&this.hasNextPage&&e.h("sp-button",{onClick:this.nextPage},e.h("div",{slot:"icon"},e.h("refresh-icon",{class:"refres-icon"}))," ","Load more..."))))):e.h(e.Host,null,e.h("sp-theme",{scale:"medium",color:"dark"},this.hasPreviousPage&&e.h("sp-button",{class:"previous",parr:"previous",onClick:this.previousPage},e.h("div",{slot:"icon"},e.h("chevron-icon",{class:"previous-icon"}))," ","Previous"),this.hasPreviousPage&&this.hasNextPage&&" ",this.hasNextPage&&e.h("sp-button",{class:"next",parr:"next",onClick:this.nextPage},e.h("div",{slot:"icon"},e.h("chevron-icon",{class:"next-icon"}))," ","Next")))}get host(){return e.getElement(this)}};m([g.RegisterComponent({name:"nylas-pagination",stateToProps:new Map([["mailbox.hasNextThreadPage","hasNextPage"],["mailbox.hasPreviousThreadPage","hasPreviousPage"],["mailbox.state","state"]]),eventToProps:{next:async(t,n)=>{a.debug("[nylas-pagination] Next page event fired");const{hasChildren:i}=t.detail;await n.threads.nextThreadPage(i?"append":"overwrite",!i)},previous:async(t,n)=>{a.debug("[nylas-pagination] Previous page event fired");const{hasChildren:i}=t.detail;await n.threads.previousThreadPage(i?"append":"overwrite",!i)}},fireRegisterEvent:!0}),h("design:type",Function),h("design:paramtypes",[]),h("design:returntype",void 0)],d.prototype,"render",null);d.style=u;exports.nylas_mailbox_pagination=d;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./index-2b8437d6.cjs"),b=require("./register-component-dc659dc3-fb85ee68.cjs"),c=require("./utils-c00bdc3c-94b9c3b6.cjs");require("react");require("react-dom");require("./_commonjsHelpers-57e89916-4a3ae7d8.cjs");const y=":host{display:block}sp-button{border-radius:var(--nylas-border-radius);background-color:var(--nylas-color-primary-400);color:var(--nylas-color-primary-900);fill:var(--nylas-color-primary-900)}sp-button:hover{background-color:var(--nylas-color-primary-500)}sp-button:disabled{background-color:var(--nylas-color-primary-200);color:var(--nylas-color-primary-600);cursor:not-allowed}",h=y;var f=function(t,o,e,n){var l=arguments.length,r=l<3?o:n===null?n=Object.getOwnPropertyDescriptor(o,e):n,i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(t,o,e,n);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(r=(l<3?i(r):l>3?i(o,e,r):i(o,e))||r);return l>3&&r&&Object.defineProperty(o,e,r),r},d=function(t,o){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,o)};const u=class{constructor(t){a.registerInstance(this,t),this.onClick=async()=>{const o=this.method;if(c.debug("[nylas-mailbox-toolbar-button] onClick",{method:o,mailboxConnector:this.mailboxConnector}),this.mailboxConnector&&o){const e=this.callMethod(this.mailboxConnector,o);e&&await e()}},this.method=void 0,this.dataState=void 0,this.iconOnly=!1,this.mailboxConnector=void 0}connectedCallback(){}disconnectedCallback(){}async componentWillLoad(){c.debug("[nylas-if-state] Component will load")}async componentDidLoad(){c.debug("[nylas-if-state] Component did load")}callMethod(t,o){const e=o.split(".");let n=t;for(const i of e.slice(0,-1))if(n=n[i],!n)return;const l=e[e.length-1],r=n[l];if(typeof r=="function")return r.bind(n)}renderByState(t){return t?a.h("slot",{name:"loading"},"Loading..."):a.h("slot",null,"Click")}hasSlot(t){return!!this.host.querySelector(`[slot="${t}"]`)}render(){var n;let t=!1;const o=(n=this.mailboxConnector)==null?void 0:n.nylasMailboxStore;if(typeof o<"u"){const l=String(this.dataState);t=this.dataState?o.get(l)==="loading":!1}const e=t?"state-loading":"state-ready";return a.h(a.Host,{key:"bc4a3e76b0b9ea32d5c640b6ef5944bc45edb2b1"},a.h("sp-theme",{key:"c52ad12f24b96ca8ee1da8f026db2441ae87d40e",scale:"medium",color:"dark"},a.h("sp-button",{onClick:this.onClick,disabled:t,key:e,"icon-only":this.iconOnly,label:this.renderByState(t)},this.hasSlot("icon")&&a.h("div",{slot:"icon",class:"slot"},a.h("slot",{name:"icon"})),!this.iconOnly&&this.renderByState(t))))}get host(){return a.getElement(this)}};f([b.RegisterComponent({name:"nylas-mailbox-toolbar-button",connectorToProp:"mailboxConnector",fireRegisterEvent:!0}),d("design:type",Function),d("design:paramtypes",[]),d("design:returntype",void 0)],u.prototype,"render",null);u.style=h;exports.nylas_mailbox_toolbar_button=u;
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import { r as y, h as l, H as m, g as f } from "./index-db0c5017.js";
|
|
2
|
-
import { R as u } from "./register-component-dc659dc3-e43e8fae.js";
|
|
3
|
-
import { d as c } from "./utils-c00bdc3c-89ab163d.js";
|
|
4
|
-
import "react";
|
|
5
|
-
import "react-dom";
|
|
6
|
-
import "./_commonjsHelpers-57e89916-af061c86.js";
|
|
7
|
-
const p = ":host{display:block}sp-button{border-radius:var(--nylas-border-radius);background-color:var(--nylas-color-primary-400);color:var(--nylas-color-primary-900);fill:var(--nylas-color-primary-900)}sp-button:hover{background-color:var(--nylas-color-primary-500)}sp-button:disabled{background-color:var(--nylas-color-primary-200);color:var(--nylas-color-primary-600);cursor:not-allowed}", h = p;
|
|
8
|
-
var g = function(t, o, e, n) {
|
|
9
|
-
var r = arguments.length, a = r < 3 ? o : n === null ? n = Object.getOwnPropertyDescriptor(o, e) : n, i;
|
|
10
|
-
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
11
|
-
a = Reflect.decorate(t, o, e, n);
|
|
12
|
-
else
|
|
13
|
-
for (var s = t.length - 1; s >= 0; s--)
|
|
14
|
-
(i = t[s]) && (a = (r < 3 ? i(a) : r > 3 ? i(o, e, a) : i(o, e)) || a);
|
|
15
|
-
return r > 3 && a && Object.defineProperty(o, e, a), a;
|
|
16
|
-
}, d = function(t, o) {
|
|
17
|
-
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
18
|
-
return Reflect.metadata(t, o);
|
|
19
|
-
};
|
|
20
|
-
const b = class {
|
|
21
|
-
constructor(t) {
|
|
22
|
-
y(this, t), this.onClick = async () => {
|
|
23
|
-
const o = this.method;
|
|
24
|
-
if (c("[nylas-mailbox-toolbar-button] onClick", { method: o, mailboxConnector: this.mailboxConnector }), this.mailboxConnector && o) {
|
|
25
|
-
const e = this.callMethod(this.mailboxConnector, o);
|
|
26
|
-
e && await e();
|
|
27
|
-
}
|
|
28
|
-
}, this.method = void 0, this.dataState = void 0, this.iconOnly = !1, this.mailboxConnector = void 0;
|
|
29
|
-
}
|
|
30
|
-
connectedCallback() {
|
|
31
|
-
}
|
|
32
|
-
disconnectedCallback() {
|
|
33
|
-
}
|
|
34
|
-
async componentWillLoad() {
|
|
35
|
-
c("[nylas-if-state] Component will load");
|
|
36
|
-
}
|
|
37
|
-
async componentDidLoad() {
|
|
38
|
-
c("[nylas-if-state] Component did load");
|
|
39
|
-
}
|
|
40
|
-
callMethod(t, o) {
|
|
41
|
-
const e = o.split(".");
|
|
42
|
-
let n = t;
|
|
43
|
-
for (const i of e.slice(0, -1))
|
|
44
|
-
if (n = n[i], !n)
|
|
45
|
-
return;
|
|
46
|
-
const r = e[e.length - 1], a = n[r];
|
|
47
|
-
if (typeof a == "function")
|
|
48
|
-
return a.bind(n);
|
|
49
|
-
}
|
|
50
|
-
renderByState(t) {
|
|
51
|
-
return t ? l("slot", { name: "loading" }, "Loading...") : l("slot", null, "Click");
|
|
52
|
-
}
|
|
53
|
-
hasSlot(t) {
|
|
54
|
-
return !!this.host.querySelector(`[slot="${t}"]`);
|
|
55
|
-
}
|
|
56
|
-
render() {
|
|
57
|
-
var n;
|
|
58
|
-
let t = !1;
|
|
59
|
-
const o = (n = this.mailboxConnector) == null ? void 0 : n.nylasMailboxStore;
|
|
60
|
-
if (typeof o < "u") {
|
|
61
|
-
const r = String(this.dataState);
|
|
62
|
-
t = this.dataState ? o.get(r) === "loading" : !1;
|
|
63
|
-
}
|
|
64
|
-
const e = t ? "state-loading" : "state-ready";
|
|
65
|
-
return l(m, { key: "bc4a3e76b0b9ea32d5c640b6ef5944bc45edb2b1" }, l("sp-theme", { key: "c52ad12f24b96ca8ee1da8f026db2441ae87d40e", scale: "medium", color: "dark" }, l("sp-button", { onClick: this.onClick, disabled: t, key: e, "icon-only": this.iconOnly, label: this.renderByState(t) }, this.hasSlot("icon") && l("div", { slot: "icon", class: "slot" }, l("slot", { name: "icon" })), !this.iconOnly && this.renderByState(t))));
|
|
66
|
-
}
|
|
67
|
-
get host() {
|
|
68
|
-
return f(this);
|
|
69
|
-
}
|
|
70
|
-
};
|
|
71
|
-
g([
|
|
72
|
-
u({
|
|
73
|
-
name: "nylas-mailbox-toolbar-button",
|
|
74
|
-
connectorToProp: "mailboxConnector",
|
|
75
|
-
fireRegisterEvent: !0
|
|
76
|
-
}),
|
|
77
|
-
d("design:type", Function),
|
|
78
|
-
d("design:paramtypes", []),
|
|
79
|
-
d("design:returntype", void 0)
|
|
80
|
-
], b.prototype, "render", null);
|
|
81
|
-
b.style = h;
|
|
82
|
-
export {
|
|
83
|
-
b as nylas_mailbox_toolbar_button
|
|
84
|
-
};
|
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
import { r as A, c as l, h as f, H as M, g as _ } from "./index-db0c5017.js";
|
|
2
|
-
import { N as v, e as w } from "./index.es-2578c6a5-71441142.js";
|
|
3
|
-
import { d as S } from "./utils-c00bdc3c-89ab163d.js";
|
|
4
|
-
import { C as P, a as N, H as I, N as E, b as L, c as O, d as R } from "./mailbox-store-bb21512c-649a374c.js";
|
|
5
|
-
import "react";
|
|
6
|
-
import "react-dom";
|
|
7
|
-
import "./_commonjsHelpers-57e89916-af061c86.js";
|
|
8
|
-
class T {
|
|
9
|
-
constructor(e, s, o, i) {
|
|
10
|
-
this.router = e, this.nylasAuth = s, this.nylasAuthStore = o, this.nylasMailboxStore = i;
|
|
11
|
-
}
|
|
12
|
-
init() {
|
|
13
|
-
S("NylasMailboxConnector init");
|
|
14
|
-
}
|
|
15
|
-
get mailboxStore() {
|
|
16
|
-
return this.nylasMailboxStore;
|
|
17
|
-
}
|
|
18
|
-
get authStore() {
|
|
19
|
-
return this.nylasAuthStore;
|
|
20
|
-
}
|
|
21
|
-
get auth() {
|
|
22
|
-
return this._authConnector ? this._authConnector : (this._authConnector = new E(this.nylasAuth, this.nylasAuthStore), this._authConnector);
|
|
23
|
-
}
|
|
24
|
-
get threads() {
|
|
25
|
-
return this._threadConnector ? this._threadConnector : (this._threadConnector = new L(this.nylasAuth, this.nylasAuthStore, this.nylasMailboxStore, this.router), this._threadConnector);
|
|
26
|
-
}
|
|
27
|
-
get messages() {
|
|
28
|
-
return this._messageConnector ? this._messageConnector : (this._messageConnector = new O(this.nylasAuth, this.nylasAuthStore, this.nylasMailboxStore), this._messageConnector);
|
|
29
|
-
}
|
|
30
|
-
get folders() {
|
|
31
|
-
return this._foldersConnector ? this._foldersConnector : (this._foldersConnector = new R(this.nylasAuth, this.nylasAuthStore, this.nylasMailboxStore), this._foldersConnector);
|
|
32
|
-
}
|
|
33
|
-
getAuth() {
|
|
34
|
-
return this.nylasAuth;
|
|
35
|
-
}
|
|
36
|
-
resetStores() {
|
|
37
|
-
this.nylasMailboxStore.reset(), this.nylasAuthStore.reset();
|
|
38
|
-
}
|
|
39
|
-
async logout() {
|
|
40
|
-
await this.nylasAuth.logout(), this.resetStores();
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
const H = ":host{display:contents}", k = H, D = class {
|
|
44
|
-
constructor(t) {
|
|
45
|
-
A(this, t), this.init = l(this, "init", 7), this.loggedIn = l(this, "loggedIn", 7), this.loggedOut = l(this, "loggedOut", 7), this.handleAuthChange = async (e) => {
|
|
46
|
-
var s;
|
|
47
|
-
e ? this.loggedIn.emit(this.host) : this.loggedOut.emit(this.host).defaultPrevented || await ((s = this.nylasMailboxConnector) == null ? void 0 : s.logout());
|
|
48
|
-
}, this.automaticComponentRegistration = !0, this.eventOverrides = {}, this.authConfig = void 0, this.defaultAuthStoreState = void 0, this.defaultMailboxStoreState = void 0;
|
|
49
|
-
}
|
|
50
|
-
connectedCallback() {
|
|
51
|
-
S("[nylas-mailbox] connectedCallback");
|
|
52
|
-
}
|
|
53
|
-
async componentWillLoad() {
|
|
54
|
-
var o, i, d, u, c, y, g;
|
|
55
|
-
this.stores = {
|
|
56
|
-
auth: P(this.defaultAuthStoreState),
|
|
57
|
-
mailbox: N(this.defaultMailboxStoreState)
|
|
58
|
-
}, this.baseProvider = new v(this.host, this.stores, this.automaticComponentRegistration, this.eventOverrides), this.router = new I(), this.nylasAuth = w({
|
|
59
|
-
apiUri: "https://api.us.nylas.com",
|
|
60
|
-
elementsApiUri: "https://elements.us.nylas.com",
|
|
61
|
-
storageType: "indexeddb",
|
|
62
|
-
clientId: "YOUR_CLIENT_ID",
|
|
63
|
-
defaultScopes: [],
|
|
64
|
-
redirectURI: "/",
|
|
65
|
-
...this.authConfig
|
|
66
|
-
});
|
|
67
|
-
const t = (o = this.baseProvider) == null ? void 0 : o.getStore("auth");
|
|
68
|
-
if (!t)
|
|
69
|
-
throw new Error("Auth store is not defined");
|
|
70
|
-
const e = (i = this.baseProvider) == null ? void 0 : i.getStore("mailbox");
|
|
71
|
-
if (!e)
|
|
72
|
-
throw new Error("Mailbox store is not defined");
|
|
73
|
-
this.nylasMailboxConnector = new T(this.router, this.nylasAuth, t, e), this.init.emit(this.host).defaultPrevented || await ((d = this.nylasMailboxConnector) == null ? void 0 : d.auth.validateSession()), (u = this.router) == null || u.addRouteChangeListener("/thread/:threadId", async (x, p, b) => {
|
|
74
|
-
var a, r;
|
|
75
|
-
const h = b.threadId, n = await ((a = this.nylasMailboxConnector) == null ? void 0 : a.threads.getThread(h));
|
|
76
|
-
n && ((r = this.nylasMailboxConnector) == null || r.mailboxStore.set("selectedThread", n));
|
|
77
|
-
}), (c = this.router) == null || c.addRouteChangeListener("/", async (x, p, b) => {
|
|
78
|
-
var n, a, r, C;
|
|
79
|
-
if (!t.state.isAuthenticated)
|
|
80
|
-
return;
|
|
81
|
-
(n = this.nylasMailboxConnector) == null || n.threads.unSelectThread(), (a = this.nylasMailboxConnector) == null || a.folders.getFolders();
|
|
82
|
-
const h = window.location.hash.split("?")[1];
|
|
83
|
-
if (h) {
|
|
84
|
-
const m = new URLSearchParams(h).get("query");
|
|
85
|
-
m && await ((r = this.nylasMailboxConnector) == null ? void 0 : r.threads.getThreads({
|
|
86
|
-
search_query_native: m,
|
|
87
|
-
page_token: void 0
|
|
88
|
-
}));
|
|
89
|
-
} else
|
|
90
|
-
(C = this.nylasMailboxConnector) == null || C.threads.getThreads();
|
|
91
|
-
}), (y = this.router) == null || y.init(), this.handleAuthChange(t.state.isAuthenticated), (g = this.baseProvider) == null || g.componentWillLoad(this.nylasMailboxConnector);
|
|
92
|
-
}
|
|
93
|
-
async componentDidLoad() {
|
|
94
|
-
var e, s;
|
|
95
|
-
const t = (e = this.baseProvider) == null ? void 0 : e.getStore("auth");
|
|
96
|
-
if (!t)
|
|
97
|
-
throw new Error("Auth store is not defined");
|
|
98
|
-
t.onChange("isAuthenticated", this.handleAuthChange), (s = this.baseProvider) == null || s.componentDidLoad();
|
|
99
|
-
}
|
|
100
|
-
componentDisconnected() {
|
|
101
|
-
var t;
|
|
102
|
-
(t = this.baseProvider) == null || t.componentDisconnected();
|
|
103
|
-
}
|
|
104
|
-
async registerComponentHandler(t) {
|
|
105
|
-
var e;
|
|
106
|
-
(e = this.baseProvider) == null || e.registerComponent(t.detail);
|
|
107
|
-
}
|
|
108
|
-
async unregisterComponentHandler(t) {
|
|
109
|
-
var e;
|
|
110
|
-
(e = this.baseProvider) == null || e.unregisterComponent(t.detail);
|
|
111
|
-
}
|
|
112
|
-
async getMailboxStore() {
|
|
113
|
-
var t;
|
|
114
|
-
return (t = this.baseProvider) == null ? void 0 : t.getStore("mailbox");
|
|
115
|
-
}
|
|
116
|
-
async getAuthStore() {
|
|
117
|
-
var t;
|
|
118
|
-
return (t = this.baseProvider) == null ? void 0 : t.getStore("auth");
|
|
119
|
-
}
|
|
120
|
-
async getNylasAuth() {
|
|
121
|
-
return this.nylasAuth;
|
|
122
|
-
}
|
|
123
|
-
async getNylasMailboxConnector() {
|
|
124
|
-
return this.nylasMailboxConnector;
|
|
125
|
-
}
|
|
126
|
-
render() {
|
|
127
|
-
return f(M, { key: "c60eb0c2f7929884b9ac702c50451ab6e09a2b6c" }, f("slot", { key: "7c5e0f6dfb81b7e3e4dd67a700b78e1143e2bf53" }));
|
|
128
|
-
}
|
|
129
|
-
get host() {
|
|
130
|
-
return _(this);
|
|
131
|
-
}
|
|
132
|
-
};
|
|
133
|
-
D.style = k;
|
|
134
|
-
export {
|
|
135
|
-
D as nylas_mailbox
|
|
136
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index-2b8437d6.cjs"),f=require("./index.es-2578c6a5-098d48d0.cjs"),x=require("./utils-c00bdc3c-94b9c3b6.cjs"),n=require("./mailbox-store-bb21512c-fc3c8c03.cjs");require("react");require("react-dom");require("./_commonjsHelpers-57e89916-4a3ae7d8.cjs");class _{constructor(e,s,r,l){this.router=e,this.nylasAuth=s,this.nylasAuthStore=r,this.nylasMailboxStore=l}init(){x.debug("NylasMailboxConnector init")}get mailboxStore(){return this.nylasMailboxStore}get authStore(){return this.nylasAuthStore}get auth(){return this._authConnector?this._authConnector:(this._authConnector=new n.NylasAuthConnector(this.nylasAuth,this.nylasAuthStore),this._authConnector)}get threads(){return this._threadConnector?this._threadConnector:(this._threadConnector=new n.NylasThreadsConnector(this.nylasAuth,this.nylasAuthStore,this.nylasMailboxStore,this.router),this._threadConnector)}get messages(){return this._messageConnector?this._messageConnector:(this._messageConnector=new n.NylasMessagesConnector(this.nylasAuth,this.nylasAuthStore,this.nylasMailboxStore),this._messageConnector)}get folders(){return this._foldersConnector?this._foldersConnector:(this._foldersConnector=new n.NylasFoldersConnector(this.nylasAuth,this.nylasAuthStore,this.nylasMailboxStore),this._foldersConnector)}getAuth(){return this.nylasAuth}resetStores(){this.nylasMailboxStore.reset(),this.nylasAuthStore.reset()}async logout(){await this.nylasAuth.logout(),this.resetStores()}}const p=":host{display:contents}",w=p,A=class{constructor(t){o.registerInstance(this,t),this.init=o.createEvent(this,"init",7),this.loggedIn=o.createEvent(this,"loggedIn",7),this.loggedOut=o.createEvent(this,"loggedOut",7),this.handleAuthChange=async e=>{var s;e?this.loggedIn.emit(this.host):this.loggedOut.emit(this.host).defaultPrevented||await((s=this.nylasMailboxConnector)==null?void 0:s.logout())},this.automaticComponentRegistration=!0,this.eventOverrides={},this.authConfig=void 0,this.defaultAuthStoreState=void 0,this.defaultMailboxStoreState=void 0}connectedCallback(){x.debug("[nylas-mailbox] connectedCallback")}async componentWillLoad(){var r,l,d,c,y,g,b;this.stores={auth:n.CreateNylasAuthStore(this.defaultAuthStoreState),mailbox:n.CreateNylasMailboxStore(this.defaultMailboxStoreState)},this.baseProvider=new f.NylasBaseProvider(this.host,this.stores,this.automaticComponentRegistration,this.eventOverrides),this.router=new n.HashRouter,this.nylasAuth=f.es({apiUri:"https://api.us.nylas.com",elementsApiUri:"https://elements.us.nylas.com",storageType:"indexeddb",clientId:"YOUR_CLIENT_ID",defaultScopes:[],redirectURI:"/",...this.authConfig});const t=(r=this.baseProvider)==null?void 0:r.getStore("auth");if(!t)throw new Error("Auth store is not defined");const e=(l=this.baseProvider)==null?void 0:l.getStore("mailbox");if(!e)throw new Error("Mailbox store is not defined");this.nylasMailboxConnector=new _(this.router,this.nylasAuth,t,e),this.init.emit(this.host).defaultPrevented||await((d=this.nylasMailboxConnector)==null?void 0:d.auth.validateSession()),(c=this.router)==null||c.addRouteChangeListener("/thread/:threadId",async(M,v,C)=>{var a,h;const u=C.threadId,i=await((a=this.nylasMailboxConnector)==null?void 0:a.threads.getThread(u));i&&((h=this.nylasMailboxConnector)==null||h.mailboxStore.set("selectedThread",i))}),(y=this.router)==null||y.addRouteChangeListener("/",async(M,v,C)=>{var i,a,h,S;if(!t.state.isAuthenticated)return;(i=this.nylasMailboxConnector)==null||i.threads.unSelectThread(),(a=this.nylasMailboxConnector)==null||a.folders.getFolders();const u=window.location.hash.split("?")[1];if(u){const m=new URLSearchParams(u).get("query");m&&await((h=this.nylasMailboxConnector)==null?void 0:h.threads.getThreads({search_query_native:m,page_token:void 0}))}else(S=this.nylasMailboxConnector)==null||S.threads.getThreads()}),(g=this.router)==null||g.init(),this.handleAuthChange(t.state.isAuthenticated),(b=this.baseProvider)==null||b.componentWillLoad(this.nylasMailboxConnector)}async componentDidLoad(){var e,s;const t=(e=this.baseProvider)==null?void 0:e.getStore("auth");if(!t)throw new Error("Auth store is not defined");t.onChange("isAuthenticated",this.handleAuthChange),(s=this.baseProvider)==null||s.componentDidLoad()}componentDisconnected(){var t;(t=this.baseProvider)==null||t.componentDisconnected()}async registerComponentHandler(t){var e;(e=this.baseProvider)==null||e.registerComponent(t.detail)}async unregisterComponentHandler(t){var e;(e=this.baseProvider)==null||e.unregisterComponent(t.detail)}async getMailboxStore(){var t;return(t=this.baseProvider)==null?void 0:t.getStore("mailbox")}async getAuthStore(){var t;return(t=this.baseProvider)==null?void 0:t.getStore("auth")}async getNylasAuth(){return this.nylasAuth}async getNylasMailboxConnector(){return this.nylasMailboxConnector}render(){return o.h(o.Host,{key:"c60eb0c2f7929884b9ac702c50451ab6e09a2b6c"},o.h("slot",{key:"7c5e0f6dfb81b7e3e4dd67a700b78e1143e2bf53"}))}get host(){return o.getElement(this)}};A.style=w;exports.nylas_mailbox=A;
|
|
@@ -1,147 +0,0 @@
|
|
|
1
|
-
import { r as C, c as a, h as g, H as S, g as m } from "./index-db0c5017.js";
|
|
2
|
-
import { N as f, e as b } from "./index.es-2578c6a5-71441142.js";
|
|
3
|
-
import { d as h } from "./utils-c00bdc3c-89ab163d.js";
|
|
4
|
-
import { C as p, a as A, H as v, N as P, b as _, c as N, d as w } from "./mailbox-store-bb21512c-649a374c.js";
|
|
5
|
-
import { C as x, N as I } from "./scheduler-store-72116723-e5f87122.js";
|
|
6
|
-
import { C as M } from "./scheduler-config-store-51ee4f42-66f8c2ac.js";
|
|
7
|
-
import "react";
|
|
8
|
-
import "react-dom";
|
|
9
|
-
import "./_commonjsHelpers-57e89916-af061c86.js";
|
|
10
|
-
class E {
|
|
11
|
-
constructor(e, s, r, o, l, n, i = "https://api.us.nylas.com") {
|
|
12
|
-
this.router = e, this.schedulerAPIURL = i, this.nylasAuth = s, this.nylasAuthStore = r, this.nylasMailboxStore = o, this.nylasSchedulerStore = l, this.nylasSchedulerConfigStore = n;
|
|
13
|
-
}
|
|
14
|
-
init() {
|
|
15
|
-
h("NylasConnector init");
|
|
16
|
-
}
|
|
17
|
-
get authStore() {
|
|
18
|
-
return this.nylasAuthStore;
|
|
19
|
-
}
|
|
20
|
-
get mailboxStore() {
|
|
21
|
-
return this.nylasMailboxStore;
|
|
22
|
-
}
|
|
23
|
-
get schedulerStore() {
|
|
24
|
-
return this.nylasSchedulerStore;
|
|
25
|
-
}
|
|
26
|
-
get schedulerConfigStore() {
|
|
27
|
-
return this.nylasSchedulerConfigStore;
|
|
28
|
-
}
|
|
29
|
-
get auth() {
|
|
30
|
-
return this._authConnector ? this._authConnector : (this._authConnector = new P(this.nylasAuth, this.nylasAuthStore), this._authConnector);
|
|
31
|
-
}
|
|
32
|
-
get threads() {
|
|
33
|
-
return this._threadConnector ? this._threadConnector : (this._threadConnector = new _(this.nylasAuth, this.nylasAuthStore, this.nylasMailboxStore, this.router), this._threadConnector);
|
|
34
|
-
}
|
|
35
|
-
get messages() {
|
|
36
|
-
return this._messageConnector ? this._messageConnector : (this._messageConnector = new N(this.nylasAuth, this.nylasAuthStore, this.nylasMailboxStore), this._messageConnector);
|
|
37
|
-
}
|
|
38
|
-
get folders() {
|
|
39
|
-
return this._foldersConnector ? this._foldersConnector : (this._foldersConnector = new w(this.nylasAuth, this.nylasAuthStore, this.nylasMailboxStore), this._foldersConnector);
|
|
40
|
-
}
|
|
41
|
-
get scheduler() {
|
|
42
|
-
return this._schedulerAPIConnector ? this._schedulerAPIConnector : (this._schedulerAPIConnector = new I({
|
|
43
|
-
schedulerAPIURL: this.schedulerAPIURL,
|
|
44
|
-
schedulerStore: this.schedulerStore
|
|
45
|
-
}), this._schedulerAPIConnector);
|
|
46
|
-
}
|
|
47
|
-
getAuth() {
|
|
48
|
-
return this.nylasAuth;
|
|
49
|
-
}
|
|
50
|
-
resetStores() {
|
|
51
|
-
this.nylasAuthStore.reset(), this.nylasMailboxStore.reset();
|
|
52
|
-
}
|
|
53
|
-
async logout() {
|
|
54
|
-
await this.nylasAuth.logout(), this.resetStores();
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
const L = ":host{display:contents}", R = L, T = class {
|
|
58
|
-
constructor(t) {
|
|
59
|
-
C(this, t), this.init = a(this, "init", 7), this.loggedIn = a(this, "loggedIn", 7), this.loggedOut = a(this, "loggedOut", 7), this.handleAuthChange = async (e) => {
|
|
60
|
-
e ? this.loggedIn.emit(this.host) : this.loggedOut.emit(this.host);
|
|
61
|
-
}, this.authConfig = void 0, this.eventOverrides = {}, this.automaticComponentRegistration = !0;
|
|
62
|
-
}
|
|
63
|
-
connectedCallback() {
|
|
64
|
-
h("[nylas-provider] connectedCallback");
|
|
65
|
-
}
|
|
66
|
-
async componentWillLoad() {
|
|
67
|
-
var n, i, c, u, d, y;
|
|
68
|
-
h("[nylas-provider] componentWillLoad"), this.stores = {
|
|
69
|
-
auth: p(),
|
|
70
|
-
mailbox: A(),
|
|
71
|
-
scheduler: x(),
|
|
72
|
-
schedulerConfig: M()
|
|
73
|
-
}, this.baseProvider = new f(this.host, this.stores, this.automaticComponentRegistration, this.eventOverrides);
|
|
74
|
-
const t = new v();
|
|
75
|
-
this.nylasAuth = b({
|
|
76
|
-
apiUri: "https://api.us.nylas.com",
|
|
77
|
-
elementsApiUri: "https://elements.us.nylas.com",
|
|
78
|
-
storageType: "indexeddb",
|
|
79
|
-
clientId: "YOUR_CLIENT_ID",
|
|
80
|
-
defaultScopes: [],
|
|
81
|
-
redirectURI: "/",
|
|
82
|
-
...this.authConfig
|
|
83
|
-
});
|
|
84
|
-
const e = (n = this.baseProvider) == null ? void 0 : n.getStore("mailbox");
|
|
85
|
-
if (!e)
|
|
86
|
-
throw new Error("The mailbox store is not set");
|
|
87
|
-
const s = (i = this.baseProvider) == null ? void 0 : i.getStore("auth");
|
|
88
|
-
if (!s)
|
|
89
|
-
throw new Error("The auth store is not set");
|
|
90
|
-
const r = (c = this.baseProvider) == null ? void 0 : c.getStore("scheduler");
|
|
91
|
-
if (!r)
|
|
92
|
-
throw new Error("The scheduler store is not set");
|
|
93
|
-
const o = (u = this.baseProvider) == null ? void 0 : u.getStore("schedulerConfig");
|
|
94
|
-
if (!o)
|
|
95
|
-
throw new Error("The scheduler config store is not set");
|
|
96
|
-
this.nylasConnector = new E(t, this.nylasAuth, s, e, r, o), this.init.emit(this.host).defaultPrevented || await ((d = this.nylasConnector) == null ? void 0 : d.auth.validateSession()), this.handleAuthChange(s.state.isAuthenticated), (y = this.baseProvider) == null || y.componentWillLoad(this.nylasConnector);
|
|
97
|
-
}
|
|
98
|
-
componentDidLoad() {
|
|
99
|
-
var e, s;
|
|
100
|
-
const t = (e = this.baseProvider) == null ? void 0 : e.getStore("auth");
|
|
101
|
-
t == null || t.onChange("isAuthenticated", this.handleAuthChange), (s = this.baseProvider) == null || s.componentDidLoad();
|
|
102
|
-
}
|
|
103
|
-
componentDisconnected() {
|
|
104
|
-
var t;
|
|
105
|
-
(t = this.baseProvider) == null || t.componentDisconnected();
|
|
106
|
-
}
|
|
107
|
-
async registerComponentHandler(t) {
|
|
108
|
-
var e;
|
|
109
|
-
(e = this.baseProvider) == null || e.registerComponent(t.detail);
|
|
110
|
-
}
|
|
111
|
-
async unregisterComponentHandler(t) {
|
|
112
|
-
var e;
|
|
113
|
-
(e = this.baseProvider) == null || e.unregisterComponent(t.detail);
|
|
114
|
-
}
|
|
115
|
-
async getNylasAuth() {
|
|
116
|
-
return this.nylasAuth;
|
|
117
|
-
}
|
|
118
|
-
async getNylasConnector() {
|
|
119
|
-
return this.nylasConnector;
|
|
120
|
-
}
|
|
121
|
-
async getMailboxStore() {
|
|
122
|
-
var t;
|
|
123
|
-
return (t = this.baseProvider) == null ? void 0 : t.getStore("mailbox");
|
|
124
|
-
}
|
|
125
|
-
async getAuthStore() {
|
|
126
|
-
var t;
|
|
127
|
-
return (t = this.baseProvider) == null ? void 0 : t.getStore("auth");
|
|
128
|
-
}
|
|
129
|
-
async getNylasSchedulerStore() {
|
|
130
|
-
var t;
|
|
131
|
-
return (t = this.baseProvider) == null ? void 0 : t.getStore("scheduler");
|
|
132
|
-
}
|
|
133
|
-
async getNylasSchedulerConfigStore() {
|
|
134
|
-
var t;
|
|
135
|
-
return (t = this.baseProvider) == null ? void 0 : t.getStore("schedulerConfig");
|
|
136
|
-
}
|
|
137
|
-
render() {
|
|
138
|
-
return g(S, { key: "cf7646d512fe6614ad4a73ac63c3581f20af1ab2" }, g("slot", { key: "bf17dda1b22695e9862a549866fcd140b5d2e0db" }));
|
|
139
|
-
}
|
|
140
|
-
get host() {
|
|
141
|
-
return m(this);
|
|
142
|
-
}
|
|
143
|
-
};
|
|
144
|
-
T.style = R;
|
|
145
|
-
export {
|
|
146
|
-
T as nylas_provider
|
|
147
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index-2b8437d6.cjs"),S=require("./index.es-2578c6a5-098d48d0.cjs"),l=require("./utils-c00bdc3c-94b9c3b6.cjs"),o=require("./mailbox-store-bb21512c-fc3c8c03.cjs"),C=require("./scheduler-store-72116723-ce4c7a69.cjs"),f=require("./scheduler-config-store-51ee4f42-d7d9c25d.cjs");require("react");require("react-dom");require("./_commonjsHelpers-57e89916-4a3ae7d8.cjs");class m{constructor(t,s,n,i,c,h,a="https://api.us.nylas.com"){this.router=t,this.schedulerAPIURL=a,this.nylasAuth=s,this.nylasAuthStore=n,this.nylasMailboxStore=i,this.nylasSchedulerStore=c,this.nylasSchedulerConfigStore=h}init(){l.debug("NylasConnector init")}get authStore(){return this.nylasAuthStore}get mailboxStore(){return this.nylasMailboxStore}get schedulerStore(){return this.nylasSchedulerStore}get schedulerConfigStore(){return this.nylasSchedulerConfigStore}get auth(){return this._authConnector?this._authConnector:(this._authConnector=new o.NylasAuthConnector(this.nylasAuth,this.nylasAuthStore),this._authConnector)}get threads(){return this._threadConnector?this._threadConnector:(this._threadConnector=new o.NylasThreadsConnector(this.nylasAuth,this.nylasAuthStore,this.nylasMailboxStore,this.router),this._threadConnector)}get messages(){return this._messageConnector?this._messageConnector:(this._messageConnector=new o.NylasMessagesConnector(this.nylasAuth,this.nylasAuthStore,this.nylasMailboxStore),this._messageConnector)}get folders(){return this._foldersConnector?this._foldersConnector:(this._foldersConnector=new o.NylasFoldersConnector(this.nylasAuth,this.nylasAuthStore,this.nylasMailboxStore),this._foldersConnector)}get scheduler(){return this._schedulerAPIConnector?this._schedulerAPIConnector:(this._schedulerAPIConnector=new C.NylaSchedulerAPIConnector({schedulerAPIURL:this.schedulerAPIURL,schedulerStore:this.schedulerStore}),this._schedulerAPIConnector)}getAuth(){return this.nylasAuth}resetStores(){this.nylasAuthStore.reset(),this.nylasMailboxStore.reset()}async logout(){await this.nylasAuth.logout(),this.resetStores()}}const A=":host{display:contents}",v=A,b=class{constructor(e){r.registerInstance(this,e),this.init=r.createEvent(this,"init",7),this.loggedIn=r.createEvent(this,"loggedIn",7),this.loggedOut=r.createEvent(this,"loggedOut",7),this.handleAuthChange=async t=>{t?this.loggedIn.emit(this.host):this.loggedOut.emit(this.host)},this.authConfig=void 0,this.eventOverrides={},this.automaticComponentRegistration=!0}connectedCallback(){l.debug("[nylas-provider] connectedCallback")}async componentWillLoad(){var h,a,u,d,y,g;l.debug("[nylas-provider] componentWillLoad"),this.stores={auth:o.CreateNylasAuthStore(),mailbox:o.CreateNylasMailboxStore(),scheduler:C.CreateNylasSchedulerStore(),schedulerConfig:f.CreateNylasSchedulerConfigStore()},this.baseProvider=new S.NylasBaseProvider(this.host,this.stores,this.automaticComponentRegistration,this.eventOverrides);const e=new o.HashRouter;this.nylasAuth=S.es({apiUri:"https://api.us.nylas.com",elementsApiUri:"https://elements.us.nylas.com",storageType:"indexeddb",clientId:"YOUR_CLIENT_ID",defaultScopes:[],redirectURI:"/",...this.authConfig});const t=(h=this.baseProvider)==null?void 0:h.getStore("mailbox");if(!t)throw new Error("The mailbox store is not set");const s=(a=this.baseProvider)==null?void 0:a.getStore("auth");if(!s)throw new Error("The auth store is not set");const n=(u=this.baseProvider)==null?void 0:u.getStore("scheduler");if(!n)throw new Error("The scheduler store is not set");const i=(d=this.baseProvider)==null?void 0:d.getStore("schedulerConfig");if(!i)throw new Error("The scheduler config store is not set");this.nylasConnector=new m(e,this.nylasAuth,s,t,n,i),this.init.emit(this.host).defaultPrevented||await((y=this.nylasConnector)==null?void 0:y.auth.validateSession()),this.handleAuthChange(s.state.isAuthenticated),(g=this.baseProvider)==null||g.componentWillLoad(this.nylasConnector)}componentDidLoad(){var t,s;const e=(t=this.baseProvider)==null?void 0:t.getStore("auth");e==null||e.onChange("isAuthenticated",this.handleAuthChange),(s=this.baseProvider)==null||s.componentDidLoad()}componentDisconnected(){var e;(e=this.baseProvider)==null||e.componentDisconnected()}async registerComponentHandler(e){var t;(t=this.baseProvider)==null||t.registerComponent(e.detail)}async unregisterComponentHandler(e){var t;(t=this.baseProvider)==null||t.unregisterComponent(e.detail)}async getNylasAuth(){return this.nylasAuth}async getNylasConnector(){return this.nylasConnector}async getMailboxStore(){var e;return(e=this.baseProvider)==null?void 0:e.getStore("mailbox")}async getAuthStore(){var e;return(e=this.baseProvider)==null?void 0:e.getStore("auth")}async getNylasSchedulerStore(){var e;return(e=this.baseProvider)==null?void 0:e.getStore("scheduler")}async getNylasSchedulerConfigStore(){var e;return(e=this.baseProvider)==null?void 0:e.getStore("schedulerConfig")}render(){return r.h(r.Host,{key:"cf7646d512fe6614ad4a73ac63c3581f20af1ab2"},r.h("slot",{key:"bf17dda1b22695e9862a549866fcd140b5d2e0db"}))}get host(){return r.getElement(this)}};b.style=v;exports.nylas_provider=b;
|