@open-workspace/email 0.4.1 → 0.5.0
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/README.md +9 -4
- package/alchemy/index.ts +130 -2
- package/drizzle/mailbox/0002_good_komodo.sql +2 -0
- package/drizzle/mailbox/0003_after_0_4_2.sql +180 -0
- package/drizzle/mailbox/meta/0002_snapshot.json +1017 -0
- package/drizzle/mailbox/meta/0003_snapshot.json +1507 -0
- package/drizzle/mailbox/meta/_journal.json +14 -0
- package/drizzle/mailbox/migrations.js +5 -1
- package/migrations/0001_overrated_ricochet.sql +2 -0
- package/migrations/0002_after_0_4_2.sql +35 -0
- package/migrations/meta/0001_snapshot.json +564 -0
- package/migrations/meta/0002_snapshot.json +807 -0
- package/migrations/meta/_journal.json +14 -0
- package/package.json +23 -7
- package/shared/attachment-preview.ts +18 -8
- package/shared/folder-order.ts +31 -6
- package/shared/mail-headers.ts +3 -3
- package/shared/mail-html.ts +25 -0
- package/shared/mail-import.ts +0 -7
- package/shared/mail-received.ts +4 -4
- package/shared/mail-rule-actions.ts +47 -0
- package/shared/mail.ts +70 -4
- package/shared/office-preview.ts +0 -4
- package/shared/pdfjs-assets.ts +1 -3
- package/shared/rich-content.ts +35 -0
- package/shared/signature.ts +15 -0
- package/src/admin/address-auto-reply.tsx +49 -0
- package/src/admin/blocked-senders.tsx +86 -66
- package/src/admin/forward-destinations.tsx +140 -0
- package/src/admin/mail-archive.tsx +134 -0
- package/src/admin/team-signature.tsx +90 -0
- package/src/client.tsx +130 -16
- package/src/mail/attachment-preview-dialog.tsx +13 -5
- package/src/mail/auto-reply-banner.tsx +61 -0
- package/src/mail/blocked-senders.tsx +124 -91
- package/src/mail/compose-window-chrome.tsx +20 -8
- package/src/mail/compose-window.tsx +387 -365
- package/src/mail/composer-asset-bookmarks.ts +47 -12
- package/src/mail/composer-attachment-list.tsx +42 -17
- package/src/mail/composer-editor-document.ts +54 -10
- package/src/mail/composer-editor.tsx +44 -44
- package/src/mail/composer-link-text.ts +42 -0
- package/src/mail/composer-recipient-fields.tsx +25 -16
- package/src/mail/composer-recipients.ts +62 -16
- package/src/mail/composer-session.ts +107 -23
- package/src/mail/composer-toolbar.tsx +15 -1
- package/src/mail/composer-upload-client.ts +29 -1
- package/src/mail/composer-upload-progress.ts +2 -2
- package/src/mail/conversation-actions-model.ts +56 -0
- package/src/mail/conversation-list.tsx +263 -128
- package/src/mail/conversation-loading-skeleton.tsx +165 -90
- package/src/mail/conversation-message.tsx +257 -102
- package/src/mail/conversation-order.ts +12 -0
- package/src/mail/conversation-reply.tsx +313 -189
- package/src/mail/conversation-selection-toolbar.tsx +188 -143
- package/src/mail/conversation-view.tsx +320 -85
- package/src/mail/delivery-indicator.tsx +33 -12
- package/src/mail/draft-attachments.ts +194 -0
- package/src/mail/email-html-body.tsx +97 -53
- package/src/mail/folder-cleanup-bar.tsx +193 -0
- package/src/mail/folder-glyph.tsx +5 -0
- package/src/mail/folder-manager.tsx +71 -38
- package/src/mail/mail-app-bar.tsx +15 -3
- package/src/mail/mail-dock.tsx +19 -3
- package/src/mail/mail-focus.ts +48 -0
- package/src/mail/mail-folders.ts +14 -2
- package/src/mail/mail-layout.css +20 -0
- package/src/mail/mail-mailbox-sheet.tsx +22 -69
- package/src/mail/mail-nav-rail.tsx +7 -4
- package/src/mail/mail-nav.tsx +66 -46
- package/src/mail/mail-prefetch.ts +30 -9
- package/src/mail/mail-primitives.tsx +6 -4
- package/src/mail/mail-queries.ts +122 -20
- package/src/mail/mail-query-cache.ts +1085 -173
- package/src/mail/mail-search-params.ts +35 -0
- package/src/mail/mail-shell.tsx +32 -9
- package/src/mail/mailbox-ai-settings.tsx +56 -42
- package/src/mail/mailbox-realtime.tsx +4 -12
- package/src/mail/mailbox-rules.tsx +898 -0
- package/src/mail/message-actions.tsx +38 -26
- package/src/mail/message-attachments.tsx +20 -12
- package/src/mail/message-body.ts +53 -0
- package/src/mail/message-format.ts +8 -2
- package/src/mail/message-header.tsx +3 -1
- package/src/mail/message-translation.tsx +34 -67
- package/src/mail/original-message-sheet.tsx +63 -50
- package/src/mail/original-message.ts +6 -6
- package/src/mail/pane-splitter.tsx +3 -3
- package/src/mail/pdf-preview.tsx +70 -62
- package/src/mail/plain-message-text.tsx +28 -0
- package/src/mail/print-message.ts +31 -36
- package/src/mail/reader-pane.tsx +134 -102
- package/src/mail/recipient-combobox.tsx +52 -29
- package/src/mail/recipient-field-row.tsx +3 -0
- package/src/mail/rich-content.ts +128 -0
- package/src/mail/sanitize-email-html.ts +57 -33
- package/src/mail/sender-actions.tsx +49 -39
- package/src/mail/sender-authentication.tsx +1 -1
- package/src/mail/sender-dialogs.tsx +67 -43
- package/src/mail/sender-security.tsx +9 -10
- package/src/mail/signature.ts +43 -0
- package/src/mail/translation-html.ts +3 -3
- package/src/mail/types.ts +12 -0
- package/src/mail/use-composer-attachment-preflight.ts +23 -60
- package/src/mail/use-composer-core.ts +286 -0
- package/src/mail/use-composer-navigation.ts +120 -0
- package/src/mail/use-composer-submission.ts +154 -19
- package/src/mail/use-conversation-actions.ts +292 -0
- package/src/mail/use-conversation-position.ts +51 -0
- package/src/mail/use-conversation-selection.ts +192 -89
- package/src/mail/use-draft-autosave.ts +394 -0
- package/src/mail/use-drafts.ts +194 -0
- package/src/mail/use-mail-controller.ts +754 -213
- package/src/mail/use-mail-data.ts +210 -100
- package/src/mail/use-mail-safety.ts +19 -38
- package/src/mail/use-mail-send.ts +18 -6
- package/src/mail/use-pdf-translation.ts +1 -1
- package/src/mail/use-reply-cc.ts +61 -0
- package/src/mail/use-visible-message-read.ts +128 -64
- package/src/pwa/push-key.ts +18 -0
- package/src/pwa/push-subscription.ts +88 -26
- package/src/settings/auto-reply-editor.tsx +454 -0
- package/src/settings/auto-reply-page.tsx +59 -0
- package/src/settings/mail-apps-page.tsx +52 -43
- package/src/settings/notifications-page.tsx +82 -67
- package/src/settings/rich-content-editor.tsx +182 -0
- package/src/settings/settings-queries.ts +57 -0
- package/src/settings/signature-editor.tsx +142 -0
- package/src/settings/signature-page.tsx +70 -0
- package/worker/admin/blocked-sender-routes.ts +10 -16
- package/worker/backups/eml.ts +185 -0
- package/worker/backups/file-parts.ts +140 -0
- package/worker/backups/mail-backup.ts +644 -0
- package/worker/backups/settings-backup.ts +866 -0
- package/worker/backups/stream-eml.ts +73 -0
- package/worker/db/schema.ts +98 -2
- package/worker/jmap/attachment-blobs.ts +113 -0
- package/worker/jmap/blobs.ts +162 -0
- package/worker/jmap/draft-content.ts +42 -0
- package/worker/jmap/drafts.ts +70 -0
- package/worker/jmap/email-body.ts +152 -0
- package/worker/jmap/email-methods.ts +1223 -0
- package/worker/jmap/eventsource.ts +9 -8
- package/worker/jmap/import-methods.ts +205 -0
- package/worker/jmap/mailbox-methods.ts +187 -0
- package/worker/jmap/method-core.ts +379 -0
- package/worker/jmap/methods.ts +108 -1815
- package/worker/jmap/push-subscription-methods.ts +373 -0
- package/worker/jmap/push-types.ts +46 -2
- package/worker/jmap/push.ts +24 -31
- package/worker/jmap/routes.ts +144 -153
- package/worker/jmap/submission-methods.ts +395 -0
- package/worker/mail/access.ts +35 -12
- package/worker/mail/ai-classification.ts +2 -2
- package/worker/mail/archive-object.ts +96 -0
- package/worker/mail/archive-routes.ts +35 -0
- package/worker/mail/archive.ts +682 -0
- package/worker/mail/auth-headers.ts +48 -40
- package/worker/mail/auto-reply-routes.ts +255 -0
- package/worker/mail/auto-reply.ts +243 -0
- package/worker/mail/bimi.ts +53 -36
- package/worker/mail/bootstrap.ts +11 -3
- package/worker/mail/capabilities.ts +69 -0
- package/worker/mail/classification-signals.ts +1 -1
- package/worker/mail/confusables-data.ts +9 -0
- package/worker/mail/conversation-cursor.ts +6 -15
- package/worker/mail/delivery-events.ts +9 -7
- package/worker/mail/delivery-facts.ts +1 -1
- package/worker/mail/demo-routes.ts +3 -3
- package/worker/mail/doh.ts +3 -3
- package/worker/mail/download-links.ts +153 -0
- package/worker/mail/downloads.ts +2 -6
- package/worker/mail/draft-routes.ts +473 -0
- package/worker/mail/draft-sender.ts +54 -0
- package/worker/mail/edge-cache.ts +41 -55
- package/worker/mail/email-routing.ts +123 -0
- package/worker/mail/forward-destinations.ts +114 -0
- package/worker/mail/forward-downloads.ts +115 -0
- package/worker/mail/forward-html.ts +85 -0
- package/worker/mail/header-metadata.ts +2 -5
- package/worker/mail/impersonation.ts +102 -101
- package/worker/mail/import-routes.ts +29 -82
- package/worker/mail/import.ts +130 -0
- package/worker/mail/inbound-delivery.ts +6 -5
- package/worker/mail/inbound.ts +58 -28
- package/worker/mail/ip-intel.ts +8 -17
- package/worker/mail/isolate-cache.ts +1 -1
- package/worker/mail/mailbox-deletion.ts +33 -12
- package/worker/mail/mailbox-directory.ts +39 -65
- package/worker/mail/mailing-list.ts +29 -58
- package/worker/mail/message-security.ts +3 -3
- package/worker/mail/message-view.ts +12 -10
- package/worker/mail/office-conversion.ts +3 -5
- package/worker/mail/office-preview-container.ts +3 -8
- package/worker/mail/outbound-content.ts +139 -65
- package/worker/mail/outbound-delivery.ts +20 -17
- package/worker/mail/outbound-service.ts +34 -9
- package/worker/mail/outbound.ts +146 -75
- package/worker/mail/outgoing-context.ts +60 -30
- package/worker/mail/participants.ts +10 -15
- package/worker/mail/plain-body.ts +39 -0
- package/worker/mail/push-endpoint.ts +17 -0
- package/worker/mail/push-notifications.ts +87 -43
- package/worker/mail/quote-parser.ts +107 -25
- package/worker/mail/r2-presigned-urls.ts +7 -0
- package/worker/mail/receive.ts +146 -39
- package/worker/mail/recipients.ts +1 -1
- package/worker/mail/remote-proxy.ts +3 -3
- package/worker/mail/repeat.ts +1 -1
- package/worker/mail/reply-plan.ts +124 -26
- package/worker/mail/rfc.ts +15 -7
- package/worker/mail/rich-content.ts +207 -0
- package/worker/mail/routes.ts +696 -304
- package/worker/mail/routing.ts +274 -0
- package/worker/mail/rules.ts +230 -0
- package/worker/mail/safety-routes.ts +88 -80
- package/worker/mail/schemas.ts +222 -31
- package/worker/mail/search.ts +25 -2
- package/worker/mail/security-settings.ts +4 -10
- package/worker/mail/send-message.ts +238 -0
- package/worker/mail/sender-intel.ts +12 -20
- package/worker/mail/signature-routes.ts +201 -0
- package/worker/mail/signatures.ts +195 -0
- package/worker/mail/spamhaus.ts +28 -16
- package/worker/mail/storage-keys.ts +35 -0
- package/worker/mail/unsubscribe.ts +19 -41
- package/worker/mail/uploads.ts +193 -80
- package/worker/mail/webhook-source.ts +3 -2
- package/worker/mail/workspace-safety.ts +194 -60
- package/worker/mailbox/demo.ts +13 -15
- package/worker/mailbox/email-index.ts +92 -13
- package/worker/mailbox/folder-model.ts +0 -20
- package/worker/mailbox/import-placement.ts +21 -36
- package/worker/mailbox/inbound-decision.ts +114 -0
- package/worker/mailbox/inbox-counts.ts +45 -25
- package/worker/mailbox/index.ts +843 -2888
- package/worker/mailbox/jmap-change-log.ts +195 -0
- package/worker/mailbox/jmap-email-rows.ts +186 -0
- package/worker/mailbox/jmap-mailboxes.ts +116 -0
- package/worker/mailbox/jmap-placement.ts +139 -0
- package/worker/mailbox/jmap-query-filter.ts +231 -0
- package/worker/mailbox/jmap-store.ts +167 -299
- package/worker/mailbox/mailbox-auto-reply.ts +301 -0
- package/worker/mailbox/mailbox-backup.ts +538 -0
- package/worker/mailbox/mailbox-drafts.ts +417 -0
- package/worker/mailbox/mailbox-folders.ts +242 -0
- package/worker/mailbox/mailbox-import.ts +450 -0
- package/worker/mailbox/mailbox-inbound.ts +934 -0
- package/worker/mailbox/mailbox-jmap.ts +294 -0
- package/worker/mailbox/mailbox-outbound.ts +413 -0
- package/worker/mailbox/mailbox-rules.ts +336 -0
- package/worker/mailbox/mailbox-senders.ts +294 -0
- package/worker/mailbox/mailbox-storage.ts +438 -0
- package/worker/mailbox/mailbox-views.ts +891 -0
- package/worker/mailbox/model.ts +1 -0
- package/worker/mailbox/office-preview-jobs.ts +59 -47
- package/worker/mailbox/placement.ts +933 -0
- package/worker/mailbox/restore-thread.ts +52 -0
- package/worker/mailbox/retention.ts +36 -0
- package/worker/mailbox/schema.ts +211 -1
- package/worker/mailbox/senders.ts +216 -178
- package/worker/mailbox/spam-undo-filing.ts +138 -0
- package/worker/mailbox/spam-undo.ts +240 -0
- package/worker/mailbox/support.ts +416 -0
- package/worker/mcp/mail-action-tools.ts +156 -0
- package/worker/mcp/mail-compose-tools.ts +8 -2
- package/worker/mcp/mail-safety-tools.ts +4 -4
- package/worker/module.ts +23 -2
- package/src/mail/use-compose-submission.ts +0 -208
- package/src/mail/use-reply-submission.ts +0 -114
- package/worker/mail/capped-body.ts +0 -36
|
@@ -29,9 +29,15 @@ import {
|
|
|
29
29
|
import { useState } from "react";
|
|
30
30
|
import type { ReactNode } from "react";
|
|
31
31
|
|
|
32
|
+
import { conversationFolder } from "../../shared/folder-order";
|
|
33
|
+
import {
|
|
34
|
+
actionFolder,
|
|
35
|
+
canArchiveOrRestore,
|
|
36
|
+
conversationActionsIn,
|
|
37
|
+
} from "./conversation-actions-model";
|
|
32
38
|
import { orderedFolders } from "./mail-folders";
|
|
33
39
|
import { ToolbarTooltip } from "./toolbar-tooltip";
|
|
34
|
-
import type { MailFolder } from "./types";
|
|
40
|
+
import type { ConversationSummary, MailFolder } from "./types";
|
|
35
41
|
import type { BulkConversationAction } from "./use-mail-data";
|
|
36
42
|
|
|
37
43
|
function ActionButton({
|
|
@@ -64,36 +70,34 @@ function ActionButton({
|
|
|
64
70
|
}
|
|
65
71
|
|
|
66
72
|
export function ConversationSelectionToolbar({
|
|
73
|
+
onDiscardDrafts,
|
|
67
74
|
sharedMailboxName,
|
|
68
75
|
canDeletePermanently,
|
|
69
76
|
folder,
|
|
70
77
|
folders,
|
|
71
|
-
|
|
78
|
+
selected,
|
|
72
79
|
allLoadedSelected,
|
|
73
|
-
someLoadedSelected,
|
|
74
|
-
anySelectedUnread,
|
|
75
|
-
hasSelectedIncoming,
|
|
76
|
-
allSelectedHaveIncoming,
|
|
77
80
|
busy,
|
|
78
81
|
onToggleAll,
|
|
79
82
|
onAction,
|
|
80
83
|
onReport,
|
|
84
|
+
onNotSpam,
|
|
81
85
|
onExit,
|
|
82
86
|
}: {
|
|
87
|
+
/** In Drafts, discarding is the only action. */
|
|
88
|
+
onDiscardDrafts?: () => void;
|
|
83
89
|
sharedMailboxName?: string;
|
|
84
90
|
canDeletePermanently: boolean;
|
|
85
91
|
folder: string;
|
|
86
92
|
folders: MailFolder[];
|
|
87
|
-
|
|
93
|
+
selected: ConversationSummary[];
|
|
88
94
|
allLoadedSelected: boolean;
|
|
89
|
-
someLoadedSelected: boolean;
|
|
90
|
-
anySelectedUnread: boolean;
|
|
91
|
-
hasSelectedIncoming: boolean;
|
|
92
|
-
allSelectedHaveIncoming: boolean;
|
|
93
95
|
busy: boolean;
|
|
94
96
|
onToggleAll: () => void;
|
|
95
97
|
onAction: (action: BulkConversationAction, verb: string) => void;
|
|
96
98
|
onReport: () => void;
|
|
99
|
+
/** Not spam, as the single action does (trust, feedback, rejoining). */
|
|
100
|
+
onNotSpam: () => void;
|
|
97
101
|
onExit: () => void;
|
|
98
102
|
}) {
|
|
99
103
|
const [deleteDialogOpen, setDeleteDialogOpen] = useState(false);
|
|
@@ -104,10 +108,33 @@ export function ConversationSelectionToolbar({
|
|
|
104
108
|
(item) => item.kind === "custom"
|
|
105
109
|
);
|
|
106
110
|
|
|
107
|
-
const
|
|
108
|
-
|
|
111
|
+
const offered = conversationActionsIn(actionFolder(systemType ?? folder));
|
|
112
|
+
|
|
113
|
+
const selectedCount = selected.length;
|
|
114
|
+
const anySelectedUnread = selected.some((row) => row.isUnread);
|
|
115
|
+
const hasSelectedIncoming = selected.some((row) => row.hasIncoming);
|
|
116
|
+
const allSelectedHaveIncoming = selected.every((row) => row.hasIncoming);
|
|
117
|
+
|
|
118
|
+
// Inbox and Sent can list conversations filed elsewhere.
|
|
119
|
+
const selectedFolders = new Set(
|
|
120
|
+
selected.flatMap((row) =>
|
|
121
|
+
row.draftId === null ? [conversationFolder(row)] : []
|
|
122
|
+
)
|
|
123
|
+
);
|
|
124
|
+
|
|
125
|
+
const commonFolder =
|
|
126
|
+
selectedFolders.size === 1 ? [...selectedFolders][0] : undefined;
|
|
109
127
|
|
|
110
128
|
const nothingSelected = selectedCount === 0;
|
|
129
|
+
|
|
130
|
+
const showArchive = nothingSelected
|
|
131
|
+
? offered.archive
|
|
132
|
+
: selected.some((row) => canArchiveOrRestore(row, "archive"));
|
|
133
|
+
|
|
134
|
+
const showRestore = nothingSelected
|
|
135
|
+
? offered.restore
|
|
136
|
+
: selected.some((row) => canArchiveOrRestore(row, "active"));
|
|
137
|
+
|
|
111
138
|
const disabled = busy || nothingSelected;
|
|
112
139
|
const moveDisabled = disabled || !allSelectedHaveIncoming;
|
|
113
140
|
|
|
@@ -124,7 +151,7 @@ export function ConversationSelectionToolbar({
|
|
|
124
151
|
<label className="mr-auto flex min-w-0 items-center gap-2 pr-2 lg:mr-1">
|
|
125
152
|
<Checkbox
|
|
126
153
|
checked={allLoadedSelected}
|
|
127
|
-
indeterminate={
|
|
154
|
+
indeterminate={!nothingSelected && !allLoadedSelected}
|
|
128
155
|
disabled={busy}
|
|
129
156
|
aria-label={
|
|
130
157
|
allLoadedSelected
|
|
@@ -138,150 +165,168 @@ export function ConversationSelectionToolbar({
|
|
|
138
165
|
</span>
|
|
139
166
|
</label>
|
|
140
167
|
|
|
141
|
-
|
|
142
|
-
label={
|
|
143
|
-
anySelectedUnread
|
|
144
|
-
? "Mark selected as read"
|
|
145
|
-
: "Mark selected as unread"
|
|
146
|
-
}
|
|
147
|
-
disabled={disabled || !hasSelectedIncoming}
|
|
148
|
-
onClick={() =>
|
|
149
|
-
onAction(
|
|
150
|
-
{ type: "read", isRead: anySelectedUnread },
|
|
151
|
-
anySelectedUnread ? "marked as read" : "marked as unread"
|
|
152
|
-
)
|
|
153
|
-
}
|
|
154
|
-
>
|
|
155
|
-
{busy ? (
|
|
156
|
-
<LoaderCircle className="animate-spin" />
|
|
157
|
-
) : anySelectedUnread ? (
|
|
158
|
-
<MailOpen />
|
|
159
|
-
) : (
|
|
160
|
-
<Mail />
|
|
161
|
-
)}
|
|
162
|
-
</ActionButton>
|
|
163
|
-
|
|
164
|
-
{isInboxDistribution ? (
|
|
165
|
-
<ActionButton
|
|
166
|
-
label={`Archive selected${sharedSuffix}`}
|
|
167
|
-
disabled={disabled}
|
|
168
|
-
onClick={() =>
|
|
169
|
-
onAction(
|
|
170
|
-
{ type: "update", update: { mailboxState: "archive" } },
|
|
171
|
-
"archived"
|
|
172
|
-
)
|
|
173
|
-
}
|
|
174
|
-
>
|
|
175
|
-
<Archive />
|
|
176
|
-
</ActionButton>
|
|
177
|
-
) : null}
|
|
178
|
-
{["archive", "spam", "trash"].includes(systemType ?? "") ? (
|
|
168
|
+
{onDiscardDrafts ? (
|
|
179
169
|
<ActionButton
|
|
180
|
-
label=
|
|
181
|
-
|
|
182
|
-
? `Mark selected as not spam${sharedSuffix}`
|
|
183
|
-
: `Restore selected${sharedSuffix}`
|
|
184
|
-
}
|
|
170
|
+
label="Discard selected drafts"
|
|
171
|
+
destructive
|
|
185
172
|
disabled={disabled}
|
|
186
|
-
onClick={
|
|
187
|
-
onAction(
|
|
188
|
-
{ type: "update", update: { mailboxState: "active" } },
|
|
189
|
-
systemType === "spam" ? "marked as not spam" : "restored"
|
|
190
|
-
)
|
|
191
|
-
}
|
|
173
|
+
onClick={onDiscardDrafts}
|
|
192
174
|
>
|
|
193
|
-
<
|
|
175
|
+
{busy ? <LoaderCircle className="animate-spin" /> : <Trash2 />}
|
|
194
176
|
</ActionButton>
|
|
195
|
-
) :
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
177
|
+
) : (
|
|
178
|
+
<>
|
|
179
|
+
<ActionButton
|
|
180
|
+
label={
|
|
181
|
+
anySelectedUnread
|
|
182
|
+
? "Mark selected as read"
|
|
183
|
+
: "Mark selected as unread"
|
|
184
|
+
}
|
|
185
|
+
disabled={disabled || !hasSelectedIncoming}
|
|
186
|
+
onClick={() =>
|
|
187
|
+
onAction(
|
|
188
|
+
{ type: "read", isRead: anySelectedUnread },
|
|
189
|
+
anySelectedUnread ? "marked as read" : "marked as unread"
|
|
190
|
+
)
|
|
207
191
|
}
|
|
208
192
|
>
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
193
|
+
{busy ? (
|
|
194
|
+
<LoaderCircle className="animate-spin" />
|
|
195
|
+
) : anySelectedUnread ? (
|
|
196
|
+
<MailOpen />
|
|
197
|
+
) : (
|
|
198
|
+
<Mail />
|
|
199
|
+
)}
|
|
200
|
+
</ActionButton>
|
|
201
|
+
|
|
202
|
+
{showArchive ? (
|
|
203
|
+
<ActionButton
|
|
204
|
+
label={`Archive selected${sharedSuffix}`}
|
|
205
|
+
disabled={disabled}
|
|
218
206
|
onClick={() =>
|
|
219
207
|
onAction(
|
|
220
|
-
{
|
|
221
|
-
|
|
222
|
-
update: { mailboxState: "active", folderId: null },
|
|
223
|
-
},
|
|
224
|
-
"moved to Inbox"
|
|
208
|
+
{ type: "update", update: { mailboxState: "archive" } },
|
|
209
|
+
"archived"
|
|
225
210
|
)
|
|
226
211
|
}
|
|
227
212
|
>
|
|
228
|
-
<
|
|
229
|
-
</
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
)
|
|
213
|
+
<Archive />
|
|
214
|
+
</ActionButton>
|
|
215
|
+
) : null}
|
|
216
|
+
{showRestore || offered.notSpam ? (
|
|
217
|
+
<ActionButton
|
|
218
|
+
label={
|
|
219
|
+
offered.notSpam
|
|
220
|
+
? `Mark selected as not spam${sharedSuffix}`
|
|
221
|
+
: `Restore selected${sharedSuffix}`
|
|
222
|
+
}
|
|
223
|
+
disabled={disabled}
|
|
224
|
+
onClick={() =>
|
|
225
|
+
offered.notSpam
|
|
226
|
+
? onNotSpam()
|
|
227
|
+
: onAction(
|
|
228
|
+
{ type: "update", update: { mailboxState: "active" } },
|
|
229
|
+
"restored"
|
|
230
|
+
)
|
|
231
|
+
}
|
|
232
|
+
>
|
|
233
|
+
<Inbox />
|
|
234
|
+
</ActionButton>
|
|
235
|
+
) : null}
|
|
236
|
+
|
|
237
|
+
<DropdownMenu>
|
|
238
|
+
<ToolbarTooltip label={`Move selected${sharedSuffix}`}>
|
|
239
|
+
<DropdownMenuTrigger
|
|
240
|
+
render={
|
|
241
|
+
<Button
|
|
242
|
+
type="button"
|
|
243
|
+
variant="ghost"
|
|
244
|
+
size="icon-sm"
|
|
245
|
+
disabled={moveDisabled}
|
|
246
|
+
/>
|
|
242
247
|
}
|
|
243
248
|
>
|
|
244
|
-
<FolderInput />
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
249
|
+
<FolderInput />
|
|
250
|
+
<span className="sr-only">Move selected</span>
|
|
251
|
+
</DropdownMenuTrigger>
|
|
252
|
+
</ToolbarTooltip>
|
|
253
|
+
<DropdownMenuContent align="end" className="w-64">
|
|
254
|
+
<DropdownMenuGroup>
|
|
255
|
+
<DropdownMenuLabel>Move to</DropdownMenuLabel>
|
|
256
|
+
<DropdownMenuItem
|
|
257
|
+
disabled={commonFolder === "inbox"}
|
|
258
|
+
onClick={() =>
|
|
259
|
+
onAction(
|
|
260
|
+
{
|
|
261
|
+
type: "update",
|
|
262
|
+
update: { mailboxState: "active", folderId: null },
|
|
263
|
+
},
|
|
264
|
+
"moved to Inbox"
|
|
265
|
+
)
|
|
266
|
+
}
|
|
267
|
+
>
|
|
268
|
+
<Inbox /> Inbox
|
|
269
|
+
</DropdownMenuItem>
|
|
270
|
+
{customFolders.map((item) => (
|
|
271
|
+
<DropdownMenuItem
|
|
272
|
+
key={item.id}
|
|
273
|
+
disabled={item.id === commonFolder}
|
|
274
|
+
onClick={() =>
|
|
275
|
+
onAction(
|
|
276
|
+
{
|
|
277
|
+
type: "update",
|
|
278
|
+
update: {
|
|
279
|
+
mailboxState: "active",
|
|
280
|
+
folderId: item.id,
|
|
281
|
+
},
|
|
282
|
+
},
|
|
283
|
+
`moved to ${item.name}`
|
|
284
|
+
)
|
|
285
|
+
}
|
|
286
|
+
>
|
|
287
|
+
<FolderInput /> {item.name}
|
|
288
|
+
</DropdownMenuItem>
|
|
289
|
+
))}
|
|
290
|
+
</DropdownMenuGroup>
|
|
291
|
+
</DropdownMenuContent>
|
|
292
|
+
</DropdownMenu>
|
|
250
293
|
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
294
|
+
{offered.deleteForever ? (
|
|
295
|
+
canDeletePermanently ? (
|
|
296
|
+
<ActionButton
|
|
297
|
+
label="Delete selected permanently"
|
|
298
|
+
destructive
|
|
299
|
+
disabled={disabled}
|
|
300
|
+
onClick={() => setDeleteDialogOpen(true)}
|
|
301
|
+
>
|
|
302
|
+
<Trash2 />
|
|
303
|
+
</ActionButton>
|
|
304
|
+
) : null
|
|
305
|
+
) : (
|
|
306
|
+
<ActionButton
|
|
307
|
+
label={`Move selected to Trash${sharedSuffix}`}
|
|
308
|
+
disabled={disabled}
|
|
309
|
+
onClick={() =>
|
|
310
|
+
onAction(
|
|
311
|
+
{ type: "update", update: { mailboxState: "trash" } },
|
|
312
|
+
"moved to Trash"
|
|
313
|
+
)
|
|
314
|
+
}
|
|
315
|
+
>
|
|
316
|
+
<Trash2 />
|
|
317
|
+
</ActionButton>
|
|
318
|
+
)}
|
|
276
319
|
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
320
|
+
{offered.report ? (
|
|
321
|
+
<ActionButton
|
|
322
|
+
label="Report spam"
|
|
323
|
+
disabled={disabled || !hasSelectedIncoming}
|
|
324
|
+
onClick={onReport}
|
|
325
|
+
>
|
|
326
|
+
<OctagonAlert />
|
|
327
|
+
</ActionButton>
|
|
328
|
+
) : null}
|
|
329
|
+
</>
|
|
285
330
|
)}
|
|
286
331
|
|
|
287
332
|
<span className="bg-border mx-0.5 hidden h-5 w-px lg:block" />
|