@nylas/react 1.0.2-canary.0 → 1.0.2-canary.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/add-circle-icon_18.entry-b66b6343.cjs +1 -0
- package/dist/add-circle-icon_18.entry-f86ae88d.js +1527 -0
- package/dist/{archive-icon_7.entry-0deb31c2.cjs → archive-icon_7.entry-052ac074.cjs} +1 -1
- package/dist/{archive-icon_7.entry-187a3484.js → archive-icon_7.entry-0e34d6e7.js} +17 -17
- package/dist/arrow-icon.entry-2afd9ea9.js +15 -0
- package/dist/{arrow-icon.entry-fb0ebc89.cjs → arrow-icon.entry-93f21385.cjs} +1 -1
- package/dist/{auth-store-764d3768-ce84fc6a.cjs → auth-store-69ac49c7-5a0bbb90.cjs} +1 -1
- package/dist/{auth-store-764d3768-3e9c24a0.js → auth-store-69ac49c7-cbfda055.js} +2 -2
- package/dist/{bold-icon_3.entry-8aebbbdb.js → bold-icon_3.entry-88ce1d25.js} +8 -8
- package/dist/bold-icon_3.entry-8f55a9e7.cjs +1 -0
- package/dist/{calendar-cancel-icon.entry-3f4d6cf2.cjs → calendar-cancel-icon.entry-574c8aa4.cjs} +1 -1
- package/dist/{calendar-cancel-icon.entry-305c099c.js → calendar-cancel-icon.entry-e9c692fa.js} +5 -5
- package/dist/{calendar-check-icon_2.entry-fa7c033a.cjs → calendar-check-icon_2.entry-b0476bca.cjs} +1 -1
- package/dist/{calendar-check-icon_2.entry-1bf4163c.js → calendar-check-icon_2.entry-d461c713.js} +7 -7
- package/dist/{calendar-icon.entry-b5678535.js → calendar-icon.entry-1ca202a4.js} +4 -4
- package/dist/{calendar-icon.entry-78433555.cjs → calendar-icon.entry-98936e6d.cjs} +1 -1
- package/dist/chevron-icon_3.entry-830f52c2.js +105 -0
- package/dist/chevron-icon_3.entry-f7801467.cjs +1 -0
- package/dist/close-icon.entry-37e8361f.js +15 -0
- package/dist/close-icon.entry-8d6e9816.cjs +1 -0
- package/dist/{constants-d93cf397-e3587f5c.cjs → constants-b6bf6671-27e2557d.cjs} +4 -4
- package/dist/{constants-d93cf397-dd67263d.js → constants-b6bf6671-49a0f1f2.js} +464 -442
- package/dist/{document-refresh-icon.entry-8791ab16.js → document-refresh-icon.entry-faea08ce.js} +2 -2
- package/dist/document-refresh-icon.entry-fcb33921.cjs +1 -0
- package/dist/elements/index.d.ts +9 -3
- package/dist/{forward-icon_6.entry-cb605bfc.js → forward-icon_6.entry-8da1f65d.js} +10 -10
- package/dist/{forward-icon_6.entry-903ccd33.cjs → forward-icon_6.entry-c4b37cb1.cjs} +2 -2
- package/dist/globe-icon.entry-4720304b.js +15 -0
- package/dist/globe-icon.entry-90a0b9c9.cjs +1 -0
- package/dist/{index-10914bc1-1a809477.js → index-10914bc1-346f04fa.js} +3 -3
- package/dist/{index-10914bc1-93ff6f46.cjs → index-10914bc1-c8c3a2f3.cjs} +1 -1
- package/dist/index-457dcf0b.cjs +30 -0
- package/dist/index-ce40ad47.js +1570 -0
- package/dist/info-icon_2.entry-81e95048.cjs +1 -0
- package/dist/info-icon_2.entry-9307db18.js +34 -0
- package/dist/loading-icon.entry-06d37ef0.cjs +1 -0
- package/dist/loading-icon.entry-dc518df4.js +15 -0
- package/dist/{mailbox-store-6b9425dc-a0366cf2.cjs → mailbox-store-e721b17c-4e97e07d.cjs} +1 -1
- package/dist/{mailbox-store-6b9425dc-c249fa99.js → mailbox-store-e721b17c-cf9a43dd.js} +2 -2
- package/dist/nylas-additional-participants.entry-1653dec7.js +83 -0
- package/dist/nylas-additional-participants.entry-ff8bf378.cjs +1 -0
- package/dist/nylas-booked-event-card_10.entry-06bc3c51.cjs +1 -0
- package/dist/nylas-booked-event-card_10.entry-aa971e8a.js +784 -0
- package/dist/nylas-editor-tabs.entry-49b5a3ab.cjs +1 -0
- package/dist/nylas-editor-tabs.entry-9d0959bf.js +181 -0
- package/dist/nylas-form-card.entry-69d2095b.cjs +1 -0
- package/dist/nylas-form-card.entry-c4e78f88.js +56 -0
- package/dist/{nylas-if-state_3.entry-e7b615a1.js → nylas-if-state_3.entry-2eb3f385.js} +8 -8
- package/dist/{nylas-if-state_3.entry-2093c593.cjs → nylas-if-state_3.entry-5baf6d6f.cjs} +1 -1
- package/dist/{nylas-list-folders.entry-dff7a835.cjs → nylas-list-folders.entry-3b24d92d.cjs} +1 -1
- package/dist/{nylas-list-folders.entry-744293ae.js → nylas-list-folders.entry-995fa819.js} +4 -4
- package/dist/{nylas-list-threads.entry-85ad1b74.js → nylas-list-threads.entry-21466eb3.js} +6 -6
- package/dist/{nylas-list-threads.entry-edb1d265.cjs → nylas-list-threads.entry-fda42ded.cjs} +1 -1
- package/dist/{nylas-mailbox-pagination.entry-55ef4b8c.js → nylas-mailbox-pagination.entry-02d40186.js} +3 -3
- package/dist/{nylas-mailbox-pagination.entry-5b888a0e.cjs → nylas-mailbox-pagination.entry-9dcd4901.cjs} +1 -1
- package/dist/{nylas-mailbox-toolbar-button.entry-bb42156a.cjs → nylas-mailbox-toolbar-button.entry-d1099fab.cjs} +1 -1
- package/dist/{nylas-mailbox-toolbar-button.entry-bdcf7d17.js → nylas-mailbox-toolbar-button.entry-dbad44b4.js} +9 -9
- package/dist/{nylas-provider.entry-cb1ef04e.cjs → nylas-provider.entry-78e2fa30.cjs} +1 -1
- package/dist/{nylas-provider.entry-1dc58829.js → nylas-provider.entry-bbee8c99.js} +8 -8
- package/dist/nylas-scheduler-editor.entry-550d3c59.cjs +1 -0
- package/dist/{nylas-scheduler-config.entry-2382ac1b.js → nylas-scheduler-editor.entry-8f7ecf3b.js} +32 -35
- package/dist/nylas-scheduling.entry-22b5ad07.js +236 -0
- package/dist/nylas-scheduling.entry-30a63738.cjs +1 -0
- package/dist/{nylas-threads-refresh.entry-b35f1b68.cjs → nylas-threads-refresh.entry-05258b36.cjs} +1 -1
- package/dist/{nylas-threads-refresh.entry-ef5d6dfd.js → nylas-threads-refresh.entry-414d8740.js} +12 -12
- package/dist/{nylas-threads-search.entry-e570bf8e.js → nylas-threads-search.entry-a19dc90f.js} +8 -8
- package/dist/{nylas-threads-search.entry-2dda7524.cjs → nylas-threads-search.entry-ff21fc65.cjs} +1 -1
- package/dist/{nylas-view-thread.entry-3939c913.js → nylas-view-thread.entry-38149162.js} +4 -4
- package/dist/{nylas-view-thread.entry-1ee0680f.cjs → nylas-view-thread.entry-5da81e99.cjs} +1 -1
- package/dist/{people-icon.entry-4a88822e.cjs → people-icon.entry-4b682757.cjs} +1 -1
- package/dist/{people-icon.entry-69465395.js → people-icon.entry-5c244c8d.js} +6 -6
- package/dist/play-icon_2.entry-ccdc6b9c.cjs +1 -0
- package/dist/play-icon_2.entry-f36d6d55.js +25 -0
- package/dist/react.cjs +1 -1
- package/dist/react.js +70 -64
- package/dist/{refresh-icon.entry-678f92e7.cjs → refresh-icon.entry-59fff3d4.cjs} +1 -1
- package/dist/{refresh-icon.entry-bd2bf7ce.js → refresh-icon.entry-63456c9a.js} +4 -4
- package/dist/{register-component-486ea571-cdfe1ef9.cjs → register-component-d056a880-2be11c56.cjs} +1 -1
- package/dist/{register-component-486ea571-1f151779.js → register-component-d056a880-f3003d6c.js} +2 -2
- package/dist/{scheduler-config-store-a059f30b-06c1aa21.cjs → scheduler-config-store-4d035001-0256b40c.cjs} +1 -1
- package/dist/{scheduler-config-store-a059f30b-ff3efc00.js → scheduler-config-store-4d035001-db9dc78a.js} +1 -1
- package/dist/{scheduler-store-81058220-263a5f44.js → scheduler-store-0fbe642c-14466305.js} +85 -89
- package/dist/scheduler-store-0fbe642c-410fdbf4.cjs +1 -0
- package/dist/{translate-icon.entry-0c0dbba6.cjs → translate-icon.entry-1784c18e.cjs} +1 -1
- package/dist/{translate-icon.entry-c1fcd2f8.js → translate-icon.entry-35999e70.js} +2 -2
- package/dist/{utils-df5c1963-d9833bcb.js → utils-0cd66d04-89ab163d.js} +98 -101
- package/dist/{utils-df5c1963-1c47e21c.cjs → utils-0cd66d04-94b9c3b6.cjs} +5 -5
- package/dist/{warning-icon.entry-dbd44cdb.cjs → warning-icon.entry-3a702d1d.cjs} +1 -1
- package/dist/warning-icon.entry-73de08c3.js +15 -0
- package/package.json +4 -4
- package/dist/add-circle-icon_13.entry-6dccb5e5.cjs +0 -1
- package/dist/add-circle-icon_13.entry-ab84be80.js +0 -1050
- package/dist/arrow-icon.entry-b782e05a.js +0 -15
- package/dist/bold-icon_3.entry-49e5a1d0.cjs +0 -1
- package/dist/chevron-icon.entry-49b0d3e7.cjs +0 -1
- package/dist/chevron-icon.entry-f484c9a3.js +0 -15
- package/dist/close-icon.entry-24d5c268.js +0 -15
- package/dist/close-icon.entry-37965d55.cjs +0 -1
- package/dist/document-refresh-icon.entry-0e8935fa.cjs +0 -1
- package/dist/duration-bddc4a13-05d3e3e2.cjs +0 -1
- package/dist/duration-bddc4a13-179ce826.js +0 -41
- package/dist/globe-icon_3.entry-71d83904.js +0 -109
- package/dist/globe-icon_3.entry-c6aefc52.cjs +0 -1
- package/dist/index-cee193d2.cjs +0 -30
- package/dist/index-e834697b.js +0 -1562
- package/dist/info-icon.entry-3774a4e3.js +0 -15
- package/dist/info-icon.entry-85bf3fbc.cjs +0 -1
- package/dist/loading-icon.entry-8941102c.js +0 -15
- package/dist/loading-icon.entry-ae6c7b74.cjs +0 -1
- package/dist/nylas-booked-event-card_10.entry-a166d51d.js +0 -739
- package/dist/nylas-booked-event-card_10.entry-b181a874.cjs +0 -1
- package/dist/nylas-form-card.entry-7173dd4a.js +0 -56
- package/dist/nylas-form-card.entry-8fdbefa6.cjs +0 -1
- package/dist/nylas-open-hours-picker.entry-0f4f34f6.cjs +0 -1
- package/dist/nylas-open-hours-picker.entry-7e7060fe.js +0 -187
- package/dist/nylas-scheduler-config.entry-477d2171.cjs +0 -1
- package/dist/nylas-scheduler-editor.entry-1a95d313.cjs +0 -1
- package/dist/nylas-scheduler-editor.entry-c0479087.js +0 -140
- package/dist/nylas-scheduler.entry-69ecc3ae.cjs +0 -1
- package/dist/nylas-scheduler.entry-7084c148.js +0 -231
- package/dist/play-icon_2.entry-bc24fda7.js +0 -25
- package/dist/play-icon_2.entry-bd9f650e.cjs +0 -1
- package/dist/scheduler-store-81058220-a20698af.cjs +0 -1
- package/dist/warning-icon.entry-9631cd2e.js +0 -15
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { r as
|
|
2
|
-
import { R as u } from "./register-component-
|
|
3
|
-
import { d as c } from "./utils-
|
|
1
|
+
import { r as b, h as l, H as y, g as m } from "./index-ce40ad47.js";
|
|
2
|
+
import { R as u } from "./register-component-d056a880-f3003d6c.js";
|
|
3
|
+
import { d as c } from "./utils-0cd66d04-89ab163d.js";
|
|
4
4
|
import "react";
|
|
5
5
|
import "react-dom";
|
|
6
6
|
import "./_commonjsHelpers-57e89916-af061c86.js";
|
|
@@ -17,9 +17,9 @@ var g = function(t, o, e, n) {
|
|
|
17
17
|
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
18
18
|
return Reflect.metadata(t, o);
|
|
19
19
|
};
|
|
20
|
-
const
|
|
20
|
+
const f = class {
|
|
21
21
|
constructor(t) {
|
|
22
|
-
|
|
22
|
+
b(this, t), this.onClick = async () => {
|
|
23
23
|
const o = this.method;
|
|
24
24
|
if (c("[nylas-mailbox-toolbar-button] onClick", { method: o, mailboxConnector: this.mailboxConnector }), this.mailboxConnector && o) {
|
|
25
25
|
const e = this.callMethod(this.mailboxConnector, o);
|
|
@@ -62,7 +62,7 @@ const b = class {
|
|
|
62
62
|
t = this.dataState ? o.get(r) === "loading" : !1;
|
|
63
63
|
}
|
|
64
64
|
const e = t ? "state-loading" : "state-ready";
|
|
65
|
-
return l(y, { key: "
|
|
65
|
+
return l(y, { key: "2454ef2e4270d1642cabe57dacf53908fcdb34e6" }, l("sp-theme", { key: "97d71094fabc3466b87142dfdd1d0bb22659fd32", scale: "medium", color: "dark" }, l("sp-button", { onClick: this.onClick, disabled: t, key: e, "icon-only": this.iconOnly, label: this.renderByState(t) }, this.hasSlot("icon") && l("div", { slot: "icon", class: "slot" }, l("slot", { name: "icon" })), !this.iconOnly && this.renderByState(t))));
|
|
66
66
|
}
|
|
67
67
|
get host() {
|
|
68
68
|
return m(this);
|
|
@@ -77,8 +77,8 @@ g([
|
|
|
77
77
|
d("design:type", Function),
|
|
78
78
|
d("design:paramtypes", []),
|
|
79
79
|
d("design:returntype", void 0)
|
|
80
|
-
],
|
|
81
|
-
|
|
80
|
+
], f.prototype, "render", null);
|
|
81
|
+
f.style = h;
|
|
82
82
|
export {
|
|
83
|
-
|
|
83
|
+
f as nylas_mailbox_toolbar_button
|
|
84
84
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index-457dcf0b.cjs"),C=require("./index-10914bc1-c8c3a2f3.cjs"),l=require("./utils-0cd66d04-94b9c3b6.cjs"),S=require("./auth-store-69ac49c7-5a0bbb90.cjs"),o=require("./mailbox-store-e721b17c-4e97e07d.cjs"),f=require("./scheduler-store-0fbe642c-410fdbf4.cjs"),b=require("./scheduler-config-store-4d035001-0256b40c.cjs");require("react");require("react-dom");require("./_commonjsHelpers-57e89916-4a3ae7d8.cjs");class m{constructor(t,s,n,i,c,h,a="https://api.us.nylas.com"){this.router=t,this.schedulerAPIURL=a,this.nylasAuth=s,this.nylasAuthStore=n,this.nylasMailboxStore=i,this.nylasSchedulerStore=c,this.nylasSchedulerConfigStore=h}init(){l.debug("NylasConnector init")}get authStore(){return this.nylasAuthStore}get mailboxStore(){return this.nylasMailboxStore}get schedulerStore(){return this.nylasSchedulerStore}get schedulerConfigStore(){return this.nylasSchedulerConfigStore}get auth(){return this._authConnector?this._authConnector:(this._authConnector=new S.NylasAuthConnector(this.nylasAuth,this.nylasAuthStore),this._authConnector)}get threads(){return this._threadConnector?this._threadConnector:(this._threadConnector=new o.NylasThreadsConnector(this.nylasAuth,this.nylasAuthStore,this.nylasMailboxStore,this.router),this._threadConnector)}get messages(){return this._messageConnector?this._messageConnector:(this._messageConnector=new o.NylasMessagesConnector(this.nylasAuth,this.nylasAuthStore,this.nylasMailboxStore),this._messageConnector)}get folders(){return this._foldersConnector?this._foldersConnector:(this._foldersConnector=new o.NylasFoldersConnector(this.nylasAuth,this.nylasAuthStore,this.nylasMailboxStore),this._foldersConnector)}get scheduler(){return this._schedulerAPIConnector?this._schedulerAPIConnector:(this._schedulerAPIConnector=new f.NylaSchedulerAPIConnector({schedulerAPIURL:this.schedulerAPIURL,schedulerStore:this.schedulerStore}),this._schedulerAPIConnector)}get schedulerConfig(){return this._schedulerConfigConnector?this._schedulerConfigConnector:(this._schedulerConfigConnector=new b.NylasSchedulerConfigAPIConnector({nylasAuth:this.nylasAuth,nylasAuthStore:this.nylasAuthStore,nylasSchedulerConfigStore:this.nylasSchedulerConfigStore}),this._schedulerConfigConnector)}getAuth(){return this.nylasAuth}resetStores(){this.nylasAuthStore.reset(),this.nylasMailboxStore.reset()}async logout(){await this.nylasAuth.logout(),this.resetStores()}}const v=":host{display:contents}",P=v,A=class{constructor(e){r.registerInstance(this,e),this.init=r.createEvent(this,"init",7),this.loggedIn=r.createEvent(this,"loggedIn",7),this.loggedOut=r.createEvent(this,"loggedOut",7),this.handleAuthChange=async t=>{t?this.loggedIn.emit(this.host):this.loggedOut.emit(this.host)},this.authConfig=void 0,this.eventOverrides={},this.automaticComponentRegistration=!0}connectedCallback(){l.debug("[nylas-provider] connectedCallback")}async componentWillLoad(){var h,a,u,d,g,y;l.debug("[nylas-provider] componentWillLoad"),this.stores={auth:S.CreateNylasAuthStore(),mailbox:o.CreateNylasMailboxStore(),scheduler:f.CreateNylasSchedulerStore(),schedulerConfig:b.CreateNylasSchedulerConfigStore()},this.baseProvider=new C.NylasBaseProvider(this.host,this.stores,this.automaticComponentRegistration,this.eventOverrides);const e=new o.HashRouter;this.nylasAuth=C.es({apiUri:"https://api.us.nylas.com",elementsApiUri:"https://elements.us.nylas.com",storageType:"indexeddb",clientId:"YOUR_CLIENT_ID",defaultScopes:[],redirectURI:"/",...this.authConfig});const t=(h=this.baseProvider)==null?void 0:h.getStore("mailbox");if(!t)throw new Error("The mailbox store is not set");const s=(a=this.baseProvider)==null?void 0:a.getStore("auth");if(!s)throw new Error("The auth store is not set");const n=(u=this.baseProvider)==null?void 0:u.getStore("scheduler");if(!n)throw new Error("The scheduler store is not set");const i=(d=this.baseProvider)==null?void 0:d.getStore("schedulerConfig");if(!i)throw new Error("The scheduler config store is not set");this.nylasConnector=new m(e,this.nylasAuth,s,t,n,i),this.init.emit(this.host).defaultPrevented||await((g=this.nylasConnector)==null?void 0:g.auth.validateSession()),this.handleAuthChange(s.state.isAuthenticated),(y=this.baseProvider)==null||y.componentWillLoad(this.nylasConnector)}componentDidLoad(){var t,s;const e=(t=this.baseProvider)==null?void 0:t.getStore("auth");e==null||e.onChange("isAuthenticated",this.handleAuthChange),(s=this.baseProvider)==null||s.componentDidLoad()}componentDisconnected(){var e;(e=this.baseProvider)==null||e.componentDisconnected()}async registerComponentHandler(e){var t;(t=this.baseProvider)==null||t.registerComponent(e.detail)}async unregisterComponentHandler(e){var t;(t=this.baseProvider)==null||t.unregisterComponent(e.detail)}async getNylasAuth(){return this.nylasAuth}async getNylasConnector(){return this.nylasConnector}async getMailboxStore(){var e;return(e=this.baseProvider)==null?void 0:e.getStore("mailbox")}async getAuthStore(){var e;return(e=this.baseProvider)==null?void 0:e.getStore("auth")}async getNylasSchedulerStore(){var e;return(e=this.baseProvider)==null?void 0:e.getStore("scheduler")}async getNylasSchedulerConfigStore(){var e;return(e=this.baseProvider)==null?void 0:e.getStore("schedulerConfig")}render(){return r.h(r.Host,{key:"c70dbacf5502b79a6306f27b969dd9a9f841f5a0"},r.h("slot",{key:"031e85b2e755d2e4b7f925982a47e32daa5f8200"}))}get host(){return r.getElement(this)}};A.style=P;exports.nylas_provider=A;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { r as C, c as h, h as g, H as S, g as f } from "./index-
|
|
2
|
-
import { N as m, e as A } from "./index-10914bc1-
|
|
3
|
-
import { d as a } from "./utils-
|
|
4
|
-
import { C as b, N as p } from "./auth-store-
|
|
5
|
-
import { C as v, H as P, N as _, a as N, b as w } from "./mailbox-store-
|
|
6
|
-
import { C as I, N as x } from "./scheduler-store-
|
|
7
|
-
import { C as M, N as E } from "./scheduler-config-store-
|
|
1
|
+
import { r as C, c as h, h as g, H as S, g as f } from "./index-ce40ad47.js";
|
|
2
|
+
import { N as m, e as A } from "./index-10914bc1-346f04fa.js";
|
|
3
|
+
import { d as a } from "./utils-0cd66d04-89ab163d.js";
|
|
4
|
+
import { C as b, N as p } from "./auth-store-69ac49c7-cbfda055.js";
|
|
5
|
+
import { C as v, H as P, N as _, a as N, b as w } from "./mailbox-store-e721b17c-cf9a43dd.js";
|
|
6
|
+
import { C as I, N as x } from "./scheduler-store-0fbe642c-14466305.js";
|
|
7
|
+
import { C as M, N as E } from "./scheduler-config-store-4d035001-db9dc78a.js";
|
|
8
8
|
import "react";
|
|
9
9
|
import "react-dom";
|
|
10
10
|
import "./_commonjsHelpers-57e89916-af061c86.js";
|
|
@@ -143,7 +143,7 @@ const R = ":host{display:contents}", T = R, U = class {
|
|
|
143
143
|
return (e = this.baseProvider) == null ? void 0 : e.getStore("schedulerConfig");
|
|
144
144
|
}
|
|
145
145
|
render() {
|
|
146
|
-
return g(S, { key: "
|
|
146
|
+
return g(S, { key: "c70dbacf5502b79a6306f27b969dd9a9f841f5a0" }, g("slot", { key: "031e85b2e755d2e4b7f925982a47e32daa5f8200" }));
|
|
147
147
|
}
|
|
148
148
|
get host() {
|
|
149
149
|
return f(this);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-457dcf0b.cjs"),d=require("./index-10914bc1-c8c3a2f3.cjs"),c=require("./auth-store-69ac49c7-5a0bbb90.cjs"),r=require("./utils-0cd66d04-94b9c3b6.cjs"),u=require("./scheduler-config-store-4d035001-0256b40c.cjs");require("react");require("react-dom");require("./_commonjsHelpers-57e89916-4a3ae7d8.cjs");class y{constructor({nylasAuth:e,nylasAuthStore:n,nylasSchedulerConfigStore:o}){this.nylasAuth=e,this.nylasAuthStore=n,this.nylasSchedulerConfigStore=o}init(){r.debug("NylasSchedulerConfigConnector init")}get authStore(){return this.nylasAuthStore}get auth(){return this._authConnector?this._authConnector:(this._authConnector=new c.NylasAuthConnector(this.nylasAuth,this.nylasAuthStore),this._authConnector)}get schedulerConfigStore(){return this.nylasSchedulerConfigStore}get schedulerConfig(){return this._schedulerConfigConnector?this._schedulerConfigConnector:(this._schedulerConfigConnector=new u.NylasSchedulerConfigAPIConnector({nylasAuth:this.nylasAuth,nylasAuthStore:this.nylasAuthStore,nylasSchedulerConfigStore:this.nylasSchedulerConfigStore}),this._schedulerConfigConnector)}getAuth(){return this.nylasAuth}getTokenInfo(){return this.nylasAuth.getTokenInfo()}resetStores(){r.debug("NylasSchedulerConfigConnector resetStores"),this.nylasAuthStore.reset(),this.nylasSchedulerConfigStore.reset()}async logout(){r.debug("NylasSchedulerConfigConnector logout"),await this.auth.logout(),this.resetStores()}}const f=':host{display:flex;flex-direction:column;overflow:visible;border-radius:var(--nylas-border-radius-2x);width:fit-content;background:var(--nylas-base-0);position:relative;box-shadow:0px 4px 6px -2px rgba(0, 0, 0, 0.05), 0px 10px 15px -3px rgba(0, 0, 0, 0.1);--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif}@media screen and (max-width: 768px){:host{width:auto;min-width:325px}}div.scheduler-editor-header{display:flex;align-items:center;justify-content:space-between;padding:1rem;border-bottom:1px solid var(--nylas-base-200);color:var(--nylas-base-900)}div.scheduler-editor-header h1.scheduler-editor-title{display:flex;align-items:center;gap:0.5rem;width:858px;margin:0;font-size:18px;line-height:24px;font-weight:600}@media screen and (max-width: 768px){div.scheduler-editor-header h1.scheduler-editor-title{width:auto;min-width:calc(325px - 1rem)}}div.scheduler-editor-header button{background:transparent;border:none;cursor:pointer}div.scheduler-editor-header button:hover,div.scheduler-editor-header button:active{color:var(--nylas-primary)}div.scheduler-editor-header button:disabled{cursor:not-allowed}nylas-editor-tabs{width:100%}',C=f,g=class{constructor(s){t.registerInstance(this,s),this.init=t.createEvent(this,"init",7),this.loggedIn=t.createEvent(this,"loggedIn",7),this.loggedOut=t.createEvent(this,"loggedOut",7),this.schedulerConfigCloseClicked=t.createEvent(this,"schedulerConfigCloseClicked",7),this.handleAuthChange=async e=>{var n;e?this.loggedIn.emit(this.host):this.loggedOut.emit(this.host).defaultPrevented||await((n=this.nylasSchedulerConfigConnector)==null?void 0:n.logout())},this.handleSchedulerConfigCloseClicked=e=>{this.schedulerConfigCloseClicked.emit(this.host)},this.authConfig=void 0,this.eventOverrides={},this.defaultAuthStoreState=void 0,this.defaultSchedulerConfigStoreState=void 0,this.mode="app",this.automaticComponentRegistration=!0,this.loggedInUser=""}connectedCallback(){r.debug("[nylas-scheduler-editor] connectedCallback")}async componentWillLoad(){var o,i,a,l;r.debug("[nylas-scheduler-editor] componentWillLoad"),this.stores={auth:c.CreateNylasAuthStore(this.defaultAuthStoreState),schedulerConfig:u.CreateNylasSchedulerConfigStore({...this.defaultSchedulerConfigStoreState})},this.baseProvider=new d.NylasBaseProvider(this.host,this.stores,this.automaticComponentRegistration,this.eventOverrides),this.nylasAuth=d.es({apiUri:"https://api.us.nylas.com",elementsApiUri:"https://elements.us.nylas.com",storageType:"indexeddb",clientId:"YOUR_CLIENT_ID",defaultScopes:[],redirectURI:"/",...this.authConfig});const s=(o=this.baseProvider)==null?void 0:o.getStore("auth"),e=this.baseProvider.getStore("schedulerConfig");if(this.nylasSchedulerConfigConnector=new y({nylasAuth:this.nylasAuth,nylasAuthStore:this.stores.auth,nylasSchedulerConfigStore:e}),!this.init.emit(this.host).defaultPrevented){await((i=this.nylasSchedulerConfigConnector)==null?void 0:i.auth.validateSession());const h=await((a=this.nylasSchedulerConfigConnector)==null?void 0:a.auth.getTokenInfo());h&&(this.loggedInUser=h.email)}this.handleAuthChange(s.state.isAuthenticated),(l=this.baseProvider)==null||l.componentWillLoad(this.nylasSchedulerConfigConnector)}async componentDidLoad(){var s,e,n;r.debug("[nylas-scheduler-editor] componentDidLoad"),(s=this.baseProvider)==null||s.componentDidLoad(),await((n=(e=this.nylasSchedulerConfigConnector)==null?void 0:e.schedulerConfig)==null?void 0:n.getCalendars())}componentDisconnected(){var s;(s=this.baseProvider)==null||s.componentDisconnected()}async registerComponentHandler(s){var e;(e=this.baseProvider)==null||e.registerComponent(s.detail)}async unregisterComponentHandler(s){var e;(e=this.baseProvider)==null||e.unregisterComponent(s.detail)}render(){return this.mode==="app"?t.h(t.Host,null,t.h("div",{class:"scheduler-editor-header"},t.h("h1",{class:"scheduler-editor-title"},t.h("calendar-icon",{width:"18",height:"18"}),"Schedule editor"),t.h("button",{class:"scheduler-editor-close",onClick:e=>this.handleSchedulerConfigCloseClicked(e),part:"nsc-close-button"},t.h("close-icon",{width:"18",height:"18"}))),t.h("nylas-editor-tabs",null)):t.h(t.Host,null,t.h("slot",null))}get host(){return t.getElement(this)}};g.style=C;exports.nylas_scheduler_editor=g;
|
package/dist/{nylas-scheduler-config.entry-2382ac1b.js → nylas-scheduler-editor.entry-8f7ecf3b.js}
RENAMED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { r as u, c as
|
|
2
|
-
import { N as f, e as y } from "./index-10914bc1-
|
|
3
|
-
import { C, N as p } from "./auth-store-
|
|
4
|
-
import { d as o } from "./utils-
|
|
5
|
-
import { C as S, N as
|
|
1
|
+
import { r as u, c as i, h as s, H as c, g } from "./index-ce40ad47.js";
|
|
2
|
+
import { N as f, e as y } from "./index-10914bc1-346f04fa.js";
|
|
3
|
+
import { C, N as p } from "./auth-store-69ac49c7-cbfda055.js";
|
|
4
|
+
import { d as o } from "./utils-0cd66d04-89ab163d.js";
|
|
5
|
+
import { C as S, N as b } from "./scheduler-config-store-4d035001-db9dc78a.js";
|
|
6
6
|
import "react";
|
|
7
7
|
import "react-dom";
|
|
8
8
|
import "./_commonjsHelpers-57e89916-af061c86.js";
|
|
9
|
-
class
|
|
10
|
-
constructor({ nylasAuth:
|
|
11
|
-
this.nylasAuth =
|
|
9
|
+
class m {
|
|
10
|
+
constructor({ nylasAuth: e, nylasAuthStore: n, nylasSchedulerConfigStore: r }) {
|
|
11
|
+
this.nylasAuth = e, this.nylasAuthStore = n, this.nylasSchedulerConfigStore = r;
|
|
12
12
|
}
|
|
13
13
|
init() {
|
|
14
14
|
o("NylasSchedulerConfigConnector init");
|
|
@@ -23,7 +23,7 @@ class b {
|
|
|
23
23
|
return this.nylasSchedulerConfigStore;
|
|
24
24
|
}
|
|
25
25
|
get schedulerConfig() {
|
|
26
|
-
return this._schedulerConfigConnector ? this._schedulerConfigConnector : (this._schedulerConfigConnector = new
|
|
26
|
+
return this._schedulerConfigConnector ? this._schedulerConfigConnector : (this._schedulerConfigConnector = new b({
|
|
27
27
|
nylasAuth: this.nylasAuth,
|
|
28
28
|
nylasAuthStore: this.nylasAuthStore,
|
|
29
29
|
nylasSchedulerConfigStore: this.nylasSchedulerConfigStore
|
|
@@ -42,21 +42,21 @@ class b {
|
|
|
42
42
|
o("NylasSchedulerConfigConnector logout"), await this.auth.logout(), this.resetStores();
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
|
-
const v =
|
|
46
|
-
constructor(
|
|
47
|
-
u(this,
|
|
45
|
+
const v = ':host{display:flex;flex-direction:column;overflow:visible;border-radius:var(--nylas-border-radius-2x);width:fit-content;background:var(--nylas-base-0);position:relative;box-shadow:0px 4px 6px -2px rgba(0, 0, 0, 0.05), 0px 10px 15px -3px rgba(0, 0, 0, 0.1);--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif}@media screen and (max-width: 768px){:host{width:auto;min-width:325px}}div.scheduler-editor-header{display:flex;align-items:center;justify-content:space-between;padding:1rem;border-bottom:1px solid var(--nylas-base-200);color:var(--nylas-base-900)}div.scheduler-editor-header h1.scheduler-editor-title{display:flex;align-items:center;gap:0.5rem;width:858px;margin:0;font-size:18px;line-height:24px;font-weight:600}@media screen and (max-width: 768px){div.scheduler-editor-header h1.scheduler-editor-title{width:auto;min-width:calc(325px - 1rem)}}div.scheduler-editor-header button{background:transparent;border:none;cursor:pointer}div.scheduler-editor-header button:hover,div.scheduler-editor-header button:active{color:var(--nylas-primary)}div.scheduler-editor-header button:disabled{cursor:not-allowed}nylas-editor-tabs{width:100%}', x = v, w = class {
|
|
46
|
+
constructor(t) {
|
|
47
|
+
u(this, t), this.init = i(this, "init", 7), this.loggedIn = i(this, "loggedIn", 7), this.loggedOut = i(this, "loggedOut", 7), this.schedulerConfigCloseClicked = i(this, "schedulerConfigCloseClicked", 7), this.handleAuthChange = async (e) => {
|
|
48
48
|
var n;
|
|
49
|
-
|
|
50
|
-
}, this.handleSchedulerConfigCloseClicked = (
|
|
49
|
+
e ? this.loggedIn.emit(this.host) : this.loggedOut.emit(this.host).defaultPrevented || await ((n = this.nylasSchedulerConfigConnector) == null ? void 0 : n.logout());
|
|
50
|
+
}, this.handleSchedulerConfigCloseClicked = (e) => {
|
|
51
51
|
this.schedulerConfigCloseClicked.emit(this.host);
|
|
52
52
|
}, this.authConfig = void 0, this.eventOverrides = {}, this.defaultAuthStoreState = void 0, this.defaultSchedulerConfigStoreState = void 0, this.mode = "app", this.automaticComponentRegistration = !0, this.loggedInUser = "";
|
|
53
53
|
}
|
|
54
54
|
connectedCallback() {
|
|
55
|
-
o("[nylas-scheduler-
|
|
55
|
+
o("[nylas-scheduler-editor] connectedCallback");
|
|
56
56
|
}
|
|
57
57
|
async componentWillLoad() {
|
|
58
|
-
var
|
|
59
|
-
o("[nylas-scheduler-
|
|
58
|
+
var r, a, l, h;
|
|
59
|
+
o("[nylas-scheduler-editor] componentWillLoad"), this.stores = {
|
|
60
60
|
auth: C(this.defaultAuthStoreState),
|
|
61
61
|
schedulerConfig: S({
|
|
62
62
|
...this.defaultSchedulerConfigStoreState
|
|
@@ -70,39 +70,36 @@ const v = ":host{display:flex;flex-direction:column;overflow:visible;border-radi
|
|
|
70
70
|
redirectURI: "/",
|
|
71
71
|
...this.authConfig
|
|
72
72
|
});
|
|
73
|
-
const
|
|
74
|
-
if (this.nylasSchedulerConfigConnector = new
|
|
73
|
+
const t = (r = this.baseProvider) == null ? void 0 : r.getStore("auth"), e = this.baseProvider.getStore("schedulerConfig");
|
|
74
|
+
if (this.nylasSchedulerConfigConnector = new m({
|
|
75
75
|
nylasAuth: this.nylasAuth,
|
|
76
76
|
nylasAuthStore: this.stores.auth,
|
|
77
|
-
nylasSchedulerConfigStore:
|
|
77
|
+
nylasSchedulerConfigStore: e
|
|
78
78
|
}), !this.init.emit(this.host).defaultPrevented) {
|
|
79
79
|
await ((a = this.nylasSchedulerConfigConnector) == null ? void 0 : a.auth.validateSession());
|
|
80
80
|
const d = await ((l = this.nylasSchedulerConfigConnector) == null ? void 0 : l.auth.getTokenInfo());
|
|
81
81
|
d && (this.loggedInUser = d.email);
|
|
82
82
|
}
|
|
83
|
-
this.handleAuthChange(
|
|
83
|
+
this.handleAuthChange(t.state.isAuthenticated), (h = this.baseProvider) == null || h.componentWillLoad(this.nylasSchedulerConfigConnector);
|
|
84
84
|
}
|
|
85
85
|
async componentDidLoad() {
|
|
86
|
-
var
|
|
87
|
-
o("[nylas-scheduler-
|
|
86
|
+
var t, e, n;
|
|
87
|
+
o("[nylas-scheduler-editor] componentDidLoad"), (t = this.baseProvider) == null || t.componentDidLoad(), await ((n = (e = this.nylasSchedulerConfigConnector) == null ? void 0 : e.schedulerConfig) == null ? void 0 : n.getCalendars());
|
|
88
88
|
}
|
|
89
89
|
componentDisconnected() {
|
|
90
|
-
var e;
|
|
91
|
-
(e = this.baseProvider) == null || e.componentDisconnected();
|
|
92
|
-
}
|
|
93
|
-
async registerComponentHandler(e) {
|
|
94
90
|
var t;
|
|
95
|
-
(t = this.baseProvider) == null || t.
|
|
91
|
+
(t = this.baseProvider) == null || t.componentDisconnected();
|
|
96
92
|
}
|
|
97
|
-
async
|
|
98
|
-
var
|
|
99
|
-
(
|
|
93
|
+
async registerComponentHandler(t) {
|
|
94
|
+
var e;
|
|
95
|
+
(e = this.baseProvider) == null || e.registerComponent(t.detail);
|
|
100
96
|
}
|
|
101
|
-
async
|
|
102
|
-
|
|
97
|
+
async unregisterComponentHandler(t) {
|
|
98
|
+
var e;
|
|
99
|
+
(e = this.baseProvider) == null || e.unregisterComponent(t.detail);
|
|
103
100
|
}
|
|
104
101
|
render() {
|
|
105
|
-
return this.mode === "app" ? s(c, null, s("div", { class: "scheduler-editor-header" }, s("h1", { class: "scheduler-editor-title" }, s("calendar-icon", { width: "18", height: "18" }), "Schedule editor"), s("button", { class: "scheduler-editor-close", onClick: (
|
|
102
|
+
return this.mode === "app" ? s(c, null, s("div", { class: "scheduler-editor-header" }, s("h1", { class: "scheduler-editor-title" }, s("calendar-icon", { width: "18", height: "18" }), "Schedule editor"), s("button", { class: "scheduler-editor-close", onClick: (e) => this.handleSchedulerConfigCloseClicked(e), part: "nsc-close-button" }, s("close-icon", { width: "18", height: "18" }))), s("nylas-editor-tabs", null)) : s(c, null, s("slot", null));
|
|
106
103
|
}
|
|
107
104
|
get host() {
|
|
108
105
|
return g(this);
|
|
@@ -110,5 +107,5 @@ const v = ":host{display:flex;flex-direction:column;overflow:visible;border-radi
|
|
|
110
107
|
};
|
|
111
108
|
w.style = x;
|
|
112
109
|
export {
|
|
113
|
-
w as
|
|
110
|
+
w as nylas_scheduler_editor
|
|
114
111
|
};
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
import { r as x, c as u, h as n, H as d, g as _, F as k } from "./index-ce40ad47.js";
|
|
2
|
+
import { n as f, N as I } from "./index-10914bc1-346f04fa.js";
|
|
3
|
+
import { d as m } from "./utils-0cd66d04-89ab163d.js";
|
|
4
|
+
import { E as b, C, N as E } from "./scheduler-store-0fbe642c-14466305.js";
|
|
5
|
+
import "react";
|
|
6
|
+
import "react-dom";
|
|
7
|
+
import "./_commonjsHelpers-57e89916-af061c86.js";
|
|
8
|
+
class D {
|
|
9
|
+
constructor({ schedulerAPIURL: t, nylasSchedulerStore: s, sessionId: a, configId: i }) {
|
|
10
|
+
if (!t)
|
|
11
|
+
throw new Error("schedulerAPIURL is required");
|
|
12
|
+
if (!s)
|
|
13
|
+
throw new Error("nylasSchedulerStore is required");
|
|
14
|
+
if (!a && !i)
|
|
15
|
+
throw new Error("sessionId is required for private configs, if not config id is required for public configs");
|
|
16
|
+
t === "/" && (t = new URL(window.location.href).origin), this.configId = i, this.sessionId = a, this.schedulerAPIURL = t, this.nylasSchedulerStore = s;
|
|
17
|
+
}
|
|
18
|
+
init() {
|
|
19
|
+
m("NylasConnector init");
|
|
20
|
+
}
|
|
21
|
+
get schedulerStore() {
|
|
22
|
+
return this.nylasSchedulerStore;
|
|
23
|
+
}
|
|
24
|
+
get scheduler() {
|
|
25
|
+
return this._schedulerAPIConnector ? this._schedulerAPIConnector : (this._schedulerAPIConnector = new E({
|
|
26
|
+
schedulerAPIURL: this.schedulerAPIURL,
|
|
27
|
+
schedulerStore: this.schedulerStore,
|
|
28
|
+
sessionId: this.sessionId,
|
|
29
|
+
configId: this.configId
|
|
30
|
+
}), this._schedulerAPIConnector);
|
|
31
|
+
}
|
|
32
|
+
resetStores() {
|
|
33
|
+
this.nylasSchedulerStore.reset();
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
const h = (e, t) => {
|
|
37
|
+
const s = e.isLoading, a = e.showNotification;
|
|
38
|
+
return n(
|
|
39
|
+
k,
|
|
40
|
+
null,
|
|
41
|
+
a && n("nylas-notification", null),
|
|
42
|
+
s && n(
|
|
43
|
+
"div",
|
|
44
|
+
{ class: "loading" },
|
|
45
|
+
n(
|
|
46
|
+
"div",
|
|
47
|
+
{ class: "left" },
|
|
48
|
+
n("div", { class: "skeleton" })
|
|
49
|
+
),
|
|
50
|
+
n(
|
|
51
|
+
"div",
|
|
52
|
+
{ class: "right" },
|
|
53
|
+
n("div", { class: "skeleton" }),
|
|
54
|
+
n("div", { class: "skeleton" }),
|
|
55
|
+
n("div", { class: "skeleton" }),
|
|
56
|
+
n("div", { class: "skeleton" }),
|
|
57
|
+
n("div", { class: "skeleton" })
|
|
58
|
+
)
|
|
59
|
+
),
|
|
60
|
+
!s && t,
|
|
61
|
+
n(
|
|
62
|
+
"div",
|
|
63
|
+
{ class: "footer" },
|
|
64
|
+
"Powered by ",
|
|
65
|
+
n("nylas-logo", null)
|
|
66
|
+
)
|
|
67
|
+
);
|
|
68
|
+
}, y = (e, t) => n("div", { class: "message-banner" }, t), L = ':host{display:flex;flex-direction:column;overflow:visible;border-radius:var(--nylas-border-radius-2x);width:fit-content;background:var(--nylas-base-0);position:relative;box-shadow:0px 4px 6px -2px rgba(0, 0, 0, 0.05), 0px 10px 15px -3px rgba(0, 0, 0, 0.1);--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;font-family:var(--nylas-font-family);font-optical-sizing:auto;font-style:normal;font-variation-settings:"slnt" 0}@media screen and (max-width: 768px){:host{width:auto;min-width:325px}}:root{font-family:inherit}.error{padding:8rem 12rem;color:var(--nylas-base-0);background-color:var(--nylas-error);margin:1.5rem;border-radius:var(--nylas-border-radius-2x)}.message-banner{text-align:right;color:var(--nylas-base-800);padding:1rem;border-bottom:1px solid var(--nylas-color-primary-200);margin-top:1rem}.loading{margin:1.5rem;display:flex;gap:1rem}.loading .skeleton{border-radius:var(--nylas-border-radius-2x);animation:pulsate 1.5s infinite}.loading .skeleton:nth-child(2){animation-delay:-100ms}.loading .skeleton:nth-child(3){animation-delay:-200ms}.loading .skeleton:nth-child(4){animation-delay:-300ms}.loading .skeleton:nth-child(5){animation-delay:-400ms}.loading .left .skeleton{height:100%;width:400px}.loading .right .skeleton{height:5rem;width:300px;margin-bottom:1rem}.loading .right .skeleton:last-child{margin-bottom:0}@keyframes pulsate{0%{background-color:var(--nylas-base-50)}50%{background-color:var(--nylas-base-100)}100%{background-color:var(--nylas-base-50)}}.select-date-page,.additional-data-page,.booked-event-page,.cancelled-event-page,.cancel-flow-page{border-top-left-radius:var(--nylas-border-radius-2x);border-top-right-radius:var(--nylas-border-radius-2x)}.select-date-page,.additional-data-page{display:flex}@media screen and (max-width: 768px){.select-date-page,.additional-data-page{flex-direction:column}}.booked-event-page{background-color:var(--nylas-base-50)}.cancelled-event-page,.cancel-flow-page{padding:1rem;height:496px;display:flex;justify-content:center;align-items:center}.booked-event-page,.cancelled-event-page,.cancel-flow-page{min-width:784px}@media screen and (max-width: 768px){.booked-event-page,.cancelled-event-page,.cancel-flow-page{min-width:90%}}.left-panel{padding:1rem 20px 0;gap:1rem;height:512px;min-width:384px;border-top-left-radius:inherit}@media screen and (max-width: 768px){.left-panel{border-top-right-radius:inherit;min-width:unset}}@media screen and (max-width: 768px){.additional-data-page .left-panel{height:325px}}@media screen and (max-width: 768px){.select-date-page .left-panel{padding:0.5rem 4px 0}}.border{margin-left:-20px;margin-right:-20px;border-top-width:1px;height:1px;background-color:var(--nylas-base-200)}@media screen and (max-width: 768px){.border{display:none}}.right-panel{min-width:360px;width:360px;background-color:var(--nylas-base-50);height:512px;padding-top:16px;border-left:1px solid var(--nylas-base-200);border-top-right-radius:inherit}@media screen and (max-width: 768px){.right-panel{border-top-right-radius:0px;width:inherit;min-width:unset}}.right-panel h2{display:flex;margin:0;height:48px;gap:0.25rem;justify-content:center;align-items:center;width:auto;font-size:1.125rem;line-height:1.5rem;font-weight:500;text-align:center;color:var(--nylas-base-800)}.additional-data-page .left-panel{background-color:var(--nylas-base-50)}.additional-data-page .right-panel{background-color:var(--nylas-base-0)}nylas-selected-event-card{height:496px}@media screen and (max-width: 768px){nylas-selected-event-card{height:325px}}.footer{display:flex;justify-content:flex-end;align-items:center;padding:16px;font-size:14px;font-weight:300;color:var(--nylas-base-500);border-top:1px solid var(--nylas-base-200)}.footer svg{fill:var(--nylas-base-500)}.footer svg{margin-top:1px}nylas-selected-event-card::part(nsec__timezone){position:absolute;bottom:0}', N = L, v = { title: "Something went wrong...", type: f.Error, category: b.Component }, P = class {
|
|
69
|
+
constructor(e) {
|
|
70
|
+
x(this, e), this.init = u(this, "init", 7), this.schedulerWillLoad = u(this, "schedulerWillLoad", 7), this.schedulerDidLoad = u(this, "schedulerDidLoad", 7), this.nylasSchedulerError = u(this, "nylasSchedulerError", 7), this.mode = "app", this.defaultSchedulerState = void 0, this.sessionId = void 0, this.schedulerApiUrl = "https://api.us.nylas.com", this.bookingInfo = void 0, this.rescheduleBookingId = void 0, this.cancelBookingId = void 0, this.configId = void 0, this.eventOverrides = {}, this.isLoading = void 0, this.themeConfig = void 0, this.showNotification = !0, this.automaticComponentRegistration = !0, this.selectedDateLabel = (/* @__PURE__ */ new Date()).toLocaleDateString(void 0, { dateStyle: "full" }) || "No date selected";
|
|
71
|
+
}
|
|
72
|
+
connectedCallback() {
|
|
73
|
+
m("[nylas-scheduler] connectedCallback");
|
|
74
|
+
}
|
|
75
|
+
async componentWillLoad() {
|
|
76
|
+
var s, a;
|
|
77
|
+
if (m("[nylas-scheduler] Component will load"), this.schedulerWillLoad.emit(this.host).defaultPrevented || !this.checkIfSessionIdOrConfigIdExists())
|
|
78
|
+
return;
|
|
79
|
+
this.stores = {
|
|
80
|
+
scheduler: C({
|
|
81
|
+
bookingInfo: this.bookingInfo,
|
|
82
|
+
...this.defaultSchedulerState
|
|
83
|
+
})
|
|
84
|
+
}, this.baseProvider = new I(this.host, this.stores, this.automaticComponentRegistration, this.eventOverrides);
|
|
85
|
+
const t = (s = this.baseProvider) == null ? void 0 : s.getStore("scheduler");
|
|
86
|
+
if (this.nylasSchedulerConnector = new D({
|
|
87
|
+
schedulerAPIURL: this.schedulerApiUrl,
|
|
88
|
+
sessionId: this.sessionId,
|
|
89
|
+
configId: this.configId,
|
|
90
|
+
nylasSchedulerStore: t
|
|
91
|
+
}), this.init.emit(this.host), (a = this.baseProvider) == null || a.componentWillLoad(this.nylasSchedulerConnector), this.themeConfig)
|
|
92
|
+
for (const [i, o] of Object.entries(this.themeConfig))
|
|
93
|
+
this.host.style.setProperty(`${i}`, o);
|
|
94
|
+
}
|
|
95
|
+
async componentDidLoad() {
|
|
96
|
+
var o, g, l, c;
|
|
97
|
+
if ((o = this.baseProvider) == null || o.componentDidLoad(), !this.checkIfSessionIdOrConfigIdExists())
|
|
98
|
+
return;
|
|
99
|
+
const e = (g = this.baseProvider) == null ? void 0 : g.getStore("scheduler"), t = e == null ? void 0 : e.get("selectedTimeslot");
|
|
100
|
+
if (t && (t != null && t.start_time)) {
|
|
101
|
+
if (!this.isTimeslotValid(t))
|
|
102
|
+
return;
|
|
103
|
+
if (e != null && e.get("showBookingForm")) {
|
|
104
|
+
e == null || e.set("selectedDate", t.start_time);
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
const s = e == null ? void 0 : e.get("selectedDate"), a = e == null ? void 0 : e.get("availability");
|
|
109
|
+
let i;
|
|
110
|
+
if (!(a && a.length > 0)) {
|
|
111
|
+
if (!s)
|
|
112
|
+
i = await ((l = this.nylasSchedulerConnector) == null ? void 0 : l.scheduler.getAvailability());
|
|
113
|
+
else {
|
|
114
|
+
const r = new Date(s.getFullYear(), s.getMonth(), 1).getTime() / 1e3, p = new Date(s.getFullYear(), s.getMonth() + 1, 1).getTime() / 1e3;
|
|
115
|
+
i = await ((c = this.nylasSchedulerConnector) == null ? void 0 : c.scheduler.getAvailability(r, p));
|
|
116
|
+
}
|
|
117
|
+
if ((!i || "error" in i) && this.nylasSchedulerError.emit({ ...this.getErrorObject(i == null ? void 0 : i.error) }), !s) {
|
|
118
|
+
let r = /* @__PURE__ */ new Date();
|
|
119
|
+
const p = e == null ? void 0 : e.get("availability").find((w) => new Date(w.start_time) > /* @__PURE__ */ new Date());
|
|
120
|
+
p && (r = p.start_time), e == null || e.set("selectedDate", r);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
componentDisconnected() {
|
|
125
|
+
var e;
|
|
126
|
+
(e = this.baseProvider) == null || e.componentDisconnected();
|
|
127
|
+
}
|
|
128
|
+
bookingInfoChanged(e) {
|
|
129
|
+
var t;
|
|
130
|
+
(t = this.stores) == null || t.scheduler.set("bookingInfo", e);
|
|
131
|
+
}
|
|
132
|
+
async registerComponentHandler(e) {
|
|
133
|
+
var t;
|
|
134
|
+
(t = this.baseProvider) == null || t.registerComponent(e.detail);
|
|
135
|
+
}
|
|
136
|
+
async unregisterComponentHandler(e) {
|
|
137
|
+
var t;
|
|
138
|
+
(t = this.baseProvider) == null || t.unregisterComponent(e.detail);
|
|
139
|
+
}
|
|
140
|
+
async monthChangedHandler(e) {
|
|
141
|
+
var o;
|
|
142
|
+
const t = e.detail, s = new Date(t.getFullYear(), t.getMonth(), 1).getTime() / 1e3, a = new Date(t.getFullYear(), t.getMonth() + 1, 1).getTime() / 1e3, i = await ((o = this.nylasSchedulerConnector) == null ? void 0 : o.scheduler.getAvailability(s, a));
|
|
143
|
+
(!i || "error" in i) && this.nylasSchedulerError.emit({ ...this.getErrorObject(i == null ? void 0 : i.error) });
|
|
144
|
+
}
|
|
145
|
+
async bookButtonClickedHandler(e) {
|
|
146
|
+
var s, a;
|
|
147
|
+
if (this.rescheduleBookingId) {
|
|
148
|
+
const i = await ((s = this.nylasSchedulerConnector) == null ? void 0 : s.scheduler.rescheduleBooking(this.rescheduleBookingId, e.detail));
|
|
149
|
+
(!i || "error" in i) && this.nylasSchedulerError.emit({ ...this.getErrorObject(i == null ? void 0 : i.error) });
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
152
|
+
const t = await ((a = this.nylasSchedulerConnector) == null ? void 0 : a.scheduler.bookTimeslot(e.detail));
|
|
153
|
+
(!t || "error" in t) && this.nylasSchedulerError.emit({ ...this.getErrorObject(t == null ? void 0 : t.error) });
|
|
154
|
+
}
|
|
155
|
+
dateSelectedHandler(e) {
|
|
156
|
+
const t = e.detail;
|
|
157
|
+
this.selectedDateLabel = t ? t.toLocaleDateString(void 0, { dateStyle: "full" }) : "No date selected";
|
|
158
|
+
}
|
|
159
|
+
cancelBookedEventErrorHandler(e) {
|
|
160
|
+
this.nylasSchedulerError.emit({ ...this.getErrorObject(e.detail.error) });
|
|
161
|
+
}
|
|
162
|
+
rescheduleBookedEventErrorHandler(e) {
|
|
163
|
+
this.nylasSchedulerError.emit({ ...this.getErrorObject(e.detail.error) });
|
|
164
|
+
}
|
|
165
|
+
async getNylasSchedulerStore() {
|
|
166
|
+
var e;
|
|
167
|
+
return (e = this.baseProvider) == null ? void 0 : e.getStore("scheduler");
|
|
168
|
+
}
|
|
169
|
+
async getNylasSchedulerConnector() {
|
|
170
|
+
return this.nylasSchedulerConnector;
|
|
171
|
+
}
|
|
172
|
+
async getRef() {
|
|
173
|
+
return this.host;
|
|
174
|
+
}
|
|
175
|
+
getErrorObject(e) {
|
|
176
|
+
return {
|
|
177
|
+
title: (e == null ? void 0 : e.title) || v.title,
|
|
178
|
+
category: (e == null ? void 0 : e.category) || v.category,
|
|
179
|
+
type: f.Error,
|
|
180
|
+
description: (e == null ? void 0 : e.message) || "",
|
|
181
|
+
id: (/* @__PURE__ */ new Date()).getTime().toString(),
|
|
182
|
+
ttl: "none"
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
checkIfSessionIdOrConfigIdExists() {
|
|
186
|
+
return !this.sessionId && !this.configId ? (this.nylasSchedulerError.emit({
|
|
187
|
+
title: "No sessionId!",
|
|
188
|
+
category: b.Component,
|
|
189
|
+
type: f.Error,
|
|
190
|
+
description: "Session ID is required",
|
|
191
|
+
id: (/* @__PURE__ */ new Date()).getTime().toString(),
|
|
192
|
+
ttl: "none"
|
|
193
|
+
}), !1) : !0;
|
|
194
|
+
}
|
|
195
|
+
isTimeslotValid(e) {
|
|
196
|
+
return new Date(e.start_time) < /* @__PURE__ */ new Date() ? (this.nylasSchedulerError.emit({
|
|
197
|
+
title: "Invalid tiemslot!",
|
|
198
|
+
category: b.Component,
|
|
199
|
+
type: f.Error,
|
|
200
|
+
description: "The selected timeslot is invalid.",
|
|
201
|
+
id: (/* @__PURE__ */ new Date()).getTime().toString(),
|
|
202
|
+
ttl: "none"
|
|
203
|
+
}), !1) : !0;
|
|
204
|
+
}
|
|
205
|
+
render() {
|
|
206
|
+
var c;
|
|
207
|
+
const e = this.mode === "app", t = (c = this.baseProvider) == null ? void 0 : c.getStore("scheduler"), s = t == null ? void 0 : t.get("eventInfo"), a = t == null ? void 0 : t.get("showBookingForm"), i = t == null ? void 0 : t.get("cancelledEventInfo"), o = (t == null ? void 0 : t.get("cancelBookingId")) || this.cancelBookingId, g = t == null ? void 0 : t.get("selectedTimeslot"), l = (t == null ? void 0 : t.get("rescheduleBookingId")) || this.rescheduleBookingId;
|
|
208
|
+
if (e && o && !i)
|
|
209
|
+
return n(d, null, n(h, { isLoading: this.isLoading, showNotification: this.showNotification }, n("div", { class: "cancel-flow-page", part: "cancel-flow-page" }, n("nylas-cancel-booking-form", { cancelBookingId: o, exportparts: "ncbf, ncbf__input-textfield, ncbf__button-cta, ncbf__button-outline, ncbf__input-label" }))));
|
|
210
|
+
if (e && i)
|
|
211
|
+
return n(d, null, n(h, { isLoading: this.isLoading, showNotification: this.showNotification }, n("div", { class: "cancelled-event-page", part: "cancelled-event-page" }, n("nylas-cancelled-event-card", { cancelledEventInfo: i, exportparts: "ncec, ncec__icon, ncec__title, ncec__description, ncec__button-outline, ncec__card" }))));
|
|
212
|
+
if (e && s)
|
|
213
|
+
return n(d, null, n(h, { isLoading: this.isLoading, showNotification: this.showNotification }, n("div", { class: "booked-event-page", part: "booked-event-page" }, n("nylas-booked-event-card", { selectedTimeslot: g, eventInfo: s, exportparts: "nbec, nbec__title, nbec__card, nbec__description, nbec__button-outline, nbec__cancel-cta, nbec__reschedule-cta" }))));
|
|
214
|
+
if (e && (!s || l) && !a) {
|
|
215
|
+
const r = this.host.querySelector('[slot="timeslot-picker-cta-label"]');
|
|
216
|
+
return n(d, null, n(h, { isLoading: this.isLoading, showNotification: this.showNotification }, l && n(y, null, "Choose another time slot to reschedule your meeting"), n("div", { class: "select-date-page", part: "select-date-page" }, n("div", { class: "left-panel" }, n("nylas-date-picker", { exportparts: "ndp, ndp__month-header, ndp__month-button, ndp__day, ndp__date, ndp__date--selected, ndp__date--current-day, ndp__date--current-month" }), n("div", { class: "border" }), n("nylas-locale-switch", null)), n("div", { class: "right-panel" }, n("h2", null, n("calendar-icon", null), n("span", { id: "selectedDate" }, this.selectedDateLabel)), n("nylas-timeslot-picker", { exportparts: "ntp, ntp__timeslot, ntp__timeslot--selected, ntp__button-primary" }, r && n("span", { slot: "timeslot-picker-cta-label" }, n("slot", { name: "timeslot-picker-cta-label" })))))));
|
|
217
|
+
}
|
|
218
|
+
if (e && !s && a) {
|
|
219
|
+
const r = this.host.querySelector('[slot="custom-booking-form"]');
|
|
220
|
+
return n(d, null, n(h, { isLoading: this.isLoading, showNotification: this.showNotification }, l && n(y, null, "Choose another time slot to reschedule your meeting"), n("div", { class: "additional-data-page", part: "additional-data-page" }, n("div", { class: "left-panel" }, n("div", { class: "wrapper" }, n("nylas-selected-event-card", { exportparts: "nsec, nsec__card, nsec__icon, nsec__date, nsec__time" }))), n("div", { class: "right-panel" }, n("nylas-booking-form", { exportparts: "nbf, nbf__input-label, nbf__input-textfield, nbf__button-ghost, nbf__button-primary, nbf__button-outline" }, r && n("div", { slot: "custom-booking-form" }, n("slot", { name: "custom-booking-form" })))))));
|
|
221
|
+
}
|
|
222
|
+
return n(d, null, n("slot", null));
|
|
223
|
+
}
|
|
224
|
+
get host() {
|
|
225
|
+
return _(this);
|
|
226
|
+
}
|
|
227
|
+
static get watchers() {
|
|
228
|
+
return {
|
|
229
|
+
bookingInfo: ["bookingInfoChanged"]
|
|
230
|
+
};
|
|
231
|
+
}
|
|
232
|
+
};
|
|
233
|
+
P.style = N;
|
|
234
|
+
export {
|
|
235
|
+
P as nylas_scheduling
|
|
236
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-457dcf0b.cjs"),h=require("./index-10914bc1-c8c3a2f3.cjs"),f=require("./utils-0cd66d04-94b9c3b6.cjs"),g=require("./scheduler-store-0fbe642c-410fdbf4.cjs");require("react");require("react-dom");require("./_commonjsHelpers-57e89916-4a3ae7d8.cjs");class w{constructor({schedulerAPIURL:n,nylasSchedulerStore:s,sessionId:o,configId:i}){if(!n)throw new Error("schedulerAPIURL is required");if(!s)throw new Error("nylasSchedulerStore is required");if(!o&&!i)throw new Error("sessionId is required for private configs, if not config id is required for public configs");n==="/"&&(n=new URL(window.location.href).origin),this.configId=i,this.sessionId=o,this.schedulerAPIURL=n,this.nylasSchedulerStore=s}init(){f.debug("NylasConnector init")}get schedulerStore(){return this.nylasSchedulerStore}get scheduler(){return this._schedulerAPIConnector?this._schedulerAPIConnector:(this._schedulerAPIConnector=new g.NylaSchedulerAPIConnector({schedulerAPIURL:this.schedulerAPIURL,schedulerStore:this.schedulerStore,sessionId:this.sessionId,configId:this.configId}),this._schedulerAPIConnector)}resetStores(){this.nylasSchedulerStore.reset()}}const c=(e,n)=>{const s=e.isLoading,o=e.showNotification;return t.h(t.Fragment,null,o&&t.h("nylas-notification",null),s&&t.h("div",{class:"loading"},t.h("div",{class:"left"},t.h("div",{class:"skeleton"})),t.h("div",{class:"right"},t.h("div",{class:"skeleton"}),t.h("div",{class:"skeleton"}),t.h("div",{class:"skeleton"}),t.h("div",{class:"skeleton"}),t.h("div",{class:"skeleton"}))),!s&&n,t.h("div",{class:"footer"},"Powered by ",t.h("nylas-logo",null)))},m=(e,n)=>t.h("div",{class:"message-banner"},n),x=':host{display:flex;flex-direction:column;overflow:visible;border-radius:var(--nylas-border-radius-2x);width:fit-content;background:var(--nylas-base-0);position:relative;box-shadow:0px 4px 6px -2px rgba(0, 0, 0, 0.05), 0px 10px 15px -3px rgba(0, 0, 0, 0.1);--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;font-family:var(--nylas-font-family);font-optical-sizing:auto;font-style:normal;font-variation-settings:"slnt" 0}@media screen and (max-width: 768px){:host{width:auto;min-width:325px}}:root{font-family:inherit}.error{padding:8rem 12rem;color:var(--nylas-base-0);background-color:var(--nylas-error);margin:1.5rem;border-radius:var(--nylas-border-radius-2x)}.message-banner{text-align:right;color:var(--nylas-base-800);padding:1rem;border-bottom:1px solid var(--nylas-color-primary-200);margin-top:1rem}.loading{margin:1.5rem;display:flex;gap:1rem}.loading .skeleton{border-radius:var(--nylas-border-radius-2x);animation:pulsate 1.5s infinite}.loading .skeleton:nth-child(2){animation-delay:-100ms}.loading .skeleton:nth-child(3){animation-delay:-200ms}.loading .skeleton:nth-child(4){animation-delay:-300ms}.loading .skeleton:nth-child(5){animation-delay:-400ms}.loading .left .skeleton{height:100%;width:400px}.loading .right .skeleton{height:5rem;width:300px;margin-bottom:1rem}.loading .right .skeleton:last-child{margin-bottom:0}@keyframes pulsate{0%{background-color:var(--nylas-base-50)}50%{background-color:var(--nylas-base-100)}100%{background-color:var(--nylas-base-50)}}.select-date-page,.additional-data-page,.booked-event-page,.cancelled-event-page,.cancel-flow-page{border-top-left-radius:var(--nylas-border-radius-2x);border-top-right-radius:var(--nylas-border-radius-2x)}.select-date-page,.additional-data-page{display:flex}@media screen and (max-width: 768px){.select-date-page,.additional-data-page{flex-direction:column}}.booked-event-page{background-color:var(--nylas-base-50)}.cancelled-event-page,.cancel-flow-page{padding:1rem;height:496px;display:flex;justify-content:center;align-items:center}.booked-event-page,.cancelled-event-page,.cancel-flow-page{min-width:784px}@media screen and (max-width: 768px){.booked-event-page,.cancelled-event-page,.cancel-flow-page{min-width:90%}}.left-panel{padding:1rem 20px 0;gap:1rem;height:512px;min-width:384px;border-top-left-radius:inherit}@media screen and (max-width: 768px){.left-panel{border-top-right-radius:inherit;min-width:unset}}@media screen and (max-width: 768px){.additional-data-page .left-panel{height:325px}}@media screen and (max-width: 768px){.select-date-page .left-panel{padding:0.5rem 4px 0}}.border{margin-left:-20px;margin-right:-20px;border-top-width:1px;height:1px;background-color:var(--nylas-base-200)}@media screen and (max-width: 768px){.border{display:none}}.right-panel{min-width:360px;width:360px;background-color:var(--nylas-base-50);height:512px;padding-top:16px;border-left:1px solid var(--nylas-base-200);border-top-right-radius:inherit}@media screen and (max-width: 768px){.right-panel{border-top-right-radius:0px;width:inherit;min-width:unset}}.right-panel h2{display:flex;margin:0;height:48px;gap:0.25rem;justify-content:center;align-items:center;width:auto;font-size:1.125rem;line-height:1.5rem;font-weight:500;text-align:center;color:var(--nylas-base-800)}.additional-data-page .left-panel{background-color:var(--nylas-base-50)}.additional-data-page .right-panel{background-color:var(--nylas-base-0)}nylas-selected-event-card{height:496px}@media screen and (max-width: 768px){nylas-selected-event-card{height:325px}}.footer{display:flex;justify-content:flex-end;align-items:center;padding:16px;font-size:14px;font-weight:300;color:var(--nylas-base-500);border-top:1px solid var(--nylas-base-200)}.footer svg{fill:var(--nylas-base-500)}.footer svg{margin-top:1px}nylas-selected-event-card::part(nsec__timezone){position:absolute;bottom:0}',_=x,b={title:"Something went wrong...",type:h.nr.Error,category:g.ErrorCategory.Component},y=class{constructor(e){t.registerInstance(this,e),this.init=t.createEvent(this,"init",7),this.schedulerWillLoad=t.createEvent(this,"schedulerWillLoad",7),this.schedulerDidLoad=t.createEvent(this,"schedulerDidLoad",7),this.nylasSchedulerError=t.createEvent(this,"nylasSchedulerError",7),this.mode="app",this.defaultSchedulerState=void 0,this.sessionId=void 0,this.schedulerApiUrl="https://api.us.nylas.com",this.bookingInfo=void 0,this.rescheduleBookingId=void 0,this.cancelBookingId=void 0,this.configId=void 0,this.eventOverrides={},this.isLoading=void 0,this.themeConfig=void 0,this.showNotification=!0,this.automaticComponentRegistration=!0,this.selectedDateLabel=new Date().toLocaleDateString(void 0,{dateStyle:"full"})||"No date selected"}connectedCallback(){f.debug("[nylas-scheduler] connectedCallback")}async componentWillLoad(){var s,o;if(f.debug("[nylas-scheduler] Component will load"),this.schedulerWillLoad.emit(this.host).defaultPrevented||!this.checkIfSessionIdOrConfigIdExists())return;this.stores={scheduler:g.CreateNylasSchedulerStore({bookingInfo:this.bookingInfo,...this.defaultSchedulerState})},this.baseProvider=new h.NylasBaseProvider(this.host,this.stores,this.automaticComponentRegistration,this.eventOverrides);const n=(s=this.baseProvider)==null?void 0:s.getStore("scheduler");if(this.nylasSchedulerConnector=new w({schedulerAPIURL:this.schedulerApiUrl,sessionId:this.sessionId,configId:this.configId,nylasSchedulerStore:n}),this.init.emit(this.host),(o=this.baseProvider)==null||o.componentWillLoad(this.nylasSchedulerConnector),this.themeConfig)for(const[i,a]of Object.entries(this.themeConfig))this.host.style.setProperty(`${i}`,a)}async componentDidLoad(){var a,u,l,d;if((a=this.baseProvider)==null||a.componentDidLoad(),!this.checkIfSessionIdOrConfigIdExists())return;const e=(u=this.baseProvider)==null?void 0:u.getStore("scheduler"),n=e==null?void 0:e.get("selectedTimeslot");if(n&&(n!=null&&n.start_time)){if(!this.isTimeslotValid(n))return;if(e!=null&&e.get("showBookingForm")){e==null||e.set("selectedDate",n.start_time);return}}const s=e==null?void 0:e.get("selectedDate"),o=e==null?void 0:e.get("availability");let i;if(!(o&&o.length>0)){if(!s)i=await((l=this.nylasSchedulerConnector)==null?void 0:l.scheduler.getAvailability());else{const r=new Date(s.getFullYear(),s.getMonth(),1).getTime()/1e3,p=new Date(s.getFullYear(),s.getMonth()+1,1).getTime()/1e3;i=await((d=this.nylasSchedulerConnector)==null?void 0:d.scheduler.getAvailability(r,p))}if((!i||"error"in i)&&this.nylasSchedulerError.emit({...this.getErrorObject(i==null?void 0:i.error)}),!s){let r=new Date;const p=e==null?void 0:e.get("availability").find(v=>new Date(v.start_time)>new Date);p&&(r=p.start_time),e==null||e.set("selectedDate",r)}}}componentDisconnected(){var e;(e=this.baseProvider)==null||e.componentDisconnected()}bookingInfoChanged(e){var n;(n=this.stores)==null||n.scheduler.set("bookingInfo",e)}async registerComponentHandler(e){var n;(n=this.baseProvider)==null||n.registerComponent(e.detail)}async unregisterComponentHandler(e){var n;(n=this.baseProvider)==null||n.unregisterComponent(e.detail)}async monthChangedHandler(e){var a;const n=e.detail,s=new Date(n.getFullYear(),n.getMonth(),1).getTime()/1e3,o=new Date(n.getFullYear(),n.getMonth()+1,1).getTime()/1e3,i=await((a=this.nylasSchedulerConnector)==null?void 0:a.scheduler.getAvailability(s,o));(!i||"error"in i)&&this.nylasSchedulerError.emit({...this.getErrorObject(i==null?void 0:i.error)})}async bookButtonClickedHandler(e){var s,o;if(this.rescheduleBookingId){const i=await((s=this.nylasSchedulerConnector)==null?void 0:s.scheduler.rescheduleBooking(this.rescheduleBookingId,e.detail));(!i||"error"in i)&&this.nylasSchedulerError.emit({...this.getErrorObject(i==null?void 0:i.error)});return}const n=await((o=this.nylasSchedulerConnector)==null?void 0:o.scheduler.bookTimeslot(e.detail));(!n||"error"in n)&&this.nylasSchedulerError.emit({...this.getErrorObject(n==null?void 0:n.error)})}dateSelectedHandler(e){const n=e.detail;this.selectedDateLabel=n?n.toLocaleDateString(void 0,{dateStyle:"full"}):"No date selected"}cancelBookedEventErrorHandler(e){this.nylasSchedulerError.emit({...this.getErrorObject(e.detail.error)})}rescheduleBookedEventErrorHandler(e){this.nylasSchedulerError.emit({...this.getErrorObject(e.detail.error)})}async getNylasSchedulerStore(){var e;return(e=this.baseProvider)==null?void 0:e.getStore("scheduler")}async getNylasSchedulerConnector(){return this.nylasSchedulerConnector}async getRef(){return this.host}getErrorObject(e){return{title:(e==null?void 0:e.title)||b.title,category:(e==null?void 0:e.category)||b.category,type:h.nr.Error,description:(e==null?void 0:e.message)||"",id:new Date().getTime().toString(),ttl:"none"}}checkIfSessionIdOrConfigIdExists(){return!this.sessionId&&!this.configId?(this.nylasSchedulerError.emit({title:"No sessionId!",category:g.ErrorCategory.Component,type:h.nr.Error,description:"Session ID is required",id:new Date().getTime().toString(),ttl:"none"}),!1):!0}isTimeslotValid(e){return new Date(e.start_time)<new Date?(this.nylasSchedulerError.emit({title:"Invalid tiemslot!",category:g.ErrorCategory.Component,type:h.nr.Error,description:"The selected timeslot is invalid.",id:new Date().getTime().toString(),ttl:"none"}),!1):!0}render(){var d;const e=this.mode==="app",n=(d=this.baseProvider)==null?void 0:d.getStore("scheduler"),s=n==null?void 0:n.get("eventInfo"),o=n==null?void 0:n.get("showBookingForm"),i=n==null?void 0:n.get("cancelledEventInfo"),a=(n==null?void 0:n.get("cancelBookingId"))||this.cancelBookingId,u=n==null?void 0:n.get("selectedTimeslot"),l=(n==null?void 0:n.get("rescheduleBookingId"))||this.rescheduleBookingId;if(e&&a&&!i)return t.h(t.Host,null,t.h(c,{isLoading:this.isLoading,showNotification:this.showNotification},t.h("div",{class:"cancel-flow-page",part:"cancel-flow-page"},t.h("nylas-cancel-booking-form",{cancelBookingId:a,exportparts:"ncbf, ncbf__input-textfield, ncbf__button-cta, ncbf__button-outline, ncbf__input-label"}))));if(e&&i)return t.h(t.Host,null,t.h(c,{isLoading:this.isLoading,showNotification:this.showNotification},t.h("div",{class:"cancelled-event-page",part:"cancelled-event-page"},t.h("nylas-cancelled-event-card",{cancelledEventInfo:i,exportparts:"ncec, ncec__icon, ncec__title, ncec__description, ncec__button-outline, ncec__card"}))));if(e&&s)return t.h(t.Host,null,t.h(c,{isLoading:this.isLoading,showNotification:this.showNotification},t.h("div",{class:"booked-event-page",part:"booked-event-page"},t.h("nylas-booked-event-card",{selectedTimeslot:u,eventInfo:s,exportparts:"nbec, nbec__title, nbec__card, nbec__description, nbec__button-outline, nbec__cancel-cta, nbec__reschedule-cta"}))));if(e&&(!s||l)&&!o){const r=this.host.querySelector('[slot="timeslot-picker-cta-label"]');return t.h(t.Host,null,t.h(c,{isLoading:this.isLoading,showNotification:this.showNotification},l&&t.h(m,null,"Choose another time slot to reschedule your meeting"),t.h("div",{class:"select-date-page",part:"select-date-page"},t.h("div",{class:"left-panel"},t.h("nylas-date-picker",{exportparts:"ndp, ndp__month-header, ndp__month-button, ndp__day, ndp__date, ndp__date--selected, ndp__date--current-day, ndp__date--current-month"}),t.h("div",{class:"border"}),t.h("nylas-locale-switch",null)),t.h("div",{class:"right-panel"},t.h("h2",null,t.h("calendar-icon",null),t.h("span",{id:"selectedDate"},this.selectedDateLabel)),t.h("nylas-timeslot-picker",{exportparts:"ntp, ntp__timeslot, ntp__timeslot--selected, ntp__button-primary"},r&&t.h("span",{slot:"timeslot-picker-cta-label"},t.h("slot",{name:"timeslot-picker-cta-label"})))))))}if(e&&!s&&o){const r=this.host.querySelector('[slot="custom-booking-form"]');return t.h(t.Host,null,t.h(c,{isLoading:this.isLoading,showNotification:this.showNotification},l&&t.h(m,null,"Choose another time slot to reschedule your meeting"),t.h("div",{class:"additional-data-page",part:"additional-data-page"},t.h("div",{class:"left-panel"},t.h("div",{class:"wrapper"},t.h("nylas-selected-event-card",{exportparts:"nsec, nsec__card, nsec__icon, nsec__date, nsec__time"}))),t.h("div",{class:"right-panel"},t.h("nylas-booking-form",{exportparts:"nbf, nbf__input-label, nbf__input-textfield, nbf__button-ghost, nbf__button-primary, nbf__button-outline"},r&&t.h("div",{slot:"custom-booking-form"},t.h("slot",{name:"custom-booking-form"})))))))}return t.h(t.Host,null,t.h("slot",null))}get host(){return t.getElement(this)}static get watchers(){return{bookingInfo:["bookingInfoChanged"]}}};y.style=_;exports.nylas_scheduling=y;
|
package/dist/{nylas-threads-refresh.entry-b35f1b68.cjs → nylas-threads-refresh.entry-05258b36.cjs}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index-457dcf0b.cjs"),f=require("./register-component-d056a880-2be11c56.cjs"),o=require("./utils-0cd66d04-94b9c3b6.cjs");require("react");require("react-dom");require("./_commonjsHelpers-57e89916-4a3ae7d8.cjs");const u=":host{display:contents}.container{width:100%;overflow:auto;-webkit-overflow-scrolling:touch}.pull-to-refresh{display:none;border:0;background-color:transparent;text-align:center;width:100%;justify-content:center}.pulling{position:relative;display:flex;margin:0 auto;padding:1rem}.pulling svg{width:24px;height:24px;color:var(--nylas-color-primary-500);transform:rotate(90deg)}.refreshing{position:relative;display:flex;margin:0 auto;padding:1rem}.refreshing svg{width:24px;height:24px;fill:var(--nylas-color-primary-500);animation:rotate 1s linear infinite}@keyframes rotate{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}",p=u;var g=function(t,e,n,a){var i=arguments.length,s=i<3?e:a===null?a=Object.getOwnPropertyDescriptor(e,n):a,h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,n,a);else for(var l=t.length-1;l>=0;l--)(h=t[l])&&(s=(i<3?h(s):i>3?h(e,n,s):h(e,n))||s);return i>3&&s&&Object.defineProperty(e,n,s),s},c=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)};const d=class{constructor(t){r.registerInstance(this,t),this.refresh=r.createEvent(this,"refresh",7),this.threshold=100,this.onTouchStart=e=>{var n,a,i,s;o.debug("[nylas-threads-refresh] Touch start",e.touches[0].pageY,(n=this.containerElement)==null?void 0:n.scrollTop,(a=this.containerElement)==null?void 0:a.offsetHeight,(i=this.contentElement)==null?void 0:i.scrollTop),((s=this.containerElement)==null?void 0:s.scrollTop)===0?this.start=e.touches[0].pageY:this.start=0},this.onTouchMove=e=>{this.start&&(e.touches[0].pageY-this.start>this.threshold?this.pulling=!0:this.pulling=!1)},this.onTouchEnd=e=>{this.start&&(e.changedTouches[0].pageY-this.start>this.threshold&&(this.pulling=!1,this.refresh.emit({updateState:this.updateState})),this.start=0)},this.start=0,this.state="ready",this.pulling=!1,o.debug("[nylas-threads-refresh] Constructor"),this.updateState=this.updateState.bind(this)}connectedCallback(){}async componentWillLoad(){o.debug("[nylas-threads-refresh] Component will load")}componentDidLoad(){var t,e,n;o.debug("[nylas-threads-refresh] Component did load"),(t=this.containerElement)==null||t.addEventListener("touchstart",this.onTouchStart),(e=this.containerElement)==null||e.addEventListener("touchmove",this.onTouchMove),(n=this.containerElement)==null||n.addEventListener("touchend",this.onTouchEnd)}disconnectedCallback(){var t,e,n;o.debug("[nylas-threads-refresh] Component disconnected"),(t=this.containerElement)==null||t.removeEventListener("touchstart",this.onTouchStart),(e=this.containerElement)==null||e.removeEventListener("touchmove",this.onTouchMove),(n=this.containerElement)==null||n.removeEventListener("touchend",this.onTouchEnd)}async updateState(t){this.state=t}render(){return r.h(r.Host,{key:"9027360ae546f7cb1cf5c1e8f977d2e8f85eb3fd"},r.h("div",{key:"7bf8bf464971f8669d6cb1fc31c478ed29fbda63",class:"container",ref:t=>this.containerElement=t},r.h("button",{key:"af4dc6f3ec1e45554f13f0dbee2945a7b60acc6c",class:{"pull-to-refresh":!0,pulling:this.pulling,refreshing:this.state==="loading"},"aria-label":"Refreshing..."},this.state==="loading"&&r.h("refresh-icon",{slot:"icon"}),this.state!=="loading"&&r.h("arrow-icon",{slot:"icon"})),r.h("div",{key:"d2bceb3b11369e03a9eefa80f983f341bae71239",class:"content",ref:t=>this.contentElement=t},r.h("slot",{key:"c88b393187aa10285fd940d11bf7b792ac4dbf14"}))))}};g([f.RegisterComponent({name:"nylas-threads-refresh",eventToProps:{refresh:async(t,e)=>{o.debug("[nylas-threads-refresh] Refreshing threads");const{updateState:n}=t.detail;await n("loading"),await e.threads.getThreads(void 0,"overwrite",!1),await n("ready")}},fireRegisterEvent:!0}),c("design:type",Function),c("design:paramtypes",[]),c("design:returntype",void 0)],d.prototype,"render",null);d.style=p;exports.nylas_threads_refresh=d;
|
package/dist/{nylas-threads-refresh.entry-ef5d6dfd.js → nylas-threads-refresh.entry-414d8740.js}
RENAMED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { r as f, c as p, h as o, H as u } from "./index-
|
|
2
|
-
import { R as m } from "./register-component-
|
|
3
|
-
import { d as i } from "./utils-
|
|
1
|
+
import { r as f, c as p, h as o, H as u } from "./index-ce40ad47.js";
|
|
2
|
+
import { R as m } from "./register-component-d056a880-f3003d6c.js";
|
|
3
|
+
import { d as i } from "./utils-0cd66d04-89ab163d.js";
|
|
4
4
|
import "react";
|
|
5
5
|
import "react-dom";
|
|
6
6
|
import "./_commonjsHelpers-57e89916-af061c86.js";
|
|
7
7
|
const g = ":host{display:contents}.container{width:100%;overflow:auto;-webkit-overflow-scrolling:touch}.pull-to-refresh{display:none;border:0;background-color:transparent;text-align:center;width:100%;justify-content:center}.pulling{position:relative;display:flex;margin:0 auto;padding:1rem}.pulling svg{width:24px;height:24px;color:var(--nylas-color-primary-500);transform:rotate(90deg)}.refreshing{position:relative;display:flex;margin:0 auto;padding:1rem}.refreshing svg{width:24px;height:24px;fill:var(--nylas-color-primary-500);animation:rotate 1s linear infinite}@keyframes rotate{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}", y = g;
|
|
8
|
-
var v = function(t, e, s,
|
|
9
|
-
var
|
|
8
|
+
var v = function(t, e, s, r) {
|
|
9
|
+
var a = arguments.length, n = a < 3 ? e : r === null ? r = Object.getOwnPropertyDescriptor(e, s) : r, h;
|
|
10
10
|
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
11
|
-
n = Reflect.decorate(t, e, s,
|
|
11
|
+
n = Reflect.decorate(t, e, s, r);
|
|
12
12
|
else
|
|
13
13
|
for (var l = t.length - 1; l >= 0; l--)
|
|
14
|
-
(h = t[l]) && (n = (
|
|
15
|
-
return
|
|
14
|
+
(h = t[l]) && (n = (a < 3 ? h(n) : a > 3 ? h(e, s, n) : h(e, s)) || n);
|
|
15
|
+
return a > 3 && n && Object.defineProperty(e, s, n), n;
|
|
16
16
|
}, c = function(t, e) {
|
|
17
17
|
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
18
18
|
return Reflect.metadata(t, e);
|
|
@@ -20,8 +20,8 @@ var v = function(t, e, s, a) {
|
|
|
20
20
|
const d = class {
|
|
21
21
|
constructor(t) {
|
|
22
22
|
f(this, t), this.refresh = p(this, "refresh", 7), this.threshold = 100, this.onTouchStart = (e) => {
|
|
23
|
-
var s,
|
|
24
|
-
i("[nylas-threads-refresh] Touch start", e.touches[0].pageY, (s = this.containerElement) == null ? void 0 : s.scrollTop, (
|
|
23
|
+
var s, r, a, n;
|
|
24
|
+
i("[nylas-threads-refresh] Touch start", e.touches[0].pageY, (s = this.containerElement) == null ? void 0 : s.scrollTop, (r = this.containerElement) == null ? void 0 : r.offsetHeight, (a = this.contentElement) == null ? void 0 : a.scrollTop), ((n = this.containerElement) == null ? void 0 : n.scrollTop) === 0 ? this.start = e.touches[0].pageY : this.start = 0;
|
|
25
25
|
}, this.onTouchMove = (e) => {
|
|
26
26
|
this.start && (e.touches[0].pageY - this.start > this.threshold ? this.pulling = !0 : this.pulling = !1);
|
|
27
27
|
}, this.onTouchEnd = (e) => {
|
|
@@ -47,11 +47,11 @@ const d = class {
|
|
|
47
47
|
this.state = t;
|
|
48
48
|
}
|
|
49
49
|
render() {
|
|
50
|
-
return o(u, { key: "
|
|
50
|
+
return o(u, { key: "9027360ae546f7cb1cf5c1e8f977d2e8f85eb3fd" }, o("div", { key: "7bf8bf464971f8669d6cb1fc31c478ed29fbda63", class: "container", ref: (t) => this.containerElement = t }, o("button", { key: "af4dc6f3ec1e45554f13f0dbee2945a7b60acc6c", class: {
|
|
51
51
|
"pull-to-refresh": !0,
|
|
52
52
|
pulling: this.pulling,
|
|
53
53
|
refreshing: this.state === "loading"
|
|
54
|
-
}, "aria-label": "Refreshing..." }, this.state === "loading" && o("refresh-icon", { slot: "icon" }), this.state !== "loading" && o("arrow-icon", { slot: "icon" })), o("div", { key: "
|
|
54
|
+
}, "aria-label": "Refreshing..." }, this.state === "loading" && o("refresh-icon", { slot: "icon" }), this.state !== "loading" && o("arrow-icon", { slot: "icon" })), o("div", { key: "d2bceb3b11369e03a9eefa80f983f341bae71239", class: "content", ref: (t) => this.contentElement = t }, o("slot", { key: "c88b393187aa10285fd940d11bf7b792ac4dbf14" }))));
|
|
55
55
|
}
|
|
56
56
|
};
|
|
57
57
|
v([
|