@byline/host-tanstack-start 3.13.2 → 3.14.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.
@@ -1,5 +1,7 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { useEffect } from "react";
2
3
  import { Outlet, createFileRoute, redirect } from "@tanstack/react-router";
4
+ import { applyStoredTheme } from "@byline/admin/admin-account/components/theme";
3
5
  import { BylineFieldServicesProvider } from "@byline/admin/react";
4
6
  import { BylineAdminServicesProvider } from "@byline/admin/services";
5
7
  import { getClientConfig } from "@byline/core";
@@ -42,6 +44,9 @@ function createAdminLayoutRoute(path, opts = {}) {
42
44
  const { user, activeLocale } = Route.useRouteContext();
43
45
  const { i18n } = getClientConfig();
44
46
  const localeDefinitions = buildLocaleDefinitions(i18n.interface.locales, i18n.interface.localeDefinitions);
47
+ useEffect(()=>{
48
+ applyStoredTheme();
49
+ }, []);
45
50
  const handleSetLocale = async (next)=>{
46
51
  await setInterfaceLocaleFn({
47
52
  data: {
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "private": false,
4
4
  "type": "module",
5
5
  "license": "MPL-2.0",
6
- "version": "3.13.2",
6
+ "version": "3.14.0",
7
7
  "engines": {
8
8
  "node": ">=20.9.0"
9
9
  },
@@ -119,13 +119,13 @@
119
119
  "react-swipeable": "^7.0.2",
120
120
  "uuid": "^14.0.0",
121
121
  "zod": "^4.4.3",
122
- "@byline/auth": "3.13.2",
123
- "@byline/core": "3.13.2",
124
- "@byline/i18n": "3.13.2",
125
- "@byline/ui": "3.13.2",
126
- "@byline/ai": "3.13.2",
127
- "@byline/admin": "3.13.2",
128
- "@byline/client": "3.13.2"
122
+ "@byline/admin": "3.14.0",
123
+ "@byline/ai": "3.14.0",
124
+ "@byline/auth": "3.14.0",
125
+ "@byline/client": "3.14.0",
126
+ "@byline/i18n": "3.14.0",
127
+ "@byline/core": "3.14.0",
128
+ "@byline/ui": "3.14.0"
129
129
  },
130
130
  "peerDependencies": {
131
131
  "@tanstack/react-router": "^1.167.0",
@@ -19,8 +19,10 @@
19
19
  * route (and the `AdminAppBar`) can read it without an extra fetch.
20
20
  */
21
21
 
22
+ import { useEffect } from 'react'
22
23
  import { createFileRoute, Outlet, redirect } from '@tanstack/react-router'
23
24
 
25
+ import { applyStoredTheme } from '@byline/admin/admin-account/components/theme'
24
26
  import { BylineFieldServicesProvider } from '@byline/admin/react'
25
27
  import { BylineAdminServicesProvider } from '@byline/admin/services'
26
28
  import { getClientConfig } from '@byline/core'
@@ -84,6 +86,13 @@ export function createAdminLayoutRoute(path: string, opts: AdminLayoutOpts = {})
84
86
  i18n.interface.locales,
85
87
  i18n.interface.localeDefinitions
86
88
  )
89
+ // Re-assert the admin user's stored theme when the shell mounts.
90
+ // Byline shares the host's theme contract, but a host theme provider
91
+ // can clobber the stored choice on navigation; this makes the admin
92
+ // area self-correcting regardless of how the host manages theme.
93
+ useEffect(() => {
94
+ applyStoredTheme()
95
+ }, [])
87
96
  // Cookie + DB write happen in setInterfaceLocaleFn; full reload
88
97
  // re-runs beforeLoad so the provider re-renders with the new
89
98
  // bundle/locale (no in-place bundle swap needed for PR 1's scope).