polen 0.10.0-next.3 → 0.10.0-next.4

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.
Files changed (268) hide show
  1. package/README.md +49 -376
  2. package/build/api/api.d.ts +1 -0
  3. package/build/api/api.d.ts.map +1 -1
  4. package/build/api/api.js +1 -0
  5. package/build/api/api.js.map +1 -1
  6. package/build/api/static/index.d.ts +2 -0
  7. package/build/api/static/index.d.ts.map +1 -0
  8. package/build/api/static/index.js +2 -0
  9. package/build/api/static/index.js.map +1 -0
  10. package/build/api/static/manifest.d.ts +18 -0
  11. package/build/api/static/manifest.d.ts.map +1 -0
  12. package/build/api/static/manifest.js +13 -0
  13. package/build/api/static/manifest.js.map +1 -0
  14. package/build/api/static/rebase.d.ts +14 -0
  15. package/build/api/static/rebase.d.ts.map +1 -0
  16. package/build/api/static/rebase.js +110 -0
  17. package/build/api/static/rebase.js.map +1 -0
  18. package/build/api/static/static.d.ts +3 -0
  19. package/build/api/static/static.d.ts.map +1 -0
  20. package/build/api/static/static.js +3 -0
  21. package/build/api/static/static.js.map +1 -0
  22. package/build/api/vite/plugins/build.d.ts.map +1 -1
  23. package/build/api/vite/plugins/build.js +22 -1
  24. package/build/api/vite/plugins/build.js.map +1 -1
  25. package/build/cli/commands/static/$default.d.ts +3 -0
  26. package/build/cli/commands/static/$default.d.ts.map +1 -0
  27. package/build/cli/commands/static/$default.js +38 -0
  28. package/build/cli/commands/static/$default.js.map +1 -0
  29. package/build/cli/commands/static/rebase.d.ts +2 -0
  30. package/build/cli/commands/static/rebase.d.ts.map +1 -0
  31. package/build/cli/commands/static/rebase.js +26 -0
  32. package/build/cli/commands/static/rebase.js.map +1 -0
  33. package/build/cli/commands/static.d.ts +3 -0
  34. package/build/cli/commands/static.d.ts.map +1 -0
  35. package/build/cli/commands/static.js +5 -0
  36. package/build/cli/commands/static.js.map +1 -0
  37. package/build/lib/demos/builder.d.ts +83 -0
  38. package/build/lib/demos/builder.d.ts.map +1 -0
  39. package/build/lib/demos/builder.js +237 -0
  40. package/build/lib/demos/builder.js.map +1 -0
  41. package/build/lib/demos/config-schema.d.ts +243 -0
  42. package/build/lib/demos/config-schema.d.ts.map +1 -0
  43. package/build/lib/demos/config-schema.js +52 -0
  44. package/build/lib/demos/config-schema.js.map +1 -0
  45. package/build/lib/demos/config.d.ts +40 -0
  46. package/build/lib/demos/config.d.ts.map +1 -0
  47. package/build/lib/demos/config.js +180 -0
  48. package/build/lib/demos/config.js.map +1 -0
  49. package/build/lib/demos/index.d.ts +9 -0
  50. package/build/lib/demos/index.d.ts.map +1 -0
  51. package/build/lib/demos/index.js +8 -0
  52. package/build/lib/demos/index.js.map +1 -0
  53. package/build/lib/demos/ui/components.d.ts +33 -0
  54. package/build/lib/demos/ui/components.d.ts.map +1 -0
  55. package/build/lib/demos/ui/components.js +699 -0
  56. package/build/lib/demos/ui/components.js.map +1 -0
  57. package/build/lib/demos/ui/data-collector.d.ts +88 -0
  58. package/build/lib/demos/ui/data-collector.d.ts.map +1 -0
  59. package/build/lib/demos/ui/data-collector.js +174 -0
  60. package/build/lib/demos/ui/data-collector.js.map +1 -0
  61. package/build/lib/demos/ui/landing-page-cli.d.ts +3 -0
  62. package/build/lib/demos/ui/landing-page-cli.d.ts.map +1 -0
  63. package/build/lib/demos/ui/landing-page-cli.js +21 -0
  64. package/build/lib/demos/ui/landing-page-cli.js.map +1 -0
  65. package/build/lib/demos/ui/landing-page.d.ts +32 -0
  66. package/build/lib/demos/ui/landing-page.d.ts.map +1 -0
  67. package/build/lib/demos/ui/landing-page.js +83 -0
  68. package/build/lib/demos/ui/landing-page.js.map +1 -0
  69. package/build/lib/demos/ui/page-renderer.d.ts +26 -0
  70. package/build/lib/demos/ui/page-renderer.d.ts.map +1 -0
  71. package/build/lib/demos/ui/page-renderer.js +104 -0
  72. package/build/lib/demos/ui/page-renderer.js.map +1 -0
  73. package/build/lib/demos/utils.d.ts +14 -0
  74. package/build/lib/demos/utils.d.ts.map +1 -0
  75. package/build/lib/demos/utils.js +37 -0
  76. package/build/lib/demos/utils.js.map +1 -0
  77. package/build/lib/deployment/$$.d.ts +3 -0
  78. package/build/lib/deployment/$$.d.ts.map +1 -0
  79. package/build/lib/deployment/$$.js +3 -0
  80. package/build/lib/deployment/$$.js.map +1 -0
  81. package/build/lib/deployment/$.d.ts +2 -0
  82. package/build/lib/deployment/$.d.ts.map +1 -0
  83. package/build/lib/deployment/$.js +2 -0
  84. package/build/lib/deployment/$.js.map +1 -0
  85. package/build/lib/deployment/metadata.d.ts +32 -0
  86. package/build/lib/deployment/metadata.d.ts.map +1 -0
  87. package/build/lib/deployment/metadata.js +37 -0
  88. package/build/lib/deployment/metadata.js.map +1 -0
  89. package/build/lib/deployment/path-manager.d.ts +41 -0
  90. package/build/lib/deployment/path-manager.d.ts.map +1 -0
  91. package/build/lib/deployment/path-manager.js +157 -0
  92. package/build/lib/deployment/path-manager.js.map +1 -0
  93. package/build/lib/github-actions/git-controller.d.ts +50 -0
  94. package/build/lib/github-actions/git-controller.d.ts.map +1 -0
  95. package/build/lib/github-actions/git-controller.js +90 -0
  96. package/build/lib/github-actions/git-controller.js.map +1 -0
  97. package/build/lib/github-actions/github-actions.d.ts +7 -0
  98. package/build/lib/github-actions/github-actions.d.ts.map +1 -0
  99. package/build/lib/github-actions/github-actions.js +7 -0
  100. package/build/lib/github-actions/github-actions.js.map +1 -0
  101. package/build/lib/github-actions/index.d.ts +2 -0
  102. package/build/lib/github-actions/index.d.ts.map +1 -0
  103. package/build/lib/github-actions/index.js +2 -0
  104. package/build/lib/github-actions/index.js.map +1 -0
  105. package/build/lib/github-actions/lib/get-pr-deployments.d.ts +12 -0
  106. package/build/lib/github-actions/lib/get-pr-deployments.d.ts.map +1 -0
  107. package/build/lib/github-actions/lib/get-pr-deployments.js +51 -0
  108. package/build/lib/github-actions/lib/get-pr-deployments.js.map +1 -0
  109. package/build/lib/github-actions/pr-controller.d.ts +39 -0
  110. package/build/lib/github-actions/pr-controller.d.ts.map +1 -0
  111. package/build/lib/github-actions/pr-controller.js +122 -0
  112. package/build/lib/github-actions/pr-controller.js.map +1 -0
  113. package/build/lib/github-actions/run-step-cli.d.ts +9 -0
  114. package/build/lib/github-actions/run-step-cli.d.ts.map +1 -0
  115. package/build/lib/github-actions/run-step-cli.js +71 -0
  116. package/build/lib/github-actions/run-step-cli.js.map +1 -0
  117. package/build/lib/github-actions/runner.d.ts +17 -0
  118. package/build/lib/github-actions/runner.d.ts.map +1 -0
  119. package/build/lib/github-actions/runner.js +195 -0
  120. package/build/lib/github-actions/runner.js.map +1 -0
  121. package/build/lib/github-actions/schemas/context.d.ts +933 -0
  122. package/build/lib/github-actions/schemas/context.d.ts.map +1 -0
  123. package/build/lib/github-actions/schemas/context.js +407 -0
  124. package/build/lib/github-actions/schemas/context.js.map +1 -0
  125. package/build/lib/github-actions/schemas/index.d.ts +5 -0
  126. package/build/lib/github-actions/schemas/index.d.ts.map +1 -0
  127. package/build/lib/github-actions/schemas/index.js +5 -0
  128. package/build/lib/github-actions/schemas/index.js.map +1 -0
  129. package/build/lib/github-actions/search-module.d.ts +38 -0
  130. package/build/lib/github-actions/search-module.d.ts.map +1 -0
  131. package/build/lib/github-actions/search-module.js +40 -0
  132. package/build/lib/github-actions/search-module.js.map +1 -0
  133. package/build/lib/github-actions/step.d.ts +163 -0
  134. package/build/lib/github-actions/step.d.ts.map +1 -0
  135. package/build/lib/github-actions/step.js +121 -0
  136. package/build/lib/github-actions/step.js.map +1 -0
  137. package/build/lib/helpers.d.ts.map +1 -1
  138. package/build/lib/helpers.js +5 -3
  139. package/build/lib/helpers.js.map +1 -1
  140. package/build/lib/kit-temp.d.ts +54 -0
  141. package/build/lib/kit-temp.d.ts.map +1 -1
  142. package/build/lib/kit-temp.js +80 -14
  143. package/build/lib/kit-temp.js.map +1 -1
  144. package/build/lib/kit-temp.test-d.d.ts +2 -0
  145. package/build/lib/kit-temp.test-d.d.ts.map +1 -0
  146. package/build/lib/kit-temp.test-d.js +75 -0
  147. package/build/lib/kit-temp.test-d.js.map +1 -0
  148. package/build/lib/mask/$$.d.ts +3 -0
  149. package/build/lib/mask/$$.d.ts.map +1 -0
  150. package/build/lib/mask/$$.js +3 -0
  151. package/build/lib/mask/$$.js.map +1 -0
  152. package/build/lib/mask/$.d.ts +2 -0
  153. package/build/lib/mask/$.d.ts.map +1 -0
  154. package/build/lib/mask/$.js +2 -0
  155. package/build/lib/mask/$.js.map +1 -0
  156. package/build/lib/mask/apply.d.ts +86 -0
  157. package/build/lib/mask/apply.d.ts.map +1 -0
  158. package/build/lib/mask/apply.js +86 -0
  159. package/build/lib/mask/apply.js.map +1 -0
  160. package/build/lib/mask/mask.d.ts +124 -0
  161. package/build/lib/mask/mask.d.ts.map +1 -0
  162. package/build/lib/mask/mask.js +137 -0
  163. package/build/lib/mask/mask.js.map +1 -0
  164. package/build/lib/mask/mask.test-d.d.ts +2 -0
  165. package/build/lib/mask/mask.test-d.d.ts.map +1 -0
  166. package/build/lib/mask/mask.test-d.js +102 -0
  167. package/build/lib/mask/mask.test-d.js.map +1 -0
  168. package/build/lib/task/$$.d.ts +3 -0
  169. package/build/lib/task/$$.d.ts.map +1 -0
  170. package/build/lib/task/$$.js +3 -0
  171. package/build/lib/task/$$.js.map +1 -0
  172. package/build/lib/task/$.d.ts +2 -0
  173. package/build/lib/task/$.d.ts.map +1 -0
  174. package/build/lib/task/$.js +2 -0
  175. package/build/lib/task/$.js.map +1 -0
  176. package/build/lib/task/report.d.ts +28 -0
  177. package/build/lib/task/report.d.ts.map +1 -0
  178. package/build/lib/task/report.js +33 -0
  179. package/build/lib/task/report.js.map +1 -0
  180. package/build/lib/task/task.d.ts +44 -0
  181. package/build/lib/task/task.d.ts.map +1 -0
  182. package/build/lib/task/task.js +63 -0
  183. package/build/lib/task/task.js.map +1 -0
  184. package/build/lib/version-history/index.d.ts +3 -0
  185. package/build/lib/version-history/index.d.ts.map +1 -0
  186. package/build/lib/version-history/index.js +2 -0
  187. package/build/lib/version-history/index.js.map +1 -0
  188. package/build/lib/version-history/types.d.ts +64 -0
  189. package/build/lib/version-history/types.d.ts.map +1 -0
  190. package/build/lib/version-history/types.js +5 -0
  191. package/build/lib/version-history/types.js.map +1 -0
  192. package/build/lib/version-history/version-history.d.ts +85 -0
  193. package/build/lib/version-history/version-history.d.ts.map +1 -0
  194. package/build/lib/version-history/version-history.js +248 -0
  195. package/build/lib/version-history/version-history.js.map +1 -0
  196. package/build/sandbox.d.ts +2 -0
  197. package/build/sandbox.d.ts.map +1 -0
  198. package/build/sandbox.js +3 -0
  199. package/build/sandbox.js.map +1 -0
  200. package/build/template/components/Link.jsx +1 -1
  201. package/package.json +16 -9
  202. package/src/api/api.ts +1 -0
  203. package/src/api/singletons/markdown/markdown.test.ts +1 -1
  204. package/src/api/static/index.ts +1 -0
  205. package/src/api/static/manifest.test.ts +106 -0
  206. package/src/api/static/manifest.ts +16 -0
  207. package/src/api/static/rebase.test.ts +229 -0
  208. package/src/api/static/rebase.ts +140 -0
  209. package/src/api/static/static.ts +2 -0
  210. package/src/api/utils/asset-url/asset-url.test.ts +4 -4
  211. package/src/api/vite/plugins/build.ts +25 -1
  212. package/src/api/vite/plugins/core.ts +1 -1
  213. package/src/cli/commands/static/$default.ts +43 -0
  214. package/src/cli/commands/static/rebase.ts +37 -0
  215. package/src/cli/commands/static.ts +6 -0
  216. package/src/lib/demos/builder.ts +298 -0
  217. package/src/lib/demos/config-schema.ts +56 -0
  218. package/src/lib/demos/config.test.ts +193 -0
  219. package/src/lib/demos/config.ts +205 -0
  220. package/src/lib/demos/index.ts +9 -0
  221. package/src/lib/demos/ui/components.ts +739 -0
  222. package/src/lib/demos/ui/data-collector.ts +246 -0
  223. package/src/lib/demos/ui/landing-page-cli.ts +23 -0
  224. package/src/lib/demos/ui/landing-page.ts +126 -0
  225. package/src/lib/demos/ui/page-renderer.ts +124 -0
  226. package/src/lib/demos/utils.ts +43 -0
  227. package/src/lib/deployment/$$.ts +2 -0
  228. package/src/lib/deployment/$.test.ts +53 -0
  229. package/src/lib/deployment/$.ts +1 -0
  230. package/src/lib/deployment/metadata.ts +40 -0
  231. package/src/lib/deployment/path-manager.ts +186 -0
  232. package/src/lib/github-actions/git-controller.ts +151 -0
  233. package/src/lib/github-actions/github-actions.ts +6 -0
  234. package/src/lib/github-actions/index.ts +1 -0
  235. package/src/lib/github-actions/lib/get-pr-deployments.ts +76 -0
  236. package/src/lib/github-actions/pr-controller.test.ts +172 -0
  237. package/src/lib/github-actions/pr-controller.ts +183 -0
  238. package/src/lib/github-actions/run-step-cli.ts +84 -0
  239. package/src/lib/github-actions/runner.test.ts +192 -0
  240. package/src/lib/github-actions/runner.ts +226 -0
  241. package/src/lib/github-actions/schemas/context.ts +424 -0
  242. package/src/lib/github-actions/schemas/index.ts +5 -0
  243. package/src/lib/github-actions/search-module.test.ts +110 -0
  244. package/src/lib/github-actions/search-module.ts +76 -0
  245. package/src/lib/github-actions/step.test.ts +149 -0
  246. package/src/lib/github-actions/step.ts +232 -0
  247. package/src/lib/helpers.ts +4 -3
  248. package/src/lib/kit-temp.test-d.ts +115 -0
  249. package/src/lib/kit-temp.test.ts +127 -0
  250. package/src/lib/kit-temp.ts +126 -14
  251. package/src/lib/mask/$$.ts +2 -0
  252. package/src/lib/mask/$.test.ts +248 -0
  253. package/src/lib/mask/$.ts +1 -0
  254. package/src/lib/mask/apply.ts +134 -0
  255. package/src/lib/mask/mask.test-d.ts +144 -0
  256. package/src/lib/mask/mask.ts +244 -0
  257. package/src/lib/shiki/shiki.test.ts +1 -1
  258. package/src/lib/task/$$.ts +2 -0
  259. package/src/lib/task/$.test.ts +209 -0
  260. package/src/lib/task/$.ts +1 -0
  261. package/src/lib/task/report.ts +72 -0
  262. package/src/lib/task/task.ts +112 -0
  263. package/src/lib/version-history/index.test.ts +188 -0
  264. package/src/lib/version-history/index.ts +4 -0
  265. package/src/lib/version-history/types.ts +68 -0
  266. package/src/lib/version-history/version-history.ts +293 -0
  267. package/src/sandbox.ts +1 -0
  268. package/src/template/components/Link.tsx +1 -1
@@ -0,0 +1,739 @@
1
+ /**
2
+ * UI component generators for demo landing pages
3
+ */
4
+
5
+ import { getDemoConfig } from '../index.ts'
6
+ import type { DemoMetadata, LandingPageData } from './data-collector.ts'
7
+
8
+ /**
9
+ * CSS styles for the demo landing page
10
+ */
11
+ export const getDemoPageStyles = () => {
12
+ const config = getDemoConfig().fullConfig
13
+ const theme = config.ui.theme
14
+
15
+ return `
16
+ * {
17
+ margin: 0;
18
+ padding: 0;
19
+ box-sizing: border-box;
20
+ }
21
+
22
+ body {
23
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
24
+ line-height: 1.6;
25
+ color: ${theme.textColor};
26
+ background: ${theme.backgroundColor};
27
+ }
28
+
29
+ .container {
30
+ max-width: 1200px;
31
+ margin: 0 auto;
32
+ padding: 2rem;
33
+ }
34
+
35
+ .header {
36
+ margin-bottom: 4rem;
37
+ padding: 3rem 0;
38
+ border-bottom: 1px solid ${theme.primaryColor};
39
+ }
40
+
41
+ .header h1 {
42
+ font-size: 2.5rem;
43
+ font-weight: 400;
44
+ margin-bottom: 0.5rem;
45
+ letter-spacing: -0.02em;
46
+ }
47
+
48
+ .header p {
49
+ font-size: 1rem;
50
+ color: ${theme.textColor};
51
+ max-width: 600px;
52
+ }
53
+
54
+ .demos-grid {
55
+ display: grid;
56
+ grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
57
+ gap: 2rem;
58
+ margin-bottom: 3rem;
59
+ }
60
+
61
+ .demo-card {
62
+ background: ${theme.backgroundColor};
63
+ padding: 2rem;
64
+ border: 1px solid ${theme.primaryColor};
65
+ transition: all 0.2s ease;
66
+ }
67
+
68
+ .demo-card:hover {
69
+ transform: translateY(-2px);
70
+ }
71
+
72
+ .demo-card h2 {
73
+ font-size: 1.25rem;
74
+ margin-bottom: 0.5rem;
75
+ color: ${theme.textColor};
76
+ font-weight: 600;
77
+ letter-spacing: -0.01em;
78
+ }
79
+
80
+ .demo-card p {
81
+ color: ${theme.textColor};
82
+ margin-bottom: 1.5rem;
83
+ font-size: 0.875rem;
84
+ line-height: 1.5;
85
+ }
86
+
87
+ .demo-link {
88
+ display: inline-flex;
89
+ align-items: center;
90
+ gap: 0.5rem;
91
+ background: ${theme.primaryColor};
92
+ color: ${theme.backgroundColor};
93
+ text-decoration: none;
94
+ padding: 0.625rem 1.25rem;
95
+ font-size: 0.875rem;
96
+ font-weight: 500;
97
+ transition: all 0.2s ease;
98
+ border: 1px solid ${theme.primaryColor};
99
+ }
100
+
101
+ .demo-link:hover {
102
+ background: ${theme.backgroundColor};
103
+ color: ${theme.primaryColor};
104
+ }
105
+
106
+ .demo-link svg {
107
+ width: 16px;
108
+ height: 16px;
109
+ }
110
+
111
+ .demo-links {
112
+ display: flex;
113
+ flex-direction: column;
114
+ gap: 1rem;
115
+ margin-top: 1.5rem;
116
+ }
117
+
118
+ .dist-tags {
119
+ display: flex;
120
+ flex-direction: column;
121
+ gap: 0.75rem;
122
+ }
123
+
124
+ .dist-tag-button {
125
+ display: flex;
126
+ align-items: stretch;
127
+ border: 1px solid ${theme.primaryColor};
128
+ overflow: hidden;
129
+ }
130
+
131
+ .dist-tag-label {
132
+ flex: 1;
133
+ padding: 0.625rem 1.25rem;
134
+ font-size: 0.875rem;
135
+ font-weight: 500;
136
+ display: flex;
137
+ align-items: center;
138
+ gap: 0.5rem;
139
+ background: ${theme.primaryColor};
140
+ color: ${theme.backgroundColor};
141
+ text-decoration: none;
142
+ transition: all 0.2s ease;
143
+ }
144
+
145
+ .dist-tag-label svg {
146
+ width: 16px;
147
+ height: 16px;
148
+ transition: transform 0.2s ease;
149
+ }
150
+
151
+ .dist-tag-label:hover svg {
152
+ transform: translateX(4px);
153
+ }
154
+
155
+ .dist-tag-version {
156
+ padding: 0.625rem 1.25rem;
157
+ border-left: 1px solid rgba(255, 255, 255, 0.2);
158
+ font-family: monospace;
159
+ font-size: 0.875rem;
160
+ background: ${theme.primaryColor};
161
+ color: ${theme.backgroundColor};
162
+ text-decoration: none;
163
+ display: flex;
164
+ align-items: center;
165
+ transition: all 0.2s ease;
166
+ }
167
+
168
+ /* Hover states */
169
+ .dist-tag-button:hover .dist-tag-label,
170
+ .dist-tag-button:hover .dist-tag-version {
171
+ background: ${theme.backgroundColor};
172
+ color: rgba(0, 0, 0, 0.5);
173
+ }
174
+
175
+ .dist-tag-button:hover .dist-tag-version {
176
+ border-left-color: rgba(0, 0, 0, 0.2);
177
+ }
178
+
179
+ .dist-tag-label:hover {
180
+ color: ${theme.primaryColor} !important;
181
+ }
182
+
183
+ .dist-tag-version:hover {
184
+ color: ${theme.primaryColor} !important;
185
+ }
186
+
187
+ .permalink-icon {
188
+ display: inline-block;
189
+ transition: transform 0.2s ease;
190
+ margin-left: 0.75rem;
191
+ transform-origin: center center;
192
+ }
193
+
194
+ .dist-tag-version:hover .permalink-icon {
195
+ transform: rotate(15deg) translateY(-1px);
196
+ }
197
+
198
+ .previous-versions {
199
+ margin-top: 1rem;
200
+ padding-top: 1rem;
201
+ border-top: 1px solid #e0e0e0;
202
+ }
203
+
204
+ .previous-versions h3 {
205
+ font-size: 0.875rem;
206
+ font-weight: 600;
207
+ margin-bottom: 0.5rem;
208
+ }
209
+
210
+ .commit-links {
211
+ display: flex;
212
+ flex-wrap: wrap;
213
+ gap: 0.5rem;
214
+ font-size: 0.75rem;
215
+ }
216
+
217
+ .commit-link {
218
+ padding: 0.25rem 0.5rem;
219
+ border: 1px solid ${theme.primaryColor};
220
+ text-decoration: none;
221
+ color: ${theme.primaryColor};
222
+ font-family: monospace;
223
+ transition: all 0.2s ease;
224
+ }
225
+
226
+ .commit-link:hover {
227
+ background: ${theme.primaryColor};
228
+ color: ${theme.backgroundColor};
229
+ }
230
+
231
+ .current-deployment {
232
+ margin-top: 1rem;
233
+ font-size: 0.875rem;
234
+ color: #666;
235
+ }
236
+
237
+ .current-deployment span {
238
+ color: ${theme.primaryColor};
239
+ }
240
+
241
+ .footer {
242
+ text-align: center;
243
+ padding: 3rem 0;
244
+ color: ${theme.primaryColor};
245
+ border-top: 1px solid ${theme.primaryColor};
246
+ font-size: 0.875rem;
247
+ }
248
+
249
+ .footer a {
250
+ color: ${theme.primaryColor};
251
+ text-decoration: underline;
252
+ }
253
+
254
+ .footer a:hover {
255
+ text-decoration: none;
256
+ }
257
+
258
+ .disabled {
259
+ opacity: 0.4;
260
+ cursor: not-allowed;
261
+ }
262
+
263
+ .disabled .demo-link {
264
+ background: ${theme.backgroundColor};
265
+ color: ${theme.primaryColor};
266
+ pointer-events: none;
267
+ width: 100%;
268
+ justify-content: center;
269
+ }
270
+
271
+ .version-info {
272
+ margin-top: 3rem;
273
+ padding: 2rem;
274
+ background: #f8f8f8;
275
+ border: 1px solid #e0e0e0;
276
+ }
277
+
278
+ .version-info h3 {
279
+ font-size: 1.125rem;
280
+ margin-bottom: 1rem;
281
+ color: ${theme.textColor};
282
+ }
283
+
284
+ .version-list {
285
+ display: flex;
286
+ flex-wrap: wrap;
287
+ gap: 0.5rem;
288
+ }
289
+
290
+ .version-tag {
291
+ padding: 0.25rem 0.75rem;
292
+ background: ${theme.primaryColor};
293
+ color: ${theme.backgroundColor};
294
+ text-decoration: none;
295
+ font-size: 0.75rem;
296
+ font-weight: 500;
297
+ border-radius: 3px;
298
+ }
299
+
300
+ .version-tag.latest {
301
+ background: #0066cc;
302
+ }
303
+
304
+ .version-tag.next {
305
+ background: #ff6600;
306
+ }
307
+
308
+ .pr-section {
309
+ margin-top: 3rem;
310
+ padding: 2rem;
311
+ background: #f0f8ff;
312
+ border: 1px solid #b3d9ff;
313
+ }
314
+
315
+ .pr-section h3 {
316
+ color: #0066cc;
317
+ margin-bottom: 1rem;
318
+ }
319
+
320
+ .pr-list {
321
+ display: grid;
322
+ gap: 1rem;
323
+ }
324
+
325
+ .pr-item {
326
+ padding: 1rem;
327
+ background: white;
328
+ border: 1px solid #ddd;
329
+ }
330
+
331
+ .pr-item h4 {
332
+ color: #0066cc;
333
+ margin-bottom: 0.5rem;
334
+ }
335
+
336
+ .back-link {
337
+ color: ${theme.textColor};
338
+ text-decoration: none;
339
+ display: inline-flex;
340
+ align-items: center;
341
+ gap: 0.5rem;
342
+ margin-bottom: 2rem;
343
+ font-size: 0.875rem;
344
+ }
345
+
346
+ .back-link:hover {
347
+ text-decoration: underline;
348
+ }
349
+
350
+ .pr-banner {
351
+ background: ${theme.primaryColor};
352
+ color: ${theme.backgroundColor};
353
+ padding: 1rem 0;
354
+ margin-bottom: 0;
355
+ border-bottom: 2px solid ${theme.primaryColor};
356
+ }
357
+
358
+ .pr-banner .container {
359
+ display: flex;
360
+ justify-content: space-between;
361
+ align-items: center;
362
+ gap: 2rem;
363
+ flex-wrap: wrap;
364
+ max-width: 1200px;
365
+ margin: 0 auto;
366
+ padding: 0 2rem;
367
+ }
368
+
369
+ .pr-banner-content {
370
+ display: flex;
371
+ align-items: center;
372
+ gap: 1rem;
373
+ }
374
+
375
+ .pr-banner-badge {
376
+ background: ${theme.backgroundColor};
377
+ color: ${theme.primaryColor};
378
+ padding: 0.25rem 0.75rem;
379
+ font-size: 0.75rem;
380
+ font-weight: 600;
381
+ text-transform: uppercase;
382
+ letter-spacing: 0.05em;
383
+ }
384
+
385
+ .pr-banner-text {
386
+ font-size: 0.875rem;
387
+ }
388
+
389
+ .pr-banner-links {
390
+ display: flex;
391
+ gap: 1rem;
392
+ align-items: center;
393
+ }
394
+
395
+ .pr-banner-link {
396
+ color: ${theme.backgroundColor};
397
+ text-decoration: none;
398
+ font-size: 0.875rem;
399
+ display: flex;
400
+ align-items: center;
401
+ gap: 0.5rem;
402
+ padding: 0.5rem 1rem;
403
+ border: 1px solid ${theme.backgroundColor};
404
+ transition: all 0.2s ease;
405
+ }
406
+
407
+ .pr-banner-link:hover {
408
+ background: ${theme.backgroundColor};
409
+ color: ${theme.primaryColor};
410
+ }
411
+
412
+ .pr-banner-link svg {
413
+ width: 16px;
414
+ height: 16px;
415
+ }
416
+
417
+ @media (max-width: 768px) {
418
+ .container {
419
+ padding: 1rem;
420
+ }
421
+
422
+ .header h1 {
423
+ font-size: 2rem;
424
+ }
425
+
426
+ .demos-grid {
427
+ grid-template-columns: 1fr;
428
+ gap: 1rem;
429
+ }
430
+
431
+ .demo-card {
432
+ padding: 1.5rem;
433
+ }
434
+
435
+ .pr-banner .container {
436
+ flex-direction: column;
437
+ align-items: flex-start;
438
+ gap: 1rem;
439
+ padding: 0 1rem;
440
+ }
441
+
442
+ .pr-banner-links {
443
+ width: 100%;
444
+ flex-direction: column;
445
+ align-items: stretch;
446
+ }
447
+
448
+ .pr-banner-link {
449
+ justify-content: center;
450
+ }
451
+ }
452
+ `
453
+ }
454
+
455
+ /**
456
+ * Generate PR banner HTML
457
+ */
458
+ export const generatePrBanner = (prNumber: string): string => {
459
+ // These should be set by the GitHub Actions environment
460
+ const repoOwner = process.env['GITHUB_REPOSITORY_OWNER'] || 'the-guild-org'
461
+ const repoName = process.env['GITHUB_REPOSITORY']?.split('/')[1] || 'polen'
462
+
463
+ return `
464
+ <div class="pr-banner">
465
+ <div class="container">
466
+ <div class="pr-banner-content">
467
+ <span class="pr-banner-badge">PR Preview</span>
468
+ <span class="pr-banner-text">You're viewing a preview deployment for Pull Request #${prNumber}</span>
469
+ </div>
470
+ <div class="pr-banner-links">
471
+ <a href="https://github.com/${repoOwner}/${repoName}/pull/${prNumber}" class="pr-banner-link" target="_blank">
472
+ <svg fill="none" viewBox="0 0 24 24" stroke="currentColor">
473
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14" />
474
+ </svg>
475
+ View PR on GitHub
476
+ </a>
477
+ <a href="https://${repoOwner}.github.io/${repoName}/" class="pr-banner-link">
478
+ <svg fill="none" viewBox="0 0 24 24" stroke="currentColor">
479
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6" />
480
+ </svg>
481
+ Go to Production Demos
482
+ </a>
483
+ </div>
484
+ </div>
485
+ </div>
486
+ `
487
+ }
488
+
489
+ /**
490
+ * Generate header HTML
491
+ */
492
+ export const generateHeader = (data: LandingPageData): string => {
493
+ const config = getDemoConfig().fullConfig
494
+ const { mode, prNumber } = data.config
495
+
496
+ let title = config.ui.branding.title
497
+ let description = config.ui.branding.description
498
+
499
+ if (prNumber) {
500
+ title = `${title} - PR #${prNumber} Preview`
501
+ description = `Preview of changes in pull request #${prNumber}`
502
+ }
503
+
504
+ return `
505
+ <div class="header">
506
+ <h1>${title}</h1>
507
+ <p>${description}</p>
508
+ </div>
509
+ `
510
+ }
511
+
512
+ /**
513
+ * Generate demo card HTML for the demos landing page
514
+ */
515
+ export const generateDemoCard = (
516
+ name: string,
517
+ metadata: DemoMetadata,
518
+ data: LandingPageData,
519
+ ): string => {
520
+ const { title, description, enabled } = metadata
521
+ const { basePath, prNumber, currentSha } = data.config
522
+ const { distTags, trunkDeployments, prDeployments } = data
523
+
524
+ if (!enabled) {
525
+ return `<div class="demo-card disabled">
526
+ <h2>${title}</h2>
527
+ <p>${description}</p>
528
+ <span class="demo-link">
529
+ Coming Soon
530
+ </span>
531
+ </div>`
532
+ }
533
+
534
+ // Get previous deployments for PR from the passed data
535
+ let previousDeployments: string[] = []
536
+ if (prNumber && prDeployments) {
537
+ const currentPr = prDeployments.find(pr => pr.number.toString() === prNumber)
538
+ if (currentPr && currentPr.previousDeployments) {
539
+ previousDeployments = currentPr.previousDeployments.filter(sha => sha !== currentSha)
540
+ }
541
+ }
542
+
543
+ return `<div class="demo-card">
544
+ <h2>${title}</h2>
545
+ <p>${description}</p>
546
+ <div class="demo-links">
547
+ ${
548
+ // For trunk deployments, show dist-tag buttons
549
+ !prNumber
550
+ ? distTags && Object.entries(distTags).length > 0
551
+ ? `<div class="dist-tags">
552
+ ${
553
+ Object.entries(distTags)
554
+ .sort(([a], [b]) => a === 'latest' ? -1 : b === 'latest' ? 1 : 0)
555
+ .filter(([tag, version]) => {
556
+ // If next points to the same version as latest, filter it out
557
+ if (tag === 'next' && distTags['latest'] === version) {
558
+ return false
559
+ }
560
+ return true
561
+ })
562
+ .map(([tag, version]) => `
563
+ <div class="dist-tag-button">
564
+ <a href="${basePath}${tag}/${name}/" class="dist-tag-label">
565
+ ${tag}
566
+ <svg fill="none" viewBox="0 0 24 24" stroke="currentColor">
567
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M14 5l7 7m0 0l-7 7m7-7H3" />
568
+ </svg>
569
+ </a>
570
+ <a href="${basePath}${version}/${name}/" class="dist-tag-version">${version}<span class="permalink-icon">¶</span></a>
571
+ </div>
572
+ `).join('')
573
+ }
574
+ ${
575
+ // Show "no prereleases" message if next === latest
576
+ distTags && distTags['next'] && distTags['next'] === distTags['latest']
577
+ ? '<div class="disabled" style="margin-top: 0.75rem;"><span class="demo-link" style="width: 100%; justify-content: center;">No pre-releases since latest</span></div>'
578
+ : ''}
579
+ </div>`
580
+ : trunkDeployments && trunkDeployments.latest
581
+ ? `<a href="${basePath}latest/${name}/" class="demo-link">
582
+ View Latest (${trunkDeployments.latest.tag || trunkDeployments.latest.shortSha})
583
+ <svg fill="none" viewBox="0 0 24 24" stroke="currentColor">
584
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M14 5l7 7m0 0l-7 7m7-7H3" />
585
+ </svg>
586
+ </a>`
587
+ : '<p style="color: #666; font-size: 0.875rem;">No deployments available</p>'
588
+ // For PR deployments
589
+ : prDeployments && prDeployments.length > 0
590
+ ? currentSha
591
+ // If we have currentSha, show the specific deployment
592
+ ? `<div class="dist-tags">
593
+ <div class="dist-tag-button">
594
+ <a href="${basePath}latest/${name}/" class="dist-tag-label">
595
+ latest
596
+ <svg fill="none" viewBox="0 0 24 24" stroke="currentColor">
597
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M14 5l7 7m0 0l-7 7m7-7H3" />
598
+ </svg>
599
+ </a>
600
+ <a href="${basePath}${currentSha}/${name}/" class="dist-tag-version">${
601
+ currentSha.substring(0, 7)
602
+ }<span class="permalink-icon">¶</span></a>
603
+ </div>
604
+ </div>`
605
+ // Otherwise show available deployments for this PR
606
+ : prDeployments[0]?.sha
607
+ ? `<div class="dist-tags">
608
+ <div class="dist-tag-button">
609
+ <a href="${basePath}latest/${name}/" class="dist-tag-label">
610
+ latest
611
+ <svg fill="none" viewBox="0 0 24 24" stroke="currentColor">
612
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M14 5l7 7m0 0l-7 7m7-7H3" />
613
+ </svg>
614
+ </a>
615
+ <a href="${basePath}${prDeployments[0].sha}/${name}/" class="dist-tag-version">${
616
+ prDeployments[0].sha
617
+ }<span class="permalink-icon">¶</span></a>
618
+ </div>
619
+ </div>`
620
+ : '<p style="color: #666; font-size: 0.875rem;">No deployments available</p>'
621
+ : '<p style="color: #666; font-size: 0.875rem;">No deployments available</p>'}
622
+ <div class="previous-versions">
623
+ <h3>Previous Versions</h3>
624
+ ${
625
+ // For trunk deployments, use parsedTrunkDeployments
626
+ !prNumber && trunkDeployments
627
+ ? trunkDeployments.previous.length > 0
628
+ ? `<div class="commit-links">
629
+ ${
630
+ trunkDeployments.previous.map(deployment => {
631
+ // For semver deployments, tag and sha are the same, so just show once
632
+ const label = deployment.tag || deployment.shortSha
633
+ return `<a href="${basePath}${deployment.sha}/${name}/" class="commit-link">${label}</a>`
634
+ }).join('')
635
+ }
636
+ </div>`
637
+ : '<p style="color: #666; font-size: 0.875rem; margin: 0;">(none)</p>'
638
+ // For PR deployments, use the existing logic
639
+ : previousDeployments.length > 0
640
+ ? `<div class="commit-links">
641
+ ${
642
+ previousDeployments.map(sha => `
643
+ <a href="${basePath}${sha}/${name}/" class="commit-link">${sha.substring(0, 7)}</a>
644
+ `).join('')
645
+ }
646
+ </div>`
647
+ : '<p style="color: #666; font-size: 0.875rem; margin: 0;">(none)</p>'}
648
+ </div>
649
+ </div>
650
+ </div>`
651
+ }
652
+
653
+ /**
654
+ * Generate demos grid HTML
655
+ */
656
+ export const generateDemosGrid = (data: LandingPageData): string => {
657
+ const { demoMetadata, demoExamples } = data
658
+ const orderedExamples = getDemoConfig().getOrderedDemos(demoExamples)
659
+
660
+ // Add disabled demos to the list
661
+ const allDemos = [...orderedExamples]
662
+ for (const [name, metadata] of Object.entries(demoMetadata)) {
663
+ if (!metadata.enabled && !allDemos.includes(name)) {
664
+ allDemos.push(name)
665
+ }
666
+ }
667
+
668
+ const demoCards = allDemos
669
+ .map(name => generateDemoCard(name, demoMetadata[name] || { title: name, description: '', enabled: true }, data))
670
+ .join('')
671
+
672
+ return `
673
+ <div class="demos-grid">
674
+ ${demoCards}
675
+ </div>
676
+ `
677
+ }
678
+
679
+ /**
680
+ * Generate version information section
681
+ */
682
+ export const generateVersionInfo = (data: LandingPageData): string => {
683
+ const { trunkDeployments, distTags } = data
684
+
685
+ if (!trunkDeployments) return ''
686
+
687
+ const basePath = data.config.basePath || '/'
688
+
689
+ const distTagsHtml = distTags
690
+ ? Object.entries(distTags)
691
+ .map(([tag, version]) => {
692
+ const className = tag === 'latest'
693
+ ? 'version-tag latest'
694
+ : tag === 'next'
695
+ ? 'version-tag next'
696
+ : 'version-tag'
697
+ return `<a href="${basePath}${version}/" class="${className}">${tag}: ${version}</a>`
698
+ })
699
+ .join('')
700
+ : ''
701
+
702
+ const previousVersionsHtml = trunkDeployments.previous && trunkDeployments.previous.length > 0
703
+ ? trunkDeployments.previous
704
+ .slice(0, 10) // Limit to recent versions
705
+ .map(version => `<a href="${basePath}${version.tag}/" class="version-tag">${version.tag}</a>`)
706
+ .join('')
707
+ : ''
708
+
709
+ // Only show the version info section if there's content to display
710
+ if (!distTagsHtml && !previousVersionsHtml) {
711
+ return ''
712
+ }
713
+
714
+ return `
715
+ <div class="version-info">
716
+ <h3>Available Versions</h3>
717
+ ${distTagsHtml ? `<div class="version-list">${distTagsHtml}</div>` : ''}
718
+ ${
719
+ previousVersionsHtml
720
+ ? `
721
+ <h4 style="margin: 1rem 0 0.5rem 0; font-size: 0.875rem; color: #666;">Previous Versions:</h4>
722
+ <div class="version-list">${previousVersionsHtml}</div>
723
+ `
724
+ : ''
725
+ }
726
+ </div>
727
+ `
728
+ }
729
+
730
+ /**
731
+ * Generate footer section
732
+ */
733
+ export const generateFooter = (): string => {
734
+ return `
735
+ <div class="footer">
736
+ <p>Built with <a href="https://github.com/the-guild-org/polen" target="_blank">Polen</a> - The delightful GraphQL documentation framework</p>
737
+ </div>
738
+ `
739
+ }