@burdenoff/microfe-integrations 2026.1107.2 → 2026.1109.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dev/main.d.ts +0 -2
- package/dist/generated/global-operations.d.ts +4 -2
- package/dist/generated/global-types.d.ts +2 -22
- package/dist/generated/wspace-operations.d.ts +995 -705
- package/dist/generated/wspace-operations.js +180 -167
- package/dist/generated/wspace-operations.js.map +1 -1
- package/dist/generated/wspace-types.d.ts +4 -24
- package/dist/generated/wspace-types.js +1 -2
- package/dist/generated/wspace-types.js.map +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/integrations/ConnectSourceDialog.d.ts +0 -2
- package/dist/integrations/ConnectSourceDialog.js +13 -14
- package/dist/integrations/ConnectSourceDialog.js.map +1 -1
- package/dist/integrations/ConnectionsPanel.d.ts +0 -2
- package/dist/integrations/ConnectionsPanel.js +5 -6
- package/dist/integrations/ConnectionsPanel.js.map +1 -1
- package/dist/integrations/IntegrationsAdminRoot.d.ts +0 -2
- package/dist/integrations/IntegrationsAdminRoot.js +14 -11
- package/dist/integrations/IntegrationsAdminRoot.js.map +1 -1
- package/dist/integrations/IntegrationsAdminRoutes.d.ts +1 -2
- package/dist/integrations/IntegrationsAdminRoutes.js +1 -2
- package/dist/integrations/IntegrationsAdminRoutes.js.map +1 -1
- package/dist/integrations/IntegrationsRoot.d.ts +0 -2
- package/dist/integrations/IntegrationsRoot.js +9 -6
- package/dist/integrations/IntegrationsRoot.js.map +1 -1
- package/dist/integrations/IntegrationsUserRoutes.d.ts +1 -2
- package/dist/integrations/IntegrationsUserRoutes.js +7 -8
- package/dist/integrations/IntegrationsUserRoutes.js.map +1 -1
- package/dist/integrations/components/AddConnectionDialog.d.ts +1 -3
- package/dist/integrations/components/AddConnectionDialog.js +12 -15
- package/dist/integrations/components/AddConnectionDialog.js.map +1 -1
- package/dist/integrations/components/AuthMethodsEditor.d.ts +0 -2
- package/dist/integrations/components/AuthMethodsEditor.js +1 -2
- package/dist/integrations/components/AuthMethodsEditor.js.map +1 -1
- package/dist/integrations/components/ConfirmDialog.d.ts +1 -3
- package/dist/integrations/components/ConfirmDialog.js +1 -2
- package/dist/integrations/components/ConfirmDialog.js.map +1 -1
- package/dist/integrations/components/ConnectionCard.d.ts +0 -2
- package/dist/integrations/components/ConnectionCard.js +9 -10
- package/dist/integrations/components/ConnectionCard.js.map +1 -1
- package/dist/integrations/components/ConnectionModalFrame.d.ts +0 -2
- package/dist/integrations/components/ConnectionModalFrame.js +2 -3
- package/dist/integrations/components/ConnectionModalFrame.js.map +1 -1
- package/dist/integrations/components/ConnectionSharing.d.ts +0 -2
- package/dist/integrations/components/ConnectionSharing.js +7 -8
- package/dist/integrations/components/ConnectionSharing.js.map +1 -1
- package/dist/integrations/components/ConnectionStatusBadge.d.ts +0 -2
- package/dist/integrations/components/ConnectionStatusBadge.js +1 -2
- package/dist/integrations/components/ConnectionStatusBadge.js.map +1 -1
- package/dist/integrations/components/ConnectorSubmissionCard.d.ts +2 -4
- package/dist/integrations/components/ConnectorSubmissionCard.js +8 -9
- package/dist/integrations/components/ConnectorSubmissionCard.js.map +1 -1
- package/dist/integrations/components/ConnectorSubmissionPager.d.ts +1 -2
- package/dist/integrations/components/ConnectorSubmissionPager.js +1 -2
- package/dist/integrations/components/ConnectorSubmissionPager.js.map +1 -1
- package/dist/integrations/components/MailMessageBody.d.ts +1 -3
- package/dist/integrations/components/MailMessageBody.js +4 -5
- package/dist/integrations/components/MailMessageBody.js.map +1 -1
- package/dist/integrations/components/ProviderCard.d.ts +0 -2
- package/dist/integrations/components/ProviderCard.js +8 -9
- package/dist/integrations/components/ProviderCard.js.map +1 -1
- package/dist/integrations/constants/featureFlags.d.ts +0 -1
- package/dist/integrations/constants/featureFlags.js +1 -2
- package/dist/integrations/constants/featureFlags.js.map +1 -1
- package/dist/integrations/constants/permissions.d.ts +0 -1
- package/dist/integrations/constants/permissions.js +1 -2
- package/dist/integrations/constants/permissions.js.map +1 -1
- package/dist/integrations/events/integrations-events.d.ts +0 -1
- package/dist/integrations/events/useIntegrationsEventBus.d.ts +0 -2
- package/dist/integrations/events/useIntegrationsEventBus.js +1 -2
- package/dist/integrations/events/useIntegrationsEventBus.js.map +1 -1
- package/dist/integrations/hooks/useConnections.d.ts +3 -14
- package/dist/integrations/hooks/useConnections.js +74 -75
- package/dist/integrations/hooks/useConnections.js.map +1 -1
- package/dist/integrations/hooks/useConnectorSubmissions.d.ts +2 -10
- package/dist/integrations/hooks/useConnectorSubmissions.js +23 -24
- package/dist/integrations/hooks/useConnectorSubmissions.js.map +1 -1
- package/dist/integrations/hooks/useFormatDate.d.ts +0 -1
- package/dist/integrations/hooks/useFormatDate.js +1 -2
- package/dist/integrations/hooks/useFormatDate.js.map +1 -1
- package/dist/integrations/hooks/useFormatLastUsed.d.ts +0 -1
- package/dist/integrations/hooks/useFormatLastUsed.js +1 -2
- package/dist/integrations/hooks/useFormatLastUsed.js.map +1 -1
- package/dist/integrations/hooks/useLabel.d.ts +0 -2
- package/dist/integrations/hooks/useLabel.js +1 -2
- package/dist/integrations/hooks/useLabel.js.map +1 -1
- package/dist/integrations/hooks/useLogs.d.ts +1 -6
- package/dist/integrations/hooks/useLogs.js +6 -7
- package/dist/integrations/hooks/useLogs.js.map +1 -1
- package/dist/integrations/hooks/useMailbox.d.ts +19 -43
- package/dist/integrations/hooks/useMailbox.js +46 -47
- package/dist/integrations/hooks/useMailbox.js.map +1 -1
- package/dist/integrations/hooks/useProviders.d.ts +3 -14
- package/dist/integrations/hooks/useProviders.js +42 -43
- package/dist/integrations/hooks/useProviders.js.map +1 -1
- package/dist/integrations/hooks/useTr.d.ts +0 -1
- package/dist/integrations/hooks/useTr.js +1 -2
- package/dist/integrations/hooks/useTr.js.map +1 -1
- package/dist/integrations/index.d.ts +0 -1
- package/dist/integrations/index.js +9 -8
- package/dist/integrations/pages/AddConnectionWizard.d.ts +1 -2
- package/dist/integrations/pages/AddConnectionWizard.js +291 -306
- package/dist/integrations/pages/AddConnectionWizard.js.map +1 -1
- package/dist/integrations/pages/ConnectionDetail.d.ts +1 -2
- package/dist/integrations/pages/ConnectionDetail.js +241 -246
- package/dist/integrations/pages/ConnectionDetail.js.map +1 -1
- package/dist/integrations/pages/ConnectionLogs.d.ts +1 -2
- package/dist/integrations/pages/ConnectionLogs.js +154 -155
- package/dist/integrations/pages/ConnectionLogs.js.map +1 -1
- package/dist/integrations/pages/ConnectionsList.d.ts +1 -2
- package/dist/integrations/pages/ConnectionsList.js +40 -41
- package/dist/integrations/pages/ConnectionsList.js.map +1 -1
- package/dist/integrations/pages/ConnectorReviewQueuePage.d.ts +1 -2
- package/dist/integrations/pages/ConnectorReviewQueuePage.js +9 -10
- package/dist/integrations/pages/ConnectorReviewQueuePage.js.map +1 -1
- package/dist/integrations/pages/ConnectorSubmissionsPage.d.ts +1 -2
- package/dist/integrations/pages/ConnectorSubmissionsPage.js +138 -139
- package/dist/integrations/pages/ConnectorSubmissionsPage.js.map +1 -1
- package/dist/integrations/pages/IntegrationsOverview.d.ts +1 -2
- package/dist/integrations/pages/IntegrationsOverview.js +35 -36
- package/dist/integrations/pages/IntegrationsOverview.js.map +1 -1
- package/dist/integrations/pages/IntegrationsSettings.d.ts +1 -2
- package/dist/integrations/pages/IntegrationsSettings.js +7 -8
- package/dist/integrations/pages/IntegrationsSettings.js.map +1 -1
- package/dist/integrations/pages/IntegrationsUserLandingPage.d.ts +1 -2
- package/dist/integrations/pages/IntegrationsUserLandingPage.js +1 -2
- package/dist/integrations/pages/IntegrationsUserLandingPage.js.map +1 -1
- package/dist/integrations/pages/MailboxInbox.d.ts +1 -2
- package/dist/integrations/pages/MailboxInbox.js +135 -140
- package/dist/integrations/pages/MailboxInbox.js.map +1 -1
- package/dist/integrations/pages/ProviderCatalog.d.ts +1 -2
- package/dist/integrations/pages/ProviderCatalog.js +107 -108
- package/dist/integrations/pages/ProviderCatalog.js.map +1 -1
- package/dist/integrations/pages/ProviderDetail.d.ts +1 -2
- package/dist/integrations/pages/ProviderDetail.js +21 -22
- package/dist/integrations/pages/ProviderDetail.js.map +1 -1
- package/dist/integrations/pages/ProviderEditorPage.d.ts +1 -2
- package/dist/integrations/pages/ProviderEditorPage.js +261 -264
- package/dist/integrations/pages/ProviderEditorPage.js.map +1 -1
- package/dist/integrations/providers/IntegrationsProvider.d.ts +0 -2
- package/dist/integrations/providers/IntegrationsProvider.js +109 -96
- package/dist/integrations/providers/IntegrationsProvider.js.map +1 -1
- package/dist/integrations/store/integrationsStore.d.ts +0 -2
- package/dist/integrations/store/integrationsStore.js +1 -2
- package/dist/integrations/store/integrationsStore.js.map +1 -1
- package/dist/integrations/store/mailboxStore.d.ts +0 -2
- package/dist/integrations/store/mailboxStore.js +1 -2
- package/dist/integrations/store/mailboxStore.js.map +1 -1
- package/dist/integrations/translations/en.d.ts +0 -1
- package/dist/integrations/types/index.d.ts +0 -1
- package/dist/integrations/utils/appearance.d.ts +0 -1
- package/dist/integrations/utils/appearance.js +1 -2
- package/dist/integrations/utils/appearance.js.map +1 -1
- package/dist/integrations/utils/cn.d.ts +0 -2
- package/dist/integrations/utils/cn.js +2 -3
- package/dist/integrations/utils/cn.js.map +1 -1
- package/dist/integrations/utils/constants.d.ts +0 -1
- package/dist/integrations/utils/constants.js +1 -2
- package/dist/integrations/utils/constants.js.map +1 -1
- package/dist/integrations/utils/integrationsHelpers.d.ts +0 -2
- package/dist/integrations/utils/integrationsHelpers.js +1 -2
- package/dist/integrations/utils/integrationsHelpers.js.map +1 -1
- package/dist/integrations/utils/mailHtml.d.ts +0 -2
- package/dist/integrations/utils/mailHtml.js +3 -4
- package/dist/integrations/utils/mailHtml.js.map +1 -1
- package/dist/integrations/utils/mappers.d.ts +0 -2
- package/dist/integrations/utils/mappers.js +2 -3
- package/dist/integrations/utils/mappers.js.map +1 -1
- package/dist/integrations/utils/navigation.d.ts +0 -1
- package/dist/integrations/utils/navigation.js +2 -8
- package/dist/integrations/utils/navigation.js.map +1 -1
- package/dist/integrations/utils/paths.d.ts +0 -1
- package/dist/integrations/utils/paths.js +1 -2
- package/dist/integrations/utils/paths.js.map +1 -1
- package/dist/node_modules/clsx/dist/clsx.js +8 -7
- package/dist/node_modules/clsx/dist/clsx.js.map +1 -1
- package/dist/node_modules/dompurify/dist/purify.es.js +20 -36
- package/dist/node_modules/dompurify/dist/purify.es.js.map +1 -1
- package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js +229 -167
- package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js.map +1 -1
- package/dist/utils/nativeBridge.d.ts +0 -1
- package/dist/utils/nativeBridge.js +1 -2
- package/package.json +63 -49
- package/dist/dev/main.d.ts.map +0 -1
- package/dist/generated/global-operations.d.ts.map +0 -1
- package/dist/generated/global-types.d.ts.map +0 -1
- package/dist/generated/wspace-operations.d.ts.map +0 -1
- package/dist/generated/wspace-types.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/integrations/ConnectSourceDialog.d.ts.map +0 -1
- package/dist/integrations/ConnectionsPanel.d.ts.map +0 -1
- package/dist/integrations/IntegrationsAdminRoot.d.ts.map +0 -1
- package/dist/integrations/IntegrationsAdminRoutes.d.ts.map +0 -1
- package/dist/integrations/IntegrationsRoot.d.ts.map +0 -1
- package/dist/integrations/IntegrationsUserRoutes.d.ts.map +0 -1
- package/dist/integrations/components/AddConnectionDialog.d.ts.map +0 -1
- package/dist/integrations/components/AuthMethodsEditor.d.ts.map +0 -1
- package/dist/integrations/components/ConfirmDialog.d.ts.map +0 -1
- package/dist/integrations/components/ConnectionCard.d.ts.map +0 -1
- package/dist/integrations/components/ConnectionModalFrame.d.ts.map +0 -1
- package/dist/integrations/components/ConnectionSharing.d.ts.map +0 -1
- package/dist/integrations/components/ConnectionStatusBadge.d.ts.map +0 -1
- package/dist/integrations/components/ConnectorSubmissionCard.d.ts.map +0 -1
- package/dist/integrations/components/ConnectorSubmissionPager.d.ts.map +0 -1
- package/dist/integrations/components/MailMessageBody.d.ts.map +0 -1
- package/dist/integrations/components/ProviderCard.d.ts.map +0 -1
- package/dist/integrations/constants/featureFlags.d.ts.map +0 -1
- package/dist/integrations/constants/permissions.d.ts.map +0 -1
- package/dist/integrations/events/integrations-events.d.ts.map +0 -1
- package/dist/integrations/events/useIntegrationsEventBus.d.ts.map +0 -1
- package/dist/integrations/hooks/useConnections.d.ts.map +0 -1
- package/dist/integrations/hooks/useConnectorSubmissions.d.ts.map +0 -1
- package/dist/integrations/hooks/useFormatDate.d.ts.map +0 -1
- package/dist/integrations/hooks/useFormatLastUsed.d.ts.map +0 -1
- package/dist/integrations/hooks/useLabel.d.ts.map +0 -1
- package/dist/integrations/hooks/useLogs.d.ts.map +0 -1
- package/dist/integrations/hooks/useMailbox.d.ts.map +0 -1
- package/dist/integrations/hooks/useProviders.d.ts.map +0 -1
- package/dist/integrations/hooks/useTr.d.ts.map +0 -1
- package/dist/integrations/index.d.ts.map +0 -1
- package/dist/integrations/pages/AddConnectionWizard.d.ts.map +0 -1
- package/dist/integrations/pages/ConnectionDetail.d.ts.map +0 -1
- package/dist/integrations/pages/ConnectionLogs.d.ts.map +0 -1
- package/dist/integrations/pages/ConnectionsList.d.ts.map +0 -1
- package/dist/integrations/pages/ConnectorReviewQueuePage.d.ts.map +0 -1
- package/dist/integrations/pages/ConnectorSubmissionsPage.d.ts.map +0 -1
- package/dist/integrations/pages/IntegrationsOverview.d.ts.map +0 -1
- package/dist/integrations/pages/IntegrationsSettings.d.ts.map +0 -1
- package/dist/integrations/pages/IntegrationsUserLandingPage.d.ts.map +0 -1
- package/dist/integrations/pages/MailboxInbox.d.ts.map +0 -1
- package/dist/integrations/pages/ProviderCatalog.d.ts.map +0 -1
- package/dist/integrations/pages/ProviderDetail.d.ts.map +0 -1
- package/dist/integrations/pages/ProviderEditorPage.d.ts.map +0 -1
- package/dist/integrations/providers/IntegrationsProvider.d.ts.map +0 -1
- package/dist/integrations/store/integrationsStore.d.ts.map +0 -1
- package/dist/integrations/store/mailboxStore.d.ts.map +0 -1
- package/dist/integrations/translations/en.d.ts.map +0 -1
- package/dist/integrations/types/index.d.ts.map +0 -1
- package/dist/integrations/utils/appearance.d.ts.map +0 -1
- package/dist/integrations/utils/cn.d.ts.map +0 -1
- package/dist/integrations/utils/constants.d.ts.map +0 -1
- package/dist/integrations/utils/integrationsHelpers.d.ts.map +0 -1
- package/dist/integrations/utils/mailHtml.d.ts.map +0 -1
- package/dist/integrations/utils/mappers.d.ts.map +0 -1
- package/dist/integrations/utils/navigation.d.ts.map +0 -1
- package/dist/integrations/utils/paths.d.ts.map +0 -1
- package/dist/utils/nativeBridge.d.ts.map +0 -1
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { cn as e } from "../utils/cn.js";
|
|
2
|
+
import { joinPath as t } from "../utils/paths.js";
|
|
3
|
+
import { useTr as n } from "../hooks/useTr.js";
|
|
4
4
|
import { MailboxFolder as r, MailboxKind as i, MailboxLabelKind as a } from "../../generated/wspace-types.js";
|
|
5
5
|
import { useFormatDate as o } from "../hooks/useFormatDate.js";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
6
|
+
import { useIntegrations as s } from "../providers/IntegrationsProvider.js";
|
|
7
|
+
import { MAILBOX_SEND_ATTACHMENT_BYTES as c, splitRecipients as l, useMailboxAccounts as u, useMailboxLabels as d, useMailboxMessages as f, useMailboxThread as p, useMailboxThreadActions as m, useSendMail as h, useSetMailRead as g, useUploadMailAttachment as _ } from "../hooks/useMailbox.js";
|
|
8
|
+
import { useMailboxStore as v } from "../store/mailboxStore.js";
|
|
9
|
+
import { ConfirmDialog as y } from "../components/ConfirmDialog.js";
|
|
10
|
+
import { MailMessageBody as b } from "../components/MailMessageBody.js";
|
|
11
|
+
import { formatBytes as x } from "../utils/mailHtml.js";
|
|
12
12
|
import { useEffect as S, useId as C, useRef as w, useState as T } from "react";
|
|
13
13
|
import { Archive as E, ArrowLeft as D, Inbox as O, Loader2 as k, Mail as A, MailOpen as j, Paperclip as M, PenSquare as N, RefreshCw as P, Reply as F, Search as I, Send as L, Trash2 as R, X as z } from "lucide-react";
|
|
14
14
|
import { Fragment as B, jsx as V, jsxs as H } from "react/jsx-runtime";
|
|
15
15
|
import { Button as U, IllustratedEmptyState as W, PagePurpose as G } from "@burdenoff/fe-libs/ui";
|
|
16
|
-
|
|
16
|
+
// src/integrations/pages/MailboxInbox.tsx
|
|
17
17
|
function K(e) {
|
|
18
18
|
return e ? e.name ? `${e.name} <${e.email}>` : e.email : "";
|
|
19
19
|
}
|
|
@@ -37,28 +37,24 @@ var J = [
|
|
|
37
37
|
label: "All mail"
|
|
38
38
|
}
|
|
39
39
|
];
|
|
40
|
-
function Y(
|
|
41
|
-
let { connectionId: r, kind: i, replyTo: a, onClose: o, onSent: s } =
|
|
40
|
+
function Y(t) {
|
|
41
|
+
let { connectionId: r, kind: i, replyTo: a, onClose: o, onSent: s } = t, u = n(), d = C(), { send: f, sending: p } = h(), m = _(), g = w(null), [v, y] = T([]), [b, S] = T(!1), E = c[i], D = Math.round(E / 1048576 * 10) / 10, O = async (e) => {
|
|
42
42
|
let t = Array.from(e ?? []);
|
|
43
|
-
if (
|
|
44
|
-
if (G(null),
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
43
|
+
if (g.current && (g.current.value = ""), t.length !== 0) {
|
|
44
|
+
if (G(null), v.length + t.length > 10) G(u("integrations.mailbox.compose.tooManyFiles", "A message can have at most {{max}} attachments", { max: 10 }));
|
|
45
|
+
else if ([...v, ...t].reduce((e, t) => e + t.size, 0) > E) G(u("integrations.mailbox.compose.filesTooLarge", "Attachments on one message can total at most {{max}} MB with this mailbox", { max: D }));
|
|
46
|
+
else {
|
|
47
|
+
S(!0);
|
|
48
|
+
try {
|
|
49
|
+
for (let e of t) {
|
|
50
|
+
let t = await m(e);
|
|
51
|
+
y((e) => [...e, t]);
|
|
52
|
+
}
|
|
53
|
+
} catch (e) {
|
|
54
|
+
G(e instanceof Error ? e.message : u("integrations.mailbox.compose.uploadFailed", "Could not upload the file"));
|
|
55
|
+
} finally {
|
|
56
|
+
S(!1);
|
|
57
57
|
}
|
|
58
|
-
} catch (e) {
|
|
59
|
-
G(e instanceof Error ? e.message : c("integrations.mailbox.compose.uploadFailed", "Could not upload the file"));
|
|
60
|
-
} finally {
|
|
61
|
-
S(!1);
|
|
62
58
|
}
|
|
63
59
|
}
|
|
64
60
|
}, [A, j] = T(a?.to ?? ""), [N, P] = T(""), [F, I] = T(a?.subject ?? ""), [R, B] = T(""), [W, G] = T(null), K = async (e) => {
|
|
@@ -66,34 +62,34 @@ function Y(e) {
|
|
|
66
62
|
try {
|
|
67
63
|
await f({
|
|
68
64
|
connectionId: r,
|
|
69
|
-
to:
|
|
70
|
-
cc:
|
|
65
|
+
to: l(A),
|
|
66
|
+
cc: l(N),
|
|
71
67
|
subject: F,
|
|
72
68
|
bodyText: R,
|
|
73
69
|
replyToMessageId: a?.messageId,
|
|
74
|
-
attachmentFileIds:
|
|
70
|
+
attachmentFileIds: v.map((e) => e.fileId)
|
|
75
71
|
}), s();
|
|
76
72
|
} catch (e) {
|
|
77
|
-
G(e instanceof Error ? e.message :
|
|
73
|
+
G(e instanceof Error ? e.message : u("integrations.mailbox.compose.failed", "Could not send"));
|
|
78
74
|
}
|
|
79
75
|
}, q = "w-full px-3 py-2 border border-border-subtle rounded-lg bg-bg-surface text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary";
|
|
80
76
|
return /* @__PURE__ */ H("form", {
|
|
81
77
|
onSubmit: K,
|
|
82
78
|
className: "rounded-xl border border-border-seam bg-bg-surface p-4 space-y-3",
|
|
83
|
-
"aria-label": a ?
|
|
79
|
+
"aria-label": a ? u("integrations.mailbox.compose.replyTitle", "Reply") : u("integrations.mailbox.compose.title", "New message"),
|
|
84
80
|
children: [
|
|
85
81
|
/* @__PURE__ */ H("div", {
|
|
86
82
|
className: "flex items-center justify-between",
|
|
87
83
|
children: [/* @__PURE__ */ V("h2", {
|
|
88
84
|
className: "text-sm font-semibold text-text-primary",
|
|
89
|
-
children: a ?
|
|
85
|
+
children: a ? u("integrations.mailbox.compose.replyTitle", "Reply") : u("integrations.mailbox.compose.title", "New message")
|
|
90
86
|
}), /* @__PURE__ */ V(U, {
|
|
91
87
|
type: "button",
|
|
92
88
|
variant: "ghost",
|
|
93
89
|
size: "icon",
|
|
94
90
|
onClick: o,
|
|
95
91
|
disabled: p,
|
|
96
|
-
"aria-label":
|
|
92
|
+
"aria-label": u("integrations.common.close", "Close"),
|
|
97
93
|
children: /* @__PURE__ */ V(z, { size: 16 })
|
|
98
94
|
})]
|
|
99
95
|
}),
|
|
@@ -102,13 +98,13 @@ function Y(e) {
|
|
|
102
98
|
children: [/* @__PURE__ */ V("label", {
|
|
103
99
|
htmlFor: `${d}-to`,
|
|
104
100
|
className: "text-xs font-medium text-text-secondary",
|
|
105
|
-
children:
|
|
101
|
+
children: u("integrations.mailbox.compose.to", "To")
|
|
106
102
|
}), /* @__PURE__ */ V("input", {
|
|
107
103
|
id: `${d}-to`,
|
|
108
104
|
type: "text",
|
|
109
105
|
value: A,
|
|
110
106
|
onChange: (e) => j(e.target.value),
|
|
111
|
-
placeholder:
|
|
107
|
+
placeholder: u("integrations.mailbox.compose.toPlaceholder", "name@example.com, another@example.com"),
|
|
112
108
|
className: q,
|
|
113
109
|
required: !0
|
|
114
110
|
})]
|
|
@@ -118,7 +114,7 @@ function Y(e) {
|
|
|
118
114
|
children: [/* @__PURE__ */ V("label", {
|
|
119
115
|
htmlFor: `${d}-cc`,
|
|
120
116
|
className: "text-xs font-medium text-text-secondary",
|
|
121
|
-
children:
|
|
117
|
+
children: u("integrations.mailbox.compose.cc", "Cc")
|
|
122
118
|
}), /* @__PURE__ */ V("input", {
|
|
123
119
|
id: `${d}-cc`,
|
|
124
120
|
type: "text",
|
|
@@ -132,7 +128,7 @@ function Y(e) {
|
|
|
132
128
|
children: [/* @__PURE__ */ V("label", {
|
|
133
129
|
htmlFor: `${d}-subject`,
|
|
134
130
|
className: "text-xs font-medium text-text-secondary",
|
|
135
|
-
children:
|
|
131
|
+
children: u("integrations.mailbox.compose.subject", "Subject")
|
|
136
132
|
}), /* @__PURE__ */ V("input", {
|
|
137
133
|
id: `${d}-subject`,
|
|
138
134
|
type: "text",
|
|
@@ -147,13 +143,13 @@ function Y(e) {
|
|
|
147
143
|
children: [/* @__PURE__ */ V("label", {
|
|
148
144
|
htmlFor: `${d}-body`,
|
|
149
145
|
className: "text-xs font-medium text-text-secondary",
|
|
150
|
-
children:
|
|
146
|
+
children: u("integrations.mailbox.compose.body", "Message")
|
|
151
147
|
}), /* @__PURE__ */ V("textarea", {
|
|
152
148
|
id: `${d}-body`,
|
|
153
149
|
value: R,
|
|
154
150
|
onChange: (e) => B(e.target.value),
|
|
155
151
|
rows: 8,
|
|
156
|
-
className:
|
|
152
|
+
className: e(q, "resize-y"),
|
|
157
153
|
required: !0
|
|
158
154
|
})]
|
|
159
155
|
}),
|
|
@@ -161,38 +157,38 @@ function Y(e) {
|
|
|
161
157
|
className: "space-y-2",
|
|
162
158
|
children: [
|
|
163
159
|
/* @__PURE__ */ V("input", {
|
|
164
|
-
ref:
|
|
160
|
+
ref: g,
|
|
165
161
|
id: `${d}-files`,
|
|
166
162
|
type: "file",
|
|
167
163
|
multiple: !0,
|
|
168
|
-
"aria-label":
|
|
164
|
+
"aria-label": u("integrations.mailbox.compose.attach", "Attach files"),
|
|
169
165
|
tabIndex: -1,
|
|
170
166
|
className: "sr-only",
|
|
171
167
|
onChange: (e) => void O(e.target.files),
|
|
172
|
-
disabled: p ||
|
|
168
|
+
disabled: p || b
|
|
173
169
|
}),
|
|
174
170
|
/* @__PURE__ */ H(U, {
|
|
175
171
|
type: "button",
|
|
176
172
|
variant: "outline",
|
|
177
173
|
size: "sm",
|
|
178
|
-
disabled: p ||
|
|
179
|
-
onClick: () =>
|
|
180
|
-
children: [
|
|
174
|
+
disabled: p || b || v.length >= 10,
|
|
175
|
+
onClick: () => g.current?.click(),
|
|
176
|
+
children: [b ? /* @__PURE__ */ V(k, {
|
|
181
177
|
size: 14,
|
|
182
178
|
className: "animate-spin"
|
|
183
|
-
}) : /* @__PURE__ */ V(M, { size: 14 }),
|
|
179
|
+
}) : /* @__PURE__ */ V(M, { size: 14 }), b ? u("integrations.mailbox.compose.uploading", "Uploading…") : u("integrations.mailbox.compose.attach", "Attach files")]
|
|
184
180
|
}),
|
|
185
181
|
/* @__PURE__ */ V("p", {
|
|
186
182
|
className: "text-xs text-text-tertiary",
|
|
187
|
-
children:
|
|
183
|
+
children: u("integrations.mailbox.compose.attachHint", "Up to {{count}} files, {{max}} MB in total. A copy is kept in your Files.", {
|
|
188
184
|
count: 10,
|
|
189
185
|
max: D
|
|
190
186
|
})
|
|
191
187
|
}),
|
|
192
|
-
|
|
188
|
+
v.length > 0 && /* @__PURE__ */ V("ul", {
|
|
193
189
|
className: "flex flex-wrap gap-2",
|
|
194
190
|
"data-testid": "mailbox-compose-attachments",
|
|
195
|
-
children:
|
|
191
|
+
children: v.map((e) => /* @__PURE__ */ H("li", {
|
|
196
192
|
className: "flex items-center gap-1 rounded-full border border-border-subtle px-3 py-1 text-xs text-text-primary",
|
|
197
193
|
children: [
|
|
198
194
|
/* @__PURE__ */ V(M, { size: 12 }),
|
|
@@ -202,13 +198,13 @@ function Y(e) {
|
|
|
202
198
|
}),
|
|
203
199
|
/* @__PURE__ */ V("span", {
|
|
204
200
|
className: "text-text-tertiary",
|
|
205
|
-
children:
|
|
201
|
+
children: x(e.size)
|
|
206
202
|
}),
|
|
207
203
|
/* @__PURE__ */ V("button", {
|
|
208
204
|
type: "button",
|
|
209
205
|
className: "ml-1 rounded-full p-0.5 hover:bg-accent",
|
|
210
206
|
disabled: p,
|
|
211
|
-
"aria-label":
|
|
207
|
+
"aria-label": u("integrations.mailbox.compose.removeFile", "Remove {{name}}", { name: e.name }),
|
|
212
208
|
onClick: () => y((t) => t.filter((t) => t.fileId !== e.fileId)),
|
|
213
209
|
children: /* @__PURE__ */ V(z, { size: 12 })
|
|
214
210
|
})
|
|
@@ -229,60 +225,60 @@ function Y(e) {
|
|
|
229
225
|
variant: "outline",
|
|
230
226
|
onClick: o,
|
|
231
227
|
disabled: p,
|
|
232
|
-
children:
|
|
228
|
+
children: u("integrations.common.cancel", "Cancel")
|
|
233
229
|
}), /* @__PURE__ */ H(U, {
|
|
234
230
|
type: "submit",
|
|
235
|
-
disabled: p ||
|
|
231
|
+
disabled: p || b || !R.trim() || !A.trim(),
|
|
236
232
|
children: [p ? /* @__PURE__ */ V(k, {
|
|
237
233
|
size: 16,
|
|
238
234
|
className: "animate-spin"
|
|
239
|
-
}) : /* @__PURE__ */ V(L, { size: 16 }),
|
|
235
|
+
}) : /* @__PURE__ */ V(L, { size: 16 }), u("integrations.mailbox.compose.send", "Send")]
|
|
240
236
|
})]
|
|
241
237
|
})
|
|
242
238
|
]
|
|
243
239
|
});
|
|
244
240
|
}
|
|
245
241
|
function X(e) {
|
|
246
|
-
let { connectionId:
|
|
242
|
+
let { connectionId: t, kind: r, threadId: a, accountEmail: s, onBack: c, onRemoved: l } = e, u = n(), d = o(), { thread: f, loading: h, error: g, refetch: _ } = p(t, a), { archiveThread: v, trashThread: x, busy: S } = m(), [C, w] = T(!1), [O, A] = T(null), j = async (e) => {
|
|
247
243
|
A(null);
|
|
248
244
|
try {
|
|
249
|
-
e === "archived" ? await
|
|
245
|
+
e === "archived" ? await v(t, a) : await x(t, a), w(!1), l(e);
|
|
250
246
|
} catch (e) {
|
|
251
|
-
w(!1), A(e instanceof Error ? e.message :
|
|
247
|
+
w(!1), A(e instanceof Error ? e.message : u("integrations.mailbox.actions.failed", "That did not work. Try again."));
|
|
252
248
|
}
|
|
253
249
|
}, [N, I] = T(!1), [L, z] = T(!1);
|
|
254
|
-
if (
|
|
250
|
+
if (h && !f) return /* @__PURE__ */ V("div", {
|
|
255
251
|
className: "flex items-center justify-center py-16",
|
|
256
252
|
children: /* @__PURE__ */ V(k, { className: "size-6 animate-spin text-primary" })
|
|
257
253
|
});
|
|
258
|
-
if (
|
|
254
|
+
if (g || !f) return /* @__PURE__ */ H("div", {
|
|
259
255
|
className: "p-6 space-y-3 text-center",
|
|
260
256
|
children: [/* @__PURE__ */ V("p", {
|
|
261
257
|
role: "alert",
|
|
262
258
|
className: "text-sm text-status-error-text",
|
|
263
|
-
children:
|
|
259
|
+
children: g?.message ?? u("integrations.mailbox.thread.notFound", "Conversation not found")
|
|
264
260
|
}), /* @__PURE__ */ H("div", {
|
|
265
261
|
className: "flex flex-wrap justify-center gap-2",
|
|
266
262
|
children: [/* @__PURE__ */ H(U, {
|
|
267
263
|
variant: "ghost",
|
|
268
|
-
onClick:
|
|
264
|
+
onClick: c,
|
|
269
265
|
children: [
|
|
270
266
|
/* @__PURE__ */ V(D, { size: 16 }),
|
|
271
267
|
" ",
|
|
272
|
-
|
|
268
|
+
u("integrations.common.back", "Back")
|
|
273
269
|
]
|
|
274
270
|
}), /* @__PURE__ */ H(U, {
|
|
275
271
|
variant: "outline",
|
|
276
|
-
onClick: () =>
|
|
272
|
+
onClick: () => _(),
|
|
277
273
|
children: [
|
|
278
274
|
/* @__PURE__ */ V(P, { size: 16 }),
|
|
279
275
|
" ",
|
|
280
|
-
|
|
276
|
+
u("integrations.mailbox.actions.retry", "Try again")
|
|
281
277
|
]
|
|
282
278
|
})]
|
|
283
279
|
})]
|
|
284
280
|
});
|
|
285
|
-
let B =
|
|
281
|
+
let B = f.messages[f.messages.length - 1], W = s?.trim().toLowerCase() ?? null, G = B ? W && B.from?.email.toLowerCase() === W ? B.to.map((e) => e.email).filter((e) => e.toLowerCase() !== W) : [B.from?.email ?? ""] : [];
|
|
286
282
|
return /* @__PURE__ */ H("div", {
|
|
287
283
|
className: "space-y-4",
|
|
288
284
|
"data-testid": "mailbox-thread",
|
|
@@ -294,13 +290,13 @@ function X(e) {
|
|
|
294
290
|
variant: "ghost",
|
|
295
291
|
size: "icon",
|
|
296
292
|
className: "lg:hidden",
|
|
297
|
-
onClick:
|
|
298
|
-
"aria-label":
|
|
293
|
+
onClick: c,
|
|
294
|
+
"aria-label": u("integrations.common.back", "Back"),
|
|
299
295
|
children: /* @__PURE__ */ V(D, { size: 18 })
|
|
300
296
|
}),
|
|
301
297
|
/* @__PURE__ */ V("h2", {
|
|
302
298
|
className: "min-w-0 flex-1 text-lg font-semibold text-text-primary break-words",
|
|
303
|
-
children:
|
|
299
|
+
children: f.subject || u("integrations.mailbox.noSubject", "(no subject)")
|
|
304
300
|
}),
|
|
305
301
|
/* @__PURE__ */ H("div", {
|
|
306
302
|
className: "flex shrink-0 gap-1",
|
|
@@ -309,16 +305,16 @@ function X(e) {
|
|
|
309
305
|
size: "icon",
|
|
310
306
|
disabled: S,
|
|
311
307
|
onClick: () => void j("archived"),
|
|
312
|
-
"aria-label":
|
|
313
|
-
title:
|
|
308
|
+
"aria-label": u("integrations.mailbox.actions.archive", "Archive"),
|
|
309
|
+
title: u("integrations.mailbox.actions.archive", "Archive"),
|
|
314
310
|
children: /* @__PURE__ */ V(E, { size: 18 })
|
|
315
311
|
}), /* @__PURE__ */ V(U, {
|
|
316
312
|
variant: "ghost",
|
|
317
313
|
size: "icon",
|
|
318
314
|
disabled: S,
|
|
319
315
|
onClick: () => w(!0),
|
|
320
|
-
"aria-label":
|
|
321
|
-
title:
|
|
316
|
+
"aria-label": u("integrations.mailbox.actions.trash", "Delete"),
|
|
317
|
+
title: u("integrations.mailbox.actions.trash", "Delete"),
|
|
322
318
|
children: /* @__PURE__ */ V(R, { size: 18 })
|
|
323
319
|
})]
|
|
324
320
|
})
|
|
@@ -329,18 +325,18 @@ function X(e) {
|
|
|
329
325
|
className: "text-sm text-status-error-text",
|
|
330
326
|
children: O
|
|
331
327
|
}),
|
|
332
|
-
/* @__PURE__ */ V(
|
|
328
|
+
/* @__PURE__ */ V(y, {
|
|
333
329
|
open: C,
|
|
334
|
-
title:
|
|
335
|
-
description: r === i.Outlook ?
|
|
336
|
-
confirmLabel:
|
|
337
|
-
cancelLabel:
|
|
330
|
+
title: u("integrations.mailbox.trash.title", "Delete this conversation?"),
|
|
331
|
+
description: r === i.Outlook ? u("integrations.mailbox.trash.descriptionOutlook", "It moves to Deleted Items in Outlook, where you can restore it.") : u("integrations.mailbox.trash.descriptionGmail", "It moves to Trash in Gmail, where you can restore it for 30 days."),
|
|
332
|
+
confirmLabel: u("integrations.mailbox.actions.trash", "Delete"),
|
|
333
|
+
cancelLabel: u("integrations.common.cancel", "Cancel"),
|
|
338
334
|
loading: S,
|
|
339
335
|
destructive: !0,
|
|
340
336
|
onConfirm: () => void j("trashed"),
|
|
341
337
|
onCancel: () => w(!1)
|
|
342
338
|
}),
|
|
343
|
-
|
|
339
|
+
f.messages.map((e) => /* @__PURE__ */ H("article", {
|
|
344
340
|
className: "rounded-xl border border-border-subtle bg-bg-surface p-4 space-y-2",
|
|
345
341
|
children: [/* @__PURE__ */ H("header", {
|
|
346
342
|
className: "flex flex-wrap items-baseline justify-between gap-2",
|
|
@@ -352,44 +348,44 @@ function X(e) {
|
|
|
352
348
|
}), /* @__PURE__ */ H("p", {
|
|
353
349
|
className: "text-xs text-text-secondary break-all",
|
|
354
350
|
children: [
|
|
355
|
-
|
|
351
|
+
u("integrations.mailbox.thread.to", "To"),
|
|
356
352
|
":",
|
|
357
353
|
" ",
|
|
358
354
|
e.to.map(K).join(", "),
|
|
359
|
-
e.cc.length > 0 && ` · ${
|
|
355
|
+
e.cc.length > 0 && ` · ${u("integrations.mailbox.thread.cc", "Cc")}: ${e.cc.map(K).join(", ")}`
|
|
360
356
|
]
|
|
361
357
|
})]
|
|
362
358
|
}), /* @__PURE__ */ H("div", {
|
|
363
359
|
className: "flex items-center gap-2 text-xs text-text-tertiary",
|
|
364
360
|
children: [e.hasAttachments && /* @__PURE__ */ V(M, {
|
|
365
361
|
size: 14,
|
|
366
|
-
"aria-label":
|
|
362
|
+
"aria-label": u("integrations.mailbox.attachments", "Has attachments")
|
|
367
363
|
}), e.receivedAt && /* @__PURE__ */ V("time", {
|
|
368
364
|
dateTime: e.receivedAt,
|
|
369
|
-
children:
|
|
365
|
+
children: d(e.receivedAt)
|
|
370
366
|
})]
|
|
371
367
|
})]
|
|
372
|
-
}), /* @__PURE__ */ V(
|
|
373
|
-
connectionId:
|
|
368
|
+
}), /* @__PURE__ */ V(b, {
|
|
369
|
+
connectionId: t,
|
|
374
370
|
message: e
|
|
375
371
|
})]
|
|
376
372
|
}, e.id)),
|
|
377
373
|
L && /* @__PURE__ */ V("p", {
|
|
378
374
|
role: "status",
|
|
379
375
|
className: "text-sm text-status-success-text",
|
|
380
|
-
children:
|
|
376
|
+
children: u("integrations.mailbox.compose.sent", "Message sent")
|
|
381
377
|
}),
|
|
382
378
|
B && (N ? /* @__PURE__ */ V(Y, {
|
|
383
|
-
connectionId:
|
|
379
|
+
connectionId: t,
|
|
384
380
|
kind: r,
|
|
385
381
|
replyTo: {
|
|
386
382
|
messageId: B.id,
|
|
387
383
|
to: G.filter(Boolean).join(", "),
|
|
388
|
-
subject:
|
|
384
|
+
subject: f.subject
|
|
389
385
|
},
|
|
390
386
|
onClose: () => I(!1),
|
|
391
387
|
onSent: () => {
|
|
392
|
-
I(!1), z(!0),
|
|
388
|
+
I(!1), z(!0), _();
|
|
393
389
|
}
|
|
394
390
|
}) : /* @__PURE__ */ H(U, {
|
|
395
391
|
variant: "outline",
|
|
@@ -397,14 +393,14 @@ function X(e) {
|
|
|
397
393
|
children: [
|
|
398
394
|
/* @__PURE__ */ V(F, { size: 16 }),
|
|
399
395
|
" ",
|
|
400
|
-
|
|
396
|
+
u("integrations.mailbox.actions.reply", "Reply")
|
|
401
397
|
]
|
|
402
398
|
}))
|
|
403
399
|
]
|
|
404
400
|
});
|
|
405
401
|
}
|
|
406
|
-
function Z(
|
|
407
|
-
let { messages: i, loading: a, error: s, refetch: c, folder: l, threadId: u, hasPrevious: d, nextPageToken: f, onOpen: p, onPrevious: m, onNext: h } =
|
|
402
|
+
function Z(t) {
|
|
403
|
+
let { messages: i, loading: a, error: s, refetch: c, folder: l, threadId: u, hasPrevious: d, nextPageToken: f, onOpen: p, onPrevious: m, onNext: h } = t, g = n(), _ = o();
|
|
408
404
|
return /* @__PURE__ */ H(B, { children: [s ? /* @__PURE__ */ H("div", {
|
|
409
405
|
className: "p-6 text-center space-y-3",
|
|
410
406
|
children: [/* @__PURE__ */ V("p", {
|
|
@@ -429,36 +425,36 @@ function Z(e) {
|
|
|
429
425
|
}) : /* @__PURE__ */ V("ul", {
|
|
430
426
|
className: "divide-y divide-border-subtle",
|
|
431
427
|
"data-testid": "mailbox-message-list",
|
|
432
|
-
children: i.map((
|
|
428
|
+
children: i.map((t) => /* @__PURE__ */ V("li", { children: /* @__PURE__ */ H("button", {
|
|
433
429
|
type: "button",
|
|
434
|
-
onClick: () => p(
|
|
435
|
-
"aria-current": u ===
|
|
436
|
-
className:
|
|
430
|
+
onClick: () => p(t.threadId, t.id, t.isUnread),
|
|
431
|
+
"aria-current": u === t.threadId ? "true" : void 0,
|
|
432
|
+
className: e("w-full text-left px-4 py-3 transition-colors hover:bg-accent focus:outline-none focus-visible:ring-2 focus-visible:ring-primary/30", u === t.threadId && "bg-accent"),
|
|
437
433
|
children: [
|
|
438
434
|
/* @__PURE__ */ H("div", {
|
|
439
435
|
className: "flex items-center justify-between gap-2",
|
|
440
436
|
children: [/* @__PURE__ */ V("span", {
|
|
441
|
-
className:
|
|
442
|
-
children: l === r.Sent ?
|
|
437
|
+
className: e("truncate text-sm", t.isUnread ? "font-semibold text-text-primary" : "text-text-secondary"),
|
|
438
|
+
children: l === r.Sent ? t.to.map(q).join(", ") : q(t.from)
|
|
443
439
|
}), /* @__PURE__ */ H("span", {
|
|
444
440
|
className: "flex shrink-0 items-center gap-1 text-xs text-text-tertiary",
|
|
445
441
|
children: [
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
442
|
+
t.hasAttachments && /* @__PURE__ */ V(M, { size: 12 }),
|
|
443
|
+
t.isUnread ? /* @__PURE__ */ V(A, { size: 12 }) : /* @__PURE__ */ V(j, { size: 12 }),
|
|
444
|
+
t.receivedAt ? _(t.receivedAt) : ""
|
|
449
445
|
]
|
|
450
446
|
})]
|
|
451
447
|
}),
|
|
452
448
|
/* @__PURE__ */ V("p", {
|
|
453
|
-
className:
|
|
454
|
-
children:
|
|
449
|
+
className: e("truncate text-sm", t.isUnread ? "font-medium text-text-primary" : "text-text-primary"),
|
|
450
|
+
children: t.subject || g("integrations.mailbox.noSubject", "(no subject)")
|
|
455
451
|
}),
|
|
456
452
|
/* @__PURE__ */ V("p", {
|
|
457
453
|
className: "truncate text-xs text-text-secondary",
|
|
458
|
-
children:
|
|
454
|
+
children: t.snippet
|
|
459
455
|
})
|
|
460
456
|
]
|
|
461
|
-
}) },
|
|
457
|
+
}) }, t.id))
|
|
462
458
|
}), (d || f) && /* @__PURE__ */ H("div", {
|
|
463
459
|
className: "flex justify-between gap-2 border-t border-border-subtle p-3",
|
|
464
460
|
children: [/* @__PURE__ */ V(U, {
|
|
@@ -476,17 +472,17 @@ function Z(e) {
|
|
|
476
472
|
})]
|
|
477
473
|
})] });
|
|
478
474
|
}
|
|
479
|
-
function Q(
|
|
480
|
-
let r =
|
|
475
|
+
function Q(e) {
|
|
476
|
+
let r = n(), { basePath: i = "/", navigate: a } = s(), o = t(i, "providers");
|
|
481
477
|
return /* @__PURE__ */ H("div", {
|
|
482
478
|
className: "space-y-6 p-6 max-w-5xl mx-auto",
|
|
483
479
|
children: [/* @__PURE__ */ V(G, {
|
|
484
480
|
icon: /* @__PURE__ */ V(A, { size: 16 }),
|
|
485
481
|
children: r("integrations.mailbox.purpose", "Read and send mail from your own Gmail or Outlook account without leaving Workspaces. Only you can open your mailbox; sharing a connection never shares your mail.")
|
|
486
|
-
}),
|
|
482
|
+
}), e.errorMessage ? /* @__PURE__ */ V("p", {
|
|
487
483
|
role: "alert",
|
|
488
484
|
className: "text-sm text-status-error-text text-center",
|
|
489
|
-
children:
|
|
485
|
+
children: e.errorMessage
|
|
490
486
|
}) : /* @__PURE__ */ V(W, {
|
|
491
487
|
illustration: "empty-data",
|
|
492
488
|
title: r("integrations.mailbox.empty.title", "Connect a mailbox"),
|
|
@@ -503,7 +499,7 @@ function Q(n) {
|
|
|
503
499
|
});
|
|
504
500
|
}
|
|
505
501
|
function $(e) {
|
|
506
|
-
let { accounts:
|
|
502
|
+
let { accounts: t, connectionId: r } = e, i = n(), a = C(), o = v((e) => e.composing), s = v((e) => e.selectConnection), c = v((e) => e.startCompose), l = t.find((e) => e.connectionId === r) ?? null;
|
|
507
503
|
return /* @__PURE__ */ V("div", {
|
|
508
504
|
className: "rounded-xl border border-border-seam bg-accent-wash p-4 sm:p-6",
|
|
509
505
|
children: /* @__PURE__ */ H("div", {
|
|
@@ -525,7 +521,7 @@ function $(e) {
|
|
|
525
521
|
})] })]
|
|
526
522
|
}), /* @__PURE__ */ H("div", {
|
|
527
523
|
className: "flex flex-wrap items-center gap-2",
|
|
528
|
-
children: [
|
|
524
|
+
children: [t.length > 1 && /* @__PURE__ */ H(B, { children: [/* @__PURE__ */ V("label", {
|
|
529
525
|
htmlFor: `${a}-account`,
|
|
530
526
|
className: "sr-only",
|
|
531
527
|
children: i("integrations.mailbox.account", "Mailbox")
|
|
@@ -535,7 +531,7 @@ function $(e) {
|
|
|
535
531
|
disabled: o,
|
|
536
532
|
onChange: (e) => s(e.target.value),
|
|
537
533
|
className: "px-3 py-2 border border-border-subtle rounded-lg bg-bg-surface text-sm text-text-primary",
|
|
538
|
-
children:
|
|
534
|
+
children: t.map((e) => /* @__PURE__ */ V("option", {
|
|
539
535
|
value: e.connectionId,
|
|
540
536
|
children: e.emailAddress ?? e.name
|
|
541
537
|
}, e.connectionId))
|
|
@@ -551,9 +547,9 @@ function $(e) {
|
|
|
551
547
|
})
|
|
552
548
|
});
|
|
553
549
|
}
|
|
554
|
-
var ee = new Set(["INBOX", "SENT"]);
|
|
555
|
-
function te(
|
|
556
|
-
let r =
|
|
550
|
+
var ee = /* @__PURE__ */ new Set(["INBOX", "SENT"]);
|
|
551
|
+
function te(t) {
|
|
552
|
+
let r = n(), i = C(), o = v((e) => e.folder), s = v((e) => e.folderId), c = v((e) => e.query), l = v((e) => e.selectFolder), u = v((e) => e.selectLabel), f = v((e) => e.search), { labels: p } = d(t.connectionId), m = p.filter((e) => !(e.kind === a.System && ee.has(e.id))), [h, g] = T(c);
|
|
557
553
|
return /* @__PURE__ */ H("div", {
|
|
558
554
|
className: "flex flex-col sm:flex-row gap-3",
|
|
559
555
|
children: [
|
|
@@ -561,13 +557,13 @@ function te(e) {
|
|
|
561
557
|
className: "flex gap-1 rounded-lg border border-border-subtle bg-bg-surface p-1",
|
|
562
558
|
role: "group",
|
|
563
559
|
"aria-label": r("integrations.mailbox.folders.ariaLabel", "Folders"),
|
|
564
|
-
children: J.map((
|
|
560
|
+
children: J.map((t) => /* @__PURE__ */ V("button", {
|
|
565
561
|
type: "button",
|
|
566
|
-
"aria-pressed": !s && o ===
|
|
567
|
-
onClick: () => l(
|
|
568
|
-
className:
|
|
569
|
-
children: r(`integrations.mailbox.folders.${
|
|
570
|
-
},
|
|
562
|
+
"aria-pressed": !s && o === t.value,
|
|
563
|
+
onClick: () => l(t.value),
|
|
564
|
+
className: e("px-3 py-1.5 text-sm rounded-md transition-colors", !s && o === t.value ? "bg-action-primary-bg text-action-primary-text" : "text-text-secondary hover:bg-accent"),
|
|
565
|
+
children: r(`integrations.mailbox.folders.${t.key}`, t.label)
|
|
566
|
+
}, t.value))
|
|
571
567
|
}),
|
|
572
568
|
m.length > 0 && /* @__PURE__ */ H("div", { children: [/* @__PURE__ */ V("label", {
|
|
573
569
|
htmlFor: `${i}-label`,
|
|
@@ -592,7 +588,7 @@ function te(e) {
|
|
|
592
588
|
/* @__PURE__ */ H("form", {
|
|
593
589
|
className: "flex-1 relative",
|
|
594
590
|
onSubmit: (e) => {
|
|
595
|
-
e.preventDefault(),
|
|
591
|
+
e.preventDefault(), f(h);
|
|
596
592
|
},
|
|
597
593
|
children: [/* @__PURE__ */ V(I, {
|
|
598
594
|
size: 16,
|
|
@@ -609,12 +605,12 @@ function te(e) {
|
|
|
609
605
|
}),
|
|
610
606
|
/* @__PURE__ */ H(U, {
|
|
611
607
|
variant: "outline",
|
|
612
|
-
onClick:
|
|
613
|
-
disabled:
|
|
608
|
+
onClick: t.onRefresh,
|
|
609
|
+
disabled: t.loading,
|
|
614
610
|
children: [
|
|
615
611
|
/* @__PURE__ */ V(P, {
|
|
616
612
|
size: 16,
|
|
617
|
-
className:
|
|
613
|
+
className: e(t.loading && "animate-spin")
|
|
618
614
|
}),
|
|
619
615
|
" ",
|
|
620
616
|
r("integrations.mailbox.actions.refresh", "Refresh")
|
|
@@ -623,10 +619,10 @@ function te(e) {
|
|
|
623
619
|
]
|
|
624
620
|
});
|
|
625
621
|
}
|
|
626
|
-
function ne(
|
|
627
|
-
let { accounts: a } =
|
|
622
|
+
function ne(t) {
|
|
623
|
+
let { accounts: a } = t, o = n(), s = v(), c = v((e) => e.reset), l = g();
|
|
628
624
|
S(() => c, [c]);
|
|
629
|
-
let u = a.find((e) => e.connectionId === s.selectedConnectionId) ?? a[0] ?? null, d = u?.connectionId ?? null, [
|
|
625
|
+
let u = a.find((e) => e.connectionId === s.selectedConnectionId) ?? a[0] ?? null, d = u?.connectionId ?? null, [p, m] = T(null), { messages: h, nextPageToken: _, loading: y, error: b, refetch: x } = f({
|
|
630
626
|
connectionId: d,
|
|
631
627
|
folder: s.folder,
|
|
632
628
|
folderId: s.folderId,
|
|
@@ -645,13 +641,13 @@ function ne(e) {
|
|
|
645
641
|
}),
|
|
646
642
|
/* @__PURE__ */ V(te, {
|
|
647
643
|
connectionId: d,
|
|
648
|
-
loading:
|
|
644
|
+
loading: y,
|
|
649
645
|
onRefresh: () => void x()
|
|
650
646
|
}, d ?? "none"),
|
|
651
|
-
|
|
647
|
+
p && !s.threadId && /* @__PURE__ */ V("p", {
|
|
652
648
|
role: "status",
|
|
653
649
|
className: "text-sm text-status-success-text",
|
|
654
|
-
children:
|
|
650
|
+
children: p
|
|
655
651
|
}),
|
|
656
652
|
s.sentNotice && /* @__PURE__ */ V("p", {
|
|
657
653
|
role: "status",
|
|
@@ -662,22 +658,22 @@ function ne(e) {
|
|
|
662
658
|
className: "grid gap-4 lg:grid-cols-[minmax(0,2fr)_minmax(0,3fr)]",
|
|
663
659
|
children: [/* @__PURE__ */ V("section", {
|
|
664
660
|
"aria-label": o("integrations.mailbox.list.ariaLabel", "Messages"),
|
|
665
|
-
className:
|
|
661
|
+
className: e("rounded-xl border border-border-subtle bg-bg-surface overflow-hidden", w && "hidden lg:block"),
|
|
666
662
|
children: /* @__PURE__ */ V(Z, {
|
|
667
663
|
messages: h,
|
|
668
|
-
loading:
|
|
664
|
+
loading: y,
|
|
669
665
|
error: b,
|
|
670
666
|
refetch: x,
|
|
671
667
|
folder: s.folder,
|
|
672
668
|
threadId: s.threadId,
|
|
673
669
|
hasPrevious: s.pageTokens.length > 1,
|
|
674
|
-
nextPageToken:
|
|
670
|
+
nextPageToken: _,
|
|
675
671
|
onOpen: C,
|
|
676
672
|
onPrevious: s.previousPage,
|
|
677
673
|
onNext: s.nextPage
|
|
678
674
|
})
|
|
679
675
|
}), /* @__PURE__ */ V("section", {
|
|
680
|
-
className:
|
|
676
|
+
className: e(!w && "hidden lg:block"),
|
|
681
677
|
children: s.composing && d ? /* @__PURE__ */ V(Y, {
|
|
682
678
|
connectionId: d,
|
|
683
679
|
kind: u?.kind ?? i.Gmail,
|
|
@@ -704,14 +700,13 @@ function ne(e) {
|
|
|
704
700
|
});
|
|
705
701
|
}
|
|
706
702
|
function re() {
|
|
707
|
-
let { accounts: e, answered: t, error: n } =
|
|
703
|
+
let { accounts: e, answered: t, error: n } = u();
|
|
708
704
|
return !t && !n ? /* @__PURE__ */ V("div", {
|
|
709
705
|
className: "flex items-center justify-center py-24",
|
|
710
706
|
"data-testid": "mailbox-loading",
|
|
711
707
|
children: /* @__PURE__ */ V(k, { className: "size-6 animate-spin text-primary" })
|
|
712
708
|
}) : e.length === 0 ? /* @__PURE__ */ V(Q, { errorMessage: n?.message ?? null }) : /* @__PURE__ */ V(ne, { accounts: e });
|
|
713
709
|
}
|
|
714
|
-
//#endregion
|
|
715
710
|
export { re as MailboxInbox };
|
|
716
711
|
|
|
717
712
|
//# sourceMappingURL=MailboxInbox.js.map
|