@byline/host-tanstack-start 4.11.1 → 4.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/dist/admin-shell/admin-activity/list.js +2 -2
  2. package/dist/admin-shell/chrome/dashboard.js +2 -2
  3. package/dist/admin-shell/chrome/route-error.js +3 -3
  4. package/dist/admin-shell/chrome/sign-in-page.d.ts +5 -5
  5. package/dist/admin-shell/chrome/sign-in-page.js +8 -8
  6. package/dist/i18n/locale-cookie.d.ts +1 -1
  7. package/dist/i18n/locale-definitions.d.ts +1 -1
  8. package/dist/i18n/resolve-locale.js +5 -5
  9. package/dist/i18n/server-translator.js +2 -2
  10. package/dist/integrations/byline-admin-services.js +2 -2
  11. package/dist/routes/admin-path.js +2 -2
  12. package/dist/routes/create-admin-dashboard-route.js +2 -2
  13. package/dist/routes/create-admin-layout-route.d.ts +1 -6
  14. package/dist/routes/create-admin-layout-route.js +9 -10
  15. package/dist/routes/create-sign-in-route.d.ts +9 -1
  16. package/dist/routes/create-sign-in-route.js +5 -2
  17. package/dist/routes/get-content-locale-route-config.js +2 -2
  18. package/dist/routes/index.d.ts +2 -2
  19. package/dist/routes/index.js +1 -1
  20. package/dist/routes/sign-in-home-url.d.ts +9 -0
  21. package/dist/routes/sign-in-home-url.js +4 -0
  22. package/dist/routes/sign-in-path.d.ts +0 -4
  23. package/dist/routes/sign-in-path.js +3 -17
  24. package/dist/server-fns/auth/sign-in.js +1 -1
  25. package/dist/server-fns/i18n/index.d.ts +2 -2
  26. package/dist/server-fns/i18n/index.js +1 -1
  27. package/dist/server-fns/i18n/set-locale.d.ts +3 -3
  28. package/dist/server-fns/i18n/set-locale.js +4 -4
  29. package/package.json +17 -17
  30. package/src/admin-shell/admin-activity/list.tsx +2 -2
  31. package/src/admin-shell/chrome/dashboard.tsx +2 -2
  32. package/src/admin-shell/chrome/route-error.tsx +4 -4
  33. package/src/admin-shell/chrome/sign-in-page.tsx +12 -15
  34. package/src/i18n/locale-cookie.ts +1 -1
  35. package/src/i18n/locale-definitions.ts +1 -1
  36. package/src/i18n/resolve-locale.ts +6 -6
  37. package/src/i18n/server-translator.ts +2 -2
  38. package/src/integrations/byline-admin-services.ts +2 -2
  39. package/src/routes/admin-path.test.node.ts +3 -4
  40. package/src/routes/admin-path.ts +2 -2
  41. package/src/routes/auth-routes.test.node.ts +4 -10
  42. package/src/routes/create-admin-dashboard-route.tsx +2 -2
  43. package/src/routes/create-admin-layout-route.tsx +11 -17
  44. package/src/routes/create-sign-in-route.tsx +13 -2
  45. package/src/routes/get-content-locale-route-config.ts +2 -2
  46. package/src/routes/index.ts +5 -2
  47. package/src/routes/sign-in-home-url.test.node.ts +21 -0
  48. package/src/routes/sign-in-home-url.ts +12 -0
  49. package/src/routes/sign-in-path.test.node.ts +4 -61
  50. package/src/routes/sign-in-path.ts +2 -24
  51. package/src/server-fns/auth/sign-in.ts +2 -2
  52. package/src/server-fns/i18n/index.ts +2 -2
  53. package/src/server-fns/i18n/set-locale.ts +8 -8
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3
3
  import { useRouterState } from "@tanstack/react-router";
4
- import { getClientConfig } from "@byline/core";
4
+ import { getAdminConfig } from "@byline/core";
5
5
  import { useTranslation } from "@byline/i18n/react";
6
6
  import { Button, Container, Section, Select, Table } from "@byline/ui/react";
7
7
  import clsx from "clsx";
@@ -47,7 +47,7 @@ const ActivitySystemView = ({ data })=>{
47
47
  });
48
48
  const search = location.search;
49
49
  const entries = data?.entries ?? [];
50
- const collections = getClientConfig().collections;
50
+ const collections = getAdminConfig().collections;
51
51
  const applyFilter = (key, value)=>{
52
52
  const params = structuredClone(location.search);
53
53
  params.page = void 0;
@@ -1,5 +1,5 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
- import { getClientConfig, getWorkflowStatuses } from "@byline/core";
2
+ import { getAdminConfig, getWorkflowStatuses } from "@byline/core";
3
3
  import { useTranslation } from "@byline/i18n/react";
4
4
  import { Card, Container, Section } from "@byline/ui/react";
5
5
  import clsx from "clsx";
@@ -51,7 +51,7 @@ function StatTile({ ws, count, collectionPath }) {
51
51
  });
52
52
  }
53
53
  function AdminDashboard({ statsMap }) {
54
- const config = getClientConfig();
54
+ const config = getAdminConfig();
55
55
  const { t } = useTranslation('byline-admin');
56
56
  return /*#__PURE__*/ jsx(Section, {
57
57
  children: /*#__PURE__*/ jsx(Container, {
@@ -1,7 +1,7 @@
1
1
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
2
  import { useContext } from "react";
3
3
  import { useRouter } from "@tanstack/react-router";
4
- import { BylineError, ErrorCodes, getClientConfig } from "@byline/core";
4
+ import { BylineError, ErrorCodes, getAdminConfig } from "@byline/core";
5
5
  import { I18nContext, I18nProvider, useTranslation } from "@byline/i18n/react";
6
6
  import { Alert, Button, Container, Section } from "@byline/ui/react";
7
7
  import clsx from "clsx";
@@ -32,9 +32,9 @@ function ErrorScreenI18nProvider({ children }) {
32
32
  let bundle = {};
33
33
  let locale = 'en';
34
34
  try {
35
- const { i18n } = getClientConfig();
35
+ const { i18n } = getAdminConfig();
36
36
  bundle = i18n.translations ?? {};
37
- locale = i18n.interface.defaultLocale;
37
+ locale = i18n.admin.defaultLocale;
38
38
  } catch {}
39
39
  return /*#__PURE__*/ jsx(I18nProvider, {
40
40
  bundle: bundle,
@@ -9,6 +9,7 @@ import type { LocaleCode } from '@byline/i18n';
9
9
  interface SignInPageProps {
10
10
  redirectTo: string;
11
11
  activeLocale: LocaleCode;
12
+ homeUrl?: string;
12
13
  }
13
14
  /**
14
15
  * Sign-in page chrome — rendered outside the authenticated admin
@@ -20,16 +21,15 @@ interface SignInPageProps {
20
21
  * (the one that wraps the authenticated admin) doesn't apply here.
21
22
  * `<LanguageMenu>` lights up automatically when two or more interface
22
23
  * locales are configured. On change, the menu calls
23
- * `setInterfaceLocaleFn` which writes the cookie unconditionally and
24
+ * `setAdminLocaleFn` which writes the cookie unconditionally and
24
25
  * skips the DB write on the pre-auth path (the user has no admin
25
26
  * session yet). After sign-in succeeds, the `adminSignIn` server fn
26
27
  * reconciles the cookie locale into the user's
27
28
  * `admin_users.preferred_locale` so the pre-auth choice becomes
28
29
  * sticky across devices from day one.
29
30
  *
30
- * Threads the configured `serverURL` into the `SignInForm` as `homeUrl` so
31
- * the form's action row can render a plain "Home" link beside the submit
32
- * button.
31
+ * Threads an optional host-owned `homeUrl` into `SignInForm` so the form's
32
+ * action row can render a plain "Home" link beside the submit button.
33
33
  */
34
- export declare function SignInPage({ redirectTo, activeLocale }: SignInPageProps): import("react").JSX.Element;
34
+ export declare function SignInPage({ redirectTo, activeLocale, homeUrl }: SignInPageProps): import("react").JSX.Element;
35
35
  export {};
@@ -1,18 +1,18 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { SignInForm } from "@byline/admin/auth/components/sign-in-form";
3
3
  import { BylineAdminServicesProvider } from "@byline/admin/services";
4
- import { getClientConfig } from "@byline/core";
4
+ import { getAdminConfig } from "@byline/core";
5
5
  import { I18nProvider, LanguageMenu } from "@byline/i18n/react";
6
6
  import clsx from "clsx";
7
7
  import { buildLocaleDefinitions } from "../../i18n/locale-definitions.js";
8
8
  import { bylineAdminServices } from "../../integrations/byline-admin-services.js";
9
- import { setInterfaceLocaleFn } from "../../server-fns/i18n/index.js";
9
+ import { setAdminLocaleFn } from "../../server-fns/i18n/index.js";
10
10
  import sign_in_page_module from "./sign-in-page.module.js";
11
- function SignInPage({ redirectTo, activeLocale }) {
12
- const { i18n, serverURL } = getClientConfig();
13
- const localeDefinitions = buildLocaleDefinitions(i18n.interface.locales, i18n.interface.localeDefinitions);
11
+ function SignInPage({ redirectTo, activeLocale, homeUrl }) {
12
+ const { i18n } = getAdminConfig();
13
+ const localeDefinitions = buildLocaleDefinitions(i18n.admin.locales, i18n.admin.localeDefinitions);
14
14
  const handleSetLocale = async (next)=>{
15
- await setInterfaceLocaleFn({
15
+ await setAdminLocaleFn({
16
16
  data: {
17
17
  locale: next
18
18
  }
@@ -22,7 +22,7 @@ function SignInPage({ redirectTo, activeLocale }) {
22
22
  return /*#__PURE__*/ jsx(I18nProvider, {
23
23
  bundle: i18n.translations ?? {},
24
24
  activeLocale: activeLocale,
25
- defaultLocale: i18n.interface.defaultLocale,
25
+ defaultLocale: i18n.admin.defaultLocale,
26
26
  localeDefinitions: localeDefinitions,
27
27
  setLocale: handleSetLocale,
28
28
  children: /*#__PURE__*/ jsx(BylineAdminServicesProvider, {
@@ -38,7 +38,7 @@ function SignInPage({ redirectTo, activeLocale }) {
38
38
  className: clsx('byline-sign-in-page-inner', sign_in_page_module.inner),
39
39
  children: /*#__PURE__*/ jsx(SignInForm, {
40
40
  redirectTo: redirectTo,
41
- homeUrl: serverURL
41
+ homeUrl: homeUrl
42
42
  })
43
43
  })
44
44
  ]
@@ -10,7 +10,7 @@ export declare const ADMIN_LOCALE_COOKIE = "byline_admin_lng";
10
10
  export declare function readAdminLocaleCookie(): string | null;
11
11
  /**
12
12
  * Write the admin locale cookie. Caller is expected to have validated
13
- * `locale` against the permitted `i18n.interface.locales` set first.
13
+ * `locale` against the permitted `i18n.admin.locales` set first.
14
14
  */
15
15
  export declare function setAdminLocaleCookie(locale: string): void;
16
16
  /** Clear the cookie — used when a user opts back into browser-default detection. */
@@ -11,7 +11,7 @@ import type { LocaleDefinition } from '@byline/i18n';
11
11
  * resolution order:
12
12
  *
13
13
  * 1. An entry from the host's configured `localeDefinitions` —
14
- * `i18n.interface.localeDefinitions` for the admin switcher, or
14
+ * `i18n.admin.localeDefinitions` for the admin switcher, or
15
15
  * `i18n.content.localeDefinitions` when a host frontend resolves
16
16
  * content-locale labels (matched by code). Wins outright — this is
17
17
  * the path that lets a host author write `Français` instead of the
@@ -1,17 +1,17 @@
1
1
  import { getRequestHeader } from "@tanstack/react-start/server";
2
2
  import { AuthError, AuthErrorCodes } from "@byline/auth";
3
3
  import { getAdminRequestContext } from "@byline/client/server";
4
- import { resolveInterfaceLocale } from "@byline/i18n";
4
+ import { resolveAdminLocale } from "@byline/i18n";
5
5
  import { bylineCore } from "../integrations/byline-core.js";
6
6
  import { readAdminLocaleCookie } from "./locale-cookie.js";
7
7
  async function resolveRequestLocale(options) {
8
8
  const core = bylineCore();
9
- const { interface: ifaceConfig } = core.config.i18n;
9
+ const { admin: adminConfig } = core.config.i18n;
10
10
  let preferred = null;
11
11
  if (!options?.skipActorLookup) preferred = await readPreferredLocaleFromActor();
12
- return resolveInterfaceLocale({
13
- locales: ifaceConfig.locales,
14
- defaultLocale: ifaceConfig.defaultLocale,
12
+ return resolveAdminLocale({
13
+ locales: adminConfig.locales,
14
+ defaultLocale: adminConfig.defaultLocale,
15
15
  preferred,
16
16
  cookie: readAdminLocaleCookie(),
17
17
  acceptLanguage: readAcceptLanguage()
@@ -3,13 +3,13 @@ import { bylineCore } from "../integrations/byline-core.js";
3
3
  import { resolveRequestLocale } from "./resolve-locale.js";
4
4
  async function resolveServerTranslator(namespace) {
5
5
  const core = bylineCore();
6
- const { interface: ifaceConfig, translations: bundle } = core.config.i18n;
6
+ const { admin: adminConfig, translations: bundle } = core.config.i18n;
7
7
  if (null == bundle) throw new Error("[resolveServerTranslator] no translation bundle is registered. Pass `translations: adminTranslations({ en: true })` (or a merged bundle) on `i18n` in your config.");
8
8
  const activeLocale = await resolveRequestLocale();
9
9
  const formatter = createFormatter({
10
10
  bundle,
11
11
  activeLocale,
12
- defaultLocale: ifaceConfig.defaultLocale
12
+ defaultLocale: adminConfig.defaultLocale
13
13
  });
14
14
  return {
15
15
  t: (key, values)=>formatter.t(namespace, key, values),
@@ -4,7 +4,7 @@ import { createAdminRole, updateAdminRole } from "../server-fns/admin-roles/inde
4
4
  import { createAdminUser, setAdminUserPassword, setUserRoles, updateAdminUser } from "../server-fns/admin-users/index.js";
5
5
  import { adminSignIn } from "../server-fns/auth/index.js";
6
6
  import { getCollectionDocumentVersion } from "../server-fns/collections/get.js";
7
- import { setInterfaceLocaleFn } from "../server-fns/i18n/index.js";
7
+ import { setAdminLocaleFn } from "../server-fns/i18n/index.js";
8
8
  const byline_admin_services_getCollectionDocumentVersion = async (collection, documentId, versionId, locale)=>{
9
9
  const result = await getCollectionDocumentVersion(collection, documentId, versionId, locale);
10
10
  if (null == result) throw new Error(`Document version not found: collection=${collection} document=${documentId} version=${versionId}`);
@@ -14,7 +14,7 @@ const bylineAdminServices = {
14
14
  adminSignIn: adminSignIn,
15
15
  updateAccount: updateAccount,
16
16
  changeAccountPassword: changeAccountPassword,
17
- setInterfaceLocale: setInterfaceLocaleFn,
17
+ setAdminLocale: setAdminLocaleFn,
18
18
  createAdminUser: createAdminUser,
19
19
  updateAdminUser: updateAdminUser,
20
20
  setAdminUserPassword: setAdminUserPassword,
@@ -1,6 +1,6 @@
1
- import { getClientConfig, normalizeRootRelativeRedirect } from "@byline/core";
1
+ import { getAdminConfig, normalizeRootRelativeRedirect } from "@byline/core";
2
2
  function getAdminRoutePath(...segments) {
3
- const configuredBase = getClientConfig().routes.admin;
3
+ const configuredBase = getAdminConfig().routes.admin;
4
4
  const normalizedBase = configuredBase.replace(/^\/+|\/+$/g, '');
5
5
  const base = normalizedBase ? `/${normalizedBase}` : '/';
6
6
  const suffix = segments.map((segment)=>String(segment).replace(/^\/+|\/+$/g, '')).filter(Boolean).join('/');
@@ -1,6 +1,6 @@
1
1
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
2
  import { createFileRoute } from "@tanstack/react-router";
3
- import { getClientConfig } from "@byline/core";
3
+ import { getAdminConfig } from "@byline/core";
4
4
  import { useTranslation } from "@byline/i18n/react";
5
5
  import { BreadcrumbsClient } from "../admin-shell/chrome/breadcrumbs/breadcrumbs-client.js";
6
6
  import { AdminDashboard } from "../admin-shell/chrome/dashboard.js";
@@ -9,7 +9,7 @@ import { getAdminRoutePath } from "./admin-path.js";
9
9
  function createAdminDashboardRoute(path) {
10
10
  const Route = createFileRoute(path)({
11
11
  loader: async ()=>{
12
- const { collections } = getClientConfig();
12
+ const { collections } = getAdminConfig();
13
13
  const statsMap = {};
14
14
  await Promise.all(collections.filter((c)=>true === c.showStats).map(async (c)=>{
15
15
  try {
@@ -5,9 +5,4 @@
5
5
  *
6
6
  * Copyright (c) Infonomic Company Limited
7
7
  */
8
- interface AdminLayoutOpts {
9
- /** @deprecated Configure `routes.signIn`; an override must resolve to the same path. */
10
- signInPath?: string;
11
- }
12
- export declare function createAdminLayoutRoute(path: string, opts?: AdminLayoutOpts): any;
13
- export {};
8
+ export declare function createAdminLayoutRoute(path: string): any;
@@ -4,7 +4,7 @@ import { Outlet, createFileRoute, redirect } from "@tanstack/react-router";
4
4
  import { applyStoredTheme } from "@byline/admin/admin-account/components/theme";
5
5
  import { BylineFieldServicesProvider } from "@byline/admin/react";
6
6
  import { BylineAdminServicesProvider } from "@byline/admin/services";
7
- import { getClientConfig } from "@byline/core";
7
+ import { getAdminConfig } from "@byline/core";
8
8
  import { I18nProvider } from "@byline/i18n/react";
9
9
  import clsx from "clsx";
10
10
  import { AdminAppBar } from "../admin-shell/chrome/admin-app-bar.js";
@@ -19,13 +19,12 @@ import { bylineAdminServices } from "../integrations/byline-admin-services.js";
19
19
  import { BylineAiAdminProvider } from "../integrations/byline-ai.js";
20
20
  import { bylineFieldServices } from "../integrations/byline-field-services.js";
21
21
  import { getCurrentAdminUser } from "../server-fns/auth/index.js";
22
- import { getActiveLocaleFn, setInterfaceLocaleFn } from "../server-fns/i18n/index.js";
23
- import { createSignInRoutePathResolver } from "./sign-in-path.js";
24
- function createAdminLayoutRoute(path, opts = {}) {
25
- const resolveSignInPath = createSignInRoutePathResolver(opts.signInPath);
22
+ import { getActiveLocaleFn, setAdminLocaleFn } from "../server-fns/i18n/index.js";
23
+ import { getSignInRoutePath } from "./sign-in-path.js";
24
+ function createAdminLayoutRoute(path) {
26
25
  const Route = createFileRoute(path)({
27
26
  beforeLoad: async ({ location })=>{
28
- const signInPath = resolveSignInPath();
27
+ const signInPath = getSignInRoutePath();
29
28
  try {
30
29
  const user = await getCurrentAdminUser();
31
30
  const activeLocale = await getActiveLocaleFn();
@@ -44,13 +43,13 @@ function createAdminLayoutRoute(path, opts = {}) {
44
43
  },
45
44
  component: function() {
46
45
  const { user, activeLocale } = Route.useRouteContext();
47
- const { i18n } = getClientConfig();
48
- const localeDefinitions = buildLocaleDefinitions(i18n.interface.locales, i18n.interface.localeDefinitions);
46
+ const { i18n } = getAdminConfig();
47
+ const localeDefinitions = buildLocaleDefinitions(i18n.admin.locales, i18n.admin.localeDefinitions);
49
48
  useEffect(()=>{
50
49
  applyStoredTheme();
51
50
  }, []);
52
51
  const handleSetLocale = async (next)=>{
53
- await setInterfaceLocaleFn({
52
+ await setAdminLocaleFn({
54
53
  data: {
55
54
  locale: next
56
55
  }
@@ -60,7 +59,7 @@ function createAdminLayoutRoute(path, opts = {}) {
60
59
  return /*#__PURE__*/ jsx(I18nProvider, {
61
60
  bundle: i18n.translations ?? {},
62
61
  activeLocale: activeLocale,
63
- defaultLocale: i18n.interface.defaultLocale,
62
+ defaultLocale: i18n.admin.defaultLocale,
64
63
  localeDefinitions: localeDefinitions,
65
64
  setLocale: handleSetLocale,
66
65
  children: /*#__PURE__*/ jsx(BylineAdminServicesProvider, {
@@ -5,4 +5,12 @@
5
5
  *
6
6
  * Copyright (c) Infonomic Company Limited
7
7
  */
8
- export declare function createSignInRoute(path: string): any;
8
+ export interface CreateSignInRouteOptions {
9
+ /**
10
+ * Client-safe URL for the sign-in page's Home link. Defaults to `/`, which
11
+ * preserves the link for integrated hosts without requiring an absolute site
12
+ * origin. Pass an absolute URL when the public home is on another origin.
13
+ */
14
+ homeUrl?: string;
15
+ }
16
+ export declare function createSignInRoute(path: string, { homeUrl }?: CreateSignInRouteOptions): any;
@@ -3,7 +3,9 @@ import { createFileRoute } from "@tanstack/react-router";
3
3
  import { SignInPage } from "../admin-shell/chrome/sign-in-page.js";
4
4
  import { getActiveLocaleFn } from "../server-fns/i18n/index.js";
5
5
  import { resolveAdminCallbackPath, resolveAdminSignInRedirect } from "./admin-path.js";
6
- function createSignInRoute(path) {
6
+ import { resolveSignInHomeUrl } from "./sign-in-home-url.js";
7
+ function createSignInRoute(path, { homeUrl } = {}) {
8
+ const resolvedHomeUrl = resolveSignInHomeUrl(homeUrl);
7
9
  const Route = createFileRoute(path)({
8
10
  validateSearch: (search)=>{
9
11
  const callbackUrl = resolveAdminCallbackPath(search.callbackUrl);
@@ -22,7 +24,8 @@ function createSignInRoute(path) {
22
24
  const { activeLocale } = Route.useRouteContext();
23
25
  return /*#__PURE__*/ jsx(SignInPage, {
24
26
  redirectTo: resolveAdminSignInRedirect(callbackUrl),
25
- activeLocale: activeLocale
27
+ activeLocale: activeLocale,
28
+ homeUrl: resolvedHomeUrl
26
29
  });
27
30
  }
28
31
  });
@@ -1,6 +1,6 @@
1
- import { getClientConfig } from "@byline/core";
1
+ import { getAdminConfig } from "@byline/core";
2
2
  function getContentLocaleRouteConfig() {
3
- const content = getClientConfig().i18n.content;
3
+ const content = getAdminConfig().i18n.content;
4
4
  const labels = new Map(content.localeDefinitions?.map(({ code, nativeName })=>[
5
5
  code,
6
6
  nativeName
@@ -6,7 +6,7 @@
6
6
  * Copyright (c) Infonomic Company Limited
7
7
  */
8
8
  export { getAdminRouteId, getAdminRoutePath, isAdminRoutePathActive, isRoutePathWithin, resolveAdminCallbackPath, resolveAdminSignInRedirect, } from './admin-path.js';
9
- export { configureSignInRoutePath, getSignInRoutePath } from './sign-in-path.js';
9
+ export { getSignInRoutePath } from './sign-in-path.js';
10
10
  /**
11
11
  * Route factories for the Byline admin UI on TanStack Start.
12
12
  *
@@ -35,4 +35,4 @@ export { createCollectionCreateRoute } from './create-collection-create-route.js
35
35
  export { createCollectionEditRoute } from './create-collection-edit-route.js';
36
36
  export { createCollectionHistoryRoute } from './create-collection-history-route.js';
37
37
  export { createCollectionListRoute } from './create-collection-list-route.js';
38
- export { createSignInRoute } from './create-sign-in-route.js';
38
+ export { type CreateSignInRouteOptions, createSignInRoute, } from './create-sign-in-route.js';
@@ -1,5 +1,5 @@
1
1
  export { getAdminRouteId, getAdminRoutePath, isAdminRoutePathActive, isRoutePathWithin, resolveAdminCallbackPath, resolveAdminSignInRedirect } from "./admin-path.js";
2
- export { configureSignInRoutePath, getSignInRoutePath } from "./sign-in-path.js";
2
+ export { getSignInRoutePath } from "./sign-in-path.js";
3
3
  export { createAdminAccountRoute } from "./create-admin-account-route.js";
4
4
  export { createAdminActivityRoute } from "./create-admin-activity-route.js";
5
5
  export { createAdminDashboardRoute } from "./create-admin-dashboard-route.js";
@@ -0,0 +1,9 @@
1
+ /**
2
+ * This Source Code is subject to the terms of the Mozilla Public
3
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
4
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
5
+ *
6
+ * Copyright (c) Infonomic Company Limited
7
+ */
8
+ /** Resolve the sign-in Home link without requiring a configured site origin. */
9
+ export declare function resolveSignInHomeUrl(homeUrl: string | undefined): string;
@@ -0,0 +1,4 @@
1
+ function resolveSignInHomeUrl(homeUrl) {
2
+ return homeUrl ?? '/';
3
+ }
4
+ export { resolveSignInHomeUrl };
@@ -7,7 +7,3 @@
7
7
  */
8
8
  /** Read the canonical client-safe sign-in destination. */
9
9
  export declare function getSignInRoutePath(): string;
10
- /** @deprecated Configure `routes.signIn`; retained for route-factory input validation. */
11
- export declare function configureSignInRoutePath(legacyOverride?: string): string;
12
- /** Defer deprecated override validation until the admin route's beforeLoad boundary. */
13
- export declare function createSignInRoutePathResolver(legacyOverride?: string): () => string;
@@ -1,19 +1,5 @@
1
- import { getClientConfig, resolveRoutes } from "@byline/core";
1
+ import { getAdminConfig } from "@byline/core";
2
2
  function getSignInRoutePath() {
3
- return getClientConfig().routes.signIn;
3
+ return getAdminConfig().routes.signIn;
4
4
  }
5
- function configureSignInRoutePath(legacyOverride) {
6
- const routes = getClientConfig().routes;
7
- const configured = routes.signIn;
8
- if (void 0 === legacyOverride) return configured;
9
- const normalizedOverride = resolveRoutes({
10
- ...routes,
11
- signIn: legacyOverride
12
- }).signIn;
13
- if (normalizedOverride !== configured) throw new Error(`createAdminLayoutRoute signInPath (${normalizedOverride}) must match routes.signIn (${configured})`);
14
- return configured;
15
- }
16
- function createSignInRoutePathResolver(legacyOverride) {
17
- return void 0 === legacyOverride ? getSignInRoutePath : ()=>configureSignInRoutePath(legacyOverride);
18
- }
19
- export { configureSignInRoutePath, createSignInRoutePathResolver, getSignInRoutePath };
5
+ export { getSignInRoutePath };
@@ -37,7 +37,7 @@ async function reconcileLocaleAfterSignIn(adminUserId) {
37
37
  const cookieLocale = readAdminLocaleCookie();
38
38
  if (null == cookieLocale) return;
39
39
  const core = bylineCore();
40
- const locales = core.config.i18n.interface.locales;
40
+ const locales = core.config.i18n.admin.locales;
41
41
  if (!locales.includes(cookieLocale)) return;
42
42
  const adminStore = core.adminStore;
43
43
  if (null == adminStore) return;
@@ -6,5 +6,5 @@
6
6
  * Copyright (c) Infonomic Company Limited
7
7
  */
8
8
  export { getActiveLocaleFn } from './get-active-locale.js';
9
- export { setInterfaceLocaleFn } from './set-locale.js';
10
- export type { SetInterfaceLocaleInput, SetInterfaceLocaleResult } from './set-locale.js';
9
+ export { setAdminLocaleFn } from './set-locale.js';
10
+ export type { SetAdminLocaleInput, SetAdminLocaleResult } from './set-locale.js';
@@ -1,2 +1,2 @@
1
1
  export { getActiveLocaleFn } from "./get-active-locale.js";
2
- export { setInterfaceLocaleFn } from "./set-locale.js";
2
+ export { setAdminLocaleFn } from "./set-locale.js";
@@ -6,11 +6,11 @@
6
6
  * Copyright (c) Infonomic Company Limited
7
7
  */
8
8
  import type { AccountResponse } from '@byline/admin/admin-account';
9
- export interface SetInterfaceLocaleInput {
9
+ export interface SetAdminLocaleInput {
10
10
  /** BCP 47 tag, or `null` to clear the preference. */
11
11
  locale: string | null;
12
12
  }
13
- export interface SetInterfaceLocaleResult {
13
+ export interface SetAdminLocaleResult {
14
14
  ok: true;
15
15
  /** Echo of the persisted value. `null` means the column was cleared. */
16
16
  locale: string | null;
@@ -22,4 +22,4 @@ export interface SetInterfaceLocaleResult {
22
22
  */
23
23
  account: AccountResponse | null;
24
24
  }
25
- export declare const setInterfaceLocaleFn: import("@tanstack/react-start").RequiredFetcher<undefined, (input: SetInterfaceLocaleInput) => SetInterfaceLocaleInput, Promise<SetInterfaceLocaleResult>>;
25
+ export declare const setAdminLocaleFn: import("@tanstack/react-start").RequiredFetcher<undefined, (input: SetAdminLocaleInput) => SetAdminLocaleInput, Promise<SetAdminLocaleResult>>;
@@ -4,12 +4,12 @@ import { AuthError, AuthErrorCodes } from "@byline/auth";
4
4
  import { getAdminRequestContext } from "@byline/client/server";
5
5
  import { clearAdminLocaleCookie, setAdminLocaleCookie } from "../../i18n/locale-cookie.js";
6
6
  import { bylineCore } from "../../integrations/byline-core.js";
7
- const setInterfaceLocaleFn = createServerFn({
7
+ const setAdminLocaleFn = createServerFn({
8
8
  method: 'POST'
9
9
  }).validator((input)=>input).handler(async ({ data })=>{
10
10
  const core = bylineCore();
11
- const locales = core.config.i18n.interface.locales;
12
- if (null != data.locale && !locales.includes(data.locale)) throw new Error(`[setInterfaceLocaleFn] locale '${data.locale}' is not in i18n.interface.locales [${locales.join(', ')}].`);
11
+ const locales = core.config.i18n.admin.locales;
12
+ if (null != data.locale && !locales.includes(data.locale)) throw new Error(`[setAdminLocaleFn] locale '${data.locale}' is not in i18n.admin.locales [${locales.join(', ')}].`);
13
13
  if (null == data.locale) clearAdminLocaleCookie();
14
14
  else setAdminLocaleCookie(data.locale);
15
15
  const adminStore = core.adminStore;
@@ -39,4 +39,4 @@ const setInterfaceLocaleFn = createServerFn({
39
39
  throw err;
40
40
  }
41
41
  });
42
- export { setInterfaceLocaleFn };
42
+ export { setAdminLocaleFn };
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "private": false,
4
4
  "type": "module",
5
5
  "license": "MPL-2.0",
6
- "version": "4.11.1",
6
+ "version": "4.12.0",
7
7
  "engines": {
8
8
  "node": ">=20.9.0"
9
9
  },
@@ -117,13 +117,13 @@
117
117
  "react-json-view-lite": "^2.5.0",
118
118
  "react-swipeable": "^7.0.2",
119
119
  "zod": "^4.4.3",
120
- "@byline/ai": "4.11.1",
121
- "@byline/core": "4.11.1",
122
- "@byline/i18n": "4.11.1",
123
- "@byline/client": "4.11.1",
124
- "@byline/auth": "4.11.1",
125
- "@byline/ui": "4.11.1",
126
- "@byline/admin": "4.11.1"
120
+ "@byline/ai": "4.12.0",
121
+ "@byline/client": "4.12.0",
122
+ "@byline/auth": "4.12.0",
123
+ "@byline/admin": "4.12.0",
124
+ "@byline/core": "4.12.0",
125
+ "@byline/ui": "4.12.0",
126
+ "@byline/i18n": "4.12.0"
127
127
  },
128
128
  "peerDependencies": {
129
129
  "@tanstack/react-router": "^1.167.0",
@@ -133,22 +133,22 @@
133
133
  "vite": "^8.0.0"
134
134
  },
135
135
  "devDependencies": {
136
- "@biomejs/biome": "2.5.4",
136
+ "@biomejs/biome": "2.5.6",
137
137
  "@rsbuild/plugin-react": "^2.1.0",
138
138
  "@rslib/core": "^0.23.2",
139
139
  "@tanstack/react-router": "^1.170.18",
140
- "@tanstack/react-start": "^1.168.28",
141
- "@types/node": "^26.1.1",
142
- "@types/react": "19.2.17",
143
- "@types/react-dom": "19.2.3",
144
- "lightningcss": "^1.32.0",
140
+ "@tanstack/react-start": "^1.168.34",
141
+ "@types/node": "^26.1.2",
142
+ "@types/react": "19.2.18",
143
+ "@types/react-dom": "19.2.4",
144
+ "lightningcss": "^1.33.0",
145
145
  "npm-run-all": "^4.1.5",
146
- "react": "^19.2.7",
147
- "react-dom": "^19.2.7",
146
+ "react": "^19.2.8",
147
+ "react-dom": "^19.2.8",
148
148
  "rimraf": "^6.1.3",
149
149
  "typescript": "^7.0.2",
150
150
  "typescript-plugin-css-modules": "^5.2.0",
151
- "vite": "^8.1.5",
151
+ "vite": "^8.2.0",
152
152
  "vitest": "^4.1.10"
153
153
  },
154
154
  "publishConfig": {
@@ -10,7 +10,7 @@
10
10
 
11
11
  import { useRouterState } from '@tanstack/react-router'
12
12
 
13
- import { getClientConfig } from '@byline/core'
13
+ import { getAdminConfig } from '@byline/core'
14
14
  import { useTranslation } from '@byline/i18n/react'
15
15
  import { Button, Container, Section, Select, Table } from '@byline/ui/react'
16
16
  import cx from 'clsx'
@@ -79,7 +79,7 @@ export const ActivitySystemView = ({ data }: { data: SystemActivityResponse }) =
79
79
  }
80
80
 
81
81
  const entries = data?.entries ?? []
82
- const collections = getClientConfig().collections
82
+ const collections = getAdminConfig().collections
83
83
 
84
84
  // Navigate with the changed filter merged into the URL search; clearing the
85
85
  // page so a filter change always lands on page 1. `_all` removes the filter.
@@ -7,7 +7,7 @@
7
7
  */
8
8
 
9
9
  import type { WorkflowStatus } from '@byline/core'
10
- import { getClientConfig, getWorkflowStatuses } from '@byline/core'
10
+ import { getAdminConfig, getWorkflowStatuses } from '@byline/core'
11
11
  import { useTranslation } from '@byline/i18n/react'
12
12
  import { Card, Container, Section } from '@byline/ui/react'
13
13
  import cx from 'clsx'
@@ -63,7 +63,7 @@ interface AdminDashboardProps {
63
63
  }
64
64
 
65
65
  export function AdminDashboard({ statsMap }: AdminDashboardProps) {
66
- const config = getClientConfig()
66
+ const config = getAdminConfig()
67
67
  const { t } = useTranslation('byline-admin')
68
68
 
69
69
  return (
@@ -24,7 +24,7 @@ import { type ReactNode, useContext } from 'react'
24
24
  import type { ErrorComponentProps, NotFoundRouteProps } from '@tanstack/react-router'
25
25
  import { useRouter } from '@tanstack/react-router'
26
26
 
27
- import { BylineError, ErrorCodes, getClientConfig } from '@byline/core'
27
+ import { BylineError, ErrorCodes, getAdminConfig } from '@byline/core'
28
28
  import type { TranslationBundle } from '@byline/i18n'
29
29
  import type { UseTranslationReturn } from '@byline/i18n/react'
30
30
  import { I18nContext, I18nProvider, useTranslation } from '@byline/i18n/react'
@@ -76,7 +76,7 @@ function getErrorMessage(error: unknown, t: Translate): string {
76
76
  * Only when none is present (the error-boundary case) does it self-mount.
77
77
  *
78
78
  * Resilient by design (an error component that throws masks the real error):
79
- * if the client config can't be read, it falls back to an English-default
79
+ * if the admin config can't be read, it falls back to an English-default
80
80
  * provider with an empty bundle. With a provider always present,
81
81
  * `useTranslation` never throws; a missing key then renders as the raw key
82
82
  * rather than crashing (see `I18nProvider`'s `onMissing`).
@@ -90,11 +90,11 @@ function ErrorScreenI18nProvider({ children }: { children: ReactNode }) {
90
90
  let bundle: TranslationBundle = {}
91
91
  let locale = 'en'
92
92
  try {
93
- const { i18n } = getClientConfig()
93
+ const { i18n } = getAdminConfig()
94
94
  bundle = i18n.translations ?? {}
95
95
  // No active provider, so render in the default locale — recovering the
96
96
  // per-user active locale isn't worth another lookup that could itself throw.
97
- locale = i18n.interface.defaultLocale
97
+ locale = i18n.admin.defaultLocale
98
98
  } catch {
99
99
  // Config unavailable (very early boot / broken provider chain) — fall
100
100
  // through with the English defaults above.