polen 0.10.0-next.11 → 0.10.0-next.13

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 (340) hide show
  1. package/build/api/builder/builder.js +1 -1
  2. package/build/api/builder/builder.js.map +1 -1
  3. package/build/api/config/load.js +1 -1
  4. package/build/api/config/load.js.map +1 -1
  5. package/build/api/vite/plugins/build.js +1 -1
  6. package/build/api/vite/plugins/build.js.map +1 -1
  7. package/build/api/vite/plugins/core.d.ts.map +1 -1
  8. package/build/api/vite/plugins/core.js +0 -2
  9. package/build/api/vite/plugins/core.js.map +1 -1
  10. package/build/api/vite/plugins/pages.js +1 -1
  11. package/build/api/vite/plugins/pages.js.map +1 -1
  12. package/build/exports/components.d.ts +4 -1
  13. package/build/exports/components.d.ts.map +1 -1
  14. package/build/exports/components.js +4 -1
  15. package/build/exports/components.js.map +1 -1
  16. package/build/lib/demos/config-schema.d.ts +6 -6
  17. package/build/lib/github-actions/runner.js +2 -2
  18. package/build/lib/github-actions/runner.js.map +1 -1
  19. package/build/lib/graphql-document/$$.d.ts +5 -0
  20. package/build/lib/graphql-document/$$.d.ts.map +1 -0
  21. package/build/lib/graphql-document/$$.js +5 -0
  22. package/build/lib/graphql-document/$$.js.map +1 -0
  23. package/build/lib/graphql-document/$.d.ts +2 -0
  24. package/build/lib/graphql-document/$.d.ts.map +1 -0
  25. package/build/lib/graphql-document/$.js +2 -0
  26. package/build/lib/graphql-document/$.js.map +1 -0
  27. package/build/lib/graphql-document/analysis.d.ts +44 -0
  28. package/build/lib/graphql-document/analysis.d.ts.map +1 -0
  29. package/build/lib/graphql-document/analysis.js +361 -0
  30. package/build/lib/graphql-document/analysis.js.map +1 -0
  31. package/build/lib/graphql-document/components/CopyButton.d.ts +19 -0
  32. package/build/lib/graphql-document/components/CopyButton.d.ts.map +1 -0
  33. package/build/lib/graphql-document/components/CopyButton.js +43 -0
  34. package/build/lib/graphql-document/components/CopyButton.js.map +1 -0
  35. package/build/lib/graphql-document/components/GraphQLDocument.d.ts +38 -0
  36. package/build/lib/graphql-document/components/GraphQLDocument.d.ts.map +1 -0
  37. package/build/lib/graphql-document/components/GraphQLDocument.js +130 -0
  38. package/build/lib/graphql-document/components/GraphQLDocument.js.map +1 -0
  39. package/build/lib/graphql-document/components/GraphQLDocumentWithSchema.d.ts +7 -0
  40. package/build/lib/graphql-document/components/GraphQLDocumentWithSchema.d.ts.map +1 -0
  41. package/build/lib/graphql-document/components/GraphQLDocumentWithSchema.js +45 -0
  42. package/build/lib/graphql-document/components/GraphQLDocumentWithSchema.js.map +1 -0
  43. package/build/lib/graphql-document/components/GraphQLIdentifierPopover.d.ts +33 -0
  44. package/build/lib/graphql-document/components/GraphQLIdentifierPopover.d.ts.map +1 -0
  45. package/build/lib/graphql-document/components/GraphQLIdentifierPopover.js +48 -0
  46. package/build/lib/graphql-document/components/GraphQLIdentifierPopover.js.map +1 -0
  47. package/build/lib/graphql-document/components/IdentifierLink.d.ts +39 -0
  48. package/build/lib/graphql-document/components/IdentifierLink.d.ts.map +1 -0
  49. package/build/lib/graphql-document/components/IdentifierLink.js +75 -0
  50. package/build/lib/graphql-document/components/IdentifierLink.js.map +1 -0
  51. package/build/lib/graphql-document/components/graphql-document-styles.d.ts +5 -0
  52. package/build/lib/graphql-document/components/graphql-document-styles.d.ts.map +1 -0
  53. package/build/lib/graphql-document/components/graphql-document-styles.js +167 -0
  54. package/build/lib/graphql-document/components/graphql-document-styles.js.map +1 -0
  55. package/build/lib/graphql-document/components/index.d.ts +6 -0
  56. package/build/lib/graphql-document/components/index.d.ts.map +1 -0
  57. package/build/lib/graphql-document/components/index.js +6 -0
  58. package/build/lib/graphql-document/components/index.js.map +1 -0
  59. package/build/lib/graphql-document/example.d.ts +25 -0
  60. package/build/lib/graphql-document/example.d.ts.map +1 -0
  61. package/build/lib/graphql-document/example.js +140 -0
  62. package/build/lib/graphql-document/example.js.map +1 -0
  63. package/build/lib/graphql-document/graphql-document.d.ts +35 -0
  64. package/build/lib/graphql-document/graphql-document.d.ts.map +1 -0
  65. package/build/lib/graphql-document/graphql-document.js +36 -0
  66. package/build/lib/graphql-document/graphql-document.js.map +1 -0
  67. package/build/lib/graphql-document/hooks/use-tooltip-state.d.ts +43 -0
  68. package/build/lib/graphql-document/hooks/use-tooltip-state.d.ts.map +1 -0
  69. package/build/lib/graphql-document/hooks/use-tooltip-state.js +132 -0
  70. package/build/lib/graphql-document/hooks/use-tooltip-state.js.map +1 -0
  71. package/build/lib/graphql-document/positioning-simple.d.ts +68 -0
  72. package/build/lib/graphql-document/positioning-simple.d.ts.map +1 -0
  73. package/build/lib/graphql-document/positioning-simple.js +197 -0
  74. package/build/lib/graphql-document/positioning-simple.js.map +1 -0
  75. package/build/lib/graphql-document/schema-context.d.ts +8 -0
  76. package/build/lib/graphql-document/schema-context.d.ts.map +1 -0
  77. package/build/lib/graphql-document/schema-context.js +11 -0
  78. package/build/lib/graphql-document/schema-context.js.map +1 -0
  79. package/build/lib/graphql-document/schema-integration-example.d.ts +27 -0
  80. package/build/lib/graphql-document/schema-integration-example.d.ts.map +1 -0
  81. package/build/lib/graphql-document/schema-integration-example.js +297 -0
  82. package/build/lib/graphql-document/schema-integration-example.js.map +1 -0
  83. package/build/lib/graphql-document/schema-integration.d.ts +135 -0
  84. package/build/lib/graphql-document/schema-integration.d.ts.map +1 -0
  85. package/build/lib/graphql-document/schema-integration.js +328 -0
  86. package/build/lib/graphql-document/schema-integration.js.map +1 -0
  87. package/build/lib/graphql-document/types.d.ts +117 -0
  88. package/build/lib/graphql-document/types.d.ts.map +1 -0
  89. package/build/lib/graphql-document/types.js +2 -0
  90. package/build/lib/graphql-document/types.js.map +1 -0
  91. package/build/template/components/ArgumentAnnotation.js +10 -0
  92. package/build/template/components/ArgumentAnnotation.js.map +1 -0
  93. package/build/template/components/ArgumentList.js +9 -0
  94. package/build/template/components/ArgumentList.js.map +1 -0
  95. package/build/template/components/ArgumentListAnnotation.js +15 -0
  96. package/build/template/components/ArgumentListAnnotation.js.map +1 -0
  97. package/build/template/components/Changelog.js +44 -0
  98. package/build/template/components/Changelog.js.map +1 -0
  99. package/build/template/components/{CodeBlock.jsx → CodeBlock.js} +4 -5
  100. package/build/template/components/{CodeBlock.jsx.map → CodeBlock.js.map} +1 -1
  101. package/build/template/components/{CodeBlockEnhancer.jsx → CodeBlockEnhancer.js} +4 -4
  102. package/build/template/components/CodeBlockEnhancer.js.map +1 -0
  103. package/build/template/components/DeprecationReason.js +9 -0
  104. package/build/template/components/DeprecationReason.js.map +1 -0
  105. package/build/template/components/Description.js +9 -0
  106. package/build/template/components/Description.js.map +1 -0
  107. package/build/template/components/Field.js +14 -0
  108. package/build/template/components/Field.js.map +1 -0
  109. package/build/template/components/{FieldList.jsx → FieldList.js} +4 -5
  110. package/build/template/components/FieldList.js.map +1 -0
  111. package/build/template/components/{FieldListSection.jsx → FieldListSection.js} +4 -6
  112. package/build/template/components/FieldListSection.js.map +1 -0
  113. package/build/template/components/HamburgerMenu.js +30 -0
  114. package/build/template/components/HamburgerMenu.js.map +1 -0
  115. package/build/template/components/Link.d.ts +1 -1
  116. package/build/template/components/{Link.jsx → Link.js} +4 -5
  117. package/build/template/components/Link.js.map +1 -0
  118. package/build/template/components/Logo.js +20 -0
  119. package/build/template/components/Logo.js.map +1 -0
  120. package/build/template/components/MDXComponents.d.ts +11 -0
  121. package/build/template/components/MDXComponents.d.ts.map +1 -0
  122. package/build/template/components/MDXComponents.js +70 -0
  123. package/build/template/components/MDXComponents.js.map +1 -0
  124. package/build/template/components/{Markdown.jsx → Markdown.js} +3 -2
  125. package/build/template/components/Markdown.js.map +1 -0
  126. package/build/template/components/MissingSchema.d.ts +1 -1
  127. package/build/template/components/MissingSchema.d.ts.map +1 -1
  128. package/build/template/components/MissingSchema.js +5 -0
  129. package/build/template/components/MissingSchema.js.map +1 -0
  130. package/build/template/components/NamedType.js +12 -0
  131. package/build/template/components/NamedType.js.map +1 -0
  132. package/build/template/components/NotFound.js +7 -0
  133. package/build/template/components/NotFound.js.map +1 -0
  134. package/build/template/components/{RadixLink.jsx → RadixLink.js} +1 -1
  135. package/build/template/components/RadixLink.js.map +1 -0
  136. package/build/template/components/TestComponent.d.ts +5 -0
  137. package/build/template/components/TestComponent.d.ts.map +1 -0
  138. package/build/template/components/TestComponent.js +7 -0
  139. package/build/template/components/TestComponent.js.map +1 -0
  140. package/build/template/components/Texts/{MinorHeading.jsx → MinorHeading.js} +4 -3
  141. package/build/template/components/Texts/MinorHeading.js.map +1 -0
  142. package/build/template/components/Texts/texts.js +1 -1
  143. package/build/template/components/Texts/texts.js.map +1 -1
  144. package/build/template/components/ThemeToggle.js +9 -0
  145. package/build/template/components/ThemeToggle.js.map +1 -0
  146. package/build/template/components/{TypeAnnotation.jsx → TypeAnnotation.js} +8 -18
  147. package/build/template/components/TypeAnnotation.js.map +1 -0
  148. package/build/template/components/TypeFieldsLinkList.js +9 -0
  149. package/build/template/components/TypeFieldsLinkList.js.map +1 -0
  150. package/build/template/components/TypeIndex.js +17 -0
  151. package/build/template/components/TypeIndex.js.map +1 -0
  152. package/build/template/components/content/$$.d.ts +1 -0
  153. package/build/template/components/content/$$.d.ts.map +1 -1
  154. package/build/template/components/content/$$.js +1 -0
  155. package/build/template/components/content/$$.js.map +1 -1
  156. package/build/template/components/content/GraphQLDocumentWithSchema.d.ts +8 -0
  157. package/build/template/components/content/GraphQLDocumentWithSchema.d.ts.map +1 -0
  158. package/build/template/components/content/GraphQLDocumentWithSchema.js +16 -0
  159. package/build/template/components/content/GraphQLDocumentWithSchema.js.map +1 -0
  160. package/build/template/components/content/GraphQLDocumentWrapper.d.ts +7 -0
  161. package/build/template/components/content/GraphQLDocumentWrapper.d.ts.map +1 -0
  162. package/build/template/components/content/GraphQLDocumentWrapper.js +62 -0
  163. package/build/template/components/content/GraphQLDocumentWrapper.js.map +1 -0
  164. package/build/template/components/graphql/graphql.d.ts +2 -2
  165. package/build/template/components/graphql/graphql.js +3 -0
  166. package/build/template/components/graphql/graphql.js.map +1 -0
  167. package/build/template/components/graphql/index.d.ts +1 -1
  168. package/build/template/components/graphql/index.js +1 -1
  169. package/build/template/components/graphql/index.js.map +1 -1
  170. package/build/template/components/graphql/{type-kind-icon.jsx → type-kind-icon.js} +3 -2
  171. package/build/template/components/graphql/type-kind-icon.js.map +1 -0
  172. package/build/template/components/graphql/type-link.js +11 -0
  173. package/build/template/components/graphql/type-link.js.map +1 -0
  174. package/build/template/components/sidebar/Sidebar.d.ts +1 -1
  175. package/build/template/components/sidebar/Sidebar.d.ts.map +1 -1
  176. package/build/template/components/sidebar/Sidebar.js +11 -0
  177. package/build/template/components/sidebar/Sidebar.js.map +1 -0
  178. package/build/template/components/sidebar/{SidebarItem.jsx → SidebarItem.js} +15 -32
  179. package/build/template/components/sidebar/SidebarItem.js.map +1 -0
  180. package/build/template/components/sidebar/ToggleButton.d.ts +1 -1
  181. package/build/template/components/sidebar/ToggleButton.d.ts.map +1 -1
  182. package/build/template/components/sidebar/ToggleButton.js +5 -0
  183. package/build/template/components/sidebar/ToggleButton.js.map +1 -0
  184. package/build/template/contexts/{ThemeContext.jsx → ThemeContext.js} +3 -4
  185. package/build/template/contexts/{ThemeContext.jsx.map → ThemeContext.js.map} +1 -1
  186. package/build/template/entry.client.d.ts +1 -0
  187. package/build/template/entry.client.d.ts.map +1 -1
  188. package/build/template/{entry.client.jsx → entry.client.js} +5 -6
  189. package/build/template/entry.client.js.map +1 -0
  190. package/build/template/routes/changelog.d.ts +1 -1
  191. package/build/template/routes/{changelog.jsx → changelog.js} +5 -4
  192. package/build/template/routes/changelog.js.map +1 -0
  193. package/build/template/routes/{index.jsx → index.js} +3 -2
  194. package/build/template/routes/index.js.map +1 -0
  195. package/build/template/routes/reference.$type.$field.d.ts +1 -1
  196. package/build/template/routes/{reference.$type.$field.jsx → reference.$type.$field.js} +6 -5
  197. package/build/template/routes/reference.$type.$field.js.map +1 -0
  198. package/build/template/routes/reference.$type.d.ts +1 -1
  199. package/build/template/routes/{reference.$type.jsx → reference.$type.js} +6 -5
  200. package/build/template/routes/reference.$type.js.map +1 -0
  201. package/build/template/routes/reference.d.ts +2 -2
  202. package/build/template/routes/{reference.jsx → reference.js} +6 -7
  203. package/build/template/routes/reference.js.map +1 -0
  204. package/build/template/routes/root.d.ts +2 -2
  205. package/build/template/routes/root.d.ts.map +1 -1
  206. package/build/template/routes/{root.jsx → root.js} +46 -88
  207. package/build/template/routes/root.js.map +1 -0
  208. package/build/template/routes.js +5 -0
  209. package/build/template/routes.js.map +1 -0
  210. package/build/template/server/app.js +1 -1
  211. package/build/template/server/app.js.map +1 -1
  212. package/build/template/server/{render-page.jsx → render-page.js} +3 -4
  213. package/build/template/server/render-page.js.map +1 -0
  214. package/build/template/server/ssg/generate.js +1 -1
  215. package/build/template/server/ssg/generate.js.map +1 -1
  216. package/build/template/server/ssg/get-route-paths.js +1 -1
  217. package/build/template/server/ssg/get-route-paths.js.map +1 -1
  218. package/build/template/server/view.js +1 -1
  219. package/build/template/server/view.js.map +1 -1
  220. package/package.json +57 -8
  221. package/src/api/vite/plugins/core.ts +0 -3
  222. package/src/api/vite/plugins/pages.ts +1 -1
  223. package/src/exports/components.ts +4 -1
  224. package/src/lib/graphql-document/$$.ts +4 -0
  225. package/src/lib/graphql-document/$.test.ts +132 -0
  226. package/src/lib/graphql-document/$.ts +1 -0
  227. package/src/lib/graphql-document/README.md +102 -0
  228. package/src/lib/graphql-document/analysis.ts +415 -0
  229. package/src/lib/graphql-document/components/CopyButton.tsx +76 -0
  230. package/src/lib/graphql-document/components/GraphQLDocument.tsx +250 -0
  231. package/src/lib/graphql-document/components/GraphQLDocument.unit.test.ts +188 -0
  232. package/src/lib/graphql-document/components/GraphQLDocumentWithSchema.tsx +70 -0
  233. package/src/lib/graphql-document/components/GraphQLIdentifierPopover.tsx +197 -0
  234. package/src/lib/graphql-document/components/IdentifierLink.tsx +160 -0
  235. package/src/lib/graphql-document/components/graphql-document-styles.ts +167 -0
  236. package/src/lib/graphql-document/components/index.ts +5 -0
  237. package/src/lib/graphql-document/demo.md +155 -0
  238. package/src/lib/graphql-document/example.ts +163 -0
  239. package/src/lib/graphql-document/graphql-document.ts +37 -0
  240. package/src/lib/graphql-document/hooks/use-tooltip-state.test.ts +76 -0
  241. package/src/lib/graphql-document/hooks/use-tooltip-state.ts +191 -0
  242. package/src/lib/graphql-document/positioning-simple.test.ts +252 -0
  243. package/src/lib/graphql-document/positioning-simple.ts +271 -0
  244. package/src/lib/graphql-document/schema-context.tsx +20 -0
  245. package/src/lib/graphql-document/schema-integration-example.ts +341 -0
  246. package/src/lib/graphql-document/schema-integration.test.ts +365 -0
  247. package/src/lib/graphql-document/schema-integration.ts +497 -0
  248. package/src/lib/graphql-document/types.ts +129 -0
  249. package/src/template/components/ArgumentAnnotation.tsx +1 -1
  250. package/src/template/components/ArgumentList.tsx +1 -1
  251. package/src/template/components/ArgumentListAnnotation.tsx +2 -2
  252. package/src/template/components/CodeBlockEnhancer.tsx +21 -21
  253. package/src/template/components/DeprecationReason.tsx +1 -1
  254. package/src/template/components/Description.tsx +1 -1
  255. package/src/template/components/Field.tsx +4 -4
  256. package/src/template/components/FieldList.tsx +1 -1
  257. package/src/template/components/FieldListSection.tsx +1 -1
  258. package/src/template/components/Link.tsx +2 -2
  259. package/src/template/components/MDXComponents.tsx +101 -0
  260. package/src/template/components/NamedType.tsx +2 -2
  261. package/src/template/components/TestComponent.tsx +6 -0
  262. package/src/template/components/TypeAnnotation.tsx +1 -1
  263. package/src/template/components/TypeFieldsLinkList.tsx +1 -1
  264. package/src/template/components/TypeIndex.tsx +1 -1
  265. package/src/template/components/content/$$.ts +1 -0
  266. package/src/template/components/content/GraphQLDocumentWithSchema.tsx +18 -0
  267. package/src/template/components/content/GraphQLDocumentWrapper.tsx +82 -0
  268. package/src/template/components/graphql/graphql.tsx +2 -2
  269. package/src/template/components/graphql/index.ts +1 -1
  270. package/src/template/components/graphql/type-link.tsx +2 -2
  271. package/src/template/entry.client.tsx +2 -2
  272. package/src/template/routes/changelog.tsx +1 -1
  273. package/src/template/routes/reference.$type.$field.tsx +3 -3
  274. package/src/template/routes/reference.$type.tsx +3 -3
  275. package/src/template/routes/reference.tsx +3 -3
  276. package/src/template/routes/root.tsx +36 -25
  277. package/src/template/routes.tsx +1 -1
  278. package/src/template/server/app.ts +1 -1
  279. package/src/template/server/ssg/generate.ts +1 -1
  280. package/src/template/server/ssg/get-route-paths.ts +1 -1
  281. package/src/template/server/view.ts +1 -1
  282. package/src/template/styles/code-block.css +32 -0
  283. package/build/template/components/ArgumentAnnotation.jsx +0 -16
  284. package/build/template/components/ArgumentAnnotation.jsx.map +0 -1
  285. package/build/template/components/ArgumentList.jsx +0 -16
  286. package/build/template/components/ArgumentList.jsx.map +0 -1
  287. package/build/template/components/ArgumentListAnnotation.jsx +0 -23
  288. package/build/template/components/ArgumentListAnnotation.jsx.map +0 -1
  289. package/build/template/components/Changelog.jsx +0 -68
  290. package/build/template/components/Changelog.jsx.map +0 -1
  291. package/build/template/components/CodeBlockEnhancer.jsx.map +0 -1
  292. package/build/template/components/DeprecationReason.jsx +0 -10
  293. package/build/template/components/DeprecationReason.jsx.map +0 -1
  294. package/build/template/components/Description.jsx +0 -10
  295. package/build/template/components/Description.jsx.map +0 -1
  296. package/build/template/components/Field.jsx +0 -22
  297. package/build/template/components/Field.jsx.map +0 -1
  298. package/build/template/components/FieldList.jsx.map +0 -1
  299. package/build/template/components/FieldListSection.jsx.map +0 -1
  300. package/build/template/components/HamburgerMenu.jsx +0 -53
  301. package/build/template/components/HamburgerMenu.jsx.map +0 -1
  302. package/build/template/components/Link.jsx.map +0 -1
  303. package/build/template/components/Logo.jsx +0 -29
  304. package/build/template/components/Logo.jsx.map +0 -1
  305. package/build/template/components/Markdown.jsx.map +0 -1
  306. package/build/template/components/MissingSchema.jsx +0 -4
  307. package/build/template/components/MissingSchema.jsx.map +0 -1
  308. package/build/template/components/NamedType.jsx +0 -17
  309. package/build/template/components/NamedType.jsx.map +0 -1
  310. package/build/template/components/NotFound.jsx +0 -26
  311. package/build/template/components/NotFound.jsx.map +0 -1
  312. package/build/template/components/RadixLink.jsx.map +0 -1
  313. package/build/template/components/Texts/MinorHeading.jsx.map +0 -1
  314. package/build/template/components/ThemeToggle.jsx +0 -10
  315. package/build/template/components/ThemeToggle.jsx.map +0 -1
  316. package/build/template/components/TypeAnnotation.jsx.map +0 -1
  317. package/build/template/components/TypeFieldsLinkList.jsx +0 -17
  318. package/build/template/components/TypeFieldsLinkList.jsx.map +0 -1
  319. package/build/template/components/TypeIndex.jsx +0 -27
  320. package/build/template/components/TypeIndex.jsx.map +0 -1
  321. package/build/template/components/graphql/graphql.jsx +0 -3
  322. package/build/template/components/graphql/graphql.jsx.map +0 -1
  323. package/build/template/components/graphql/type-kind-icon.jsx.map +0 -1
  324. package/build/template/components/graphql/type-link.jsx +0 -16
  325. package/build/template/components/graphql/type-link.jsx.map +0 -1
  326. package/build/template/components/sidebar/Sidebar.jsx +0 -15
  327. package/build/template/components/sidebar/Sidebar.jsx.map +0 -1
  328. package/build/template/components/sidebar/SidebarItem.jsx.map +0 -1
  329. package/build/template/components/sidebar/ToggleButton.jsx +0 -6
  330. package/build/template/components/sidebar/ToggleButton.jsx.map +0 -1
  331. package/build/template/entry.client.jsx.map +0 -1
  332. package/build/template/routes/changelog.jsx.map +0 -1
  333. package/build/template/routes/index.jsx.map +0 -1
  334. package/build/template/routes/reference.$type.$field.jsx.map +0 -1
  335. package/build/template/routes/reference.$type.jsx.map +0 -1
  336. package/build/template/routes/reference.jsx.map +0 -1
  337. package/build/template/routes/root.jsx.map +0 -1
  338. package/build/template/routes.jsx +0 -5
  339. package/build/template/routes.jsx.map +0 -1
  340. package/build/template/server/render-page.jsx.map +0 -1
@@ -10,13 +10,13 @@ export const CodeBlockEnhancer = () => {
10
10
  // Add styles for code block enhancements
11
11
  const styleId = 'code-block-enhancer-styles'
12
12
  let styleElement = document.getElementById(styleId) as HTMLStyleElement
13
-
13
+
14
14
  if (!styleElement) {
15
15
  styleElement = document.createElement('style')
16
16
  styleElement.id = styleId
17
17
  document.head.appendChild(styleElement)
18
18
  }
19
-
19
+
20
20
  styleElement.textContent = `
21
21
  /* Enhanced code block styles */
22
22
  pre.shiki {
@@ -89,7 +89,7 @@ export const CodeBlockEnhancer = () => {
89
89
  color: white !important;
90
90
  }
91
91
  `
92
-
92
+
93
93
  return () => {
94
94
  if (styleElement && styleElement.parentNode) {
95
95
  styleElement.parentNode.removeChild(styleElement)
@@ -100,22 +100,22 @@ export const CodeBlockEnhancer = () => {
100
100
  useEffect(() => {
101
101
  const enhanceCodeBlocks = () => {
102
102
  const codeBlocks = document.querySelectorAll('pre.shiki:not([data-enhanced])')
103
-
103
+
104
104
  codeBlocks.forEach((block) => {
105
105
  const preElement = block as HTMLPreElement
106
106
  preElement.setAttribute('data-enhanced', 'true')
107
-
107
+
108
108
  // Get language from class name
109
109
  const classes = preElement.className.split(' ')
110
110
  const language = classes.find(c => c !== 'shiki' && c !== 'shiki-light' && c !== 'shiki-dark') || 'text'
111
-
111
+
112
112
  // Check for title in first line
113
113
  const codeElement = preElement.querySelector('code')
114
114
  if (!codeElement) return
115
-
115
+
116
116
  const firstLine = codeElement.textContent?.split('\n')[0] || ''
117
117
  let title = ''
118
-
118
+
119
119
  const titleMatch = firstLine.match(/^\/\/\s*title:\s*(.+)$/i)
120
120
  if (titleMatch && titleMatch[1]) {
121
121
  title = titleMatch[1]
@@ -124,27 +124,27 @@ export const CodeBlockEnhancer = () => {
124
124
  if (firstLineElement) {
125
125
  firstLineElement.style.display = 'none'
126
126
  }
127
-
127
+
128
128
  // Set data attributes for CSS
129
129
  preElement.setAttribute('data-title', title)
130
130
  preElement.setAttribute('data-language', language)
131
131
  preElement.style.marginTop = '3rem'
132
132
  }
133
-
133
+
134
134
  // Create copy button
135
135
  const copyButton = document.createElement('button')
136
136
  copyButton.className = 'code-block-copy'
137
137
  copyButton.textContent = 'Copy'
138
138
  copyButton.setAttribute('data-copied', 'false')
139
-
139
+
140
140
  copyButton.onclick = async (e) => {
141
141
  e.preventDefault()
142
142
  e.stopPropagation()
143
-
143
+
144
144
  // Get clean code without the title line
145
145
  const code = codeElement.textContent || ''
146
146
  const cleanCode = title ? code.split('\n').slice(1).join('\n') : code
147
-
147
+
148
148
  try {
149
149
  await navigator.clipboard.writeText(cleanCode)
150
150
  copyButton.textContent = 'Copied!'
@@ -157,15 +157,15 @@ export const CodeBlockEnhancer = () => {
157
157
  console.error('Failed to copy:', err)
158
158
  }
159
159
  }
160
-
160
+
161
161
  // Append copy button directly to pre element
162
162
  preElement.appendChild(copyButton)
163
163
  })
164
164
  }
165
-
165
+
166
166
  // Small delay to ensure DOM is ready
167
167
  const timeoutId = setTimeout(enhanceCodeBlocks, 100)
168
-
168
+
169
169
  return () => {
170
170
  clearTimeout(timeoutId)
171
171
  // Clean up enhanced code blocks
@@ -181,12 +181,12 @@ export const CodeBlockEnhancer = () => {
181
181
  const firstLine = block.querySelector('span.line') as HTMLElement
182
182
  if (firstLine && firstLine.style.display === 'none') {
183
183
  firstLine.style.display = ''
184
- }
185
- // Reset margin
186
- (block as HTMLElement).style.marginTop = ''
184
+ } // Reset margin
185
+
186
+ ;(block as HTMLElement).style.marginTop = ''
187
187
  })
188
188
  }
189
189
  }, [location.pathname]) // Re-run when route changes
190
-
190
+
191
191
  return null
192
- }
192
+ }
@@ -1,7 +1,7 @@
1
1
  import type { GrafaidOld } from '#lib/grafaid-old/index'
2
2
  import { Text } from '@radix-ui/themes'
3
3
  import type { FC } from 'react'
4
- import { Markdown } from './Markdown.jsx'
4
+ import { Markdown } from './Markdown.tsx'
5
5
 
6
6
  export const DeprecationReason: FC<{ data: GrafaidOld.GraphQLField }> = ({ data }) => {
7
7
  if (!data.deprecationReason) return null
@@ -1,6 +1,6 @@
1
1
  import { Text } from '@radix-ui/themes'
2
2
  import type { FC } from 'react'
3
- import { Markdown } from './Markdown.jsx'
3
+ import { Markdown } from './Markdown.tsx'
4
4
  // import type { Grafaid } from '#lib/grafaid'
5
5
  import type { GrafaidOld } from '#lib/grafaid-old/index'
6
6
  import type { GraphQLNamedType } from 'graphql'
@@ -2,10 +2,10 @@ import { GrafaidOld } from '#lib/grafaid-old/index'
2
2
  import type { BoxProps } from '@radix-ui/themes'
3
3
  import { Box, Text } from '@radix-ui/themes'
4
4
  import type { FC } from 'react'
5
- import { ArgumentListAnnotation } from './ArgumentListAnnotation.jsx'
6
- import { DeprecationReason } from './DeprecationReason.jsx'
7
- import { Description } from './Description.jsx'
8
- import { TypeAnnotation } from './TypeAnnotation.jsx'
5
+ import { ArgumentListAnnotation } from './ArgumentListAnnotation.tsx'
6
+ import { DeprecationReason } from './DeprecationReason.tsx'
7
+ import { Description } from './Description.tsx'
8
+ import { TypeAnnotation } from './TypeAnnotation.tsx'
9
9
 
10
10
  export type Props = BoxProps & {
11
11
  data: GrafaidOld.GraphQLField
@@ -1,7 +1,7 @@
1
1
  import { Grafaid } from '#lib/grafaid/index'
2
2
  import { Box } from '@radix-ui/themes'
3
3
  import type { FC } from 'react'
4
- import { Field } from './Field.jsx'
4
+ import { Field } from './Field.tsx'
5
5
 
6
6
  export interface Props {
7
7
  data: Grafaid.Schema.TypesLike.Named
@@ -2,7 +2,7 @@ import { Grafaid } from '#lib/grafaid/index'
2
2
  import { Box, Heading } from '@radix-ui/themes'
3
3
  import type { GraphQLNamedType } from 'graphql'
4
4
  import type { FC } from 'react'
5
- import { FieldList } from './FieldList.jsx'
5
+ import { FieldList } from './FieldList.tsx'
6
6
 
7
7
  export interface Props {
8
8
  data: GraphQLNamedType
@@ -3,8 +3,8 @@ 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
5
  import { ObjPartition } from '../../lib/kit-temp.ts'
6
- import type { LinkPropsRadix } from './RadixLink.jsx'
7
- import { LinkRadix } from './RadixLink.jsx'
6
+ import type { LinkPropsRadix } from './RadixLink.tsx'
7
+ import { LinkRadix } from './RadixLink.tsx'
8
8
 
9
9
  const reactRouterPropKeys = [
10
10
  'discover',
@@ -0,0 +1,101 @@
1
+ import React from 'react'
2
+
3
+ interface PreProps {
4
+ children: React.ReactNode
5
+ className?: string
6
+ 'data-enhanced'?: string
7
+ }
8
+
9
+ interface CodeProps {
10
+ children: string
11
+ className?: string
12
+ }
13
+
14
+ /**
15
+ * Custom pre component that intercepts GraphQL code blocks
16
+ */
17
+ const Pre: React.FC<PreProps> = ({ children, className, ...props }) => {
18
+ // Check if this is a Shiki-enhanced code block
19
+ const isShiki = props['data-enhanced'] === 'true'
20
+
21
+ // Extract the code element
22
+ const codeElement = React.Children.toArray(children).find(
23
+ child => React.isValidElement(child) && child.type === 'code',
24
+ ) as React.ReactElement<CodeProps> | undefined
25
+
26
+ if (!codeElement) {
27
+ return <pre className={className} {...props}>{children}</pre>
28
+ }
29
+
30
+ // Check if it's a GraphQL code block
31
+ const codeClassName = codeElement.props.className || ''
32
+ const isGraphQL = codeClassName.includes('language-graphql') || codeClassName.includes('language-gql')
33
+
34
+ if (isGraphQL && isShiki) {
35
+ // Extract the plain text content from the code element
36
+ const plainText = extractPlainText(codeElement.props.children)
37
+
38
+ // For now, just render the Shiki-highlighted code normally
39
+ // The GraphQLDocument component will be enhanced client-side
40
+ return (
41
+ <div data-testid='graphql-document' data-graphql-code={plainText}>
42
+ <pre className={className} {...props}>{children}</pre>
43
+ </div>
44
+ )
45
+ }
46
+
47
+ // For non-GraphQL code blocks, render normally
48
+ return <pre className={className} {...props}>{children}</pre>
49
+ }
50
+
51
+ /**
52
+ * Extract plain text from React children (recursive)
53
+ */
54
+ function extractPlainText(children: React.ReactNode): string {
55
+ if (typeof children === 'string') {
56
+ return children
57
+ }
58
+
59
+ if (Array.isArray(children)) {
60
+ return children.map(extractPlainText).join('')
61
+ }
62
+
63
+ if (React.isValidElement(children)) {
64
+ const props = (children as React.ReactElement<any>).props
65
+ if (props?.children) {
66
+ return extractPlainText(props.children)
67
+ }
68
+ }
69
+
70
+ return ''
71
+ }
72
+
73
+ /**
74
+ * Simple server-side rendering of React element to HTML string
75
+ */
76
+ function renderToStaticMarkup(element: React.ReactNode): string {
77
+ // For server-side, we just need to preserve the structure
78
+ if (typeof element === 'string') return element
79
+
80
+ if (React.isValidElement(element)) {
81
+ const { type, props } = element as React.ReactElement<any>
82
+ const tagName = typeof type === 'string' ? type : 'div'
83
+ const attrs = Object.entries(props || {})
84
+ .filter(([key]) => key !== 'children' && !key.startsWith('__'))
85
+ .map(([key, value]) => `${key}="${value}"`)
86
+ .join(' ')
87
+
88
+ const children = props?.children ? renderToStaticMarkup(props.children) : ''
89
+ return `<${tagName}${attrs ? ' ' + attrs : ''}>${children}</${tagName}>`
90
+ }
91
+
92
+ if (Array.isArray(element)) {
93
+ return element.map(renderToStaticMarkup).join('')
94
+ }
95
+
96
+ return ''
97
+ }
98
+
99
+ export const mdxComponents = {
100
+ pre: Pre,
101
+ }
@@ -1,8 +1,8 @@
1
1
  import { Box, Heading, Text } from '@radix-ui/themes'
2
2
  import { type GraphQLNamedType } from 'graphql'
3
3
  import type { FC } from 'react'
4
- import { FieldListSection } from './FieldListSection.jsx'
5
- import { Markdown } from './Markdown.jsx'
4
+ import { FieldListSection } from './FieldListSection.tsx'
5
+ import { Markdown } from './Markdown.tsx'
6
6
 
7
7
  export interface Props {
8
8
  data: GraphQLNamedType
@@ -0,0 +1,6 @@
1
+ import React from 'react'
2
+
3
+ export const TestComponent: React.FC<{ children: React.ReactNode }> = ({ children }) => {
4
+ console.log('TestComponent rendered!')
5
+ return <div style={{ border: '2px solid red', padding: '10px' }}>TEST: {children}</div>
6
+ }
@@ -2,7 +2,7 @@ import { Text } from '@radix-ui/themes'
2
2
  import type { GraphQLType } from 'graphql'
3
3
  import { isInputObjectType, isListType, isNamedType, isNonNullType, isScalarType } from 'graphql'
4
4
  import type { FC } from 'react'
5
- import { Link } from './Link.jsx'
5
+ import { Link } from './Link.tsx'
6
6
 
7
7
  export interface Props {
8
8
  type: GraphQLType // Can be either GraphQLInputType or GraphQLOutputType
@@ -1,7 +1,7 @@
1
1
  import { Box, Flex, Heading } from '@radix-ui/themes'
2
2
  import type { GraphQLInterfaceType, GraphQLObjectType } from 'graphql'
3
3
  import type { FC } from 'react'
4
- import { Link } from './Link.jsx'
4
+ import { Link } from './Link.tsx'
5
5
 
6
6
  export interface Props {
7
7
  type: GraphQLObjectType | GraphQLInterfaceType
@@ -3,7 +3,7 @@ import { Box, Flex, Heading } from '@radix-ui/themes'
3
3
  import { Obj } from '@wollybeard/kit'
4
4
  import type { GraphQLNamedType, GraphQLSchema } from 'graphql'
5
5
  import type { FC } from 'react'
6
- import { Link } from './Link.jsx'
6
+ import { Link } from './Link.tsx'
7
7
 
8
8
  export interface Props {
9
9
  schema: GraphQLSchema
@@ -1 +1,2 @@
1
1
  export { Callout, Tabs } from '@radix-ui/themes'
2
+ export { GraphQLDocumentWithSchema } from './GraphQLDocumentWithSchema.tsx'
@@ -0,0 +1,18 @@
1
+ import type { GraphQLSchema } from 'graphql'
2
+ import React from 'react'
3
+ import PROJECT_DATA from 'virtual:polen/project/data.jsonsuper'
4
+ import { GraphQLDocument } from '../../../lib/graphql-document/components/GraphQLDocument.tsx'
5
+ import type { GraphQLDocumentProps } from '../../../lib/graphql-document/components/GraphQLDocument.tsx'
6
+
7
+ /**
8
+ * Wrapper component that provides schema from virtual module directly to GraphQLDocument
9
+ * This bypasses the context issue with MDX components
10
+ */
11
+ export const GraphQLDocumentWithSchema: React.FC<Omit<GraphQLDocumentProps, 'schema'>> = (props) => {
12
+ const schema = PROJECT_DATA.schema?.versions[0]?.after
13
+ console.log('Template wrapper - schema:', schema ? 'EXISTS' : 'UNDEFINED')
14
+ console.log('Template wrapper - props:', props)
15
+ console.log('Template wrapper - PROJECT_DATA.schema:', PROJECT_DATA.schema)
16
+
17
+ return <GraphQLDocument {...props} schema={schema} />
18
+ }
@@ -0,0 +1,82 @@
1
+ import React from 'react'
2
+ import { useNavigate } from 'react-router'
3
+ import { GraphQLDocument } from '../../../lib/graphql-document/components/GraphQLDocument.tsx'
4
+ import type { GraphQLDocumentProps } from '../../../lib/graphql-document/components/GraphQLDocument.tsx'
5
+ import { highlightCode } from '../../../lib/shiki/shiki.ts'
6
+
7
+ /**
8
+ * Client-side wrapper that hydrates GraphQL documents with schema
9
+ */
10
+ export const GraphQLDocumentWithSchema: React.FC<Omit<GraphQLDocumentProps, 'schema'>> = (props) => {
11
+ try {
12
+ const [schema, setSchema] = React.useState<any>(null)
13
+ const [isClient, setIsClient] = React.useState(false)
14
+ const [highlightedHtml, setHighlightedHtml] = React.useState<string | null>(null)
15
+
16
+ React.useEffect(() => {
17
+ setIsClient(true)
18
+
19
+ // Highlight the code
20
+ if (typeof props.children === 'string') {
21
+ highlightCode({
22
+ code: props.children,
23
+ lang: 'graphql',
24
+ theme: 'light', // You can make this dynamic based on theme
25
+ }).then(html => {
26
+ setHighlightedHtml(html)
27
+ }).catch(err => {
28
+ console.error('Failed to highlight code:', err)
29
+ })
30
+ }
31
+
32
+ // Access virtual module only on client side
33
+ if (typeof window !== 'undefined') {
34
+ import('virtual:polen/project/data.jsonsuper').then(PROJECT_DATA => {
35
+ const s = PROJECT_DATA.default?.schema?.versions?.[0]?.after
36
+ if (s) {
37
+ setSchema(s)
38
+ }
39
+ }).catch(err => {
40
+ console.error('Failed to load schema:', err)
41
+ })
42
+ }
43
+ }, [props.children])
44
+
45
+ // During SSR, render a simple code block
46
+ if (!isClient) {
47
+ return (
48
+ <div data-testid='graphql-document' className='graphql-document graphql-document-static'>
49
+ <pre className='shiki shiki-themes github-light tokyo-night'>
50
+ <code className="language-graphql">{props.children}</code>
51
+ </pre>
52
+ </div>
53
+ )
54
+ }
55
+
56
+ // During client render, use the full component
57
+ // Pass a custom navigate function that doesn't require router
58
+ const handleNavigate = (url: string) => {
59
+ if (typeof window !== 'undefined') {
60
+ window.location.href = url
61
+ }
62
+ }
63
+
64
+ return (
65
+ <div data-testid='graphql-document'>
66
+ <GraphQLDocument
67
+ {...props}
68
+ schema={schema}
69
+ highlightedHtml={highlightedHtml || undefined}
70
+ options={{
71
+ ...props.options,
72
+ onNavigate: handleNavigate,
73
+ debug: false, // Disable debug mode for shipping
74
+ }}
75
+ />
76
+ </div>
77
+ )
78
+ } catch (err) {
79
+ console.error('GraphQLDocumentWithSchema error:', err)
80
+ return <div>Error rendering GraphQL document</div>
81
+ }
82
+ }
@@ -1,2 +1,2 @@
1
- export * from './type-kind-icon.jsx'
2
- export * from './type-link.jsx'
1
+ export * from './type-kind-icon.tsx'
2
+ export * from './type-link.tsx'
@@ -1 +1 @@
1
- export * as Graphql from './graphql.jsx'
1
+ export * as Graphql from './graphql.tsx'
@@ -1,7 +1,7 @@
1
1
  import { Grafaid } from '#lib/grafaid/index'
2
2
  import { Code, Flex } from '@radix-ui/themes'
3
- import { Link } from '../Link.jsx'
4
- import { TypeKindIcon } from './graphql.jsx'
3
+ import { Link } from '../Link.tsx'
4
+ import { TypeKindIcon } from './graphql.tsx'
5
5
  import { typeKindTokensIndex } from './type-kind-tokens.ts'
6
6
 
7
7
  export const TypeLink: React.FC<{ type: Grafaid.Schema.TypesLike.Named }> = ({ type }) => {
@@ -2,12 +2,12 @@
2
2
  // But then, we won't get it from the client manifest. But we could get it from the server manifest. Should we do that?
3
3
  // But then, that wouldn't work for SPA. Does that matter? Just put a conditional here e.g. if (import.meta.env.PROD) ...?
4
4
  import '@radix-ui/themes/styles.css'
5
- // import './styles/code-block.css' // TODO: Handle CSS in build process
5
+ import './styles/code-block.css'
6
6
  import { ReactDomClient } from '#dep/react-dom-client/index'
7
7
  import { StrictMode } from 'react'
8
8
  import { createBrowserRouter, RouterProvider } from 'react-router'
9
9
  import PROJECT_DATA from 'virtual:polen/project/data.jsonsuper'
10
- import { routes } from './routes.jsx'
10
+ import { routes } from './routes.tsx'
11
11
 
12
12
  // SPA
13
13
 
@@ -1,7 +1,7 @@
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
3
  import PROJECT_DATA from 'virtual:polen/project/data.jsonsuper'
4
- import { Changelog } from '../components/Changelog.jsx'
4
+ import { Changelog } from '../components/Changelog.tsx'
5
5
 
6
6
  const loader = createLoader(() => {
7
7
  return {
@@ -2,9 +2,9 @@ import { Grafaid } from '#lib/grafaid/index'
2
2
  import { ReactRouterAid } from '#lib/react-router-aid/index'
3
3
  import { useLoaderData } from '#lib/react-router-loader/react-router-loader'
4
4
  import { useParams } from 'react-router'
5
- import { Field } from '../components/Field.jsx'
6
- import { MissingSchema } from '../components/MissingSchema.jsx'
7
- import type { reference } from './reference.jsx'
5
+ import { Field } from '../components/Field.tsx'
6
+ import { MissingSchema } from '../components/MissingSchema.tsx'
7
+ import type { reference } from './reference.tsx'
8
8
 
9
9
  const Component = () => {
10
10
  const params = useParams() as { type: string; field: string }
@@ -1,9 +1,9 @@
1
1
  import { createRoute } from '#lib/react-router-aid/react-router-aid'
2
2
  import { useLoaderData } from '#lib/react-router-loader/react-router-loader'
3
3
  import { useParams } from 'react-router'
4
- import { MissingSchema } from '../components/MissingSchema.jsx'
5
- import { NamedType } from '../components/NamedType.jsx'
6
- import type { reference } from './reference.jsx'
4
+ import { MissingSchema } from '../components/MissingSchema.tsx'
5
+ import { NamedType } from '../components/NamedType.tsx'
6
+ import type { reference } from './reference.tsx'
7
7
 
8
8
  const Component = () => {
9
9
  const params = useParams() as { type: string }
@@ -3,8 +3,8 @@ import { createLoader, useLoaderData } from '#lib/react-router-loader/react-rout
3
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
- import { MissingSchema } from '../components/MissingSchema.jsx'
7
- import { reference$type } from './reference.$type.jsx'
6
+ import { MissingSchema } from '../components/MissingSchema.tsx'
7
+ import { reference$type } from './reference.$type.tsx'
8
8
 
9
9
  const loader = createLoader(() => {
10
10
  const latestSchemaVersion = PROJECT_DATA.schema?.versions[0].after ?? null
@@ -21,7 +21,7 @@ const Component = () => {
21
21
  }
22
22
 
23
23
  return (
24
- <Box className="prose">
24
+ <Box className='prose'>
25
25
  <Outlet />
26
26
  </Box>
27
27
  )