@remit/ui 0.0.237 → 0.0.239
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/category-presentation.d.ts +1 -1
- package/dist/category-presentation.js +7 -1
- package/dist/components/app-shell-types.d.ts +18 -2
- package/dist/components/button.d.ts +5 -0
- package/dist/components/button.js +2 -0
- package/dist/components/check-again-panel.d.ts +43 -0
- package/dist/components/check-again-panel.js +60 -0
- package/dist/components/failure-banner.d.ts +11 -0
- package/dist/components/failure-banner.js +7 -0
- package/dist/components/intelligence-calendar-fixtures.js +0 -12
- package/dist/components/intelligence-panel.d.ts +7 -26
- package/dist/components/intelligence-panel.js +4 -16
- package/dist/components/intelligence-section.d.ts +3 -1
- package/dist/components/intelligence-section.js +2 -2
- package/dist/components/message-row.js +6 -3
- package/dist/components/nav-sidebar.d.ts +7 -2
- package/dist/components/nav-sidebar.js +9 -2
- package/dist/components/selection-top-bar.d.ts +3 -1
- package/dist/components/selection-top-bar.js +10 -2
- package/dist/components/spam-copy.d.ts +25 -0
- package/dist/components/spam-copy.js +100 -0
- package/dist/components/spam-daily-chart.d.ts +17 -0
- package/dist/components/spam-daily-chart.js +18 -0
- package/dist/components/spam-fixtures.d.ts +19 -0
- package/dist/components/spam-fixtures.js +143 -0
- package/dist/components/spam-row-marker.d.ts +12 -0
- package/dist/components/spam-row-marker.js +10 -0
- package/dist/components/spam-verdict-panel.d.ts +37 -0
- package/dist/components/spam-verdict-panel.js +74 -0
- package/dist/components/spam-warning-banner.d.ts +20 -0
- package/dist/components/spam-warning-banner.js +62 -0
- package/dist/index.d.ts +10 -3
- package/dist/index.js +8 -1
- package/dist/lib/email-render-treatment.d.ts +1 -1
- package/package.json +3 -2
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
const REASON_SENTENCES = {
|
|
2
|
+
DmarcFail: "It failed the sender domain's DMARC check.",
|
|
3
|
+
SignerMismatch: "It was signed by a different domain than its sender.",
|
|
4
|
+
ReplyToMismatch: "Replies would go to a different domain than the sender's.",
|
|
5
|
+
LinkTextMismatch: "A link's text shows one domain and opens another.",
|
|
6
|
+
LinkDomainDistant: "A link leads to a domain unrelated to the sender's.",
|
|
7
|
+
PunycodeDomain: "A domain in it is written in punycode, which can hide lookalike letters.",
|
|
8
|
+
MixedScriptDomain: "A domain in it mixes letters from different alphabets.",
|
|
9
|
+
ConfusableDomains: "Two different domains in it look the same.",
|
|
10
|
+
SingleOffDomainLink: "Its only link leads away from the sender's domain.",
|
|
11
|
+
GeneratedName: "The sender's address looks machine-generated.",
|
|
12
|
+
FirstContactDomain: "The sender's domain has sent you nothing before.",
|
|
13
|
+
RecentlyRegisteredDomain: "The sender's domain was registered recently.",
|
|
14
|
+
UnknownRegistrationDate: "The sender's domain has no public registration date.",
|
|
15
|
+
ClassifierSpam: "Remit's classifier rated it as likely spam.",
|
|
16
|
+
ClassifierPhishing: "Remit's classifier rated it as likely phishing.",
|
|
17
|
+
ProviderSpam: "Your provider marked it as spam.",
|
|
18
|
+
DisplayNameForeignAddress: "The display name spells out an address at another domain.",
|
|
19
|
+
DisplayNameLookalike: "The display name looks like a different domain's name.",
|
|
20
|
+
ModelImpersonation: "The model judged that it claims an organisation its sender does not belong to.",
|
|
21
|
+
ModelSpam: "The model judged it spam.",
|
|
22
|
+
ModelClean: "The model judged it legitimate.",
|
|
23
|
+
ListedPhishingLink: "A link in it is on a list of known phishing pages.",
|
|
24
|
+
};
|
|
25
|
+
const MODEL_REASONS = new Set([
|
|
26
|
+
"ModelImpersonation",
|
|
27
|
+
"ModelSpam",
|
|
28
|
+
"ModelClean",
|
|
29
|
+
]);
|
|
30
|
+
export const isModelReason = (reason) => MODEL_REASONS.has(reason.name);
|
|
31
|
+
export const UNKNOWN_REASON_SENTENCE = "Remit ran a check this version can't describe.";
|
|
32
|
+
export const CHECK_FAILED_HEADLINE = "Remit couldn't check this message";
|
|
33
|
+
export const BASIC_CHECKS_ONLY = "Only the basic checks ran";
|
|
34
|
+
const isDescribedReason = (name) => Object.hasOwn(REASON_SENTENCES, name);
|
|
35
|
+
/**
|
|
36
|
+
* The one sentence a reason reads as, wherever it shows. A backend symbol, or
|
|
37
|
+
* a name this version does not know, yields `undefined`: the caller shows the
|
|
38
|
+
* raw symbol and a report link instead of a guess.
|
|
39
|
+
*/
|
|
40
|
+
export function spamReasonSentence(name) {
|
|
41
|
+
return isDescribedReason(name) ? REASON_SENTENCES[name] : undefined;
|
|
42
|
+
}
|
|
43
|
+
export function topSpamReason(reasons) {
|
|
44
|
+
return reasons.reduce((top, reason) => (top && top.score >= reason.score ? top : reason), undefined);
|
|
45
|
+
}
|
|
46
|
+
export function topSpamReasonSentence(reasons) {
|
|
47
|
+
const top = topSpamReason(reasons);
|
|
48
|
+
if (!top)
|
|
49
|
+
return "";
|
|
50
|
+
return spamReasonSentence(top.name) ?? UNKNOWN_REASON_SENTENCE;
|
|
51
|
+
}
|
|
52
|
+
/** What the model said, quoted from its reason, when it answered. */
|
|
53
|
+
export function modelSaid(verdict) {
|
|
54
|
+
if (verdict.modelOutcome !== "Answered")
|
|
55
|
+
return undefined;
|
|
56
|
+
const reason = verdict.reasons.find(isModelReason);
|
|
57
|
+
if (!reason || reason.options.length === 0)
|
|
58
|
+
return undefined;
|
|
59
|
+
return reason.options.join(" ");
|
|
60
|
+
}
|
|
61
|
+
export const MODEL_SKIP_CAUSES = {
|
|
62
|
+
NotConfigured: "this account has no model set up.",
|
|
63
|
+
DailyLimit: "this account reached its daily model limit.",
|
|
64
|
+
RateLimited: "the model provider asked Remit to slow down.",
|
|
65
|
+
};
|
|
66
|
+
/** Why the model did not weigh in on a message it would have helped with. */
|
|
67
|
+
export function modelSkipCause(verdict) {
|
|
68
|
+
const outcome = verdict.modelOutcome;
|
|
69
|
+
if (outcome === "Answered" || outcome === "OutOfBand")
|
|
70
|
+
return undefined;
|
|
71
|
+
return MODEL_SKIP_CAUSES[outcome];
|
|
72
|
+
}
|
|
73
|
+
export const SPAM_FAILURE_SENTENCES = {
|
|
74
|
+
Unreachable: "the spam service could not be reached",
|
|
75
|
+
TimedOut: "the spam service did not answer in time",
|
|
76
|
+
ServiceError: "the spam service answered with an error",
|
|
77
|
+
Unparseable: "Remit could not read the spam service's answer",
|
|
78
|
+
};
|
|
79
|
+
export const CHECK_AGAIN_FAILURE_SENTENCES = {
|
|
80
|
+
RateLimited: "try again in a minute.",
|
|
81
|
+
DailyCap: "try again tomorrow (daily model limit).",
|
|
82
|
+
NotSettled: "a move is still settling. Remit will retry it once the move lands.",
|
|
83
|
+
NotFound: "the message is gone from the server. No retry for this one.",
|
|
84
|
+
NotPermitted: "the server refused access to this message. No retry for this one.",
|
|
85
|
+
};
|
|
86
|
+
export const SPAM_SCREEN_SENTENCES = {
|
|
87
|
+
NeverSpam: "You marked this sender Never in Spam.",
|
|
88
|
+
Vip: "This sender is a VIP.",
|
|
89
|
+
WellKnown: "You know this sender well.",
|
|
90
|
+
Newsletter: "It is a newsletter from a sender you already get mail from.",
|
|
91
|
+
};
|
|
92
|
+
export const filterScreenSentence = (filterName) => `Your filter "${filterName}" matched it.`;
|
|
93
|
+
export const SPAM_WARN_HEADLINES = {
|
|
94
|
+
Spam: "Remit suspects this is spam",
|
|
95
|
+
Phishing: "Remit suspects this message impersonates someone",
|
|
96
|
+
};
|
|
97
|
+
export const formatSpamScore = (score) => score.toFixed(2);
|
|
98
|
+
export const spamScoreSentence = (score, thresholds) => thresholds.state === "Set"
|
|
99
|
+
? `Score ${formatSpamScore(score)}. Remit warns from ${formatSpamScore(thresholds.cleanBelow)} and moves to Spam from ${formatSpamScore(thresholds.spamAt)}.`
|
|
100
|
+
: `Score ${formatSpamScore(score)}. The spam service applies its own thresholds.`;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/** One day of verdicts: what reached the Spam threshold and what only warned. */
|
|
2
|
+
export interface SpamDay {
|
|
3
|
+
date: string;
|
|
4
|
+
moved: number;
|
|
5
|
+
warned: number;
|
|
6
|
+
}
|
|
7
|
+
export interface SpamDailyChartProps {
|
|
8
|
+
title: string;
|
|
9
|
+
tone: "warning" | "danger";
|
|
10
|
+
days: SpamDay[];
|
|
11
|
+
}
|
|
12
|
+
export declare const spamDayDescription: (day: SpamDay) => string;
|
|
13
|
+
/**
|
|
14
|
+
* One bar per day, moved stacked under warned. Each bar carries its own text
|
|
15
|
+
* alternative.
|
|
16
|
+
*/
|
|
17
|
+
export declare function SpamDailyChart({ title, tone, days }: SpamDailyChartProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "../lib/cn.js";
|
|
3
|
+
const TONES = {
|
|
4
|
+
warning: { moved: "bg-warning", warned: "bg-warning/35" },
|
|
5
|
+
danger: { moved: "bg-danger", warned: "bg-danger/35" },
|
|
6
|
+
};
|
|
7
|
+
export const spamDayDescription = (day) => `${day.date}: ${day.moved} moved, ${day.warned} warned`;
|
|
8
|
+
/**
|
|
9
|
+
* One bar per day, moved stacked under warned. Each bar carries its own text
|
|
10
|
+
* alternative.
|
|
11
|
+
*/
|
|
12
|
+
export function SpamDailyChart({ title, tone, days }) {
|
|
13
|
+
const peak = Math.max(1, ...days.map((day) => day.moved + day.warned));
|
|
14
|
+
const colours = TONES[tone];
|
|
15
|
+
const first = days[0];
|
|
16
|
+
const last = days[days.length - 1];
|
|
17
|
+
return (_jsxs("figure", { className: "min-w-0", children: [_jsx("figcaption", { className: "text-xs font-semibold text-fg", children: title }), _jsx("ul", { className: "mt-2 flex h-24 list-none items-end gap-px border-b border-line", children: days.map((day) => (_jsx("li", { className: "h-full min-w-0 flex-1", children: _jsxs("span", { role: "img", "aria-label": spamDayDescription(day), className: "flex h-full flex-col justify-end", children: [_jsx("span", { className: cn("w-full rounded-t-sm", colours.warned), style: { height: `${(day.warned / peak) * 100}%` } }), _jsx("span", { className: cn("w-full", colours.moved), style: { height: `${(day.moved / peak) * 100}%` } })] }) }, day.date))) }), first && last && (_jsxs("div", { "aria-hidden": "true", className: "mt-1 flex justify-between text-2xs text-fg-subtle tabular-nums", children: [_jsx("span", { children: first.date }), _jsx("span", { children: last.date })] }))] }));
|
|
18
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { RemitImapSpamChecked, RemitImapSpamFailed, RemitImapSpamThresholdsSet } from "@remit/api-http-client/types.gen.ts";
|
|
2
|
+
import type { CheckAgainFailure } from "./check-again-panel.js";
|
|
3
|
+
import type { LabelChipData } from "./label-chip.js";
|
|
4
|
+
import type { SpamDay } from "./spam-daily-chart.js";
|
|
5
|
+
export declare const spamThresholdsFixture: RemitImapSpamThresholdsSet;
|
|
6
|
+
export declare const spamLabelFixture: LabelChipData;
|
|
7
|
+
export declare const phishingLabelFixture: LabelChipData;
|
|
8
|
+
export declare const warnSpamVerdict: RemitImapSpamChecked;
|
|
9
|
+
export declare const warnPhishingVerdict: RemitImapSpamChecked;
|
|
10
|
+
export declare const junkPhishingVerdict: RemitImapSpamChecked;
|
|
11
|
+
export declare const modelSkippedVerdict: RemitImapSpamChecked;
|
|
12
|
+
export declare const modelJudgedVerdict: RemitImapSpamChecked;
|
|
13
|
+
export declare const nowJunkVerdict: RemitImapSpamChecked;
|
|
14
|
+
export declare const warnOnlyAboveJunkVerdict: RemitImapSpamChecked;
|
|
15
|
+
export declare const unknownReasonVerdict: RemitImapSpamChecked;
|
|
16
|
+
export declare const failedVerdict: RemitImapSpamFailed;
|
|
17
|
+
export declare const checkAgainFailuresFixture: CheckAgainFailure[];
|
|
18
|
+
export declare const spamDaysFixture: SpamDay[];
|
|
19
|
+
export declare const phishingDaysFixture: SpamDay[];
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
export const spamThresholdsFixture = {
|
|
2
|
+
state: "Set",
|
|
3
|
+
cleanBelow: 0.4,
|
|
4
|
+
spamAt: 0.85,
|
|
5
|
+
};
|
|
6
|
+
export const spamLabelFixture = {
|
|
7
|
+
labelId: "label-spam",
|
|
8
|
+
name: "Spam",
|
|
9
|
+
color: "Orange",
|
|
10
|
+
};
|
|
11
|
+
export const phishingLabelFixture = {
|
|
12
|
+
labelId: "label-phishing",
|
|
13
|
+
name: "Phishing",
|
|
14
|
+
color: "Red",
|
|
15
|
+
};
|
|
16
|
+
const reason = (name, score, options = []) => ({ name, symbol: name, score, options });
|
|
17
|
+
export const warnSpamVerdict = {
|
|
18
|
+
state: "Checked",
|
|
19
|
+
score: 0.72,
|
|
20
|
+
action: "Warn",
|
|
21
|
+
kind: "Spam",
|
|
22
|
+
modelOutcome: "OutOfBand",
|
|
23
|
+
reasons: [
|
|
24
|
+
reason("LinkTextMismatch", 0.3, ["bank.example -> login-check.example"]),
|
|
25
|
+
reason("FirstContactDomain", 0.25, ["sender-domain.example"]),
|
|
26
|
+
reason("ProviderSpam", 0.17),
|
|
27
|
+
],
|
|
28
|
+
};
|
|
29
|
+
export const warnPhishingVerdict = {
|
|
30
|
+
state: "Checked",
|
|
31
|
+
score: 0.68,
|
|
32
|
+
action: "Warn",
|
|
33
|
+
kind: "Phishing",
|
|
34
|
+
modelOutcome: "OutOfBand",
|
|
35
|
+
reasons: [
|
|
36
|
+
reason("DisplayNameForeignAddress", 0.4, [
|
|
37
|
+
'"support@bank.example" <x@other.example>',
|
|
38
|
+
]),
|
|
39
|
+
reason("DmarcFail", 0.28),
|
|
40
|
+
],
|
|
41
|
+
};
|
|
42
|
+
export const junkPhishingVerdict = {
|
|
43
|
+
...warnPhishingVerdict,
|
|
44
|
+
score: 0.93,
|
|
45
|
+
action: "Junk",
|
|
46
|
+
};
|
|
47
|
+
export const modelSkippedVerdict = {
|
|
48
|
+
...warnSpamVerdict,
|
|
49
|
+
modelOutcome: "DailyLimit",
|
|
50
|
+
};
|
|
51
|
+
export const modelJudgedVerdict = {
|
|
52
|
+
state: "Checked",
|
|
53
|
+
score: 0.61,
|
|
54
|
+
action: "Warn",
|
|
55
|
+
kind: "Spam",
|
|
56
|
+
modelOutcome: "Answered",
|
|
57
|
+
reasons: [
|
|
58
|
+
reason("RecentlyRegisteredDomain", 0.35, ["registered 2026-11-02"]),
|
|
59
|
+
reason("ModelSpam", 0.2, [
|
|
60
|
+
"It pushes a payment link from a domain registered last week.",
|
|
61
|
+
]),
|
|
62
|
+
],
|
|
63
|
+
};
|
|
64
|
+
export const nowJunkVerdict = {
|
|
65
|
+
...warnSpamVerdict,
|
|
66
|
+
score: 0.88,
|
|
67
|
+
action: "Junk",
|
|
68
|
+
};
|
|
69
|
+
export const warnOnlyAboveJunkVerdict = {
|
|
70
|
+
state: "Checked",
|
|
71
|
+
score: 0.9,
|
|
72
|
+
action: "Warn",
|
|
73
|
+
kind: "Spam",
|
|
74
|
+
modelOutcome: "Answered",
|
|
75
|
+
reasons: [
|
|
76
|
+
reason("LinkTextMismatch", 0.5, ["bank.example -> login-check.example"]),
|
|
77
|
+
reason("FirstContactDomain", 0.4, ["sender-domain.example"]),
|
|
78
|
+
],
|
|
79
|
+
};
|
|
80
|
+
export const unknownReasonVerdict = {
|
|
81
|
+
state: "Checked",
|
|
82
|
+
score: 0.55,
|
|
83
|
+
action: "Warn",
|
|
84
|
+
kind: "Spam",
|
|
85
|
+
modelOutcome: "Answered",
|
|
86
|
+
reasons: [
|
|
87
|
+
reason("ProviderSpam", 0.3),
|
|
88
|
+
{
|
|
89
|
+
name: "BackendSymbol",
|
|
90
|
+
symbol: "MIME_HTML_ONLY",
|
|
91
|
+
score: 0.25,
|
|
92
|
+
options: [],
|
|
93
|
+
},
|
|
94
|
+
],
|
|
95
|
+
};
|
|
96
|
+
export const failedVerdict = {
|
|
97
|
+
state: "Failed",
|
|
98
|
+
kind: "TimedOut",
|
|
99
|
+
};
|
|
100
|
+
export const checkAgainFailuresFixture = [
|
|
101
|
+
{
|
|
102
|
+
messageId: "m-1",
|
|
103
|
+
subject: "Subject line",
|
|
104
|
+
code: "RateLimited",
|
|
105
|
+
retryable: true,
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
messageId: "m-2",
|
|
109
|
+
subject: "Subject line",
|
|
110
|
+
code: "RateLimited",
|
|
111
|
+
retryable: true,
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
messageId: "m-3",
|
|
115
|
+
subject: "Subject line",
|
|
116
|
+
code: "DailyCap",
|
|
117
|
+
retryable: true,
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
messageId: "m-4",
|
|
121
|
+
subject: "Subject line",
|
|
122
|
+
code: "NotFound",
|
|
123
|
+
retryable: false,
|
|
124
|
+
},
|
|
125
|
+
];
|
|
126
|
+
const DAY_MS = 24 * 60 * 60 * 1000;
|
|
127
|
+
const LAST_DAY = Date.UTC(2026, 10, 13);
|
|
128
|
+
const isoDay = (offset) => new Date(LAST_DAY - offset * DAY_MS).toISOString().slice(0, 10);
|
|
129
|
+
const spamPattern = [3, 5, 2, 6, 4, 1, 0, 4, 7, 3, 5, 2, 3, 6, 4];
|
|
130
|
+
const phishingPattern = [0, 1, 0, 0, 2, 0, 1, 0, 0, 1, 0, 0, 2, 0, 1];
|
|
131
|
+
export const spamDaysFixture = Array.from({ length: 30 }, (_, i) => {
|
|
132
|
+
const n = spamPattern[i % spamPattern.length] ?? 0;
|
|
133
|
+
return {
|
|
134
|
+
date: isoDay(29 - i),
|
|
135
|
+
moved: n,
|
|
136
|
+
warned: Math.ceil(n / 2),
|
|
137
|
+
};
|
|
138
|
+
});
|
|
139
|
+
export const phishingDaysFixture = Array.from({ length: 30 }, (_, i) => ({
|
|
140
|
+
date: isoDay(29 - i),
|
|
141
|
+
moved: phishingPattern[i % phishingPattern.length] ?? 0,
|
|
142
|
+
warned: i % 7 === 3 ? 1 : 0,
|
|
143
|
+
}));
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type LabelChipData } from "./label-chip.js";
|
|
2
|
+
export interface SpamRowMarkerProps {
|
|
3
|
+
label: LabelChipData;
|
|
4
|
+
/** The message still sits where it arrived, under the warning. */
|
|
5
|
+
suspected: boolean;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* A thread row's one spam mark: the Remit label chip, then an outlined
|
|
9
|
+
* Suspected marker while the message sits outside Spam. A row in Spam shows
|
|
10
|
+
* the chip alone, because the folder already says it moved.
|
|
11
|
+
*/
|
|
12
|
+
export declare function SpamRowMarker({ label, suspected }: SpamRowMarkerProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { LabelChip } from "./label-chip.js";
|
|
3
|
+
/**
|
|
4
|
+
* A thread row's one spam mark: the Remit label chip, then an outlined
|
|
5
|
+
* Suspected marker while the message sits outside Spam. A row in Spam shows
|
|
6
|
+
* the chip alone, because the folder already says it moved.
|
|
7
|
+
*/
|
|
8
|
+
export function SpamRowMarker({ label, suspected }) {
|
|
9
|
+
return (_jsxs("span", { className: "inline-flex shrink-0 items-center gap-1", children: [_jsx("span", { className: "sr-only", children: suspected ? `${label.name}, suspected` : label.name }), _jsxs("span", { "aria-hidden": "true", className: "inline-flex items-center gap-1", children: [_jsx(LabelChip, { label: label, className: "max-w-20" }), suspected && (_jsx("span", { className: "rounded-full border border-warning/60 px-1.5 text-2xs font-medium leading-4 text-warning", children: "Suspected" }))] })] }));
|
|
10
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { RemitImapSpamChecked, RemitImapSpamFailed, RemitImapSpamLabelPlacement, RemitImapSpamThresholds, RemitImapSpamVerdictScreenedOut } from "@remit/api-http-client/types.gen.ts";
|
|
2
|
+
import type { ReactElement, ReactNode } from "react";
|
|
3
|
+
import type { LabelChipData } from "./label-chip.js";
|
|
4
|
+
export declare const SPAM_CHECK_HEADING_ID = "spam-check-heading";
|
|
5
|
+
/** Where a link in the Spam check section goes; the host maps it to a route. */
|
|
6
|
+
export type SpamVerdictLinkTarget = {
|
|
7
|
+
kind: "SpamSettings";
|
|
8
|
+
} | {
|
|
9
|
+
kind: "NeverInSpamSenders";
|
|
10
|
+
} | {
|
|
11
|
+
kind: "Filter";
|
|
12
|
+
filterId: string;
|
|
13
|
+
};
|
|
14
|
+
export interface SpamVerdictLinkProps {
|
|
15
|
+
target: SpamVerdictLinkTarget;
|
|
16
|
+
className: string;
|
|
17
|
+
children: ReactNode;
|
|
18
|
+
}
|
|
19
|
+
/** Renders an in-app link, so following it is a navigation, not a reload. */
|
|
20
|
+
export type SpamVerdictLinkComponent = (props: SpamVerdictLinkProps) => ReactElement;
|
|
21
|
+
export interface SpamVerdictPanelProps {
|
|
22
|
+
verdict: RemitImapSpamChecked | RemitImapSpamFailed | RemitImapSpamVerdictScreenedOut;
|
|
23
|
+
/** The Remit label the message carries, when it carries one. */
|
|
24
|
+
label?: LabelChipData;
|
|
25
|
+
thresholds: RemitImapSpamThresholds;
|
|
26
|
+
placement: RemitImapSpamLabelPlacement;
|
|
27
|
+
filterName?: string;
|
|
28
|
+
linkComponent: SpamVerdictLinkComponent;
|
|
29
|
+
reportIssueHref: (symbol: string) => string;
|
|
30
|
+
onNotSpam: () => void;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* The intelligence rail's Spam check section: what the check concluded, the
|
|
34
|
+
* score against the thresholds, and one sentence per reason. Why on the
|
|
35
|
+
* banner focuses its heading by {@link SPAM_CHECK_HEADING_ID}.
|
|
36
|
+
*/
|
|
37
|
+
export declare function SpamVerdictPanel(props: SpamVerdictPanelProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "../lib/cn.js";
|
|
3
|
+
import { Button } from "./button.js";
|
|
4
|
+
import { IntelligenceSection } from "./intelligence-section.js";
|
|
5
|
+
import { BASIC_CHECKS_ONLY, CHECK_FAILED_HEADLINE, filterScreenSentence, formatSpamScore, isModelReason, modelSaid, modelSkipCause, SPAM_FAILURE_SENTENCES, SPAM_SCREEN_SENTENCES, SPAM_WARN_HEADLINES, spamReasonSentence, spamScoreSentence, UNKNOWN_REASON_SENTENCE, } from "./spam-copy.js";
|
|
6
|
+
import { SpamRowMarker } from "./spam-row-marker.js";
|
|
7
|
+
export const SPAM_CHECK_HEADING_ID = "spam-check-heading";
|
|
8
|
+
const LINK = "text-accent-2 hover:underline";
|
|
9
|
+
function Section({ children }) {
|
|
10
|
+
return (_jsx(IntelligenceSection, { label: "Spam check", headingId: SPAM_CHECK_HEADING_ID, children: _jsx("div", { className: "space-y-2 text-sm", children: children }) }));
|
|
11
|
+
}
|
|
12
|
+
function Headline({ children }) {
|
|
13
|
+
return _jsx("p", { className: "font-semibold text-fg", children: children });
|
|
14
|
+
}
|
|
15
|
+
function ScoreBar({ score, thresholds, }) {
|
|
16
|
+
const at = (value) => `${Math.min(100, Math.max(0, value * 100))}%`;
|
|
17
|
+
return (_jsxs("div", { "aria-hidden": "true", className: "pt-4 pb-1", children: [_jsxs("div", { className: "relative h-1.5 rounded-full bg-surface-sunken", children: [_jsx("div", { className: "absolute inset-y-0 rounded-r-full bg-warning/30", style: { left: at(thresholds.cleanBelow), right: 0 } }), _jsx("div", { className: "absolute inset-y-0 rounded-r-full bg-danger/30", style: { left: at(thresholds.spamAt), right: 0 } }), [
|
|
18
|
+
{ key: "warn", value: thresholds.cleanBelow, text: "Warn" },
|
|
19
|
+
{ key: "junk", value: thresholds.spamAt, text: "Spam" },
|
|
20
|
+
].map((mark) => (_jsx("span", { className: "absolute -top-4 -translate-x-1/2 text-2xs text-fg-subtle tabular-nums", style: { left: at(mark.value) }, children: `${mark.text} ${formatSpamScore(mark.value)}` }, mark.key))), _jsx("span", { className: "absolute top-1/2 size-3 -translate-x-1/2 -translate-y-1/2 rounded-full border-2 border-surface bg-fg", style: { left: at(score) } })] }), _jsxs("div", { className: "mt-1 flex justify-between text-2xs text-fg-subtle tabular-nums", children: [_jsx("span", { children: "0" }), _jsx("span", { children: "1" })] })] }));
|
|
21
|
+
}
|
|
22
|
+
function Finding({ text }) {
|
|
23
|
+
return (_jsx("code", { className: "mt-0.5 inline-block max-w-full break-all rounded bg-surface-sunken px-1.5 py-0.5 font-mono text-2xs text-fg-muted", children: text }));
|
|
24
|
+
}
|
|
25
|
+
function ReasonItem({ reason, reportIssueHref, }) {
|
|
26
|
+
const sentence = spamReasonSentence(reason.name);
|
|
27
|
+
if (!sentence) {
|
|
28
|
+
return (_jsxs("li", { children: [_jsx("p", { className: "text-fg", children: UNKNOWN_REASON_SENTENCE }), _jsx(Finding, { text: reason.symbol }), _jsx("a", { href: reportIssueHref(reason.symbol), target: "_blank", rel: "noopener noreferrer", className: cn("ml-2 text-xs", LINK), children: "Report an issue" })] }));
|
|
29
|
+
}
|
|
30
|
+
return (_jsxs("li", { children: [_jsx("p", { className: "text-fg", children: sentence }), reason.options.length > 0 && (_jsx(Finding, { text: reason.options.join(", ") }))] }));
|
|
31
|
+
}
|
|
32
|
+
function CheckedVerdict({ verdict, label, thresholds, placement, linkComponent: Link, reportIssueHref, }) {
|
|
33
|
+
const said = modelSaid(verdict);
|
|
34
|
+
const skipped = modelSkipCause(verdict);
|
|
35
|
+
const headline = verdict.action === "Junk"
|
|
36
|
+
? "Remit moved this to Spam"
|
|
37
|
+
: verdict.action === "Warn"
|
|
38
|
+
? SPAM_WARN_HEADLINES[verdict.kind]
|
|
39
|
+
: "Remit found too little to act on";
|
|
40
|
+
const keptByWarnOnly = verdict.action !== "None" &&
|
|
41
|
+
placement === "WarnOnly" &&
|
|
42
|
+
thresholds.state === "Set" &&
|
|
43
|
+
verdict.score >= thresholds.spamAt;
|
|
44
|
+
return (_jsxs(Section, { children: [_jsx(Headline, { children: headline }), label && verdict.action !== "None" && (_jsx(SpamRowMarker, { label: label, suspected: verdict.action === "Warn" })), _jsx("p", { className: "text-fg-muted", children: spamScoreSentence(verdict.score, thresholds) }), thresholds.state === "Set" && (_jsx(ScoreBar, { score: verdict.score, thresholds: thresholds })), _jsxs("div", { children: [_jsx("h4", { className: "text-xs font-semibold text-fg", children: "Why" }), _jsx("ul", { className: "mt-1 list-disc space-y-1.5 pl-4 marker:text-fg-subtle", children: verdict.reasons
|
|
45
|
+
.filter((reason) => !isModelReason(reason))
|
|
46
|
+
.map((reason) => (_jsx(ReasonItem, { reason: reason, reportIssueHref: reportIssueHref }, reason.symbol))) })] }), said !== undefined && (_jsxs("div", { className: "text-fg-muted", children: [_jsx("p", { children: "Remit asked the model. It said:" }), _jsx("blockquote", { className: "mt-0.5 border-l-2 border-line pl-2 italic", children: said })] })), skipped !== undefined && (_jsx("p", { className: "text-fg-muted", children: `${BASIC_CHECKS_ONLY}: ${skipped}` })), keptByWarnOnly && (_jsxs("p", { className: "text-fg-muted", children: ["The score reached your Spam threshold. Spam is set to Warn only, so it stays here.", " ", _jsx(Link, { target: { kind: "SpamSettings" }, className: LINK, children: "Change in Spam & phishing settings" })] }))] }));
|
|
47
|
+
}
|
|
48
|
+
function ScreenedOutVerdict({ verdict, label, filterName, linkComponent: Link, onNotSpam, }) {
|
|
49
|
+
const { screen } = verdict;
|
|
50
|
+
if (screen.rule === "ReportedSender") {
|
|
51
|
+
return (_jsxs(Section, { children: [_jsx(Headline, { children: "You reported this sender" }), label && _jsx(SpamRowMarker, { label: label, suspected: false }), _jsx("p", { className: "text-fg-muted", children: "Remit sent their mail to Spam without checking it." }), _jsx(Button, { variant: "secondary", size: "md", onClick: onNotSpam, children: "Not spam" })] }));
|
|
52
|
+
}
|
|
53
|
+
if (screen.rule === "Filter") {
|
|
54
|
+
return (_jsxs(Section, { children: [_jsx(Headline, { children: "Remit skipped the spam check" }), _jsx("p", { className: "text-fg-muted", children: filterName
|
|
55
|
+
? filterScreenSentence(filterName)
|
|
56
|
+
: "One of your filters matched it." }), _jsx(Link, { target: { kind: "Filter", filterId: screen.filterId }, className: LINK, children: "Open the filter in Settings" })] }));
|
|
57
|
+
}
|
|
58
|
+
return (_jsxs(Section, { children: [_jsx(Headline, { children: "Remit skipped the spam check" }), _jsx("p", { className: "text-fg-muted", children: SPAM_SCREEN_SENTENCES[screen.rule] }), screen.rule === "NeverSpam" && (_jsx(Link, { target: { kind: "NeverInSpamSenders" }, className: LINK, children: "Manage in Senders & Rules" }))] }));
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* The intelligence rail's Spam check section: what the check concluded, the
|
|
62
|
+
* score against the thresholds, and one sentence per reason. Why on the
|
|
63
|
+
* banner focuses its heading by {@link SPAM_CHECK_HEADING_ID}.
|
|
64
|
+
*/
|
|
65
|
+
export function SpamVerdictPanel(props) {
|
|
66
|
+
const { verdict } = props;
|
|
67
|
+
if (verdict.state === "ScreenedOut") {
|
|
68
|
+
return _jsx(ScreenedOutVerdict, { ...props, verdict: verdict });
|
|
69
|
+
}
|
|
70
|
+
if (verdict.state === "Failed") {
|
|
71
|
+
return (_jsxs(Section, { children: [_jsx(Headline, { children: CHECK_FAILED_HEADLINE }), _jsx("p", { className: "text-fg-muted", children: `The spam check failed: ${SPAM_FAILURE_SENTENCES[verdict.kind]}.` })] }));
|
|
72
|
+
}
|
|
73
|
+
return _jsx(CheckedVerdict, { ...props, verdict: verdict });
|
|
74
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { RemitImapRescanFailureCode, RemitImapSpamChecked, RemitImapSpamFailed } from "@remit/api-http-client/types.gen.ts";
|
|
2
|
+
export type SpamWarningPending = "NotSpam" | "Report" | "Move" | "CheckAgain";
|
|
3
|
+
export interface SpamWarningBannerProps {
|
|
4
|
+
verdict: RemitImapSpamChecked | RemitImapSpamFailed;
|
|
5
|
+
inSpamFolder: boolean;
|
|
6
|
+
pending?: SpamWarningPending;
|
|
7
|
+
checkAgainFailure?: RemitImapRescanFailureCode;
|
|
8
|
+
onNotSpam: () => void;
|
|
9
|
+
onReport: () => void;
|
|
10
|
+
onMove: () => void;
|
|
11
|
+
onWhy: () => void;
|
|
12
|
+
onCheckAgain: () => void;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* The message view's one banner slot, between the header and the body. The
|
|
16
|
+
* verdict decides what it says: a failed check, a Check again that now reaches
|
|
17
|
+
* Spam for a message outside it, or a warning. It has no close control; it
|
|
18
|
+
* goes when its verdict goes.
|
|
19
|
+
*/
|
|
20
|
+
export declare function SpamWarningBanner({ verdict, inSpamFolder, pending, checkAgainFailure, onNotSpam, onReport, onMove, onWhy, onCheckAgain, }: SpamWarningBannerProps): import("react").JSX.Element | null;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { CircleQuestionMark, ShieldAlert, TriangleAlert } from "../icons.js";
|
|
3
|
+
import { cn } from "../lib/cn.js";
|
|
4
|
+
import { Banner } from "./banner.js";
|
|
5
|
+
import { Button } from "./button.js";
|
|
6
|
+
import { BASIC_CHECKS_ONLY, CHECK_AGAIN_FAILURE_SENTENCES, CHECK_FAILED_HEADLINE, formatSpamScore, modelSkipCause, SPAM_FAILURE_SENTENCES, SPAM_WARN_HEADLINES, topSpamReasonSentence, } from "./spam-copy.js";
|
|
7
|
+
const PENDING_LABELS = {
|
|
8
|
+
NotSpam: "Removing label...",
|
|
9
|
+
Report: "Reporting...",
|
|
10
|
+
Move: "Moving...",
|
|
11
|
+
CheckAgain: "Checking...",
|
|
12
|
+
};
|
|
13
|
+
const ACTION_BUTTON = "h-10";
|
|
14
|
+
function BannerAction({ label, pending, busy, onClick, variant = "secondary", disabled = false, }) {
|
|
15
|
+
const pressed = pending === busy;
|
|
16
|
+
const blocked = pending !== undefined || disabled;
|
|
17
|
+
return (_jsx(Button, { variant: variant, size: "md", className: cn(ACTION_BUTTON, blocked && "pointer-events-none opacity-60"), "aria-disabled": blocked || undefined, "aria-busy": pressed || undefined, onClick: blocked ? undefined : onClick, children: pressed ? PENDING_LABELS[busy] : label }));
|
|
18
|
+
}
|
|
19
|
+
function WhyButton({ onWhy }) {
|
|
20
|
+
return (_jsx(Button, { variant: "ghost", size: "md", className: ACTION_BUTTON, onClick: onWhy, children: "Why" }));
|
|
21
|
+
}
|
|
22
|
+
function BannerBody({ tone, icon, headline, lines, actions, role, }) {
|
|
23
|
+
return (_jsx(Banner, { tone: tone, variant: "soft", role: role, className: "rounded-none border-b border-line px-5 py-3", children: _jsxs("div", { className: "flex items-start gap-2", children: [_jsx("span", { className: "mt-0.5 shrink-0", "aria-hidden": "true", children: icon }), _jsxs("div", { className: "min-w-0 flex-1", children: [_jsx("p", { className: "font-semibold text-fg", children: headline }), lines.map((line) => (_jsx("p", { className: "mt-0.5 text-fg-muted", children: line }, line))), _jsx("div", { className: "mt-2 flex flex-wrap gap-2", children: actions })] })] }) }));
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* The message view's one banner slot, between the header and the body. The
|
|
27
|
+
* verdict decides what it says: a failed check, a Check again that now reaches
|
|
28
|
+
* Spam for a message outside it, or a warning. It has no close control; it
|
|
29
|
+
* goes when its verdict goes.
|
|
30
|
+
*/
|
|
31
|
+
export function SpamWarningBanner({ verdict, inSpamFolder, pending, checkAgainFailure, onNotSpam, onReport, onMove, onWhy, onCheckAgain, }) {
|
|
32
|
+
if (verdict.state === "Failed") {
|
|
33
|
+
return (_jsx(BannerBody, { tone: "info", role: "status", icon: _jsx(CircleQuestionMark, { className: "size-4 text-accent-2" }), headline: CHECK_FAILED_HEADLINE, lines: [
|
|
34
|
+
`The spam check failed: ${SPAM_FAILURE_SENTENCES[verdict.kind]}. No label was added.`,
|
|
35
|
+
...(checkAgainFailure
|
|
36
|
+
? [
|
|
37
|
+
`Check again didn't finish: ${CHECK_AGAIN_FAILURE_SENTENCES[checkAgainFailure]}`,
|
|
38
|
+
]
|
|
39
|
+
: []),
|
|
40
|
+
], actions: _jsx(BannerAction, { label: "Check again", pending: pending, busy: "CheckAgain", disabled: checkAgainFailure === "DailyCap", onClick: onCheckAgain }) }));
|
|
41
|
+
}
|
|
42
|
+
if (verdict.action === "None")
|
|
43
|
+
return null;
|
|
44
|
+
if (verdict.action === "Junk" && inSpamFolder)
|
|
45
|
+
return null;
|
|
46
|
+
const phishing = verdict.kind === "Phishing";
|
|
47
|
+
const skipped = modelSkipCause(verdict);
|
|
48
|
+
const tone = phishing ? "danger" : "warning";
|
|
49
|
+
const role = phishing ? "alert" : "status";
|
|
50
|
+
const icon = phishing ? (_jsx(ShieldAlert, { className: "size-4 text-danger" })) : (_jsx(TriangleAlert, { className: "size-4 text-warning" }));
|
|
51
|
+
if (verdict.action === "Junk") {
|
|
52
|
+
return (_jsx(BannerBody, { tone: tone, role: role, icon: icon, headline: phishing
|
|
53
|
+
? "Remit now judges this phishing"
|
|
54
|
+
: "Remit now judges this spam", lines: [
|
|
55
|
+
`Check again scored it ${formatSpamScore(verdict.score)}, past your Move to Spam threshold. It stays here until you move it.`,
|
|
56
|
+
], actions: _jsxs(_Fragment, { children: [_jsx(BannerAction, { label: "Move to Spam", variant: "primary", pending: pending, busy: "Move", onClick: onMove }), _jsx(BannerAction, { label: "Not spam", pending: pending, busy: "NotSpam", onClick: onNotSpam }), _jsx(WhyButton, { onWhy: onWhy })] }) }));
|
|
57
|
+
}
|
|
58
|
+
return (_jsx(BannerBody, { tone: tone, role: role, icon: icon, headline: SPAM_WARN_HEADLINES[verdict.kind], lines: [
|
|
59
|
+
topSpamReasonSentence(verdict.reasons),
|
|
60
|
+
...(skipped ? [`${BASIC_CHECKS_ONLY}: ${skipped}`] : []),
|
|
61
|
+
], actions: _jsxs(_Fragment, { children: [_jsx(BannerAction, { label: "Not spam", pending: pending, busy: "NotSpam", onClick: onNotSpam }), _jsx(BannerAction, { label: "Report spam", pending: pending, busy: "Report", onClick: onReport }), _jsx(WhyButton, { onWhy: onWhy })] }) }));
|
|
62
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ export { NextUpCard, type NextUpCardProps, } from "./components/agenda-panels.js
|
|
|
11
11
|
export { AppChrome, type AppChromeProps } from "./components/app-chrome.js";
|
|
12
12
|
export { AppPasswordHint, type AppPasswordHintProps, } from "./components/app-password-hint.js";
|
|
13
13
|
export { type AppShellLayoutContext, AppShellSlotted, type AppShellSlottedProps, useAppShellLayout, } from "./components/app-shell-slotted.js";
|
|
14
|
-
export { type AppShellProps, type Density, INTELLIGENCE_MIN_WIDTH, type MessageListKeyboard, type MessageListSelection, type NarrowView, type NavAccount, type NavAccountStatus, type NavLinkComponent, type NavLinkRenderProps, type NavMailbox, type NavMailboxRole, type PaneLayout, READING_PANE_MIN_WIDTH, resolvePaneLayout, type ThreadData, type ThreadMessageData, type ThreadRowData, type ThreadSection, type TouchSeed, useContainerWidth, } from "./components/app-shell-types.js";
|
|
14
|
+
export { type AppShellProps, type Density, INTELLIGENCE_MIN_WIDTH, type MessageListKeyboard, type MessageListSelection, type NarrowView, type NavAccount, type NavAccountStatus, type NavLabel, type NavLinkComponent, type NavLinkRenderProps, type NavMailbox, type NavMailboxRole, type PaneLayout, READING_PANE_MIN_WIDTH, resolvePaneLayout, type ThreadData, type ThreadMessageData, type ThreadRowData, type ThreadRowSpam, type ThreadSection, type TouchSeed, useContainerWidth, } from "./components/app-shell-types.js";
|
|
15
15
|
export { AppBar, type AppId, type AppSwitcherProps, type AppSwitchItem, AppTabBar, } from "./components/app-switcher.js";
|
|
16
16
|
export { AppTopBar, type AppTopBarProps } from "./components/app-top-bar.js";
|
|
17
17
|
export { type AttachmentDownloadState, type AttachmentItem, type AttachmentKind, AttachmentList, type AttachmentListProps, } from "./components/attachment-list.js";
|
|
@@ -29,7 +29,7 @@ export { BottomSheet, type BottomSheetProps, } from "./components/bottom-sheet.j
|
|
|
29
29
|
export { BriefEmpty, type BriefEmptyProps, type BriefSyncProgress, } from "./components/brief-empty.js";
|
|
30
30
|
export { BriefSection, type BriefSectionProps, SECTION_ROW_CAP, } from "./components/brief-section.js";
|
|
31
31
|
export { type BriefCategoryControl, type BriefFilterControl, type BriefFilterSurface, BriefSections, type BriefSectionsProps, type BriefSourceControl, } from "./components/brief-sections.js";
|
|
32
|
-
export { Button, ButtonLink, type ButtonLinkProps, type ButtonProps, } from "./components/button.js";
|
|
32
|
+
export { Button, ButtonLink, type ButtonLinkProps, type ButtonProps, buttonClassName, } from "./components/button.js";
|
|
33
33
|
export { CalendarClashStrip, type CalendarClashStripProps, } from "./components/calendar-clash-strip.js";
|
|
34
34
|
export { CalendarEventChip, type CalendarEventChipProps, } from "./components/calendar-event-chip.js";
|
|
35
35
|
export { CalendarEventChipContent, type CalendarEventChipContentProps, } from "./components/calendar-event-chip-content.js";
|
|
@@ -55,6 +55,7 @@ export { type CalendarAttendee, type CalendarClash, type CalendarColorId, type C
|
|
|
55
55
|
export { CalendarYear, type CalendarYearProps, } from "./components/calendar-year.js";
|
|
56
56
|
export { Card, CardBody, CardHeader, type CardProps, CardTitle, } from "./components/card.js";
|
|
57
57
|
export { CategoryBadge, type CategoryBadgeProps, } from "./components/category-badge.js";
|
|
58
|
+
export { type CheckAgainFailure, type CheckAgainOutcome, CheckAgainPanel, type CheckAgainPanelProps, CheckAgainResultTag, type CheckAgainSummary, checkAgainSummarySentence, } from "./components/check-again-panel.js";
|
|
58
59
|
export { Checkbox, type CheckboxProps } from "./components/checkbox.js";
|
|
59
60
|
export { ComposeActionBar, type ComposeActionBarProps, type ComposeSaveState, type ComposeSendState, } from "./components/compose-action-bar.js";
|
|
60
61
|
export { type AddressEntry, type ComposeAddressCommit, ComposeAddressField, type ComposeAddressFieldHandle, type ComposeAddressFieldProps, type ParsedAddressInput, } from "./components/compose-address-field.js";
|
|
@@ -80,6 +81,7 @@ export type { AuthorDeclarations, EmailFrameVariant, } from "./components/email-
|
|
|
80
81
|
export { EventEditor, type EventEditorLayout, type EventEditorProps, endsBeforeStart, withAllDay, withStartDate, } from "./components/event-editor.js";
|
|
81
82
|
export { EventEditorPane, type EventEditorPaneProps, } from "./components/event-editor-pane.js";
|
|
82
83
|
export { EventSuggestionCard, type EventSuggestionCardProps, settleZone, ZONE_UNSETTLED_REASON, type ZoneSettlement, } from "./components/event-suggestion-card.js";
|
|
84
|
+
export { FailureBanner, type FailureBannerProps, } from "./components/failure-banner.js";
|
|
83
85
|
export { FieldLabel, type FieldLabelProps, } from "./components/field-label.js";
|
|
84
86
|
export { AddChipButton, type AddChipButtonProps, ClauseChip, type ClauseChipProps, type ClauseDraft, ClauseEditor, type ClauseEditorProps, } from "./components/filter-clause-chip.js";
|
|
85
87
|
export { FilterPreviewCount, type FilterPreviewCountProps, } from "./components/filter-preview-count.js";
|
|
@@ -97,7 +99,7 @@ export { FolderSyncBadge, type FolderSyncBadgeProps, type FolderSyncMailbox, typ
|
|
|
97
99
|
export { type FolderTreeNode, FolderTreePicker, type FolderTreePickerLabels, type FolderTreePickerProps, type FolderTreeRow, } from "./components/folder-tree-picker.js";
|
|
98
100
|
export { Input, type InputProps, type InputVariant, } from "./components/input.js";
|
|
99
101
|
export { type CalendarDayEntry, type CalendarInviteIntel, type CalendarProseIntel, type CalendarSuggestionIntel, IntelligenceCalendar, type IntelligenceCalendarActions, type IntelligenceCalendarData, type IntelligenceCalendarProps, } from "./components/intelligence-calendar.js";
|
|
100
|
-
export { type
|
|
102
|
+
export { type IntelligenceCalendarSurface, type IntelligenceData, IntelligencePanel, type IntelligencePanelProps, type IntelligenceQuickActions, type IntelligenceTabId, type SenderFlagsIntel, type SenderIntel, type SenderTrustLevel, type SpamQuickAction, } from "./components/intelligence-panel.js";
|
|
101
103
|
export type { PlacementIntel } from "./components/intelligence-placement.js";
|
|
102
104
|
export { IntelligenceSection } from "./components/intelligence-section.js";
|
|
103
105
|
export { IntelligenceToggle, type IntelligenceToggleProps, } from "./components/intelligence-toggle.js";
|
|
@@ -170,7 +172,12 @@ export { type SenderTrust, SenderTrustIndicator, type SenderTrustIndicatorProps,
|
|
|
170
172
|
export { AccountHealthCard, type AccountHealthCardProps, SenderFlagRow, type SenderFlagRowProps, type SettingsNavItem, SettingsShell, type SettingsShellProps, } from "./components/settings-screen.js";
|
|
171
173
|
export { type ShellSearchScope, ShellTopBar, type ShellTopBarProps, type ShellTopBarSearch, } from "./components/shell-top-bar.js";
|
|
172
174
|
export { SlidePanel, type SlidePanelProps, } from "./components/slide-panel.js";
|
|
175
|
+
export { BASIC_CHECKS_ONLY, CHECK_AGAIN_FAILURE_SENTENCES, CHECK_FAILED_HEADLINE, filterScreenSentence, formatSpamScore, isModelReason, MODEL_SKIP_CAUSES, modelSaid, modelSkipCause, spamReasonSentence, spamScoreSentence, topSpamReason, topSpamReasonSentence, UNKNOWN_REASON_SENTENCE, } from "./components/spam-copy.js";
|
|
176
|
+
export { SpamDailyChart, type SpamDailyChartProps, type SpamDay, spamDayDescription, } from "./components/spam-daily-chart.js";
|
|
173
177
|
export { SpamResultsOffer, type SpamResultsOfferProps, } from "./components/spam-results-offer.js";
|
|
178
|
+
export { SpamRowMarker, type SpamRowMarkerProps, } from "./components/spam-row-marker.js";
|
|
179
|
+
export { SPAM_CHECK_HEADING_ID, type SpamVerdictLinkComponent, type SpamVerdictLinkProps, type SpamVerdictLinkTarget, SpamVerdictPanel, type SpamVerdictPanelProps, } from "./components/spam-verdict-panel.js";
|
|
180
|
+
export { SpamWarningBanner, type SpamWarningBannerProps, type SpamWarningPending, } from "./components/spam-warning-banner.js";
|
|
174
181
|
export { type Suggestion, SuggestList, type SuggestListProps, } from "./components/suggest-list.js";
|
|
175
182
|
export { commitPeek, SwipeableRow, type SwipePeek, } from "./components/swipeable-row.js";
|
|
176
183
|
export { Switch, type SwitchProps } from "./components/switch.js";
|
package/dist/index.js
CHANGED
|
@@ -29,7 +29,7 @@ export { BottomSheet, } from "./components/bottom-sheet.js";
|
|
|
29
29
|
export { BriefEmpty, } from "./components/brief-empty.js";
|
|
30
30
|
export { BriefSection, SECTION_ROW_CAP, } from "./components/brief-section.js";
|
|
31
31
|
export { BriefSections, } from "./components/brief-sections.js";
|
|
32
|
-
export { Button, ButtonLink, } from "./components/button.js";
|
|
32
|
+
export { Button, ButtonLink, buttonClassName, } from "./components/button.js";
|
|
33
33
|
export { CalendarClashStrip, } from "./components/calendar-clash-strip.js";
|
|
34
34
|
export { CalendarEventChip, } from "./components/calendar-event-chip.js";
|
|
35
35
|
export { CalendarEventChipContent, } from "./components/calendar-event-chip-content.js";
|
|
@@ -55,6 +55,7 @@ export { calendarColorIds, } from "./components/calendar-types.js";
|
|
|
55
55
|
export { CalendarYear, } from "./components/calendar-year.js";
|
|
56
56
|
export { Card, CardBody, CardHeader, CardTitle, } from "./components/card.js";
|
|
57
57
|
export { CategoryBadge, } from "./components/category-badge.js";
|
|
58
|
+
export { CheckAgainPanel, CheckAgainResultTag, checkAgainSummarySentence, } from "./components/check-again-panel.js";
|
|
58
59
|
export { Checkbox } from "./components/checkbox.js";
|
|
59
60
|
export { ComposeActionBar, } from "./components/compose-action-bar.js";
|
|
60
61
|
export { ComposeAddressField, } from "./components/compose-address-field.js";
|
|
@@ -79,6 +80,7 @@ export { ErrorState, formatErrorMessage } from "./components/ErrorState.js";
|
|
|
79
80
|
export { EventEditor, endsBeforeStart, withAllDay, withStartDate, } from "./components/event-editor.js";
|
|
80
81
|
export { EventEditorPane, } from "./components/event-editor-pane.js";
|
|
81
82
|
export { EventSuggestionCard, settleZone, ZONE_UNSETTLED_REASON, } from "./components/event-suggestion-card.js";
|
|
83
|
+
export { FailureBanner, } from "./components/failure-banner.js";
|
|
82
84
|
export { FieldLabel, } from "./components/field-label.js";
|
|
83
85
|
export { AddChipButton, ClauseChip, ClauseEditor, } from "./components/filter-clause-chip.js";
|
|
84
86
|
export { FilterPreviewCount, } from "./components/filter-preview-count.js";
|
|
@@ -168,7 +170,12 @@ export { SenderTrustIndicator, selectSenderTrustVariant, } from "./components/se
|
|
|
168
170
|
export { AccountHealthCard, SenderFlagRow, SettingsShell, } from "./components/settings-screen.js";
|
|
169
171
|
export { ShellTopBar, } from "./components/shell-top-bar.js";
|
|
170
172
|
export { SlidePanel, } from "./components/slide-panel.js";
|
|
173
|
+
export { BASIC_CHECKS_ONLY, CHECK_AGAIN_FAILURE_SENTENCES, CHECK_FAILED_HEADLINE, filterScreenSentence, formatSpamScore, isModelReason, MODEL_SKIP_CAUSES, modelSaid, modelSkipCause, spamReasonSentence, spamScoreSentence, topSpamReason, topSpamReasonSentence, UNKNOWN_REASON_SENTENCE, } from "./components/spam-copy.js";
|
|
174
|
+
export { SpamDailyChart, spamDayDescription, } from "./components/spam-daily-chart.js";
|
|
171
175
|
export { SpamResultsOffer, } from "./components/spam-results-offer.js";
|
|
176
|
+
export { SpamRowMarker, } from "./components/spam-row-marker.js";
|
|
177
|
+
export { SPAM_CHECK_HEADING_ID, SpamVerdictPanel, } from "./components/spam-verdict-panel.js";
|
|
178
|
+
export { SpamWarningBanner, } from "./components/spam-warning-banner.js";
|
|
172
179
|
export { SuggestList, } from "./components/suggest-list.js";
|
|
173
180
|
export { commitPeek, SwipeableRow, } from "./components/swipeable-row.js";
|
|
174
181
|
export { Switch } from "./components/switch.js";
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
* a hard dependency on the generated types (this file compiles before `make`
|
|
21
21
|
* in fresh checkouts).
|
|
22
22
|
*/
|
|
23
|
-
export type EmailRenderCategory = "uncategorized" | "personal" | "newsletter" | "marketing" | "automated" | "transactional" | "social";
|
|
23
|
+
export type EmailRenderCategory = "uncategorized" | "personal" | "newsletter" | "marketing" | "automated" | "transactional" | "social" | "coldOutreach";
|
|
24
24
|
export interface EmailRenderTreatment {
|
|
25
25
|
/** Designed mail: render framed + light-mode, preserve author colors. */
|
|
26
26
|
framed: boolean;
|