polen 0.11.0-next.24 → 0.11.0-next.26

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 (375) hide show
  1. package/build/api/config/input.d.ts +259 -77
  2. package/build/api/config/input.d.ts.map +1 -1
  3. package/build/api/config/input.js +2 -0
  4. package/build/api/config/input.js.map +1 -1
  5. package/build/api/config/normalized.d.ts +433 -143
  6. package/build/api/config/normalized.d.ts.map +1 -1
  7. package/build/api/config/normalized.js +47 -0
  8. package/build/api/config/normalized.js.map +1 -1
  9. package/build/api/config-template/template.d.ts +191 -121
  10. package/build/api/config-template/template.d.ts.map +1 -1
  11. package/build/api/config-template/template.js +18 -1
  12. package/build/api/config-template/template.js.map +1 -1
  13. package/build/api/examples/diagnostic/diagnostic.d.ts +0 -23
  14. package/build/api/examples/diagnostic/diagnostic.d.ts.map +1 -1
  15. package/build/api/examples/diagnostic/diagnostic.js +1 -3
  16. package/build/api/examples/diagnostic/diagnostic.js.map +1 -1
  17. package/build/api/examples/scanner.d.ts +27 -1
  18. package/build/api/examples/scanner.d.ts.map +1 -1
  19. package/build/api/examples/scanner.js +30 -17
  20. package/build/api/examples/scanner.js.map +1 -1
  21. package/build/api/examples/schemas/catalog.d.ts +56 -12
  22. package/build/api/examples/schemas/catalog.d.ts.map +1 -1
  23. package/build/api/examples/schemas/example/example.d.ts +54 -11
  24. package/build/api/examples/schemas/example/example.d.ts.map +1 -1
  25. package/build/api/examples/schemas/example/example.js +5 -0
  26. package/build/api/examples/schemas/example/example.js.map +1 -1
  27. package/build/api/reference/$.d.ts +4 -0
  28. package/build/api/reference/$.d.ts.map +1 -0
  29. package/build/api/reference/$.js +4 -0
  30. package/build/api/reference/$.js.map +1 -0
  31. package/build/api/reference/catalog.d.ts +69 -0
  32. package/build/api/reference/catalog.d.ts.map +1 -0
  33. package/build/api/reference/catalog.js +44 -0
  34. package/build/api/reference/catalog.js.map +1 -0
  35. package/build/api/reference/config.d.ts +616 -0
  36. package/build/api/reference/config.d.ts.map +1 -0
  37. package/build/api/reference/config.js +162 -0
  38. package/build/api/reference/config.js.map +1 -0
  39. package/build/api/reference/scanner.d.ts +26 -0
  40. package/build/api/reference/scanner.d.ts.map +1 -0
  41. package/build/api/reference/scanner.js +27 -0
  42. package/build/api/reference/scanner.js.map +1 -0
  43. package/build/api/schema/augmentations/$$.d.ts +7 -0
  44. package/build/api/schema/augmentations/$$.d.ts.map +1 -0
  45. package/build/api/schema/augmentations/$$.js +7 -0
  46. package/build/api/schema/augmentations/$$.js.map +1 -0
  47. package/build/api/schema/augmentations/$.d.ts +1 -1
  48. package/build/api/schema/augmentations/$.d.ts.map +1 -1
  49. package/build/api/schema/augmentations/$.js +1 -1
  50. package/build/api/schema/augmentations/$.js.map +1 -1
  51. package/build/api/schema/augmentations/apply.d.ts +29 -0
  52. package/build/api/schema/augmentations/apply.d.ts.map +1 -0
  53. package/build/api/schema/augmentations/apply.js +181 -0
  54. package/build/api/schema/augmentations/apply.js.map +1 -0
  55. package/build/api/schema/augmentations/augmentation.d.ts +31 -0
  56. package/build/api/schema/augmentations/augmentation.d.ts.map +1 -0
  57. package/build/api/schema/augmentations/augmentation.js +22 -0
  58. package/build/api/schema/augmentations/augmentation.js.map +1 -0
  59. package/build/api/schema/augmentations/config.d.ts +24 -0
  60. package/build/api/schema/augmentations/config.d.ts.map +1 -0
  61. package/build/api/schema/augmentations/config.js +9 -0
  62. package/build/api/schema/augmentations/config.js.map +1 -0
  63. package/build/api/schema/augmentations/diagnostics/diagnostic.d.ts +67 -0
  64. package/build/api/schema/augmentations/diagnostics/diagnostic.d.ts.map +1 -0
  65. package/build/api/schema/augmentations/diagnostics/diagnostic.js +13 -0
  66. package/build/api/schema/augmentations/diagnostics/diagnostic.js.map +1 -0
  67. package/build/api/schema/augmentations/diagnostics/duplicate-version.d.ts +45 -0
  68. package/build/api/schema/augmentations/diagnostics/duplicate-version.d.ts.map +1 -0
  69. package/build/api/schema/augmentations/diagnostics/duplicate-version.js +17 -0
  70. package/build/api/schema/augmentations/diagnostics/duplicate-version.js.map +1 -0
  71. package/build/api/schema/augmentations/diagnostics/invalid-path.d.ts +46 -0
  72. package/build/api/schema/augmentations/diagnostics/invalid-path.d.ts.map +1 -0
  73. package/build/api/schema/augmentations/diagnostics/invalid-path.js +18 -0
  74. package/build/api/schema/augmentations/diagnostics/invalid-path.js.map +1 -0
  75. package/build/api/schema/augmentations/diagnostics/version-mismatch.d.ts +46 -0
  76. package/build/api/schema/augmentations/diagnostics/version-mismatch.d.ts.map +1 -0
  77. package/build/api/schema/augmentations/diagnostics/version-mismatch.js +18 -0
  78. package/build/api/schema/augmentations/diagnostics/version-mismatch.js.map +1 -0
  79. package/build/api/schema/augmentations/input.d.ts +145 -0
  80. package/build/api/schema/augmentations/input.d.ts.map +1 -0
  81. package/build/api/schema/augmentations/input.js +191 -0
  82. package/build/api/schema/augmentations/input.js.map +1 -0
  83. package/build/api/schema/augmentations/placement.d.ts +8 -0
  84. package/build/api/schema/augmentations/placement.d.ts.map +1 -0
  85. package/build/api/schema/augmentations/placement.js +7 -0
  86. package/build/api/schema/augmentations/placement.js.map +1 -0
  87. package/build/api/schema/config-schema.d.ts +66 -66
  88. package/build/api/schema/config-schema.d.ts.map +1 -1
  89. package/build/api/schema/config-schema.js +2 -2
  90. package/build/api/schema/config-schema.js.map +1 -1
  91. package/build/api/schema/input-source/load.d.ts +2 -0
  92. package/build/api/schema/input-source/load.d.ts.map +1 -1
  93. package/build/api/schema/input-source/load.js.map +1 -1
  94. package/build/api/schema/input-sources/directory.d.ts +39 -39
  95. package/build/api/schema/input-sources/file.d.ts +39 -39
  96. package/build/api/schema/input-sources/introspection-file.d.ts +39 -39
  97. package/build/api/schema/input-sources/introspection.d.ts +39 -39
  98. package/build/api/schema/input-sources/memory.d.ts +39 -39
  99. package/build/api/schema/input-sources/versioned-directory.d.ts +79 -79
  100. package/build/api/schema/load.d.ts.map +1 -1
  101. package/build/api/schema/load.js +9 -2
  102. package/build/api/schema/load.js.map +1 -1
  103. package/build/lib/catalog/catalog.d.ts +1181 -1181
  104. package/build/lib/catalog/unversioned.d.ts +312 -312
  105. package/build/lib/catalog/versioned.d.ts +634 -634
  106. package/build/lib/change/change.d.ts +238 -238
  107. package/build/lib/document/document.d.ts +14 -8
  108. package/build/lib/document/document.d.ts.map +1 -1
  109. package/build/lib/document/versioned.d.ts +17 -10
  110. package/build/lib/document/versioned.d.ts.map +1 -1
  111. package/build/lib/grafaid/schema/KindMap/_.d.ts +1 -1
  112. package/build/lib/grafaid/schema/format-default-value.d.ts +11 -0
  113. package/build/lib/grafaid/schema/format-default-value.d.ts.map +1 -0
  114. package/build/lib/grafaid/schema/format-default-value.js +20 -0
  115. package/build/lib/grafaid/schema/format-default-value.js.map +1 -0
  116. package/build/lib/grafaid/schema/schema.d.ts +1 -0
  117. package/build/lib/grafaid/schema/schema.d.ts.map +1 -1
  118. package/build/lib/grafaid/schema/schema.js +1 -0
  119. package/build/lib/grafaid/schema/schema.js.map +1 -1
  120. package/build/lib/graphql-path/$$.d.ts +7 -13
  121. package/build/lib/graphql-path/$$.d.ts.map +1 -1
  122. package/build/lib/graphql-path/$$.js +7 -13
  123. package/build/lib/graphql-path/$$.js.map +1 -1
  124. package/build/lib/graphql-path/definition.d.ts +104 -94
  125. package/build/lib/graphql-path/definition.d.ts.map +1 -1
  126. package/build/lib/graphql-path/definition.js +126 -125
  127. package/build/lib/graphql-path/definition.js.map +1 -1
  128. package/build/lib/graphql-path/query.d.ts +25 -57
  129. package/build/lib/graphql-path/query.d.ts.map +1 -1
  130. package/build/lib/graphql-path/query.js +15 -93
  131. package/build/lib/graphql-path/query.js.map +1 -1
  132. package/build/lib/graphql-path/schema.d.ts +49 -0
  133. package/build/lib/graphql-path/schema.d.ts.map +1 -0
  134. package/build/lib/graphql-path/schema.js +89 -0
  135. package/build/lib/graphql-path/schema.js.map +1 -0
  136. package/build/lib/graphql-path/types.d.ts +76 -28
  137. package/build/lib/graphql-path/types.d.ts.map +1 -1
  138. package/build/lib/graphql-path/types.js +101 -2
  139. package/build/lib/graphql-path/types.js.map +1 -1
  140. package/build/lib/revision/revision.d.ts +1170 -1170
  141. package/build/lib/schema/schema.d.ts +708 -708
  142. package/build/lib/schema/unversioned.d.ts +1092 -1092
  143. package/build/lib/schema/versioned.d.ts +634 -634
  144. package/build/lib/semver/official-release.d.ts +10 -10
  145. package/build/lib/semver/pre-release.d.ts +10 -10
  146. package/build/lib/semver/semver.d.ts +50 -50
  147. package/build/lib/version-coverage/version-coverage.d.ts +43 -11
  148. package/build/lib/version-coverage/version-coverage.d.ts.map +1 -1
  149. package/build/lib/version-coverage/version-coverage.js +40 -6
  150. package/build/lib/version-coverage/version-coverage.js.map +1 -1
  151. package/build/template/components/ArgumentAnnotation.d.ts +2 -1
  152. package/build/template/components/ArgumentAnnotation.d.ts.map +1 -1
  153. package/build/template/components/ArgumentAnnotation.js +14 -4
  154. package/build/template/components/ArgumentAnnotation.js.map +1 -1
  155. package/build/template/components/ArgumentListAnnotation.d.ts +1 -0
  156. package/build/template/components/ArgumentListAnnotation.d.ts.map +1 -1
  157. package/build/template/components/ArgumentListAnnotation.js +21 -8
  158. package/build/template/components/ArgumentListAnnotation.js.map +1 -1
  159. package/build/template/components/Changelog/groups/FieldArgument.d.ts.map +1 -1
  160. package/build/template/components/Changelog/groups/FieldArgument.js +0 -1
  161. package/build/template/components/Changelog/groups/FieldArgument.js.map +1 -1
  162. package/build/template/components/CodeBlock.d.ts.map +1 -1
  163. package/build/template/components/CodeBlock.js +1 -1
  164. package/build/template/components/CodeBlock.js.map +1 -1
  165. package/build/template/components/Description.js +1 -1
  166. package/build/template/components/Description.js.map +1 -1
  167. package/build/template/components/ExampleLink.d.ts.map +1 -1
  168. package/build/template/components/ExampleLink.js +2 -1
  169. package/build/template/components/ExampleLink.js.map +1 -1
  170. package/build/template/components/Field.d.ts +2 -0
  171. package/build/template/components/Field.d.ts.map +1 -1
  172. package/build/template/components/Field.js +42 -4
  173. package/build/template/components/Field.js.map +1 -1
  174. package/build/template/components/FieldList.d.ts +2 -1
  175. package/build/template/components/FieldList.d.ts.map +1 -1
  176. package/build/template/components/FieldList.js +14 -3
  177. package/build/template/components/FieldList.js.map +1 -1
  178. package/build/template/components/FieldListSection.d.ts.map +1 -1
  179. package/build/template/components/FieldListSection.js +6 -1
  180. package/build/template/components/FieldListSection.js.map +1 -1
  181. package/build/template/components/GraphQLDocument.d.ts.map +1 -1
  182. package/build/template/components/GraphQLDocument.js +2 -1
  183. package/build/template/components/GraphQLDocument.js.map +1 -1
  184. package/build/template/components/GraphQLInteractive/GraphQLInteractive.d.ts +2 -0
  185. package/build/template/components/GraphQLInteractive/GraphQLInteractive.d.ts.map +1 -1
  186. package/build/template/components/GraphQLInteractive/GraphQLInteractive.js +4 -3
  187. package/build/template/components/GraphQLInteractive/GraphQLInteractive.js.map +1 -1
  188. package/build/template/components/GraphQLInteractive/lib/parser.d.ts +2 -2
  189. package/build/template/components/GraphQLInteractive/lib/parser.d.ts.map +1 -1
  190. package/build/template/components/GraphQLInteractive/lib/parser.js +17 -12
  191. package/build/template/components/GraphQLInteractive/lib/parser.js.map +1 -1
  192. package/build/template/components/IAPIndicator.d.ts +12 -0
  193. package/build/template/components/IAPIndicator.d.ts.map +1 -0
  194. package/build/template/components/IAPIndicator.js +21 -0
  195. package/build/template/components/IAPIndicator.js.map +1 -0
  196. package/build/template/components/Link.d.ts +1 -2
  197. package/build/template/components/Link.d.ts.map +1 -1
  198. package/build/template/components/Link.js +5 -2
  199. package/build/template/components/Link.js.map +1 -1
  200. package/build/template/components/NamedType.d.ts.map +1 -1
  201. package/build/template/components/NamedType.js +9 -5
  202. package/build/template/components/NamedType.js.map +1 -1
  203. package/build/template/components/ReferenceLink.d.ts +2 -2
  204. package/build/template/components/ReferenceLink.d.ts.map +1 -1
  205. package/build/template/components/ReferenceLink.js +5 -3
  206. package/build/template/components/ReferenceLink.js.map +1 -1
  207. package/build/template/components/TypeAnnotation.d.ts +2 -0
  208. package/build/template/components/TypeAnnotation.d.ts.map +1 -1
  209. package/build/template/components/TypeAnnotation.js +4 -4
  210. package/build/template/components/TypeAnnotation.js.map +1 -1
  211. package/build/template/components/ViewModeToggle.d.ts +3 -0
  212. package/build/template/components/ViewModeToggle.d.ts.map +1 -0
  213. package/build/template/components/ViewModeToggle.js +9 -0
  214. package/build/template/components/ViewModeToggle.js.map +1 -0
  215. package/build/template/components/graphql/type-link.d.ts +2 -0
  216. package/build/template/components/graphql/type-link.d.ts.map +1 -1
  217. package/build/template/components/graphql/type-link.js +15 -3
  218. package/build/template/components/graphql/type-link.js.map +1 -1
  219. package/build/template/components/home/PlaygroundPreview.d.ts.map +1 -1
  220. package/build/template/components/home/PlaygroundPreview.js +3 -2
  221. package/build/template/components/home/PlaygroundPreview.js.map +1 -1
  222. package/build/template/components/sidebar/SidebarItem.d.ts.map +1 -1
  223. package/build/template/components/sidebar/SidebarItem.js +18 -5
  224. package/build/template/components/sidebar/SidebarItem.js.map +1 -1
  225. package/build/template/contexts/ReferenceConfigContext.d.ts +16 -0
  226. package/build/template/contexts/ReferenceConfigContext.d.ts.map +1 -0
  227. package/build/template/contexts/ReferenceConfigContext.js +14 -0
  228. package/build/template/contexts/ReferenceConfigContext.js.map +1 -0
  229. package/build/template/contexts/ViewModeContext.d.ts +14 -0
  230. package/build/template/contexts/ViewModeContext.d.ts.map +1 -0
  231. package/build/template/contexts/ViewModeContext.js +40 -0
  232. package/build/template/contexts/ViewModeContext.js.map +1 -0
  233. package/build/template/hooks/use-examples.d.ts +4 -1
  234. package/build/template/hooks/use-examples.d.ts.map +1 -1
  235. package/build/template/hooks/useAlignedColumns.d.ts +10 -0
  236. package/build/template/hooks/useAlignedColumns.d.ts.map +1 -0
  237. package/build/template/hooks/useAlignedColumns.js +17 -0
  238. package/build/template/hooks/useAlignedColumns.js.map +1 -0
  239. package/build/template/routes/changelog/ChangelogSidebar.d.ts +2 -2
  240. package/build/template/routes/changelog/ChangelogSidebar.d.ts.map +1 -1
  241. package/build/template/routes/changelog/ChangelogSidebar.js +4 -4
  242. package/build/template/routes/changelog/ChangelogSidebar.js.map +1 -1
  243. package/build/template/routes/examples/_.d.ts +12 -3
  244. package/build/template/routes/examples/_.d.ts.map +1 -1
  245. package/build/template/routes/examples/_index.d.ts +8 -2
  246. package/build/template/routes/examples/_index.d.ts.map +1 -1
  247. package/build/template/routes/examples/name.d.ts +12 -3
  248. package/build/template/routes/examples/name.d.ts.map +1 -1
  249. package/build/template/routes/examples/name.js +6 -2
  250. package/build/template/routes/examples/name.js.map +1 -1
  251. package/build/template/routes/reference.d.ts.map +1 -1
  252. package/build/template/routes/reference.js +37 -10
  253. package/build/template/routes/reference.js.map +1 -1
  254. package/build/template/stores/changelog.d.ts +39 -39
  255. package/build/vite/plugins/core.d.ts.map +1 -1
  256. package/build/vite/plugins/core.js +6 -0
  257. package/build/vite/plugins/core.js.map +1 -1
  258. package/build/vite/plugins/examples.d.ts.map +1 -1
  259. package/build/vite/plugins/examples.js +10 -3
  260. package/build/vite/plugins/examples.js.map +1 -1
  261. package/build/vite/plugins/index.d.ts +1 -0
  262. package/build/vite/plugins/index.d.ts.map +1 -1
  263. package/build/vite/plugins/index.js +1 -0
  264. package/build/vite/plugins/index.js.map +1 -1
  265. package/build/vite/plugins/navbar.d.ts.map +1 -1
  266. package/build/vite/plugins/navbar.js +3 -1
  267. package/build/vite/plugins/navbar.js.map +1 -1
  268. package/build/vite/plugins/reference.d.ts +19 -0
  269. package/build/vite/plugins/reference.d.ts.map +1 -0
  270. package/build/vite/plugins/reference.js +96 -0
  271. package/build/vite/plugins/reference.js.map +1 -0
  272. package/build/vite/plugins/schemas.d.ts.map +1 -1
  273. package/build/vite/plugins/schemas.js +38 -2
  274. package/build/vite/plugins/schemas.js.map +1 -1
  275. package/package.json +1 -1
  276. package/src/api/config/input.ts +2 -0
  277. package/src/api/config/normalized.ts +54 -0
  278. package/src/api/config-template/template.ts +18 -1
  279. package/src/api/examples/diagnostic/diagnostic.ts +0 -3
  280. package/src/api/examples/scanner.test.ts +83 -0
  281. package/src/api/examples/scanner.ts +31 -21
  282. package/src/api/examples/schemas/example/example.ts +6 -0
  283. package/src/api/reference/$.ts +3 -0
  284. package/src/api/reference/catalog.ts +55 -0
  285. package/src/api/reference/config.ts +193 -0
  286. package/src/api/reference/scanner.ts +53 -0
  287. package/src/api/schema/augmentations/$$.ts +6 -0
  288. package/src/api/schema/augmentations/$.ts +1 -1
  289. package/src/api/schema/augmentations/apply.test.ts +89 -0
  290. package/src/api/schema/augmentations/apply.ts +277 -0
  291. package/src/api/schema/augmentations/augmentation.ts +24 -0
  292. package/src/api/schema/augmentations/config.ts +11 -0
  293. package/src/api/schema/augmentations/diagnostics/diagnostic.ts +20 -0
  294. package/src/api/schema/augmentations/diagnostics/duplicate-version.ts +20 -0
  295. package/src/api/schema/augmentations/diagnostics/invalid-path.ts +21 -0
  296. package/src/api/schema/augmentations/diagnostics/version-mismatch.ts +21 -0
  297. package/src/api/schema/augmentations/input.test.ts +144 -0
  298. package/src/api/schema/augmentations/input.ts +215 -0
  299. package/src/api/schema/augmentations/placement.ts +11 -0
  300. package/src/api/schema/config-schema.ts +2 -2
  301. package/src/api/schema/input-source/load.ts +2 -0
  302. package/src/api/schema/load.ts +19 -2
  303. package/src/lib/grafaid/schema/format-default-value.ts +22 -0
  304. package/src/lib/grafaid/schema/schema.ts +2 -0
  305. package/src/lib/graphql-path/$$.ts +7 -13
  306. package/src/lib/graphql-path/$.test.ts +175 -0
  307. package/src/lib/graphql-path/definition.ts +162 -162
  308. package/src/lib/graphql-path/query.ts +15 -98
  309. package/src/lib/graphql-path/schema.ts +136 -0
  310. package/src/lib/graphql-path/types.ts +108 -28
  311. package/src/lib/version-coverage/version-coverage.ts +48 -6
  312. package/src/template/components/ArgumentAnnotation.tsx +58 -9
  313. package/src/template/components/ArgumentListAnnotation.tsx +50 -17
  314. package/src/template/components/Changelog/groups/FieldArgument.tsx +0 -1
  315. package/src/template/components/CodeBlock.tsx +1 -0
  316. package/src/template/components/Description.tsx +1 -1
  317. package/src/template/components/ExampleLink.tsx +2 -1
  318. package/src/template/components/Field.tsx +148 -20
  319. package/src/template/components/FieldList.tsx +28 -13
  320. package/src/template/components/FieldListSection.tsx +12 -2
  321. package/src/template/components/GraphQLDocument.tsx +2 -0
  322. package/src/template/components/GraphQLInteractive/GraphQLInteractive.tsx +6 -1
  323. package/src/template/components/GraphQLInteractive/lib/parser.ts +16 -3
  324. package/src/template/components/IAPIndicator.tsx +73 -0
  325. package/src/template/components/Link.tsx +9 -3
  326. package/src/template/components/NamedType.tsx +54 -28
  327. package/src/template/components/ReferenceLink.tsx +16 -10
  328. package/src/template/components/TypeAnnotation.tsx +17 -5
  329. package/src/template/components/ViewModeToggle.tsx +27 -0
  330. package/src/template/components/graphql/type-link.tsx +34 -3
  331. package/src/template/components/home/PlaygroundPreview.tsx +3 -0
  332. package/src/template/components/sidebar/SidebarItem.tsx +21 -5
  333. package/src/template/contexts/ReferenceConfigContext.tsx +37 -0
  334. package/src/template/contexts/ViewModeContext.tsx +64 -0
  335. package/src/template/hooks/useAlignedColumns.ts +19 -0
  336. package/src/template/routes/changelog/ChangelogSidebar.tsx +4 -4
  337. package/src/template/routes/examples/name.tsx +13 -1
  338. package/src/template/routes/reference.tsx +67 -23
  339. package/src/types/virtual-modules.d.ts +5 -0
  340. package/src/vite/plugins/core.ts +6 -0
  341. package/src/vite/plugins/examples.ts +12 -2
  342. package/src/vite/plugins/index.ts +1 -0
  343. package/src/vite/plugins/navbar.ts +4 -1
  344. package/src/vite/plugins/reference.ts +130 -0
  345. package/src/vite/plugins/schemas.ts +51 -2
  346. package/build/api/examples/diagnostic/unused-default.d.ts +0 -49
  347. package/build/api/examples/diagnostic/unused-default.d.ts.map +0 -1
  348. package/build/api/examples/diagnostic/unused-default.js +0 -19
  349. package/build/api/examples/diagnostic/unused-default.js.map +0 -1
  350. package/build/api/schema/augmentations/augmentations/description.d.ts +0 -26
  351. package/build/api/schema/augmentations/augmentations/description.d.ts.map +0 -1
  352. package/build/api/schema/augmentations/augmentations/description.js +0 -55
  353. package/build/api/schema/augmentations/augmentations/description.js.map +0 -1
  354. package/build/api/schema/augmentations/schema-augmentation.d.ts +0 -20
  355. package/build/api/schema/augmentations/schema-augmentation.d.ts.map +0 -1
  356. package/build/api/schema/augmentations/schema-augmentation.js +0 -22
  357. package/build/api/schema/augmentations/schema-augmentation.js.map +0 -1
  358. package/build/api/schema/augmentations/target.d.ts +0 -25
  359. package/build/api/schema/augmentations/target.d.ts.map +0 -1
  360. package/build/api/schema/augmentations/target.js +0 -39
  361. package/build/api/schema/augmentations/target.js.map +0 -1
  362. package/build/lib/graphql-path/constructors.d.ts +0 -57
  363. package/build/lib/graphql-path/constructors.d.ts.map +0 -1
  364. package/build/lib/graphql-path/constructors.js +0 -73
  365. package/build/lib/graphql-path/constructors.js.map +0 -1
  366. package/build/template/components/ArgumentList.d.ts +0 -6
  367. package/build/template/components/ArgumentList.d.ts.map +0 -1
  368. package/build/template/components/ArgumentList.js +0 -9
  369. package/build/template/components/ArgumentList.js.map +0 -1
  370. package/src/api/examples/diagnostic/unused-default.ts +0 -22
  371. package/src/api/schema/augmentations/augmentations/description.ts +0 -69
  372. package/src/api/schema/augmentations/schema-augmentation.ts +0 -32
  373. package/src/api/schema/augmentations/target.ts +0 -61
  374. package/src/lib/graphql-path/constructors.ts +0 -81
  375. package/src/template/components/ArgumentList.tsx +0 -22
@@ -1,4 +1,4 @@
1
- import type { FC } from 'react'
1
+ import { forwardRef } 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
@@ -20,7 +20,10 @@ const reactRouterPropKeys = [
20
20
  `children`,
21
21
  ] as const
22
22
 
23
- export const Link: FC<LinkPropsReactRouter & Omit<LinkPropsRadix, `asChild`>> = props => {
23
+ export const Link = forwardRef<
24
+ HTMLAnchorElement,
25
+ LinkPropsReactRouter & Omit<LinkPropsRadix, `asChild`>
26
+ >((props, ref) => {
24
27
  const location = useLocation()
25
28
  const toPathExp = typeof props.to === `string` ? props.to : props.to.pathname || ``
26
29
 
@@ -34,6 +37,7 @@ export const Link: FC<LinkPropsReactRouter & Omit<LinkPropsRadix, `asChild`>> =
34
37
  // Only add data attributes if they're true
35
38
  const linkRadixProps = {
36
39
  ...radixProps,
40
+ ref,
37
41
  asChild: true,
38
42
  ...(active.is && { 'data-active': true }),
39
43
  ...(active.isDirect && { 'data-active-direct': true }),
@@ -45,7 +49,9 @@ export const Link: FC<LinkPropsReactRouter & Omit<LinkPropsRadix, `asChild`>> =
45
49
  <LinkReactRouter {...reactRouterProps} />
46
50
  </LinkRadix>
47
51
  )
48
- }
52
+ })
53
+
54
+ Link.displayName = 'Link'
49
55
 
50
56
  export interface PathActiveReport {
51
57
  is: boolean
@@ -2,11 +2,12 @@ import { Api } from '#api/iso'
2
2
  import { Lifecycles } from '#lib/lifecycles/$'
3
3
  import { Schema } from '#lib/schema/$'
4
4
  import { Version } from '#lib/version/$'
5
- import { Badge, Box, Heading, Text } from '@radix-ui/themes'
5
+ import { Badge, Box, Card, Heading, Section, Separator, Text } from '@radix-ui/themes'
6
6
  import { HashSet } from 'effect'
7
7
  import { type GraphQLNamedType } from 'graphql'
8
8
  import type { FC } from 'react'
9
9
  import { useSchema } from '../contexts/GraphqlLifecycleContext.js'
10
+ import { useViewMode } from '../contexts/ViewModeContext.js'
10
11
  import { useExamplesForType } from '../hooks/use-examples.js'
11
12
  import { ExampleLink } from './ExampleLink.js'
12
13
  import { FieldListSection } from './FieldListSection.js'
@@ -20,10 +21,11 @@ export interface Props {
20
21
 
21
22
  export const NamedType: FC<Props> = ({ data }) => {
22
23
  const { schema, lifecycles } = useSchema()
24
+ const { viewMode } = useViewMode()
23
25
 
24
- const description = data.description
26
+ const description = data.description && viewMode === 'expanded'
25
27
  ? (
26
- <Text as='div' color='gray'>
28
+ <Text as='div' size='2' color='gray'>
27
29
  <Markdown>{data.description}</Markdown>
28
30
  </Text>
29
31
  )
@@ -33,6 +35,9 @@ export const NamedType: FC<Props> = ({ data }) => {
33
35
  const since = Lifecycles.getTypeSince(lifecycles, data.name, schema)
34
36
  const removedDate = Lifecycles.getTypeRemovedDate(lifecycles, data.name, schema)
35
37
 
38
+ // Only show since badge if it's NOT the initial version
39
+ const showSinceBadge = since && since._tag !== 'initial'
40
+
36
41
  // Get examples that use this type
37
42
  const currentVersion = Schema.Versioned.is(schema)
38
43
  ? schema.version
@@ -41,34 +46,55 @@ export const NamedType: FC<Props> = ({ data }) => {
41
46
 
42
47
  return (
43
48
  <Box>
44
- <Box style={{ display: 'flex', alignItems: 'center', gap: '8px', marginBottom: '8px' }}>
45
- <Heading size='8'>
46
- <TypeLink type={data} />
47
- </Heading>
48
- {since && <SinceBadge since={since} />}
49
- {removedDate && (
50
- <Badge color='red' variant='soft' size='1'>
51
- Removed {Api.Schema.dateToVersionString(removedDate)}
52
- </Badge>
49
+ {/* Type header section */}
50
+ <Section size='1'>
51
+ <Box style={{ display: 'flex', alignItems: 'center', gap: '8px' }}>
52
+ <Heading size='7' weight='bold'>
53
+ <TypeLink type={data} />
54
+ </Heading>
55
+ {showSinceBadge && <SinceBadge since={since} />}
56
+ {removedDate && (
57
+ <Badge color='red' variant='soft' size='1'>
58
+ Removed {Api.Schema.dateToVersionString(removedDate)}
59
+ </Badge>
60
+ )}
61
+ </Box>
62
+
63
+ {/* Description section */}
64
+ {description && (
65
+ <Box mt='3'>
66
+ {description}
67
+ </Box>
53
68
  )}
54
- </Box>
55
- {description}
69
+ </Section>
70
+
71
+ {/* Examples section with separator */}
56
72
  {HashSet.size(examples) > 0 && (
57
- <Box mt='4' mb='4'>
58
- <Heading size='4' mb='2'>Used in Examples</Heading>
59
- <Box style={{ display: 'flex', flexWrap: 'wrap', gap: '8px' }}>
60
- {[...examples].map((exampleRef) => (
61
- <ExampleLink
62
- key={`${exampleRef.name}-${
63
- exampleRef.version ? Version.encodeSync(exampleRef.version) : 'unversioned'
64
- }`}
65
- exampleRef={exampleRef}
66
- />
67
- ))}
68
- </Box>
69
- </Box>
73
+ <>
74
+ <Separator size='4' my='4' />
75
+ <Section size='1'>
76
+ <Heading size='5' mb='3' weight='medium'>Used in Examples</Heading>
77
+ <Card variant='surface'>
78
+ <Box style={{ display: 'flex', flexWrap: 'wrap', gap: '8px' }}>
79
+ {[...examples].map((exampleRef) => (
80
+ <ExampleLink
81
+ key={`${exampleRef.name}-${
82
+ exampleRef.version ? Version.encodeSync(exampleRef.version) : 'unversioned'
83
+ }`}
84
+ exampleRef={exampleRef}
85
+ />
86
+ ))}
87
+ </Box>
88
+ </Card>
89
+ </Section>
90
+ </>
70
91
  )}
71
- <FieldListSection data={data} />
92
+
93
+ {/* Fields section with separator */}
94
+ <Separator size='4' my='4' />
95
+ <Section size='1'>
96
+ <FieldListSection data={data} />
97
+ </Section>
72
98
  </Box>
73
99
  )
74
100
  }
@@ -1,5 +1,6 @@
1
1
  import { Api } from '#api/iso'
2
2
  import type { React } from '#dep/react/index'
3
+ import { forwardRef } from 'react'
3
4
  import { useVersionPath } from '../hooks/useVersionPath.js'
4
5
  import { Link } from './Link.js'
5
6
 
@@ -10,14 +11,17 @@ import { Link } from './Link.js'
10
11
  * <ReferenceLink type="User">User</ReferenceLink>
11
12
  * <ReferenceLink type="User" field="name">User.name</ReferenceLink>
12
13
  */
13
- export const ReferenceLink: React.FC<{
14
- /** The GraphQL type name */
15
- type: string
16
- /** Optional field name for field-specific links */
17
- field?: string
18
- /** Link content */
19
- children: React.ReactNode
20
- }> = ({ type, field, children }) => {
14
+ export const ReferenceLink = forwardRef<
15
+ HTMLAnchorElement,
16
+ {
17
+ /** The GraphQL type name */
18
+ type: string
19
+ /** Optional field name for field-specific links */
20
+ field?: string
21
+ /** Link content */
22
+ children: React.ReactNode
23
+ }
24
+ >(({ type, field, children, ...props }, ref) => {
21
25
  const versionPath = useVersionPath()
22
26
 
23
27
  const path = Api.Schema.Routing.joinSegmentsAndPaths(
@@ -28,8 +32,10 @@ export const ReferenceLink: React.FC<{
28
32
  )
29
33
 
30
34
  return (
31
- <Link to={path}>
35
+ <Link to={path} ref={ref} {...props}>
32
36
  {children}
33
37
  </Link>
34
38
  )
35
- }
39
+ })
40
+
41
+ ReferenceLink.displayName = 'ReferenceLink'
@@ -7,13 +7,21 @@ import { TypeLink } from './graphql/graphql.js'
7
7
  /**
8
8
  * Renders a GraphQL type recursively, with links for named types
9
9
  */
10
- export const TypeAnnotation: React.FC<{ type: GraphQLType }> = ({ type }) => {
10
+ export const TypeAnnotation: React.FC<{
11
+ type: GraphQLType
12
+ showDescription?: boolean
13
+ nullabilityRendering?: 'questionMark' | 'bangMark'
14
+ }> = ({ type, showDescription = false, nullabilityRendering = 'bangMark' }) => {
11
15
  // Handle NonNull type wrapper
12
16
  if (isNonNullType(type)) {
13
17
  return (
14
18
  <>
15
- <TypeAnnotation type={type.ofType} />
16
- <Text color='gray'>!</Text>
19
+ <TypeAnnotation
20
+ type={type.ofType}
21
+ showDescription={showDescription}
22
+ nullabilityRendering={nullabilityRendering}
23
+ />
24
+ {nullabilityRendering === 'bangMark' && <Text color='gray'>!</Text>}
17
25
  </>
18
26
  )
19
27
  }
@@ -23,7 +31,11 @@ export const TypeAnnotation: React.FC<{ type: GraphQLType }> = ({ type }) => {
23
31
  return (
24
32
  <>
25
33
  <Text color='gray'>[</Text>
26
- <TypeAnnotation type={type.ofType} />
34
+ <TypeAnnotation
35
+ type={type.ofType}
36
+ showDescription={showDescription}
37
+ nullabilityRendering={nullabilityRendering}
38
+ />
27
39
  <Text color='gray'>]</Text>
28
40
  </>
29
41
  )
@@ -31,7 +43,7 @@ export const TypeAnnotation: React.FC<{ type: GraphQLType }> = ({ type }) => {
31
43
 
32
44
  // Handle named types - use TypeLink which already has icon support
33
45
  if (isNamedType(type)) {
34
- return <TypeLink type={type} />
46
+ return <TypeLink type={type} showDescription={showDescription} />
35
47
  }
36
48
 
37
49
  // TypeScript exhaustiveness check - this should be unreachable
@@ -0,0 +1,27 @@
1
+ import type { React } from '#dep/react/index'
2
+ import { ReaderIcon, RowsIcon } from '@radix-ui/react-icons'
3
+ import { Flex, SegmentedControl } from '@radix-ui/themes'
4
+ import { useViewMode } from '../contexts/ViewModeContext.js'
5
+
6
+ export const ViewModeToggle: React.FC = () => {
7
+ const { viewMode, setViewMode } = useViewMode()
8
+
9
+ return (
10
+ <SegmentedControl.Root
11
+ value={viewMode}
12
+ onValueChange={(value) => setViewMode(value as 'compact' | 'expanded')}
13
+ size='1'
14
+ >
15
+ <SegmentedControl.Item value='expanded'>
16
+ <Flex align='center' gap='2'>
17
+ <ReaderIcon />
18
+ </Flex>
19
+ </SegmentedControl.Item>
20
+ <SegmentedControl.Item value='compact'>
21
+ <Flex align='center' gap='2'>
22
+ <RowsIcon />
23
+ </Flex>
24
+ </SegmentedControl.Item>
25
+ </SegmentedControl.Root>
26
+ )
27
+ }
@@ -1,13 +1,20 @@
1
1
  import { Grafaid } from '#lib/grafaid'
2
- import { Code, Flex } from '@radix-ui/themes'
2
+ import { Code, Flex, HoverCard, Text } from '@radix-ui/themes'
3
+ import React from 'react'
4
+ import { Description } from '../Description.js'
3
5
  import { ReferenceLink } from '../ReferenceLink.js'
4
6
  import { TypeKindIcon } from './graphql.js'
5
7
  import { typeKindTokensIndex } from './type-kind-tokens.js'
6
8
 
7
- export const TypeLink: React.FC<{ type: Grafaid.Schema.TypesLike.Named }> = ({ type }) => {
9
+ export const TypeLink: React.FC<{
10
+ type: Grafaid.Schema.TypesLike.Named
11
+ showDescription?: boolean
12
+ }> = ({ type, showDescription = false }) => {
8
13
  const kind = Grafaid.Schema.typeKindFromClass(type)
14
+ const hasDescription = type.description && type.description.trim() !== ''
9
15
 
10
- return (
16
+ const linkContent = (
17
+ // <a href='https://foo.bar'>
11
18
  <ReferenceLink type={type.name}>
12
19
  <Flex align='center' gap='1' display='inline-flex'>
13
20
  <TypeKindIcon kind={kind} />
@@ -15,5 +22,29 @@ export const TypeLink: React.FC<{ type: Grafaid.Schema.TypesLike.Named }> = ({ t
15
22
  <Code color={typeKindTokensIndex[kind].color} variant='ghost'>{type.name}</Code>
16
23
  </Flex>
17
24
  </ReferenceLink>
25
+ // {/*</a>*/}
26
+ )
27
+
28
+ // Only show HoverCard if showDescription is true AND description exists
29
+ if (!showDescription || !hasDescription) {
30
+ return linkContent
31
+ }
32
+
33
+ return (
34
+ <HoverCard.Root>
35
+ <HoverCard.Trigger>
36
+ {linkContent}
37
+ </HoverCard.Trigger>
38
+ <HoverCard.Content
39
+ size='2'
40
+ maxWidth='400px'
41
+ side='top'
42
+ align='center'
43
+ >
44
+ <Text size='2' color='gray'>
45
+ <Description data={type} />
46
+ </Text>
47
+ </HoverCard.Content>
48
+ </HoverCard.Root>
18
49
  )
19
50
  }
@@ -3,6 +3,7 @@ import { highlight } from 'codehike/code'
3
3
  import type { GraphQLSchema } from 'graphql'
4
4
  import * as React from 'react'
5
5
  import { Link } from 'react-router'
6
+ import { templateConfig } from 'virtual:polen/project/config'
6
7
  import { GraphQLInteractive } from '../GraphQLInteractive/GraphQLInteractive.js'
7
8
 
8
9
  interface PlaygroundPreviewProps {
@@ -68,12 +69,14 @@ export const PlaygroundPreviewSection: React.FC<PlaygroundPreviewProps> = ({
68
69
  codeblock={highlightedCode}
69
70
  schema={schema}
70
71
  showWarningIfNoSchema={false}
72
+ referenceEnabled={templateConfig.reference.enabled}
71
73
  />
72
74
  )
73
75
  : (
74
76
  <GraphQLInteractive
75
77
  codeblock={highlightedCode}
76
78
  showWarningIfNoSchema={false}
79
+ referenceEnabled={templateConfig.reference.enabled}
77
80
  />
78
81
  )}
79
82
  </Box>
@@ -3,6 +3,7 @@ import { Api } from '#api/iso'
3
3
  import type { React } from '#dep/react/index'
4
4
  import { Texts } from '#template/components/Texts/index'
5
5
  import { Box, Flex } from '@radix-ui/themes'
6
+ import { Str } from '@wollybeard/kit'
6
7
  import { useContext } from 'react'
7
8
  import { useLocation } from 'react-router'
8
9
  import { getPathActiveReport, Link } from '../Link.js'
@@ -70,6 +71,11 @@ const SBLink: React.FC<{
70
71
  const href = Api.Schema.Routing.joinSegmentsAndPaths(basePath, link.pathExp)
71
72
  const active = getPathActiveReport(href, currentPathExp)
72
73
 
74
+ // Apply title case transformation to string titles for better readability
75
+ const displayTitle = typeof link.title === 'string'
76
+ ? Str.Case.title(link.title)
77
+ : link.title
78
+
73
79
  return (
74
80
  <Link
75
81
  role='Sidebar Link'
@@ -80,11 +86,11 @@ const SBLink: React.FC<{
80
86
  display: `block`,
81
87
  textDecoration: `none`,
82
88
  color: active.is ? `var(--accent-12)` : undefined,
83
- backgroundColor: active.isDirect ? `var(--accent-2)` : active.isDescendant ? `var(--accent-1)` : `transparent`,
89
+ backgroundColor: active.isDirect ? `var(--accent-3)` : active.isDescendant ? `var(--gray-2)` : `transparent`,
84
90
  borderRadius: `var(--radius-2)`,
85
91
  }}
86
92
  >
87
- <Box py='2' px='4'>{link.title}</Box>
93
+ <Box py='2' px='4'>{displayTitle}</Box>
88
94
  </Link>
89
95
  )
90
96
  }
@@ -100,11 +106,16 @@ const SBLink: React.FC<{
100
106
  const Section: React.FC<{
101
107
  section: TemplateItemSection
102
108
  }> = ({ section }) => {
109
+ // Apply title case transformation to string titles for better readability
110
+ const displayTitle = typeof section.title === 'string'
111
+ ? Str.Case.title(section.title)
112
+ : section.title
113
+
103
114
  return (
104
115
  <Box mt='8'>
105
116
  <Box ml='4' mb='2'>
106
117
  <Texts.MinorHeading color='gray'>
107
- {section.title}
118
+ {displayTitle}
108
119
  </Texts.MinorHeading>
109
120
  </Box>
110
121
  <Items items={section.links} />
@@ -156,6 +167,11 @@ const SectionLink: React.FC<{ link: TemplateItemLink }> = ({ link }) => {
156
167
  const href = Api.Schema.Routing.joinSegmentsAndPaths(basePath, link.pathExp)
157
168
  const active = getPathActiveReport(href, location.pathname)
158
169
 
170
+ // Apply title case transformation to string titles for better readability
171
+ const displayTitle = typeof link.title === 'string'
172
+ ? Str.Case.title(link.title)
173
+ : link.title
174
+
159
175
  return (
160
176
  <Link
161
177
  role='Sidebar Link'
@@ -164,12 +180,12 @@ const SectionLink: React.FC<{ link: TemplateItemLink }> = ({ link }) => {
164
180
  style={{
165
181
  textDecoration: `none`,
166
182
  color: active.is ? `var(--accent-12)` : undefined,
167
- backgroundColor: active.isDirect ? `var(--accent-2)` : active.isDescendant ? `var(--accent-1)` : `transparent`,
183
+ backgroundColor: active.isDirect ? `var(--accent-3)` : active.isDescendant ? `var(--gray-2)` : `transparent`,
168
184
  borderBottomRightRadius: `var(--radius-2)`,
169
185
  borderTopRightRadius: `var(--radius-2)`,
170
186
  }}
171
187
  >
172
- <Box py='2' px='4'>{link.title}</Box>
188
+ <Box py='2' px='4'>{displayTitle}</Box>
173
189
  </Link>
174
190
  )
175
191
  }
@@ -0,0 +1,37 @@
1
+ import type { React } from '#dep/react/index'
2
+ import { createContext, useContext } from 'react'
3
+
4
+ export interface ReferenceConfig {
5
+ descriptionsView: {
6
+ defaultMode: 'compact' | 'expanded'
7
+ showControl: boolean
8
+ }
9
+ nullabilityRendering: 'questionMark' | 'bangMark'
10
+ }
11
+
12
+ interface ReferenceConfigContextValue {
13
+ config: ReferenceConfig
14
+ }
15
+
16
+ const ReferenceConfigContext = createContext<ReferenceConfigContextValue | undefined>(undefined)
17
+
18
+ interface ReferenceConfigProviderProps {
19
+ children: React.ReactNode
20
+ config: ReferenceConfig
21
+ }
22
+
23
+ export const ReferenceConfigProvider: React.FC<ReferenceConfigProviderProps> = ({ children, config }) => {
24
+ return (
25
+ <ReferenceConfigContext.Provider value={{ config }}>
26
+ {children}
27
+ </ReferenceConfigContext.Provider>
28
+ )
29
+ }
30
+
31
+ export const useReferenceConfig = () => {
32
+ const context = useContext(ReferenceConfigContext)
33
+ if (!context) {
34
+ throw new Error('useReferenceConfig must be used within ReferenceConfigProvider')
35
+ }
36
+ return context.config
37
+ }
@@ -0,0 +1,64 @@
1
+ import type { React } from '#dep/react/index'
2
+ import { createContext, useContext, useEffect, useState } from 'react'
3
+
4
+ export type ViewMode = 'compact' | 'expanded'
5
+
6
+ interface ViewModeContextValue {
7
+ viewMode: ViewMode
8
+ setViewMode: (mode: ViewMode) => void
9
+ }
10
+
11
+ const ViewModeContext = createContext<ViewModeContextValue | undefined>(undefined)
12
+
13
+ const STORAGE_KEY = 'polen-view-mode'
14
+
15
+ interface ViewModeProviderProps {
16
+ children: React.ReactNode
17
+ defaultMode?: ViewMode
18
+ }
19
+
20
+ export const ViewModeProvider: React.FC<ViewModeProviderProps> = ({ children, defaultMode = 'expanded' }) => {
21
+ const [viewMode, setViewModeState] = useState<ViewMode>(defaultMode)
22
+
23
+ // Load from localStorage after mount to avoid hydration mismatch
24
+ useEffect(() => {
25
+ const saved = localStorage.getItem(STORAGE_KEY)
26
+ if (saved === 'compact' || saved === 'expanded') {
27
+ setViewModeState(saved)
28
+ }
29
+ }, [])
30
+
31
+ const setViewMode = (mode: ViewMode) => {
32
+ setViewModeState(mode)
33
+ // Save to localStorage
34
+ if (typeof window !== 'undefined') {
35
+ localStorage.setItem(STORAGE_KEY, mode)
36
+ }
37
+ }
38
+
39
+ useEffect(() => {
40
+ // Sync with localStorage changes from other tabs
41
+ const handleStorageChange = (e: StorageEvent) => {
42
+ if (e.key === STORAGE_KEY && (e.newValue === 'compact' || e.newValue === 'expanded')) {
43
+ setViewModeState(e.newValue as ViewMode)
44
+ }
45
+ }
46
+
47
+ window.addEventListener('storage', handleStorageChange)
48
+ return () => window.removeEventListener('storage', handleStorageChange)
49
+ }, [])
50
+
51
+ return (
52
+ <ViewModeContext.Provider value={{ viewMode, setViewMode }}>
53
+ {children}
54
+ </ViewModeContext.Provider>
55
+ )
56
+ }
57
+
58
+ export const useViewMode = () => {
59
+ const context = useContext(ViewModeContext)
60
+ if (!context) {
61
+ throw new Error('useViewMode must be used within ViewModeProvider')
62
+ }
63
+ return context
64
+ }
@@ -0,0 +1,19 @@
1
+ import { useMemo } from 'react'
2
+
3
+ /**
4
+ * Generic hook for calculating the maximum character width of names in a list.
5
+ * Used to align columns in lists like fields, arguments, etc.
6
+ *
7
+ * @param items - Array of items to measure
8
+ * @param getName - Function to extract the name from each item
9
+ * @returns Maximum character width across all names
10
+ */
11
+ export const useAlignedColumns = <T>(
12
+ items: T[],
13
+ getName: (item: T) => string,
14
+ ): number => {
15
+ return useMemo(() => {
16
+ if (items.length === 0) return 0
17
+ return Math.max(...items.map(item => getName(item).length))
18
+ }, [items])
19
+ }
@@ -1,10 +1,10 @@
1
- import { Catalog } from '#lib/catalog/$'
2
- import { Schema } from '#lib/schema/$'
3
- import { Swiss } from '#lib/swiss/$'
1
+ import { Catalog } from '#lib/catalog'
2
+ import { Schema } from '#lib/schema'
3
+ import { Swiss } from '#lib/swiss'
4
4
  import { Version } from '#lib/version'
5
5
  import { Box, Text } from '@radix-ui/themes'
6
6
  import { useEffect, useState } from 'react'
7
- import { useNavigate, useParams } from 'react-router'
7
+ import { useNavigate } from 'react-router'
8
8
  import { VersionPicker } from '../../components/VersionPicker.js'
9
9
  import { ChangelogSidebarItem } from './ChangelogSidebarItem.js'
10
10
 
@@ -1,14 +1,17 @@
1
1
  import { Example } from '#api/examples/schemas/example/example'
2
+ import { Catalog } from '#lib/catalog/$'
2
3
  import { route } from '#lib/react-router-effect/route'
3
4
  import { useLoaderData } from '#lib/react-router-effect/use-loader-data'
4
5
  import { Version } from '#lib/version/$'
5
- import { Heading } from '@radix-ui/themes'
6
+ import { Box, Heading } from '@radix-ui/themes'
6
7
  import { Str } from '@wollybeard/kit'
7
8
  import { Array, Option } from 'effect'
8
9
  import { useSearchParams } from 'react-router'
10
+ import * as ExamplesModule from 'virtual:polen/project/examples'
9
11
  import { examplesCatalog } from 'virtual:polen/project/examples'
10
12
  import { schemasCatalog } from 'virtual:polen/project/schemas'
11
13
  import { GraphQLDocument } from '../../components/GraphQLDocument.js'
14
+ import { MdxProvider } from '../../providers/mdx.js'
12
15
 
13
16
  export const NameSchema = Example
14
17
 
@@ -47,9 +50,18 @@ const Component = () => {
47
50
  ? Version.decodeSync(versionParam)
48
51
  : undefined
49
52
 
53
+ const DescriptionComponent = (ExamplesModule as any)[`DescriptionComponent_${example.name.replace(/-/g, '_')}`]
54
+
50
55
  return (
51
56
  <>
52
57
  <Heading size='6' mb='4'>{Str.Case.title(example.name)}</Heading>
58
+ {DescriptionComponent && (
59
+ <Box mb='4'>
60
+ <MdxProvider schema={schemasCatalog && Catalog.getLatest(schemasCatalog).definition}>
61
+ <DescriptionComponent />
62
+ </MdxProvider>
63
+ </Box>
64
+ )}
53
65
  <GraphQLDocument
54
66
  document={example.document}
55
67
  schemaCatalog={schemasCatalog ?? undefined}