@gitpagedocs/cli 1.1.62 → 1.1.64
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/README.md +193 -193
- package/ai/application/ai-command.ts +24 -24
- package/ai/application/ai-provider-factory.ts +22 -22
- package/ai/application/docs-pattern.ts +68 -68
- package/ai/application/run-ai-cli-command.ts +167 -167
- package/ai/config.ts +50 -50
- package/ai/core/models/ai-cli-config.ts +33 -33
- package/ai/core/models/parse-ai-cli-config.ts +78 -78
- package/ai/core/ports/illm-provider.ts +32 -32
- package/ai/infrastructure/ai-config-file.ts +101 -101
- package/ai/infrastructure/file-system-adapter.ts +85 -85
- package/ai/infrastructure/llm/tools-llm-provider.ts +54 -54
- package/ai/infrastructure/version-docs-writer.ts +143 -143
- package/ai/presentation/ai-prompts.ts +239 -239
- package/application/ports/cli-runtime-ports.ts +91 -91
- package/application/report/config-only-reporter.mjs +64 -64
- package/application/use-cases/dispatch-mode.ts +18 -18
- package/builders/config-orchestrator.mjs +34 -34
- package/builders/project-links.mjs +50 -50
- package/builders/root-config-builder.mjs +61 -61
- package/builders/route-builders.mjs +136 -136
- package/builders/theme-template.mjs +76 -76
- package/builders/version-config-builder.mjs +186 -186
- package/content/docs-en.mjs +549 -549
- package/content/docs-es.mjs +462 -462
- package/content/docs-pt.mjs +462 -462
- package/contracts/doc-versions.mjs +3 -3
- package/data/default-site-config.mjs +321 -321
- package/data/i18n-langmenu.mjs +347 -347
- package/data/layouts.mjs +436 -436
- package/data/path-mappings.mjs +26 -26
- package/data/route-metas.mjs +93 -93
- package/data/theme-colors.mjs +443 -443
- package/data/urls.mjs +12 -12
- package/domain/models/cli-options.ts +33 -33
- package/home/constants.mjs +4 -4
- package/index.mjs +37 -37
- package/infrastructure/gitpagedocs-config-file.ts +47 -47
- package/infrastructure/home/runtime.mjs +37 -37
- package/package.json +3 -3
- package/presentation/commands/ai-info.ts +57 -57
- package/presentation/commands/config-clear.ts +23 -23
- package/presentation/commands/config-info.ts +24 -24
- package/presentation/commands/diagnostics.ts +164 -164
- package/presentation/commands/docs.ts +37 -37
- package/presentation/commands/mcp.ts +20 -20
- package/presentation/commands/pages.ts +101 -101
- package/presentation/commands/password.ts +62 -62
- package/presentation/commands/run-command.ts +70 -70
- package/presentation/index.ts +124 -124
- package/presentation/options/parser.ts +119 -119
- package/presentation/options/resolver.ts +46 -46
- package/presentation/ui/clack.ts +91 -91
- package/presentation/ui/prompts.ts +146 -146
- package/runtime/git-ops.mjs +110 -110
- package/runtime/output.mjs +159 -159
- package/runtime/workflow.mjs +129 -129
- package/start.mjs +12 -12
- package/ui/logger.mjs +9 -9
|
@@ -1,136 +1,136 @@
|
|
|
1
|
-
/** Build route objects for md, html, and video content types */
|
|
2
|
-
|
|
3
|
-
export function buildMdRoute(versionId, routeId, pathByLang, titles, descriptions, options = {}) {
|
|
4
|
-
const {
|
|
5
|
-
titleCss = "font-size: 1.85rem; font-weight: 700;",
|
|
6
|
-
titleDarkCss = "font-size: 1.85rem; font-weight: 700; color: var(--text);",
|
|
7
|
-
titleLightCss = "font-size: 1.85rem; font-weight: 700; color: var(--text);",
|
|
8
|
-
titlePosition = "center",
|
|
9
|
-
titleIsVisible = true,
|
|
10
|
-
descriptionCss = "font-size: 1.2rem; font-weight: 500;",
|
|
11
|
-
descriptionDarkCss = "font-size: 1.2rem; font-weight: 500; color: var(--text-secondary);",
|
|
12
|
-
descriptionLightCss = "font-size: 1.2rem; font-weight: 500; color: var(--text-secondary);",
|
|
13
|
-
descriptionPosition = "center",
|
|
14
|
-
descriptionIsVisible = true,
|
|
15
|
-
fullscreenEnabled = true,
|
|
16
|
-
marginTop = "",
|
|
17
|
-
marginBottom = "",
|
|
18
|
-
blockLink = true,
|
|
19
|
-
container,
|
|
20
|
-
browseAll = false,
|
|
21
|
-
RouteguideBrand = true,
|
|
22
|
-
RouteGuideSpeciFicbrand = [],
|
|
23
|
-
RouteguideBrandPosition = "center",
|
|
24
|
-
RouteguideBrandContainerTop = false,
|
|
25
|
-
audio,
|
|
26
|
-
authorization,
|
|
27
|
-
} = options;
|
|
28
|
-
const out = {
|
|
29
|
-
id: routeId,
|
|
30
|
-
title: titles ?? { pt: "Documentação", en: "Documentation", es: "Documentación" },
|
|
31
|
-
description: descriptions ?? { pt: "Descrição da página", en: "Page description", es: "Descripción de la página" },
|
|
32
|
-
titleCss,
|
|
33
|
-
titleDarkCss,
|
|
34
|
-
titleLightCss,
|
|
35
|
-
titlePosition,
|
|
36
|
-
titleIsVisible,
|
|
37
|
-
descriptionCss,
|
|
38
|
-
descriptionDarkCss,
|
|
39
|
-
descriptionLightCss,
|
|
40
|
-
descriptionPosition,
|
|
41
|
-
descriptionIsVisible,
|
|
42
|
-
path: pathByLang,
|
|
43
|
-
fullscreenEnabled,
|
|
44
|
-
marginTop,
|
|
45
|
-
marginBottom,
|
|
46
|
-
blockLink,
|
|
47
|
-
container,
|
|
48
|
-
browseAll,
|
|
49
|
-
RouteguideBrand,
|
|
50
|
-
RouteGuideSpeciFicbrand,
|
|
51
|
-
RouteguideBrandPosition,
|
|
52
|
-
RouteguideBrandContainerTop,
|
|
53
|
-
};
|
|
54
|
-
if (container !== undefined) out.container = container;
|
|
55
|
-
if (audio !== undefined) out.audio = audio;
|
|
56
|
-
if (authorization !== undefined) out.authorization = authorization;
|
|
57
|
-
return out;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
export function buildHtmlRoute(versionId, routeId, pathByLang, titles, descriptions, options = {}) {
|
|
61
|
-
const base = buildMdRoute(versionId, routeId, pathByLang, titles, descriptions, options);
|
|
62
|
-
return { ...base };
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
export function buildVideoRoute(versionId, routeId, videoType, pathVideo, titles, descriptions, options = {}) {
|
|
66
|
-
const {
|
|
67
|
-
titleCss = "font-size: 1.85rem; font-weight: 700;",
|
|
68
|
-
titleDarkCss = "font-size: 1.85rem; font-weight: 700; color: var(--text);",
|
|
69
|
-
titleLightCss = "font-size: 1.85rem; font-weight: 700; color: var(--text);",
|
|
70
|
-
titlePosition = "center",
|
|
71
|
-
titleIsVisible = true,
|
|
72
|
-
descriptionCss = "font-size: 1.2rem; font-weight: 500;",
|
|
73
|
-
descriptionDarkCss = "font-size: 1.2rem; font-weight: 500; color: var(--text-secondary);",
|
|
74
|
-
descriptionLightCss = "font-size: 1.2rem; font-weight: 500; color: var(--text-secondary);",
|
|
75
|
-
descriptionPosition = "center",
|
|
76
|
-
descriptionIsVisible = true,
|
|
77
|
-
fullscreenEnabled = true,
|
|
78
|
-
marginTop = "",
|
|
79
|
-
marginBottom = "",
|
|
80
|
-
blockLink = true,
|
|
81
|
-
container,
|
|
82
|
-
browseAll = false,
|
|
83
|
-
authorization,
|
|
84
|
-
} = options;
|
|
85
|
-
const videoTypeByLang = typeof videoType === "string" ? { pt: videoType, en: videoType, es: videoType } : videoType;
|
|
86
|
-
const pathVideoByLang = typeof pathVideo === "string" ? { pt: pathVideo, en: pathVideo, es: pathVideo } : pathVideo;
|
|
87
|
-
const obj = {
|
|
88
|
-
id: routeId,
|
|
89
|
-
title: titles ?? { pt: "Vídeo", en: "Video", es: "Vídeo" },
|
|
90
|
-
description: descriptions ?? { pt: "Descrição do vídeo", en: "Video description", es: "Descripción del vídeo" },
|
|
91
|
-
titleCss,
|
|
92
|
-
titleDarkCss,
|
|
93
|
-
titleLightCss,
|
|
94
|
-
titlePosition,
|
|
95
|
-
titleIsVisible,
|
|
96
|
-
descriptionCss,
|
|
97
|
-
descriptionDarkCss,
|
|
98
|
-
descriptionLightCss,
|
|
99
|
-
descriptionPosition,
|
|
100
|
-
descriptionIsVisible,
|
|
101
|
-
fullscreenEnabled,
|
|
102
|
-
marginTop,
|
|
103
|
-
marginBottom,
|
|
104
|
-
blockLink,
|
|
105
|
-
browseAll,
|
|
106
|
-
video: { videoType: videoTypeByLang, pathVideo: pathVideoByLang },
|
|
107
|
-
};
|
|
108
|
-
if (container !== undefined) obj.container = container;
|
|
109
|
-
if (authorization !== undefined) obj.authorization = authorization;
|
|
110
|
-
return obj;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
export function buildAudioRoute(versionId, routeId, audioType, pathAudio, titles, descriptions, options = {}) {
|
|
114
|
-
const base = buildVideoRoute(versionId, routeId, audioType, pathAudio, titles, descriptions, options);
|
|
115
|
-
const audioTypeByLang = typeof audioType === "string" ? { pt: audioType, en: audioType, es: audioType } : audioType;
|
|
116
|
-
const pathAudioByLang = typeof pathAudio === "string" ? { pt: pathAudio, en: pathAudio, es: pathAudio } : pathAudio;
|
|
117
|
-
const { video, ...rest } = base;
|
|
118
|
-
return {
|
|
119
|
-
...rest,
|
|
120
|
-
audio: { audioType: audioTypeByLang, pathAudio: pathAudioByLang },
|
|
121
|
-
};
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
export function buildSourceViewerRoute(routeId, sourceViewerPath, titles, descriptions, options = {}) {
|
|
125
|
-
const base = buildMdRoute("", routeId, {}, titles, descriptions, {
|
|
126
|
-
...options,
|
|
127
|
-
fullscreenEnabled: false,
|
|
128
|
-
RouteguideBrand: false,
|
|
129
|
-
});
|
|
130
|
-
delete base.path;
|
|
131
|
-
return {
|
|
132
|
-
...base,
|
|
133
|
-
"source-viewer": true,
|
|
134
|
-
"source-viewer-path": sourceViewerPath,
|
|
135
|
-
};
|
|
136
|
-
}
|
|
1
|
+
/** Build route objects for md, html, and video content types */
|
|
2
|
+
|
|
3
|
+
export function buildMdRoute(versionId, routeId, pathByLang, titles, descriptions, options = {}) {
|
|
4
|
+
const {
|
|
5
|
+
titleCss = "font-size: 1.85rem; font-weight: 700;",
|
|
6
|
+
titleDarkCss = "font-size: 1.85rem; font-weight: 700; color: var(--text);",
|
|
7
|
+
titleLightCss = "font-size: 1.85rem; font-weight: 700; color: var(--text);",
|
|
8
|
+
titlePosition = "center",
|
|
9
|
+
titleIsVisible = true,
|
|
10
|
+
descriptionCss = "font-size: 1.2rem; font-weight: 500;",
|
|
11
|
+
descriptionDarkCss = "font-size: 1.2rem; font-weight: 500; color: var(--text-secondary);",
|
|
12
|
+
descriptionLightCss = "font-size: 1.2rem; font-weight: 500; color: var(--text-secondary);",
|
|
13
|
+
descriptionPosition = "center",
|
|
14
|
+
descriptionIsVisible = true,
|
|
15
|
+
fullscreenEnabled = true,
|
|
16
|
+
marginTop = "",
|
|
17
|
+
marginBottom = "",
|
|
18
|
+
blockLink = true,
|
|
19
|
+
container,
|
|
20
|
+
browseAll = false,
|
|
21
|
+
RouteguideBrand = true,
|
|
22
|
+
RouteGuideSpeciFicbrand = [],
|
|
23
|
+
RouteguideBrandPosition = "center",
|
|
24
|
+
RouteguideBrandContainerTop = false,
|
|
25
|
+
audio,
|
|
26
|
+
authorization,
|
|
27
|
+
} = options;
|
|
28
|
+
const out = {
|
|
29
|
+
id: routeId,
|
|
30
|
+
title: titles ?? { pt: "Documentação", en: "Documentation", es: "Documentación" },
|
|
31
|
+
description: descriptions ?? { pt: "Descrição da página", en: "Page description", es: "Descripción de la página" },
|
|
32
|
+
titleCss,
|
|
33
|
+
titleDarkCss,
|
|
34
|
+
titleLightCss,
|
|
35
|
+
titlePosition,
|
|
36
|
+
titleIsVisible,
|
|
37
|
+
descriptionCss,
|
|
38
|
+
descriptionDarkCss,
|
|
39
|
+
descriptionLightCss,
|
|
40
|
+
descriptionPosition,
|
|
41
|
+
descriptionIsVisible,
|
|
42
|
+
path: pathByLang,
|
|
43
|
+
fullscreenEnabled,
|
|
44
|
+
marginTop,
|
|
45
|
+
marginBottom,
|
|
46
|
+
blockLink,
|
|
47
|
+
container,
|
|
48
|
+
browseAll,
|
|
49
|
+
RouteguideBrand,
|
|
50
|
+
RouteGuideSpeciFicbrand,
|
|
51
|
+
RouteguideBrandPosition,
|
|
52
|
+
RouteguideBrandContainerTop,
|
|
53
|
+
};
|
|
54
|
+
if (container !== undefined) out.container = container;
|
|
55
|
+
if (audio !== undefined) out.audio = audio;
|
|
56
|
+
if (authorization !== undefined) out.authorization = authorization;
|
|
57
|
+
return out;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export function buildHtmlRoute(versionId, routeId, pathByLang, titles, descriptions, options = {}) {
|
|
61
|
+
const base = buildMdRoute(versionId, routeId, pathByLang, titles, descriptions, options);
|
|
62
|
+
return { ...base };
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export function buildVideoRoute(versionId, routeId, videoType, pathVideo, titles, descriptions, options = {}) {
|
|
66
|
+
const {
|
|
67
|
+
titleCss = "font-size: 1.85rem; font-weight: 700;",
|
|
68
|
+
titleDarkCss = "font-size: 1.85rem; font-weight: 700; color: var(--text);",
|
|
69
|
+
titleLightCss = "font-size: 1.85rem; font-weight: 700; color: var(--text);",
|
|
70
|
+
titlePosition = "center",
|
|
71
|
+
titleIsVisible = true,
|
|
72
|
+
descriptionCss = "font-size: 1.2rem; font-weight: 500;",
|
|
73
|
+
descriptionDarkCss = "font-size: 1.2rem; font-weight: 500; color: var(--text-secondary);",
|
|
74
|
+
descriptionLightCss = "font-size: 1.2rem; font-weight: 500; color: var(--text-secondary);",
|
|
75
|
+
descriptionPosition = "center",
|
|
76
|
+
descriptionIsVisible = true,
|
|
77
|
+
fullscreenEnabled = true,
|
|
78
|
+
marginTop = "",
|
|
79
|
+
marginBottom = "",
|
|
80
|
+
blockLink = true,
|
|
81
|
+
container,
|
|
82
|
+
browseAll = false,
|
|
83
|
+
authorization,
|
|
84
|
+
} = options;
|
|
85
|
+
const videoTypeByLang = typeof videoType === "string" ? { pt: videoType, en: videoType, es: videoType } : videoType;
|
|
86
|
+
const pathVideoByLang = typeof pathVideo === "string" ? { pt: pathVideo, en: pathVideo, es: pathVideo } : pathVideo;
|
|
87
|
+
const obj = {
|
|
88
|
+
id: routeId,
|
|
89
|
+
title: titles ?? { pt: "Vídeo", en: "Video", es: "Vídeo" },
|
|
90
|
+
description: descriptions ?? { pt: "Descrição do vídeo", en: "Video description", es: "Descripción del vídeo" },
|
|
91
|
+
titleCss,
|
|
92
|
+
titleDarkCss,
|
|
93
|
+
titleLightCss,
|
|
94
|
+
titlePosition,
|
|
95
|
+
titleIsVisible,
|
|
96
|
+
descriptionCss,
|
|
97
|
+
descriptionDarkCss,
|
|
98
|
+
descriptionLightCss,
|
|
99
|
+
descriptionPosition,
|
|
100
|
+
descriptionIsVisible,
|
|
101
|
+
fullscreenEnabled,
|
|
102
|
+
marginTop,
|
|
103
|
+
marginBottom,
|
|
104
|
+
blockLink,
|
|
105
|
+
browseAll,
|
|
106
|
+
video: { videoType: videoTypeByLang, pathVideo: pathVideoByLang },
|
|
107
|
+
};
|
|
108
|
+
if (container !== undefined) obj.container = container;
|
|
109
|
+
if (authorization !== undefined) obj.authorization = authorization;
|
|
110
|
+
return obj;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export function buildAudioRoute(versionId, routeId, audioType, pathAudio, titles, descriptions, options = {}) {
|
|
114
|
+
const base = buildVideoRoute(versionId, routeId, audioType, pathAudio, titles, descriptions, options);
|
|
115
|
+
const audioTypeByLang = typeof audioType === "string" ? { pt: audioType, en: audioType, es: audioType } : audioType;
|
|
116
|
+
const pathAudioByLang = typeof pathAudio === "string" ? { pt: pathAudio, en: pathAudio, es: pathAudio } : pathAudio;
|
|
117
|
+
const { video, ...rest } = base;
|
|
118
|
+
return {
|
|
119
|
+
...rest,
|
|
120
|
+
audio: { audioType: audioTypeByLang, pathAudio: pathAudioByLang },
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
export function buildSourceViewerRoute(routeId, sourceViewerPath, titles, descriptions, options = {}) {
|
|
125
|
+
const base = buildMdRoute("", routeId, {}, titles, descriptions, {
|
|
126
|
+
...options,
|
|
127
|
+
fullscreenEnabled: false,
|
|
128
|
+
RouteguideBrand: false,
|
|
129
|
+
});
|
|
130
|
+
delete base.path;
|
|
131
|
+
return {
|
|
132
|
+
...base,
|
|
133
|
+
"source-viewer": true,
|
|
134
|
+
"source-viewer-path": sourceViewerPath,
|
|
135
|
+
};
|
|
136
|
+
}
|
|
@@ -1,76 +1,76 @@
|
|
|
1
|
-
/** Build theme JSON template from layout definition */
|
|
2
|
-
|
|
3
|
-
import { PACKAGE_VERSION } from "../contracts/doc-versions.mjs";
|
|
4
|
-
import { THEME_COLORS } from "../data/theme-colors.mjs";
|
|
5
|
-
|
|
6
|
-
export function createThemeTemplate(layout, themeColors = THEME_COLORS) {
|
|
7
|
-
const colors = themeColors[layout.id] ?? themeColors.default;
|
|
8
|
-
const dark = layout.mode === "dark";
|
|
9
|
-
return {
|
|
10
|
-
id: layout.id,
|
|
11
|
-
name: layout.name,
|
|
12
|
-
author: layout.author,
|
|
13
|
-
version: PACKAGE_VERSION,
|
|
14
|
-
mode: layout.mode,
|
|
15
|
-
supportsLightAndDarkModes: layout.supportsLightAndDarkModes,
|
|
16
|
-
colors,
|
|
17
|
-
typography: {
|
|
18
|
-
fontFamily: "-apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, Roboto, Helvetica, Arial, sans-serif",
|
|
19
|
-
fontSize: {
|
|
20
|
-
small: "0.875rem",
|
|
21
|
-
base: "1rem",
|
|
22
|
-
medium: "1.125rem",
|
|
23
|
-
large: "1.25rem",
|
|
24
|
-
xlarge: "2rem",
|
|
25
|
-
},
|
|
26
|
-
},
|
|
27
|
-
components: {
|
|
28
|
-
header: {
|
|
29
|
-
height: "80px",
|
|
30
|
-
backgroundColor: dark ? "#0B1220" : "#FFFFFF",
|
|
31
|
-
borderBottom: dark ? "1px solid #334155" : "1px solid #E2E8F0",
|
|
32
|
-
},
|
|
33
|
-
footer: {
|
|
34
|
-
height: "60px",
|
|
35
|
-
backgroundColor: dark ? "#0B1220" : "#FFFFFF",
|
|
36
|
-
borderTop: dark ? "1px solid #334155" : "1px solid #E2E8F0",
|
|
37
|
-
},
|
|
38
|
-
card: {
|
|
39
|
-
borderRadius: "16px",
|
|
40
|
-
padding: "24px",
|
|
41
|
-
boxShadow: dark ? "0 18px 60px rgba(0, 0, 0, 0.45)" : "0 18px 50px rgba(15, 23, 42, 0.08)",
|
|
42
|
-
},
|
|
43
|
-
button: {
|
|
44
|
-
borderRadius: "12px",
|
|
45
|
-
padding: "10px 18px",
|
|
46
|
-
border: dark ? "1px solid #334155" : "1px solid #E2E8F0",
|
|
47
|
-
hoverGlow: dark ? "0 0 0 3px rgba(124, 58, 237, 0.18)" : "0 0 0 4px rgba(109, 40, 217, 0.15)",
|
|
48
|
-
},
|
|
49
|
-
select: {
|
|
50
|
-
borderRadius: "12px",
|
|
51
|
-
padding: "10px 40px 10px 16px",
|
|
52
|
-
border: dark ? "1px solid #334155" : "1px solid #E2E8F0",
|
|
53
|
-
backgroundColor: dark ? "#0F172A" : "#FFFFFF",
|
|
54
|
-
textAlign: "center",
|
|
55
|
-
iconColor: colors.secondary,
|
|
56
|
-
hoverBorderColor: dark ? "rgba(34, 211, 238, 0.7)" : "rgba(8, 145, 178, 0.7)",
|
|
57
|
-
focusBorderColor: dark ? "rgba(124, 58, 237, 0.8)" : "rgba(109, 40, 217, 0.8)",
|
|
58
|
-
focusGlow: dark ? "0 0 0 4px rgba(124, 58, 237, 0.18)" : "0 0 0 4px rgba(109, 40, 217, 0.15)",
|
|
59
|
-
},
|
|
60
|
-
checkbox: {
|
|
61
|
-
width: "20px",
|
|
62
|
-
height: "20px",
|
|
63
|
-
accentColor: colors.primary,
|
|
64
|
-
borderColor: dark ? "#475569" : "#CBD5E1",
|
|
65
|
-
hoverBorderColor: dark ? "rgba(34, 211, 238, 0.75)" : "rgba(8, 145, 178, 0.7)",
|
|
66
|
-
checkMarkColor: colors.background,
|
|
67
|
-
borderRadius: "6px",
|
|
68
|
-
},
|
|
69
|
-
},
|
|
70
|
-
animations: {
|
|
71
|
-
enableTypingEffect: false,
|
|
72
|
-
enableGlow: dark,
|
|
73
|
-
transitionDuration: "0.22s",
|
|
74
|
-
},
|
|
75
|
-
};
|
|
76
|
-
}
|
|
1
|
+
/** Build theme JSON template from layout definition */
|
|
2
|
+
|
|
3
|
+
import { PACKAGE_VERSION } from "../contracts/doc-versions.mjs";
|
|
4
|
+
import { THEME_COLORS } from "../data/theme-colors.mjs";
|
|
5
|
+
|
|
6
|
+
export function createThemeTemplate(layout, themeColors = THEME_COLORS) {
|
|
7
|
+
const colors = themeColors[layout.id] ?? themeColors.default;
|
|
8
|
+
const dark = layout.mode === "dark";
|
|
9
|
+
return {
|
|
10
|
+
id: layout.id,
|
|
11
|
+
name: layout.name,
|
|
12
|
+
author: layout.author,
|
|
13
|
+
version: PACKAGE_VERSION,
|
|
14
|
+
mode: layout.mode,
|
|
15
|
+
supportsLightAndDarkModes: layout.supportsLightAndDarkModes,
|
|
16
|
+
colors,
|
|
17
|
+
typography: {
|
|
18
|
+
fontFamily: "-apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, Roboto, Helvetica, Arial, sans-serif",
|
|
19
|
+
fontSize: {
|
|
20
|
+
small: "0.875rem",
|
|
21
|
+
base: "1rem",
|
|
22
|
+
medium: "1.125rem",
|
|
23
|
+
large: "1.25rem",
|
|
24
|
+
xlarge: "2rem",
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
components: {
|
|
28
|
+
header: {
|
|
29
|
+
height: "80px",
|
|
30
|
+
backgroundColor: dark ? "#0B1220" : "#FFFFFF",
|
|
31
|
+
borderBottom: dark ? "1px solid #334155" : "1px solid #E2E8F0",
|
|
32
|
+
},
|
|
33
|
+
footer: {
|
|
34
|
+
height: "60px",
|
|
35
|
+
backgroundColor: dark ? "#0B1220" : "#FFFFFF",
|
|
36
|
+
borderTop: dark ? "1px solid #334155" : "1px solid #E2E8F0",
|
|
37
|
+
},
|
|
38
|
+
card: {
|
|
39
|
+
borderRadius: "16px",
|
|
40
|
+
padding: "24px",
|
|
41
|
+
boxShadow: dark ? "0 18px 60px rgba(0, 0, 0, 0.45)" : "0 18px 50px rgba(15, 23, 42, 0.08)",
|
|
42
|
+
},
|
|
43
|
+
button: {
|
|
44
|
+
borderRadius: "12px",
|
|
45
|
+
padding: "10px 18px",
|
|
46
|
+
border: dark ? "1px solid #334155" : "1px solid #E2E8F0",
|
|
47
|
+
hoverGlow: dark ? "0 0 0 3px rgba(124, 58, 237, 0.18)" : "0 0 0 4px rgba(109, 40, 217, 0.15)",
|
|
48
|
+
},
|
|
49
|
+
select: {
|
|
50
|
+
borderRadius: "12px",
|
|
51
|
+
padding: "10px 40px 10px 16px",
|
|
52
|
+
border: dark ? "1px solid #334155" : "1px solid #E2E8F0",
|
|
53
|
+
backgroundColor: dark ? "#0F172A" : "#FFFFFF",
|
|
54
|
+
textAlign: "center",
|
|
55
|
+
iconColor: colors.secondary,
|
|
56
|
+
hoverBorderColor: dark ? "rgba(34, 211, 238, 0.7)" : "rgba(8, 145, 178, 0.7)",
|
|
57
|
+
focusBorderColor: dark ? "rgba(124, 58, 237, 0.8)" : "rgba(109, 40, 217, 0.8)",
|
|
58
|
+
focusGlow: dark ? "0 0 0 4px rgba(124, 58, 237, 0.18)" : "0 0 0 4px rgba(109, 40, 217, 0.15)",
|
|
59
|
+
},
|
|
60
|
+
checkbox: {
|
|
61
|
+
width: "20px",
|
|
62
|
+
height: "20px",
|
|
63
|
+
accentColor: colors.primary,
|
|
64
|
+
borderColor: dark ? "#475569" : "#CBD5E1",
|
|
65
|
+
hoverBorderColor: dark ? "rgba(34, 211, 238, 0.75)" : "rgba(8, 145, 178, 0.7)",
|
|
66
|
+
checkMarkColor: colors.background,
|
|
67
|
+
borderRadius: "6px",
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
animations: {
|
|
71
|
+
enableTypingEffect: false,
|
|
72
|
+
enableGlow: dark,
|
|
73
|
+
transitionDuration: "0.22s",
|
|
74
|
+
},
|
|
75
|
+
};
|
|
76
|
+
}
|