@nylas/react 1.1.3 → 1.1.5
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_2.entry-1e899552.js +25 -0
- package/dist/add-circle-icon_2.entry-31acee1d.cjs +1 -0
- package/dist/archive-icon.entry-b5f307e8.js +15 -0
- package/dist/archive-icon.entry-e932c9e6.cjs +1 -0
- package/dist/arrow-icon.entry-aae2e22d.js +15 -0
- package/dist/{arrow-icon.entry-2dfd8319.cjs → arrow-icon.entry-e35a6cad.cjs} +1 -1
- package/dist/bold-icon.entry-1e3c9b1f.cjs +1 -0
- package/dist/bold-icon.entry-d5d86b3f.js +15 -0
- package/dist/{button-component_2.entry-697bf5ac.js → button-component_2.entry-5284316e.js} +6 -6
- package/dist/{button-component_2.entry-27a504d9.cjs → button-component_2.entry-a86f8dca.cjs} +1 -1
- package/dist/{calendar-agenda-fill-icon_51.entry-52b5bf31.js → calendar-agenda-fill-icon_54.entry-5672c589.js} +1944 -1639
- package/dist/calendar-agenda-fill-icon_54.entry-702b29cc.cjs +10 -0
- package/dist/{calendar-cancel-icon.entry-e6a433a2.js → calendar-cancel-icon.entry-7f81de9d.js} +4 -4
- package/dist/{calendar-cancel-icon.entry-c6e2eed6.cjs → calendar-cancel-icon.entry-e9792eaa.cjs} +1 -1
- package/dist/{calendar-check-icon_2.entry-d88307d6.js → calendar-check-icon_2.entry-84db1700.js} +3 -3
- package/dist/{calendar-check-icon_2.entry-45cad6f1.cjs → calendar-check-icon_2.entry-ad055b37.cjs} +1 -1
- package/dist/{calendar-icon.entry-b2fffd21.cjs → calendar-icon.entry-019f7feb.cjs} +1 -1
- package/dist/{calendar-icon.entry-2badc962.js → calendar-icon.entry-45db1630.js} +4 -4
- package/dist/{checkbox-component_2.entry-3926b644.cjs → checkbox-component_2.entry-8325ff88.cjs} +1 -1
- package/dist/{checkbox-component_2.entry-5ab55050.js → checkbox-component_2.entry-84a053ff.js} +3 -3
- package/dist/{chevron-icon_3.entry-1fe5d097.cjs → chevron-icon_3.entry-0edde2a6.cjs} +1 -1
- package/dist/{chevron-icon_3.entry-664fae5d.js → chevron-icon_3.entry-ec894a13.js} +4 -4
- package/dist/{clock-icon_4.entry-f11f9dad.js → clock-icon_4.entry-8ec9c29b.js} +15 -15
- package/dist/{clock-icon_4.entry-efec2c08.cjs → clock-icon_4.entry-935fe48d.cjs} +1 -1
- package/dist/constants-c549b12b-7ea4c7f5.js +763 -0
- package/dist/constants-c549b12b-c85413b1.cjs +1 -0
- package/dist/copy-icon.entry-5a2030da.cjs +1 -0
- package/dist/{copy-icon.entry-70131e8e.js → copy-icon.entry-d9405510.js} +6 -6
- package/dist/{delete-icon.entry-e003695d.js → delete-icon.entry-1b0a3ba4.js} +4 -4
- package/dist/{delete-icon.entry-5d067fef.cjs → delete-icon.entry-3f3d1ffb.cjs} +1 -1
- package/dist/document-refresh-icon.entry-59a18097.cjs +1 -0
- package/dist/document-refresh-icon.entry-fab58d33.js +15 -0
- package/dist/elements/index.d.ts +0 -11
- package/dist/feedbackSync-b56b29ed-7a1f1f75.js +6035 -0
- package/dist/feedbackSync-b56b29ed-b6f352f3.cjs +448 -0
- package/dist/folder-icon.entry-b5a123d0.js +15 -0
- package/dist/folder-icon.entry-e85383b6.cjs +1 -0
- package/dist/forward-icon.entry-7c8ed4c3.cjs +1 -0
- package/dist/forward-icon.entry-88ab1a85.js +15 -0
- package/dist/{globe-icon.entry-6fc456c7.js → globe-icon.entry-6fb414ca.js} +5 -5
- package/dist/{globe-icon.entry-8c3c9e48.cjs → globe-icon.entry-b1253516.cjs} +1 -1
- package/dist/google-logo-icon_4.entry-ae09d065.cjs +1 -0
- package/dist/{google-logo-icon_4.entry-d6e0c4c0.js → google-logo-icon_4.entry-fe627741.js} +221 -207
- package/dist/inbox-icon.entry-7dce836e.cjs +1 -0
- package/dist/inbox-icon.entry-cec35da1.js +15 -0
- package/dist/{index-a282e817.js → index-3fd31877.js} +4194 -4123
- package/dist/index-bd6fdc8c.cjs +81 -0
- package/dist/index.d.ts +1 -1
- package/dist/{index.es-ab9affcc-18263b66.cjs → index.es-c7ca1bad-0a324dca.cjs} +5 -5
- package/dist/{index.es-ab9affcc-30461b18.js → index.es-c7ca1bad-b895d84b.js} +125 -131
- package/dist/{info-icon_2.entry-e582ac10.cjs → info-icon_2.entry-1dab6311.cjs} +1 -1
- package/dist/{info-icon_2.entry-d20b975c.js → info-icon_2.entry-f7e6b4aa.js} +3 -3
- package/dist/{input-color-picker.entry-27f4288f.js → input-color-picker.entry-30cda4e2.js} +3 -3
- package/dist/{input-color-picker.entry-c6a28671.cjs → input-color-picker.entry-b6e53c29.cjs} +1 -1
- package/dist/{input-component.entry-744fcec1.cjs → input-component.entry-1f1f8e00.cjs} +1 -1
- package/dist/{input-component.entry-b6f1c417.js → input-component.entry-7a04bc8b.js} +3 -3
- package/dist/{input-dropdown.entry-f13234d7.cjs → input-dropdown.entry-5e5b67be.cjs} +1 -1
- package/dist/{input-dropdown.entry-18744def.js → input-dropdown.entry-abf134a8.js} +2 -2
- package/dist/italic-icon.entry-4631c594.js +15 -0
- package/dist/italic-icon.entry-c793243b.cjs +1 -0
- package/dist/{multi-select-dropdown.entry-dde671d7.cjs → multi-select-dropdown.entry-2b8728d5.cjs} +1 -1
- package/dist/{multi-select-dropdown.entry-924809e1.js → multi-select-dropdown.entry-9a93da56.js} +2 -2
- package/dist/nylas-booked-event-card_12.entry-8d502a3c.cjs +1 -0
- package/dist/{nylas-booked-event-card_12.entry-52c3111d.js → nylas-booked-event-card_12.entry-f13f3f54.js} +294 -288
- package/dist/{nylas-form-card.entry-b0a2403f.js → nylas-form-card.entry-862519b4.js} +20 -20
- package/dist/nylas-form-card.entry-af179b96.cjs +1 -0
- package/dist/{nylas-if-state.entry-523fdc6b.js → nylas-if-state.entry-8803a762.js} +3 -3
- package/dist/{nylas-if-state.entry-53883c36.cjs → nylas-if-state.entry-c1c1282d.cjs} +1 -1
- package/dist/{nylas-login.entry-d9bf3974.js → nylas-login.entry-3e12f747.js} +3 -3
- package/dist/{nylas-login.entry-05e1df3e.cjs → nylas-login.entry-65f8f046.cjs} +1 -1
- package/dist/nylas-provider.entry-9626b113.cjs +1 -0
- package/dist/nylas-provider.entry-e3501bd1.js +264 -0
- package/dist/{nylas-scheduler-editor.entry-1a2f3ee0.cjs → nylas-scheduler-editor.entry-17cd1514.cjs} +2 -2
- package/dist/{nylas-scheduler-editor.entry-b434b526.js → nylas-scheduler-editor.entry-6df45b05.js} +25 -25
- package/dist/{nylas-scheduling.entry-b71080c8.js → nylas-scheduling.entry-08051ba3.js} +136 -124
- package/dist/nylas-scheduling.entry-b1fafd91.cjs +1 -0
- package/dist/{nylas-time-window-picker.entry-a6d1c648.cjs → nylas-time-window-picker.entry-4989d421.cjs} +1 -1
- package/dist/{nylas-time-window-picker.entry-c1ee860a.js → nylas-time-window-picker.entry-bdc8c6ea.js} +16 -16
- package/dist/{person-icon.entry-8833e3cc.js → person-icon.entry-d62a16b4.js} +2 -2
- package/dist/{person-icon.entry-80c9022e.cjs → person-icon.entry-fb7efa8f.cjs} +1 -1
- package/dist/play-icon.entry-01b95392.js +15 -0
- package/dist/play-icon.entry-f485a2c8.cjs +1 -0
- package/dist/react.cjs +1 -1
- package/dist/react.js +92 -103
- package/dist/{refresh-icon.entry-4d6791bd.js → refresh-icon.entry-1ff4b39f.js} +4 -4
- package/dist/{refresh-icon.entry-d4cc16b7.cjs → refresh-icon.entry-5f997e86.cjs} +1 -1
- package/dist/{register-component-a7ea27ad-fa2c4b17.js → register-component-3444af44-854971ad.js} +1 -1
- package/dist/{register-component-a7ea27ad-2343f3df.cjs → register-component-3444af44-9053e8c3.cjs} +1 -1
- package/dist/reply-all-icon.entry-1dad6514.cjs +1 -0
- package/dist/reply-all-icon.entry-cbafb8a0.js +15 -0
- package/dist/reply-icon.entry-162d9945.cjs +1 -0
- package/dist/reply-icon.entry-a43bc252.js +15 -0
- package/dist/{scheduler-config-store-2a3b403d-5176cd45.js → scheduler-config-store-ed4a8dfd-22db9285.js} +1 -2
- package/dist/scheduler-config-store-ed4a8dfd-eeaeaa50.cjs +1 -0
- package/dist/{scheduler-store-33ab8dea-9801357a.js → scheduler-store-d4784b24-9a5f5734.js} +134 -126
- package/dist/scheduler-store-d4784b24-aed474e8.cjs +1 -0
- package/dist/sent-icon.entry-a05486d5.js +15 -0
- package/dist/sent-icon.entry-a1aec7e9.cjs +1 -0
- package/dist/spam-icon.entry-473f11af.js +15 -0
- package/dist/spam-icon.entry-b481a04b.cjs +1 -0
- package/dist/star-icon.entry-12fdc345.js +15 -0
- package/dist/star-icon.entry-6b1fe3cf.cjs +1 -0
- package/dist/stop-icon.entry-4bd609f7.js +15 -0
- package/dist/stop-icon.entry-72481153.cjs +1 -0
- package/dist/{textarea-component.entry-174089bc.js → textarea-component.entry-47e1b2e6.js} +2 -2
- package/dist/{textarea-component.entry-019e75d0.cjs → textarea-component.entry-f330a755.cjs} +1 -1
- package/dist/{time-period-selector.entry-62c854d1.js → time-period-selector.entry-a4899368.js} +4 -4
- package/dist/{time-period-selector.entry-8466d0f2.cjs → time-period-selector.entry-c7611563.cjs} +1 -1
- package/dist/{translate-icon.entry-7d5cf4b8.cjs → translate-icon.entry-40dfa8c9.cjs} +1 -1
- package/dist/{translate-icon.entry-73f7127b.js → translate-icon.entry-4517838d.js} +2 -2
- package/dist/trash-fill-icon.entry-86ca3055.cjs +1 -0
- package/dist/trash-fill-icon.entry-d7e960eb.js +15 -0
- package/dist/underline-icon.entry-352970f5.js +15 -0
- package/dist/underline-icon.entry-f16d4943.cjs +1 -0
- package/dist/{warning-icon.entry-abf896c3.js → warning-icon.entry-63987dad.js} +5 -5
- package/dist/{warning-icon.entry-92638eeb.cjs → warning-icon.entry-79ef75b2.cjs} +1 -1
- package/package.json +3 -3
- package/dist/add-circle-icon_2.entry-b77120e5.cjs +0 -1
- package/dist/add-circle-icon_2.entry-fbc1e82b.js +0 -25
- package/dist/archive-icon_7.entry-30962e70.js +0 -75
- package/dist/archive-icon_7.entry-dd8c7642.cjs +0 -1
- package/dist/arrow-icon.entry-5b436054.js +0 -15
- package/dist/bold-icon_3.entry-5120a9c8.js +0 -35
- package/dist/bold-icon_3.entry-da2d1270.cjs +0 -1
- package/dist/calendar-agenda-fill-icon_51.entry-a25262b3.cjs +0 -7
- package/dist/constants-50c3e067-33cf0ffe.js +0 -3883
- package/dist/constants-50c3e067-5ec3f879.cjs +0 -15
- package/dist/copy-icon.entry-3965f206.cjs +0 -1
- package/dist/document-refresh-icon.entry-30c974df.cjs +0 -1
- package/dist/document-refresh-icon.entry-b4e01cd4.js +0 -15
- package/dist/elements-dc5b338e-55823d00.js +0 -28031
- package/dist/elements-dc5b338e-6883a39e.cjs +0 -16516
- package/dist/feedbackSync-81d4c4d8-dd4d2e32.js +0 -11735
- package/dist/feedbackSync-81d4c4d8-f4e78902.cjs +0 -455
- package/dist/flow-40ff9cea-6f8c30e2.cjs +0 -9
- package/dist/flow-40ff9cea-ee70fdf5.js +0 -505
- package/dist/focus-visible-e8093c16-431bbe59.cjs +0 -1
- package/dist/focus-visible-e8093c16-f403fee8.js +0 -84
- package/dist/forward-icon_6.entry-3bb91d58.js +0 -953
- package/dist/forward-icon_6.entry-ceec2371.cjs +0 -3
- package/dist/google-logo-icon_4.entry-4eb16cd2.cjs +0 -1
- package/dist/index-11f33e47.cjs +0 -82
- package/dist/mailbox-store-affca6de-9451094e.cjs +0 -1
- package/dist/mailbox-store-affca6de-d601dc6b.js +0 -380
- package/dist/nylas-booked-event-card_12.entry-d89c1f9d.cjs +0 -1
- package/dist/nylas-form-card.entry-ab61fdc5.cjs +0 -1
- package/dist/nylas-list-folders.entry-4ef6cb3d.cjs +0 -1
- package/dist/nylas-list-folders.entry-e37d069f.js +0 -120
- package/dist/nylas-list-threads.entry-3be623e9.cjs +0 -1
- package/dist/nylas-list-threads.entry-8ba62db8.js +0 -70
- package/dist/nylas-mailbox-pagination.entry-3dd05cf4.cjs +0 -1
- package/dist/nylas-mailbox-pagination.entry-50d9d9e3.js +0 -101
- package/dist/nylas-mailbox-toolbar-button.entry-9a77d137.js +0 -82
- package/dist/nylas-mailbox-toolbar-button.entry-d87b55de.cjs +0 -1
- package/dist/nylas-mailbox.entry-cb7d1031.js +0 -134
- package/dist/nylas-mailbox.entry-f7db9aa8.cjs +0 -1
- package/dist/nylas-provider.entry-1716bf48.cjs +0 -1
- package/dist/nylas-provider.entry-7aa46ea2.js +0 -145
- package/dist/nylas-reminder-emails.entry-88a862cd.cjs +0 -4
- package/dist/nylas-reminder-emails.entry-a86231b7.js +0 -129
- package/dist/nylas-reminder-time_2.entry-9589d5f2.js +0 -105
- package/dist/nylas-reminder-time_2.entry-bc76d4ab.cjs +0 -1
- package/dist/nylas-scheduling.entry-59e5e8c1.cjs +0 -1
- package/dist/nylas-threads-refresh.entry-544ca90a.js +0 -74
- package/dist/nylas-threads-refresh.entry-7ada7b2d.cjs +0 -1
- package/dist/nylas-threads-search.entry-181ba46a.js +0 -69
- package/dist/nylas-threads-search.entry-f1cb19e4.cjs +0 -1
- package/dist/nylas-view-thread.entry-6ae8dd64.cjs +0 -1
- package/dist/nylas-view-thread.entry-c066f522.js +0 -203
- package/dist/play-icon_2.entry-801c85bc.cjs +0 -1
- package/dist/play-icon_2.entry-efca8f00.js +0 -25
- package/dist/scheduler-config-store-2a3b403d-2263f999.cjs +0 -1
- package/dist/scheduler-store-33ab8dea-a0b39d36.cjs +0 -1
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
import { r as
|
|
2
|
-
import { R as u } from "./register-component-
|
|
1
|
+
import { r as b, d as c, K as y, h as n, H as m, g as p } from "./index-3fd31877.js";
|
|
2
|
+
import { R as u } from "./register-component-3444af44-854971ad.js";
|
|
3
3
|
import "react";
|
|
4
4
|
import "react-dom";
|
|
5
5
|
const h = ':host{display:block;--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}.nylas-form-card{width:100%;border-radius:8px;border:1px solid var(--nylas-base-200)}.nylas-form-card__header{padding:1rem;border-bottom:1px solid var(--nylas-base-200)}', v = h;
|
|
6
6
|
var _ = function(e, a, t, r) {
|
|
7
|
-
var
|
|
7
|
+
var d = arguments.length, s = d < 3 ? a : r === null ? r = Object.getOwnPropertyDescriptor(a, t) : r, l;
|
|
8
8
|
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
9
9
|
s = Reflect.decorate(e, a, t, r);
|
|
10
10
|
else
|
|
11
|
-
for (var
|
|
12
|
-
(l = e[
|
|
13
|
-
return
|
|
14
|
-
},
|
|
11
|
+
for (var o = e.length - 1; o >= 0; o--)
|
|
12
|
+
(l = e[o]) && (s = (d < 3 ? l(s) : d > 3 ? l(a, t, s) : l(a, t)) || s);
|
|
13
|
+
return d > 3 && s && Object.defineProperty(a, t, s), s;
|
|
14
|
+
}, f = function(e, a) {
|
|
15
15
|
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
16
16
|
return Reflect.metadata(e, a);
|
|
17
17
|
};
|
|
18
|
-
const
|
|
18
|
+
const i = class {
|
|
19
19
|
constructor(e) {
|
|
20
|
-
|
|
20
|
+
b(this, e), e.$hostElement$["s-ei"] ? this.internals = e.$hostElement$["s-ei"] : (this.internals = e.$hostElement$.attachInternals(), e.$hostElement$["s-ei"] = this.internals);
|
|
21
21
|
}
|
|
22
22
|
connectedCallback() {
|
|
23
|
-
|
|
23
|
+
c("nylas-event-card", "connectedCallback");
|
|
24
24
|
}
|
|
25
25
|
componentWillLoad() {
|
|
26
|
-
|
|
26
|
+
c("nylas-event-card", "componentWillLoad");
|
|
27
27
|
}
|
|
28
28
|
componentDidLoad() {
|
|
29
|
-
|
|
29
|
+
c("nylas-event-card", "componentDidLoad");
|
|
30
30
|
}
|
|
31
31
|
disconnectedCallback() {
|
|
32
|
-
|
|
32
|
+
c("nylas-event-card", "disconnectedCallback"), y(["header-title", "header-subtitle", "content"], this.host);
|
|
33
33
|
}
|
|
34
34
|
render() {
|
|
35
|
-
return n(m, { key: "
|
|
35
|
+
return n(m, { key: "5ccd047d1a8bb515dea8aa7b9d7d39265afc31c9" }, n("div", { key: "c40f52eaa4d099d92d65b0df662cd2de1b5f35c7", class: "nylas-form-card", part: "nfc" }, n("div", { key: "545dabd81dce9b4f6f5f1d129071e1136f62e609", class: "nylas-form-card__header", part: "nfc__header" }, n("slot", { key: "2be9b24f91316235be7132a6466cd16b9dfe813c", name: "header-title" }), n("slot", { key: "3414a084465efc50a3856291dff61d8ef3b3c617", name: "header-subtitle" })), n("div", { key: "cc07650a55afd7fc5d2429ff3611168977775bc8", class: "nylas-form-card__content" }, n("slot", { key: "d50dd8dfbfea1ad84876495e72dd03102e2bc0dc", name: "content" }))));
|
|
36
36
|
}
|
|
37
37
|
static get formAssociated() {
|
|
38
38
|
return !0;
|
|
@@ -47,11 +47,11 @@ _([
|
|
|
47
47
|
eventToProps: {},
|
|
48
48
|
fireRegisterEvent: !0
|
|
49
49
|
}),
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
],
|
|
54
|
-
|
|
50
|
+
f("design:type", Function),
|
|
51
|
+
f("design:paramtypes", []),
|
|
52
|
+
f("design:returntype", void 0)
|
|
53
|
+
], i.prototype, "render", null);
|
|
54
|
+
i.style = v;
|
|
55
55
|
export {
|
|
56
|
-
|
|
56
|
+
i as nylas_form_card
|
|
57
57
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-bd6fdc8c.cjs"),i=require("./register-component-3444af44-9053e8c3.cjs");require("react");require("react-dom");const b=':host{display:block;--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}.nylas-form-card{width:100%;border-radius:8px;border:1px solid var(--nylas-base-200)}.nylas-form-card__header{padding:1rem;border-bottom:1px solid var(--nylas-base-200)}',y=b;var m=function(a,n,t,r){var d=arguments.length,s=d<3?n:r===null?r=Object.getOwnPropertyDescriptor(n,t):r,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(a,n,t,r);else for(var l=a.length-1;l>=0;l--)(c=a[l])&&(s=(d<3?c(s):d>3?c(n,t,s):c(n,t))||s);return d>3&&s&&Object.defineProperty(n,t,s),s},o=function(a,n){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(a,n)};const f=class{constructor(a){e.registerInstance(this,a),a.$hostElement$["s-ei"]?this.internals=a.$hostElement$["s-ei"]:(this.internals=a.$hostElement$.attachInternals(),a.$hostElement$["s-ei"]=this.internals)}connectedCallback(){e.debug("nylas-event-card","connectedCallback")}componentWillLoad(){e.debug("nylas-event-card","componentWillLoad")}componentDidLoad(){e.debug("nylas-event-card","componentDidLoad")}disconnectedCallback(){e.debug("nylas-event-card","disconnectedCallback");const a=["header-title","header-subtitle","content"];e.checkForMissingSlots(a,this.host)}render(){return e.h(e.Host,{key:"5ccd047d1a8bb515dea8aa7b9d7d39265afc31c9"},e.h("div",{key:"c40f52eaa4d099d92d65b0df662cd2de1b5f35c7",class:"nylas-form-card",part:"nfc"},e.h("div",{key:"545dabd81dce9b4f6f5f1d129071e1136f62e609",class:"nylas-form-card__header",part:"nfc__header"},e.h("slot",{key:"2be9b24f91316235be7132a6466cd16b9dfe813c",name:"header-title"}),e.h("slot",{key:"3414a084465efc50a3856291dff61d8ef3b3c617",name:"header-subtitle"})),e.h("div",{key:"cc07650a55afd7fc5d2429ff3611168977775bc8",class:"nylas-form-card__content"},e.h("slot",{key:"d50dd8dfbfea1ad84876495e72dd03102e2bc0dc",name:"content"}))))}static get formAssociated(){return!0}get host(){return e.getElement(this)}};m([i.RegisterComponent({name:"nylas-form-card",eventToProps:{},fireRegisterEvent:!0}),o("design:type",Function),o("design:paramtypes",[]),o("design:returntype",void 0)],f.prototype,"render",null);f.style=y;exports.nylas_form_card=f;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { r as h, d as o, h as l, H as u } from "./index-
|
|
2
|
-
import { R as m } from "./register-component-
|
|
1
|
+
import { r as h, d as o, h as l, H as u } from "./index-3fd31877.js";
|
|
2
|
+
import { R as m } from "./register-component-3444af44-854971ad.js";
|
|
3
3
|
import "react";
|
|
4
4
|
import "react-dom";
|
|
5
5
|
const p = ":host{display:block}div{height:inherit}@keyframes fadeIn{0%{opacity:0}100%{opacity:1}}@keyframes fadeOut{0%{opacity:1}100%{opacity:0}}.fade-in{animation:fadeIn 1.5s}.fade-out{animation:fadeOut 1.5s}@keyframes slideIn{0%{transform:translateY(100%)}100%{transform:translateY(0)}}@keyframes slideOut{0%{transform:translateY(0)}100%{transform:translateY(100%)}}.slide-in{animation:slideIn 1.5s}.slide-out{animation:slideOut 1.5s}@keyframes swipeIn{0%{transform:translateX(100%)}100%{transform:translateX(0)}}@keyframes swipeOut{0%{transform:translateX(0)}100%{transform:translateX(100%)}}.swipe-in{animation:swipeIn 1.5s}.swipe-out{animation:swipeOut 1.5s}", y = p;
|
|
@@ -70,7 +70,7 @@ const c = class {
|
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
72
|
render() {
|
|
73
|
-
return l(u, { key: "
|
|
73
|
+
return l(u, { key: "4ab162229644e4d5d9d571af164b417c3e503e2c" }, l("div", { key: "f5b4dd56ac193ba63be4a7040bdb61d7a2e1da04", class: this.classes }, this.show && l("slot", null)));
|
|
74
74
|
}
|
|
75
75
|
static get watchers() {
|
|
76
76
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index-bd6fdc8c.cjs"),u=require("./register-component-3444af44-9053e8c3.cjs");require("react");require("react-dom");const c=":host{display:block}div{height:inherit}@keyframes fadeIn{0%{opacity:0}100%{opacity:1}}@keyframes fadeOut{0%{opacity:1}100%{opacity:0}}.fade-in{animation:fadeIn 1.5s}.fade-out{animation:fadeOut 1.5s}@keyframes slideIn{0%{transform:translateY(100%)}100%{transform:translateY(0)}}@keyframes slideOut{0%{transform:translateY(0)}100%{transform:translateY(100%)}}.slide-in{animation:slideIn 1.5s}.slide-out{animation:slideOut 1.5s}@keyframes swipeIn{0%{transform:translateX(100%)}100%{transform:translateX(0)}}@keyframes swipeOut{0%{transform:translateX(0)}100%{transform:translateX(100%)}}.swipe-in{animation:swipeIn 1.5s}.swipe-out{animation:swipeOut 1.5s}",h=c;var m=function(e,n,s,a){var t=arguments.length,o=t<3?n:a===null?a=Object.getOwnPropertyDescriptor(n,s):a,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(e,n,s,a);else for(var f=e.length-1;f>=0;f--)(r=e[f])&&(o=(t<3?r(o):t>3?r(n,s,o):r(n,s))||o);return t>3&&o&&Object.defineProperty(n,s,o),o},l=function(e,n){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,n)};const d=class{constructor(e){i.registerInstance(this,e),this.state=void 0,this.isStateSet=void 0,this.isBoolean=void 0,this.getStore=void 0,this.transition="none",this.show=!1,this.classes={},this.initTransition=this.initTransition.bind(this)}connectedCallback(){}disconnectedCallback(){}async componentWillLoad(){i.debug("[nylas-if-state] Component will load"),this.watchStore(!0)}async componentDidLoad(){i.debug("[nylas-if-state] Component did load")}shouldRender(){const[e,n]=this.state?this.state.split("."):["",""],s=this.getStore;if(typeof s>"u")return i.debug(`[nylas-if-state] Store name: ${e} | State name: ${n}`,{getStore:s}),!1;const a=s(e);if(typeof a>"u")return i.debug(`[nylas-if-state] Store name: ${e} | State name: ${n}`,{store:a}),!1;const t=a.state[n];return typeof this.isStateSet=="boolean"?this.isStateSet===!1&&(typeof t>"u"||t===null||t.length===0)||this.isStateSet===!0&&typeof t<"u"&&t!==null:typeof this.isBoolean=="boolean"?this.isBoolean===!0&&typeof t<"u"&&t===!0||this.isBoolean===!1&&typeof t<"u"&&t===!1:!1}onGetStoreChange(){this.watchStore(!0)}watchStore(e=!1){const[n,s]=this.state?this.state.split("."):["",""],a=this.getStore;if(typeof a>"u")return i.debug(`[nylas-if-state] Store name: ${n} | State name: ${s}`,{getStore:a}),null;const t=a(n);if(typeof t>"u")return i.debug(`[nylas-if-state] Store name: ${n} | State name: ${s}`,{store:t}),null;e===!0&&this.initTransition(),t.onChange(s,this.initTransition)}initTransition(){const e=this.shouldRender();switch(this.transition){case"fade":case"slide":case"swipe":this.classes={[`${this.transition}-in`]:e,[`${this.transition}-out`]:!e},setTimeout(()=>{this.show=e},150);break;default:this.show=this.shouldRender();break}}render(){return i.h(i.Host,{key:"4ab162229644e4d5d9d571af164b417c3e503e2c"},i.h("div",{key:"f5b4dd56ac193ba63be4a7040bdb61d7a2e1da04",class:this.classes},this.show&&i.h("slot",null)))}static get watchers(){return{getStore:["onGetStoreChange"]}}};m([u.RegisterComponent({name:"nylas-if-state",getStoresToProp:"getStore",fireRegisterEvent:!0}),l("design:type",Function),l("design:paramtypes",[]),l("design:returntype",void 0)],d.prototype,"render",null);d.style=h;exports.nylas_if_state=d;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { r as h, c as p, h as o, H as u } from "./index-
|
|
2
|
-
import { R as m } from "./register-component-
|
|
1
|
+
import { r as h, c as p, h as o, H as u } from "./index-3fd31877.js";
|
|
2
|
+
import { R as m } from "./register-component-3444af44-854971ad.js";
|
|
3
3
|
import "react";
|
|
4
4
|
import "react-dom";
|
|
5
5
|
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);}", y = g;
|
|
@@ -51,7 +51,7 @@ const d = class {
|
|
|
51
51
|
render() {
|
|
52
52
|
var t;
|
|
53
53
|
const n = ((t = this.providers) == null ? void 0 : t.split(",")) || [];
|
|
54
|
-
return o(u, { key: "
|
|
54
|
+
return o(u, { key: "0e8ae3287facdc3e67109cd57cb80a761897de76" }, this.loginMethod === "redirect" && o("div", { class: "redirect-container" }, !this.isAuthenticated && o("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: {
|
|
55
55
|
minWidth: this.logoWidth
|
|
56
56
|
} }), 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")))));
|
|
57
57
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-bd6fdc8c.cjs"),h=require("./register-component-3444af44-9053e8c3.cjs");require("react");require("react-dom");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:"0e8ae3287facdc3e67109cd57cb80a761897de76"},this.loginMethod==="redirect"&&t.h("div",{class:"redirect-container"},!this.isAuthenticated&&t.h("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;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index-bd6fdc8c.cjs"),l=require("./index.es-c7ca1bad-0a324dca.cjs"),d=require("./scheduler-store-d4784b24-aed474e8.cjs"),y=require("./scheduler-config-store-ed4a8dfd-eeaeaa50.cjs");require("react");require("react-dom");class f{constructor(e,t){this.nylasAuth=e,this.nylasAuthStore=t}async validateSession(){const e=await this.isAccessTokenValid();if(!e)this.logout();else{let t=await this.nylasAuth.getTokenInfo();if(t){const r=Math.floor(Date.now()/1e3);if(t.expires_in&&t.expires_in-r<3e5&&(o.debug("[NylasAuthConnectorMixin] Refreshing access token"),t=await this.nylasAuth.refreshAccessToken(),!t)){o.debug("[NylasAuthConnectorMixin] Token is expired and could not be refreshed. Logging out."),this.logout();return}this.nylasAuthStore.state.tokenInfo=t}}this.nylasAuthStore.state.isAuthenticated=e}async isAuthenticated(){return this.nylasAuth.isAuthenticated()}async getTokenInfo(){return this.nylasAuth.getTokenInfo()}async isAccessTokenValid(){return this.nylasAuth.isAccessTokenValid()}async logout(){await this.nylasAuth.logout()}async getHostedAuthRedirectURL(e,t,n){return this.nylasAuth.getHostedAuthRedirectURL(e,t,n)}async manageHostedAuthCodeExchange(e){const n=new URL(e).searchParams.get("code");if(n){const r=await this.nylasAuth.exchangeAuthCodeForTokenInfo(n);if(r)return this.nylasAuthStore.state.tokenInfo=r,this.nylasAuthStore.state.isAuthenticated=!0,r}return null}}class C{constructor(e,t,n,r,i,a="https://api.us.nylas.com"){this.router=e,this.schedulerAPIURL=a,this.nylasAuth=t,this.nylasAuthStore=n,this.nylasSchedulerStore=r,this.nylasSchedulerConfigStore=i}init(){o.debug("NylasConnector init")}get authStore(){return this.nylasAuthStore}get schedulerStore(){return this.nylasSchedulerStore}get schedulerConfigStore(){return this.nylasSchedulerConfigStore}get auth(){return this._authConnector?this._authConnector:(this._authConnector=new f(this.nylasAuth,this.nylasAuthStore),this._authConnector)}get scheduler(){return this._schedulerAPIConnector?this._schedulerAPIConnector:(this._schedulerAPIConnector=new d.NylaSchedulerAPIConnector({schedulerAPIURL:this.schedulerAPIURL,schedulerStore:this.schedulerStore}),this._schedulerAPIConnector)}getAuth(){return this.nylasAuth}resetStores(){this.nylasAuthStore.reset()}async logout(){await this.nylasAuth.logout(),this.resetStores()}}class A extends Event{constructor(e,t){super(e,t),this.oldURL=t.oldURL,this.newURL=t.newURL}}class R{constructor(){this.routeChangeListeners=[],o.debug("HashRouter constructor")}destroy(){o.debug("HashRouter destroy"),window.removeEventListener("hashchange",this.onRouteChange.bind(this))}init(){if(o.debug("HashRouter init"),window.addEventListener("hashchange",this.onRouteChange.bind(this)),typeof HashChangeEvent<"u"){const e=new HashChangeEvent("hashchange",{oldURL:"",newURL:window.location.href});this.onRouteChange(e)}else{const e=new A("hashchange",{oldURL:"",newURL:window.location.href});this.onRouteChange(e)}}addRouteChangeListener(e,t){o.debug("HashRouter addRouteChangeListener"),this.routeChangeListeners.push([e,t])}navigate(e,t){if(o.debug("HashRouter navigate"),t)return window.history.pushState(null,"",`#${e}`);window.location.hash=e}setRoute(e){o.debug("HashRouter setRoute"),window.location.hash=e}matchRoute(e,t){const n=e.split("/"),r=t.split("/");if(o.debug(`HashRouter matchRoute route=${e} path=${t}`,{routeParts:n,pathParts:r}),n[1]===""&&r[0]==="")return!0;if(n.length!==r.length)return!1;for(let i=0;i<n.length;i++){const a=n[i],h=r[i];if(!a.startsWith(":")&&a!==h)return!1}return!0}getRouteParams(e){o.debug("HashRouter getRouteParams");const t={},n=e.split("/"),r=window.location.hash.split("/");return n.forEach((i,a)=>{if(i.startsWith(":")){const h=i.substring(1);t[h]=r[a]}}),t}getRouteWithParams(e,t){o.debug("HashRouter getRouteWithParams");let n=e;return Object.keys(t).forEach(r=>{n=n.replace(`:${r}`,t[r])}),n}getRoute(){return o.debug("HashRouter getRoute"),window.location.hash}onRouteChange(e){this.routeChangeListeners.forEach(async([t,n])=>{const r=e.newURL.indexOf("#")===-1?"":e.newURL.substring(e.newURL.indexOf("#")+1);if(o.debug(`HashRouter onRouteChange route=${t} path=${r}`,{event:e}),!this.matchRoute(t,r)){o.debug(`HashRouter onRouteChange route=${t} path=${r} does not match`);return}const i=this.getRouteParams(t);await n(t,r,i)})}getBasePath(){return o.debug("HashRouter getBasePath"),""}}function S(s={}){const e={isAuthenticated:!1,tokenInfo:null,state:"ready",...s},t=o.createStore(e);return t.reset=()=>{for(const n in e){const r=e[n];t.set(n,r)}},t}const b=":host{display:contents}",w=b,g=class{constructor(s){o.registerInstance(this,s),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=>{e?this.loggedIn.emit(this.host):this.loggedOut.emit(this.host)},this.authConfig=void 0,this.eventOverrides={},this.automaticComponentRegistration=!0}connectedCallback(){o.debug("[nylas-provider] connectedCallback")}async componentWillLoad(){var i,a,h,u,c;o.debug("[nylas-provider] componentWillLoad"),this.stores={auth:S(),scheduler:d.CreateNylasSchedulerStore(),schedulerConfig:y.CreateNylasSchedulerConfigStore()},this.baseProvider=new l.NylasBaseProvider(this.host,this.stores,this.automaticComponentRegistration,this.eventOverrides);const s=new R;this.nylasAuth=l.es({apiUri:"https://api.us.nylas.com",elementsApiUri:"https://elements.us.nylas.com",storageType:"indexeddb",clientId:"YOUR_CLIENT_ID",defaultScopes:[],redirectURI:"/",...this.authConfig});const e=(i=this.baseProvider)==null?void 0:i.getStore("auth");if(!e)throw new Error("The auth store is not set");const t=(a=this.baseProvider)==null?void 0:a.getStore("scheduler");if(!t)throw new Error("The scheduler store is not set");const n=(h=this.baseProvider)==null?void 0:h.getStore("schedulerConfig");if(!n)throw new Error("The scheduler config store is not set");this.nylasConnector=new C(s,this.nylasAuth,e,t,n),this.init.emit(this.host).defaultPrevented||await((u=this.nylasConnector)==null?void 0:u.auth.validateSession()),this.handleAuthChange(e.state.isAuthenticated),(c=this.baseProvider)==null||c.componentWillLoad(this.nylasConnector)}componentDidLoad(){var e,t;const s=(e=this.baseProvider)==null?void 0:e.getStore("auth");s==null||s.onChange("isAuthenticated",this.handleAuthChange),(t=this.baseProvider)==null||t.componentDidLoad()}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)}async getNylasAuth(){return this.nylasAuth}async getNylasConnector(){return this.nylasConnector}async getAuthStore(){var s;return(s=this.baseProvider)==null?void 0:s.getStore("auth")}async getNylasSchedulerStore(){var s;return(s=this.baseProvider)==null?void 0:s.getStore("scheduler")}async getNylasSchedulerConfigStore(){var s;return(s=this.baseProvider)==null?void 0:s.getStore("schedulerConfig")}render(){return o.h(o.Host,{key:"a07ace4fe61c7f7ee20b723d1858f7ebac56ff95"},o.h("slot",{key:"7c10f2b5cf18450c28617b3f35215b720f1d8bd2"}))}get host(){return o.getElement(this)}};g.style=w;exports.nylas_provider=g;
|
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
import { r as g, c as u, d as r, h as d, H as y, g as f, a as C } from "./index-3fd31877.js";
|
|
2
|
+
import { N as A, e as R } from "./index.es-c7ca1bad-b895d84b.js";
|
|
3
|
+
import { C as S, N as p } from "./scheduler-store-d4784b24-9a5f5734.js";
|
|
4
|
+
import { C as m } from "./scheduler-config-store-ed4a8dfd-22db9285.js";
|
|
5
|
+
import "react";
|
|
6
|
+
import "react-dom";
|
|
7
|
+
class w {
|
|
8
|
+
constructor(t, e) {
|
|
9
|
+
this.nylasAuth = t, this.nylasAuthStore = e;
|
|
10
|
+
}
|
|
11
|
+
async validateSession() {
|
|
12
|
+
const t = await this.isAccessTokenValid();
|
|
13
|
+
if (!t)
|
|
14
|
+
this.logout();
|
|
15
|
+
else {
|
|
16
|
+
let e = await this.nylasAuth.getTokenInfo();
|
|
17
|
+
if (e) {
|
|
18
|
+
const o = Math.floor(Date.now() / 1e3);
|
|
19
|
+
if (e.expires_in && e.expires_in - o < 3e5 && (r("[NylasAuthConnectorMixin] Refreshing access token"), e = await this.nylasAuth.refreshAccessToken(), !e)) {
|
|
20
|
+
r("[NylasAuthConnectorMixin] Token is expired and could not be refreshed. Logging out."), this.logout();
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
this.nylasAuthStore.state.tokenInfo = e;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
this.nylasAuthStore.state.isAuthenticated = t;
|
|
27
|
+
}
|
|
28
|
+
async isAuthenticated() {
|
|
29
|
+
return this.nylasAuth.isAuthenticated();
|
|
30
|
+
}
|
|
31
|
+
async getTokenInfo() {
|
|
32
|
+
return this.nylasAuth.getTokenInfo();
|
|
33
|
+
}
|
|
34
|
+
async isAccessTokenValid() {
|
|
35
|
+
return this.nylasAuth.isAccessTokenValid();
|
|
36
|
+
}
|
|
37
|
+
async logout() {
|
|
38
|
+
await this.nylasAuth.logout();
|
|
39
|
+
}
|
|
40
|
+
async getHostedAuthRedirectURL(t, e, n) {
|
|
41
|
+
return this.nylasAuth.getHostedAuthRedirectURL(t, e, n);
|
|
42
|
+
}
|
|
43
|
+
async manageHostedAuthCodeExchange(t) {
|
|
44
|
+
const n = new URL(t).searchParams.get("code");
|
|
45
|
+
if (n) {
|
|
46
|
+
const o = await this.nylasAuth.exchangeAuthCodeForTokenInfo(n);
|
|
47
|
+
if (o)
|
|
48
|
+
return this.nylasAuthStore.state.tokenInfo = o, this.nylasAuthStore.state.isAuthenticated = !0, o;
|
|
49
|
+
}
|
|
50
|
+
return null;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
class P {
|
|
54
|
+
constructor(t, e, n, o, a, i = "https://api.us.nylas.com") {
|
|
55
|
+
this.router = t, this.schedulerAPIURL = i, this.nylasAuth = e, this.nylasAuthStore = n, this.nylasSchedulerStore = o, this.nylasSchedulerConfigStore = a;
|
|
56
|
+
}
|
|
57
|
+
init() {
|
|
58
|
+
r("NylasConnector init");
|
|
59
|
+
}
|
|
60
|
+
get authStore() {
|
|
61
|
+
return this.nylasAuthStore;
|
|
62
|
+
}
|
|
63
|
+
get schedulerStore() {
|
|
64
|
+
return this.nylasSchedulerStore;
|
|
65
|
+
}
|
|
66
|
+
get schedulerConfigStore() {
|
|
67
|
+
return this.nylasSchedulerConfigStore;
|
|
68
|
+
}
|
|
69
|
+
get auth() {
|
|
70
|
+
return this._authConnector ? this._authConnector : (this._authConnector = new w(this.nylasAuth, this.nylasAuthStore), this._authConnector);
|
|
71
|
+
}
|
|
72
|
+
get scheduler() {
|
|
73
|
+
return this._schedulerAPIConnector ? this._schedulerAPIConnector : (this._schedulerAPIConnector = new p({
|
|
74
|
+
schedulerAPIURL: this.schedulerAPIURL,
|
|
75
|
+
schedulerStore: this.schedulerStore
|
|
76
|
+
}), this._schedulerAPIConnector);
|
|
77
|
+
}
|
|
78
|
+
getAuth() {
|
|
79
|
+
return this.nylasAuth;
|
|
80
|
+
}
|
|
81
|
+
resetStores() {
|
|
82
|
+
this.nylasAuthStore.reset();
|
|
83
|
+
}
|
|
84
|
+
async logout() {
|
|
85
|
+
await this.nylasAuth.logout(), this.resetStores();
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
class v extends Event {
|
|
89
|
+
constructor(t, e) {
|
|
90
|
+
super(t, e), this.oldURL = e.oldURL, this.newURL = e.newURL;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
class L {
|
|
94
|
+
constructor() {
|
|
95
|
+
this.routeChangeListeners = [], r("HashRouter constructor");
|
|
96
|
+
}
|
|
97
|
+
destroy() {
|
|
98
|
+
r("HashRouter destroy"), window.removeEventListener("hashchange", this.onRouteChange.bind(this));
|
|
99
|
+
}
|
|
100
|
+
init() {
|
|
101
|
+
if (r("HashRouter init"), window.addEventListener("hashchange", this.onRouteChange.bind(this)), typeof HashChangeEvent < "u") {
|
|
102
|
+
const t = new HashChangeEvent("hashchange", { oldURL: "", newURL: window.location.href });
|
|
103
|
+
this.onRouteChange(t);
|
|
104
|
+
} else {
|
|
105
|
+
const t = new v("hashchange", { oldURL: "", newURL: window.location.href });
|
|
106
|
+
this.onRouteChange(t);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
addRouteChangeListener(t, e) {
|
|
110
|
+
r("HashRouter addRouteChangeListener"), this.routeChangeListeners.push([t, e]);
|
|
111
|
+
}
|
|
112
|
+
navigate(t, e) {
|
|
113
|
+
if (r("HashRouter navigate"), e)
|
|
114
|
+
return window.history.pushState(null, "", `#${t}`);
|
|
115
|
+
window.location.hash = t;
|
|
116
|
+
}
|
|
117
|
+
setRoute(t) {
|
|
118
|
+
r("HashRouter setRoute"), window.location.hash = t;
|
|
119
|
+
}
|
|
120
|
+
matchRoute(t, e) {
|
|
121
|
+
const n = t.split("/"), o = e.split("/");
|
|
122
|
+
if (r(`HashRouter matchRoute route=${t} path=${e}`, { routeParts: n, pathParts: o }), n[1] === "" && o[0] === "")
|
|
123
|
+
return !0;
|
|
124
|
+
if (n.length !== o.length)
|
|
125
|
+
return !1;
|
|
126
|
+
for (let a = 0; a < n.length; a++) {
|
|
127
|
+
const i = n[a], h = o[a];
|
|
128
|
+
if (!i.startsWith(":") && i !== h)
|
|
129
|
+
return !1;
|
|
130
|
+
}
|
|
131
|
+
return !0;
|
|
132
|
+
}
|
|
133
|
+
getRouteParams(t) {
|
|
134
|
+
r("HashRouter getRouteParams");
|
|
135
|
+
const e = {}, n = t.split("/"), o = window.location.hash.split("/");
|
|
136
|
+
return n.forEach((a, i) => {
|
|
137
|
+
if (a.startsWith(":")) {
|
|
138
|
+
const h = a.substring(1);
|
|
139
|
+
e[h] = o[i];
|
|
140
|
+
}
|
|
141
|
+
}), e;
|
|
142
|
+
}
|
|
143
|
+
getRouteWithParams(t, e) {
|
|
144
|
+
r("HashRouter getRouteWithParams");
|
|
145
|
+
let n = t;
|
|
146
|
+
return Object.keys(e).forEach((o) => {
|
|
147
|
+
n = n.replace(`:${o}`, e[o]);
|
|
148
|
+
}), n;
|
|
149
|
+
}
|
|
150
|
+
getRoute() {
|
|
151
|
+
return r("HashRouter getRoute"), window.location.hash;
|
|
152
|
+
}
|
|
153
|
+
onRouteChange(t) {
|
|
154
|
+
this.routeChangeListeners.forEach(async ([e, n]) => {
|
|
155
|
+
const o = t.newURL.indexOf("#") === -1 ? "" : t.newURL.substring(t.newURL.indexOf("#") + 1);
|
|
156
|
+
if (r(`HashRouter onRouteChange route=${e} path=${o}`, { event: t }), !this.matchRoute(e, o)) {
|
|
157
|
+
r(`HashRouter onRouteChange route=${e} path=${o} does not match`);
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
160
|
+
const a = this.getRouteParams(e);
|
|
161
|
+
await n(e, o, a);
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
getBasePath() {
|
|
165
|
+
return r("HashRouter getBasePath"), "";
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
function b(s = {}) {
|
|
169
|
+
const t = {
|
|
170
|
+
isAuthenticated: !1,
|
|
171
|
+
tokenInfo: null,
|
|
172
|
+
state: "ready",
|
|
173
|
+
...s
|
|
174
|
+
}, e = C(t);
|
|
175
|
+
return e.reset = () => {
|
|
176
|
+
for (const n in t) {
|
|
177
|
+
const o = t[n];
|
|
178
|
+
e.set(n, o);
|
|
179
|
+
}
|
|
180
|
+
}, e;
|
|
181
|
+
}
|
|
182
|
+
const H = ":host{display:contents}", I = H, k = class {
|
|
183
|
+
constructor(s) {
|
|
184
|
+
g(this, s), this.init = u(this, "init", 7), this.loggedIn = u(this, "loggedIn", 7), this.loggedOut = u(this, "loggedOut", 7), this.handleAuthChange = async (t) => {
|
|
185
|
+
t ? this.loggedIn.emit(this.host) : this.loggedOut.emit(this.host);
|
|
186
|
+
}, this.authConfig = void 0, this.eventOverrides = {}, this.automaticComponentRegistration = !0;
|
|
187
|
+
}
|
|
188
|
+
connectedCallback() {
|
|
189
|
+
r("[nylas-provider] connectedCallback");
|
|
190
|
+
}
|
|
191
|
+
async componentWillLoad() {
|
|
192
|
+
var a, i, h, c, l;
|
|
193
|
+
r("[nylas-provider] componentWillLoad"), this.stores = {
|
|
194
|
+
auth: b(),
|
|
195
|
+
scheduler: S(),
|
|
196
|
+
schedulerConfig: m()
|
|
197
|
+
}, this.baseProvider = new A(this.host, this.stores, this.automaticComponentRegistration, this.eventOverrides);
|
|
198
|
+
const s = new L();
|
|
199
|
+
this.nylasAuth = R({
|
|
200
|
+
apiUri: "https://api.us.nylas.com",
|
|
201
|
+
elementsApiUri: "https://elements.us.nylas.com",
|
|
202
|
+
storageType: "indexeddb",
|
|
203
|
+
clientId: "YOUR_CLIENT_ID",
|
|
204
|
+
defaultScopes: [],
|
|
205
|
+
redirectURI: "/",
|
|
206
|
+
...this.authConfig
|
|
207
|
+
});
|
|
208
|
+
const t = (a = this.baseProvider) == null ? void 0 : a.getStore("auth");
|
|
209
|
+
if (!t)
|
|
210
|
+
throw new Error("The auth store is not set");
|
|
211
|
+
const e = (i = this.baseProvider) == null ? void 0 : i.getStore("scheduler");
|
|
212
|
+
if (!e)
|
|
213
|
+
throw new Error("The scheduler store is not set");
|
|
214
|
+
const n = (h = this.baseProvider) == null ? void 0 : h.getStore("schedulerConfig");
|
|
215
|
+
if (!n)
|
|
216
|
+
throw new Error("The scheduler config store is not set");
|
|
217
|
+
this.nylasConnector = new P(s, this.nylasAuth, t, e, n), this.init.emit(this.host).defaultPrevented || await ((c = this.nylasConnector) == null ? void 0 : c.auth.validateSession()), this.handleAuthChange(t.state.isAuthenticated), (l = this.baseProvider) == null || l.componentWillLoad(this.nylasConnector);
|
|
218
|
+
}
|
|
219
|
+
componentDidLoad() {
|
|
220
|
+
var t, e;
|
|
221
|
+
const s = (t = this.baseProvider) == null ? void 0 : t.getStore("auth");
|
|
222
|
+
s == null || s.onChange("isAuthenticated", this.handleAuthChange), (e = this.baseProvider) == null || e.componentDidLoad();
|
|
223
|
+
}
|
|
224
|
+
componentDisconnected() {
|
|
225
|
+
var s;
|
|
226
|
+
(s = this.baseProvider) == null || s.componentDisconnected();
|
|
227
|
+
}
|
|
228
|
+
async registerComponentHandler(s) {
|
|
229
|
+
var t;
|
|
230
|
+
(t = this.baseProvider) == null || t.registerComponent(s.detail);
|
|
231
|
+
}
|
|
232
|
+
async unregisterComponentHandler(s) {
|
|
233
|
+
var t;
|
|
234
|
+
(t = this.baseProvider) == null || t.unregisterComponent(s.detail);
|
|
235
|
+
}
|
|
236
|
+
async getNylasAuth() {
|
|
237
|
+
return this.nylasAuth;
|
|
238
|
+
}
|
|
239
|
+
async getNylasConnector() {
|
|
240
|
+
return this.nylasConnector;
|
|
241
|
+
}
|
|
242
|
+
async getAuthStore() {
|
|
243
|
+
var s;
|
|
244
|
+
return (s = this.baseProvider) == null ? void 0 : s.getStore("auth");
|
|
245
|
+
}
|
|
246
|
+
async getNylasSchedulerStore() {
|
|
247
|
+
var s;
|
|
248
|
+
return (s = this.baseProvider) == null ? void 0 : s.getStore("scheduler");
|
|
249
|
+
}
|
|
250
|
+
async getNylasSchedulerConfigStore() {
|
|
251
|
+
var s;
|
|
252
|
+
return (s = this.baseProvider) == null ? void 0 : s.getStore("schedulerConfig");
|
|
253
|
+
}
|
|
254
|
+
render() {
|
|
255
|
+
return d(y, { key: "a07ace4fe61c7f7ee20b723d1858f7ebac56ff95" }, d("slot", { key: "7c10f2b5cf18450c28617b3f35215b720f1d8bd2" }));
|
|
256
|
+
}
|
|
257
|
+
get host() {
|
|
258
|
+
return f(this);
|
|
259
|
+
}
|
|
260
|
+
};
|
|
261
|
+
k.style = I;
|
|
262
|
+
export {
|
|
263
|
+
k as nylas_provider
|
|
264
|
+
};
|