@remit/web-client 0.0.346 → 0.0.348

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (108) hide show
  1. package/dist/src/components/mail/BriefPane.js +3 -3
  2. package/dist/src/components/mail/CheckAgainProvider.d.ts +30 -0
  3. package/dist/src/components/mail/CheckAgainProvider.js +194 -0
  4. package/dist/src/components/mail/{FlaggedList.d.ts → CollectionList.d.ts} +7 -3
  5. package/dist/src/components/mail/{FlaggedList.js → CollectionList.js} +29 -24
  6. package/dist/src/components/mail/CollectionPane.d.ts +32 -0
  7. package/dist/src/components/mail/{FlaggedPane.js → CollectionPane.js} +35 -33
  8. package/dist/src/components/mail/ConversationView.d.ts +7 -8
  9. package/dist/src/components/mail/ConversationView.js +4 -4
  10. package/dist/src/components/mail/DailyBrief.js +6 -4
  11. package/dist/src/components/mail/IntelligencePane.d.ts +2 -2
  12. package/dist/src/components/mail/IntelligencePane.js +33 -4
  13. package/dist/src/components/mail/MailSidebarAdapter.js +29 -7
  14. package/dist/src/components/mail/MailboxPane.js +10 -12
  15. package/dist/src/components/mail/MessageActionMenu.d.ts +3 -1
  16. package/dist/src/components/mail/MessageActionMenu.js +3 -3
  17. package/dist/src/components/mail/MessageCard.js +9 -1
  18. package/dist/src/components/mail/MessageList.js +11 -2
  19. package/dist/src/components/mail/MessageListItem.d.ts +4 -2
  20. package/dist/src/components/mail/MessageListItem.js +4 -6
  21. package/dist/src/components/mail/SpamBannerSlot.d.ts +10 -0
  22. package/dist/src/components/mail/SpamBannerSlot.js +56 -0
  23. package/dist/src/components/mail/SwipeableMessageRow.d.ts +3 -2
  24. package/dist/src/components/mail/SwipeableMessageRow.js +6 -6
  25. package/dist/src/components/mail/ThreadListInteraction.d.ts +2 -0
  26. package/dist/src/components/mail/ThreadListInteraction.js +12 -2
  27. package/dist/src/components/settings/classification/FailureBanner.js +3 -4
  28. package/dist/src/components/settings/spam/SpamSettingsPanel.d.ts +6 -0
  29. package/dist/src/components/settings/spam/SpamSettingsPanel.js +176 -0
  30. package/dist/src/hooks/{useStarredThreads.d.ts → useCollectionThreads.d.ts} +10 -8
  31. package/dist/src/hooks/{useStarredThreads.js → useCollectionThreads.js} +16 -14
  32. package/dist/src/hooks/useCurrentMailboxName.d.ts +1 -0
  33. package/dist/src/hooks/useCurrentMailboxName.js +6 -1
  34. package/dist/src/hooks/useIntelligenceData.d.ts +2 -4
  35. package/dist/src/hooks/useIntelligenceData.js +1 -127
  36. package/dist/src/hooks/useJunkMailboxIds.d.ts +2 -0
  37. package/dist/src/hooks/useJunkMailboxIds.js +17 -0
  38. package/dist/src/hooks/useLabels.d.ts +10 -9
  39. package/dist/src/hooks/useLabels.js +25 -6
  40. package/dist/src/lib/brief.d.ts +1 -1
  41. package/dist/src/lib/brief.js +3 -3
  42. package/dist/src/lib/check-again.d.ts +33 -0
  43. package/dist/src/lib/check-again.js +66 -0
  44. package/dist/src/lib/{flagged-criteria.d.ts → collection-criteria.d.ts} +18 -6
  45. package/dist/src/lib/{flagged-criteria.js → collection-criteria.js} +4 -3
  46. package/dist/src/lib/conversation-target.d.ts +3 -2
  47. package/dist/src/lib/label-folders.d.ts +6 -0
  48. package/dist/src/lib/label-folders.js +10 -0
  49. package/dist/src/lib/mail-route.d.ts +10 -5
  50. package/dist/src/lib/mail-route.js +9 -1
  51. package/dist/src/lib/mail-search.d.ts +11 -0
  52. package/dist/src/lib/mail-search.js +4 -0
  53. package/dist/src/lib/search-scope.d.ts +2 -2
  54. package/dist/src/lib/search-scope.js +4 -4
  55. package/dist/src/lib/search-tokens.d.ts +1 -1
  56. package/dist/src/lib/search-tokens.js +2 -2
  57. package/dist/src/lib/spam-overview.d.ts +23 -0
  58. package/dist/src/lib/spam-overview.js +44 -0
  59. package/dist/src/lib/spam.d.ts +32 -0
  60. package/dist/src/lib/spam.js +38 -0
  61. package/dist/src/lib/thread-search-tokens.js +3 -1
  62. package/dist/src/routeTree.gen.d.ts +312 -5
  63. package/dist/src/routeTree.gen.js +72 -0
  64. package/dist/src/routes/__root.js +2 -1
  65. package/dist/src/routes/mail/flagged/$threadId/$messageId.js +2 -2
  66. package/dist/src/routes/mail/flagged/$threadId/index.js +2 -2
  67. package/dist/src/routes/mail/flagged/index.js +2 -2
  68. package/dist/src/routes/mail/flagged.js +3 -2
  69. package/dist/src/routes/mail/label/$labelId/$threadId/$messageId/$mode.{-$outboxMessageId}.d.ts +18 -0
  70. package/dist/src/routes/mail/label/$labelId/$threadId/$messageId/$mode.{-$outboxMessageId}.js +8 -0
  71. package/dist/src/routes/mail/label/$labelId/$threadId/$messageId.d.ts +15 -0
  72. package/dist/src/routes/mail/label/$labelId/$threadId/$messageId.js +14 -0
  73. package/dist/src/routes/mail/label/$labelId/$threadId/index.d.ts +15 -0
  74. package/dist/src/routes/mail/label/$labelId/$threadId/index.js +9 -0
  75. package/dist/src/routes/mail/label/$labelId/$threadId.d.ts +15 -0
  76. package/dist/src/routes/mail/label/$labelId/$threadId.js +8 -0
  77. package/dist/src/routes/mail/label/$labelId/compose.{-$outboxMessageId}.d.ts +15 -0
  78. package/dist/src/routes/mail/label/$labelId/compose.{-$outboxMessageId}.js +10 -0
  79. package/dist/src/routes/mail/label/$labelId/index.d.ts +15 -0
  80. package/dist/src/routes/mail/label/$labelId/index.js +9 -0
  81. package/dist/src/routes/mail/label/$labelId.d.ts +15 -0
  82. package/dist/src/routes/mail/label/$labelId.js +30 -0
  83. package/dist/src/routes/mail/label/index.d.ts +29 -0
  84. package/dist/src/routes/mail/label/index.js +18 -0
  85. package/dist/src/routes/settings/filters.d.ts +6 -2
  86. package/dist/src/routes/settings/filters.js +10 -3
  87. package/dist/src/routes/settings/senders.d.ts +14 -2
  88. package/dist/src/routes/settings/senders.js +32 -15
  89. package/dist/src/routes/settings/spam.d.ts +1 -0
  90. package/dist/src/routes/settings/spam.js +15 -0
  91. package/dist/src/routes/settings.js +6 -1
  92. package/dist/src/routing/browsed-list.d.ts +1 -1
  93. package/dist/src/routing/browsed-list.js +15 -4
  94. package/dist/src/routing/compose.js +10 -6
  95. package/dist/src/routing/index.d.ts +1 -1
  96. package/dist/src/routing/index.js +1 -1
  97. package/dist/src/routing/nav-selection.d.ts +5 -0
  98. package/dist/src/routing/nav-selection.js +15 -0
  99. package/dist/src/routing/open-thread.js +23 -3
  100. package/dist/src/routing/reply.js +28 -11
  101. package/dist/src/routing/search-mirror.d.ts +5 -0
  102. package/dist/src/routing/search-mirror.js +20 -2
  103. package/dist/src/routing/spam-link.d.ts +3 -0
  104. package/dist/src/routing/spam-link.js +12 -0
  105. package/package.json +2 -2
  106. package/dist/src/components/mail/AuthenticityBanner.d.ts +0 -14
  107. package/dist/src/components/mail/AuthenticityBanner.js +0 -18
  108. package/dist/src/components/mail/FlaggedPane.d.ts +0 -29
@@ -9,6 +9,11 @@ export type SearchMirrorTarget = {
9
9
  params: {
10
10
  mailboxId: string;
11
11
  };
12
+ } | {
13
+ to: "/mail/label/$labelId";
14
+ params: {
15
+ labelId: string;
16
+ };
12
17
  };
13
18
  /**
14
19
  * Mirrors the settled search into the URL so links are shareable and a refresh
@@ -66,8 +66,13 @@ export function useSearchMirror(target) {
66
66
  const isReplying = useIsReplying();
67
67
  const isWriting = isComposing || isReplying;
68
68
  const { to } = target;
69
- const mailboxId = "params" in target ? target.params.mailboxId : undefined;
70
- const listPath = mailboxId ? `/mail/${mailboxId}` : to;
69
+ const mailboxId = target.to === "/mail/$mailboxId" ? target.params.mailboxId : undefined;
70
+ const labelId = target.to === "/mail/label/$labelId" ? target.params.labelId : undefined;
71
+ const listPath = mailboxId
72
+ ? `/mail/${mailboxId}`
73
+ : labelId
74
+ ? `/mail/label/${labelId}`
75
+ : to;
71
76
  useEffect(() => {
72
77
  const mayWrite = shouldMirrorQuery({
73
78
  searchInput,
@@ -105,6 +110,18 @@ export function useSearchMirror(target) {
105
110
  });
106
111
  return;
107
112
  }
113
+ if (to === "/mail/label/$labelId") {
114
+ if (!labelId)
115
+ return;
116
+ navigate({
117
+ to,
118
+ params: { labelId },
119
+ search,
120
+ hash: true,
121
+ replace: true,
122
+ });
123
+ return;
124
+ }
108
125
  navigate({ to, search, hash: true, replace: true });
109
126
  }, [
110
127
  searchInput,
@@ -113,6 +130,7 @@ export function useSearchMirror(target) {
113
130
  navigate,
114
131
  to,
115
132
  mailboxId,
133
+ labelId,
116
134
  listPath,
117
135
  pathname,
118
136
  isWriting,
@@ -0,0 +1,3 @@
1
+ import type { SpamVerdictLinkProps } from "@remit/ui";
2
+ /** The Spam check section's links, as router navigations. */
3
+ export declare function SpamVerdictLink({ target, className, children, }: SpamVerdictLinkProps): import("react").JSX.Element;
@@ -0,0 +1,12 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { NavLink } from "./nav-link";
3
+ /** The Spam check section's links, as router navigations. */
4
+ export function SpamVerdictLink({ target, className, children, }) {
5
+ if (target.kind === "SpamSettings") {
6
+ return (_jsx(NavLink, { to: "/settings/spam", variant: "inline", className: className, children: children }));
7
+ }
8
+ if (target.kind === "NeverInSpamSenders") {
9
+ return (_jsx(NavLink, { to: "/settings/senders", search: { group: "neverSpam" }, variant: "inline", className: className, children: children }));
10
+ }
11
+ return (_jsx(NavLink, { to: "/settings/filters", search: { filterId: target.filterId }, variant: "inline", className: className, children: children }));
12
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remit/web-client",
3
- "version": "0.0.346",
3
+ "version": "0.0.348",
4
4
  "type": "module",
5
5
  "description": "Remit web client, published as composable primitives — the app shell, auth shells, and runtime config. A distributor imports what it composes and bundles it.",
6
6
  "exports": {
@@ -91,7 +91,7 @@
91
91
  },
92
92
  "dependencies": {
93
93
  "@hookform/resolvers": "5.4.0",
94
- "@remit/ui": "0.0.237",
94
+ "@remit/ui": "0.0.239",
95
95
  "@tanstack/react-query": "5.101.2",
96
96
  "@tanstack/react-query-devtools": "5.101.2",
97
97
  "@tanstack/react-router": "1.170.18",
@@ -1,14 +0,0 @@
1
- import type { RemitImapMessageAuthenticity } from "@remit/api-http-client/types.gen.ts";
2
- /**
3
- * Danger banner rendered above the thread body when DKIM mismatch is detected.
4
- * Design spec (03-reading-and-intelligence.md): "a danger banner renders above
5
- * the body: 'This message claims to be a company but was sent from a personal
6
- * mailbox.' with a 'Why?' link that opens/highlights this section."
7
- *
8
- * The link sits in the sentence at the sentence's own size. Set apart as
9
- * smaller, right-floated chrome it read as a label rather than the way in.
10
- */
11
- export declare function AuthenticityBanner({ authenticity, onOpenIntelligence, }: {
12
- authenticity: RemitImapMessageAuthenticity;
13
- onOpenIntelligence?: () => void;
14
- }): import("react").JSX.Element | null;
@@ -1,18 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { ShieldAlert } from "@remit/ui/icons";
3
- /**
4
- * Danger banner rendered above the thread body when DKIM mismatch is detected.
5
- * Design spec (03-reading-and-intelligence.md): "a danger banner renders above
6
- * the body: 'This message claims to be a company but was sent from a personal
7
- * mailbox.' with a 'Why?' link that opens/highlights this section."
8
- *
9
- * The link sits in the sentence at the sentence's own size. Set apart as
10
- * smaller, right-floated chrome it read as a label rather than the way in.
11
- */
12
- export function AuthenticityBanner({ authenticity, onOpenIntelligence, }) {
13
- if (!authenticity.dkimMismatch)
14
- return null;
15
- return (_jsxs("div", { className: "flex items-start gap-2 rounded-none border-b border-danger/20 bg-danger-soft px-5 py-2.5 text-sm", children: [_jsx(ShieldAlert, { className: "mt-0.5 size-4 shrink-0 text-danger" }), _jsxs("p", { className: "flex-1 leading-snug text-fg", children: ["This message claims to be from", " ", _jsx("span", { className: "font-semibold", children: authenticity.fromDomain }), " but was sent", authenticity.dkimDomain
16
- ? ` via ${authenticity.dkimDomain}`
17
- : " from a different domain", ".", " ", onOpenIntelligence && (_jsx("button", { type: "button", onClick: onOpenIntelligence, className: "font-medium text-danger hover:underline", children: "Why?" }))] })] }));
18
- }
@@ -1,29 +0,0 @@
1
- import { type ReactNode } from "react";
2
- import { type OpenThreadPath } from "../../routing";
3
- interface FlaggedPaneProps {
4
- /** The open conversation, as the address states it. */
5
- thread: OpenThreadPath | undefined;
6
- children: ReactNode;
7
- }
8
- declare function FlaggedPaneProvider({ thread, children }: FlaggedPaneProps): import("react").JSX.Element;
9
- /** Flat starred list. Mount in the `list` slot of `AppShellSlotted`. */
10
- declare function FlaggedListSlot(): import("react").JSX.Element;
11
- /**
12
- * Reading pane: toolbar + ConversationView.
13
- * Mount in the `reading` slot of `AppShellSlotted`. Only rendered ≥ 1024px.
14
- */
15
- declare function FlaggedReading(): import("react").JSX.Element;
16
- /**
17
- * Intelligence pane: IntelligencePane for the open thread.
18
- * Mount in the `intelligence` slot of `AppShellSlotted`. Only rendered ≥ 1280px.
19
- */
20
- declare function FlaggedIntelligence(): import("react").JSX.Element;
21
- /** Phone view: ConversationView when a thread is open, else the flat list. */
22
- declare function FlaggedPhone(): import("react").JSX.Element;
23
- declare const FlaggedPane: typeof FlaggedPaneProvider & {
24
- List: typeof FlaggedListSlot;
25
- Reading: typeof FlaggedReading;
26
- Intelligence: typeof FlaggedIntelligence;
27
- Phone: typeof FlaggedPhone;
28
- };
29
- export { FlaggedPane };