@donotdev/ui 0.1.46 → 0.1.47
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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DnDevLayout.d.ts","sourceRoot":"","sources":["../../../src/internal/layout/DnDevLayout.tsx"],"names":[],"mappings":"AAGA;;;;;;;;GAQG;AAEH,OAAO,EAQL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAGf,OAAO,KAAK,EAIV,YAAY,EACb,MAAM,gBAAgB,CAAC;AA0CxB,UAAU,yBAAyB;IACjC,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,WAAW,GAAI,kCAIzB,yBAAyB,
|
|
1
|
+
{"version":3,"file":"DnDevLayout.d.ts","sourceRoot":"","sources":["../../../src/internal/layout/DnDevLayout.tsx"],"names":[],"mappings":"AAGA;;;;;;;;GAQG;AAEH,OAAO,EAQL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAGf,OAAO,KAAK,EAIV,YAAY,EACb,MAAM,gBAAgB,CAAC;AA0CxB,UAAU,yBAAyB;IACjC,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,WAAW,GAAI,kCAIzB,yBAAyB,gCAyZ3B,CAAC"}
|
|
@@ -64,7 +64,7 @@ export const DnDevLayout = ({ children, layout, className, }) => {
|
|
|
64
64
|
const preset = useLayout('layoutPreset');
|
|
65
65
|
const routePresetOverride = useLayout('routePresetOverride');
|
|
66
66
|
const isMobile = useBreakpoint('isMobileOrTablet');
|
|
67
|
-
const { app, features, customPresets } = useAppConfig();
|
|
67
|
+
const { app, features, customPresets, preset: configPreset } = useAppConfig();
|
|
68
68
|
const debugEnabled = isDev() && features?.debug === true;
|
|
69
69
|
// Subscribe to language changes for zone re-renders
|
|
70
70
|
useTranslation('dndev');
|
|
@@ -83,10 +83,17 @@ export const DnDevLayout = ({ children, layout, className, }) => {
|
|
|
83
83
|
return presetRegistry;
|
|
84
84
|
return { ...presetRegistry, ...customPresets };
|
|
85
85
|
}, [customPresets]);
|
|
86
|
-
// Effective preset: route override >
|
|
86
|
+
// Effective preset: route override > store > appConfig > fallback.
|
|
87
|
+
// appConfig sits between the store and the fallback on purpose: the store starts
|
|
88
|
+
// at `layoutPreset: null` and only receives appConfig.preset from themeStore's
|
|
89
|
+
// async initialize() (a post-hydration effect). Falling straight through to
|
|
90
|
+
// 'landing' made SSR and the first client paint render the landing chrome for
|
|
91
|
+
// every non-landing app, then swap it out on hydration — a visible flash.
|
|
92
|
+
// appConfig is available synchronously on both server and client, so reading it
|
|
93
|
+
// here makes the first paint already correct; the later store init is a no-op.
|
|
87
94
|
const effectivePreset = useMemo(() => {
|
|
88
|
-
return routePresetOverride || preset || 'landing';
|
|
89
|
-
}, [routePresetOverride, preset]);
|
|
95
|
+
return routePresetOverride || preset || configPreset || 'landing';
|
|
96
|
+
}, [routePresetOverride, preset, configPreset]);
|
|
90
97
|
// Get preset config (presets only override what's different, defaults fill the rest)
|
|
91
98
|
const config = useMemo(() => {
|
|
92
99
|
const presetConfig = (effectiveRegistry[effectivePreset] ??
|