@remit/web-client 0.0.346 → 0.0.347
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/src/components/mail/{FlaggedList.d.ts → CollectionList.d.ts} +7 -3
- package/dist/src/components/mail/{FlaggedList.js → CollectionList.js} +25 -22
- package/dist/src/components/mail/CollectionPane.d.ts +32 -0
- package/dist/src/components/mail/{FlaggedPane.js → CollectionPane.js} +32 -30
- package/dist/src/components/mail/MailSidebarAdapter.js +29 -7
- package/dist/src/hooks/{useStarredThreads.d.ts → useCollectionThreads.d.ts} +10 -8
- package/dist/src/hooks/{useStarredThreads.js → useCollectionThreads.js} +16 -14
- package/dist/src/hooks/useCurrentMailboxName.d.ts +1 -0
- package/dist/src/hooks/useCurrentMailboxName.js +6 -1
- package/dist/src/hooks/useLabels.d.ts +10 -9
- package/dist/src/hooks/useLabels.js +25 -6
- package/dist/src/lib/{flagged-criteria.d.ts → collection-criteria.d.ts} +18 -6
- package/dist/src/lib/{flagged-criteria.js → collection-criteria.js} +4 -3
- package/dist/src/lib/label-folders.d.ts +6 -0
- package/dist/src/lib/label-folders.js +10 -0
- package/dist/src/lib/mail-route.d.ts +10 -5
- package/dist/src/lib/mail-route.js +9 -1
- package/dist/src/lib/mail-search.d.ts +11 -0
- package/dist/src/lib/mail-search.js +4 -0
- package/dist/src/lib/search-scope.d.ts +2 -2
- package/dist/src/lib/search-scope.js +4 -4
- package/dist/src/lib/search-tokens.d.ts +1 -1
- package/dist/src/lib/search-tokens.js +2 -2
- package/dist/src/routeTree.gen.d.ts +288 -3
- package/dist/src/routeTree.gen.js +65 -0
- package/dist/src/routes/mail/flagged/$threadId/$messageId.js +2 -2
- package/dist/src/routes/mail/flagged/$threadId/index.js +2 -2
- package/dist/src/routes/mail/flagged/index.js +2 -2
- package/dist/src/routes/mail/flagged.js +3 -2
- package/dist/src/routes/mail/label/$labelId/$threadId/$messageId/$mode.{-$outboxMessageId}.d.ts +18 -0
- package/dist/src/routes/mail/label/$labelId/$threadId/$messageId/$mode.{-$outboxMessageId}.js +8 -0
- package/dist/src/routes/mail/label/$labelId/$threadId/$messageId.d.ts +15 -0
- package/dist/src/routes/mail/label/$labelId/$threadId/$messageId.js +14 -0
- package/dist/src/routes/mail/label/$labelId/$threadId/index.d.ts +15 -0
- package/dist/src/routes/mail/label/$labelId/$threadId/index.js +9 -0
- package/dist/src/routes/mail/label/$labelId/$threadId.d.ts +15 -0
- package/dist/src/routes/mail/label/$labelId/$threadId.js +8 -0
- package/dist/src/routes/mail/label/$labelId/compose.{-$outboxMessageId}.d.ts +15 -0
- package/dist/src/routes/mail/label/$labelId/compose.{-$outboxMessageId}.js +10 -0
- package/dist/src/routes/mail/label/$labelId/index.d.ts +15 -0
- package/dist/src/routes/mail/label/$labelId/index.js +9 -0
- package/dist/src/routes/mail/label/$labelId.d.ts +15 -0
- package/dist/src/routes/mail/label/$labelId.js +30 -0
- package/dist/src/routes/mail/label/index.d.ts +29 -0
- package/dist/src/routes/mail/label/index.js +18 -0
- package/dist/src/routing/browsed-list.d.ts +1 -1
- package/dist/src/routing/browsed-list.js +15 -4
- package/dist/src/routing/compose.js +10 -6
- package/dist/src/routing/index.d.ts +1 -1
- package/dist/src/routing/index.js +1 -1
- package/dist/src/routing/nav-selection.d.ts +5 -0
- package/dist/src/routing/nav-selection.js +15 -0
- package/dist/src/routing/open-thread.js +23 -3
- package/dist/src/routing/reply.js +28 -11
- package/dist/src/routing/search-mirror.d.ts +5 -0
- package/dist/src/routing/search-mirror.js +20 -2
- package/package.json +2 -2
- package/dist/src/components/mail/FlaggedPane.d.ts +0 -29
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useNavigate, useParams } from "@tanstack/react-router";
|
|
2
2
|
import { useCallback } from "react";
|
|
3
3
|
import { withoutComposeSeed } from "../lib/mail-search";
|
|
4
|
-
import { useBrowsedList, useNavigateToBrowsedList } from "./browsed-list";
|
|
4
|
+
import { useBrowsedList, useNavigateToBrowsedList, } from "./browsed-list";
|
|
5
5
|
import { useRetainOpenPanels } from "./fragment";
|
|
6
6
|
/**
|
|
7
7
|
* The compose route under each list. The draft is an optional segment of the
|
|
@@ -12,6 +12,7 @@ const BRIEF_COMPOSE = "/mail/brief/compose/{-$outboxMessageId}";
|
|
|
12
12
|
const FLAGGED_COMPOSE = "/mail/flagged/compose/{-$outboxMessageId}";
|
|
13
13
|
const OUTBOX_COMPOSE = "/mail/outbox/compose/{-$outboxMessageId}";
|
|
14
14
|
const MAILBOX_COMPOSE = "/mail/$mailboxId/compose/{-$outboxMessageId}";
|
|
15
|
+
const LABEL_COMPOSE = "/mail/label/$labelId/compose/{-$outboxMessageId}";
|
|
15
16
|
/**
|
|
16
17
|
* The compose match, if the address has one. Each `from` names a real route, so
|
|
17
18
|
* a segment that does not exist fails to compile.
|
|
@@ -23,7 +24,8 @@ function useComposeParams() {
|
|
|
23
24
|
const flagged = useParams({ from: FLAGGED_COMPOSE, shouldThrow: false });
|
|
24
25
|
const outbox = useParams({ from: OUTBOX_COMPOSE, shouldThrow: false });
|
|
25
26
|
const mailbox = useParams({ from: MAILBOX_COMPOSE, shouldThrow: false });
|
|
26
|
-
|
|
27
|
+
const label = useParams({ from: LABEL_COMPOSE, shouldThrow: false });
|
|
28
|
+
return brief ?? flagged ?? outbox ?? mailbox ?? label;
|
|
27
29
|
}
|
|
28
30
|
/**
|
|
29
31
|
* Whether the compose surface is showing.
|
|
@@ -57,13 +59,15 @@ export function useComposeDraftId() {
|
|
|
57
59
|
* dead button this change deletes, and neither case has anything to report:
|
|
58
60
|
* a message needs no folder to be written in.
|
|
59
61
|
*/
|
|
60
|
-
function composeTarget(list, mailboxId, outboxMessageId) {
|
|
62
|
+
function composeTarget({ list, mailboxId, labelId }, outboxMessageId) {
|
|
61
63
|
if (list === "flagged")
|
|
62
64
|
return { to: FLAGGED_COMPOSE, params: { outboxMessageId } };
|
|
63
65
|
if (list === "outbox")
|
|
64
66
|
return { to: OUTBOX_COMPOSE, params: { outboxMessageId } };
|
|
65
67
|
if (list === "mailbox" && mailboxId)
|
|
66
68
|
return { to: MAILBOX_COMPOSE, params: { mailboxId, outboxMessageId } };
|
|
69
|
+
if (list === "label" && labelId)
|
|
70
|
+
return { to: LABEL_COMPOSE, params: { labelId, outboxMessageId } };
|
|
67
71
|
return { to: BRIEF_COMPOSE, params: { outboxMessageId } };
|
|
68
72
|
}
|
|
69
73
|
/**
|
|
@@ -76,10 +80,10 @@ function composeTarget(list, mailboxId, outboxMessageId) {
|
|
|
76
80
|
function useComposeNavigate() {
|
|
77
81
|
const navigate = useNavigate();
|
|
78
82
|
const retainPanels = useRetainOpenPanels();
|
|
79
|
-
const
|
|
83
|
+
const browsed = useBrowsedList();
|
|
80
84
|
return useCallback((outboxMessageId, options) => {
|
|
81
85
|
navigate({
|
|
82
|
-
...composeTarget(
|
|
86
|
+
...composeTarget(browsed, outboxMessageId),
|
|
83
87
|
search: withoutComposeSeed,
|
|
84
88
|
// Opening or closing the surface is going somewhere, so the panes the
|
|
85
89
|
// reader keeps up travel and the overlays they were reading over do
|
|
@@ -89,7 +93,7 @@ function useComposeNavigate() {
|
|
|
89
93
|
hash: options?.keepPanels ? true : retainPanels,
|
|
90
94
|
replace: options?.replace ?? false,
|
|
91
95
|
});
|
|
92
|
-
}, [navigate, retainPanels,
|
|
96
|
+
}, [navigate, retainPanels, browsed]);
|
|
93
97
|
}
|
|
94
98
|
/**
|
|
95
99
|
* Start a new message.
|
|
@@ -4,7 +4,7 @@ export { type CalendarAddress, type CalendarNavigation, type OpenCalendarEvent,
|
|
|
4
4
|
export { useAdoptComposeDraft, useCloseCompose, useComposeDraftId, useEditDraft, useIsComposing, useOpenCompose, } from "./compose";
|
|
5
5
|
export { formatOpenPanels, isOverlayPanel, type OverlayPanel, overlayPanels, type PanelFragment, panelFragments, panelsWithOverlay, parseOpenPanels, retainOpenPanelsAtTier, useOpenPanels, useRetainOpenPanels, useSetOpenPanels, } from "./fragment";
|
|
6
6
|
export { NavLink, type NavLinkProps } from "./nav-link";
|
|
7
|
-
export { useSelectedNavId } from "./nav-selection";
|
|
7
|
+
export { labelIdOfNavId, labelNavId, useSelectedNavId, } from "./nav-selection";
|
|
8
8
|
export { type OpenThreadOptions, type OpenThreadPath, type OpenThreadTarget, useCloseThread, useOpenThread, useOpenThreadPath, } from "./open-thread";
|
|
9
9
|
export { useCloseOutboxDraft, useOpenOutboxDraft, useOutboxDraftId, } from "./outbox-draft";
|
|
10
10
|
export { type ReplyAddress, type ReplyMode, type ReplySurface, type ReplyTarget, replyModes, replyToThread, useAdoptReplyDraft, useCloseReply, useIsReplying, useOpenReply, useReplySurface, } from "./reply";
|
|
@@ -4,7 +4,7 @@ export { useBackCloses, useCalendarAddress, useCalendarNavigation, useChangeSugg
|
|
|
4
4
|
export { useAdoptComposeDraft, useCloseCompose, useComposeDraftId, useEditDraft, useIsComposing, useOpenCompose, } from "./compose";
|
|
5
5
|
export { formatOpenPanels, isOverlayPanel, overlayPanels, panelFragments, panelsWithOverlay, parseOpenPanels, retainOpenPanelsAtTier, useOpenPanels, useRetainOpenPanels, useSetOpenPanels, } from "./fragment";
|
|
6
6
|
export { NavLink } from "./nav-link";
|
|
7
|
-
export { useSelectedNavId } from "./nav-selection";
|
|
7
|
+
export { labelIdOfNavId, labelNavId, useSelectedNavId, } from "./nav-selection";
|
|
8
8
|
export { useCloseThread, useOpenThread, useOpenThreadPath, } from "./open-thread";
|
|
9
9
|
export { useCloseOutboxDraft, useOpenOutboxDraft, useOutboxDraftId, } from "./outbox-draft";
|
|
10
10
|
export { replyModes, replyToThread, useAdoptReplyDraft, useCloseReply, useIsReplying, useOpenReply, useReplySurface, } from "./reply";
|
|
@@ -1,9 +1,14 @@
|
|
|
1
|
+
/** The nav id of a label's entry. Mailbox ids are UUIDs, so the prefix never collides. */
|
|
2
|
+
export declare function labelNavId(labelId: string): string;
|
|
3
|
+
/** The label a nav id names, or `undefined` when it names something else. */
|
|
4
|
+
export declare function labelIdOfNavId(navId: string): string | undefined;
|
|
1
5
|
/**
|
|
2
6
|
* The nav entry the address selects, or `""` where none does.
|
|
3
7
|
*
|
|
4
8
|
* - `/settings/*` → "settings"
|
|
5
9
|
* - `/calendar/*` → "calendar"
|
|
6
10
|
* - `/mail/outbox`, `/mail/flagged`, `/mail/brief` → that list
|
|
11
|
+
* - `/mail/label/$labelId` → the label's nav id
|
|
7
12
|
* - `/mail/$mailboxId` → the mailbox id, which is what the sidebar keys on
|
|
8
13
|
*
|
|
9
14
|
* Read off the pathname rather than the matches: the router commits the new
|
|
@@ -1,11 +1,23 @@
|
|
|
1
1
|
import { useLocation, useParams } from "@tanstack/react-router";
|
|
2
2
|
import { locationIsOnList } from "../lib/mail-route";
|
|
3
|
+
const LABEL_NAV_PREFIX = "label:";
|
|
4
|
+
/** The nav id of a label's entry. Mailbox ids are UUIDs, so the prefix never collides. */
|
|
5
|
+
export function labelNavId(labelId) {
|
|
6
|
+
return `${LABEL_NAV_PREFIX}${labelId}`;
|
|
7
|
+
}
|
|
8
|
+
/** The label a nav id names, or `undefined` when it names something else. */
|
|
9
|
+
export function labelIdOfNavId(navId) {
|
|
10
|
+
return navId.startsWith(LABEL_NAV_PREFIX)
|
|
11
|
+
? navId.slice(LABEL_NAV_PREFIX.length)
|
|
12
|
+
: undefined;
|
|
13
|
+
}
|
|
3
14
|
/**
|
|
4
15
|
* The nav entry the address selects, or `""` where none does.
|
|
5
16
|
*
|
|
6
17
|
* - `/settings/*` → "settings"
|
|
7
18
|
* - `/calendar/*` → "calendar"
|
|
8
19
|
* - `/mail/outbox`, `/mail/flagged`, `/mail/brief` → that list
|
|
20
|
+
* - `/mail/label/$labelId` → the label's nav id
|
|
9
21
|
* - `/mail/$mailboxId` → the mailbox id, which is what the sidebar keys on
|
|
10
22
|
*
|
|
11
23
|
* Read off the pathname rather than the matches: the router commits the new
|
|
@@ -15,6 +27,7 @@ import { locationIsOnList } from "../lib/mail-route";
|
|
|
15
27
|
export function useSelectedNavId() {
|
|
16
28
|
const { pathname } = useLocation();
|
|
17
29
|
const mailbox = useParams({ from: "/mail/$mailboxId", shouldThrow: false });
|
|
30
|
+
const label = useParams({ from: "/mail/label/$labelId", shouldThrow: false });
|
|
18
31
|
if (locationIsOnList(pathname, "/settings"))
|
|
19
32
|
return "settings";
|
|
20
33
|
if (locationIsOnList(pathname, "/calendar"))
|
|
@@ -25,5 +38,7 @@ export function useSelectedNavId() {
|
|
|
25
38
|
return "flagged";
|
|
26
39
|
if (locationIsOnList(pathname, "/mail/brief"))
|
|
27
40
|
return "brief";
|
|
41
|
+
if (label?.labelId)
|
|
42
|
+
return labelNavId(label.labelId);
|
|
28
43
|
return mailbox?.mailboxId ?? "";
|
|
29
44
|
}
|
|
@@ -29,6 +29,14 @@ export function useOpenThreadPath() {
|
|
|
29
29
|
from: "/mail/flagged/$threadId/$messageId",
|
|
30
30
|
shouldThrow: false,
|
|
31
31
|
});
|
|
32
|
+
const labelThread = useParams({
|
|
33
|
+
from: "/mail/label/$labelId/$threadId",
|
|
34
|
+
shouldThrow: false,
|
|
35
|
+
});
|
|
36
|
+
const labelMessage = useParams({
|
|
37
|
+
from: "/mail/label/$labelId/$threadId/$messageId",
|
|
38
|
+
shouldThrow: false,
|
|
39
|
+
});
|
|
32
40
|
const mailboxThread = useParams({
|
|
33
41
|
from: "/mail/$mailboxId/$threadId",
|
|
34
42
|
shouldThrow: false,
|
|
@@ -37,9 +45,13 @@ export function useOpenThreadPath() {
|
|
|
37
45
|
from: "/mail/$mailboxId/$threadId/$messageId",
|
|
38
46
|
shouldThrow: false,
|
|
39
47
|
});
|
|
40
|
-
const threadId = briefThread?.threadId ??
|
|
48
|
+
const threadId = briefThread?.threadId ??
|
|
49
|
+
flaggedThread?.threadId ??
|
|
50
|
+
labelThread?.threadId ??
|
|
51
|
+
mailboxThread?.threadId;
|
|
41
52
|
const messageId = briefMessage?.messageId ??
|
|
42
53
|
flaggedMessage?.messageId ??
|
|
54
|
+
labelMessage?.messageId ??
|
|
43
55
|
mailboxMessage?.messageId;
|
|
44
56
|
return useMemo(() => (threadId ? { threadId, messageId } : undefined), [threadId, messageId]);
|
|
45
57
|
}
|
|
@@ -56,7 +68,7 @@ export function useOpenThreadPath() {
|
|
|
56
68
|
export function useOpenThread() {
|
|
57
69
|
const navigate = useNavigate();
|
|
58
70
|
const retainPanels = useRetainOpenPanels();
|
|
59
|
-
const { list, mailboxId: browsedMailboxId } = useBrowsedList();
|
|
71
|
+
const { list, mailboxId: browsedMailboxId, labelId } = useBrowsedList();
|
|
60
72
|
return useCallback((target, options) => {
|
|
61
73
|
const query = options?.query;
|
|
62
74
|
const search = (prev) => query === undefined ? prev : { ...prev, q: query || undefined };
|
|
@@ -73,6 +85,14 @@ export function useOpenThread() {
|
|
|
73
85
|
});
|
|
74
86
|
return;
|
|
75
87
|
}
|
|
88
|
+
if (list === "label" && labelId) {
|
|
89
|
+
navigate({
|
|
90
|
+
to: "/mail/label/$labelId/$threadId/$messageId",
|
|
91
|
+
params: { labelId, ...target },
|
|
92
|
+
...rest,
|
|
93
|
+
});
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
76
96
|
const mailboxId = options?.mailboxId ?? browsedMailboxId;
|
|
77
97
|
if (list === "mailbox" && mailboxId) {
|
|
78
98
|
navigate({
|
|
@@ -87,7 +107,7 @@ export function useOpenThread() {
|
|
|
87
107
|
params: target,
|
|
88
108
|
...rest,
|
|
89
109
|
});
|
|
90
|
-
}, [navigate, retainPanels, list, browsedMailboxId]);
|
|
110
|
+
}, [navigate, retainPanels, list, browsedMailboxId, labelId]);
|
|
91
111
|
}
|
|
92
112
|
/**
|
|
93
113
|
* Close the conversation, landing back on the list it was opened from.
|
|
@@ -23,6 +23,7 @@ const replyModeSchema = z.enum(replyModes);
|
|
|
23
23
|
const BRIEF_REPLY = "/mail/brief/$threadId/$messageId/$mode/{-$outboxMessageId}";
|
|
24
24
|
const FLAGGED_REPLY = "/mail/flagged/$threadId/$messageId/$mode/{-$outboxMessageId}";
|
|
25
25
|
const MAILBOX_REPLY = "/mail/$mailboxId/$threadId/$messageId/$mode/{-$outboxMessageId}";
|
|
26
|
+
const LABEL_REPLY = "/mail/label/$labelId/$threadId/$messageId/$mode/{-$outboxMessageId}";
|
|
26
27
|
/**
|
|
27
28
|
* The reply match, if the address has one. Each `from` names a real route, so a
|
|
28
29
|
* segment that does not exist fails to compile.
|
|
@@ -33,13 +34,15 @@ function useReplyParams() {
|
|
|
33
34
|
const brief = useParams({ from: BRIEF_REPLY, shouldThrow: false });
|
|
34
35
|
const flagged = useParams({ from: FLAGGED_REPLY, shouldThrow: false });
|
|
35
36
|
const mailbox = useParams({ from: MAILBOX_REPLY, shouldThrow: false });
|
|
36
|
-
|
|
37
|
+
const label = useParams({ from: LABEL_REPLY, shouldThrow: false });
|
|
38
|
+
return brief ?? flagged ?? mailbox ?? label;
|
|
37
39
|
}
|
|
38
40
|
function useReplySeed() {
|
|
39
41
|
const brief = useSearch({ from: BRIEF_REPLY, shouldThrow: false });
|
|
40
42
|
const flagged = useSearch({ from: FLAGGED_REPLY, shouldThrow: false });
|
|
41
43
|
const mailbox = useSearch({ from: MAILBOX_REPLY, shouldThrow: false });
|
|
42
|
-
|
|
44
|
+
const label = useSearch({ from: LABEL_REPLY, shouldThrow: false });
|
|
45
|
+
return (brief ?? flagged ?? mailbox ?? label)?.body;
|
|
43
46
|
}
|
|
44
47
|
const seededSearch = (seed) => (prev) => seed === undefined
|
|
45
48
|
? withoutComposeSeed(prev)
|
|
@@ -90,7 +93,7 @@ export function useIsReplying() {
|
|
|
90
93
|
* exists and always mounts the conversation — so the frame before a folder id
|
|
91
94
|
* resolves opens a composer rather than reporting that it cannot.
|
|
92
95
|
*/
|
|
93
|
-
function replyTarget(list, mailboxId, target, outboxMessageId) {
|
|
96
|
+
function replyTarget({ list, mailboxId, labelId }, target, outboxMessageId) {
|
|
94
97
|
if (list === "flagged")
|
|
95
98
|
return { to: FLAGGED_REPLY, params: { ...target, outboxMessageId } };
|
|
96
99
|
if (list === "mailbox" && mailboxId)
|
|
@@ -98,6 +101,11 @@ function replyTarget(list, mailboxId, target, outboxMessageId) {
|
|
|
98
101
|
to: MAILBOX_REPLY,
|
|
99
102
|
params: { ...target, mailboxId, outboxMessageId },
|
|
100
103
|
};
|
|
104
|
+
if (list === "label" && labelId)
|
|
105
|
+
return {
|
|
106
|
+
to: LABEL_REPLY,
|
|
107
|
+
params: { ...target, labelId, outboxMessageId },
|
|
108
|
+
};
|
|
101
109
|
return { to: BRIEF_REPLY, params: { ...target, outboxMessageId } };
|
|
102
110
|
}
|
|
103
111
|
/**
|
|
@@ -133,15 +141,15 @@ function inheritedDraft(open, target) {
|
|
|
133
141
|
export function useOpenReply() {
|
|
134
142
|
const navigate = useNavigate();
|
|
135
143
|
const retainPanels = useRetainOpenPanels();
|
|
136
|
-
const
|
|
144
|
+
const browsed = useBrowsedList();
|
|
137
145
|
const open = useReplySurface();
|
|
138
146
|
return useCallback((target, seed) => {
|
|
139
147
|
navigate({
|
|
140
|
-
...replyTarget(
|
|
148
|
+
...replyTarget(browsed, target, seed === undefined ? inheritedDraft(open, target) : undefined),
|
|
141
149
|
search: seededSearch(seed),
|
|
142
150
|
hash: retainPanels,
|
|
143
151
|
});
|
|
144
|
-
}, [navigate, retainPanels,
|
|
152
|
+
}, [navigate, retainPanels, browsed, open]);
|
|
145
153
|
}
|
|
146
154
|
/**
|
|
147
155
|
* Answer the conversation a list has open, from the segments naming it.
|
|
@@ -175,13 +183,13 @@ export function replyToThread(openReply, threadId, messageId) {
|
|
|
175
183
|
*/
|
|
176
184
|
export function useAdoptReplyDraft() {
|
|
177
185
|
const navigate = useNavigate();
|
|
178
|
-
const
|
|
186
|
+
const browsed = useBrowsedList();
|
|
179
187
|
const surface = useReplySurface();
|
|
180
188
|
return useCallback((outboxMessageId) => {
|
|
181
189
|
if (surface?.kind !== "reply")
|
|
182
190
|
return;
|
|
183
191
|
navigate({
|
|
184
|
-
...replyTarget(
|
|
192
|
+
...replyTarget(browsed, {
|
|
185
193
|
threadId: surface.threadId,
|
|
186
194
|
messageId: surface.sourceMessageId,
|
|
187
195
|
mode: surface.mode,
|
|
@@ -190,7 +198,7 @@ export function useAdoptReplyDraft() {
|
|
|
190
198
|
hash: true,
|
|
191
199
|
replace: true,
|
|
192
200
|
});
|
|
193
|
-
}, [navigate,
|
|
201
|
+
}, [navigate, browsed, surface]);
|
|
194
202
|
}
|
|
195
203
|
/**
|
|
196
204
|
* Close the reply, landing back on the message it was answering.
|
|
@@ -202,7 +210,7 @@ export function useAdoptReplyDraft() {
|
|
|
202
210
|
export function useCloseReply() {
|
|
203
211
|
const navigate = useNavigate();
|
|
204
212
|
const retainPanels = useRetainOpenPanels();
|
|
205
|
-
const { list, mailboxId } = useBrowsedList();
|
|
213
|
+
const { list, mailboxId, labelId } = useBrowsedList();
|
|
206
214
|
const params = useReplyParams();
|
|
207
215
|
return useCallback(() => {
|
|
208
216
|
if (!params)
|
|
@@ -228,11 +236,20 @@ export function useCloseReply() {
|
|
|
228
236
|
});
|
|
229
237
|
return;
|
|
230
238
|
}
|
|
239
|
+
if (list === "label" && labelId) {
|
|
240
|
+
navigate({
|
|
241
|
+
to: "/mail/label/$labelId/$threadId/$messageId",
|
|
242
|
+
params: { ...message, labelId },
|
|
243
|
+
search,
|
|
244
|
+
hash,
|
|
245
|
+
});
|
|
246
|
+
return;
|
|
247
|
+
}
|
|
231
248
|
navigate({
|
|
232
249
|
to: "/mail/brief/$threadId/$messageId",
|
|
233
250
|
params: message,
|
|
234
251
|
search,
|
|
235
252
|
hash,
|
|
236
253
|
});
|
|
237
|
-
}, [navigate, retainPanels, list, mailboxId, params]);
|
|
254
|
+
}, [navigate, retainPanels, list, mailboxId, labelId, params]);
|
|
238
255
|
}
|
|
@@ -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 = "
|
|
70
|
-
const
|
|
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,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remit/web-client",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.347",
|
|
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.
|
|
94
|
+
"@remit/ui": "0.0.238",
|
|
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,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 };
|