@remit/web-client 0.0.167 → 0.0.168
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/package.json +1 -1
- package/src/components/compose/ComposeForm.tsx +14 -4
- package/src/components/compose/ComposeProvider.tsx +7 -1
- package/src/components/compose/ConversationCompose.tsx +57 -0
- package/src/components/mail/BriefPane.tsx +49 -13
- package/src/components/mail/ConversationView.tsx +82 -77
- package/src/components/mail/FlaggedPane.tsx +49 -13
- package/src/components/mail/MailboxPane.tsx +55 -55
- package/src/components/mail/conversation-reply-reach.render.test.ts +81 -28
- package/src/hooks/useThreadActions.ts +8 -17
- package/src/routeTree.gen.ts +128 -15
- package/src/routes/mail/$mailboxId/$threadId/$messageId/$mode.{-$outboxMessageId}.tsx +14 -0
- package/src/routes/mail/$mailboxId/$threadId/$messageId.tsx +4 -0
- package/src/routes/mail/brief/$threadId/$messageId/$mode.{-$outboxMessageId}.tsx +26 -0
- package/src/routes/mail/brief/$threadId/$messageId.tsx +4 -0
- package/src/routes/mail/flagged/$threadId/$messageId/$mode.{-$outboxMessageId}.tsx +14 -0
- package/src/routes/mail/flagged/$threadId/$messageId.tsx +4 -0
- package/src/routing/browsed-list.ts +22 -0
- package/src/routing/compose.ts +2 -17
- package/src/routing/index.ts +12 -0
- package/src/routing/reply.ts +282 -0
- package/src/components/compose/InlineCompose.tsx +0 -47
package/src/routeTree.gen.ts
CHANGED
|
@@ -45,6 +45,9 @@ import { Route as MailFlaggedThreadIdMessageIdRouteImport } from './routes/mail/
|
|
|
45
45
|
import { Route as MailFlaggedComposeChar123OutboxMessageIdChar125RouteImport } from './routes/mail/flagged/compose.{-$outboxMessageId}'
|
|
46
46
|
import { Route as MailOutboxComposeChar123OutboxMessageIdChar125RouteImport } from './routes/mail/outbox/compose.{-$outboxMessageId}'
|
|
47
47
|
import { Route as MailOutboxDraftOutboxMessageIdRouteImport } from './routes/mail/outbox/draft/$outboxMessageId'
|
|
48
|
+
import { Route as MailMailboxIdThreadIdMessageIdModeChar123OutboxMessageIdChar125RouteImport } from './routes/mail/$mailboxId/$threadId/$messageId/$mode.{-$outboxMessageId}'
|
|
49
|
+
import { Route as MailBriefThreadIdMessageIdModeChar123OutboxMessageIdChar125RouteImport } from './routes/mail/brief/$threadId/$messageId/$mode.{-$outboxMessageId}'
|
|
50
|
+
import { Route as MailFlaggedThreadIdMessageIdModeChar123OutboxMessageIdChar125RouteImport } from './routes/mail/flagged/$threadId/$messageId/$mode.{-$outboxMessageId}'
|
|
48
51
|
|
|
49
52
|
const IndexRoute = IndexRouteImport.update({
|
|
50
53
|
id: '/',
|
|
@@ -236,6 +239,30 @@ const MailOutboxDraftOutboxMessageIdRoute =
|
|
|
236
239
|
path: '/draft/$outboxMessageId',
|
|
237
240
|
getParentRoute: () => MailOutboxRoute,
|
|
238
241
|
} as any)
|
|
242
|
+
const MailMailboxIdThreadIdMessageIdModeChar123OutboxMessageIdChar125Route =
|
|
243
|
+
MailMailboxIdThreadIdMessageIdModeChar123OutboxMessageIdChar125RouteImport.update(
|
|
244
|
+
{
|
|
245
|
+
id: '/$mode/{-$outboxMessageId}',
|
|
246
|
+
path: '/$mode/{-$outboxMessageId}',
|
|
247
|
+
getParentRoute: () => MailMailboxIdThreadIdMessageIdRoute,
|
|
248
|
+
} as any,
|
|
249
|
+
)
|
|
250
|
+
const MailBriefThreadIdMessageIdModeChar123OutboxMessageIdChar125Route =
|
|
251
|
+
MailBriefThreadIdMessageIdModeChar123OutboxMessageIdChar125RouteImport.update(
|
|
252
|
+
{
|
|
253
|
+
id: '/$mode/{-$outboxMessageId}',
|
|
254
|
+
path: '/$mode/{-$outboxMessageId}',
|
|
255
|
+
getParentRoute: () => MailBriefThreadIdMessageIdRoute,
|
|
256
|
+
} as any,
|
|
257
|
+
)
|
|
258
|
+
const MailFlaggedThreadIdMessageIdModeChar123OutboxMessageIdChar125Route =
|
|
259
|
+
MailFlaggedThreadIdMessageIdModeChar123OutboxMessageIdChar125RouteImport.update(
|
|
260
|
+
{
|
|
261
|
+
id: '/$mode/{-$outboxMessageId}',
|
|
262
|
+
path: '/$mode/{-$outboxMessageId}',
|
|
263
|
+
getParentRoute: () => MailFlaggedThreadIdMessageIdRoute,
|
|
264
|
+
} as any,
|
|
265
|
+
)
|
|
239
266
|
|
|
240
267
|
export interface FileRoutesByFullPath {
|
|
241
268
|
'/': typeof IndexRoute
|
|
@@ -263,17 +290,20 @@ export interface FileRoutesByFullPath {
|
|
|
263
290
|
'/mail/brief/': typeof MailBriefIndexRoute
|
|
264
291
|
'/mail/flagged/': typeof MailFlaggedIndexRoute
|
|
265
292
|
'/mail/outbox/': typeof MailOutboxIndexRoute
|
|
266
|
-
'/mail/$mailboxId/$threadId/$messageId': typeof
|
|
293
|
+
'/mail/$mailboxId/$threadId/$messageId': typeof MailMailboxIdThreadIdMessageIdRouteWithChildren
|
|
267
294
|
'/mail/$mailboxId/compose/{-$outboxMessageId}': typeof MailMailboxIdComposeChar123OutboxMessageIdChar125Route
|
|
268
|
-
'/mail/brief/$threadId/$messageId': typeof
|
|
295
|
+
'/mail/brief/$threadId/$messageId': typeof MailBriefThreadIdMessageIdRouteWithChildren
|
|
269
296
|
'/mail/brief/compose/{-$outboxMessageId}': typeof MailBriefComposeChar123OutboxMessageIdChar125Route
|
|
270
|
-
'/mail/flagged/$threadId/$messageId': typeof
|
|
297
|
+
'/mail/flagged/$threadId/$messageId': typeof MailFlaggedThreadIdMessageIdRouteWithChildren
|
|
271
298
|
'/mail/flagged/compose/{-$outboxMessageId}': typeof MailFlaggedComposeChar123OutboxMessageIdChar125Route
|
|
272
299
|
'/mail/outbox/compose/{-$outboxMessageId}': typeof MailOutboxComposeChar123OutboxMessageIdChar125Route
|
|
273
300
|
'/mail/outbox/draft/$outboxMessageId': typeof MailOutboxDraftOutboxMessageIdRoute
|
|
274
301
|
'/mail/$mailboxId/$threadId/': typeof MailMailboxIdThreadIdIndexRoute
|
|
275
302
|
'/mail/brief/$threadId/': typeof MailBriefThreadIdIndexRoute
|
|
276
303
|
'/mail/flagged/$threadId/': typeof MailFlaggedThreadIdIndexRoute
|
|
304
|
+
'/mail/$mailboxId/$threadId/$messageId/$mode/{-$outboxMessageId}': typeof MailMailboxIdThreadIdMessageIdModeChar123OutboxMessageIdChar125Route
|
|
305
|
+
'/mail/brief/$threadId/$messageId/$mode/{-$outboxMessageId}': typeof MailBriefThreadIdMessageIdModeChar123OutboxMessageIdChar125Route
|
|
306
|
+
'/mail/flagged/$threadId/$messageId/$mode/{-$outboxMessageId}': typeof MailFlaggedThreadIdMessageIdModeChar123OutboxMessageIdChar125Route
|
|
277
307
|
}
|
|
278
308
|
export interface FileRoutesByTo {
|
|
279
309
|
'/': typeof IndexRoute
|
|
@@ -292,17 +322,20 @@ export interface FileRoutesByTo {
|
|
|
292
322
|
'/mail/brief': typeof MailBriefIndexRoute
|
|
293
323
|
'/mail/flagged': typeof MailFlaggedIndexRoute
|
|
294
324
|
'/mail/outbox': typeof MailOutboxIndexRoute
|
|
295
|
-
'/mail/$mailboxId/$threadId/$messageId': typeof
|
|
325
|
+
'/mail/$mailboxId/$threadId/$messageId': typeof MailMailboxIdThreadIdMessageIdRouteWithChildren
|
|
296
326
|
'/mail/$mailboxId/compose/{-$outboxMessageId}': typeof MailMailboxIdComposeChar123OutboxMessageIdChar125Route
|
|
297
|
-
'/mail/brief/$threadId/$messageId': typeof
|
|
327
|
+
'/mail/brief/$threadId/$messageId': typeof MailBriefThreadIdMessageIdRouteWithChildren
|
|
298
328
|
'/mail/brief/compose/{-$outboxMessageId}': typeof MailBriefComposeChar123OutboxMessageIdChar125Route
|
|
299
|
-
'/mail/flagged/$threadId/$messageId': typeof
|
|
329
|
+
'/mail/flagged/$threadId/$messageId': typeof MailFlaggedThreadIdMessageIdRouteWithChildren
|
|
300
330
|
'/mail/flagged/compose/{-$outboxMessageId}': typeof MailFlaggedComposeChar123OutboxMessageIdChar125Route
|
|
301
331
|
'/mail/outbox/compose/{-$outboxMessageId}': typeof MailOutboxComposeChar123OutboxMessageIdChar125Route
|
|
302
332
|
'/mail/outbox/draft/$outboxMessageId': typeof MailOutboxDraftOutboxMessageIdRoute
|
|
303
333
|
'/mail/$mailboxId/$threadId': typeof MailMailboxIdThreadIdIndexRoute
|
|
304
334
|
'/mail/brief/$threadId': typeof MailBriefThreadIdIndexRoute
|
|
305
335
|
'/mail/flagged/$threadId': typeof MailFlaggedThreadIdIndexRoute
|
|
336
|
+
'/mail/$mailboxId/$threadId/$messageId/$mode/{-$outboxMessageId}': typeof MailMailboxIdThreadIdMessageIdModeChar123OutboxMessageIdChar125Route
|
|
337
|
+
'/mail/brief/$threadId/$messageId/$mode/{-$outboxMessageId}': typeof MailBriefThreadIdMessageIdModeChar123OutboxMessageIdChar125Route
|
|
338
|
+
'/mail/flagged/$threadId/$messageId/$mode/{-$outboxMessageId}': typeof MailFlaggedThreadIdMessageIdModeChar123OutboxMessageIdChar125Route
|
|
306
339
|
}
|
|
307
340
|
export interface FileRoutesById {
|
|
308
341
|
__root__: typeof rootRouteImport
|
|
@@ -331,17 +364,20 @@ export interface FileRoutesById {
|
|
|
331
364
|
'/mail/brief/': typeof MailBriefIndexRoute
|
|
332
365
|
'/mail/flagged/': typeof MailFlaggedIndexRoute
|
|
333
366
|
'/mail/outbox/': typeof MailOutboxIndexRoute
|
|
334
|
-
'/mail/$mailboxId/$threadId/$messageId': typeof
|
|
367
|
+
'/mail/$mailboxId/$threadId/$messageId': typeof MailMailboxIdThreadIdMessageIdRouteWithChildren
|
|
335
368
|
'/mail/$mailboxId/compose/{-$outboxMessageId}': typeof MailMailboxIdComposeChar123OutboxMessageIdChar125Route
|
|
336
|
-
'/mail/brief/$threadId/$messageId': typeof
|
|
369
|
+
'/mail/brief/$threadId/$messageId': typeof MailBriefThreadIdMessageIdRouteWithChildren
|
|
337
370
|
'/mail/brief/compose/{-$outboxMessageId}': typeof MailBriefComposeChar123OutboxMessageIdChar125Route
|
|
338
|
-
'/mail/flagged/$threadId/$messageId': typeof
|
|
371
|
+
'/mail/flagged/$threadId/$messageId': typeof MailFlaggedThreadIdMessageIdRouteWithChildren
|
|
339
372
|
'/mail/flagged/compose/{-$outboxMessageId}': typeof MailFlaggedComposeChar123OutboxMessageIdChar125Route
|
|
340
373
|
'/mail/outbox/compose/{-$outboxMessageId}': typeof MailOutboxComposeChar123OutboxMessageIdChar125Route
|
|
341
374
|
'/mail/outbox/draft/$outboxMessageId': typeof MailOutboxDraftOutboxMessageIdRoute
|
|
342
375
|
'/mail/$mailboxId/$threadId/': typeof MailMailboxIdThreadIdIndexRoute
|
|
343
376
|
'/mail/brief/$threadId/': typeof MailBriefThreadIdIndexRoute
|
|
344
377
|
'/mail/flagged/$threadId/': typeof MailFlaggedThreadIdIndexRoute
|
|
378
|
+
'/mail/$mailboxId/$threadId/$messageId/$mode/{-$outboxMessageId}': typeof MailMailboxIdThreadIdMessageIdModeChar123OutboxMessageIdChar125Route
|
|
379
|
+
'/mail/brief/$threadId/$messageId/$mode/{-$outboxMessageId}': typeof MailBriefThreadIdMessageIdModeChar123OutboxMessageIdChar125Route
|
|
380
|
+
'/mail/flagged/$threadId/$messageId/$mode/{-$outboxMessageId}': typeof MailFlaggedThreadIdMessageIdModeChar123OutboxMessageIdChar125Route
|
|
345
381
|
}
|
|
346
382
|
export interface FileRouteTypes {
|
|
347
383
|
fileRoutesByFullPath: FileRoutesByFullPath
|
|
@@ -382,6 +418,9 @@ export interface FileRouteTypes {
|
|
|
382
418
|
| '/mail/$mailboxId/$threadId/'
|
|
383
419
|
| '/mail/brief/$threadId/'
|
|
384
420
|
| '/mail/flagged/$threadId/'
|
|
421
|
+
| '/mail/$mailboxId/$threadId/$messageId/$mode/{-$outboxMessageId}'
|
|
422
|
+
| '/mail/brief/$threadId/$messageId/$mode/{-$outboxMessageId}'
|
|
423
|
+
| '/mail/flagged/$threadId/$messageId/$mode/{-$outboxMessageId}'
|
|
385
424
|
fileRoutesByTo: FileRoutesByTo
|
|
386
425
|
to:
|
|
387
426
|
| '/'
|
|
@@ -411,6 +450,9 @@ export interface FileRouteTypes {
|
|
|
411
450
|
| '/mail/$mailboxId/$threadId'
|
|
412
451
|
| '/mail/brief/$threadId'
|
|
413
452
|
| '/mail/flagged/$threadId'
|
|
453
|
+
| '/mail/$mailboxId/$threadId/$messageId/$mode/{-$outboxMessageId}'
|
|
454
|
+
| '/mail/brief/$threadId/$messageId/$mode/{-$outboxMessageId}'
|
|
455
|
+
| '/mail/flagged/$threadId/$messageId/$mode/{-$outboxMessageId}'
|
|
414
456
|
id:
|
|
415
457
|
| '__root__'
|
|
416
458
|
| '/'
|
|
@@ -449,6 +491,9 @@ export interface FileRouteTypes {
|
|
|
449
491
|
| '/mail/$mailboxId/$threadId/'
|
|
450
492
|
| '/mail/brief/$threadId/'
|
|
451
493
|
| '/mail/flagged/$threadId/'
|
|
494
|
+
| '/mail/$mailboxId/$threadId/$messageId/$mode/{-$outboxMessageId}'
|
|
495
|
+
| '/mail/brief/$threadId/$messageId/$mode/{-$outboxMessageId}'
|
|
496
|
+
| '/mail/flagged/$threadId/$messageId/$mode/{-$outboxMessageId}'
|
|
452
497
|
fileRoutesById: FileRoutesById
|
|
453
498
|
}
|
|
454
499
|
export interface RootRouteChildren {
|
|
@@ -712,16 +757,53 @@ declare module '@tanstack/react-router' {
|
|
|
712
757
|
preLoaderRoute: typeof MailOutboxDraftOutboxMessageIdRouteImport
|
|
713
758
|
parentRoute: typeof MailOutboxRoute
|
|
714
759
|
}
|
|
760
|
+
'/mail/$mailboxId/$threadId/$messageId/$mode/{-$outboxMessageId}': {
|
|
761
|
+
id: '/mail/$mailboxId/$threadId/$messageId/$mode/{-$outboxMessageId}'
|
|
762
|
+
path: '/$mode/{-$outboxMessageId}'
|
|
763
|
+
fullPath: '/mail/$mailboxId/$threadId/$messageId/$mode/{-$outboxMessageId}'
|
|
764
|
+
preLoaderRoute: typeof MailMailboxIdThreadIdMessageIdModeChar123OutboxMessageIdChar125RouteImport
|
|
765
|
+
parentRoute: typeof MailMailboxIdThreadIdMessageIdRoute
|
|
766
|
+
}
|
|
767
|
+
'/mail/brief/$threadId/$messageId/$mode/{-$outboxMessageId}': {
|
|
768
|
+
id: '/mail/brief/$threadId/$messageId/$mode/{-$outboxMessageId}'
|
|
769
|
+
path: '/$mode/{-$outboxMessageId}'
|
|
770
|
+
fullPath: '/mail/brief/$threadId/$messageId/$mode/{-$outboxMessageId}'
|
|
771
|
+
preLoaderRoute: typeof MailBriefThreadIdMessageIdModeChar123OutboxMessageIdChar125RouteImport
|
|
772
|
+
parentRoute: typeof MailBriefThreadIdMessageIdRoute
|
|
773
|
+
}
|
|
774
|
+
'/mail/flagged/$threadId/$messageId/$mode/{-$outboxMessageId}': {
|
|
775
|
+
id: '/mail/flagged/$threadId/$messageId/$mode/{-$outboxMessageId}'
|
|
776
|
+
path: '/$mode/{-$outboxMessageId}'
|
|
777
|
+
fullPath: '/mail/flagged/$threadId/$messageId/$mode/{-$outboxMessageId}'
|
|
778
|
+
preLoaderRoute: typeof MailFlaggedThreadIdMessageIdModeChar123OutboxMessageIdChar125RouteImport
|
|
779
|
+
parentRoute: typeof MailFlaggedThreadIdMessageIdRoute
|
|
780
|
+
}
|
|
715
781
|
}
|
|
716
782
|
}
|
|
717
783
|
|
|
784
|
+
interface MailMailboxIdThreadIdMessageIdRouteChildren {
|
|
785
|
+
MailMailboxIdThreadIdMessageIdModeChar123OutboxMessageIdChar125Route: typeof MailMailboxIdThreadIdMessageIdModeChar123OutboxMessageIdChar125Route
|
|
786
|
+
}
|
|
787
|
+
|
|
788
|
+
const MailMailboxIdThreadIdMessageIdRouteChildren: MailMailboxIdThreadIdMessageIdRouteChildren =
|
|
789
|
+
{
|
|
790
|
+
MailMailboxIdThreadIdMessageIdModeChar123OutboxMessageIdChar125Route:
|
|
791
|
+
MailMailboxIdThreadIdMessageIdModeChar123OutboxMessageIdChar125Route,
|
|
792
|
+
}
|
|
793
|
+
|
|
794
|
+
const MailMailboxIdThreadIdMessageIdRouteWithChildren =
|
|
795
|
+
MailMailboxIdThreadIdMessageIdRoute._addFileChildren(
|
|
796
|
+
MailMailboxIdThreadIdMessageIdRouteChildren,
|
|
797
|
+
)
|
|
798
|
+
|
|
718
799
|
interface MailMailboxIdThreadIdRouteChildren {
|
|
719
|
-
MailMailboxIdThreadIdMessageIdRoute: typeof
|
|
800
|
+
MailMailboxIdThreadIdMessageIdRoute: typeof MailMailboxIdThreadIdMessageIdRouteWithChildren
|
|
720
801
|
MailMailboxIdThreadIdIndexRoute: typeof MailMailboxIdThreadIdIndexRoute
|
|
721
802
|
}
|
|
722
803
|
|
|
723
804
|
const MailMailboxIdThreadIdRouteChildren: MailMailboxIdThreadIdRouteChildren = {
|
|
724
|
-
MailMailboxIdThreadIdMessageIdRoute:
|
|
805
|
+
MailMailboxIdThreadIdMessageIdRoute:
|
|
806
|
+
MailMailboxIdThreadIdMessageIdRouteWithChildren,
|
|
725
807
|
MailMailboxIdThreadIdIndexRoute: MailMailboxIdThreadIdIndexRoute,
|
|
726
808
|
}
|
|
727
809
|
|
|
@@ -747,13 +829,28 @@ const MailMailboxIdRouteWithChildren = MailMailboxIdRoute._addFileChildren(
|
|
|
747
829
|
MailMailboxIdRouteChildren,
|
|
748
830
|
)
|
|
749
831
|
|
|
832
|
+
interface MailBriefThreadIdMessageIdRouteChildren {
|
|
833
|
+
MailBriefThreadIdMessageIdModeChar123OutboxMessageIdChar125Route: typeof MailBriefThreadIdMessageIdModeChar123OutboxMessageIdChar125Route
|
|
834
|
+
}
|
|
835
|
+
|
|
836
|
+
const MailBriefThreadIdMessageIdRouteChildren: MailBriefThreadIdMessageIdRouteChildren =
|
|
837
|
+
{
|
|
838
|
+
MailBriefThreadIdMessageIdModeChar123OutboxMessageIdChar125Route:
|
|
839
|
+
MailBriefThreadIdMessageIdModeChar123OutboxMessageIdChar125Route,
|
|
840
|
+
}
|
|
841
|
+
|
|
842
|
+
const MailBriefThreadIdMessageIdRouteWithChildren =
|
|
843
|
+
MailBriefThreadIdMessageIdRoute._addFileChildren(
|
|
844
|
+
MailBriefThreadIdMessageIdRouteChildren,
|
|
845
|
+
)
|
|
846
|
+
|
|
750
847
|
interface MailBriefThreadIdRouteChildren {
|
|
751
|
-
MailBriefThreadIdMessageIdRoute: typeof
|
|
848
|
+
MailBriefThreadIdMessageIdRoute: typeof MailBriefThreadIdMessageIdRouteWithChildren
|
|
752
849
|
MailBriefThreadIdIndexRoute: typeof MailBriefThreadIdIndexRoute
|
|
753
850
|
}
|
|
754
851
|
|
|
755
852
|
const MailBriefThreadIdRouteChildren: MailBriefThreadIdRouteChildren = {
|
|
756
|
-
MailBriefThreadIdMessageIdRoute:
|
|
853
|
+
MailBriefThreadIdMessageIdRoute: MailBriefThreadIdMessageIdRouteWithChildren,
|
|
757
854
|
MailBriefThreadIdIndexRoute: MailBriefThreadIdIndexRoute,
|
|
758
855
|
}
|
|
759
856
|
|
|
@@ -777,13 +874,29 @@ const MailBriefRouteWithChildren = MailBriefRoute._addFileChildren(
|
|
|
777
874
|
MailBriefRouteChildren,
|
|
778
875
|
)
|
|
779
876
|
|
|
877
|
+
interface MailFlaggedThreadIdMessageIdRouteChildren {
|
|
878
|
+
MailFlaggedThreadIdMessageIdModeChar123OutboxMessageIdChar125Route: typeof MailFlaggedThreadIdMessageIdModeChar123OutboxMessageIdChar125Route
|
|
879
|
+
}
|
|
880
|
+
|
|
881
|
+
const MailFlaggedThreadIdMessageIdRouteChildren: MailFlaggedThreadIdMessageIdRouteChildren =
|
|
882
|
+
{
|
|
883
|
+
MailFlaggedThreadIdMessageIdModeChar123OutboxMessageIdChar125Route:
|
|
884
|
+
MailFlaggedThreadIdMessageIdModeChar123OutboxMessageIdChar125Route,
|
|
885
|
+
}
|
|
886
|
+
|
|
887
|
+
const MailFlaggedThreadIdMessageIdRouteWithChildren =
|
|
888
|
+
MailFlaggedThreadIdMessageIdRoute._addFileChildren(
|
|
889
|
+
MailFlaggedThreadIdMessageIdRouteChildren,
|
|
890
|
+
)
|
|
891
|
+
|
|
780
892
|
interface MailFlaggedThreadIdRouteChildren {
|
|
781
|
-
MailFlaggedThreadIdMessageIdRoute: typeof
|
|
893
|
+
MailFlaggedThreadIdMessageIdRoute: typeof MailFlaggedThreadIdMessageIdRouteWithChildren
|
|
782
894
|
MailFlaggedThreadIdIndexRoute: typeof MailFlaggedThreadIdIndexRoute
|
|
783
895
|
}
|
|
784
896
|
|
|
785
897
|
const MailFlaggedThreadIdRouteChildren: MailFlaggedThreadIdRouteChildren = {
|
|
786
|
-
MailFlaggedThreadIdMessageIdRoute:
|
|
898
|
+
MailFlaggedThreadIdMessageIdRoute:
|
|
899
|
+
MailFlaggedThreadIdMessageIdRouteWithChildren,
|
|
787
900
|
MailFlaggedThreadIdIndexRoute: MailFlaggedThreadIdIndexRoute,
|
|
788
901
|
}
|
|
789
902
|
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// biome-ignore lint/style/useFilenamingConvention: TanStack Router convention
|
|
2
|
+
/**
|
|
3
|
+
* The reply, reply-all or forward under a conversation opened from a folder.
|
|
4
|
+
*
|
|
5
|
+
* The same shape as the brief's: a child of the message so the source is the
|
|
6
|
+
* address, the mode as one param rather than three literal routes, and the
|
|
7
|
+
* draft as an optional segment so recording it does not unmount the composer.
|
|
8
|
+
* The conversation reads it off the address and opens it at its head.
|
|
9
|
+
*/
|
|
10
|
+
import { createFileRoute } from "@tanstack/react-router";
|
|
11
|
+
|
|
12
|
+
export const Route = createFileRoute(
|
|
13
|
+
"/mail/$mailboxId/$threadId/$messageId/$mode/{-$outboxMessageId}",
|
|
14
|
+
)({});
|
|
@@ -6,6 +6,10 @@
|
|
|
6
6
|
* with no thread, so the pane has nothing to fetch by. The segment names which
|
|
7
7
|
* message inside the thread the reader pointed at, and the surface it renders is
|
|
8
8
|
* the thread's.
|
|
9
|
+
*
|
|
10
|
+
* It mounts the pane rather than delegating to an index route, because the
|
|
11
|
+
* reply is a segment under it: a conversation that came back on a child match
|
|
12
|
+
* would collapse and scroll to the top the moment someone pressed Reply.
|
|
9
13
|
*/
|
|
10
14
|
import { createFileRoute } from "@tanstack/react-router";
|
|
11
15
|
import { MailboxPane } from "@/components/mail/MailboxPane";
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// biome-ignore lint/style/useFilenamingConvention: TanStack Router convention
|
|
2
|
+
/**
|
|
3
|
+
* /mail/brief/<thread>/<message>/reply — the answer to that message, written at
|
|
4
|
+
* the head of the conversation it answers, and
|
|
5
|
+
* /mail/brief/<thread>/<message>/reply/<outboxMessageId> once it has a draft.
|
|
6
|
+
*
|
|
7
|
+
* A child of the message, so a reply cannot exist without a source and the
|
|
8
|
+
* conversation stays matched behind it. `reply`, `reply-all` and `forward` are
|
|
9
|
+
* one param rather than three literal routes: they differ in what the composer
|
|
10
|
+
* opens on, not in what the address mounts.
|
|
11
|
+
*
|
|
12
|
+
* The draft is an optional segment of this one route rather than a child of it,
|
|
13
|
+
* because the first autosave adopts the id it just created while the reader is
|
|
14
|
+
* still typing. Two routes would unmount the composer mid-sentence; one route
|
|
15
|
+
* with a param that arrives is a rewritten address and nothing more.
|
|
16
|
+
*
|
|
17
|
+
* The route declares the segments and mounts nothing itself. The composer opens
|
|
18
|
+
* inside the conversation, above the turn it answers, and the conversation is
|
|
19
|
+
* the single pane on a phone — where there is no reading `Outlet` to fill — so
|
|
20
|
+
* the pane reads the reply off the address, the way the shell reads compose.
|
|
21
|
+
*/
|
|
22
|
+
import { createFileRoute } from "@tanstack/react-router";
|
|
23
|
+
|
|
24
|
+
export const Route = createFileRoute(
|
|
25
|
+
"/mail/brief/$threadId/$messageId/$mode/{-$outboxMessageId}",
|
|
26
|
+
)({});
|
|
@@ -6,6 +6,10 @@
|
|
|
6
6
|
* with no thread, so the pane has nothing to fetch by. The segment names which
|
|
7
7
|
* message inside the thread the reader pointed at, and the surface it renders is
|
|
8
8
|
* the thread's.
|
|
9
|
+
*
|
|
10
|
+
* It mounts the pane rather than delegating to an index route, because the
|
|
11
|
+
* reply is a segment under it: a conversation that came back on a child match
|
|
12
|
+
* would collapse and scroll to the top the moment someone pressed Reply.
|
|
9
13
|
*/
|
|
10
14
|
import { createFileRoute } from "@tanstack/react-router";
|
|
11
15
|
import { BriefPane } from "@/components/mail/BriefPane";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// biome-ignore lint/style/useFilenamingConvention: TanStack Router convention
|
|
2
|
+
/**
|
|
3
|
+
* The reply, reply-all or forward under a conversation opened from Starred.
|
|
4
|
+
*
|
|
5
|
+
* The same shape as the brief's: a child of the message so the source is the
|
|
6
|
+
* address, the mode as one param rather than three literal routes, and the
|
|
7
|
+
* draft as an optional segment so recording it does not unmount the composer.
|
|
8
|
+
* The conversation reads it off the address and opens it at its head.
|
|
9
|
+
*/
|
|
10
|
+
import { createFileRoute } from "@tanstack/react-router";
|
|
11
|
+
|
|
12
|
+
export const Route = createFileRoute(
|
|
13
|
+
"/mail/flagged/$threadId/$messageId/$mode/{-$outboxMessageId}",
|
|
14
|
+
)({});
|
|
@@ -6,6 +6,10 @@
|
|
|
6
6
|
* with no thread, so the pane has nothing to fetch by. The segment names which
|
|
7
7
|
* message inside the thread the reader pointed at, and the surface it renders is
|
|
8
8
|
* the thread's.
|
|
9
|
+
*
|
|
10
|
+
* It mounts the pane rather than delegating to an index route, because the
|
|
11
|
+
* reply is a segment under it: a conversation that came back on a child match
|
|
12
|
+
* would collapse and scroll to the top the moment someone pressed Reply.
|
|
9
13
|
*/
|
|
10
14
|
import { createFileRoute } from "@tanstack/react-router";
|
|
11
15
|
import { FlaggedPane } from "@/components/mail/FlaggedPane";
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { useParams, useRouterState } from "@tanstack/react-router";
|
|
2
|
+
import { type MailListRoute, mailListRoute } from "@/lib/mail-route";
|
|
3
|
+
|
|
4
|
+
export interface BrowsedList {
|
|
5
|
+
list: MailListRoute["list"] | undefined;
|
|
6
|
+
mailboxId: string | undefined;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* The list the address is browsing, as the two values a navigation to it needs.
|
|
11
|
+
*
|
|
12
|
+
* Both are primitives, so a caller holding them in a dependency array settles.
|
|
13
|
+
* Every surface a list can open — compose, a reply — reads the same answer, so
|
|
14
|
+
* the four lists cannot disagree about which one is underneath.
|
|
15
|
+
*/
|
|
16
|
+
export function useBrowsedList(): BrowsedList {
|
|
17
|
+
const list = useRouterState({
|
|
18
|
+
select: (state) => mailListRoute(state.matches)?.list,
|
|
19
|
+
});
|
|
20
|
+
const mailbox = useParams({ from: "/mail/$mailboxId", shouldThrow: false });
|
|
21
|
+
return { list, mailboxId: mailbox?.mailboxId };
|
|
22
|
+
}
|
package/src/routing/compose.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { useNavigate, useParams
|
|
1
|
+
import { useNavigate, useParams } from "@tanstack/react-router";
|
|
2
2
|
import { useCallback } from "react";
|
|
3
|
-
import {
|
|
3
|
+
import { useBrowsedList } from "./browsed-list";
|
|
4
4
|
import { useRetainOpenPanels } from "./fragment";
|
|
5
5
|
|
|
6
6
|
/**
|
|
@@ -50,21 +50,6 @@ export function useComposeDraftId(): string | undefined {
|
|
|
50
50
|
return useComposeParams()?.outboxMessageId;
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
-
/**
|
|
54
|
-
* The list the address is browsing, as the two values a navigation to it needs.
|
|
55
|
-
* Both are primitives, so a caller holding them in a dependency array settles.
|
|
56
|
-
*/
|
|
57
|
-
function useBrowsedList(): {
|
|
58
|
-
list: "brief" | "flagged" | "outbox" | "mailbox" | undefined;
|
|
59
|
-
mailboxId: string | undefined;
|
|
60
|
-
} {
|
|
61
|
-
const list = useRouterState({
|
|
62
|
-
select: (state) => mailListRoute(state.matches)?.list,
|
|
63
|
-
});
|
|
64
|
-
const mailbox = useParams({ from: "/mail/$mailboxId", shouldThrow: false });
|
|
65
|
-
return { list, mailboxId: mailbox?.mailboxId };
|
|
66
|
-
}
|
|
67
|
-
|
|
68
53
|
interface ComposeNavigation {
|
|
69
54
|
/** Which list's compose route, and the draft segment under it. */
|
|
70
55
|
to: typeof BRIEF_COMPOSE | typeof FLAGGED_COMPOSE | typeof OUTBOX_COMPOSE;
|
package/src/routing/index.ts
CHANGED
|
@@ -26,3 +26,15 @@ export {
|
|
|
26
26
|
useOpenThreadPath,
|
|
27
27
|
} from "./open-thread";
|
|
28
28
|
export { useOutboxDraftId } from "./outbox-draft";
|
|
29
|
+
export {
|
|
30
|
+
type ReplyAddress,
|
|
31
|
+
type ReplyMode,
|
|
32
|
+
type ReplySurface,
|
|
33
|
+
type ReplyTarget,
|
|
34
|
+
replyModes,
|
|
35
|
+
useAdoptReplyDraft,
|
|
36
|
+
useCloseReply,
|
|
37
|
+
useIsReplying,
|
|
38
|
+
useOpenReply,
|
|
39
|
+
useReplySurface,
|
|
40
|
+
} from "./reply";
|