@constela/start 1.2.26 → 1.2.28
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.
|
@@ -2131,7 +2131,11 @@ async function createDevServer(options = {}) {
|
|
|
2131
2131
|
"monaco-editor": "/node_modules/monaco-editor/esm/vs/editor/editor.api.js"
|
|
2132
2132
|
};
|
|
2133
2133
|
const html = wrapHtml(content, hydrationScript, cssHead, {
|
|
2134
|
-
...initialTheme ? {
|
|
2134
|
+
...initialTheme ? {
|
|
2135
|
+
theme: initialTheme,
|
|
2136
|
+
defaultTheme: initialTheme,
|
|
2137
|
+
themeStorageKey: "theme"
|
|
2138
|
+
} : {},
|
|
2135
2139
|
importMap
|
|
2136
2140
|
});
|
|
2137
2141
|
res.writeHead(200, { "Content-Type": "text/html; charset=utf-8" });
|
package/dist/cli/index.js
CHANGED
package/dist/index.js
CHANGED
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
transformCsv,
|
|
24
24
|
transformMdx,
|
|
25
25
|
transformYaml
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-HMNS6TTL.js";
|
|
27
27
|
import {
|
|
28
28
|
generateHydrationScript,
|
|
29
29
|
renderPage,
|
|
@@ -317,7 +317,13 @@ function createAdapter(options) {
|
|
|
317
317
|
path: url.pathname
|
|
318
318
|
};
|
|
319
319
|
const hydrationScript = generateHydrationScript(program, void 0, routeContext);
|
|
320
|
-
const
|
|
320
|
+
const themeState = program.state?.["theme"];
|
|
321
|
+
const initialTheme = themeState?.initial;
|
|
322
|
+
const html = wrapHtml(content, hydrationScript, void 0, initialTheme ? {
|
|
323
|
+
theme: initialTheme,
|
|
324
|
+
defaultTheme: initialTheme,
|
|
325
|
+
themeStorageKey: "theme"
|
|
326
|
+
} : void 0);
|
|
321
327
|
return new Response(html, {
|
|
322
328
|
status: 200,
|
|
323
329
|
headers: { "Content-Type": "text/html; charset=utf-8" }
|
|
@@ -32,6 +32,21 @@ function initClient(options) {
|
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
34
|
if (program.state?.["theme"]) {
|
|
35
|
+
try {
|
|
36
|
+
const stored = localStorage.getItem("theme");
|
|
37
|
+
if (stored) {
|
|
38
|
+
let storedTheme = stored;
|
|
39
|
+
try {
|
|
40
|
+
storedTheme = JSON.parse(stored);
|
|
41
|
+
} catch {
|
|
42
|
+
}
|
|
43
|
+
const currentTheme2 = appInstance.getState?.("theme");
|
|
44
|
+
if (storedTheme && storedTheme !== currentTheme2) {
|
|
45
|
+
appInstance.setState?.("theme", storedTheme);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
} catch {
|
|
49
|
+
}
|
|
35
50
|
const updateThemeClass = (value) => {
|
|
36
51
|
if (value === "dark") {
|
|
37
52
|
document.documentElement.classList.add("dark");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@constela/start",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.28",
|
|
4
4
|
"description": "Meta-framework for Constela applications",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -45,9 +45,9 @@
|
|
|
45
45
|
"tailwindcss": "^4.0.0",
|
|
46
46
|
"@constela/compiler": "0.8.0",
|
|
47
47
|
"@constela/core": "0.8.0",
|
|
48
|
+
"@constela/router": "9.0.0",
|
|
48
49
|
"@constela/server": "4.1.0",
|
|
49
|
-
"@constela/runtime": "0.11.0"
|
|
50
|
-
"@constela/router": "9.0.0"
|
|
50
|
+
"@constela/runtime": "0.11.0"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@types/mdast": "^4.0.4",
|