polen 0.9.1-next.2 → 0.10.0-next.11

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 (469) hide show
  1. package/README.md +49 -364
  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/config/configurator.d.ts +9 -1
  7. package/build/api/config/configurator.d.ts.map +1 -1
  8. package/build/api/config/configurator.js +18 -6
  9. package/build/api/config/configurator.js.map +1 -1
  10. package/build/api/config/load.js +5 -5
  11. package/build/api/config/load.js.map +1 -1
  12. package/build/api/config-resolver/resolve.js +2 -2
  13. package/build/api/config-resolver/resolve.js.map +1 -1
  14. package/build/api/content/$$.d.ts +7 -0
  15. package/build/api/content/$$.d.ts.map +1 -0
  16. package/build/api/content/$$.js +7 -0
  17. package/build/api/content/$$.js.map +1 -0
  18. package/build/api/content/$.d.ts +2 -0
  19. package/build/api/content/$.d.ts.map +1 -0
  20. package/build/api/content/$.js +2 -0
  21. package/build/api/content/$.js.map +1 -0
  22. package/build/api/content/metadata.d.ts +10 -0
  23. package/build/api/content/metadata.d.ts.map +1 -0
  24. package/build/api/content/metadata.js +9 -0
  25. package/build/api/content/metadata.js.map +1 -0
  26. package/build/api/content/navbar.d.ts +10 -0
  27. package/build/api/content/navbar.d.ts.map +1 -0
  28. package/build/api/content/navbar.js +45 -0
  29. package/build/api/content/navbar.js.map +1 -0
  30. package/build/api/content/page.d.ts +11 -0
  31. package/build/api/content/page.d.ts.map +1 -0
  32. package/build/api/content/page.js +2 -0
  33. package/build/api/content/page.js.map +1 -0
  34. package/build/api/content/scan.d.ts +19 -0
  35. package/build/api/content/scan.d.ts.map +1 -0
  36. package/build/api/content/scan.js +90 -0
  37. package/build/api/content/scan.js.map +1 -0
  38. package/build/api/content/sidebar.d.ts +104 -0
  39. package/build/api/content/sidebar.d.ts.map +1 -0
  40. package/build/api/content/sidebar.js +166 -0
  41. package/build/api/content/sidebar.js.map +1 -0
  42. package/build/api/content/utils.d.ts +5 -0
  43. package/build/api/content/utils.d.ts.map +1 -0
  44. package/build/api/content/utils.js +8 -0
  45. package/build/api/content/utils.js.map +1 -0
  46. package/build/api/schema/data-sources/schema-directory/schema-directory.js +1 -1
  47. package/build/api/schema/data-sources/schema-directory/schema-directory.js.map +1 -1
  48. package/build/api/static/index.d.ts +2 -0
  49. package/build/api/static/index.d.ts.map +1 -0
  50. package/build/api/static/index.js +2 -0
  51. package/build/api/static/index.js.map +1 -0
  52. package/build/api/static/manifest.d.ts +18 -0
  53. package/build/api/static/manifest.d.ts.map +1 -0
  54. package/build/api/static/manifest.js +13 -0
  55. package/build/api/static/manifest.js.map +1 -0
  56. package/build/api/static/rebase.d.ts +14 -0
  57. package/build/api/static/rebase.d.ts.map +1 -0
  58. package/build/api/static/rebase.js +110 -0
  59. package/build/api/static/rebase.js.map +1 -0
  60. package/build/api/static/static.d.ts +3 -0
  61. package/build/api/static/static.d.ts.map +1 -0
  62. package/build/api/static/static.js +3 -0
  63. package/build/api/static/static.js.map +1 -0
  64. package/build/api/vite/plugins/branding/index.d.ts +4 -0
  65. package/build/api/vite/plugins/branding/index.d.ts.map +1 -0
  66. package/build/api/vite/plugins/branding/index.js +80 -0
  67. package/build/api/vite/plugins/branding/index.js.map +1 -0
  68. package/build/api/vite/plugins/build.d.ts.map +1 -1
  69. package/build/api/vite/plugins/build.js +22 -1
  70. package/build/api/vite/plugins/build.js.map +1 -1
  71. package/build/api/vite/plugins/core.d.ts +2 -2
  72. package/build/api/vite/plugins/core.d.ts.map +1 -1
  73. package/build/api/vite/plugins/core.js +4 -5
  74. package/build/api/vite/plugins/core.js.map +1 -1
  75. package/build/api/vite/plugins/main.d.ts.map +1 -1
  76. package/build/api/vite/plugins/main.js +2 -1
  77. package/build/api/vite/plugins/main.js.map +1 -1
  78. package/build/api/vite/plugins/pages.d.ts +8 -14
  79. package/build/api/vite/plugins/pages.d.ts.map +1 -1
  80. package/build/api/vite/plugins/pages.js +110 -183
  81. package/build/api/vite/plugins/pages.js.map +1 -1
  82. package/build/api/vite/plugins/serve.js +5 -5
  83. package/build/api/vite/plugins/serve.js.map +1 -1
  84. package/build/cli/_/self-contained-mode.js +5 -5
  85. package/build/cli/_/self-contained-mode.js.map +1 -1
  86. package/build/cli/commands/static/$default.d.ts +3 -0
  87. package/build/cli/commands/static/$default.d.ts.map +1 -0
  88. package/build/cli/commands/static/$default.js +38 -0
  89. package/build/cli/commands/static/$default.js.map +1 -0
  90. package/build/cli/commands/static/rebase.d.ts +2 -0
  91. package/build/cli/commands/static/rebase.d.ts.map +1 -0
  92. package/build/cli/commands/static/rebase.js +26 -0
  93. package/build/cli/commands/static/rebase.js.map +1 -0
  94. package/build/cli/commands/static.d.ts +3 -0
  95. package/build/cli/commands/static.d.ts.map +1 -0
  96. package/build/cli/commands/static.js +5 -0
  97. package/build/cli/commands/static.js.map +1 -0
  98. package/build/exports/components.d.ts +2 -0
  99. package/build/exports/components.d.ts.map +1 -0
  100. package/build/exports/components.js +2 -0
  101. package/build/exports/components.js.map +1 -0
  102. package/build/lib/demos/builder.d.ts +83 -0
  103. package/build/lib/demos/builder.d.ts.map +1 -0
  104. package/build/lib/demos/builder.js +237 -0
  105. package/build/lib/demos/builder.js.map +1 -0
  106. package/build/lib/demos/config-schema.d.ts +243 -0
  107. package/build/lib/demos/config-schema.d.ts.map +1 -0
  108. package/build/lib/demos/config-schema.js +52 -0
  109. package/build/lib/demos/config-schema.js.map +1 -0
  110. package/build/lib/demos/config.d.ts +40 -0
  111. package/build/lib/demos/config.d.ts.map +1 -0
  112. package/build/lib/demos/config.js +180 -0
  113. package/build/lib/demos/config.js.map +1 -0
  114. package/build/lib/demos/index.d.ts +9 -0
  115. package/build/lib/demos/index.d.ts.map +1 -0
  116. package/build/lib/demos/index.js +8 -0
  117. package/build/lib/demos/index.js.map +1 -0
  118. package/build/lib/demos/ui/components.d.ts +33 -0
  119. package/build/lib/demos/ui/components.d.ts.map +1 -0
  120. package/build/lib/demos/ui/components.js +699 -0
  121. package/build/lib/demos/ui/components.js.map +1 -0
  122. package/build/lib/demos/ui/data-collector.d.ts +88 -0
  123. package/build/lib/demos/ui/data-collector.d.ts.map +1 -0
  124. package/build/lib/demos/ui/data-collector.js +174 -0
  125. package/build/lib/demos/ui/data-collector.js.map +1 -0
  126. package/build/lib/demos/ui/landing-page-cli.d.ts +3 -0
  127. package/build/lib/demos/ui/landing-page-cli.d.ts.map +1 -0
  128. package/build/lib/demos/ui/landing-page-cli.js +21 -0
  129. package/build/lib/demos/ui/landing-page-cli.js.map +1 -0
  130. package/build/lib/demos/ui/landing-page.d.ts +32 -0
  131. package/build/lib/demos/ui/landing-page.d.ts.map +1 -0
  132. package/build/lib/demos/ui/landing-page.js +83 -0
  133. package/build/lib/demos/ui/landing-page.js.map +1 -0
  134. package/build/lib/demos/ui/page-renderer.d.ts +26 -0
  135. package/build/lib/demos/ui/page-renderer.d.ts.map +1 -0
  136. package/build/lib/demos/ui/page-renderer.js +104 -0
  137. package/build/lib/demos/ui/page-renderer.js.map +1 -0
  138. package/build/lib/demos/utils.d.ts +14 -0
  139. package/build/lib/demos/utils.d.ts.map +1 -0
  140. package/build/lib/demos/utils.js +37 -0
  141. package/build/lib/demos/utils.js.map +1 -0
  142. package/build/lib/deployment/$$.d.ts +3 -0
  143. package/build/lib/deployment/$$.d.ts.map +1 -0
  144. package/build/lib/deployment/$$.js +3 -0
  145. package/build/lib/deployment/$$.js.map +1 -0
  146. package/build/lib/deployment/$.d.ts +2 -0
  147. package/build/lib/deployment/$.d.ts.map +1 -0
  148. package/build/lib/deployment/$.js +2 -0
  149. package/build/lib/deployment/$.js.map +1 -0
  150. package/build/lib/deployment/metadata.d.ts +32 -0
  151. package/build/lib/deployment/metadata.d.ts.map +1 -0
  152. package/build/lib/deployment/metadata.js +37 -0
  153. package/build/lib/deployment/metadata.js.map +1 -0
  154. package/build/lib/deployment/path-manager.d.ts +41 -0
  155. package/build/lib/deployment/path-manager.d.ts.map +1 -0
  156. package/build/lib/deployment/path-manager.js +157 -0
  157. package/build/lib/deployment/path-manager.js.map +1 -0
  158. package/build/lib/file-router/file-router.d.ts +0 -2
  159. package/build/lib/file-router/file-router.d.ts.map +1 -1
  160. package/build/lib/file-router/file-router.js +0 -2
  161. package/build/lib/file-router/file-router.js.map +1 -1
  162. package/build/lib/file-router/route.d.ts +2 -0
  163. package/build/lib/file-router/route.d.ts.map +1 -1
  164. package/build/lib/file-router/route.js.map +1 -1
  165. package/build/lib/file-router/scan.d.ts.map +1 -1
  166. package/build/lib/file-router/scan.js +22 -13
  167. package/build/lib/file-router/scan.js.map +1 -1
  168. package/build/lib/github-actions/git-controller.d.ts +50 -0
  169. package/build/lib/github-actions/git-controller.d.ts.map +1 -0
  170. package/build/lib/github-actions/git-controller.js +90 -0
  171. package/build/lib/github-actions/git-controller.js.map +1 -0
  172. package/build/lib/github-actions/github-actions.d.ts +7 -0
  173. package/build/lib/github-actions/github-actions.d.ts.map +1 -0
  174. package/build/lib/github-actions/github-actions.js +7 -0
  175. package/build/lib/github-actions/github-actions.js.map +1 -0
  176. package/build/lib/github-actions/index.d.ts +2 -0
  177. package/build/lib/github-actions/index.d.ts.map +1 -0
  178. package/build/lib/github-actions/index.js +2 -0
  179. package/build/lib/github-actions/index.js.map +1 -0
  180. package/build/lib/github-actions/lib/get-pr-deployments.d.ts +12 -0
  181. package/build/lib/github-actions/lib/get-pr-deployments.d.ts.map +1 -0
  182. package/build/lib/github-actions/lib/get-pr-deployments.js +51 -0
  183. package/build/lib/github-actions/lib/get-pr-deployments.js.map +1 -0
  184. package/build/lib/github-actions/pr-controller.d.ts +39 -0
  185. package/build/lib/github-actions/pr-controller.d.ts.map +1 -0
  186. package/build/lib/github-actions/pr-controller.js +122 -0
  187. package/build/lib/github-actions/pr-controller.js.map +1 -0
  188. package/build/lib/github-actions/run-step-cli.d.ts +9 -0
  189. package/build/lib/github-actions/run-step-cli.d.ts.map +1 -0
  190. package/build/lib/github-actions/run-step-cli.js +71 -0
  191. package/build/lib/github-actions/run-step-cli.js.map +1 -0
  192. package/build/lib/github-actions/runner.d.ts +17 -0
  193. package/build/lib/github-actions/runner.d.ts.map +1 -0
  194. package/build/lib/github-actions/runner.js +195 -0
  195. package/build/lib/github-actions/runner.js.map +1 -0
  196. package/build/lib/github-actions/schemas/context.d.ts +933 -0
  197. package/build/lib/github-actions/schemas/context.d.ts.map +1 -0
  198. package/build/lib/github-actions/schemas/context.js +407 -0
  199. package/build/lib/github-actions/schemas/context.js.map +1 -0
  200. package/build/lib/github-actions/schemas/index.d.ts +5 -0
  201. package/build/lib/github-actions/schemas/index.d.ts.map +1 -0
  202. package/build/lib/github-actions/schemas/index.js +5 -0
  203. package/build/lib/github-actions/schemas/index.js.map +1 -0
  204. package/build/lib/github-actions/search-module.d.ts +38 -0
  205. package/build/lib/github-actions/search-module.d.ts.map +1 -0
  206. package/build/lib/github-actions/search-module.js +40 -0
  207. package/build/lib/github-actions/search-module.js.map +1 -0
  208. package/build/lib/github-actions/step.d.ts +163 -0
  209. package/build/lib/github-actions/step.d.ts.map +1 -0
  210. package/build/lib/github-actions/step.js +121 -0
  211. package/build/lib/github-actions/step.js.map +1 -0
  212. package/build/lib/helpers.d.ts.map +1 -1
  213. package/build/lib/helpers.js +5 -3
  214. package/build/lib/helpers.js.map +1 -1
  215. package/build/lib/kit-temp.d.ts +54 -0
  216. package/build/lib/kit-temp.d.ts.map +1 -1
  217. package/build/lib/kit-temp.js +82 -14
  218. package/build/lib/kit-temp.js.map +1 -1
  219. package/build/lib/kit-temp.test-d.d.ts +2 -0
  220. package/build/lib/kit-temp.test-d.d.ts.map +1 -0
  221. package/build/lib/kit-temp.test-d.js +75 -0
  222. package/build/lib/kit-temp.test-d.js.map +1 -0
  223. package/build/lib/mask/$$.d.ts +3 -0
  224. package/build/lib/mask/$$.d.ts.map +1 -0
  225. package/build/lib/mask/$$.js +3 -0
  226. package/build/lib/mask/$$.js.map +1 -0
  227. package/build/lib/mask/$.d.ts +2 -0
  228. package/build/lib/mask/$.d.ts.map +1 -0
  229. package/build/lib/mask/$.js +2 -0
  230. package/build/lib/mask/$.js.map +1 -0
  231. package/build/lib/mask/apply.d.ts +86 -0
  232. package/build/lib/mask/apply.d.ts.map +1 -0
  233. package/build/lib/mask/apply.js +86 -0
  234. package/build/lib/mask/apply.js.map +1 -0
  235. package/build/lib/mask/mask.d.ts +124 -0
  236. package/build/lib/mask/mask.d.ts.map +1 -0
  237. package/build/lib/mask/mask.js +137 -0
  238. package/build/lib/mask/mask.js.map +1 -0
  239. package/build/lib/mask/mask.test-d.d.ts +2 -0
  240. package/build/lib/mask/mask.test-d.d.ts.map +1 -0
  241. package/build/lib/mask/mask.test-d.js +102 -0
  242. package/build/lib/mask/mask.test-d.js.map +1 -0
  243. package/build/lib/mutation-type.d.ts +18 -0
  244. package/build/lib/mutation-type.d.ts.map +1 -0
  245. package/build/lib/mutation-type.js +16 -0
  246. package/build/lib/mutation-type.js.map +1 -0
  247. package/build/lib/task/$$.d.ts +3 -0
  248. package/build/lib/task/$$.d.ts.map +1 -0
  249. package/build/lib/task/$$.js +3 -0
  250. package/build/lib/task/$$.js.map +1 -0
  251. package/build/lib/task/$.d.ts +2 -0
  252. package/build/lib/task/$.d.ts.map +1 -0
  253. package/build/lib/task/$.js +2 -0
  254. package/build/lib/task/$.js.map +1 -0
  255. package/build/lib/task/report.d.ts +28 -0
  256. package/build/lib/task/report.d.ts.map +1 -0
  257. package/build/lib/task/report.js +33 -0
  258. package/build/lib/task/report.js.map +1 -0
  259. package/build/lib/task/task.d.ts +44 -0
  260. package/build/lib/task/task.d.ts.map +1 -0
  261. package/build/lib/task/task.js +63 -0
  262. package/build/lib/task/task.js.map +1 -0
  263. package/build/lib/version-history/index.d.ts +3 -0
  264. package/build/lib/version-history/index.d.ts.map +1 -0
  265. package/build/lib/version-history/index.js +2 -0
  266. package/build/lib/version-history/index.js.map +1 -0
  267. package/build/lib/version-history/types.d.ts +64 -0
  268. package/build/lib/version-history/types.d.ts.map +1 -0
  269. package/build/lib/version-history/types.js +5 -0
  270. package/build/lib/version-history/types.js.map +1 -0
  271. package/build/lib/version-history/version-history.d.ts +85 -0
  272. package/build/lib/version-history/version-history.d.ts.map +1 -0
  273. package/build/lib/version-history/version-history.js +248 -0
  274. package/build/lib/version-history/version-history.js.map +1 -0
  275. package/build/project-data.d.ts +0 -1
  276. package/build/project-data.d.ts.map +1 -1
  277. package/build/sandbox.d.ts +2 -0
  278. package/build/sandbox.d.ts.map +1 -0
  279. package/build/sandbox.js +18 -0
  280. package/build/sandbox.js.map +1 -0
  281. package/build/singletons/debug.d.ts +1 -1
  282. package/build/singletons/debug.d.ts.map +1 -1
  283. package/build/singletons/debug.js +1 -1
  284. package/build/singletons/debug.js.map +1 -1
  285. package/build/template/components/CodeBlockEnhancer.d.ts +2 -0
  286. package/build/template/components/CodeBlockEnhancer.d.ts.map +1 -0
  287. package/build/template/components/CodeBlockEnhancer.jsx +175 -0
  288. package/build/template/components/CodeBlockEnhancer.jsx.map +1 -0
  289. package/build/template/components/HamburgerMenu.d.ts +9 -0
  290. package/build/template/components/HamburgerMenu.d.ts.map +1 -0
  291. package/build/template/components/HamburgerMenu.jsx +53 -0
  292. package/build/template/components/HamburgerMenu.jsx.map +1 -0
  293. package/build/template/components/Link.jsx +1 -1
  294. package/build/template/components/Logo.d.ts +9 -0
  295. package/build/template/components/Logo.d.ts.map +1 -0
  296. package/build/template/components/Logo.jsx +29 -0
  297. package/build/template/components/Logo.jsx.map +1 -0
  298. package/build/template/components/NotFound.d.ts +2 -0
  299. package/build/template/components/NotFound.d.ts.map +1 -0
  300. package/build/template/components/NotFound.jsx +26 -0
  301. package/build/template/components/NotFound.jsx.map +1 -0
  302. package/build/template/components/ThemeToggle.d.ts +3 -0
  303. package/build/template/components/ThemeToggle.d.ts.map +1 -0
  304. package/build/template/components/ThemeToggle.jsx +10 -0
  305. package/build/template/components/ThemeToggle.jsx.map +1 -0
  306. package/build/template/components/content/$$.d.ts +2 -0
  307. package/build/template/components/content/$$.d.ts.map +1 -0
  308. package/build/template/components/content/$$.js +2 -0
  309. package/build/template/components/content/$$.js.map +1 -0
  310. package/build/template/components/sidebar/Sidebar.d.ts +2 -2
  311. package/build/template/components/sidebar/Sidebar.d.ts.map +1 -1
  312. package/build/template/components/sidebar/SidebarItem.d.ts +3 -3
  313. package/build/template/components/sidebar/SidebarItem.d.ts.map +1 -1
  314. package/build/template/components/sidebar/SidebarItem.jsx +3 -3
  315. package/build/template/components/sidebar/SidebarItem.jsx.map +1 -1
  316. package/build/template/contexts/ThemeContext.d.ts +12 -0
  317. package/build/template/contexts/ThemeContext.d.ts.map +1 -0
  318. package/build/template/contexts/ThemeContext.jsx +41 -0
  319. package/build/template/contexts/ThemeContext.jsx.map +1 -0
  320. package/build/template/routes/reference.d.ts.map +1 -1
  321. package/build/template/routes/reference.jsx +4 -8
  322. package/build/template/routes/reference.jsx.map +1 -1
  323. package/build/template/routes/root.d.ts.map +1 -1
  324. package/build/template/routes/root.jsx +192 -55
  325. package/build/template/routes/root.jsx.map +1 -1
  326. package/build/template/server/app.d.ts.map +1 -1
  327. package/build/template/server/app.js +2 -21
  328. package/build/template/server/app.js.map +1 -1
  329. package/package.json +27 -13
  330. package/src/api/api.ts +1 -0
  331. package/src/api/config/configurator.ts +28 -6
  332. package/src/api/config/load.ts +5 -5
  333. package/src/api/config-resolver/resolve.ts +2 -2
  334. package/src/api/content/$$.ts +6 -0
  335. package/src/api/content/$.test.ts +72 -0
  336. package/src/api/content/$.ts +1 -0
  337. package/src/api/content/metadata.ts +11 -0
  338. package/src/api/content/navbar.test.ts +55 -0
  339. package/src/api/content/navbar.ts +61 -0
  340. package/src/api/content/page.ts +12 -0
  341. package/src/api/content/scan.ts +117 -0
  342. package/src/api/content/sidebar.test.ts +297 -0
  343. package/src/api/content/sidebar.ts +283 -0
  344. package/src/api/content/utils.ts +7 -0
  345. package/src/api/schema/data-sources/schema-directory/schema-directory.ts +1 -1
  346. package/src/api/singletons/markdown/markdown.test.ts +1 -1
  347. package/src/api/static/index.ts +1 -0
  348. package/src/api/static/manifest.test.ts +106 -0
  349. package/src/api/static/manifest.ts +16 -0
  350. package/src/api/static/rebase.test.ts +229 -0
  351. package/src/api/static/rebase.ts +140 -0
  352. package/src/api/static/static.ts +2 -0
  353. package/src/api/utils/asset-url/asset-url.test.ts +4 -4
  354. package/src/api/vite/plugins/branding/index.ts +108 -0
  355. package/src/api/vite/plugins/build.ts +25 -1
  356. package/src/api/vite/plugins/core.ts +6 -7
  357. package/src/api/vite/plugins/main.ts +2 -0
  358. package/src/api/vite/plugins/pages.ts +131 -207
  359. package/src/api/vite/plugins/serve.ts +5 -5
  360. package/src/cli/_/self-contained-mode.ts +5 -5
  361. package/src/cli/commands/static/$default.ts +43 -0
  362. package/src/cli/commands/static/rebase.ts +37 -0
  363. package/src/cli/commands/static.ts +6 -0
  364. package/src/exports/components.ts +1 -0
  365. package/src/lib/demos/builder.ts +298 -0
  366. package/src/lib/demos/config-schema.ts +56 -0
  367. package/src/lib/demos/config.test.ts +193 -0
  368. package/src/lib/demos/config.ts +205 -0
  369. package/src/lib/demos/index.ts +9 -0
  370. package/src/lib/demos/ui/components.ts +739 -0
  371. package/src/lib/demos/ui/data-collector.ts +246 -0
  372. package/src/lib/demos/ui/landing-page-cli.ts +23 -0
  373. package/src/lib/demos/ui/landing-page.ts +126 -0
  374. package/src/lib/demos/ui/page-renderer.ts +124 -0
  375. package/src/lib/demos/utils.ts +43 -0
  376. package/src/lib/deployment/$$.ts +2 -0
  377. package/src/lib/deployment/$.test.ts +53 -0
  378. package/src/lib/deployment/$.ts +1 -0
  379. package/src/lib/deployment/metadata.ts +40 -0
  380. package/src/lib/deployment/path-manager.ts +186 -0
  381. package/src/lib/file-router/file-router.ts +0 -2
  382. package/src/lib/file-router/linter.test.ts +2 -0
  383. package/src/lib/file-router/route.ts +2 -0
  384. package/src/lib/file-router/scan.ts +26 -14
  385. package/src/lib/github-actions/git-controller.ts +151 -0
  386. package/src/lib/github-actions/github-actions.ts +6 -0
  387. package/src/lib/github-actions/index.ts +1 -0
  388. package/src/lib/github-actions/lib/get-pr-deployments.ts +76 -0
  389. package/src/lib/github-actions/pr-controller.test.ts +172 -0
  390. package/src/lib/github-actions/pr-controller.ts +183 -0
  391. package/src/lib/github-actions/run-step-cli.ts +84 -0
  392. package/src/lib/github-actions/runner.test.ts +192 -0
  393. package/src/lib/github-actions/runner.ts +226 -0
  394. package/src/lib/github-actions/schemas/context.ts +424 -0
  395. package/src/lib/github-actions/schemas/index.ts +5 -0
  396. package/src/lib/github-actions/search-module.test.ts +110 -0
  397. package/src/lib/github-actions/search-module.ts +76 -0
  398. package/src/lib/github-actions/step.test.ts +149 -0
  399. package/src/lib/github-actions/step.ts +232 -0
  400. package/src/lib/helpers.ts +4 -3
  401. package/src/lib/kit-temp.test-d.ts +115 -0
  402. package/src/lib/kit-temp.test.ts +127 -0
  403. package/src/lib/kit-temp.ts +128 -14
  404. package/src/lib/mask/$$.ts +2 -0
  405. package/src/lib/mask/$.test.ts +248 -0
  406. package/src/lib/mask/$.ts +1 -0
  407. package/src/lib/mask/apply.ts +134 -0
  408. package/src/lib/mask/mask.test-d.ts +144 -0
  409. package/src/lib/mask/mask.ts +244 -0
  410. package/src/lib/mutation-type.ts +20 -0
  411. package/src/lib/shiki/shiki.test.ts +1 -1
  412. package/src/lib/task/$$.ts +2 -0
  413. package/src/lib/task/$.test.ts +209 -0
  414. package/src/lib/task/$.ts +1 -0
  415. package/src/lib/task/report.ts +72 -0
  416. package/src/lib/task/task.ts +112 -0
  417. package/src/lib/version-history/index.test.ts +196 -0
  418. package/src/lib/version-history/index.ts +4 -0
  419. package/src/lib/version-history/types.ts +68 -0
  420. package/src/lib/version-history/version-history.ts +293 -0
  421. package/src/project-data.ts +0 -1
  422. package/src/sandbox.ts +20 -0
  423. package/src/singletons/debug.ts +1 -1
  424. package/src/template/components/CodeBlockEnhancer.tsx +192 -0
  425. package/src/template/components/HamburgerMenu.tsx +96 -0
  426. package/src/template/components/Link.tsx +1 -1
  427. package/src/template/components/Logo.tsx +46 -0
  428. package/src/template/components/NotFound.tsx +28 -0
  429. package/src/template/components/ThemeToggle.tsx +21 -0
  430. package/src/template/components/content/$$.ts +1 -0
  431. package/src/template/components/sidebar/Sidebar.tsx +2 -2
  432. package/src/template/components/sidebar/SidebarItem.tsx +12 -12
  433. package/src/template/contexts/ThemeContext.tsx +60 -0
  434. package/src/template/routes/reference.tsx +4 -8
  435. package/src/template/routes/root.tsx +216 -76
  436. package/src/template/server/app.ts +2 -27
  437. package/build/lib/file-router/scan-tree.d.ts +0 -20
  438. package/build/lib/file-router/scan-tree.d.ts.map +0 -1
  439. package/build/lib/file-router/scan-tree.js +0 -158
  440. package/build/lib/file-router/scan-tree.js.map +0 -1
  441. package/build/lib/file-router/sidebar/index.d.ts +0 -3
  442. package/build/lib/file-router/sidebar/index.d.ts.map +0 -1
  443. package/build/lib/file-router/sidebar/index.js +0 -4
  444. package/build/lib/file-router/sidebar/index.js.map +0 -1
  445. package/build/lib/file-router/sidebar/sidebar-tree.d.ts +0 -9
  446. package/build/lib/file-router/sidebar/sidebar-tree.d.ts.map +0 -1
  447. package/build/lib/file-router/sidebar/sidebar-tree.js +0 -85
  448. package/build/lib/file-router/sidebar/sidebar-tree.js.map +0 -1
  449. package/build/lib/file-router/sidebar/types.d.ts +0 -17
  450. package/build/lib/file-router/sidebar/types.d.ts.map +0 -1
  451. package/build/lib/file-router/sidebar/types.js +0 -2
  452. package/build/lib/file-router/sidebar/types.js.map +0 -1
  453. package/build/lib/tree/index.d.ts +0 -3
  454. package/build/lib/tree/index.d.ts.map +0 -1
  455. package/build/lib/tree/index.js +0 -2
  456. package/build/lib/tree/index.js.map +0 -1
  457. package/build/lib/tree/tree.d.ts +0 -62
  458. package/build/lib/tree/tree.d.ts.map +0 -1
  459. package/build/lib/tree/tree.js +0 -134
  460. package/build/lib/tree/tree.js.map +0 -1
  461. package/src/lib/file-router/scan-tree.test.ts +0 -189
  462. package/src/lib/file-router/scan-tree.ts +0 -205
  463. package/src/lib/file-router/sidebar/index.ts +0 -3
  464. package/src/lib/file-router/sidebar/sidebar-tree.test.ts +0 -123
  465. package/src/lib/file-router/sidebar/sidebar-tree.ts +0 -110
  466. package/src/lib/file-router/sidebar/types.ts +0 -19
  467. package/src/lib/tree/index.ts +0 -2
  468. package/src/lib/tree/tree.test.ts +0 -117
  469. package/src/lib/tree/tree.ts +0 -183
@@ -0,0 +1,192 @@
1
+ import { useEffect } from 'react'
2
+ import { useLocation } from 'react-router'
3
+ import { useTheme } from '../contexts/ThemeContext.tsx'
4
+
5
+ export const CodeBlockEnhancer = () => {
6
+ const { appearance } = useTheme()
7
+ const location = useLocation()
8
+
9
+ useEffect(() => {
10
+ // Add styles for code block enhancements
11
+ const styleId = 'code-block-enhancer-styles'
12
+ let styleElement = document.getElementById(styleId) as HTMLStyleElement
13
+
14
+ if (!styleElement) {
15
+ styleElement = document.createElement('style')
16
+ styleElement.id = styleId
17
+ document.head.appendChild(styleElement)
18
+ }
19
+
20
+ styleElement.textContent = `
21
+ /* Enhanced code block styles */
22
+ pre.shiki {
23
+ position: relative;
24
+ }
25
+
26
+ pre.shiki[data-title] {
27
+ margin-top: 0;
28
+ border-radius: 0 0 8px 8px !important;
29
+ }
30
+
31
+ pre.shiki[data-title]::before {
32
+ content: attr(data-title);
33
+ display: block;
34
+ position: absolute;
35
+ top: -2.5rem;
36
+ left: -1px;
37
+ right: -1px;
38
+ background-color: ${appearance === 'dark' ? '#2a2b3d' : '#f3f4f6'};
39
+ border: 1px solid var(--gray-4);
40
+ border-bottom: 1px solid ${appearance === 'dark' ? '#3a3b4d' : '#e5e7eb'};
41
+ border-radius: 8px 8px 0 0;
42
+ padding: 0.5rem 1rem;
43
+ font-size: 0.875rem;
44
+ font-weight: 500;
45
+ color: var(--gray-11);
46
+ font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
47
+ }
48
+
49
+ pre.shiki[data-title][data-language]::after {
50
+ content: attr(data-language);
51
+ position: absolute;
52
+ top: -2rem;
53
+ right: 1rem;
54
+ font-size: 0.75rem;
55
+ color: var(--gray-9);
56
+ font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
57
+ }
58
+
59
+ .code-block-copy {
60
+ position: absolute;
61
+ top: 0.5rem;
62
+ right: 0.5rem;
63
+ padding: 0.25rem 0.5rem;
64
+ font-size: 0.75rem;
65
+ cursor: pointer;
66
+ border: none;
67
+ border-radius: 4px;
68
+ transition: all 0.2s;
69
+ background-color: ${appearance === 'dark' ? 'rgba(0, 0, 0, 0.5)' : 'rgba(255, 255, 255, 0.8)'};
70
+ backdrop-filter: blur(4px);
71
+ color: ${appearance === 'dark' ? '#fff' : '#000'};
72
+ font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
73
+ }
74
+
75
+ pre.shiki[data-title] .code-block-copy {
76
+ top: -2rem;
77
+ right: 6rem;
78
+ background-color: transparent;
79
+ color: var(--gray-11);
80
+ }
81
+
82
+ .code-block-copy:hover {
83
+ background-color: var(--accent-9) !important;
84
+ color: white !important;
85
+ }
86
+
87
+ .code-block-copy[data-copied="true"] {
88
+ background-color: var(--green-9) !important;
89
+ color: white !important;
90
+ }
91
+ `
92
+
93
+ return () => {
94
+ if (styleElement && styleElement.parentNode) {
95
+ styleElement.parentNode.removeChild(styleElement)
96
+ }
97
+ }
98
+ }, [appearance])
99
+
100
+ useEffect(() => {
101
+ const enhanceCodeBlocks = () => {
102
+ const codeBlocks = document.querySelectorAll('pre.shiki:not([data-enhanced])')
103
+
104
+ codeBlocks.forEach((block) => {
105
+ const preElement = block as HTMLPreElement
106
+ preElement.setAttribute('data-enhanced', 'true')
107
+
108
+ // Get language from class name
109
+ const classes = preElement.className.split(' ')
110
+ const language = classes.find(c => c !== 'shiki' && c !== 'shiki-light' && c !== 'shiki-dark') || 'text'
111
+
112
+ // Check for title in first line
113
+ const codeElement = preElement.querySelector('code')
114
+ if (!codeElement) return
115
+
116
+ const firstLine = codeElement.textContent?.split('\n')[0] || ''
117
+ let title = ''
118
+
119
+ const titleMatch = firstLine.match(/^\/\/\s*title:\s*(.+)$/i)
120
+ if (titleMatch && titleMatch[1]) {
121
+ title = titleMatch[1]
122
+ // Remove title line from display
123
+ const firstLineElement = codeElement.querySelector('span.line') as HTMLElement
124
+ if (firstLineElement) {
125
+ firstLineElement.style.display = 'none'
126
+ }
127
+
128
+ // Set data attributes for CSS
129
+ preElement.setAttribute('data-title', title)
130
+ preElement.setAttribute('data-language', language)
131
+ preElement.style.marginTop = '3rem'
132
+ }
133
+
134
+ // Create copy button
135
+ const copyButton = document.createElement('button')
136
+ copyButton.className = 'code-block-copy'
137
+ copyButton.textContent = 'Copy'
138
+ copyButton.setAttribute('data-copied', 'false')
139
+
140
+ copyButton.onclick = async (e) => {
141
+ e.preventDefault()
142
+ e.stopPropagation()
143
+
144
+ // Get clean code without the title line
145
+ const code = codeElement.textContent || ''
146
+ const cleanCode = title ? code.split('\n').slice(1).join('\n') : code
147
+
148
+ try {
149
+ await navigator.clipboard.writeText(cleanCode)
150
+ copyButton.textContent = 'Copied!'
151
+ copyButton.setAttribute('data-copied', 'true')
152
+ setTimeout(() => {
153
+ copyButton.textContent = 'Copy'
154
+ copyButton.setAttribute('data-copied', 'false')
155
+ }, 2000)
156
+ } catch (err) {
157
+ console.error('Failed to copy:', err)
158
+ }
159
+ }
160
+
161
+ // Append copy button directly to pre element
162
+ preElement.appendChild(copyButton)
163
+ })
164
+ }
165
+
166
+ // Small delay to ensure DOM is ready
167
+ const timeoutId = setTimeout(enhanceCodeBlocks, 100)
168
+
169
+ return () => {
170
+ clearTimeout(timeoutId)
171
+ // Clean up enhanced code blocks
172
+ document.querySelectorAll('pre.shiki[data-enhanced]').forEach(block => {
173
+ block.removeAttribute('data-enhanced')
174
+ block.removeAttribute('data-title')
175
+ block.removeAttribute('data-language')
176
+ const copyButton = block.querySelector('.code-block-copy')
177
+ if (copyButton) {
178
+ copyButton.remove()
179
+ }
180
+ // Restore hidden title lines
181
+ const firstLine = block.querySelector('span.line') as HTMLElement
182
+ if (firstLine && firstLine.style.display === 'none') {
183
+ firstLine.style.display = ''
184
+ }
185
+ // Reset margin
186
+ (block as HTMLElement).style.marginTop = ''
187
+ })
188
+ }
189
+ }, [location.pathname]) // Re-run when route changes
190
+
191
+ return null
192
+ }
@@ -0,0 +1,96 @@
1
+ import type { Content } from '#api/content/$'
2
+ import { Cross2Icon, HamburgerMenuIcon } from '@radix-ui/react-icons'
3
+ import { Box, Flex, IconButton, Text } from '@radix-ui/themes'
4
+ import { useEffect } from 'react'
5
+ import { Sidebar } from '../components/sidebar/Sidebar.tsx'
6
+
7
+ export interface HamburgerMenuProps {
8
+ isOpen: boolean
9
+ onToggle: () => void
10
+ onClose: () => void
11
+ sidebarData: Content.Item[]
12
+ }
13
+
14
+ export const HamburgerMenu: React.FC<HamburgerMenuProps> = ({
15
+ isOpen,
16
+ onToggle,
17
+ onClose,
18
+ sidebarData,
19
+ }) => {
20
+ // Prevent body scroll when mobile menu is open
21
+ useEffect(() => {
22
+ if (isOpen) {
23
+ document.body.style.overflow = 'hidden'
24
+ } else {
25
+ document.body.style.overflow = ''
26
+ }
27
+
28
+ // Cleanup
29
+ return () => {
30
+ document.body.style.overflow = ''
31
+ }
32
+ }, [isOpen])
33
+
34
+ return (
35
+ <>
36
+ {/* Mobile menu button - show on mobile/tablet, hide on desktop */}
37
+ <Box display={{ initial: 'block', xs: 'block', sm: 'block', md: 'none', lg: 'none', xl: 'none' }}>
38
+ <IconButton
39
+ size='2'
40
+ variant='ghost'
41
+ onClick={onToggle}
42
+ aria-label='Toggle navigation menu'
43
+ >
44
+ {isOpen ? <Cross2Icon width='18' height='18' /> : <HamburgerMenuIcon width='18' height='18' />}
45
+ </IconButton>
46
+ </Box>
47
+
48
+ {/* Mobile Sidebar Drawer */}
49
+ {isOpen && (
50
+ <>
51
+ {/* Backdrop */}
52
+ <Box
53
+ position='fixed'
54
+ inset='0'
55
+ style={{
56
+ backgroundColor: 'var(--black-a9)',
57
+ zIndex: 50,
58
+ }}
59
+ onClick={onClose}
60
+ display={{ initial: 'block', xs: 'block', sm: 'block', md: 'none', lg: 'none', xl: 'none' }}
61
+ />
62
+
63
+ {/* Drawer */}
64
+ <Box
65
+ position='fixed'
66
+ top='0'
67
+ left='0'
68
+ bottom='0'
69
+ width='280px'
70
+ style={{
71
+ backgroundColor: 'var(--color-background)',
72
+ boxShadow: 'var(--shadow-6)',
73
+ zIndex: 100,
74
+ overflowY: 'auto',
75
+ }}
76
+ p='4'
77
+ display={{ initial: 'block', xs: 'block', sm: 'block', md: 'none', lg: 'none', xl: 'none' }}
78
+ >
79
+ <Flex justify='between' align='center' mb='4'>
80
+ <Text size='5' weight='bold'>Navigation</Text>
81
+ <IconButton
82
+ size='2'
83
+ variant='ghost'
84
+ onClick={onClose}
85
+ aria-label='Close navigation menu'
86
+ >
87
+ <Cross2Icon width='18' height='18' />
88
+ </IconButton>
89
+ </Flex>
90
+ <Sidebar data={sidebarData} />
91
+ </Box>
92
+ </>
93
+ )}
94
+ </>
95
+ )
96
+ }
@@ -2,7 +2,7 @@ import type { FC } from 'react'
2
2
  import type { LinkProps as LinkPropsReactRouter } from 'react-router'
3
3
  import { Link as LinkReactRouter, useLocation } from 'react-router'
4
4
  // todo: #lib/kit-temp does not work as import
5
- import { ObjPartition } from '../../lib/kit-temp.js'
5
+ import { ObjPartition } from '../../lib/kit-temp.ts'
6
6
  import type { LinkPropsRadix } from './RadixLink.jsx'
7
7
  import { LinkRadix } from './RadixLink.jsx'
8
8
 
@@ -0,0 +1,46 @@
1
+ import { Box, Flex, Text } from '@radix-ui/themes'
2
+
3
+ interface Props {
4
+ src: string
5
+ title?: string
6
+ height?: number
7
+ showTitle?: boolean
8
+ }
9
+
10
+ export const Logo: React.FC<Props> = ({ src, title, height = 30, showTitle = true }) => {
11
+ return (
12
+ <Flex align='center' gap='2'>
13
+ <Box style={{ height, display: 'flex', alignItems: 'center' }}>
14
+ <img
15
+ src={src}
16
+ alt={title}
17
+ height={height}
18
+ className='polen-logo'
19
+ style={{
20
+ height: '100%',
21
+ width: 'auto',
22
+ transition: 'filter 0.2s ease-in-out',
23
+ }}
24
+ />
25
+ </Box>
26
+ {showTitle && (
27
+ <Text size='3' weight='medium'>
28
+ {title}
29
+ </Text>
30
+ )}
31
+ <style>
32
+ {`
33
+ .polen-logo {
34
+ filter: none;
35
+ }
36
+
37
+ @media (prefers-color-scheme: dark) {
38
+ .polen-logo {
39
+ filter: invert(1);
40
+ }
41
+ }
42
+ `}
43
+ </style>
44
+ </Flex>
45
+ )
46
+ }
@@ -0,0 +1,28 @@
1
+ import { Box, Button, Flex, Heading, Text } from '@radix-ui/themes'
2
+ import { Link as LinkReactRouter } from 'react-router'
3
+
4
+ export const NotFound: React.FC = () => {
5
+ return (
6
+ <Flex direction='column' align='center' gap='6' style={{ textAlign: `center`, paddingTop: `4rem` }}>
7
+ <Heading size='9' style={{ color: `var(--gray-12)` }}>404</Heading>
8
+ <Box>
9
+ <Heading size='5' mb='2'>Page Not Found</Heading>
10
+ <Text size='3' color='gray'>
11
+ The page you're looking for doesn't exist or has been moved.
12
+ </Text>
13
+ </Box>
14
+ <Flex gap='3'>
15
+ <LinkReactRouter to='/'>
16
+ <Button variant='soft' size='3'>
17
+ Go Home
18
+ </Button>
19
+ </LinkReactRouter>
20
+ <LinkReactRouter to='/reference'>
21
+ <Button variant='outline' size='3'>
22
+ View API Reference
23
+ </Button>
24
+ </LinkReactRouter>
25
+ </Flex>
26
+ </Flex>
27
+ )
28
+ }
@@ -0,0 +1,21 @@
1
+ import type { React } from '#dep/react/index'
2
+ import { MoonIcon, SunIcon } from '@radix-ui/react-icons'
3
+ import { IconButton } from '@radix-ui/themes'
4
+ import { useTheme } from '../contexts/ThemeContext.tsx'
5
+
6
+ export const ThemeToggle: React.FC = () => {
7
+ const { appearance, toggleTheme } = useTheme()
8
+
9
+ return (
10
+ <IconButton
11
+ size='2'
12
+ variant='ghost'
13
+ color='gray'
14
+ onClick={toggleTheme}
15
+ aria-label={`Switch to ${appearance === 'light' ? 'dark' : 'light'} theme`}
16
+ style={{ cursor: 'pointer' }}
17
+ >
18
+ {appearance === 'light' ? <MoonIcon width='18' height='18' /> : <SunIcon width='18' height='18' />}
19
+ </IconButton>
20
+ )
21
+ }
@@ -0,0 +1 @@
1
+ export { Callout, Tabs } from '@radix-ui/themes'
@@ -1,10 +1,10 @@
1
- import type { FileRouter } from '#lib/file-router/index'
1
+ import type { Content } from '#api/content/$'
2
2
  import { Box } from '@radix-ui/themes'
3
3
  import type { BoxOwnProps, LayoutProps, MarginProps } from '@radix-ui/themes/props'
4
4
  import { Items } from './SidebarItem.tsx'
5
5
 
6
6
  interface SidebarProps extends LayoutProps, MarginProps, BoxOwnProps {
7
- data: FileRouter.Sidebar.Item[]
7
+ data: Content.Item[]
8
8
  style?: React.CSSProperties
9
9
  }
10
10
 
@@ -1,16 +1,16 @@
1
+ import type { Content } from '#api/content/$'
1
2
  import type { React } from '#dep/react/index'
2
- import type { FileRouter } from '#lib/file-router/index'
3
3
  import { Texts } from '#template/components/Texts/index'
4
- import { Box, Flex, Text } from '@radix-ui/themes'
4
+ import { Box, Flex } from '@radix-ui/themes'
5
5
  import { useLocation } from 'react-router'
6
6
  import { getPathActiveReport, Link } from '../Link.tsx'
7
7
 
8
- export const Items: React.FC<{ items: FileRouter.Sidebar.Item[] }> = ({ items }) => {
8
+ export const Items: React.FC<{ items: Content.Item[] }> = ({ items }) => {
9
9
  return (
10
10
  <Flex direction='column' gap='2px'>
11
- {items.map((item) => (
11
+ {items.map((item, index) => (
12
12
  <Item
13
- key={item.pathExp}
13
+ key={`${item.pathExp}-${index}`}
14
14
  item={item}
15
15
  />
16
16
  ))}
@@ -26,7 +26,7 @@ export const Items: React.FC<{ items: FileRouter.Sidebar.Item[] }> = ({ items })
26
26
  //
27
27
  //
28
28
 
29
- export const Item: React.FC<{ item: FileRouter.Sidebar.Item }> = ({ item }) => {
29
+ export const Item: React.FC<{ item: Content.Item }> = ({ item }) => {
30
30
  if (item.type === `ItemLink`) {
31
31
  return <SBLink link={item} />
32
32
  }
@@ -47,7 +47,7 @@ export const Item: React.FC<{ item: FileRouter.Sidebar.Item }> = ({ item }) => {
47
47
  //
48
48
 
49
49
  const SBLink: React.FC<{
50
- link: FileRouter.Sidebar.ItemLink | FileRouter.Sidebar.ItemSection
50
+ link: Content.ItemLink | Content.ItemSection
51
51
  }> = ({ link }) => {
52
52
  const location = useLocation()
53
53
  const currentPathExp = location.pathname
@@ -81,7 +81,7 @@ const SBLink: React.FC<{
81
81
  //
82
82
 
83
83
  const Section: React.FC<{
84
- section: FileRouter.Sidebar.ItemSection
84
+ section: Content.ItemSection
85
85
  }> = ({ section }) => {
86
86
  return (
87
87
  <Box mt='8'>
@@ -104,7 +104,7 @@ const Section: React.FC<{
104
104
  //
105
105
 
106
106
  const LinkedSection: React.FC<{
107
- section: FileRouter.Sidebar.ItemSection
107
+ section: Content.ItemSection
108
108
  }> = ({ section }) => {
109
109
  return (
110
110
  <Box>
@@ -121,9 +121,9 @@ const LinkedSection: React.FC<{
121
121
  borderLeft: `1px solid var(--gray-5)`,
122
122
  }}
123
123
  >
124
- {section.links.map((link) => (
124
+ {section.links.map((link, index) => (
125
125
  <SectionLink
126
- key={link.pathExp}
126
+ key={`${link.pathExp}-${index}`}
127
127
  link={link}
128
128
  />
129
129
  ))}
@@ -133,7 +133,7 @@ const LinkedSection: React.FC<{
133
133
  )
134
134
  }
135
135
 
136
- const SectionLink: React.FC<{ link: FileRouter.Sidebar.ItemLink }> = ({ link }) => {
136
+ const SectionLink: React.FC<{ link: Content.ItemLink }> = ({ link }) => {
137
137
  const location = useLocation()
138
138
  const active = getPathActiveReport(link.pathExp, location.pathname)
139
139
 
@@ -0,0 +1,60 @@
1
+ import type { React } from '#dep/react/index'
2
+ import { createContext, useContext, useEffect, useState } from 'react'
3
+
4
+ type ThemeAppearance = 'light' | 'dark'
5
+
6
+ interface ThemeContextValue {
7
+ appearance: ThemeAppearance
8
+ toggleTheme: () => void
9
+ }
10
+
11
+ const ThemeContext = createContext<ThemeContextValue | undefined>(undefined)
12
+
13
+ const THEME_STORAGE_KEY = 'polen-theme-preference'
14
+
15
+ export const ThemeProvider: React.FC<{ children: React.ReactNode }> = ({ children }) => {
16
+ const [appearance, setAppearance] = useState<ThemeAppearance>(() => {
17
+ // Check if we're in the browser
18
+ if (typeof window === 'undefined') {
19
+ return 'light'
20
+ }
21
+
22
+ // Check localStorage first
23
+ const stored = localStorage.getItem(THEME_STORAGE_KEY)
24
+ if (stored === 'light' || stored === 'dark') {
25
+ return stored
26
+ }
27
+
28
+ // Check system preference
29
+ if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
30
+ return 'dark'
31
+ }
32
+
33
+ return 'light'
34
+ })
35
+
36
+ useEffect(() => {
37
+ // Persist to localStorage
38
+ if (typeof window !== 'undefined') {
39
+ localStorage.setItem(THEME_STORAGE_KEY, appearance)
40
+ }
41
+ }, [appearance])
42
+
43
+ const toggleTheme = () => {
44
+ setAppearance(prev => prev === 'light' ? 'dark' : 'light')
45
+ }
46
+
47
+ return (
48
+ <ThemeContext.Provider value={{ appearance, toggleTheme }}>
49
+ {children}
50
+ </ThemeContext.Provider>
51
+ )
52
+ }
53
+
54
+ export const useTheme = () => {
55
+ const context = useContext(ThemeContext)
56
+ if (!context) {
57
+ throw new Error('useTheme must be used within a ThemeProvider')
58
+ }
59
+ return context
60
+ }
@@ -1,10 +1,9 @@
1
1
  import { createRoute } from '#lib/react-router-aid/react-router-aid'
2
2
  import { createLoader, useLoaderData } from '#lib/react-router-loader/react-router-loader'
3
- import { Container, Flex } from '@radix-ui/themes'
3
+ import { Box } from '@radix-ui/themes'
4
4
  import { Outlet } from 'react-router'
5
5
  import PROJECT_DATA from 'virtual:polen/project/data.jsonsuper'
6
6
  import { MissingSchema } from '../components/MissingSchema.jsx'
7
- import { TypeIndex } from '../components/TypeIndex.jsx'
8
7
  import { reference$type } from './reference.$type.jsx'
9
8
 
10
9
  const loader = createLoader(() => {
@@ -22,12 +21,9 @@ const Component = () => {
22
21
  }
23
22
 
24
23
  return (
25
- <Flex direction='row' align='start'>
26
- <TypeIndex schema={data.schema} />
27
- <Container>
28
- <Outlet />
29
- </Container>
30
- </Flex>
24
+ <Box className="prose">
25
+ <Outlet />
26
+ </Box>
31
27
  )
32
28
  }
33
29