@remit/web-client 0.0.336 → 0.0.337

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.
@@ -1,8 +1,10 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { AccountMenu as AccountMenuView } from "@remit/ui";
3
- import { useGoToSection } from "../routing/sections";
3
+ import { useOpenSettingsSection } from "../routing/sections";
4
+ import { useSettingsSlots } from "../settings-slots";
4
5
  import { AccountSession } from "./AccountSession";
5
6
  export const AccountMenu = () => {
6
- const goToSection = useGoToSection();
7
- return (_jsx(AccountSession, { children: ({ email, signOut, securityUrl }) => (_jsx(AccountMenuView, { email: email, onOpenSecurity: securityUrl ? () => goToSection("security") : undefined, onSignOut: signOut })) }));
7
+ const openSettingsSection = useOpenSettingsSection();
8
+ const slots = useSettingsSlots();
9
+ return (_jsx(AccountSession, { children: ({ email, signOut }) => (_jsx(AccountMenuView, { email: email, sections: slots.map(({ id, label, icon }) => ({ id, label, icon })), onOpenSection: openSettingsSection, onSignOut: signOut })) }));
8
10
  };
@@ -8,7 +8,6 @@ import { type FC, type ReactNode } from "react";
8
8
  */
9
9
  export interface AuthAccount {
10
10
  email: string | null;
11
- securityUrl?: string;
12
11
  signOut: () => void | Promise<void>;
13
12
  }
14
13
  export interface AuthAccountProps {
@@ -13,6 +13,7 @@ import { Route as MailFlaggedRouteImport } from './routes/mail/flagged';
13
13
  import { Route as MailOutboxRouteImport } from './routes/mail/outbox';
14
14
  import { Route as ResetPasswordTokenRouteImport } from './routes/reset-password/$token';
15
15
  import { Route as SettingsIndexRouteImport } from './routes/settings/index';
16
+ import { Route as SettingsSlotIdRouteImport } from './routes/settings/$slotId';
16
17
  import { Route as SettingsAccountsRouteImport } from './routes/settings/accounts';
17
18
  import { Route as SettingsAdvancedRouteImport } from './routes/settings/advanced';
18
19
  import { Route as SettingsAppearanceRouteImport } from './routes/settings/appearance';
@@ -21,7 +22,6 @@ import { Route as SettingsFiltersRouteImport } from './routes/settings/filters';
21
22
  import { Route as SettingsFoldersRouteImport } from './routes/settings/folders';
22
23
  import { Route as SettingsLabelsRouteImport } from './routes/settings/labels';
23
24
  import { Route as SettingsPeopleRouteImport } from './routes/settings/people';
24
- import { Route as SettingsSecurityRouteImport } from './routes/settings/security';
25
25
  import { Route as SettingsSendersRouteImport } from './routes/settings/senders';
26
26
  import { Route as SettingsSuggestedVipsRouteImport } from './routes/settings/suggested-vips';
27
27
  import { Route as SettingsWarningsRouteImport } from './routes/settings/warnings';
@@ -171,6 +171,7 @@ declare const MailOutboxRoute: import("@tanstack/router-core").Route<Register, i
171
171
  }, import("zod/v4/core").$strip>, import("@tanstack/router-core").ResolveParams<"/outbox">, import("@tanstack/router-core").AnyContext, import("@tanstack/router-core").AnyContext, import("@tanstack/router-core").AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>;
172
172
  declare const ResetPasswordTokenRoute: import("@tanstack/router-core").Route<Register, import("@tanstack/react-router").RootRoute<Register, undefined, import("./router").RouterContext, import("@tanstack/router-core").AnyContext, import("@tanstack/router-core").AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>, "/reset-password/$token", "/reset-password/$token", "/reset-password/$token", "/reset-password/$token", undefined, import("@tanstack/router-core").ResolveParams<"/reset-password/$token">, import("@tanstack/router-core").AnyContext, import("@tanstack/router-core").AnyContext, () => never, {}, undefined, unknown, unknown, unknown, unknown, undefined>;
173
173
  declare const SettingsIndexRoute: import("@tanstack/router-core").Route<Register, import("@tanstack/router-core").Route<Register, import("@tanstack/react-router").RootRoute<Register, undefined, import("./router").RouterContext, import("@tanstack/router-core").AnyContext, import("@tanstack/router-core").AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>, "/settings", "/settings", "/settings", "/settings", undefined, import("@tanstack/router-core").ResolveParams<"/settings">, import("@tanstack/router-core").AnyContext, import("@tanstack/router-core").AnyContext, import("@tanstack/router-core").AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>, "/", "/settings/", "/settings/", "/settings/", undefined, import("@tanstack/router-core").ResolveParams<"/">, import("@tanstack/router-core").AnyContext, import("@tanstack/router-core").AnyContext, import("@tanstack/router-core").AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>;
174
+ declare const SettingsSlotIdRoute: import("@tanstack/router-core").Route<Register, import("@tanstack/router-core").Route<Register, import("@tanstack/react-router").RootRoute<Register, undefined, import("./router").RouterContext, import("@tanstack/router-core").AnyContext, import("@tanstack/router-core").AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>, "/settings", "/settings", "/settings", "/settings", undefined, import("@tanstack/router-core").ResolveParams<"/settings">, import("@tanstack/router-core").AnyContext, import("@tanstack/router-core").AnyContext, import("@tanstack/router-core").AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>, "/$slotId", "/settings/$slotId", "/settings/$slotId", "/settings/$slotId", undefined, import("@tanstack/router-core").ResolveParams<"/$slotId">, import("@tanstack/router-core").AnyContext, import("@tanstack/router-core").AnyContext, import("@tanstack/router-core").AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>;
174
175
  declare const SettingsAccountsRoute: import("@tanstack/router-core").Route<Register, import("@tanstack/router-core").Route<Register, import("@tanstack/react-router").RootRoute<Register, undefined, import("./router").RouterContext, import("@tanstack/router-core").AnyContext, import("@tanstack/router-core").AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>, "/settings", "/settings", "/settings", "/settings", undefined, import("@tanstack/router-core").ResolveParams<"/settings">, import("@tanstack/router-core").AnyContext, import("@tanstack/router-core").AnyContext, import("@tanstack/router-core").AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>, "/accounts", "/settings/accounts", "/settings/accounts", "/settings/accounts", import("zod").ZodObject<{
175
176
  editAccountId: import("zod").ZodOptional<import("zod").ZodString>;
176
177
  focusSmtp: import("zod").ZodOptional<import("zod").ZodBoolean>;
@@ -186,7 +187,6 @@ declare const SettingsFiltersRoute: import("@tanstack/router-core").Route<Regist
186
187
  declare const SettingsFoldersRoute: import("@tanstack/router-core").Route<Register, import("@tanstack/router-core").Route<Register, import("@tanstack/react-router").RootRoute<Register, undefined, import("./router").RouterContext, import("@tanstack/router-core").AnyContext, import("@tanstack/router-core").AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>, "/settings", "/settings", "/settings", "/settings", undefined, import("@tanstack/router-core").ResolveParams<"/settings">, import("@tanstack/router-core").AnyContext, import("@tanstack/router-core").AnyContext, import("@tanstack/router-core").AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>, "/folders", "/settings/folders", "/settings/folders", "/settings/folders", undefined, import("@tanstack/router-core").ResolveParams<"/folders">, import("@tanstack/router-core").AnyContext, import("@tanstack/router-core").AnyContext, import("@tanstack/router-core").AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>;
187
188
  declare const SettingsLabelsRoute: import("@tanstack/router-core").Route<Register, import("@tanstack/router-core").Route<Register, import("@tanstack/react-router").RootRoute<Register, undefined, import("./router").RouterContext, import("@tanstack/router-core").AnyContext, import("@tanstack/router-core").AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>, "/settings", "/settings", "/settings", "/settings", undefined, import("@tanstack/router-core").ResolveParams<"/settings">, import("@tanstack/router-core").AnyContext, import("@tanstack/router-core").AnyContext, import("@tanstack/router-core").AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>, "/labels", "/settings/labels", "/settings/labels", "/settings/labels", undefined, import("@tanstack/router-core").ResolveParams<"/labels">, import("@tanstack/router-core").AnyContext, import("@tanstack/router-core").AnyContext, import("@tanstack/router-core").AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>;
188
189
  declare const SettingsPeopleRoute: import("@tanstack/router-core").Route<Register, import("@tanstack/router-core").Route<Register, import("@tanstack/react-router").RootRoute<Register, undefined, import("./router").RouterContext, import("@tanstack/router-core").AnyContext, import("@tanstack/router-core").AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>, "/settings", "/settings", "/settings", "/settings", undefined, import("@tanstack/router-core").ResolveParams<"/settings">, import("@tanstack/router-core").AnyContext, import("@tanstack/router-core").AnyContext, import("@tanstack/router-core").AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>, "/people", "/settings/people", "/settings/people", "/settings/people", undefined, import("@tanstack/router-core").ResolveParams<"/people">, import("@tanstack/router-core").AnyContext, import("@tanstack/router-core").AnyContext, import("@tanstack/router-core").AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>;
189
- declare const SettingsSecurityRoute: import("@tanstack/router-core").Route<Register, import("@tanstack/router-core").Route<Register, import("@tanstack/react-router").RootRoute<Register, undefined, import("./router").RouterContext, import("@tanstack/router-core").AnyContext, import("@tanstack/router-core").AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>, "/settings", "/settings", "/settings", "/settings", undefined, import("@tanstack/router-core").ResolveParams<"/settings">, import("@tanstack/router-core").AnyContext, import("@tanstack/router-core").AnyContext, import("@tanstack/router-core").AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>, "/security", "/settings/security", "/settings/security", "/settings/security", undefined, import("@tanstack/router-core").ResolveParams<"/security">, import("@tanstack/router-core").AnyContext, import("@tanstack/router-core").AnyContext, import("@tanstack/router-core").AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>;
190
190
  declare const SettingsSendersRoute: import("@tanstack/router-core").Route<Register, import("@tanstack/router-core").Route<Register, import("@tanstack/react-router").RootRoute<Register, undefined, import("./router").RouterContext, import("@tanstack/router-core").AnyContext, import("@tanstack/router-core").AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>, "/settings", "/settings", "/settings", "/settings", undefined, import("@tanstack/router-core").ResolveParams<"/settings">, import("@tanstack/router-core").AnyContext, import("@tanstack/router-core").AnyContext, import("@tanstack/router-core").AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>, "/senders", "/settings/senders", "/settings/senders", "/settings/senders", undefined, import("@tanstack/router-core").ResolveParams<"/senders">, import("@tanstack/router-core").AnyContext, import("@tanstack/router-core").AnyContext, import("@tanstack/router-core").AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>;
191
191
  declare const SettingsSuggestedVipsRoute: import("@tanstack/router-core").Route<Register, import("@tanstack/router-core").Route<Register, import("@tanstack/react-router").RootRoute<Register, undefined, import("./router").RouterContext, import("@tanstack/router-core").AnyContext, import("@tanstack/router-core").AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>, "/settings", "/settings", "/settings", "/settings", undefined, import("@tanstack/router-core").ResolveParams<"/settings">, import("@tanstack/router-core").AnyContext, import("@tanstack/router-core").AnyContext, import("@tanstack/router-core").AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>, "/suggested-vips", "/settings/suggested-vips", "/settings/suggested-vips", "/settings/suggested-vips", undefined, import("@tanstack/router-core").ResolveParams<"/suggested-vips">, import("@tanstack/router-core").AnyContext, import("@tanstack/router-core").AnyContext, import("@tanstack/router-core").AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>;
192
192
  declare const SettingsWarningsRoute: import("@tanstack/router-core").Route<Register, import("@tanstack/router-core").Route<Register, import("@tanstack/react-router").RootRoute<Register, undefined, import("./router").RouterContext, import("@tanstack/router-core").AnyContext, import("@tanstack/router-core").AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>, "/settings", "/settings", "/settings", "/settings", undefined, import("@tanstack/router-core").ResolveParams<"/settings">, import("@tanstack/router-core").AnyContext, import("@tanstack/router-core").AnyContext, import("@tanstack/router-core").AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>, "/warnings", "/settings/warnings", "/settings/warnings", "/settings/warnings", undefined, import("@tanstack/router-core").ResolveParams<"/warnings">, import("@tanstack/router-core").AnyContext, import("@tanstack/router-core").AnyContext, import("@tanstack/router-core").AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>;
@@ -585,6 +585,7 @@ export interface FileRoutesByFullPath {
585
585
  '/mail/flagged': typeof MailFlaggedRouteWithChildren;
586
586
  '/mail/outbox': typeof MailOutboxRouteWithChildren;
587
587
  '/reset-password/$token': typeof ResetPasswordTokenRoute;
588
+ '/settings/$slotId': typeof SettingsSlotIdRoute;
588
589
  '/settings/accounts': typeof SettingsAccountsRoute;
589
590
  '/settings/advanced': typeof SettingsAdvancedRoute;
590
591
  '/settings/appearance': typeof SettingsAppearanceRoute;
@@ -593,7 +594,6 @@ export interface FileRoutesByFullPath {
593
594
  '/settings/folders': typeof SettingsFoldersRoute;
594
595
  '/settings/labels': typeof SettingsLabelsRoute;
595
596
  '/settings/people': typeof SettingsPeopleRoute;
596
- '/settings/security': typeof SettingsSecurityRoute;
597
597
  '/settings/senders': typeof SettingsSendersRoute;
598
598
  '/settings/suggested-vips': typeof SettingsSuggestedVipsRoute;
599
599
  '/settings/warnings': typeof SettingsWarningsRoute;
@@ -638,6 +638,7 @@ export interface FileRoutesByTo {
638
638
  '/import': typeof ImportRoute;
639
639
  '/onboarding': typeof OnboardingRoute;
640
640
  '/reset-password/$token': typeof ResetPasswordTokenRoute;
641
+ '/settings/$slotId': typeof SettingsSlotIdRoute;
641
642
  '/settings/accounts': typeof SettingsAccountsRoute;
642
643
  '/settings/advanced': typeof SettingsAdvancedRoute;
643
644
  '/settings/appearance': typeof SettingsAppearanceRoute;
@@ -646,7 +647,6 @@ export interface FileRoutesByTo {
646
647
  '/settings/folders': typeof SettingsFoldersRoute;
647
648
  '/settings/labels': typeof SettingsLabelsRoute;
648
649
  '/settings/people': typeof SettingsPeopleRoute;
649
- '/settings/security': typeof SettingsSecurityRoute;
650
650
  '/settings/senders': typeof SettingsSendersRoute;
651
651
  '/settings/suggested-vips': typeof SettingsSuggestedVipsRoute;
652
652
  '/settings/warnings': typeof SettingsWarningsRoute;
@@ -693,6 +693,7 @@ export interface FileRoutesById {
693
693
  '/mail/flagged': typeof MailFlaggedRouteWithChildren;
694
694
  '/mail/outbox': typeof MailOutboxRouteWithChildren;
695
695
  '/reset-password/$token': typeof ResetPasswordTokenRoute;
696
+ '/settings/$slotId': typeof SettingsSlotIdRoute;
696
697
  '/settings/accounts': typeof SettingsAccountsRoute;
697
698
  '/settings/advanced': typeof SettingsAdvancedRoute;
698
699
  '/settings/appearance': typeof SettingsAppearanceRoute;
@@ -701,7 +702,6 @@ export interface FileRoutesById {
701
702
  '/settings/folders': typeof SettingsFoldersRoute;
702
703
  '/settings/labels': typeof SettingsLabelsRoute;
703
704
  '/settings/people': typeof SettingsPeopleRoute;
704
- '/settings/security': typeof SettingsSecurityRoute;
705
705
  '/settings/senders': typeof SettingsSendersRoute;
706
706
  '/settings/suggested-vips': typeof SettingsSuggestedVipsRoute;
707
707
  '/settings/warnings': typeof SettingsWarningsRoute;
@@ -743,10 +743,10 @@ export interface FileRoutesById {
743
743
  }
744
744
  export interface FileRouteTypes {
745
745
  fileRoutesByFullPath: FileRoutesByFullPath;
746
- fullPaths: '/' | '/calendar' | '/import' | '/mail' | '/onboarding' | '/settings' | '/mail/$mailboxId' | '/mail/brief' | '/mail/flagged' | '/mail/outbox' | '/reset-password/$token' | '/settings/accounts' | '/settings/advanced' | '/settings/appearance' | '/settings/calendars' | '/settings/filters' | '/settings/folders' | '/settings/labels' | '/settings/people' | '/settings/security' | '/settings/senders' | '/settings/suggested-vips' | '/settings/warnings' | '/calendar/' | '/mail/' | '/settings/' | '/calendar/$view/$date' | '/mail/$mailboxId/$threadId' | '/mail/brief/$threadId' | '/mail/flagged/$threadId' | '/mail/$mailboxId/' | '/mail/brief/' | '/mail/flagged/' | '/mail/outbox/' | '/calendar/$view/$date/$calendarObjectId' | '/calendar/$view/$date/new' | '/mail/$mailboxId/$threadId/$messageId' | '/mail/$mailboxId/compose/{-$outboxMessageId}' | '/mail/brief/$threadId/$messageId' | '/mail/brief/compose/{-$outboxMessageId}' | '/mail/flagged/$threadId/$messageId' | '/mail/flagged/compose/{-$outboxMessageId}' | '/mail/outbox/compose/{-$outboxMessageId}' | '/mail/outbox/draft/$outboxMessageId' | '/calendar/$view/$date/' | '/mail/$mailboxId/$threadId/' | '/mail/brief/$threadId/' | '/mail/flagged/$threadId/' | '/calendar/$view/$date/$calendarObjectId/$recurrenceId' | '/calendar/$view/$date/$calendarObjectId/edit' | '/calendar/$view/$date/suggestion/$suggestionId' | '/calendar/$view/$date/task/$calendarTaskId' | '/calendar/$view/$date/$calendarObjectId/' | '/calendar/$view/$date/$calendarObjectId/$recurrenceId/edit' | '/mail/$mailboxId/$threadId/$messageId/$mode/{-$outboxMessageId}' | '/mail/brief/$threadId/$messageId/$mode/{-$outboxMessageId}' | '/mail/flagged/$threadId/$messageId/$mode/{-$outboxMessageId}' | '/calendar/$view/$date/$calendarObjectId/$recurrenceId/';
746
+ fullPaths: '/' | '/calendar' | '/import' | '/mail' | '/onboarding' | '/settings' | '/mail/$mailboxId' | '/mail/brief' | '/mail/flagged' | '/mail/outbox' | '/reset-password/$token' | '/settings/$slotId' | '/settings/accounts' | '/settings/advanced' | '/settings/appearance' | '/settings/calendars' | '/settings/filters' | '/settings/folders' | '/settings/labels' | '/settings/people' | '/settings/senders' | '/settings/suggested-vips' | '/settings/warnings' | '/calendar/' | '/mail/' | '/settings/' | '/calendar/$view/$date' | '/mail/$mailboxId/$threadId' | '/mail/brief/$threadId' | '/mail/flagged/$threadId' | '/mail/$mailboxId/' | '/mail/brief/' | '/mail/flagged/' | '/mail/outbox/' | '/calendar/$view/$date/$calendarObjectId' | '/calendar/$view/$date/new' | '/mail/$mailboxId/$threadId/$messageId' | '/mail/$mailboxId/compose/{-$outboxMessageId}' | '/mail/brief/$threadId/$messageId' | '/mail/brief/compose/{-$outboxMessageId}' | '/mail/flagged/$threadId/$messageId' | '/mail/flagged/compose/{-$outboxMessageId}' | '/mail/outbox/compose/{-$outboxMessageId}' | '/mail/outbox/draft/$outboxMessageId' | '/calendar/$view/$date/' | '/mail/$mailboxId/$threadId/' | '/mail/brief/$threadId/' | '/mail/flagged/$threadId/' | '/calendar/$view/$date/$calendarObjectId/$recurrenceId' | '/calendar/$view/$date/$calendarObjectId/edit' | '/calendar/$view/$date/suggestion/$suggestionId' | '/calendar/$view/$date/task/$calendarTaskId' | '/calendar/$view/$date/$calendarObjectId/' | '/calendar/$view/$date/$calendarObjectId/$recurrenceId/edit' | '/mail/$mailboxId/$threadId/$messageId/$mode/{-$outboxMessageId}' | '/mail/brief/$threadId/$messageId/$mode/{-$outboxMessageId}' | '/mail/flagged/$threadId/$messageId/$mode/{-$outboxMessageId}' | '/calendar/$view/$date/$calendarObjectId/$recurrenceId/';
747
747
  fileRoutesByTo: FileRoutesByTo;
748
- to: '/' | '/import' | '/onboarding' | '/reset-password/$token' | '/settings/accounts' | '/settings/advanced' | '/settings/appearance' | '/settings/calendars' | '/settings/filters' | '/settings/folders' | '/settings/labels' | '/settings/people' | '/settings/security' | '/settings/senders' | '/settings/suggested-vips' | '/settings/warnings' | '/calendar' | '/mail' | '/settings' | '/mail/$mailboxId' | '/mail/brief' | '/mail/flagged' | '/mail/outbox' | '/calendar/$view/$date/new' | '/mail/$mailboxId/$threadId/$messageId' | '/mail/$mailboxId/compose/{-$outboxMessageId}' | '/mail/brief/$threadId/$messageId' | '/mail/brief/compose/{-$outboxMessageId}' | '/mail/flagged/$threadId/$messageId' | '/mail/flagged/compose/{-$outboxMessageId}' | '/mail/outbox/compose/{-$outboxMessageId}' | '/mail/outbox/draft/$outboxMessageId' | '/calendar/$view/$date' | '/mail/$mailboxId/$threadId' | '/mail/brief/$threadId' | '/mail/flagged/$threadId' | '/calendar/$view/$date/$calendarObjectId/edit' | '/calendar/$view/$date/suggestion/$suggestionId' | '/calendar/$view/$date/task/$calendarTaskId' | '/calendar/$view/$date/$calendarObjectId' | '/calendar/$view/$date/$calendarObjectId/$recurrenceId/edit' | '/mail/$mailboxId/$threadId/$messageId/$mode/{-$outboxMessageId}' | '/mail/brief/$threadId/$messageId/$mode/{-$outboxMessageId}' | '/mail/flagged/$threadId/$messageId/$mode/{-$outboxMessageId}' | '/calendar/$view/$date/$calendarObjectId/$recurrenceId';
749
- id: '__root__' | '/' | '/calendar' | '/import' | '/mail' | '/onboarding' | '/settings' | '/mail/$mailboxId' | '/mail/brief' | '/mail/flagged' | '/mail/outbox' | '/reset-password/$token' | '/settings/accounts' | '/settings/advanced' | '/settings/appearance' | '/settings/calendars' | '/settings/filters' | '/settings/folders' | '/settings/labels' | '/settings/people' | '/settings/security' | '/settings/senders' | '/settings/suggested-vips' | '/settings/warnings' | '/calendar/' | '/mail/' | '/settings/' | '/calendar/$view/$date' | '/mail/$mailboxId/$threadId' | '/mail/brief/$threadId' | '/mail/flagged/$threadId' | '/mail/$mailboxId/' | '/mail/brief/' | '/mail/flagged/' | '/mail/outbox/' | '/calendar/$view/$date/$calendarObjectId' | '/calendar/$view/$date/new' | '/mail/$mailboxId/$threadId/$messageId' | '/mail/$mailboxId/compose/{-$outboxMessageId}' | '/mail/brief/$threadId/$messageId' | '/mail/brief/compose/{-$outboxMessageId}' | '/mail/flagged/$threadId/$messageId' | '/mail/flagged/compose/{-$outboxMessageId}' | '/mail/outbox/compose/{-$outboxMessageId}' | '/mail/outbox/draft/$outboxMessageId' | '/calendar/$view/$date/' | '/mail/$mailboxId/$threadId/' | '/mail/brief/$threadId/' | '/mail/flagged/$threadId/' | '/calendar/$view/$date/$calendarObjectId/$recurrenceId' | '/calendar/$view/$date/$calendarObjectId/edit' | '/calendar/$view/$date/suggestion/$suggestionId' | '/calendar/$view/$date/task/$calendarTaskId' | '/calendar/$view/$date/$calendarObjectId/' | '/calendar/$view/$date/$calendarObjectId/$recurrenceId/edit' | '/mail/$mailboxId/$threadId/$messageId/$mode/{-$outboxMessageId}' | '/mail/brief/$threadId/$messageId/$mode/{-$outboxMessageId}' | '/mail/flagged/$threadId/$messageId/$mode/{-$outboxMessageId}' | '/calendar/$view/$date/$calendarObjectId/$recurrenceId/';
748
+ to: '/' | '/import' | '/onboarding' | '/reset-password/$token' | '/settings/$slotId' | '/settings/accounts' | '/settings/advanced' | '/settings/appearance' | '/settings/calendars' | '/settings/filters' | '/settings/folders' | '/settings/labels' | '/settings/people' | '/settings/senders' | '/settings/suggested-vips' | '/settings/warnings' | '/calendar' | '/mail' | '/settings' | '/mail/$mailboxId' | '/mail/brief' | '/mail/flagged' | '/mail/outbox' | '/calendar/$view/$date/new' | '/mail/$mailboxId/$threadId/$messageId' | '/mail/$mailboxId/compose/{-$outboxMessageId}' | '/mail/brief/$threadId/$messageId' | '/mail/brief/compose/{-$outboxMessageId}' | '/mail/flagged/$threadId/$messageId' | '/mail/flagged/compose/{-$outboxMessageId}' | '/mail/outbox/compose/{-$outboxMessageId}' | '/mail/outbox/draft/$outboxMessageId' | '/calendar/$view/$date' | '/mail/$mailboxId/$threadId' | '/mail/brief/$threadId' | '/mail/flagged/$threadId' | '/calendar/$view/$date/$calendarObjectId/edit' | '/calendar/$view/$date/suggestion/$suggestionId' | '/calendar/$view/$date/task/$calendarTaskId' | '/calendar/$view/$date/$calendarObjectId' | '/calendar/$view/$date/$calendarObjectId/$recurrenceId/edit' | '/mail/$mailboxId/$threadId/$messageId/$mode/{-$outboxMessageId}' | '/mail/brief/$threadId/$messageId/$mode/{-$outboxMessageId}' | '/mail/flagged/$threadId/$messageId/$mode/{-$outboxMessageId}' | '/calendar/$view/$date/$calendarObjectId/$recurrenceId';
749
+ id: '__root__' | '/' | '/calendar' | '/import' | '/mail' | '/onboarding' | '/settings' | '/mail/$mailboxId' | '/mail/brief' | '/mail/flagged' | '/mail/outbox' | '/reset-password/$token' | '/settings/$slotId' | '/settings/accounts' | '/settings/advanced' | '/settings/appearance' | '/settings/calendars' | '/settings/filters' | '/settings/folders' | '/settings/labels' | '/settings/people' | '/settings/senders' | '/settings/suggested-vips' | '/settings/warnings' | '/calendar/' | '/mail/' | '/settings/' | '/calendar/$view/$date' | '/mail/$mailboxId/$threadId' | '/mail/brief/$threadId' | '/mail/flagged/$threadId' | '/mail/$mailboxId/' | '/mail/brief/' | '/mail/flagged/' | '/mail/outbox/' | '/calendar/$view/$date/$calendarObjectId' | '/calendar/$view/$date/new' | '/mail/$mailboxId/$threadId/$messageId' | '/mail/$mailboxId/compose/{-$outboxMessageId}' | '/mail/brief/$threadId/$messageId' | '/mail/brief/compose/{-$outboxMessageId}' | '/mail/flagged/$threadId/$messageId' | '/mail/flagged/compose/{-$outboxMessageId}' | '/mail/outbox/compose/{-$outboxMessageId}' | '/mail/outbox/draft/$outboxMessageId' | '/calendar/$view/$date/' | '/mail/$mailboxId/$threadId/' | '/mail/brief/$threadId/' | '/mail/flagged/$threadId/' | '/calendar/$view/$date/$calendarObjectId/$recurrenceId' | '/calendar/$view/$date/$calendarObjectId/edit' | '/calendar/$view/$date/suggestion/$suggestionId' | '/calendar/$view/$date/task/$calendarTaskId' | '/calendar/$view/$date/$calendarObjectId/' | '/calendar/$view/$date/$calendarObjectId/$recurrenceId/edit' | '/mail/$mailboxId/$threadId/$messageId/$mode/{-$outboxMessageId}' | '/mail/brief/$threadId/$messageId/$mode/{-$outboxMessageId}' | '/mail/flagged/$threadId/$messageId/$mode/{-$outboxMessageId}' | '/calendar/$view/$date/$calendarObjectId/$recurrenceId/';
750
750
  fileRoutesById: FileRoutesById;
751
751
  }
752
752
  export interface RootRouteChildren {
@@ -858,6 +858,13 @@ declare module '@tanstack/react-router' {
858
858
  preLoaderRoute: typeof SettingsIndexRouteImport;
859
859
  parentRoute: typeof SettingsRoute;
860
860
  };
861
+ '/settings/$slotId': {
862
+ id: '/settings/$slotId';
863
+ path: '/$slotId';
864
+ fullPath: '/settings/$slotId';
865
+ preLoaderRoute: typeof SettingsSlotIdRouteImport;
866
+ parentRoute: typeof SettingsRoute;
867
+ };
861
868
  '/settings/accounts': {
862
869
  id: '/settings/accounts';
863
870
  path: '/accounts';
@@ -914,13 +921,6 @@ declare module '@tanstack/react-router' {
914
921
  preLoaderRoute: typeof SettingsPeopleRouteImport;
915
922
  parentRoute: typeof SettingsRoute;
916
923
  };
917
- '/settings/security': {
918
- id: '/settings/security';
919
- path: '/security';
920
- fullPath: '/settings/security';
921
- preLoaderRoute: typeof SettingsSecurityRouteImport;
922
- parentRoute: typeof SettingsRoute;
923
- };
924
924
  '/settings/senders': {
925
925
  id: '/settings/senders';
926
926
  path: '/senders';
@@ -1431,6 +1431,7 @@ declare const MailRouteWithChildren: import("@tanstack/router-core").Route<impor
1431
1431
  wizardFrom: import("zod").ZodCatch<import("zod").ZodOptional<import("zod").ZodLiteral<"search">>>;
1432
1432
  }, import("zod/v4/core").$strip>, import("@tanstack/router-core").ResolveParams<"/mail">, import("@tanstack/router-core").AnyContext, import("@tanstack/router-core").AnyContext, import("@tanstack/router-core").AnyContext, {}, ({ context: { queryClient } }: import("@tanstack/router-core").LoaderFnContext<import("@tanstack/react-router").Register, import("@tanstack/react-router").RootRoute<import("@tanstack/react-router").Register, undefined, import("./router").RouterContext, import("@tanstack/router-core").AnyContext, import("@tanstack/router-core").AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>, "/mail", import("@tanstack/router-core").ResolveParams<"/mail">, {}, import("@tanstack/router-core").AnyContext, import("@tanstack/router-core").AnyContext, import("@tanstack/router-core").AnyContext, unknown, undefined>) => void, MailRouteChildren, unknown, unknown, unknown, undefined>;
1433
1433
  interface SettingsRouteChildren {
1434
+ SettingsSlotIdRoute: typeof SettingsSlotIdRoute;
1434
1435
  SettingsAccountsRoute: typeof SettingsAccountsRoute;
1435
1436
  SettingsAdvancedRoute: typeof SettingsAdvancedRoute;
1436
1437
  SettingsAppearanceRoute: typeof SettingsAppearanceRoute;
@@ -1439,7 +1440,6 @@ interface SettingsRouteChildren {
1439
1440
  SettingsFoldersRoute: typeof SettingsFoldersRoute;
1440
1441
  SettingsLabelsRoute: typeof SettingsLabelsRoute;
1441
1442
  SettingsPeopleRoute: typeof SettingsPeopleRoute;
1442
- SettingsSecurityRoute: typeof SettingsSecurityRoute;
1443
1443
  SettingsSendersRoute: typeof SettingsSendersRoute;
1444
1444
  SettingsSuggestedVipsRoute: typeof SettingsSuggestedVipsRoute;
1445
1445
  SettingsWarningsRoute: typeof SettingsWarningsRoute;
@@ -19,6 +19,7 @@ import { Route as MailFlaggedRouteImport } from './routes/mail/flagged';
19
19
  import { Route as MailOutboxRouteImport } from './routes/mail/outbox';
20
20
  import { Route as ResetPasswordTokenRouteImport } from './routes/reset-password/$token';
21
21
  import { Route as SettingsIndexRouteImport } from './routes/settings/index';
22
+ import { Route as SettingsSlotIdRouteImport } from './routes/settings/$slotId';
22
23
  import { Route as SettingsAccountsRouteImport } from './routes/settings/accounts';
23
24
  import { Route as SettingsAdvancedRouteImport } from './routes/settings/advanced';
24
25
  import { Route as SettingsAppearanceRouteImport } from './routes/settings/appearance';
@@ -27,7 +28,6 @@ import { Route as SettingsFiltersRouteImport } from './routes/settings/filters';
27
28
  import { Route as SettingsFoldersRouteImport } from './routes/settings/folders';
28
29
  import { Route as SettingsLabelsRouteImport } from './routes/settings/labels';
29
30
  import { Route as SettingsPeopleRouteImport } from './routes/settings/people';
30
- import { Route as SettingsSecurityRouteImport } from './routes/settings/security';
31
31
  import { Route as SettingsSendersRouteImport } from './routes/settings/senders';
32
32
  import { Route as SettingsSuggestedVipsRouteImport } from './routes/settings/suggested-vips';
33
33
  import { Route as SettingsWarningsRouteImport } from './routes/settings/warnings';
@@ -133,6 +133,11 @@ const SettingsIndexRoute = SettingsIndexRouteImport.update({
133
133
  path: '/',
134
134
  getParentRoute: () => SettingsRoute,
135
135
  });
136
+ const SettingsSlotIdRoute = SettingsSlotIdRouteImport.update({
137
+ id: '/$slotId',
138
+ path: '/$slotId',
139
+ getParentRoute: () => SettingsRoute,
140
+ });
136
141
  const SettingsAccountsRoute = SettingsAccountsRouteImport.update({
137
142
  id: '/accounts',
138
143
  path: '/accounts',
@@ -173,11 +178,6 @@ const SettingsPeopleRoute = SettingsPeopleRouteImport.update({
173
178
  path: '/people',
174
179
  getParentRoute: () => SettingsRoute,
175
180
  });
176
- const SettingsSecurityRoute = SettingsSecurityRouteImport.update({
177
- id: '/security',
178
- path: '/security',
179
- getParentRoute: () => SettingsRoute,
180
- });
181
181
  const SettingsSendersRoute = SettingsSendersRouteImport.update({
182
182
  id: '/senders',
183
183
  path: '/senders',
@@ -437,6 +437,7 @@ const MailRouteChildren = {
437
437
  };
438
438
  const MailRouteWithChildren = MailRoute._addFileChildren(MailRouteChildren);
439
439
  const SettingsRouteChildren = {
440
+ SettingsSlotIdRoute: SettingsSlotIdRoute,
440
441
  SettingsAccountsRoute: SettingsAccountsRoute,
441
442
  SettingsAdvancedRoute: SettingsAdvancedRoute,
442
443
  SettingsAppearanceRoute: SettingsAppearanceRoute,
@@ -445,7 +446,6 @@ const SettingsRouteChildren = {
445
446
  SettingsFoldersRoute: SettingsFoldersRoute,
446
447
  SettingsLabelsRoute: SettingsLabelsRoute,
447
448
  SettingsPeopleRoute: SettingsPeopleRoute,
448
- SettingsSecurityRoute: SettingsSecurityRoute,
449
449
  SettingsSendersRoute: SettingsSendersRoute,
450
450
  SettingsSuggestedVipsRoute: SettingsSuggestedVipsRoute,
451
451
  SettingsWarningsRoute: SettingsWarningsRoute,
@@ -1 +1 @@
1
- export declare const Route: import("@tanstack/router-core").Route<import("@tanstack/react-router").Register, import("@tanstack/router-core").Route<import("@tanstack/react-router").Register, import("@tanstack/react-router").RootRoute<import("@tanstack/react-router").Register, undefined, import("../../router").RouterContext, import("@tanstack/router-core").AnyContext, import("@tanstack/router-core").AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>, "/settings", "/settings", "/settings", "/settings", undefined, import("@tanstack/router-core").ResolveParams<"/settings">, import("@tanstack/router-core").AnyContext, import("@tanstack/router-core").AnyContext, import("@tanstack/router-core").AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>, "/security", "/settings/security", "/settings/security", "/settings/security", undefined, import("@tanstack/router-core").ResolveParams<"/security">, import("@tanstack/router-core").AnyContext, import("@tanstack/router-core").AnyContext, import("@tanstack/router-core").AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>;
1
+ export declare const Route: import("@tanstack/router-core").Route<import("@tanstack/react-router").Register, import("@tanstack/router-core").Route<import("@tanstack/react-router").Register, import("@tanstack/react-router").RootRoute<import("@tanstack/react-router").Register, undefined, import("../../router").RouterContext, import("@tanstack/router-core").AnyContext, import("@tanstack/router-core").AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>, "/settings", "/settings", "/settings", "/settings", undefined, import("@tanstack/router-core").ResolveParams<"/settings">, import("@tanstack/router-core").AnyContext, import("@tanstack/router-core").AnyContext, import("@tanstack/router-core").AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>, "/$slotId", "/settings/$slotId", "/settings/$slotId", "/settings/$slotId", undefined, import("@tanstack/router-core").ResolveParams<"/$slotId">, import("@tanstack/router-core").AnyContext, import("@tanstack/router-core").AnyContext, import("@tanstack/router-core").AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>;
@@ -0,0 +1,20 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { SettingsShell } from "@remit/ui";
3
+ import { createFileRoute, useNavigate } from "@tanstack/react-router";
4
+ import { useState } from "react";
5
+ import { NavLink } from "../../routing/nav-link";
6
+ import { useOpenSettingsSection } from "../../routing/sections";
7
+ import { useSettingsSlots } from "../../settings-slots";
8
+ import { useSettingsNavItems } from "../settings";
9
+ export const Route = createFileRoute("/settings/$slotId")({
10
+ component: SlotSettings,
11
+ });
12
+ function SlotSettings() {
13
+ const { slotId } = Route.useParams();
14
+ const slot = useSettingsSlots().find(({ id }) => id === slotId);
15
+ const navigate = useNavigate();
16
+ const navItems = useSettingsNavItems();
17
+ const openSettingsSection = useOpenSettingsSection();
18
+ const [helpOpen, setHelpOpen] = useState(true);
19
+ return (_jsx(SettingsShell, { items: navItems, activeId: slotId, title: slot ? slot.label : "Section not found", help: slot?.help, helpOpen: helpOpen, onToggleHelp: () => setHelpOpen((v) => !v), onSelect: openSettingsSection, onBackToMail: () => void navigate({ to: "/mail" }), children: slot ? (_jsx(slot.Component, {})) : (_jsxs("div", { className: "space-y-3 text-sm text-fg-muted", children: [_jsx("p", { children: "This settings section doesn't exist." }), _jsx(NavLink, { to: "/settings", variant: "inline", children: "Back to settings" })] })) }));
20
+ }
@@ -2,5 +2,4 @@ export declare const sendersHelp: import("react").JSX.Element;
2
2
  export declare const accountsHelp: import("react").JSX.Element;
3
3
  export declare const appearanceHelp: import("react").JSX.Element;
4
4
  export declare const advancedHelp: import("react").JSX.Element;
5
- export declare const securityHelp: import("react").JSX.Element;
6
5
  export declare const warningsHelp: import("react").JSX.Element;
@@ -4,5 +4,4 @@ export const sendersHelp = (_jsxs("div", { className: "space-y-3", children: [_j
4
4
  export const accountsHelp = (_jsxs("div", { className: "space-y-3", children: [_jsxs("p", { children: [_jsx("strong", { className: "text-fg", children: "Sync health" }), " shows the IMAP connection state and the last successful sync per account."] }), _jsxs("p", { children: [_jsx("strong", { className: "text-fg", children: "Error" }), " means the last connection attempt failed \u2014 the raw server response is shown on the card. Reconnect re-runs the connection test from the add-account wizard."] }), _jsxs("p", { children: [_jsx("strong", { className: "text-fg", children: "Muted" }), " accounts keep syncing but stay out of the daily brief and unified counts."] })] }));
5
5
  export const appearanceHelp = (_jsxs("div", { className: "space-y-3", children: [_jsxs("p", { children: [_jsx("strong", { className: "text-fg", children: "Density" }), " controls how much information fits on screen. Compact is great on smaller displays; Comfortable gives each item more breathing room."] }), _jsxs("p", { children: [_jsx("strong", { className: "text-fg", children: "Theme" }), " switches between light, dark, and system-preference modes instantly. The change takes effect across the whole app immediately."] }), _jsx("p", { className: "text-2xs text-fg-subtle", children: "Preferences are stored locally in this browser. Server-side sync is coming soon." })] }));
6
6
  export const advancedHelp = (_jsx("div", { className: "space-y-3", children: _jsxs("p", { children: [_jsx("strong", { className: "text-fg", children: "Notification rules" }), " and data export are coming in a future release."] }) }));
7
- export const securityHelp = (_jsxs("div", { className: "space-y-3", children: [_jsxs("p", { children: [_jsx("strong", { className: "text-fg", children: "Two-factor authentication" }), " asks for a second proof when you sign in, so a stolen password alone is not enough."] }), _jsxs("p", { children: [_jsx("strong", { className: "text-fg", children: "Passkeys" }), " replace the password with the lock on your device."] })] }));
8
7
  export const warningsHelp = (_jsxs("div", { className: "space-y-3", children: [_jsxs("p", { children: ["A message that fails to sync three times shows here. A", " ", _jsx("strong", { className: "text-fg", children: "retrying" }), " one is tried again every sync; a body that ", _jsx("strong", { className: "text-fg", children: "gave up" }), " is not. Either leaves the list once it syncs."] }), _jsxs("p", { children: ["A message Remit cannot read is", " ", _jsx("strong", { className: "text-fg", children: "set aside" }), " rather than skipped, and the folder keeps syncing. Setting one aside is a defect in Remit, so every entry can be reported with the diagnostics already attached."] }), _jsx("p", { children: "A report carries no folder name, subject, address, message content or error text." })] }));
@@ -13,7 +13,8 @@ import { DangerZone } from "../../components/settings/DangerZone";
13
13
  import { REDIRECT_STALL_MESSAGE, useRedirectEnded, } from "../../hooks/useRedirectEnded";
14
14
  import { useReturnFromRedirect } from "../../hooks/useReturnFromRedirect";
15
15
  import { formatRelativeTime } from "../../lib/format";
16
- import { SETTINGS_ID_TO_PATH, useSettingsNavItems } from "../settings";
16
+ import { useOpenSettingsSection } from "../../routing/sections";
17
+ import { useSettingsNavItems } from "../settings";
17
18
  import { accountsHelp } from "./-shared/help-copy";
18
19
  const accountsSearchSchema = z.object({
19
20
  editAccountId: z.string().optional(),
@@ -146,6 +147,7 @@ function AccountsSettings() {
146
147
  const search = Route.useSearch();
147
148
  const navigate = useNavigate({ from: Route.fullPath });
148
149
  const navItems = useSettingsNavItems();
150
+ const openSettingsSection = useOpenSettingsSection();
149
151
  const [helpOpen, setHelpOpen] = useState(true);
150
152
  const [showForm, setShowForm] = useState(false);
151
153
  const [showAddWizard, setShowAddWizard] = useState(false);
@@ -305,12 +307,7 @@ function AccountsSettings() {
305
307
  setEditingAccountId(null);
306
308
  setFocusSmtp(false);
307
309
  };
308
- const handleSelectNav = (id) => {
309
- const path = SETTINGS_ID_TO_PATH[id];
310
- if (path)
311
- void navigate({ to: path });
312
- };
313
- return (_jsxs(SettingsShell, { items: navItems, activeId: "accounts", title: "Accounts", description: "Every account keeps syncing \u2014 muted ones just stay out of unified views.", help: accountsHelp, helpOpen: helpOpen, onToggleHelp: () => setHelpOpen((v) => !v), onSelect: handleSelectNav, onBackToMail: () => void navigate({ to: "/mail" }), children: [successMessage && (_jsx(Banner, { tone: "success", variant: "soft", "data-testid": "oauth-success-banner", onDismiss: () => setSuccessMessage(null), children: successMessage })), oauthErrorMessage && (_jsx(Banner, { tone: "danger", variant: "soft", "data-testid": "oauth-error-banner", onDismiss: () => setOauthErrorMessage(null), children: oauthErrorMessage })), _jsxs("div", { className: "flex items-center justify-between", children: [_jsx(Badge, { tone: "neutral", children: isPending || isError
310
+ return (_jsxs(SettingsShell, { items: navItems, activeId: "accounts", title: "Accounts", description: "Every account keeps syncing \u2014 muted ones just stay out of unified views.", help: accountsHelp, helpOpen: helpOpen, onToggleHelp: () => setHelpOpen((v) => !v), onSelect: openSettingsSection, onBackToMail: () => void navigate({ to: "/mail" }), children: [successMessage && (_jsx(Banner, { tone: "success", variant: "soft", "data-testid": "oauth-success-banner", onDismiss: () => setSuccessMessage(null), children: successMessage })), oauthErrorMessage && (_jsx(Banner, { tone: "danger", variant: "soft", "data-testid": "oauth-error-banner", onDismiss: () => setOauthErrorMessage(null), children: oauthErrorMessage })), _jsxs("div", { className: "flex items-center justify-between", children: [_jsx(Badge, { tone: "neutral", children: isPending || isError
314
311
  ? "accounts"
315
312
  : `${config.accounts.length} ${config.accounts.length === 1 ? "account" : "accounts"}` }), _jsx(Button, { variant: "primary", size: "sm", icon: _jsx(Plus, { className: "size-3.5" }), onClick: () => setShowAddWizard(true), children: "Add account" })] }), isPending ? (_jsx(LoadingSkeleton, {})) : isError ? (_jsx(ErrorState, { title: "Couldn't load accounts", error: error, onRetry: () => {
316
313
  refetch();
@@ -10,8 +10,9 @@ import { ConfigTransferPanel } from "../../components/settings/ConfigTransferPan
10
10
  import { SelfUpdatePanel } from "../../components/settings/SelfUpdatePanel";
11
11
  import { TlsRootCaDownload } from "../../components/settings/TlsRootCaDownload";
12
12
  import { AppVersion } from "../../components/ui/AppVersion";
13
+ import { useOpenSettingsSection } from "../../routing/sections";
13
14
  import { getRuntimeConfig } from "../../runtime-config";
14
- import { SETTINGS_ID_TO_PATH, useSettingsNavItems } from "../settings";
15
+ import { useSettingsNavItems } from "../settings";
15
16
  import { advancedHelp } from "./-shared/help-copy";
16
17
  export const Route = createFileRoute("/settings/advanced")({
17
18
  component: AdvancedSettings,
@@ -19,11 +20,7 @@ export const Route = createFileRoute("/settings/advanced")({
19
20
  function AdvancedSettings() {
20
21
  const navigate = useNavigate();
21
22
  const navItems = useSettingsNavItems();
23
+ const openSettingsSection = useOpenSettingsSection();
22
24
  const [helpOpen, setHelpOpen] = useState(true);
23
- const handleSelectNav = (id) => {
24
- const path = SETTINGS_ID_TO_PATH[id];
25
- if (path)
26
- void navigate({ to: path });
27
- };
28
- return (_jsxs(SettingsShell, { items: navItems, activeId: "advanced", title: "Advanced", description: "Notification rules, export, and diagnostics.", help: advancedHelp, helpOpen: helpOpen, onToggleHelp: () => setHelpOpen((v) => !v), onSelect: handleSelectNav, onBackToMail: () => void navigate({ to: "/mail" }), children: [getRuntimeConfig().updateMode === "self" && _jsx(SelfUpdatePanel, {}), _jsx("div", { className: "mt-6 border-t border-line pt-4", children: _jsx(ConfigTransferPanel, {}) }), _jsx("div", { className: "mt-6 border-t border-line pt-4", children: _jsx("p", { className: "text-sm text-fg-muted", children: "Notification rules are coming in a future release." }) }), _jsx(TlsRootCaDownload, {}), _jsxs("div", { className: "border-t border-line pt-4 mt-4", children: [_jsx("p", { className: "text-sm font-medium text-fg mb-1", children: "About" }), _jsx(AppVersion, {})] })] }));
25
+ return (_jsxs(SettingsShell, { items: navItems, activeId: "advanced", title: "Advanced", description: "Notification rules, export, and diagnostics.", help: advancedHelp, helpOpen: helpOpen, onToggleHelp: () => setHelpOpen((v) => !v), onSelect: openSettingsSection, onBackToMail: () => void navigate({ to: "/mail" }), children: [getRuntimeConfig().updateMode === "self" && _jsx(SelfUpdatePanel, {}), _jsx("div", { className: "mt-6 border-t border-line pt-4", children: _jsx(ConfigTransferPanel, {}) }), _jsx("div", { className: "mt-6 border-t border-line pt-4", children: _jsx("p", { className: "text-sm text-fg-muted", children: "Notification rules are coming in a future release." }) }), _jsx(TlsRootCaDownload, {}), _jsxs("div", { className: "border-t border-line pt-4 mt-4", children: [_jsx("p", { className: "text-sm font-medium text-fg mb-1", children: "About" }), _jsx(AppVersion, {})] })] }));
29
26
  }
@@ -11,7 +11,8 @@ import { SegmentedControl, SettingsShell } from "@remit/ui";
11
11
  import { createFileRoute, useNavigate } from "@tanstack/react-router";
12
12
  import { useState } from "react";
13
13
  import { getThemePreference, setThemePreference, } from "../../lib/theme-preference";
14
- import { SETTINGS_ID_TO_PATH, useSettingsNavItems } from "../settings";
14
+ import { useOpenSettingsSection } from "../../routing/sections";
15
+ import { useSettingsNavItems } from "../settings";
15
16
  import { appearanceHelp } from "./-shared/help-copy";
16
17
  export const Route = createFileRoute("/settings/appearance")({
17
18
  component: AppearanceSettings,
@@ -31,6 +32,7 @@ function readDensity() {
31
32
  function AppearanceSettings() {
32
33
  const navigate = useNavigate();
33
34
  const navItems = useSettingsNavItems();
35
+ const openSettingsSection = useOpenSettingsSection();
34
36
  const [helpOpen, setHelpOpen] = useState(true);
35
37
  const [density, setDensity] = useState(readDensity);
36
38
  // Read the current stored preference so the picker reflects the boot-time value
@@ -46,12 +48,7 @@ function AppearanceSettings() {
46
48
  setTheme(value);
47
49
  setThemePreference(value); // persists + applies immediately
48
50
  };
49
- const handleSelectNav = (id) => {
50
- const path = SETTINGS_ID_TO_PATH[id];
51
- if (path)
52
- void navigate({ to: path });
53
- };
54
- return (_jsx(SettingsShell, { items: navItems, activeId: "appearance", title: "Appearance", description: "Display density and colour theme \u2014 instant-apply.", help: appearanceHelp, helpOpen: helpOpen, onToggleHelp: () => setHelpOpen((v) => !v), onSelect: handleSelectNav, onBackToMail: () => void navigate({ to: "/mail" }), children: _jsxs("div", { className: "space-y-5", children: [_jsxs("div", { className: "space-y-2", children: [_jsx("p", { className: "text-sm font-medium text-fg", children: "Density" }), _jsx(SegmentedControl, { name: "density", "aria-label": "Density", value: density, onChange: handleDensity, options: [
51
+ return (_jsx(SettingsShell, { items: navItems, activeId: "appearance", title: "Appearance", description: "Display density and colour theme \u2014 instant-apply.", help: appearanceHelp, helpOpen: helpOpen, onToggleHelp: () => setHelpOpen((v) => !v), onSelect: openSettingsSection, onBackToMail: () => void navigate({ to: "/mail" }), children: _jsxs("div", { className: "space-y-5", children: [_jsxs("div", { className: "space-y-2", children: [_jsx("p", { className: "text-sm font-medium text-fg", children: "Density" }), _jsx(SegmentedControl, { name: "density", "aria-label": "Density", value: density, onChange: handleDensity, options: [
55
52
  { value: "comfortable", label: "Comfortable" },
56
53
  { value: "compact", label: "Compact" },
57
54
  ] }), _jsx("p", { className: "text-xs text-fg-subtle", children: "Controls the spacing of message rows in the mail list." })] }), _jsxs("div", { className: "space-y-2", children: [_jsx("p", { className: "text-sm font-medium text-fg", children: "Theme" }), _jsx(SegmentedControl, { name: "theme", "aria-label": "Theme", value: theme, onChange: handleTheme, options: [
@@ -10,7 +10,8 @@ import { CalendarSubscriptionStatus } from "../../components/settings/CalendarSu
10
10
  import { useCalendarCollectionWrites } from "../../hooks/calendar/useCalendarCollectionWrites";
11
11
  import { useCalendarSubscriptions } from "../../hooks/calendar/useCalendarSubscriptions";
12
12
  import { useCalendars } from "../../hooks/calendar/useCalendars";
13
- import { SETTINGS_ID_TO_PATH, useSettingsNavItems } from "../settings";
13
+ import { useOpenSettingsSection } from "../../routing/sections";
14
+ import { useSettingsNavItems } from "../settings";
14
15
  export const Route = createFileRoute("/settings/calendars")({
15
16
  component: CalendarsSettings,
16
17
  });
@@ -18,16 +19,13 @@ const calendarsHelp = (_jsxs("div", { className: "space-y-3", children: [_jsx("p
18
19
  function CalendarsSettings() {
19
20
  const navigate = useNavigate();
20
21
  const navItems = useSettingsNavItems();
22
+ const openSettingsSection = useOpenSettingsSection();
21
23
  const [helpOpen, setHelpOpen] = useState(true);
22
24
  const { calendars, collections, timeZoneByCalendarId, isLoading } = useCalendars();
23
25
  const subscriptions = useCalendarSubscriptions();
24
26
  const { createCalendar, isWriting } = useCalendarCollectionWrites();
25
27
  const [createProblem, setCreateProblem] = useState("");
26
- return (_jsx(SettingsShell, { items: navItems, activeId: "calendars", title: "Calendars", description: "Add, rename and delete calendars, subscribe to a calendar feed, and share one with any client that can subscribe to a URL.", help: calendarsHelp, helpOpen: helpOpen, onToggleHelp: () => setHelpOpen((open) => !open), onSelect: (id) => {
27
- const path = SETTINGS_ID_TO_PATH[id];
28
- if (path)
29
- void navigate({ to: path });
30
- }, onBackToMail: () => void navigate({ to: "/mail" }), children: isLoading ? (
28
+ return (_jsx(SettingsShell, { items: navItems, activeId: "calendars", title: "Calendars", description: "Add, rename and delete calendars, subscribe to a calendar feed, and share one with any client that can subscribe to a URL.", help: calendarsHelp, helpOpen: helpOpen, onToggleHelp: () => setHelpOpen((open) => !open), onSelect: openSettingsSection, onBackToMail: () => void navigate({ to: "/mail" }), children: isLoading ? (
31
29
  // biome-ignore lint/a11y/useAriaPropsSupportedByRole: aria-label on a loading skeleton is what assistive tech has to go on
32
30
  _jsx("div", { className: "h-24 animate-pulse rounded-sm border border-line bg-surface", "aria-busy": "true", "aria-label": "Loading calendars" })) : (_jsxs("div", { className: "space-y-4", children: [_jsx(CalendarDefaultSenderCard, {}), calendars.map((calendar) => {
33
31
  const collection = collections.find((candidate) => candidate.calendarId === calendar.id);
@@ -15,7 +15,8 @@ import { filterRunReportHref, filterToggleReportHref, } from "../../lib/filter-r
15
15
  import { buildMailboxRoleMap, labelForMailbox } from "../../lib/folder-roles";
16
16
  import { buildMoveOptions, folderDelimiter } from "../../lib/move-options";
17
17
  import { filterRunStatus } from "../../lib/organize/filter-run";
18
- import { SETTINGS_ID_TO_PATH, useSettingsNavItems } from "../settings";
18
+ import { useOpenSettingsSection } from "../../routing/sections";
19
+ import { useSettingsNavItems } from "../settings";
19
20
  export const Route = createFileRoute("/settings/filters")({
20
21
  component: FiltersSettings,
21
22
  });
@@ -74,14 +75,10 @@ export function AccountFilters({ account, }) {
74
75
  function FiltersSettings() {
75
76
  const navigate = useNavigate();
76
77
  const navItems = useSettingsNavItems();
78
+ const openSettingsSection = useOpenSettingsSection();
77
79
  const [helpOpen, setHelpOpen] = useState(true);
78
80
  const { data: config, isPending, isError, error, refetch, } = useQuery(configOperationsGetConfigOptions());
79
- const handleSelectNav = (id) => {
80
- const path = SETTINGS_ID_TO_PATH[id];
81
- if (path)
82
- void navigate({ to: path });
83
- };
84
- return (_jsx(SettingsShell, { items: navItems, activeId: "filters", title: "Filters", description: "Standing and temporary rules created by Organize, per account.", help: filtersHelp, helpOpen: helpOpen, onToggleHelp: () => setHelpOpen((v) => !v), onSelect: handleSelectNav, onBackToMail: () => void navigate({ to: "/mail" }), children: isPending ? (
81
+ return (_jsx(SettingsShell, { items: navItems, activeId: "filters", title: "Filters", description: "Standing and temporary rules created by Organize, per account.", help: filtersHelp, helpOpen: helpOpen, onToggleHelp: () => setHelpOpen((v) => !v), onSelect: openSettingsSection, onBackToMail: () => void navigate({ to: "/mail" }), children: isPending ? (
85
82
  // biome-ignore lint/a11y/useAriaPropsSupportedByRole: aria-label on loading skeleton provides useful context for assistive tech
86
83
  _jsx("div", { className: "h-24 animate-pulse rounded-sm border border-line bg-surface", "aria-busy": "true", "aria-label": "Loading accounts" })) : isError ? (_jsx(ErrorState, { title: "Couldn't load accounts", error: error, onRetry: () => {
87
84
  refetch();
@@ -12,7 +12,8 @@ import { guardFolderDeletion } from "../../lib/delete-folder";
12
12
  import { softErrorStatuses } from "../../lib/error-classifier";
13
13
  import { folderFailure } from "../../lib/folder-failure";
14
14
  import { buildMailboxRoleMap, CANONICAL_TO_NAV_ROLE, labelForMailbox, NAV_ROLE_TO_CANONICAL, } from "../../lib/folder-roles";
15
- import { SETTINGS_ID_TO_PATH, useSettingsNavItems } from "../settings";
15
+ import { useOpenSettingsSection } from "../../routing/sections";
16
+ import { useSettingsNavItems } from "../settings";
16
17
  export const Route = createFileRoute("/settings/folders")({
17
18
  component: FoldersSettings,
18
19
  });
@@ -128,14 +129,10 @@ function AccountFolders({ account }) {
128
129
  function FoldersSettings() {
129
130
  const navigate = useNavigate();
130
131
  const navItems = useSettingsNavItems();
132
+ const openSettingsSection = useOpenSettingsSection();
131
133
  const [helpOpen, setHelpOpen] = useState(true);
132
134
  const { data: config, isPending, isError, error, refetch, } = useQuery(configOperationsGetConfigOptions());
133
- const handleSelectNav = (id) => {
134
- const path = SETTINGS_ID_TO_PATH[id];
135
- if (path)
136
- void navigate({ to: path });
137
- };
138
- return (_jsx(SettingsShell, { items: navItems, activeId: "folders", title: "Folder roles", description: "Appoint which real folder fills each canonical role, per account.", help: _jsx(FolderRolesHelp, {}), helpOpen: helpOpen, onToggleHelp: () => setHelpOpen((v) => !v), onSelect: handleSelectNav, onBackToMail: () => void navigate({ to: "/mail" }), children: isPending ? (
135
+ return (_jsx(SettingsShell, { items: navItems, activeId: "folders", title: "Folder roles", description: "Appoint which real folder fills each canonical role, per account.", help: _jsx(FolderRolesHelp, {}), helpOpen: helpOpen, onToggleHelp: () => setHelpOpen((v) => !v), onSelect: openSettingsSection, onBackToMail: () => void navigate({ to: "/mail" }), children: isPending ? (
139
136
  // biome-ignore lint/a11y/useAriaPropsSupportedByRole: aria-label on loading skeleton provides useful context for assistive tech
140
137
  _jsx("div", { className: "h-24 animate-pulse rounded-sm border border-line bg-surface", "aria-busy": "true", "aria-label": "Loading accounts" })) : isError ? (_jsx(ErrorState, { title: "Couldn't load accounts", error: error, onRetry: () => {
141
138
  refetch();
@@ -7,7 +7,8 @@ import { useState } from "react";
7
7
  import { LabelsList } from "../../components/settings/LabelsList";
8
8
  import { useCreateLabel, useDeleteLabel, useLabelList, useUpdateLabel, } from "../../hooks/useLabels";
9
9
  import { deleteLabelConfirmCopy } from "../../lib/organize/label-delete-copy";
10
- import { SETTINGS_ID_TO_PATH, useSettingsNavItems } from "../settings";
10
+ import { useOpenSettingsSection } from "../../routing/sections";
11
+ import { useSettingsNavItems } from "../settings";
11
12
  export const Route = createFileRoute("/settings/labels")({
12
13
  component: LabelsSettings,
13
14
  });
@@ -57,14 +58,10 @@ function AccountLabels({ account }) {
57
58
  function LabelsSettings() {
58
59
  const navigate = useNavigate();
59
60
  const navItems = useSettingsNavItems();
61
+ const openSettingsSection = useOpenSettingsSection();
60
62
  const [helpOpen, setHelpOpen] = useState(true);
61
63
  const { data: config, isPending, isError, error, refetch, } = useQuery(configOperationsGetConfigOptions());
62
- const handleSelectNav = (id) => {
63
- const path = SETTINGS_ID_TO_PATH[id];
64
- if (path)
65
- void navigate({ to: path });
66
- };
67
- return (_jsx(SettingsShell, { items: navItems, activeId: "labels", title: "Labels", description: "Mark mail without moving it, per account.", help: labelsHelp, helpOpen: helpOpen, onToggleHelp: () => setHelpOpen((v) => !v), onSelect: handleSelectNav, onBackToMail: () => void navigate({ to: "/mail" }), children: isPending ? (
64
+ return (_jsx(SettingsShell, { items: navItems, activeId: "labels", title: "Labels", description: "Mark mail without moving it, per account.", help: labelsHelp, helpOpen: helpOpen, onToggleHelp: () => setHelpOpen((v) => !v), onSelect: openSettingsSection, onBackToMail: () => void navigate({ to: "/mail" }), children: isPending ? (
68
65
  // biome-ignore lint/a11y/useAriaPropsSupportedByRole: aria-label on loading skeleton provides useful context for assistive tech
69
66
  _jsx("div", { className: "h-24 animate-pulse rounded-sm border border-line bg-surface", "aria-busy": "true", "aria-label": "Loading accounts" })) : isError ? (_jsx(ErrorState, { title: "Couldn't load accounts", error: error, onRetry: () => {
70
67
  refetch();
@@ -3,7 +3,8 @@ import { SettingsShell } from "@remit/ui";
3
3
  import { createFileRoute, useNavigate } from "@tanstack/react-router";
4
4
  import { useState } from "react";
5
5
  import { PeoplePanel } from "../../components/settings/people/PeoplePanel";
6
- import { SETTINGS_ID_TO_PATH, useSettingsNavItems } from "../settings";
6
+ import { useOpenSettingsSection } from "../../routing/sections";
7
+ import { useSettingsNavItems } from "../settings";
7
8
  export const Route = createFileRoute("/settings/people")({
8
9
  component: PeopleSettings,
9
10
  });
@@ -11,10 +12,7 @@ const peopleHelp = (_jsxs("div", { className: "space-y-3", children: [_jsx("p",
11
12
  function PeopleSettings() {
12
13
  const navigate = useNavigate();
13
14
  const navItems = useSettingsNavItems();
15
+ const openSettingsSection = useOpenSettingsSection();
14
16
  const [helpOpen, setHelpOpen] = useState(true);
15
- return (_jsx(SettingsShell, { items: navItems, activeId: "people", title: "People", description: "Everyone with an account on this server.", help: peopleHelp, helpOpen: helpOpen, onToggleHelp: () => setHelpOpen((open) => !open), onSelect: (id) => {
16
- const path = SETTINGS_ID_TO_PATH[id];
17
- if (path)
18
- void navigate({ to: path });
19
- }, onBackToMail: () => void navigate({ to: "/mail" }), children: _jsx(PeoplePanel, {}) }));
17
+ return (_jsx(SettingsShell, { items: navItems, activeId: "people", title: "People", description: "Everyone with an account on this server.", help: peopleHelp, helpOpen: helpOpen, onToggleHelp: () => setHelpOpen((open) => !open), onSelect: openSettingsSection, onBackToMail: () => void navigate({ to: "/mail" }), children: _jsx(PeoplePanel, {}) }));
20
18
  }
@@ -17,7 +17,8 @@ import { Search, Star, X } from "lucide-react";
17
17
  import { useCallback, useEffect, useState } from "react";
18
18
  import { useDebouncedValue } from "../../hooks/useDebouncedValue";
19
19
  import { formatDate } from "../../lib/format";
20
- import { SETTINGS_ID_TO_PATH, useSettingsNavItems } from "../settings";
20
+ import { useOpenSettingsSection } from "../../routing/sections";
21
+ import { useSettingsNavItems } from "../settings";
21
22
  import { sendersHelp } from "./-shared/help-copy";
22
23
  export const Route = createFileRoute("/settings/senders")({
23
24
  component: SendersSettings,
@@ -168,6 +169,7 @@ export function SearchGroupPane({ group, query, onCount, }) {
168
169
  function SendersSettings() {
169
170
  const navigate = useNavigate();
170
171
  const navItems = useSettingsNavItems();
172
+ const openSettingsSection = useOpenSettingsSection();
171
173
  const [group, setGroup] = useState("vip");
172
174
  const [query, setQuery] = useState("");
173
175
  const [helpOpen, setHelpOpen] = useState(true);
@@ -185,12 +187,7 @@ function SendersSettings() {
185
187
  setGroupCounts((prev) => ({ ...prev, [group]: m }));
186
188
  }, [group]);
187
189
  const total = groupCounts[group];
188
- const handleSelectNav = (id) => {
189
- const path = SETTINGS_ID_TO_PATH[id];
190
- if (path)
191
- void navigate({ to: path });
192
- };
193
- return (_jsx(SettingsShell, { items: navItems, activeId: "senders", title: "Senders & Rules", description: "Per-sender preferences \u2014 set with one key from any message, managed here.", flush: true, help: sendersHelp, helpOpen: helpOpen, onToggleHelp: () => setHelpOpen((v) => !v), onSelect: handleSelectNav, onBackToMail: () => void navigate({ to: "/mail" }), children: _jsxs("div", { className: "flex min-h-0 flex-1 flex-col lg:flex-row", children: [_jsx(SenderGroupSwitch, { active: group, onSelect: (g) => {
190
+ return (_jsx(SettingsShell, { items: navItems, activeId: "senders", title: "Senders & Rules", description: "Per-sender preferences \u2014 set with one key from any message, managed here.", flush: true, help: sendersHelp, helpOpen: helpOpen, onToggleHelp: () => setHelpOpen((v) => !v), onSelect: openSettingsSection, onBackToMail: () => void navigate({ to: "/mail" }), children: _jsxs("div", { className: "flex min-h-0 flex-1 flex-col lg:flex-row", children: [_jsx(SenderGroupSwitch, { active: group, onSelect: (g) => {
194
191
  setGroup(g);
195
192
  setQuery("");
196
193
  }, options: ["vip", "muted", "blocked"].map((g) => ({
@@ -3,7 +3,8 @@ import { SettingsShell } from "@remit/ui";
3
3
  import { createFileRoute, useNavigate } from "@tanstack/react-router";
4
4
  import { useState } from "react";
5
5
  import { WarningsPanel } from "../../components/settings/WarningsPanel";
6
- import { SETTINGS_ID_TO_PATH, useSettingsNavItems } from "../settings";
6
+ import { useOpenSettingsSection } from "../../routing/sections";
7
+ import { useSettingsNavItems } from "../settings";
7
8
  import { warningsHelp } from "./-shared/help-copy";
8
9
  export const Route = createFileRoute("/settings/warnings")({
9
10
  component: WarningsSettings,
@@ -11,11 +12,7 @@ export const Route = createFileRoute("/settings/warnings")({
11
12
  function WarningsSettings() {
12
13
  const navigate = useNavigate();
13
14
  const navItems = useSettingsNavItems();
15
+ const openSettingsSection = useOpenSettingsSection();
14
16
  const [helpOpen, setHelpOpen] = useState(true);
15
- const handleSelectNav = (id) => {
16
- const path = SETTINGS_ID_TO_PATH[id];
17
- if (path)
18
- void navigate({ to: path });
19
- };
20
- return (_jsx(SettingsShell, { items: navItems, activeId: "warnings", title: "Warnings", description: "Messages that failed to sync, and messages set aside.", help: warningsHelp, helpOpen: helpOpen, onToggleHelp: () => setHelpOpen((v) => !v), onSelect: handleSelectNav, onBackToMail: () => void navigate({ to: "/mail" }), children: _jsx(WarningsPanel, {}) }));
17
+ return (_jsx(SettingsShell, { items: navItems, activeId: "warnings", title: "Warnings", description: "Messages that failed to sync, and messages set aside.", help: warningsHelp, helpOpen: helpOpen, onToggleHelp: () => setHelpOpen((v) => !v), onSelect: openSettingsSection, onBackToMail: () => void navigate({ to: "/mail" }), children: _jsx(WarningsPanel, {}) }));
21
18
  }
@@ -10,7 +10,6 @@
10
10
  */
11
11
  import type { SettingsNavItem } from "@remit/ui";
12
12
  export declare const SETTINGS_NAV_ITEMS: SettingsNavItem[];
13
- export declare const SETTINGS_ID_TO_PATH: Record<string, string>;
14
13
  /**
15
14
  * The nav every settings page renders. People shows only once the server lists
16
15
  * people: it answers 404 while self sign-up is open or off self-host.
@@ -1,11 +1,10 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { createFileRoute, Outlet } from "@tanstack/react-router";
3
- import { CalendarDays, Filter, FolderTree, Inbox, Palette, ShieldCheck, Tag, UserCog, Users, } from "lucide-react";
4
- import { createContext, useContext } from "react";
5
- import { useAuthProvider } from "../auth/provider";
3
+ import { CalendarDays, Filter, FolderTree, Inbox, Palette, Tag, UserCog, Users, } from "lucide-react";
6
4
  import { AdvancedNavIcon } from "../components/settings/AdvancedNavIcon";
7
5
  import { WarningsNavIcon } from "../components/settings/WarningsNavIcon";
8
6
  import { usePeople } from "../hooks/usePeople";
7
+ import { useSettingsSlots } from "../settings-slots";
9
8
  /* ------------------------------------------------------------------ */
10
9
  /* Nav items — single source of truth shared by all settings pages */
11
10
  /* ------------------------------------------------------------------ */
@@ -48,25 +47,6 @@ export const SETTINGS_NAV_ITEMS = [
48
47
  },
49
48
  { id: "advanced", label: "Advanced", icon: _jsx(AdvancedNavIcon, {}) },
50
49
  ];
51
- export const SETTINGS_ID_TO_PATH = {
52
- accounts: "/settings/accounts",
53
- security: "/settings/security",
54
- senders: "/settings/senders",
55
- folders: "/settings/folders",
56
- filters: "/settings/filters",
57
- labels: "/settings/labels",
58
- calendars: "/settings/calendars",
59
- appearance: "/settings/appearance",
60
- warnings: "/settings/warnings",
61
- people: "/settings/people",
62
- advanced: "/settings/advanced",
63
- };
64
- const SECURITY_NAV_ITEM = {
65
- id: "security",
66
- label: "Security",
67
- icon: _jsx(ShieldCheck, { className: "size-4" }),
68
- };
69
- const SecurityUrlContext = createContext(undefined);
70
50
  const PEOPLE_NAV_ITEM = {
71
51
  id: "people",
72
52
  label: "People",
@@ -78,10 +58,9 @@ const PEOPLE_NAV_ITEM = {
78
58
  */
79
59
  export const useSettingsNavItems = () => {
80
60
  const people = usePeople();
81
- const securityUrl = useContext(SecurityUrlContext);
61
+ const slots = useSettingsSlots();
82
62
  const items = [...SETTINGS_NAV_ITEMS];
83
- if (securityUrl)
84
- items.splice(1, 0, SECURITY_NAV_ITEM);
63
+ items.splice(1, 0, ...slots.map(({ id, label, icon }) => ({ id, label, icon })));
85
64
  if (!people.isSuccess)
86
65
  return items;
87
66
  const advanced = items.findIndex((item) => item.id === "advanced");
@@ -91,13 +70,9 @@ export const useSettingsNavItems = () => {
91
70
  ...items.slice(advanced),
92
71
  ];
93
72
  };
94
- const SettingsLayout = () => {
95
- const { Account } = useAuthProvider();
96
- return (_jsx(Account, { fallback: _jsx(SecurityUrlContext.Provider, { value: undefined, children: _jsx(Outlet, {}) }), children: ({ securityUrl }) => (_jsx(SecurityUrlContext.Provider, { value: securityUrl, children: _jsx(Outlet, {}) })) }));
97
- };
98
73
  /* ------------------------------------------------------------------ */
99
74
  /* Route — pass-through */
100
75
  /* ------------------------------------------------------------------ */
101
76
  export const Route = createFileRoute("/settings")({
102
- component: SettingsLayout,
77
+ component: () => _jsx(Outlet, {}),
103
78
  });
@@ -3,7 +3,7 @@
3
3
  * the moves that leave whatever the reader is on rather than open something
4
4
  * under it, so they carry no panels and no query.
5
5
  */
6
- export type AppSection = "brief" | "flagged" | "outbox" | "settings" | "accounts" | "security" | "importConfig";
6
+ export type AppSection = "brief" | "flagged" | "outbox" | "settings" | "accounts" | "importConfig";
7
7
  /** Go to a top-level section by name, so no caller writes a path. */
8
8
  export declare function useGoToSection(): (section: AppSection) => void;
9
9
  /**
@@ -14,3 +14,8 @@ export declare function useGoToSection(): (section: AppSection) => void;
14
14
  * what it was about.
15
15
  */
16
16
  export declare function useConfigureAccountSmtp(): (accountId: string) => void;
17
+ /**
18
+ * Open a settings section by id. A built-in section matches its own literal
19
+ * route before `/settings/$slotId`, so one call reaches both kinds.
20
+ */
21
+ export declare function useOpenSettingsSection(): (slotId: string) => void;
@@ -6,7 +6,6 @@ const sectionRoute = {
6
6
  outbox: "/mail/outbox",
7
7
  settings: "/settings",
8
8
  accounts: "/settings/accounts",
9
- security: "/settings/security",
10
9
  importConfig: "/import",
11
10
  };
12
11
  /** Go to a top-level section by name, so no caller writes a path. */
@@ -32,3 +31,13 @@ export function useConfigureAccountSmtp() {
32
31
  });
33
32
  }, [navigate]);
34
33
  }
34
+ /**
35
+ * Open a settings section by id. A built-in section matches its own literal
36
+ * route before `/settings/$slotId`, so one call reaches both kinds.
37
+ */
38
+ export function useOpenSettingsSection() {
39
+ const navigate = useNavigate();
40
+ return useCallback((slotId) => {
41
+ navigate({ to: "/settings/$slotId", params: { slotId } });
42
+ }, [navigate]);
43
+ }
@@ -0,0 +1,14 @@
1
+ import { type ComponentType, type ReactNode } from "react";
2
+ /**
3
+ * A settings section the host registers. It routes at `/settings/<id>` and
4
+ * joins the settings nav beside the built-in sections.
5
+ */
6
+ export interface SettingsSlot {
7
+ id: string;
8
+ label: string;
9
+ icon: ReactNode;
10
+ Component: ComponentType;
11
+ help: ReactNode;
12
+ }
13
+ export declare const SettingsSlotsProvider: import("react").Provider<SettingsSlot[]>;
14
+ export declare const useSettingsSlots: () => SettingsSlot[];
@@ -0,0 +1,4 @@
1
+ import { createContext, useContext, } from "react";
2
+ const SettingsSlotsContext = createContext([]);
3
+ export const SettingsSlotsProvider = SettingsSlotsContext.Provider;
4
+ export const useSettingsSlots = () => useContext(SettingsSlotsContext);
@@ -1,10 +1,13 @@
1
1
  import { type AuthProvider } from "../auth/provider";
2
+ import { type SettingsSlot } from "../settings-slots";
2
3
  import "../lib/i18n";
3
4
  import "../index.css";
4
5
  import "../lib/client";
5
6
  export interface MountOptions {
6
7
  /** The identity system this build composes. */
7
8
  authProvider: AuthProvider;
9
+ /** Settings sections the host adds, each at `/settings/<id>`. */
10
+ settingsSlots?: SettingsSlot[];
8
11
  /** Element to mount into. Defaults to `#root`. */
9
12
  rootElementId?: string;
10
13
  }
@@ -14,4 +17,5 @@ export interface MountOptions {
14
17
  * primitive a deployment shares, with the identity system supplied by the
15
18
  * distributor rather than baked in.
16
19
  */
17
- export declare const mountApp: ({ authProvider, rootElementId, }: MountOptions) => void;
20
+ export declare const mountApp: ({ authProvider, settingsSlots, rootElementId, }: MountOptions) => void;
21
+ export type { SettingsSlot } from "../settings-slots";
@@ -15,6 +15,7 @@ import { TelemetryContext } from "../lib/telemetry-context";
15
15
  import { installThemeSync } from "../lib/theme";
16
16
  import { createAppRouter } from "../router";
17
17
  import { getRuntimeConfig } from "../runtime-config";
18
+ import { SettingsSlotsProvider } from "../settings-slots";
18
19
  import "../lib/i18n";
19
20
  import "../index.css";
20
21
  import "../lib/client"; // Initialize client with error interceptor
@@ -24,7 +25,7 @@ import "../lib/client"; // Initialize client with error interceptor
24
25
  * primitive a deployment shares, with the identity system supplied by the
25
26
  * distributor rather than baked in.
26
27
  */
27
- export const mountApp = ({ authProvider, rootElementId = "root", }) => {
28
+ export const mountApp = ({ authProvider, settingsSlots = [], rootElementId = "root", }) => {
28
29
  installConsoleErrorCatcher();
29
30
  installThemeSync();
30
31
  authProvider.configure();
@@ -51,11 +52,16 @@ export const mountApp = ({ authProvider, rootElementId = "root", }) => {
51
52
  });
52
53
  installStaleBuildReload();
53
54
  const router = createAppRouter(queryClient, telemetry);
55
+ for (const slot of settingsSlots) {
56
+ if (Object.hasOwn(router.routesByPath, `/settings/${slot.id}`)) {
57
+ throw new Error(`Settings slot "${slot.id}" collides with a built-in settings section`);
58
+ }
59
+ }
54
60
  telemetry.recordPageView(window.location.pathname);
55
61
  const rootElement = document.getElementById(rootElementId);
56
62
  if (!rootElement) {
57
63
  throw new Error(`Root element not found: #${rootElementId}`);
58
64
  }
59
65
  const { Shell } = authProvider;
60
- createRoot(rootElement).render(_jsx(StrictMode, { children: _jsx(TelemetryContext.Provider, { value: telemetry, children: _jsxs(QueryClientProvider, { client: queryClient, children: [_jsx(AuthProviderProvider, { value: authProvider, children: _jsx(Shell, { children: _jsx(RouterProvider, { router: router }) }) }), !import.meta.env.PROD && !getRuntimeConfig().disableDevtools && (_jsx(ReactQueryDevtools, { initialIsOpen: false }))] }) }) }));
66
+ createRoot(rootElement).render(_jsx(StrictMode, { children: _jsx(TelemetryContext.Provider, { value: telemetry, children: _jsxs(QueryClientProvider, { client: queryClient, children: [_jsx(AuthProviderProvider, { value: authProvider, children: _jsx(SettingsSlotsProvider, { value: settingsSlots, children: _jsx(Shell, { children: _jsx(RouterProvider, { router: router }) }) }) }), !import.meta.env.PROD && !getRuntimeConfig().disableDevtools && (_jsx(ReactQueryDevtools, { initialIsOpen: false }))] }) }) }));
61
67
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remit/web-client",
3
- "version": "0.0.336",
3
+ "version": "0.0.337",
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.231",
94
+ "@remit/ui": "0.0.232",
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,21 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { SettingsShell } from "@remit/ui";
3
- import { createFileRoute, useNavigate } from "@tanstack/react-router";
4
- import { useState } from "react";
5
- import { AccountSession } from "../../auth/AccountSession";
6
- import { SETTINGS_ID_TO_PATH, useSettingsNavItems } from "../settings";
7
- import { securityHelp } from "./-shared/help-copy";
8
- export const Route = createFileRoute("/settings/security")({
9
- component: SecuritySettings,
10
- });
11
- function SecuritySettings() {
12
- const navigate = useNavigate();
13
- const navItems = useSettingsNavItems();
14
- const [helpOpen, setHelpOpen] = useState(true);
15
- const handleSelectNav = (id) => {
16
- const path = SETTINGS_ID_TO_PATH[id];
17
- if (path)
18
- void navigate({ to: path });
19
- };
20
- return (_jsx(SettingsShell, { items: navItems, activeId: "security", title: "Security", description: "Protect your account with a second step and passkeys.", help: securityHelp, helpOpen: helpOpen, onToggleHelp: () => setHelpOpen((v) => !v), onSelect: handleSelectNav, onBackToMail: () => void navigate({ to: "/mail" }), children: _jsx("div", { className: "space-y-3 text-sm text-fg-muted", children: _jsx(AccountSession, { children: ({ securityUrl }) => securityUrl ? (_jsx("a", { href: securityUrl, className: "font-medium text-accent hover:underline", children: "Manage two-factor authentication and passkeys" })) : null }) }) }));
21
- }