@jant/core 0.2.17 → 0.2.19
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.
- package/dist/app.d.ts +1 -0
- package/dist/app.d.ts.map +1 -1
- package/dist/app.js +307 -137
- package/dist/client.js +1 -0
- package/dist/i18n/context.d.ts +2 -2
- package/dist/i18n/context.js +1 -1
- package/dist/i18n/i18n.d.ts +1 -1
- package/dist/i18n/i18n.js +1 -1
- package/dist/i18n/index.d.ts +1 -1
- package/dist/i18n/index.js +1 -1
- package/dist/i18n/locales/en.d.ts.map +1 -1
- package/dist/i18n/locales/en.js +1 -1
- package/dist/i18n/locales/zh-Hans.d.ts.map +1 -1
- package/dist/i18n/locales/zh-Hans.js +1 -1
- package/dist/i18n/locales/zh-Hant.d.ts.map +1 -1
- package/dist/i18n/locales/zh-Hant.js +1 -1
- package/dist/lib/config.d.ts +44 -10
- package/dist/lib/config.d.ts.map +1 -1
- package/dist/lib/config.js +69 -44
- package/dist/lib/constants.d.ts +2 -1
- package/dist/lib/constants.d.ts.map +1 -1
- package/dist/lib/constants.js +5 -2
- package/dist/lib/image-processor.js +0 -4
- package/dist/lib/media-upload.js +104 -0
- package/dist/lib/sse.d.ts +82 -13
- package/dist/lib/sse.d.ts.map +1 -1
- package/dist/lib/sse.js +115 -17
- package/dist/lib/theme.d.ts +44 -0
- package/dist/lib/theme.d.ts.map +1 -0
- package/dist/lib/theme.js +65 -0
- package/dist/routes/api/upload.js +16 -18
- package/dist/routes/dash/appearance.d.ts +13 -0
- package/dist/routes/dash/appearance.d.ts.map +1 -0
- package/dist/routes/dash/appearance.js +160 -0
- package/dist/routes/dash/collections.js +5 -13
- package/dist/routes/dash/media.js +17 -167
- package/dist/routes/dash/pages.js +4 -10
- package/dist/routes/dash/posts.js +4 -10
- package/dist/routes/dash/redirects.js +3 -7
- package/dist/routes/dash/settings.d.ts.map +1 -1
- package/dist/routes/dash/settings.js +52 -42
- package/dist/services/settings.d.ts +1 -0
- package/dist/services/settings.d.ts.map +1 -1
- package/dist/services/settings.js +3 -0
- package/dist/theme/color-themes.d.ts +30 -0
- package/dist/theme/color-themes.d.ts.map +1 -0
- package/dist/theme/color-themes.js +268 -0
- package/dist/theme/layouts/BaseLayout.d.ts +5 -0
- package/dist/theme/layouts/BaseLayout.d.ts.map +1 -1
- package/dist/theme/layouts/BaseLayout.js +70 -3
- package/dist/theme/layouts/DashLayout.d.ts +2 -0
- package/dist/theme/layouts/DashLayout.d.ts.map +1 -1
- package/dist/theme/layouts/DashLayout.js +11 -1
- package/dist/theme/layouts/index.d.ts +1 -1
- package/dist/theme/layouts/index.d.ts.map +1 -1
- package/dist/types.d.ts +53 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +52 -0
- package/package.json +1 -1
- package/src/app.tsx +260 -81
- package/src/client.ts +1 -0
- package/src/db/migrations/{0000_solid_moon_knight.sql → 0000_square_wallflower.sql} +3 -3
- package/src/db/migrations/meta/0000_snapshot.json +9 -9
- package/src/db/migrations/meta/_journal.json +2 -30
- package/src/i18n/context.tsx +2 -2
- package/src/i18n/i18n.ts +1 -1
- package/src/i18n/index.ts +1 -1
- package/src/i18n/locales/en.po +328 -252
- package/src/i18n/locales/en.ts +1 -1
- package/src/i18n/locales/zh-Hans.po +315 -278
- package/src/i18n/locales/zh-Hans.ts +1 -1
- package/src/i18n/locales/zh-Hant.po +315 -278
- package/src/i18n/locales/zh-Hant.ts +1 -1
- package/src/lib/config.ts +73 -47
- package/src/lib/constants.ts +3 -0
- package/src/lib/image-processor.ts +0 -7
- package/src/lib/media-upload.ts +148 -0
- package/src/lib/sse.ts +156 -16
- package/src/lib/theme.ts +86 -0
- package/src/preset.css +9 -0
- package/src/routes/api/upload.ts +12 -18
- package/src/routes/dash/appearance.tsx +176 -0
- package/src/routes/dash/collections.tsx +5 -13
- package/src/routes/dash/media.tsx +16 -165
- package/src/routes/dash/pages.tsx +4 -10
- package/src/routes/dash/posts.tsx +4 -10
- package/src/routes/dash/redirects.tsx +3 -7
- package/src/routes/dash/settings.tsx +71 -55
- package/src/services/settings.ts +5 -0
- package/src/styles/components.css +93 -0
- package/src/theme/color-themes.ts +321 -0
- package/src/theme/layouts/BaseLayout.tsx +61 -1
- package/src/theme/layouts/DashLayout.tsx +14 -3
- package/src/theme/layouts/index.ts +5 -1
- package/src/types.ts +62 -1
- package/src/db/migrations/0001_add_search_fts.sql +0 -40
- package/src/db/migrations/0002_collection_path.sql +0 -2
- package/src/db/migrations/0003_collection_path_nullable.sql +0 -21
- package/src/db/migrations/0004_media_uuid.sql +0 -35
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Built-in Color Themes
|
|
3
|
+
*
|
|
4
|
+
* Each theme defines CSS variable overrides for light and dark modes,
|
|
5
|
+
* plus preview colors for the theme picker UI.
|
|
6
|
+
*/ /**
|
|
7
|
+
* A color theme definition with light and dark mode CSS variable overrides.
|
|
8
|
+
*/ /**
|
|
9
|
+
* Create a comprehensive color theme from key colors.
|
|
10
|
+
* Derives card, popover, muted, secondary, accent, and sidebar variables.
|
|
11
|
+
*/ function defineTheme(opts) {
|
|
12
|
+
const { light, dark } = opts;
|
|
13
|
+
return {
|
|
14
|
+
id: opts.id,
|
|
15
|
+
name: opts.name,
|
|
16
|
+
preview: opts.preview,
|
|
17
|
+
light: {
|
|
18
|
+
"--background": light.bg,
|
|
19
|
+
"--foreground": light.fg,
|
|
20
|
+
"--card": light.bg,
|
|
21
|
+
"--card-foreground": light.fg,
|
|
22
|
+
"--popover": light.bg,
|
|
23
|
+
"--popover-foreground": light.fg,
|
|
24
|
+
"--primary": light.primary,
|
|
25
|
+
"--primary-foreground": light.primaryFg,
|
|
26
|
+
"--secondary": light.muted,
|
|
27
|
+
"--secondary-foreground": light.fg,
|
|
28
|
+
"--muted": light.muted,
|
|
29
|
+
"--muted-foreground": light.mutedFg,
|
|
30
|
+
"--accent": light.muted,
|
|
31
|
+
"--accent-foreground": light.fg,
|
|
32
|
+
"--border": light.border,
|
|
33
|
+
"--input": light.border,
|
|
34
|
+
"--ring": light.primary,
|
|
35
|
+
"--sidebar": light.bg,
|
|
36
|
+
"--sidebar-foreground": light.fg,
|
|
37
|
+
"--sidebar-primary": light.primary,
|
|
38
|
+
"--sidebar-primary-foreground": light.primaryFg,
|
|
39
|
+
"--sidebar-accent": light.muted,
|
|
40
|
+
"--sidebar-accent-foreground": light.fg,
|
|
41
|
+
"--sidebar-border": light.border,
|
|
42
|
+
"--sidebar-ring": light.primary
|
|
43
|
+
},
|
|
44
|
+
dark: {
|
|
45
|
+
"--background": dark.bg,
|
|
46
|
+
"--foreground": dark.fg,
|
|
47
|
+
"--card": dark.bg,
|
|
48
|
+
"--card-foreground": dark.fg,
|
|
49
|
+
"--popover": dark.bg,
|
|
50
|
+
"--popover-foreground": dark.fg,
|
|
51
|
+
"--primary": dark.primary,
|
|
52
|
+
"--primary-foreground": dark.primaryFg,
|
|
53
|
+
"--secondary": dark.muted,
|
|
54
|
+
"--secondary-foreground": dark.fg,
|
|
55
|
+
"--muted": dark.muted,
|
|
56
|
+
"--muted-foreground": dark.mutedFg,
|
|
57
|
+
"--accent": dark.muted,
|
|
58
|
+
"--accent-foreground": dark.fg,
|
|
59
|
+
"--border": dark.border,
|
|
60
|
+
"--input": dark.border,
|
|
61
|
+
"--ring": dark.primary,
|
|
62
|
+
"--sidebar": dark.bg,
|
|
63
|
+
"--sidebar-foreground": dark.fg,
|
|
64
|
+
"--sidebar-primary": dark.primary,
|
|
65
|
+
"--sidebar-primary-foreground": dark.primaryFg,
|
|
66
|
+
"--sidebar-accent": dark.muted,
|
|
67
|
+
"--sidebar-accent-foreground": dark.fg,
|
|
68
|
+
"--sidebar-border": dark.border,
|
|
69
|
+
"--sidebar-ring": dark.primary
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
export const BUILTIN_COLOR_THEMES = [
|
|
74
|
+
{
|
|
75
|
+
id: "default",
|
|
76
|
+
name: "Default",
|
|
77
|
+
light: {},
|
|
78
|
+
dark: {},
|
|
79
|
+
preview: {
|
|
80
|
+
lightBg: "#ffffff",
|
|
81
|
+
lightText: "#1e1e1e",
|
|
82
|
+
lightLink: "#1e1e1e",
|
|
83
|
+
darkBg: "#262626",
|
|
84
|
+
darkText: "#fafafa",
|
|
85
|
+
darkLink: "#eaeaea"
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
defineTheme({
|
|
89
|
+
id: "beach",
|
|
90
|
+
name: "Beach",
|
|
91
|
+
preview: {
|
|
92
|
+
lightBg: "#f9f3ea",
|
|
93
|
+
lightText: "#3d3527",
|
|
94
|
+
lightLink: "#2d6a59",
|
|
95
|
+
darkBg: "#2d4553",
|
|
96
|
+
darkText: "#e2d6c4",
|
|
97
|
+
darkLink: "#7cc5a2"
|
|
98
|
+
},
|
|
99
|
+
light: {
|
|
100
|
+
bg: "oklch(0.97 0.01 85)",
|
|
101
|
+
fg: "oklch(0.28 0.02 65)",
|
|
102
|
+
primary: "oklch(0.46 0.1 170)",
|
|
103
|
+
primaryFg: "oklch(0.98 0.005 85)",
|
|
104
|
+
muted: "oklch(0.93 0.015 85)",
|
|
105
|
+
mutedFg: "oklch(0.52 0.015 65)",
|
|
106
|
+
border: "oklch(0.88 0.018 85)"
|
|
107
|
+
},
|
|
108
|
+
dark: {
|
|
109
|
+
bg: "oklch(0.27 0.03 210)",
|
|
110
|
+
fg: "oklch(0.88 0.015 80)",
|
|
111
|
+
primary: "oklch(0.72 0.1 165)",
|
|
112
|
+
primaryFg: "oklch(0.22 0.03 210)",
|
|
113
|
+
muted: "oklch(0.33 0.025 210)",
|
|
114
|
+
mutedFg: "oklch(0.65 0.015 80)",
|
|
115
|
+
border: "oklch(0.38 0.02 210)"
|
|
116
|
+
}
|
|
117
|
+
}),
|
|
118
|
+
defineTheme({
|
|
119
|
+
id: "gameboy",
|
|
120
|
+
name: "Gameboy",
|
|
121
|
+
preview: {
|
|
122
|
+
lightBg: "#d3d7c0",
|
|
123
|
+
lightText: "#2b3326",
|
|
124
|
+
lightLink: "#466740",
|
|
125
|
+
darkBg: "#1b1f18",
|
|
126
|
+
darkText: "#a6b09a",
|
|
127
|
+
darkLink: "#6d9660"
|
|
128
|
+
},
|
|
129
|
+
light: {
|
|
130
|
+
bg: "oklch(0.87 0.03 130)",
|
|
131
|
+
fg: "oklch(0.25 0.04 140)",
|
|
132
|
+
primary: "oklch(0.4 0.08 145)",
|
|
133
|
+
primaryFg: "oklch(0.92 0.02 130)",
|
|
134
|
+
muted: "oklch(0.83 0.035 130)",
|
|
135
|
+
mutedFg: "oklch(0.48 0.03 140)",
|
|
136
|
+
border: "oklch(0.79 0.035 130)"
|
|
137
|
+
},
|
|
138
|
+
dark: {
|
|
139
|
+
bg: "oklch(0.18 0.02 140)",
|
|
140
|
+
fg: "oklch(0.78 0.025 130)",
|
|
141
|
+
primary: "oklch(0.6 0.08 145)",
|
|
142
|
+
primaryFg: "oklch(0.15 0.02 140)",
|
|
143
|
+
muted: "oklch(0.24 0.02 140)",
|
|
144
|
+
mutedFg: "oklch(0.58 0.02 130)",
|
|
145
|
+
border: "oklch(0.3 0.02 140)"
|
|
146
|
+
}
|
|
147
|
+
}),
|
|
148
|
+
defineTheme({
|
|
149
|
+
id: "grayscale",
|
|
150
|
+
name: "Grayscale",
|
|
151
|
+
preview: {
|
|
152
|
+
lightBg: "#efefef",
|
|
153
|
+
lightText: "#3a3a3a",
|
|
154
|
+
lightLink: "#555555",
|
|
155
|
+
darkBg: "#1e1e1e",
|
|
156
|
+
darkText: "#c8c8c8",
|
|
157
|
+
darkLink: "#999999"
|
|
158
|
+
},
|
|
159
|
+
light: {
|
|
160
|
+
bg: "oklch(0.96 0 0)",
|
|
161
|
+
fg: "oklch(0.3 0 0)",
|
|
162
|
+
primary: "oklch(0.4 0 0)",
|
|
163
|
+
primaryFg: "oklch(0.96 0 0)",
|
|
164
|
+
muted: "oklch(0.92 0 0)",
|
|
165
|
+
mutedFg: "oklch(0.55 0 0)",
|
|
166
|
+
border: "oklch(0.87 0 0)"
|
|
167
|
+
},
|
|
168
|
+
dark: {
|
|
169
|
+
bg: "oklch(0.18 0 0)",
|
|
170
|
+
fg: "oklch(0.82 0 0)",
|
|
171
|
+
primary: "oklch(0.7 0 0)",
|
|
172
|
+
primaryFg: "oklch(0.18 0 0)",
|
|
173
|
+
muted: "oklch(0.24 0 0)",
|
|
174
|
+
mutedFg: "oklch(0.6 0 0)",
|
|
175
|
+
border: "oklch(0.3 0 0)"
|
|
176
|
+
}
|
|
177
|
+
}),
|
|
178
|
+
defineTheme({
|
|
179
|
+
id: "halloween",
|
|
180
|
+
name: "Halloween",
|
|
181
|
+
preview: {
|
|
182
|
+
lightBg: "#f9f2e3",
|
|
183
|
+
lightText: "#352200",
|
|
184
|
+
lightLink: "#cc5500",
|
|
185
|
+
darkBg: "#1e1000",
|
|
186
|
+
darkText: "#dfc390",
|
|
187
|
+
darkLink: "#ff8c00"
|
|
188
|
+
},
|
|
189
|
+
light: {
|
|
190
|
+
bg: "oklch(0.97 0.015 75)",
|
|
191
|
+
fg: "oklch(0.25 0.04 55)",
|
|
192
|
+
primary: "oklch(0.6 0.2 50)",
|
|
193
|
+
primaryFg: "oklch(0.98 0.01 75)",
|
|
194
|
+
muted: "oklch(0.93 0.02 75)",
|
|
195
|
+
mutedFg: "oklch(0.5 0.025 55)",
|
|
196
|
+
border: "oklch(0.88 0.025 75)"
|
|
197
|
+
},
|
|
198
|
+
dark: {
|
|
199
|
+
bg: "oklch(0.16 0.03 50)",
|
|
200
|
+
fg: "oklch(0.85 0.025 75)",
|
|
201
|
+
primary: "oklch(0.72 0.19 55)",
|
|
202
|
+
primaryFg: "oklch(0.14 0.03 50)",
|
|
203
|
+
muted: "oklch(0.22 0.025 50)",
|
|
204
|
+
mutedFg: "oklch(0.62 0.02 75)",
|
|
205
|
+
border: "oklch(0.28 0.025 50)"
|
|
206
|
+
}
|
|
207
|
+
}),
|
|
208
|
+
defineTheme({
|
|
209
|
+
id: "notepad",
|
|
210
|
+
name: "Notepad",
|
|
211
|
+
preview: {
|
|
212
|
+
lightBg: "#fdfce8",
|
|
213
|
+
lightText: "#333333",
|
|
214
|
+
lightLink: "#2060b8",
|
|
215
|
+
darkBg: "#2a291a",
|
|
216
|
+
darkText: "#d2d2b8",
|
|
217
|
+
darkLink: "#6695cc"
|
|
218
|
+
},
|
|
219
|
+
light: {
|
|
220
|
+
bg: "oklch(0.985 0.018 95)",
|
|
221
|
+
fg: "oklch(0.27 0 0)",
|
|
222
|
+
primary: "oklch(0.5 0.17 260)",
|
|
223
|
+
primaryFg: "oklch(0.985 0.01 95)",
|
|
224
|
+
muted: "oklch(0.94 0.022 95)",
|
|
225
|
+
mutedFg: "oklch(0.52 0 0)",
|
|
226
|
+
border: "oklch(0.88 0.025 95)"
|
|
227
|
+
},
|
|
228
|
+
dark: {
|
|
229
|
+
bg: "oklch(0.2 0.02 90)",
|
|
230
|
+
fg: "oklch(0.87 0.015 95)",
|
|
231
|
+
primary: "oklch(0.65 0.14 260)",
|
|
232
|
+
primaryFg: "oklch(0.98 0.01 95)",
|
|
233
|
+
muted: "oklch(0.26 0.018 90)",
|
|
234
|
+
mutedFg: "oklch(0.62 0.012 95)",
|
|
235
|
+
border: "oklch(0.32 0.018 90)"
|
|
236
|
+
}
|
|
237
|
+
}),
|
|
238
|
+
defineTheme({
|
|
239
|
+
id: "sonnet",
|
|
240
|
+
name: "Sonnet",
|
|
241
|
+
preview: {
|
|
242
|
+
lightBg: "#f7eef5",
|
|
243
|
+
lightText: "#2e1e2c",
|
|
244
|
+
lightLink: "#9845c8",
|
|
245
|
+
darkBg: "#1d1428",
|
|
246
|
+
darkText: "#d4c2d0",
|
|
247
|
+
darkLink: "#c080fc"
|
|
248
|
+
},
|
|
249
|
+
light: {
|
|
250
|
+
bg: "oklch(0.97 0.012 325)",
|
|
251
|
+
fg: "oklch(0.25 0.02 310)",
|
|
252
|
+
primary: "oklch(0.55 0.2 300)",
|
|
253
|
+
primaryFg: "oklch(0.98 0.008 325)",
|
|
254
|
+
muted: "oklch(0.93 0.016 325)",
|
|
255
|
+
mutedFg: "oklch(0.52 0.015 310)",
|
|
256
|
+
border: "oklch(0.88 0.016 325)"
|
|
257
|
+
},
|
|
258
|
+
dark: {
|
|
259
|
+
bg: "oklch(0.18 0.025 300)",
|
|
260
|
+
fg: "oklch(0.87 0.012 325)",
|
|
261
|
+
primary: "oklch(0.72 0.18 300)",
|
|
262
|
+
primaryFg: "oklch(0.98 0.008 325)",
|
|
263
|
+
muted: "oklch(0.24 0.022 300)",
|
|
264
|
+
mutedFg: "oklch(0.62 0.012 325)",
|
|
265
|
+
border: "oklch(0.3 0.022 300)"
|
|
266
|
+
}
|
|
267
|
+
})
|
|
268
|
+
];
|
|
@@ -8,11 +8,16 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import type { FC, PropsWithChildren } from "hono/jsx";
|
|
10
10
|
import type { Context } from "hono";
|
|
11
|
+
export interface ToastProps {
|
|
12
|
+
message: string;
|
|
13
|
+
type?: "success" | "error";
|
|
14
|
+
}
|
|
11
15
|
export interface BaseLayoutProps {
|
|
12
16
|
title: string;
|
|
13
17
|
description?: string;
|
|
14
18
|
lang?: string;
|
|
15
19
|
c?: Context;
|
|
20
|
+
toast?: ToastProps;
|
|
16
21
|
}
|
|
17
22
|
export declare const BaseLayout: FC<PropsWithChildren<BaseLayoutProps>>;
|
|
18
23
|
//# sourceMappingURL=BaseLayout.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseLayout.d.ts","sourceRoot":"","sources":["../../../src/theme/layouts/BaseLayout.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,EAAE,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AACtD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAIpC,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,CAAC,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"BaseLayout.d.ts","sourceRoot":"","sources":["../../../src/theme/layouts/BaseLayout.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,EAAE,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AACtD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAIpC,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC;CAC5B;AAED,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,CAAC,CAAC,EAAE,OAAO,CAAC;IACZ,KAAK,CAAC,EAAE,UAAU,CAAC;CACpB;AAED,eAAO,MAAM,UAAU,EAAE,EAAE,CAAC,iBAAiB,CAAC,eAAe,CAAC,CAiF7D,CAAC"}
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*/ import { jsx as _jsx, jsxs as _jsxs } from "hono/jsx/jsx-runtime";
|
|
9
9
|
import { Script, Link, ViteClient } from "vite-ssr-components/hono";
|
|
10
10
|
import { I18nProvider } from "../../i18n/index.js";
|
|
11
|
-
export const BaseLayout = ({ title, description, lang, c, children })=>{
|
|
11
|
+
export const BaseLayout = ({ title, description, lang, c, toast, children })=>{
|
|
12
12
|
// Read lang from Hono context if available, otherwise use prop or default
|
|
13
13
|
const resolvedLang = lang ?? (c ? c.get("lang") : "en");
|
|
14
14
|
// Automatically wrap with I18nProvider if Context is provided
|
|
@@ -16,6 +16,8 @@ export const BaseLayout = ({ title, description, lang, c, children })=>{
|
|
|
16
16
|
c: c,
|
|
17
17
|
children: children
|
|
18
18
|
}) : children;
|
|
19
|
+
// Read theme style from Hono context if available
|
|
20
|
+
const themeStyle = c ? c.get("themeStyle") : undefined;
|
|
19
21
|
return /*#__PURE__*/ _jsxs("html", {
|
|
20
22
|
lang: resolvedLang,
|
|
21
23
|
children: [
|
|
@@ -40,14 +42,79 @@ export const BaseLayout = ({ title, description, lang, c, children })=>{
|
|
|
40
42
|
href: "/src/style.css",
|
|
41
43
|
rel: "stylesheet"
|
|
42
44
|
}),
|
|
45
|
+
themeStyle && /*#__PURE__*/ _jsx("style", {
|
|
46
|
+
children: themeStyle
|
|
47
|
+
}),
|
|
43
48
|
/*#__PURE__*/ _jsx(Script, {
|
|
44
49
|
src: "/src/client.ts"
|
|
45
50
|
})
|
|
46
51
|
]
|
|
47
52
|
}),
|
|
48
|
-
/*#__PURE__*/
|
|
53
|
+
/*#__PURE__*/ _jsxs("body", {
|
|
49
54
|
class: "bg-background text-foreground antialiased",
|
|
50
|
-
children:
|
|
55
|
+
children: [
|
|
56
|
+
content,
|
|
57
|
+
/*#__PURE__*/ _jsx("div", {
|
|
58
|
+
id: "toast-container",
|
|
59
|
+
class: "toast-container",
|
|
60
|
+
children: toast && /*#__PURE__*/ _jsxs("div", {
|
|
61
|
+
class: `toast ${toast.type === "error" ? "toast-error" : "toast-success"}`,
|
|
62
|
+
"data-init": "history.replaceState({}, '', location.pathname); setTimeout(() => { el.classList.add('toast-out'); el.addEventListener('animationend', () => el.remove()) }, 3000)",
|
|
63
|
+
children: [
|
|
64
|
+
toast.type === "error" ? /*#__PURE__*/ _jsxs("svg", {
|
|
65
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
66
|
+
fill: "none",
|
|
67
|
+
viewBox: "0 0 24 24",
|
|
68
|
+
"stroke-width": "2",
|
|
69
|
+
stroke: "currentColor",
|
|
70
|
+
children: [
|
|
71
|
+
/*#__PURE__*/ _jsx("circle", {
|
|
72
|
+
cx: "12",
|
|
73
|
+
cy: "12",
|
|
74
|
+
r: "10"
|
|
75
|
+
}),
|
|
76
|
+
/*#__PURE__*/ _jsx("path", {
|
|
77
|
+
d: "m15 9-6 6M9 9l6 6"
|
|
78
|
+
})
|
|
79
|
+
]
|
|
80
|
+
}) : /*#__PURE__*/ _jsxs("svg", {
|
|
81
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
82
|
+
fill: "none",
|
|
83
|
+
viewBox: "0 0 24 24",
|
|
84
|
+
"stroke-width": "2",
|
|
85
|
+
stroke: "currentColor",
|
|
86
|
+
children: [
|
|
87
|
+
/*#__PURE__*/ _jsx("circle", {
|
|
88
|
+
cx: "12",
|
|
89
|
+
cy: "12",
|
|
90
|
+
r: "10"
|
|
91
|
+
}),
|
|
92
|
+
/*#__PURE__*/ _jsx("path", {
|
|
93
|
+
d: "m9 12 2 2 4-4"
|
|
94
|
+
})
|
|
95
|
+
]
|
|
96
|
+
}),
|
|
97
|
+
/*#__PURE__*/ _jsx("span", {
|
|
98
|
+
children: toast.message
|
|
99
|
+
}),
|
|
100
|
+
/*#__PURE__*/ _jsx("button", {
|
|
101
|
+
class: "toast-close",
|
|
102
|
+
"data-on:click": "el.closest('.toast').classList.add('toast-out'); el.closest('.toast').addEventListener('animationend', () => el.closest('.toast').remove())",
|
|
103
|
+
children: /*#__PURE__*/ _jsx("svg", {
|
|
104
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
105
|
+
fill: "none",
|
|
106
|
+
viewBox: "0 0 24 24",
|
|
107
|
+
"stroke-width": "2",
|
|
108
|
+
stroke: "currentColor",
|
|
109
|
+
children: /*#__PURE__*/ _jsx("path", {
|
|
110
|
+
d: "M18 6 6 18M6 6l12 12"
|
|
111
|
+
})
|
|
112
|
+
})
|
|
113
|
+
})
|
|
114
|
+
]
|
|
115
|
+
})
|
|
116
|
+
})
|
|
117
|
+
]
|
|
51
118
|
})
|
|
52
119
|
]
|
|
53
120
|
});
|
|
@@ -5,11 +5,13 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import type { FC, PropsWithChildren } from "hono/jsx";
|
|
7
7
|
import type { Context } from "hono";
|
|
8
|
+
import { type ToastProps } from "./BaseLayout.js";
|
|
8
9
|
export interface DashLayoutProps {
|
|
9
10
|
c: Context;
|
|
10
11
|
title: string;
|
|
11
12
|
siteName: string;
|
|
12
13
|
currentPath?: string;
|
|
14
|
+
toast?: ToastProps;
|
|
13
15
|
}
|
|
14
16
|
export declare const DashLayout: FC<PropsWithChildren<DashLayoutProps>>;
|
|
15
17
|
//# sourceMappingURL=DashLayout.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DashLayout.d.ts","sourceRoot":"","sources":["../../../src/theme/layouts/DashLayout.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,EAAE,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AACtD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"DashLayout.d.ts","sourceRoot":"","sources":["../../../src/theme/layouts/DashLayout.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,EAAE,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AACtD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAEpC,OAAO,EAAc,KAAK,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE9D,MAAM,WAAW,eAAe;IAC9B,CAAC,EAAE,OAAO,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,UAAU,CAAC;CACpB;AA2ID,eAAO,MAAM,UAAU,EAAE,EAAE,CAAC,iBAAiB,CAAC,eAAe,CAAC,CAe7D,CAAC"}
|
|
@@ -22,6 +22,7 @@ function DashLayoutContent({ siteName, currentPath, children }) {
|
|
|
22
22
|
class: "container flex h-14 items-center justify-between",
|
|
23
23
|
children: [
|
|
24
24
|
/*#__PURE__*/ _jsx("a", {
|
|
25
|
+
id: "site-name",
|
|
25
26
|
href: "/dash",
|
|
26
27
|
class: "font-semibold",
|
|
27
28
|
children: siteName
|
|
@@ -113,6 +114,14 @@ function DashLayoutContent({ siteName, currentPath, children }) {
|
|
|
113
114
|
id: "Tz0i8g",
|
|
114
115
|
message: "Settings"
|
|
115
116
|
})
|
|
117
|
+
}),
|
|
118
|
+
/*#__PURE__*/ _jsx("a", {
|
|
119
|
+
href: "/dash/appearance",
|
|
120
|
+
class: navClass("/dash/appearance", /^\/dash\/appearance/),
|
|
121
|
+
children: $__i18n._({
|
|
122
|
+
id: "aAIQg2",
|
|
123
|
+
message: "Appearance"
|
|
124
|
+
})
|
|
116
125
|
})
|
|
117
126
|
]
|
|
118
127
|
})
|
|
@@ -126,10 +135,11 @@ function DashLayoutContent({ siteName, currentPath, children }) {
|
|
|
126
135
|
]
|
|
127
136
|
});
|
|
128
137
|
}
|
|
129
|
-
export const DashLayout = ({ c, title, siteName, currentPath, children })=>{
|
|
138
|
+
export const DashLayout = ({ c, title, siteName, currentPath, toast, children })=>{
|
|
130
139
|
return /*#__PURE__*/ _jsx(BaseLayout, {
|
|
131
140
|
title: `${title} - ${siteName}`,
|
|
132
141
|
c: c,
|
|
142
|
+
toast: toast,
|
|
133
143
|
children: /*#__PURE__*/ _jsx(DashLayoutContent, {
|
|
134
144
|
siteName: siteName,
|
|
135
145
|
currentPath: currentPath,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/theme/layouts/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/theme/layouts/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,KAAK,eAAe,EACpB,KAAK,UAAU,GAChB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,UAAU,EAAE,KAAK,eAAe,EAAE,MAAM,iBAAiB,CAAC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -18,6 +18,55 @@ export interface Bindings {
|
|
|
18
18
|
SITE_DESCRIPTION?: string;
|
|
19
19
|
SITE_LANGUAGE?: string;
|
|
20
20
|
}
|
|
21
|
+
/**
|
|
22
|
+
* Configuration Registry - Single Source of Truth
|
|
23
|
+
*
|
|
24
|
+
* All available configuration fields with their metadata.
|
|
25
|
+
* Add new fields here, and they'll automatically work everywhere.
|
|
26
|
+
*
|
|
27
|
+
* Priority logic:
|
|
28
|
+
* - envOnly: false → User-configurable (DB > ENV > Default)
|
|
29
|
+
* - envOnly: true → Environment-only (ENV > Default)
|
|
30
|
+
*/
|
|
31
|
+
export declare const CONFIG_FIELDS: {
|
|
32
|
+
readonly SITE_NAME: {
|
|
33
|
+
readonly defaultValue: "Jant";
|
|
34
|
+
readonly envOnly: false;
|
|
35
|
+
};
|
|
36
|
+
readonly SITE_DESCRIPTION: {
|
|
37
|
+
readonly defaultValue: "A microblog powered by Jant";
|
|
38
|
+
readonly envOnly: false;
|
|
39
|
+
};
|
|
40
|
+
readonly SITE_LANGUAGE: {
|
|
41
|
+
readonly defaultValue: "en";
|
|
42
|
+
readonly envOnly: false;
|
|
43
|
+
};
|
|
44
|
+
readonly SITE_URL: {
|
|
45
|
+
readonly defaultValue: "";
|
|
46
|
+
readonly envOnly: true;
|
|
47
|
+
};
|
|
48
|
+
readonly AUTH_SECRET: {
|
|
49
|
+
readonly defaultValue: "";
|
|
50
|
+
readonly envOnly: true;
|
|
51
|
+
};
|
|
52
|
+
readonly R2_PUBLIC_URL: {
|
|
53
|
+
readonly defaultValue: "";
|
|
54
|
+
readonly envOnly: true;
|
|
55
|
+
};
|
|
56
|
+
readonly IMAGE_TRANSFORM_URL: {
|
|
57
|
+
readonly defaultValue: "";
|
|
58
|
+
readonly envOnly: true;
|
|
59
|
+
};
|
|
60
|
+
readonly DEMO_EMAIL: {
|
|
61
|
+
readonly defaultValue: "";
|
|
62
|
+
readonly envOnly: true;
|
|
63
|
+
};
|
|
64
|
+
readonly DEMO_PASSWORD: {
|
|
65
|
+
readonly defaultValue: "";
|
|
66
|
+
readonly envOnly: true;
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
export type ConfigKey = keyof typeof CONFIG_FIELDS;
|
|
21
70
|
export interface Post {
|
|
22
71
|
id: number;
|
|
23
72
|
type: PostType;
|
|
@@ -96,6 +145,7 @@ export interface UpdatePost {
|
|
|
96
145
|
publishedAt?: number;
|
|
97
146
|
}
|
|
98
147
|
import type { FC, PropsWithChildren } from "hono/jsx";
|
|
148
|
+
import type { ColorTheme } from "./theme/color-themes.js";
|
|
99
149
|
/**
|
|
100
150
|
* Props for overridable theme components
|
|
101
151
|
*/
|
|
@@ -141,8 +191,10 @@ export interface JantTheme {
|
|
|
141
191
|
name?: string;
|
|
142
192
|
/** Component overrides */
|
|
143
193
|
components?: ThemeComponents;
|
|
144
|
-
/** CSS variable overrides */
|
|
194
|
+
/** CSS variable overrides (highest priority, always applied) */
|
|
145
195
|
cssVariables?: Record<string, string>;
|
|
196
|
+
/** Replace built-in color themes with a custom list */
|
|
197
|
+
colorThemes?: ColorTheme[];
|
|
146
198
|
}
|
|
147
199
|
/**
|
|
148
200
|
* Main Jant configuration
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAMH,eAAO,MAAM,UAAU,gEAOb,CAAC;AACX,MAAM,MAAM,QAAQ,GAAG,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC;AAEnD,eAAO,MAAM,iBAAiB,qDAKpB,CAAC;AACX,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAC;AAM5D,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,UAAU,CAAC;IACf,E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IAC1B,UAAU,CAAC,EAAE,eAAe,CAAC;IAC7B,gEAAgE;IAChE,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtC,uDAAuD;IACvD,WAAW,CAAC,EAAE,UAAU,EAAE,CAAC;CAC5B;AAED;;;;;;;;;GASG;AACH,MAAM,WAAW,UAAU;IACzB,sDAAsD;IACtD,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB"}
|
package/dist/types.js
CHANGED
|
@@ -17,3 +17,55 @@ export const VISIBILITY_LEVELS = [
|
|
|
17
17
|
"unlisted",
|
|
18
18
|
"draft"
|
|
19
19
|
];
|
|
20
|
+
// =============================================================================
|
|
21
|
+
// Configuration System
|
|
22
|
+
// =============================================================================
|
|
23
|
+
/**
|
|
24
|
+
* Configuration Registry - Single Source of Truth
|
|
25
|
+
*
|
|
26
|
+
* All available configuration fields with their metadata.
|
|
27
|
+
* Add new fields here, and they'll automatically work everywhere.
|
|
28
|
+
*
|
|
29
|
+
* Priority logic:
|
|
30
|
+
* - envOnly: false → User-configurable (DB > ENV > Default)
|
|
31
|
+
* - envOnly: true → Environment-only (ENV > Default)
|
|
32
|
+
*/ export const CONFIG_FIELDS = {
|
|
33
|
+
// User-configurable (can be modified in dashboard)
|
|
34
|
+
SITE_NAME: {
|
|
35
|
+
defaultValue: "Jant",
|
|
36
|
+
envOnly: false
|
|
37
|
+
},
|
|
38
|
+
SITE_DESCRIPTION: {
|
|
39
|
+
defaultValue: "A microblog powered by Jant",
|
|
40
|
+
envOnly: false
|
|
41
|
+
},
|
|
42
|
+
SITE_LANGUAGE: {
|
|
43
|
+
defaultValue: "en",
|
|
44
|
+
envOnly: false
|
|
45
|
+
},
|
|
46
|
+
// Environment-only (deployment/infrastructure config)
|
|
47
|
+
SITE_URL: {
|
|
48
|
+
defaultValue: "",
|
|
49
|
+
envOnly: true
|
|
50
|
+
},
|
|
51
|
+
AUTH_SECRET: {
|
|
52
|
+
defaultValue: "",
|
|
53
|
+
envOnly: true
|
|
54
|
+
},
|
|
55
|
+
R2_PUBLIC_URL: {
|
|
56
|
+
defaultValue: "",
|
|
57
|
+
envOnly: true
|
|
58
|
+
},
|
|
59
|
+
IMAGE_TRANSFORM_URL: {
|
|
60
|
+
defaultValue: "",
|
|
61
|
+
envOnly: true
|
|
62
|
+
},
|
|
63
|
+
DEMO_EMAIL: {
|
|
64
|
+
defaultValue: "",
|
|
65
|
+
envOnly: true
|
|
66
|
+
},
|
|
67
|
+
DEMO_PASSWORD: {
|
|
68
|
+
defaultValue: "",
|
|
69
|
+
envOnly: true
|
|
70
|
+
}
|
|
71
|
+
};
|