@gitpagedocs/cli 1.1.55 → 1.1.56

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,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,75 +1,76 @@
1
- /** Build theme JSON template from layout definition */
2
-
3
- import { THEME_COLORS } from "../data/theme-colors.mjs";
4
-
5
- export function createThemeTemplate(layout, themeColors = THEME_COLORS) {
6
- const colors = themeColors[layout.id] ?? themeColors.default;
7
- const dark = layout.mode === "dark";
8
- return {
9
- id: layout.id,
10
- name: layout.name,
11
- author: layout.author,
12
- version: "1.1.54",
13
- mode: layout.mode,
14
- supportsLightAndDarkModes: layout.supportsLightAndDarkModes,
15
- colors,
16
- typography: {
17
- fontFamily: "-apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, Roboto, Helvetica, Arial, sans-serif",
18
- fontSize: {
19
- small: "0.875rem",
20
- base: "1rem",
21
- medium: "1.125rem",
22
- large: "1.25rem",
23
- xlarge: "2rem",
24
- },
25
- },
26
- components: {
27
- header: {
28
- height: "80px",
29
- backgroundColor: dark ? "#0B1220" : "#FFFFFF",
30
- borderBottom: dark ? "1px solid #334155" : "1px solid #E2E8F0",
31
- },
32
- footer: {
33
- height: "60px",
34
- backgroundColor: dark ? "#0B1220" : "#FFFFFF",
35
- borderTop: dark ? "1px solid #334155" : "1px solid #E2E8F0",
36
- },
37
- card: {
38
- borderRadius: "16px",
39
- padding: "24px",
40
- boxShadow: dark ? "0 18px 60px rgba(0, 0, 0, 0.45)" : "0 18px 50px rgba(15, 23, 42, 0.08)",
41
- },
42
- button: {
43
- borderRadius: "12px",
44
- padding: "10px 18px",
45
- border: dark ? "1px solid #334155" : "1px solid #E2E8F0",
46
- hoverGlow: dark ? "0 0 0 3px rgba(124, 58, 237, 0.18)" : "0 0 0 4px rgba(109, 40, 217, 0.15)",
47
- },
48
- select: {
49
- borderRadius: "12px",
50
- padding: "10px 40px 10px 16px",
51
- border: dark ? "1px solid #334155" : "1px solid #E2E8F0",
52
- backgroundColor: dark ? "#0F172A" : "#FFFFFF",
53
- textAlign: "center",
54
- iconColor: colors.secondary,
55
- hoverBorderColor: dark ? "rgba(34, 211, 238, 0.7)" : "rgba(8, 145, 178, 0.7)",
56
- focusBorderColor: dark ? "rgba(124, 58, 237, 0.8)" : "rgba(109, 40, 217, 0.8)",
57
- focusGlow: dark ? "0 0 0 4px rgba(124, 58, 237, 0.18)" : "0 0 0 4px rgba(109, 40, 217, 0.15)",
58
- },
59
- checkbox: {
60
- width: "20px",
61
- height: "20px",
62
- accentColor: colors.primary,
63
- borderColor: dark ? "#475569" : "#CBD5E1",
64
- hoverBorderColor: dark ? "rgba(34, 211, 238, 0.75)" : "rgba(8, 145, 178, 0.7)",
65
- checkMarkColor: colors.background,
66
- borderRadius: "6px",
67
- },
68
- },
69
- animations: {
70
- enableTypingEffect: false,
71
- enableGlow: dark,
72
- transitionDuration: "0.22s",
73
- },
74
- };
75
- }
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
+ }