@nylas/react 1.1.3 → 1.1.4

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.
Files changed (168) hide show
  1. package/dist/add-circle-icon_2.entry-6753bd65.js +25 -0
  2. package/dist/add-circle-icon_2.entry-cd9a7f37.cjs +1 -0
  3. package/dist/archive-icon.entry-434d1696.js +15 -0
  4. package/dist/archive-icon.entry-7cb1c265.cjs +1 -0
  5. package/dist/arrow-icon.entry-20b50784.js +15 -0
  6. package/dist/{arrow-icon.entry-2dfd8319.cjs → arrow-icon.entry-83c3105b.cjs} +1 -1
  7. package/dist/bold-icon.entry-0e3d84e1.cjs +1 -0
  8. package/dist/bold-icon.entry-34b18d0d.js +15 -0
  9. package/dist/{button-component_2.entry-27a504d9.cjs → button-component_2.entry-54101987.cjs} +1 -1
  10. package/dist/{button-component_2.entry-697bf5ac.js → button-component_2.entry-8a5e99da.js} +9 -9
  11. package/dist/{calendar-agenda-fill-icon_51.entry-a25262b3.cjs → calendar-agenda-fill-icon_51.entry-1920adc2.cjs} +2 -2
  12. package/dist/{calendar-agenda-fill-icon_51.entry-52b5bf31.js → calendar-agenda-fill-icon_51.entry-a351dca5.js} +87 -87
  13. package/dist/{calendar-cancel-icon.entry-c6e2eed6.cjs → calendar-cancel-icon.entry-00756264.cjs} +1 -1
  14. package/dist/{calendar-cancel-icon.entry-e6a433a2.js → calendar-cancel-icon.entry-f83e9b41.js} +2 -2
  15. package/dist/{calendar-check-icon_2.entry-d88307d6.js → calendar-check-icon_2.entry-1817540c.js} +7 -7
  16. package/dist/{calendar-check-icon_2.entry-45cad6f1.cjs → calendar-check-icon_2.entry-6ac948fc.cjs} +1 -1
  17. package/dist/{calendar-icon.entry-2badc962.js → calendar-icon.entry-362428bf.js} +4 -4
  18. package/dist/{calendar-icon.entry-b2fffd21.cjs → calendar-icon.entry-68e53f52.cjs} +1 -1
  19. package/dist/{checkbox-component_2.entry-5ab55050.js → checkbox-component_2.entry-0d7c1916.js} +3 -3
  20. package/dist/{checkbox-component_2.entry-3926b644.cjs → checkbox-component_2.entry-5ce9807d.cjs} +1 -1
  21. package/dist/{chevron-icon_3.entry-664fae5d.js → chevron-icon_3.entry-37c087a7.js} +6 -6
  22. package/dist/{chevron-icon_3.entry-1fe5d097.cjs → chevron-icon_3.entry-89c52603.cjs} +1 -1
  23. package/dist/{clock-icon_4.entry-f11f9dad.js → clock-icon_4.entry-2e78febe.js} +15 -15
  24. package/dist/{clock-icon_4.entry-efec2c08.cjs → clock-icon_4.entry-496058ef.cjs} +1 -1
  25. package/dist/{constants-50c3e067-33cf0ffe.js → constants-c31dccfe-04b9cd8a.js} +2 -2
  26. package/dist/{constants-50c3e067-5ec3f879.cjs → constants-c31dccfe-1a739653.cjs} +2 -2
  27. package/dist/{copy-icon.entry-70131e8e.js → copy-icon.entry-6d4e05b0.js} +7 -7
  28. package/dist/{copy-icon.entry-3965f206.cjs → copy-icon.entry-a1baee33.cjs} +1 -1
  29. package/dist/{delete-icon.entry-5d067fef.cjs → delete-icon.entry-e98b336e.cjs} +1 -1
  30. package/dist/{delete-icon.entry-e003695d.js → delete-icon.entry-ea06b42a.js} +5 -5
  31. package/dist/document-refresh-icon.entry-09750b52.cjs +1 -0
  32. package/dist/document-refresh-icon.entry-afae6621.js +15 -0
  33. package/dist/elements/index.d.ts +0 -11
  34. package/dist/feedbackSync-ab657d65-e650e46d.cjs +448 -0
  35. package/dist/feedbackSync-ab657d65-e8b7c001.js +6035 -0
  36. package/dist/folder-icon.entry-5c3f4e8f.cjs +1 -0
  37. package/dist/folder-icon.entry-6096fbf4.js +15 -0
  38. package/dist/forward-icon.entry-4089e3bb.cjs +1 -0
  39. package/dist/forward-icon.entry-da319c05.js +15 -0
  40. package/dist/{globe-icon.entry-6fc456c7.js → globe-icon.entry-59f4c2f9.js} +7 -7
  41. package/dist/{globe-icon.entry-8c3c9e48.cjs → globe-icon.entry-e8ca972e.cjs} +1 -1
  42. package/dist/{google-logo-icon_4.entry-d6e0c4c0.js → google-logo-icon_4.entry-d4b8926f.js} +39 -39
  43. package/dist/google-logo-icon_4.entry-e2001f83.cjs +1 -0
  44. package/dist/inbox-icon.entry-70dae5ec.js +15 -0
  45. package/dist/inbox-icon.entry-80ee9082.cjs +1 -0
  46. package/dist/{index-11f33e47.cjs → index-6b9d4b01.cjs} +30 -31
  47. package/dist/{index-a282e817.js → index-e475e0c0.js} +2547 -2622
  48. package/dist/index.d.ts +1 -1
  49. package/dist/{index.es-ab9affcc-18263b66.cjs → index.es-b475d61f-68a74a28.cjs} +5 -5
  50. package/dist/{index.es-ab9affcc-30461b18.js → index.es-b475d61f-bfa2cba2.js} +125 -131
  51. package/dist/{info-icon_2.entry-d20b975c.js → info-icon_2.entry-2bb60213.js} +5 -5
  52. package/dist/{info-icon_2.entry-e582ac10.cjs → info-icon_2.entry-f1b1dfba.cjs} +1 -1
  53. package/dist/{input-color-picker.entry-27f4288f.js → input-color-picker.entry-5ae45a9e.js} +3 -3
  54. package/dist/{input-color-picker.entry-c6a28671.cjs → input-color-picker.entry-b669f7fb.cjs} +1 -1
  55. package/dist/{input-component.entry-b6f1c417.js → input-component.entry-cb958501.js} +2 -2
  56. package/dist/{input-component.entry-744fcec1.cjs → input-component.entry-eeb95361.cjs} +1 -1
  57. package/dist/{input-dropdown.entry-f13234d7.cjs → input-dropdown.entry-0b458f68.cjs} +1 -1
  58. package/dist/{input-dropdown.entry-18744def.js → input-dropdown.entry-962605f8.js} +4 -4
  59. package/dist/italic-icon.entry-4a89e289.cjs +1 -0
  60. package/dist/italic-icon.entry-5be07509.js +15 -0
  61. package/dist/{multi-select-dropdown.entry-924809e1.js → multi-select-dropdown.entry-3084e1fc.js} +2 -2
  62. package/dist/{multi-select-dropdown.entry-dde671d7.cjs → multi-select-dropdown.entry-a66408a2.cjs} +1 -1
  63. package/dist/nylas-booked-event-card_12.entry-227ccf31.cjs +1 -0
  64. package/dist/{nylas-booked-event-card_12.entry-52c3111d.js → nylas-booked-event-card_12.entry-29e2a4b1.js} +64 -63
  65. package/dist/{nylas-form-card.entry-b0a2403f.js → nylas-form-card.entry-33b4c295.js} +11 -11
  66. package/dist/{nylas-form-card.entry-ab61fdc5.cjs → nylas-form-card.entry-8465eccf.cjs} +1 -1
  67. package/dist/{nylas-if-state.entry-523fdc6b.js → nylas-if-state.entry-9d96fc87.js} +2 -2
  68. package/dist/{nylas-if-state.entry-53883c36.cjs → nylas-if-state.entry-adb6103a.cjs} +1 -1
  69. package/dist/{nylas-login.entry-d9bf3974.js → nylas-login.entry-3f7c195e.js} +7 -7
  70. package/dist/{nylas-login.entry-05e1df3e.cjs → nylas-login.entry-78b968d1.cjs} +1 -1
  71. package/dist/nylas-provider.entry-19635620.js +264 -0
  72. package/dist/nylas-provider.entry-b918d0f6.cjs +1 -0
  73. package/dist/nylas-reminder-emails.entry-ec79b757.js +168 -0
  74. package/dist/nylas-reminder-emails.entry-ee76db24.cjs +4 -0
  75. package/dist/{nylas-reminder-time_2.entry-9589d5f2.js → nylas-reminder-time_2.entry-105de2d0.js} +42 -39
  76. package/dist/nylas-reminder-time_2.entry-83ecc1d4.cjs +1 -0
  77. package/dist/{nylas-scheduler-editor.entry-1a2f3ee0.cjs → nylas-scheduler-editor.entry-cfed7ae2.cjs} +2 -2
  78. package/dist/{nylas-scheduler-editor.entry-b434b526.js → nylas-scheduler-editor.entry-e848771f.js} +3 -3
  79. package/dist/{nylas-scheduling.entry-b71080c8.js → nylas-scheduling.entry-da987c02.js} +19 -19
  80. package/dist/nylas-scheduling.entry-e989cf9e.cjs +1 -0
  81. package/dist/{nylas-time-window-picker.entry-a6d1c648.cjs → nylas-time-window-picker.entry-1f76b577.cjs} +1 -1
  82. package/dist/{nylas-time-window-picker.entry-c1ee860a.js → nylas-time-window-picker.entry-3c6b29d9.js} +20 -20
  83. package/dist/{person-icon.entry-8833e3cc.js → person-icon.entry-79fcd9fb.js} +2 -2
  84. package/dist/{person-icon.entry-80c9022e.cjs → person-icon.entry-82bbb87c.cjs} +1 -1
  85. package/dist/play-icon.entry-3f357ea4.cjs +1 -0
  86. package/dist/play-icon.entry-97b40470.js +15 -0
  87. package/dist/react.cjs +1 -1
  88. package/dist/react.js +93 -104
  89. package/dist/{refresh-icon.entry-4d6791bd.js → refresh-icon.entry-1427a5e6.js} +4 -4
  90. package/dist/{refresh-icon.entry-d4cc16b7.cjs → refresh-icon.entry-7ce5ec90.cjs} +1 -1
  91. package/dist/{register-component-a7ea27ad-2343f3df.cjs → register-component-679c1308-b5a96acf.cjs} +1 -1
  92. package/dist/{register-component-a7ea27ad-fa2c4b17.js → register-component-679c1308-de697ecb.js} +1 -1
  93. package/dist/reply-all-icon.entry-cf8114db.cjs +1 -0
  94. package/dist/reply-all-icon.entry-f1165660.js +15 -0
  95. package/dist/reply-icon.entry-3a601cff.js +15 -0
  96. package/dist/reply-icon.entry-3db337c9.cjs +1 -0
  97. package/dist/{scheduler-config-store-2a3b403d-5176cd45.js → scheduler-config-store-2a3b403d-e5210f72.js} +1 -1
  98. package/dist/{scheduler-config-store-2a3b403d-2263f999.cjs → scheduler-config-store-2a3b403d-e6f5bcab.cjs} +1 -1
  99. package/dist/{scheduler-store-33ab8dea-a0b39d36.cjs → scheduler-store-908886c8-62d14677.cjs} +1 -1
  100. package/dist/{scheduler-store-33ab8dea-9801357a.js → scheduler-store-908886c8-b0f43cb9.js} +1 -1
  101. package/dist/sent-icon.entry-2c7bd48e.js +15 -0
  102. package/dist/sent-icon.entry-708b9a2b.cjs +1 -0
  103. package/dist/spam-icon.entry-3106ed3d.js +15 -0
  104. package/dist/spam-icon.entry-fa8b80c6.cjs +1 -0
  105. package/dist/star-icon.entry-88501c8b.cjs +1 -0
  106. package/dist/star-icon.entry-b15601ca.js +15 -0
  107. package/dist/stop-icon.entry-3475e257.cjs +1 -0
  108. package/dist/stop-icon.entry-f926a8db.js +15 -0
  109. package/dist/{textarea-component.entry-019e75d0.cjs → textarea-component.entry-683c2959.cjs} +1 -1
  110. package/dist/{textarea-component.entry-174089bc.js → textarea-component.entry-d1f4dd9a.js} +2 -2
  111. package/dist/{time-period-selector.entry-8466d0f2.cjs → time-period-selector.entry-8cfdf750.cjs} +1 -1
  112. package/dist/{time-period-selector.entry-62c854d1.js → time-period-selector.entry-e97f86fd.js} +4 -4
  113. package/dist/{translate-icon.entry-73f7127b.js → translate-icon.entry-09c5574f.js} +4 -4
  114. package/dist/{translate-icon.entry-7d5cf4b8.cjs → translate-icon.entry-5757c37c.cjs} +1 -1
  115. package/dist/trash-fill-icon.entry-470ec1ff.js +15 -0
  116. package/dist/trash-fill-icon.entry-4bbfabcc.cjs +1 -0
  117. package/dist/underline-icon.entry-6d729068.cjs +1 -0
  118. package/dist/underline-icon.entry-9fe74ba7.js +15 -0
  119. package/dist/{warning-icon.entry-92638eeb.cjs → warning-icon.entry-c1d48318.cjs} +1 -1
  120. package/dist/{warning-icon.entry-abf896c3.js → warning-icon.entry-d924f8f9.js} +5 -5
  121. package/package.json +2 -2
  122. package/dist/add-circle-icon_2.entry-b77120e5.cjs +0 -1
  123. package/dist/add-circle-icon_2.entry-fbc1e82b.js +0 -25
  124. package/dist/archive-icon_7.entry-30962e70.js +0 -75
  125. package/dist/archive-icon_7.entry-dd8c7642.cjs +0 -1
  126. package/dist/arrow-icon.entry-5b436054.js +0 -15
  127. package/dist/bold-icon_3.entry-5120a9c8.js +0 -35
  128. package/dist/bold-icon_3.entry-da2d1270.cjs +0 -1
  129. package/dist/document-refresh-icon.entry-30c974df.cjs +0 -1
  130. package/dist/document-refresh-icon.entry-b4e01cd4.js +0 -15
  131. package/dist/elements-dc5b338e-55823d00.js +0 -28031
  132. package/dist/elements-dc5b338e-6883a39e.cjs +0 -16516
  133. package/dist/feedbackSync-81d4c4d8-dd4d2e32.js +0 -11735
  134. package/dist/feedbackSync-81d4c4d8-f4e78902.cjs +0 -455
  135. package/dist/flow-40ff9cea-6f8c30e2.cjs +0 -9
  136. package/dist/flow-40ff9cea-ee70fdf5.js +0 -505
  137. package/dist/focus-visible-e8093c16-431bbe59.cjs +0 -1
  138. package/dist/focus-visible-e8093c16-f403fee8.js +0 -84
  139. package/dist/forward-icon_6.entry-3bb91d58.js +0 -953
  140. package/dist/forward-icon_6.entry-ceec2371.cjs +0 -3
  141. package/dist/google-logo-icon_4.entry-4eb16cd2.cjs +0 -1
  142. package/dist/mailbox-store-affca6de-9451094e.cjs +0 -1
  143. package/dist/mailbox-store-affca6de-d601dc6b.js +0 -380
  144. package/dist/nylas-booked-event-card_12.entry-d89c1f9d.cjs +0 -1
  145. package/dist/nylas-list-folders.entry-4ef6cb3d.cjs +0 -1
  146. package/dist/nylas-list-folders.entry-e37d069f.js +0 -120
  147. package/dist/nylas-list-threads.entry-3be623e9.cjs +0 -1
  148. package/dist/nylas-list-threads.entry-8ba62db8.js +0 -70
  149. package/dist/nylas-mailbox-pagination.entry-3dd05cf4.cjs +0 -1
  150. package/dist/nylas-mailbox-pagination.entry-50d9d9e3.js +0 -101
  151. package/dist/nylas-mailbox-toolbar-button.entry-9a77d137.js +0 -82
  152. package/dist/nylas-mailbox-toolbar-button.entry-d87b55de.cjs +0 -1
  153. package/dist/nylas-mailbox.entry-cb7d1031.js +0 -134
  154. package/dist/nylas-mailbox.entry-f7db9aa8.cjs +0 -1
  155. package/dist/nylas-provider.entry-1716bf48.cjs +0 -1
  156. package/dist/nylas-provider.entry-7aa46ea2.js +0 -145
  157. package/dist/nylas-reminder-emails.entry-88a862cd.cjs +0 -4
  158. package/dist/nylas-reminder-emails.entry-a86231b7.js +0 -129
  159. package/dist/nylas-reminder-time_2.entry-bc76d4ab.cjs +0 -1
  160. package/dist/nylas-scheduling.entry-59e5e8c1.cjs +0 -1
  161. package/dist/nylas-threads-refresh.entry-544ca90a.js +0 -74
  162. package/dist/nylas-threads-refresh.entry-7ada7b2d.cjs +0 -1
  163. package/dist/nylas-threads-search.entry-181ba46a.js +0 -69
  164. package/dist/nylas-threads-search.entry-f1cb19e4.cjs +0 -1
  165. package/dist/nylas-view-thread.entry-6ae8dd64.cjs +0 -1
  166. package/dist/nylas-view-thread.entry-c066f522.js +0 -203
  167. package/dist/play-icon_2.entry-801c85bc.cjs +0 -1
  168. package/dist/play-icon_2.entry-efca8f00.js +0 -25
@@ -1,120 +0,0 @@
1
- import { r as u, c as p, d, t as h, h as s, F as y, f, H as F } from "./index-a282e817.js";
2
- import { R as b } from "./register-component-a7ea27ad-fa2c4b17.js";
3
- import "react";
4
- import "react-dom";
5
- const g = ":host{display:block}.folders{display:flex;flex-direction:column;align-items:self-start}.folders .folder{border:1px solid var(--nylas-color-primary-100);padding:0.5rem 0.75rem;margin-bottom:0.5rem;justify-content:left;width:100%;min-width:200px;border-radius:var(--nylas-border-radius);background-color:var(--nylas-color-primary-50)}.folders .folder:last-child{margin-bottom:0}.folders .folder.selected{background-color:var(--nylas-color-primary-100)}.folders .folder .icon{margin-right:0.5rem;stroke:var(--nylas-color-primary-900);fill:none}hr{width:100%;margin:1rem 0;border:0;border-top:1px solid var(--nylas-color-primary-100)}", C = g;
6
- var v = function(r, t, e, o) {
7
- var l = arguments.length, a = l < 3 ? t : o === null ? o = Object.getOwnPropertyDescriptor(t, e) : o, n;
8
- if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
9
- a = Reflect.decorate(r, t, e, o);
10
- else
11
- for (var i = r.length - 1; i >= 0; i--)
12
- (n = r[i]) && (a = (l < 3 ? n(a) : l > 3 ? n(t, e, a) : n(t, e)) || a);
13
- return l > 3 && a && Object.defineProperty(t, e, a), a;
14
- }, c = function(r, t) {
15
- if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
16
- return Reflect.metadata(r, t);
17
- };
18
- const m = class {
19
- constructor(r) {
20
- u(this, r), this.folderSelected = p(this, "folderSelected", 7), this.folderSelectedHandler = (t) => {
21
- var e;
22
- (e = this.folderSelected) == null || e.emit(t);
23
- }, this.folders = void 0, this.selectedFolder = void 0, this.defaultFolders = void 0, this.otherFolders = void 0;
24
- }
25
- connectedCallback() {
26
- }
27
- disconnectedCallback() {
28
- }
29
- async componentWillLoad() {
30
- d("[nylas-list-folders] Component will load");
31
- }
32
- async componentDidLoad() {
33
- d("[nylas-list-folders] Component did load");
34
- }
35
- watchFolders(r) {
36
- d("[nylas-list-folders] watchFolders", { newFolders: r });
37
- const t = ["inbox", "drafts", "sent", "starred", "spam", "archive", "trash"];
38
- this.defaultFolders = t.filter((e) => r.find((o) => {
39
- var l;
40
- return ((l = o.name) == null ? void 0 : l.toLowerCase()) === e.toLowerCase();
41
- })).map((e) => r.find((o) => {
42
- var l;
43
- return ((l = o.name) == null ? void 0 : l.toLowerCase()) === e.toLowerCase();
44
- })).filter((e) => typeof e < "u").sort((e, o) => t.indexOf((e == null ? void 0 : e.name) ?? "") - t.indexOf((o == null ? void 0 : o.name) ?? "")), this.otherFolders = r.filter((e) => !t.find((o) => {
45
- var l;
46
- return ((l = e.name) == null ? void 0 : l.toLowerCase()) === o.toLowerCase();
47
- })).sort((e, o) => (e.name ?? "").localeCompare(o.name ?? ""));
48
- }
49
- formatFolderName(r) {
50
- var t;
51
- return h(((t = r.name) == null ? void 0 : t.replace("CATEGORY_", "")) ?? "Unknown");
52
- }
53
- getFolderIcon(r) {
54
- var t;
55
- switch ((t = r.name) == null ? void 0 : t.toLowerCase()) {
56
- case "inbox":
57
- return s("inbox-icon", null);
58
- case "drafts":
59
- return s("drafts-icon", null);
60
- case "sent":
61
- return s("sent-icon", null);
62
- case "starred":
63
- return s("star-icon", null);
64
- case "spam":
65
- return s("spam-icon", null);
66
- case "archive":
67
- return s("archive-icon", null);
68
- case "trash":
69
- return s("trash-fill-icon", null);
70
- default:
71
- return s("folder-icon", null);
72
- }
73
- }
74
- render() {
75
- var r, t;
76
- return s(F, { key: "40ce75f145ae1eac2f156d9586dedcec0902da96" }, s("div", { key: "0311656db0aa266f6130d609a9ed2e24e0178ddc", class: "folders" }, (r = this.defaultFolders) == null ? void 0 : r.map((e) => {
77
- var o;
78
- return s("sp-button", { onClick: () => this.folderSelectedHandler(e), class: {
79
- folder: !0,
80
- selected: f(e.name ?? "inbox").toLowerCase() === ((o = this.selectedFolder) == null ? void 0 : o.toLowerCase())
81
- } }, s("div", { slot: "icon", class: "icon" }, this.getFolderIcon(e)), this.formatFolderName(e));
82
- })), this.otherFolders && s(y, null, s("hr", null), s("div", { class: "folders" }, (t = this.otherFolders) == null ? void 0 : t.map((e) => {
83
- var o;
84
- return s("sp-button", { onClick: () => this.folderSelectedHandler(e), class: {
85
- folder: !0,
86
- selected: f(e.name ?? "inbox").toLowerCase() === ((o = this.selectedFolder) == null ? void 0 : o.toLowerCase())
87
- } }, s("div", { slot: "icon", class: "icon" }, this.getFolderIcon(e)), this.formatFolderName(e));
88
- }))));
89
- }
90
- static get watchers() {
91
- return {
92
- folders: ["watchFolders"]
93
- };
94
- }
95
- };
96
- v([
97
- b({
98
- name: "nylas-pagination",
99
- stateToProps: /* @__PURE__ */ new Map([
100
- ["mailbox.folders", "folders"],
101
- ["mailbox.selectedFolder", "selectedFolder"]
102
- ]),
103
- eventToProps: {
104
- folderSelected: async (r, t) => {
105
- d("[nylas-list-folders] folderSelected event", { _event: r }), await t.threads.getThreads({
106
- page_token: void 0,
107
- in: f(r.detail.id ?? "inbox")
108
- });
109
- }
110
- },
111
- fireRegisterEvent: !0
112
- }),
113
- c("design:type", Function),
114
- c("design:paramtypes", []),
115
- c("design:returntype", void 0)
116
- ], m.prototype, "render", null);
117
- m.style = C;
118
- export {
119
- m as nylas_list_folders
120
- };
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-11f33e47.cjs"),p=require("./register-component-a7ea27ad-2343f3df.cjs");require("react");require("react-dom");const u=':host{display:block;font-size:var(--nylas-font-size, inherit);font-family:var(--nylas-font-family, inherit)}.list-thread{display:grid;grid-auto-flow:row;color:var(--nylas-color-primary-800);width:100%}.thread{position:relative;width:100%;display:grid;padding:0.5rem 1rem;column-gap:0.25rem;grid-template-areas:"........ from count ....... date actions" "checkbox subject subject subject subject actions" "........ snippet snippet snippet snippet actions";grid-template-columns:auto auto auto auto auto auto;margin-bottom:0.75rem;border-radius:var(--nylas-border-radius-2x);color:var(--nylas-color-primary-00);background-color:var(--nylas-color-primary-50);border:0;box-sizing:border-box;text-align:left;cursor:pointer;box-shadow:1px 1px 3px 0px rgba(0, 0, 0, 0.3);font-size:inherit;font-family:inherit}.thread.loading{animation:pulsate 1.5s infinite ease-in-out;width:100%;height:90px}.thread:last-of-type{margin-bottom:0}.thread.selected{box-shadow:0 2px 0 0 var(--nylas-color-primary-200);background-color:var(--nylas-color-primary-100)}.thread:hover{box-shadow:0 2px 0 0 var(--nylas-color-primary-200);background-color:var(--nylas-color-primary-100)}.thread>div{align-self:center;pointer-events:all !important}.thread .actions{grid-area:actions}.thread .actions sp-action-menu{pointer-events:initial !important}.thread .actions sp-action-button{pointer-events:initial !important}.thread .actions sp-menu-item{pointer-events:initial !important}.thread .checkbox{grid-area:checkbox;margin-right:0.5rem;pointer-events:initial !important}.thread .checkbox sp-checkbox{pointer-events:initial !important}.thread .star{grid-area:star;justify-self:end}.thread .from{grid-area:from;color:var(--nylas-color-primary-600)}.thread .count{grid-area:count;color:var(--nylas-color-primary-600)}.thread .subject{grid-area:subject;color:var(--nylas-color-primary-600)}.thread .snippet{grid-area:snippet;color:var(--nylas-color-primary-500)}.thread .date{grid-area:date;align-self:center;color:var(--nylas-color-primary-500)}.thread.unread .from,.thread.unread .count,.thread.unread .subject,.thread.unread .date{font-weight:600;color:var(--nylas-color-primary-800)}.thread.unread .snippet{color:var(--nylas-color-primary-700)}.thread .from{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.thread .snippet{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.thread .subject{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}@media only screen and (min-width: 768px){.thread{column-gap:1rem;grid-template-areas:"checkbox from count subject snippet date actions";grid-template-columns:auto minmax(auto, 200px) auto auto 1fr auto auto;margin-bottom:0.5rem;border:1px solid var(--nylas-color-primary-100)}.thread.no-checkbox{grid-template-areas:"from count subject snippet date actions";grid-template-columns:minmax(auto, 200px) auto auto 1fr auto auto}.thread .checkbox{margin-right:0}}@keyframes pulsate{0%{background-color:var(--nylas-color-primary-50)}50%{background-color:var(--nylas-color-primary-100)}100%{background-color:var(--nylas-color-primary-50)}}',h=u;var m=function(e,a,r,i){var s=arguments.length,o=s<3?a:i===null?i=Object.getOwnPropertyDescriptor(a,r):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(e,a,r,i);else for(var l=e.length-1;l>=0;l--)(n=e[l])&&(o=(s<3?n(o):s>3?n(a,r,o):n(a,r))||o);return s>3&&o&&Object.defineProperty(a,r,o),o},c=function(e,a){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,a)};const d=class{constructor(e){t.registerInstance(this,e),this.threadSelected=t.createEvent(this,"threadSelected",7),this.handleThreadSelected=async a=>{t.debug("[nylas-list-threads] Thread selected",{thread:a}),this.threadSelected.emit(a).defaultPrevented||t.debug("[nylas-list-threads] Default event not prevented, selecting thread")},this.handleCheckboxClick=async a=>{t.debug("[nylas-list-threads] Checkbox clicked",{event:a}),a.stopPropagation()},this.threads=[],this.isAuthenticated=!1,this.tokenInfo=void 0,this.state="ready",this.showCheckbox=!1}connectedCallback(){}disconnectedCallback(){}async componentWillLoad(){t.debug("[nylas-list-threads] Component will load")}async componentDidLoad(){t.debug("[nylas-list-threads] Component did load",{isAuthenticated:this.isAuthenticated})}render(){return t.h(t.Host,{key:"4446ea8b3e63f5843e6c727d24d28bf5858488cd"},t.h("div",{key:"c52ddd731313c17f7030f9c42bda1a6285e65203",class:"list-thread",part:"list-thread"},this.state==="loading"&&new Array(10).fill(0).map((e,a)=>t.h("div",{class:"thread loading",style:{animationDelay:`${a*20}ms`}})),this.state==="ready"&&this.threads.map(e=>{var a,r,i,s;return t.h("button",{key:e==null?void 0:e.id,class:{thread:!0,unread:(e==null?void 0:e.unread)===!0,"no-checkbox":this.showCheckbox===!1},part:"thread","aria-label":`Thread with subject ${e==null?void 0:e.subject}`,onClick:()=>this.handleThreadSelected(e)},this.showCheckbox&&t.h("div",{class:"checkbox",part:"checkbox"},t.h("sp-checkbox",{size:"s",value:e==null?void 0:e.id,onClick:this.handleCheckboxClick})),t.h("div",{class:"from",part:"from"},t.formatParticipants(e.participants??[],(a=this.tokenInfo)==null?void 0:a.email,((r=e==null?void 0:e.message_ids)==null?void 0:r.length)||1,1)),t.h("div",{class:"subject",part:"subject"},e==null?void 0:e.subject),t.h("div",{class:"count",part:"count"},((i=e==null?void 0:e.message_ids)==null?void 0:i.length)||1),t.h("div",{class:"snippet",part:"snippet"},(s=e==null?void 0:e.snippet)==null?void 0:s.trim()),e.latest_message_received_date&&t.h("div",{class:"date","aria-label":`${Intl.DateTimeFormat(void 0,{dateStyle:"full"}).format(new Date(e.latest_message_received_date*1e3))}`,part:"date"},t.formatDateTime(e.latest_message_received_date)))})))}};m([p.RegisterComponent({name:"nylas-list-threads",stateToProps:new Map([["auth.isAuthenticated","isAuthenticated"],["auth.tokenInfo","tokenInfo"],["mailbox.threads","threads"],["mailbox.state","state"]]),eventToProps:{threadSelected:async(e,a)=>{t.debug("[nylas-list-threads] Thread selected",{event:e}),await a.threads.selectThread(e.detail)}},fireRegisterEvent:!0}),c("design:type",Function),c("design:paramtypes",[]),c("design:returntype",void 0)],d.prototype,"render",null);d.style=h;exports.nylas_list_threads=d;
@@ -1,70 +0,0 @@
1
- import { r as m, c as u, d as n, h as a, a as h, b as y, H as f } from "./index-a282e817.js";
2
- import { R as b } from "./register-component-a7ea27ad-fa2c4b17.js";
3
- import "react";
4
- import "react-dom";
5
- const v = ':host{display:block;font-size:var(--nylas-font-size, inherit);font-family:var(--nylas-font-family, inherit)}.list-thread{display:grid;grid-auto-flow:row;color:var(--nylas-color-primary-800);width:100%}.thread{position:relative;width:100%;display:grid;padding:0.5rem 1rem;column-gap:0.25rem;grid-template-areas:"........ from count ....... date actions" "checkbox subject subject subject subject actions" "........ snippet snippet snippet snippet actions";grid-template-columns:auto auto auto auto auto auto;margin-bottom:0.75rem;border-radius:var(--nylas-border-radius-2x);color:var(--nylas-color-primary-00);background-color:var(--nylas-color-primary-50);border:0;box-sizing:border-box;text-align:left;cursor:pointer;box-shadow:1px 1px 3px 0px rgba(0, 0, 0, 0.3);font-size:inherit;font-family:inherit}.thread.loading{animation:pulsate 1.5s infinite ease-in-out;width:100%;height:90px}.thread:last-of-type{margin-bottom:0}.thread.selected{box-shadow:0 2px 0 0 var(--nylas-color-primary-200);background-color:var(--nylas-color-primary-100)}.thread:hover{box-shadow:0 2px 0 0 var(--nylas-color-primary-200);background-color:var(--nylas-color-primary-100)}.thread>div{align-self:center;pointer-events:all !important}.thread .actions{grid-area:actions}.thread .actions sp-action-menu{pointer-events:initial !important}.thread .actions sp-action-button{pointer-events:initial !important}.thread .actions sp-menu-item{pointer-events:initial !important}.thread .checkbox{grid-area:checkbox;margin-right:0.5rem;pointer-events:initial !important}.thread .checkbox sp-checkbox{pointer-events:initial !important}.thread .star{grid-area:star;justify-self:end}.thread .from{grid-area:from;color:var(--nylas-color-primary-600)}.thread .count{grid-area:count;color:var(--nylas-color-primary-600)}.thread .subject{grid-area:subject;color:var(--nylas-color-primary-600)}.thread .snippet{grid-area:snippet;color:var(--nylas-color-primary-500)}.thread .date{grid-area:date;align-self:center;color:var(--nylas-color-primary-500)}.thread.unread .from,.thread.unread .count,.thread.unread .subject,.thread.unread .date{font-weight:600;color:var(--nylas-color-primary-800)}.thread.unread .snippet{color:var(--nylas-color-primary-700)}.thread .from{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.thread .snippet{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.thread .subject{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}@media only screen and (min-width: 768px){.thread{column-gap:1rem;grid-template-areas:"checkbox from count subject snippet date actions";grid-template-columns:auto minmax(auto, 200px) auto auto 1fr auto auto;margin-bottom:0.5rem;border:1px solid var(--nylas-color-primary-100)}.thread.no-checkbox{grid-template-areas:"from count subject snippet date actions";grid-template-columns:minmax(auto, 200px) auto auto 1fr auto auto}.thread .checkbox{margin-right:0}}@keyframes pulsate{0%{background-color:var(--nylas-color-primary-50)}50%{background-color:var(--nylas-color-primary-100)}100%{background-color:var(--nylas-color-primary-50)}}', g = v;
6
- var x = function(e, t, r, i) {
7
- var s = arguments.length, o = s < 3 ? t : i === null ? i = Object.getOwnPropertyDescriptor(t, r) : i, l;
8
- if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
9
- o = Reflect.decorate(e, t, r, i);
10
- else
11
- for (var c = e.length - 1; c >= 0; c--)
12
- (l = e[c]) && (o = (s < 3 ? l(o) : s > 3 ? l(t, r, o) : l(t, r)) || o);
13
- return s > 3 && o && Object.defineProperty(t, r, o), o;
14
- }, d = function(e, t) {
15
- if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
16
- return Reflect.metadata(e, t);
17
- };
18
- const p = class {
19
- constructor(e) {
20
- m(this, e), this.threadSelected = u(this, "threadSelected", 7), this.handleThreadSelected = async (t) => {
21
- n("[nylas-list-threads] Thread selected", { thread: t }), this.threadSelected.emit(t).defaultPrevented || n("[nylas-list-threads] Default event not prevented, selecting thread");
22
- }, this.handleCheckboxClick = async (t) => {
23
- n("[nylas-list-threads] Checkbox clicked", { event: t }), t.stopPropagation();
24
- }, this.threads = [], this.isAuthenticated = !1, this.tokenInfo = void 0, this.state = "ready", this.showCheckbox = !1;
25
- }
26
- connectedCallback() {
27
- }
28
- disconnectedCallback() {
29
- }
30
- async componentWillLoad() {
31
- n("[nylas-list-threads] Component will load");
32
- }
33
- async componentDidLoad() {
34
- n("[nylas-list-threads] Component did load", { isAuthenticated: this.isAuthenticated });
35
- }
36
- render() {
37
- return a(f, { key: "4446ea8b3e63f5843e6c727d24d28bf5858488cd" }, a("div", { key: "c52ddd731313c17f7030f9c42bda1a6285e65203", class: "list-thread", part: "list-thread" }, this.state === "loading" && new Array(10).fill(0).map((e, t) => a("div", { class: "thread loading", style: { animationDelay: `${t * 20}ms` } })), this.state === "ready" && this.threads.map((e) => {
38
- var t, r, i, s;
39
- return a("button", { key: e == null ? void 0 : e.id, class: {
40
- thread: !0,
41
- unread: (e == null ? void 0 : e.unread) === !0,
42
- "no-checkbox": this.showCheckbox === !1
43
- }, part: "thread", "aria-label": `Thread with subject ${e == null ? void 0 : e.subject}`, onClick: () => this.handleThreadSelected(e) }, this.showCheckbox && a("div", { class: "checkbox", part: "checkbox" }, a("sp-checkbox", { size: "s", value: e == null ? void 0 : e.id, onClick: this.handleCheckboxClick })), a("div", { class: "from", part: "from" }, h(e.participants ?? [], (t = this.tokenInfo) == null ? void 0 : t.email, ((r = e == null ? void 0 : e.message_ids) == null ? void 0 : r.length) || 1, 1)), a("div", { class: "subject", part: "subject" }, e == null ? void 0 : e.subject), a("div", { class: "count", part: "count" }, ((i = e == null ? void 0 : e.message_ids) == null ? void 0 : i.length) || 1), a("div", { class: "snippet", part: "snippet" }, (s = e == null ? void 0 : e.snippet) == null ? void 0 : s.trim()), e.latest_message_received_date && a("div", { class: "date", "aria-label": `${Intl.DateTimeFormat(void 0, { dateStyle: "full" }).format(new Date(e.latest_message_received_date * 1e3))}`, part: "date" }, y(e.latest_message_received_date)));
44
- })));
45
- }
46
- };
47
- x([
48
- b({
49
- name: "nylas-list-threads",
50
- stateToProps: /* @__PURE__ */ new Map([
51
- ["auth.isAuthenticated", "isAuthenticated"],
52
- ["auth.tokenInfo", "tokenInfo"],
53
- ["mailbox.threads", "threads"],
54
- ["mailbox.state", "state"]
55
- ]),
56
- eventToProps: {
57
- threadSelected: async (e, t) => {
58
- n("[nylas-list-threads] Thread selected", { event: e }), await t.threads.selectThread(e.detail);
59
- }
60
- },
61
- fireRegisterEvent: !0
62
- }),
63
- d("design:type", Function),
64
- d("design:paramtypes", []),
65
- d("design:returntype", void 0)
66
- ], p.prototype, "render", null);
67
- p.style = g;
68
- export {
69
- p as nylas_list_threads
70
- };
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-11f33e47.cjs"),d=require("./register-component-a7ea27ad-2343f3df.cjs");require("react");require("react-dom");const g=":host{display:contents}.container{height:var(--container-height, 100dvh);overflow-y:var(--container-overflow-y, auto)}.pagination{display:flex;justify-content:center;align-items:center;margin:0 auto;padding:0;list-style:none;font-size:0.875rem;font-weight:600;color:var(--nylas-color-primary-600)}.pagination sp-button svg{animation:rotate 1s linear infinite}sp-button{border-radius:var(--nylas-border-radius);background-color:var(--nylas-color-primary-400);color:var(--nylas-color-primary-900);fill:var(--nylas-color-primary-900)}sp-button:hover{background-color:var(--nylas-color-primary-500)}sp-button:disabled{background-color:var(--nylas-color-primary-200);color:var(--nylas-color-primary-600);cursor:not-allowed}sp-button chevron-icon svg{width:15px;height:15px}.next chevron-icon{transform:rotate(180deg)}@keyframes rotate{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}",p=g;var u=function(t,n,i,a){var r=arguments.length,o=r<3?n:a===null?a=Object.getOwnPropertyDescriptor(n,i):a,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,n,i,a);else for(var l=t.length-1;l>=0;l--)(s=t[l])&&(o=(r<3?s(o):r>3?s(n,i,o):s(n,i))||o);return r>3&&o&&Object.defineProperty(n,i,o),o},h=function(t,n){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,n)};const c=class{constructor(t){e.registerInstance(this,t),this.next=e.createEvent(this,"next",7),this.previous=e.createEvent(this,"previous",7),this.state="ready",this.hasNextPage=!1,this.hasPreviousPage=!1,this.scrollTarget="container",this.mobileOnlyInfiniteScroll=!0,this.mobileViewPortWidth=768,e.debug("[nylas-pagination] Constructed"),this.isScrollAtContainerBottom=this.isScrollAtContainerBottom.bind(this),this.isScrollAtPageBottom=this.isScrollAtPageBottom.bind(this),this.nextPage=this.nextPage.bind(this),this.previousPage=this.previousPage.bind(this),this.handlePageScroll=this.handlePageScroll.bind(this),this.handleContainerScroll=this.handleContainerScroll.bind(this)}connectedCallback(){e.debug("[nylas-pagination] Component connected")}async componentWillLoad(){e.debug("[nylas-pagination] Component will load")}async componentDidLoad(){e.debug("[nylas-pagination] Component did load"),this.containerElement&&this.containerElement.addEventListener("scroll",this.handleContainerScroll)}async componentWillRender(){e.debug("[nylas-pagination] Component will render")}disconnectedCallback(){e.debug("[nylas-pagination] Component disconnected"),this.containerElement&&this.containerElement.removeEventListener("scroll",this.handleContainerScroll)}handlePageScroll(t){this.isScrollAtPageBottom()&&this.canScroll&&this.scrollTarget==="page"&&this.nextPage()}async nextPage(){const t=this.host.children.length>0;this.next.emit({hasChildren:t})}async previousPage(){const t=this.host.children.length>0;this.previous.emit({hasChildren:t})}handleContainerScroll(t){this.isScrollAtContainerBottom()&&this.canScroll&&this.scrollTarget==="container"&&this.nextPage()}isScrollAtContainerBottom(){return this.containerElement?this.containerElement&&this.containerElement.scrollTop+this.containerElement.clientHeight>=this.containerElement.scrollHeight:!1}isScrollAtPageBottom(){return window.innerHeight+window.scrollY>=document.body.offsetHeight}get canScroll(){const t=this.host.children.length>0;return this.state==="ready"&&t&&(!this.mobileOnlyInfiniteScroll||window.innerWidth<this.mobileViewPortWidth)}render(){return this.host.children.length>0?e.h(e.Host,null,e.h("div",{class:"container",ref:n=>this.containerElement=n},e.h("slot",null),this.canScroll&&e.h("div",{class:"pagination"},e.h("sp-theme",{scale:"medium",color:"dark"},this.state==="ready"&&this.hasNextPage&&e.h("sp-button",{onClick:this.nextPage},e.h("div",{slot:"icon"},e.h("refresh-icon",{class:"refres-icon"}))," ","Load more..."))))):e.h(e.Host,null,e.h("sp-theme",{scale:"medium",color:"dark"},this.hasPreviousPage&&e.h("sp-button",{class:"previous",parr:"previous",onClick:this.previousPage},e.h("div",{slot:"icon"},e.h("chevron-icon",{class:"previous-icon"}))," ","Previous"),this.hasPreviousPage&&this.hasNextPage&&" ",this.hasNextPage&&e.h("sp-button",{class:"next",parr:"next",onClick:this.nextPage},e.h("div",{slot:"icon"},e.h("chevron-icon",{class:"next-icon"}))," ","Next")))}get host(){return e.getElement(this)}};u([d.RegisterComponent({name:"nylas-pagination",stateToProps:new Map([["mailbox.hasNextThreadPage","hasNextPage"],["mailbox.hasPreviousThreadPage","hasPreviousPage"],["mailbox.state","state"]]),eventToProps:{next:async(t,n)=>{e.debug("[nylas-pagination] Next page event fired");const{hasChildren:i}=t.detail;await n.threads.nextThreadPage(i?"append":"overwrite",!i)},previous:async(t,n)=>{e.debug("[nylas-pagination] Previous page event fired");const{hasChildren:i}=t.detail;await n.threads.previousThreadPage(i?"append":"overwrite",!i)}},fireRegisterEvent:!0}),h("design:type",Function),h("design:paramtypes",[]),h("design:returntype",void 0)],c.prototype,"render",null);c.style=p;exports.nylas_mailbox_pagination=c;
@@ -1,101 +0,0 @@
1
- import { r as m, c as d, d as a, h as e, H as p, g as u } from "./index-a282e817.js";
2
- import { R as v } from "./register-component-a7ea27ad-fa2c4b17.js";
3
- import "react";
4
- import "react-dom";
5
- const y = ":host{display:contents}.container{height:var(--container-height, 100dvh);overflow-y:var(--container-overflow-y, auto)}.pagination{display:flex;justify-content:center;align-items:center;margin:0 auto;padding:0;list-style:none;font-size:0.875rem;font-weight:600;color:var(--nylas-color-primary-600)}.pagination sp-button svg{animation:rotate 1s linear infinite}sp-button{border-radius:var(--nylas-border-radius);background-color:var(--nylas-color-primary-400);color:var(--nylas-color-primary-900);fill:var(--nylas-color-primary-900)}sp-button:hover{background-color:var(--nylas-color-primary-500)}sp-button:disabled{background-color:var(--nylas-color-primary-200);color:var(--nylas-color-primary-600);cursor:not-allowed}sp-button chevron-icon svg{width:15px;height:15px}.next chevron-icon{transform:rotate(180deg)}@keyframes rotate{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}", f = y;
6
- var P = function(t, n, i, s) {
7
- var r = arguments.length, o = r < 3 ? n : s === null ? s = Object.getOwnPropertyDescriptor(n, i) : s, l;
8
- if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
9
- o = Reflect.decorate(t, n, i, s);
10
- else
11
- for (var c = t.length - 1; c >= 0; c--)
12
- (l = t[c]) && (o = (r < 3 ? l(o) : r > 3 ? l(n, i, o) : l(n, i)) || o);
13
- return r > 3 && o && Object.defineProperty(n, i, o), o;
14
- }, h = function(t, n) {
15
- if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
16
- return Reflect.metadata(t, n);
17
- };
18
- const g = class {
19
- constructor(t) {
20
- m(this, t), this.next = d(this, "next", 7), this.previous = d(this, "previous", 7), this.state = "ready", this.hasNextPage = !1, this.hasPreviousPage = !1, this.scrollTarget = "container", this.mobileOnlyInfiniteScroll = !0, this.mobileViewPortWidth = 768, a("[nylas-pagination] Constructed"), this.isScrollAtContainerBottom = this.isScrollAtContainerBottom.bind(this), this.isScrollAtPageBottom = this.isScrollAtPageBottom.bind(this), this.nextPage = this.nextPage.bind(this), this.previousPage = this.previousPage.bind(this), this.handlePageScroll = this.handlePageScroll.bind(this), this.handleContainerScroll = this.handleContainerScroll.bind(this);
21
- }
22
- connectedCallback() {
23
- a("[nylas-pagination] Component connected");
24
- }
25
- async componentWillLoad() {
26
- a("[nylas-pagination] Component will load");
27
- }
28
- async componentDidLoad() {
29
- a("[nylas-pagination] Component did load"), this.containerElement && this.containerElement.addEventListener("scroll", this.handleContainerScroll);
30
- }
31
- async componentWillRender() {
32
- a("[nylas-pagination] Component will render");
33
- }
34
- disconnectedCallback() {
35
- a("[nylas-pagination] Component disconnected"), this.containerElement && this.containerElement.removeEventListener("scroll", this.handleContainerScroll);
36
- }
37
- handlePageScroll(t) {
38
- this.isScrollAtPageBottom() && this.canScroll && this.scrollTarget === "page" && this.nextPage();
39
- }
40
- async nextPage() {
41
- const t = this.host.children.length > 0;
42
- this.next.emit({
43
- hasChildren: t
44
- });
45
- }
46
- async previousPage() {
47
- const t = this.host.children.length > 0;
48
- this.previous.emit({
49
- hasChildren: t
50
- });
51
- }
52
- handleContainerScroll(t) {
53
- this.isScrollAtContainerBottom() && this.canScroll && this.scrollTarget === "container" && this.nextPage();
54
- }
55
- isScrollAtContainerBottom() {
56
- return this.containerElement ? this.containerElement && this.containerElement.scrollTop + this.containerElement.clientHeight >= this.containerElement.scrollHeight : !1;
57
- }
58
- isScrollAtPageBottom() {
59
- return window.innerHeight + window.scrollY >= document.body.offsetHeight;
60
- }
61
- get canScroll() {
62
- const t = this.host.children.length > 0;
63
- return this.state === "ready" && t && (!this.mobileOnlyInfiniteScroll || window.innerWidth < this.mobileViewPortWidth);
64
- }
65
- render() {
66
- return this.host.children.length > 0 ? e(p, null, e("div", { class: "container", ref: (n) => this.containerElement = n }, e("slot", null), this.canScroll && e("div", { class: "pagination" }, e("sp-theme", { scale: "medium", color: "dark" }, this.state === "ready" && this.hasNextPage && e("sp-button", { onClick: this.nextPage }, e("div", { slot: "icon" }, e("refresh-icon", { class: "refres-icon" })), " ", "Load more..."))))) : e(p, null, e("sp-theme", { scale: "medium", color: "dark" }, this.hasPreviousPage && e("sp-button", { class: "previous", parr: "previous", onClick: this.previousPage }, e("div", { slot: "icon" }, e("chevron-icon", { class: "previous-icon" })), " ", "Previous"), this.hasPreviousPage && this.hasNextPage && " ", this.hasNextPage && e("sp-button", { class: "next", parr: "next", onClick: this.nextPage }, e("div", { slot: "icon" }, e("chevron-icon", { class: "next-icon" })), " ", "Next")));
67
- }
68
- get host() {
69
- return u(this);
70
- }
71
- };
72
- P([
73
- v({
74
- name: "nylas-pagination",
75
- stateToProps: /* @__PURE__ */ new Map([
76
- ["mailbox.hasNextThreadPage", "hasNextPage"],
77
- ["mailbox.hasPreviousThreadPage", "hasPreviousPage"],
78
- ["mailbox.state", "state"]
79
- ]),
80
- eventToProps: {
81
- next: async (t, n) => {
82
- a("[nylas-pagination] Next page event fired");
83
- const { hasChildren: i } = t.detail;
84
- await n.threads.nextThreadPage(i ? "append" : "overwrite", !i);
85
- },
86
- previous: async (t, n) => {
87
- a("[nylas-pagination] Previous page event fired");
88
- const { hasChildren: i } = t.detail;
89
- await n.threads.previousThreadPage(i ? "append" : "overwrite", !i);
90
- }
91
- },
92
- fireRegisterEvent: !0
93
- }),
94
- h("design:type", Function),
95
- h("design:paramtypes", []),
96
- h("design:returntype", void 0)
97
- ], g.prototype, "render", null);
98
- g.style = f;
99
- export {
100
- g as nylas_mailbox_pagination
101
- };
@@ -1,82 +0,0 @@
1
- import { r as y, d as c, h as l, H as u, g as b } from "./index-a282e817.js";
2
- import { R as m } from "./register-component-a7ea27ad-fa2c4b17.js";
3
- import "react";
4
- import "react-dom";
5
- const h = ":host{display:block}sp-button{border-radius:var(--nylas-border-radius);background-color:var(--nylas-color-primary-400);color:var(--nylas-color-primary-900);fill:var(--nylas-color-primary-900)}sp-button:hover{background-color:var(--nylas-color-primary-500)}sp-button:disabled{background-color:var(--nylas-color-primary-200);color:var(--nylas-color-primary-600);cursor:not-allowed}", p = h;
6
- var g = function(t, o, e, n) {
7
- var r = arguments.length, a = r < 3 ? o : n === null ? n = Object.getOwnPropertyDescriptor(o, e) : n, s;
8
- if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
9
- a = Reflect.decorate(t, o, e, n);
10
- else
11
- for (var i = t.length - 1; i >= 0; i--)
12
- (s = t[i]) && (a = (r < 3 ? s(a) : r > 3 ? s(o, e, a) : s(o, e)) || a);
13
- return r > 3 && a && Object.defineProperty(o, e, a), a;
14
- }, d = function(t, o) {
15
- if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
16
- return Reflect.metadata(t, o);
17
- };
18
- const f = class {
19
- constructor(t) {
20
- y(this, t), this.onClick = async () => {
21
- const o = this.method;
22
- if (c("[nylas-mailbox-toolbar-button] onClick", { method: o, mailboxConnector: this.mailboxConnector }), this.mailboxConnector && o) {
23
- const e = this.callMethod(this.mailboxConnector, o);
24
- e && await e();
25
- }
26
- }, this.method = void 0, this.dataState = void 0, this.iconOnly = !1, this.mailboxConnector = void 0;
27
- }
28
- connectedCallback() {
29
- }
30
- disconnectedCallback() {
31
- }
32
- async componentWillLoad() {
33
- c("[nylas-if-state] Component will load");
34
- }
35
- async componentDidLoad() {
36
- c("[nylas-if-state] Component did load");
37
- }
38
- callMethod(t, o) {
39
- const e = o.split(".");
40
- let n = t;
41
- for (const s of e.slice(0, -1))
42
- if (n = n[s], !n)
43
- return;
44
- const r = e[e.length - 1], a = n[r];
45
- if (typeof a == "function")
46
- return a.bind(n);
47
- }
48
- renderByState(t) {
49
- return t ? l("slot", { name: "loading" }, "Loading...") : l("slot", null, "Click");
50
- }
51
- hasSlot(t) {
52
- return !!this.host.querySelector(`[slot="${t}"]`);
53
- }
54
- render() {
55
- var n;
56
- let t = !1;
57
- const o = (n = this.mailboxConnector) == null ? void 0 : n.nylasMailboxStore;
58
- if (typeof o < "u") {
59
- const r = String(this.dataState);
60
- t = this.dataState ? o.get(r) === "loading" : !1;
61
- }
62
- const e = t ? "state-loading" : "state-ready";
63
- return l(u, { key: "0dc0623c7768935757a124c668daac32b7093e1f" }, l("sp-theme", { key: "ff113301775da75e8cf314faa4c1db328dfa2373", 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))));
64
- }
65
- get host() {
66
- return b(this);
67
- }
68
- };
69
- g([
70
- m({
71
- name: "nylas-mailbox-toolbar-button",
72
- connectorToProp: "mailboxConnector",
73
- fireRegisterEvent: !0
74
- }),
75
- d("design:type", Function),
76
- d("design:paramtypes", []),
77
- d("design:returntype", void 0)
78
- ], f.prototype, "render", null);
79
- f.style = p;
80
- export {
81
- f as nylas_mailbox_toolbar_button
82
- };
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./index-11f33e47.cjs"),u=require("./register-component-a7ea27ad-2343f3df.cjs");require("react");require("react-dom");const y=":host{display:block}sp-button{border-radius:var(--nylas-border-radius);background-color:var(--nylas-color-primary-400);color:var(--nylas-color-primary-900);fill:var(--nylas-color-primary-900)}sp-button:hover{background-color:var(--nylas-color-primary-500)}sp-button:disabled{background-color:var(--nylas-color-primary-200);color:var(--nylas-color-primary-600);cursor:not-allowed}",b=y;var f=function(t,o,e,n){var l=arguments.length,r=l<3?o:n===null?n=Object.getOwnPropertyDescriptor(o,e):n,i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(t,o,e,n);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(r=(l<3?i(r):l>3?i(o,e,r):i(o,e))||r);return l>3&&r&&Object.defineProperty(o,e,r),r},c=function(t,o){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,o)};const d=class{constructor(t){a.registerInstance(this,t),this.onClick=async()=>{const o=this.method;if(a.debug("[nylas-mailbox-toolbar-button] onClick",{method:o,mailboxConnector:this.mailboxConnector}),this.mailboxConnector&&o){const e=this.callMethod(this.mailboxConnector,o);e&&await e()}},this.method=void 0,this.dataState=void 0,this.iconOnly=!1,this.mailboxConnector=void 0}connectedCallback(){}disconnectedCallback(){}async componentWillLoad(){a.debug("[nylas-if-state] Component will load")}async componentDidLoad(){a.debug("[nylas-if-state] Component did load")}callMethod(t,o){const e=o.split(".");let n=t;for(const i of e.slice(0,-1))if(n=n[i],!n)return;const l=e[e.length-1],r=n[l];if(typeof r=="function")return r.bind(n)}renderByState(t){return t?a.h("slot",{name:"loading"},"Loading..."):a.h("slot",null,"Click")}hasSlot(t){return!!this.host.querySelector(`[slot="${t}"]`)}render(){var n;let t=!1;const o=(n=this.mailboxConnector)==null?void 0:n.nylasMailboxStore;if(typeof o<"u"){const l=String(this.dataState);t=this.dataState?o.get(l)==="loading":!1}const e=t?"state-loading":"state-ready";return a.h(a.Host,{key:"0dc0623c7768935757a124c668daac32b7093e1f"},a.h("sp-theme",{key:"ff113301775da75e8cf314faa4c1db328dfa2373",scale:"medium",color:"dark"},a.h("sp-button",{onClick:this.onClick,disabled:t,key:e,"icon-only":this.iconOnly,label:this.renderByState(t)},this.hasSlot("icon")&&a.h("div",{slot:"icon",class:"slot"},a.h("slot",{name:"icon"})),!this.iconOnly&&this.renderByState(t))))}get host(){return a.getElement(this)}};f([u.RegisterComponent({name:"nylas-mailbox-toolbar-button",connectorToProp:"mailboxConnector",fireRegisterEvent:!0}),c("design:type",Function),c("design:paramtypes",[]),c("design:returntype",void 0)],d.prototype,"render",null);d.style=b;exports.nylas_mailbox_toolbar_button=d;
@@ -1,134 +0,0 @@
1
- import { r as p, c as l, d as S, h as f, H as M, g as _ } from "./index-a282e817.js";
2
- import { N as v, e as w } from "./index.es-ab9affcc-30461b18.js";
3
- import { C as P, a as N, H as I, N as E, b as L, c as O, d as R } from "./mailbox-store-affca6de-d601dc6b.js";
4
- import "react";
5
- import "react-dom";
6
- class T {
7
- constructor(e, s, o, i) {
8
- this.router = e, this.nylasAuth = s, this.nylasAuthStore = o, this.nylasMailboxStore = i;
9
- }
10
- init() {
11
- S("NylasMailboxConnector init");
12
- }
13
- get mailboxStore() {
14
- return this.nylasMailboxStore;
15
- }
16
- get authStore() {
17
- return this.nylasAuthStore;
18
- }
19
- get auth() {
20
- return this._authConnector ? this._authConnector : (this._authConnector = new E(this.nylasAuth, this.nylasAuthStore), this._authConnector);
21
- }
22
- get threads() {
23
- return this._threadConnector ? this._threadConnector : (this._threadConnector = new L(this.nylasAuth, this.nylasAuthStore, this.nylasMailboxStore, this.router), this._threadConnector);
24
- }
25
- get messages() {
26
- return this._messageConnector ? this._messageConnector : (this._messageConnector = new O(this.nylasAuth, this.nylasAuthStore, this.nylasMailboxStore), this._messageConnector);
27
- }
28
- get folders() {
29
- return this._foldersConnector ? this._foldersConnector : (this._foldersConnector = new R(this.nylasAuth, this.nylasAuthStore, this.nylasMailboxStore), this._foldersConnector);
30
- }
31
- getAuth() {
32
- return this.nylasAuth;
33
- }
34
- resetStores() {
35
- this.nylasMailboxStore.reset(), this.nylasAuthStore.reset();
36
- }
37
- async logout() {
38
- await this.nylasAuth.logout(), this.resetStores();
39
- }
40
- }
41
- const H = ":host{display:contents}", k = H, D = class {
42
- constructor(t) {
43
- p(this, t), this.init = l(this, "init", 7), this.loggedIn = l(this, "loggedIn", 7), this.loggedOut = l(this, "loggedOut", 7), this.handleAuthChange = async (e) => {
44
- var s;
45
- e ? this.loggedIn.emit(this.host) : this.loggedOut.emit(this.host).defaultPrevented || await ((s = this.nylasMailboxConnector) == null ? void 0 : s.logout());
46
- }, this.automaticComponentRegistration = !0, this.eventOverrides = {}, this.authConfig = void 0, this.defaultAuthStoreState = void 0, this.defaultMailboxStoreState = void 0;
47
- }
48
- connectedCallback() {
49
- S("[nylas-mailbox] connectedCallback");
50
- }
51
- async componentWillLoad() {
52
- var o, i, d, u, c, y, g;
53
- this.stores = {
54
- auth: P(this.defaultAuthStoreState),
55
- mailbox: N(this.defaultMailboxStoreState)
56
- }, this.baseProvider = new v(this.host, this.stores, this.automaticComponentRegistration, this.eventOverrides), this.router = new I(), this.nylasAuth = w({
57
- apiUri: "https://api.us.nylas.com",
58
- elementsApiUri: "https://elements.us.nylas.com",
59
- storageType: "indexeddb",
60
- clientId: "YOUR_CLIENT_ID",
61
- defaultScopes: [],
62
- redirectURI: "/",
63
- ...this.authConfig
64
- });
65
- const t = (o = this.baseProvider) == null ? void 0 : o.getStore("auth");
66
- if (!t)
67
- throw new Error("Auth store is not defined");
68
- const e = (i = this.baseProvider) == null ? void 0 : i.getStore("mailbox");
69
- if (!e)
70
- throw new Error("Mailbox store is not defined");
71
- this.nylasMailboxConnector = new T(this.router, this.nylasAuth, t, e), this.init.emit(this.host).defaultPrevented || await ((d = this.nylasMailboxConnector) == null ? void 0 : d.auth.validateSession()), (u = this.router) == null || u.addRouteChangeListener("/thread/:threadId", async (x, A, b) => {
72
- var a, r;
73
- const h = b.threadId, n = await ((a = this.nylasMailboxConnector) == null ? void 0 : a.threads.getThread(h));
74
- n && ((r = this.nylasMailboxConnector) == null || r.mailboxStore.set("selectedThread", n));
75
- }), (c = this.router) == null || c.addRouteChangeListener("/", async (x, A, b) => {
76
- var n, a, r, C;
77
- if (!t.state.isAuthenticated)
78
- return;
79
- (n = this.nylasMailboxConnector) == null || n.threads.unSelectThread(), (a = this.nylasMailboxConnector) == null || a.folders.getFolders();
80
- const h = window.location.hash.split("?")[1];
81
- if (h) {
82
- const m = new URLSearchParams(h).get("query");
83
- m && await ((r = this.nylasMailboxConnector) == null ? void 0 : r.threads.getThreads({
84
- search_query_native: m,
85
- page_token: void 0
86
- }));
87
- } else
88
- (C = this.nylasMailboxConnector) == null || C.threads.getThreads();
89
- }), (y = this.router) == null || y.init(), this.handleAuthChange(t.state.isAuthenticated), (g = this.baseProvider) == null || g.componentWillLoad(this.nylasMailboxConnector);
90
- }
91
- async componentDidLoad() {
92
- var e, s;
93
- const t = (e = this.baseProvider) == null ? void 0 : e.getStore("auth");
94
- if (!t)
95
- throw new Error("Auth store is not defined");
96
- t.onChange("isAuthenticated", this.handleAuthChange), (s = this.baseProvider) == null || s.componentDidLoad();
97
- }
98
- componentDisconnected() {
99
- var t;
100
- (t = this.baseProvider) == null || t.componentDisconnected();
101
- }
102
- async registerComponentHandler(t) {
103
- var e;
104
- (e = this.baseProvider) == null || e.registerComponent(t.detail);
105
- }
106
- async unregisterComponentHandler(t) {
107
- var e;
108
- (e = this.baseProvider) == null || e.unregisterComponent(t.detail);
109
- }
110
- async getMailboxStore() {
111
- var t;
112
- return (t = this.baseProvider) == null ? void 0 : t.getStore("mailbox");
113
- }
114
- async getAuthStore() {
115
- var t;
116
- return (t = this.baseProvider) == null ? void 0 : t.getStore("auth");
117
- }
118
- async getNylasAuth() {
119
- return this.nylasAuth;
120
- }
121
- async getNylasMailboxConnector() {
122
- return this.nylasMailboxConnector;
123
- }
124
- render() {
125
- return f(M, { key: "b7401a910fae3c9b11dfe6436d87ba51b16ed561" }, f("slot", { key: "e81d8b9bb9d973070fa20e604a4ac8865f0c29e8" }));
126
- }
127
- get host() {
128
- return _(this);
129
- }
130
- };
131
- D.style = k;
132
- export {
133
- D as nylas_mailbox
134
- };
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index-11f33e47.cjs"),m=require("./index.es-ab9affcc-18263b66.cjs"),n=require("./mailbox-store-affca6de-9451094e.cjs");require("react");require("react-dom");class v{constructor(e,o,r,l){this.router=e,this.nylasAuth=o,this.nylasAuthStore=r,this.nylasMailboxStore=l}init(){s.debug("NylasMailboxConnector init")}get mailboxStore(){return this.nylasMailboxStore}get authStore(){return this.nylasAuthStore}get auth(){return this._authConnector?this._authConnector:(this._authConnector=new n.NylasAuthConnector(this.nylasAuth,this.nylasAuthStore),this._authConnector)}get threads(){return this._threadConnector?this._threadConnector:(this._threadConnector=new n.NylasThreadsConnector(this.nylasAuth,this.nylasAuthStore,this.nylasMailboxStore,this.router),this._threadConnector)}get messages(){return this._messageConnector?this._messageConnector:(this._messageConnector=new n.NylasMessagesConnector(this.nylasAuth,this.nylasAuthStore,this.nylasMailboxStore),this._messageConnector)}get folders(){return this._foldersConnector?this._foldersConnector:(this._foldersConnector=new n.NylasFoldersConnector(this.nylasAuth,this.nylasAuthStore,this.nylasMailboxStore),this._foldersConnector)}getAuth(){return this.nylasAuth}resetStores(){this.nylasMailboxStore.reset(),this.nylasAuthStore.reset()}async logout(){await this.nylasAuth.logout(),this.resetStores()}}const _=":host{display:contents}",p=_,x=class{constructor(t){s.registerInstance(this,t),this.init=s.createEvent(this,"init",7),this.loggedIn=s.createEvent(this,"loggedIn",7),this.loggedOut=s.createEvent(this,"loggedOut",7),this.handleAuthChange=async e=>{var o;e?this.loggedIn.emit(this.host):this.loggedOut.emit(this.host).defaultPrevented||await((o=this.nylasMailboxConnector)==null?void 0:o.logout())},this.automaticComponentRegistration=!0,this.eventOverrides={},this.authConfig=void 0,this.defaultAuthStoreState=void 0,this.defaultMailboxStoreState=void 0}connectedCallback(){s.debug("[nylas-mailbox] connectedCallback")}async componentWillLoad(){var r,l,u,c,y,g,b;this.stores={auth:n.CreateNylasAuthStore(this.defaultAuthStoreState),mailbox:n.CreateNylasMailboxStore(this.defaultMailboxStoreState)},this.baseProvider=new m.NylasBaseProvider(this.host,this.stores,this.automaticComponentRegistration,this.eventOverrides),this.router=new n.HashRouter,this.nylasAuth=m.es({apiUri:"https://api.us.nylas.com",elementsApiUri:"https://elements.us.nylas.com",storageType:"indexeddb",clientId:"YOUR_CLIENT_ID",defaultScopes:[],redirectURI:"/",...this.authConfig});const t=(r=this.baseProvider)==null?void 0:r.getStore("auth");if(!t)throw new Error("Auth store is not defined");const e=(l=this.baseProvider)==null?void 0:l.getStore("mailbox");if(!e)throw new Error("Mailbox store is not defined");this.nylasMailboxConnector=new v(this.router,this.nylasAuth,t,e),this.init.emit(this.host).defaultPrevented||await((u=this.nylasMailboxConnector)==null?void 0:u.auth.validateSession()),(c=this.router)==null||c.addRouteChangeListener("/thread/:threadId",async(A,M,C)=>{var i,h;const d=C.threadId,a=await((i=this.nylasMailboxConnector)==null?void 0:i.threads.getThread(d));a&&((h=this.nylasMailboxConnector)==null||h.mailboxStore.set("selectedThread",a))}),(y=this.router)==null||y.addRouteChangeListener("/",async(A,M,C)=>{var a,i,h,S;if(!t.state.isAuthenticated)return;(a=this.nylasMailboxConnector)==null||a.threads.unSelectThread(),(i=this.nylasMailboxConnector)==null||i.folders.getFolders();const d=window.location.hash.split("?")[1];if(d){const f=new URLSearchParams(d).get("query");f&&await((h=this.nylasMailboxConnector)==null?void 0:h.threads.getThreads({search_query_native:f,page_token:void 0}))}else(S=this.nylasMailboxConnector)==null||S.threads.getThreads()}),(g=this.router)==null||g.init(),this.handleAuthChange(t.state.isAuthenticated),(b=this.baseProvider)==null||b.componentWillLoad(this.nylasMailboxConnector)}async componentDidLoad(){var e,o;const t=(e=this.baseProvider)==null?void 0:e.getStore("auth");if(!t)throw new Error("Auth store is not defined");t.onChange("isAuthenticated",this.handleAuthChange),(o=this.baseProvider)==null||o.componentDidLoad()}componentDisconnected(){var t;(t=this.baseProvider)==null||t.componentDisconnected()}async registerComponentHandler(t){var e;(e=this.baseProvider)==null||e.registerComponent(t.detail)}async unregisterComponentHandler(t){var e;(e=this.baseProvider)==null||e.unregisterComponent(t.detail)}async getMailboxStore(){var t;return(t=this.baseProvider)==null?void 0:t.getStore("mailbox")}async getAuthStore(){var t;return(t=this.baseProvider)==null?void 0:t.getStore("auth")}async getNylasAuth(){return this.nylasAuth}async getNylasMailboxConnector(){return this.nylasMailboxConnector}render(){return s.h(s.Host,{key:"b7401a910fae3c9b11dfe6436d87ba51b16ed561"},s.h("slot",{key:"e81d8b9bb9d973070fa20e604a4ac8865f0c29e8"}))}get host(){return s.getElement(this)}};x.style=p;exports.nylas_mailbox=x;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index-11f33e47.cjs"),g=require("./index.es-ab9affcc-18263b66.cjs"),o=require("./mailbox-store-affca6de-9451094e.cjs"),S=require("./scheduler-store-33ab8dea-a0b39d36.cjs"),f=require("./scheduler-config-store-2a3b403d-2263f999.cjs");require("react");require("react-dom");class b{constructor(t,r,n,i,l,h,a="https://api.us.nylas.com"){this.router=t,this.schedulerAPIURL=a,this.nylasAuth=r,this.nylasAuthStore=n,this.nylasMailboxStore=i,this.nylasSchedulerStore=l,this.nylasSchedulerConfigStore=h}init(){s.debug("NylasConnector init")}get authStore(){return this.nylasAuthStore}get mailboxStore(){return this.nylasMailboxStore}get schedulerStore(){return this.nylasSchedulerStore}get schedulerConfigStore(){return this.nylasSchedulerConfigStore}get auth(){return this._authConnector?this._authConnector:(this._authConnector=new o.NylasAuthConnector(this.nylasAuth,this.nylasAuthStore),this._authConnector)}get threads(){return this._threadConnector?this._threadConnector:(this._threadConnector=new o.NylasThreadsConnector(this.nylasAuth,this.nylasAuthStore,this.nylasMailboxStore,this.router),this._threadConnector)}get messages(){return this._messageConnector?this._messageConnector:(this._messageConnector=new o.NylasMessagesConnector(this.nylasAuth,this.nylasAuthStore,this.nylasMailboxStore),this._messageConnector)}get folders(){return this._foldersConnector?this._foldersConnector:(this._foldersConnector=new o.NylasFoldersConnector(this.nylasAuth,this.nylasAuthStore,this.nylasMailboxStore),this._foldersConnector)}get scheduler(){return this._schedulerAPIConnector?this._schedulerAPIConnector:(this._schedulerAPIConnector=new S.NylaSchedulerAPIConnector({schedulerAPIURL:this.schedulerAPIURL,schedulerStore:this.schedulerStore}),this._schedulerAPIConnector)}getAuth(){return this.nylasAuth}resetStores(){this.nylasAuthStore.reset(),this.nylasMailboxStore.reset()}async logout(){await this.nylasAuth.logout(),this.resetStores()}}const A=":host{display:contents}",m=A,C=class{constructor(e){s.registerInstance(this,e),this.init=s.createEvent(this,"init",7),this.loggedIn=s.createEvent(this,"loggedIn",7),this.loggedOut=s.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(){s.debug("[nylas-provider] connectedCallback")}async componentWillLoad(){var h,a,c,u,d,y;s.debug("[nylas-provider] componentWillLoad"),this.stores={auth:o.CreateNylasAuthStore(),mailbox:o.CreateNylasMailboxStore(),scheduler:S.CreateNylasSchedulerStore(),schedulerConfig:f.CreateNylasSchedulerConfigStore()},this.baseProvider=new g.NylasBaseProvider(this.host,this.stores,this.automaticComponentRegistration,this.eventOverrides);const e=new o.HashRouter;this.nylasAuth=g.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 r=(a=this.baseProvider)==null?void 0:a.getStore("auth");if(!r)throw new Error("The auth store is not set");const n=(c=this.baseProvider)==null?void 0:c.getStore("scheduler");if(!n)throw new Error("The scheduler store is not set");const i=(u=this.baseProvider)==null?void 0:u.getStore("schedulerConfig");if(!i)throw new Error("The scheduler config store is not set");this.nylasConnector=new b(e,this.nylasAuth,r,t,n,i),this.init.emit(this.host).defaultPrevented||await((d=this.nylasConnector)==null?void 0:d.auth.validateSession()),this.handleAuthChange(r.state.isAuthenticated),(y=this.baseProvider)==null||y.componentWillLoad(this.nylasConnector)}componentDidLoad(){var t,r;const e=(t=this.baseProvider)==null?void 0:t.getStore("auth");e==null||e.onChange("isAuthenticated",this.handleAuthChange),(r=this.baseProvider)==null||r.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 s.h(s.Host,{key:"b5a19414ce778855c2912513f65fc8835fd0fc61"},s.h("slot",{key:"9767add14ed9be96d43296ff7f1f872dc3276817"}))}get host(){return s.getElement(this)}};C.style=m;exports.nylas_provider=C;