polen 0.10.0 → 0.11.0-next.10

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 (357) hide show
  1. package/build/api/api.d.ts +1 -0
  2. package/build/api/api.d.ts.map +1 -1
  3. package/build/api/api.js +1 -0
  4. package/build/api/api.js.map +1 -1
  5. package/build/api/config/configurator.d.ts +55 -26
  6. package/build/api/config/configurator.d.ts.map +1 -1
  7. package/build/api/config/configurator.js +27 -9
  8. package/build/api/config/configurator.js.map +1 -1
  9. package/build/api/config/merge.d.ts.map +1 -1
  10. package/build/api/config/merge.js +0 -11
  11. package/build/api/config/merge.js.map +1 -1
  12. package/build/api/content/metadata.d.ts +8 -2
  13. package/build/api/content/metadata.d.ts.map +1 -1
  14. package/build/api/content/metadata.js +1 -1
  15. package/build/api/content/metadata.js.map +1 -1
  16. package/build/api/schema/data-sources/data-sources.d.ts +1 -0
  17. package/build/api/schema/data-sources/data-sources.d.ts.map +1 -1
  18. package/build/api/schema/data-sources/data-sources.js +1 -0
  19. package/build/api/schema/data-sources/data-sources.js.map +1 -1
  20. package/build/api/schema/data-sources/introspection/introspection.d.ts +83 -0
  21. package/build/api/schema/data-sources/introspection/introspection.d.ts.map +1 -0
  22. package/build/api/schema/data-sources/introspection/introspection.js +110 -0
  23. package/build/api/schema/data-sources/introspection/introspection.js.map +1 -0
  24. package/build/api/schema/data-sources/memory/memory.d.ts +2 -2
  25. package/build/api/schema/data-sources/memory/memory.d.ts.map +1 -1
  26. package/build/api/schema/data-sources/memory/memory.js +1 -3
  27. package/build/api/schema/data-sources/memory/memory.js.map +1 -1
  28. package/build/api/schema/data-sources/schema-directory/file-name-expression/file-name-expression.d.ts +7 -3
  29. package/build/api/schema/data-sources/schema-directory/file-name-expression/file-name-expression.d.ts.map +1 -1
  30. package/build/api/schema/data-sources/schema-directory/file-name-expression/file-name-expression.js +15 -11
  31. package/build/api/schema/data-sources/schema-directory/file-name-expression/file-name-expression.js.map +1 -1
  32. package/build/api/schema/data-sources/schema-directory/schema-directory.d.ts +16 -7
  33. package/build/api/schema/data-sources/schema-directory/schema-directory.d.ts.map +1 -1
  34. package/build/api/schema/data-sources/schema-directory/schema-directory.js +26 -7
  35. package/build/api/schema/data-sources/schema-directory/schema-directory.js.map +1 -1
  36. package/build/api/schema/data-sources/schema-file/schema-file.d.ts +7 -2
  37. package/build/api/schema/data-sources/schema-file/schema-file.d.ts.map +1 -1
  38. package/build/api/schema/data-sources/schema-file/schema-file.js +13 -5
  39. package/build/api/schema/data-sources/schema-file/schema-file.js.map +1 -1
  40. package/build/api/schema/metadata.d.ts +16 -0
  41. package/build/api/schema/metadata.d.ts.map +1 -0
  42. package/build/api/schema/metadata.js +19 -0
  43. package/build/api/schema/metadata.js.map +1 -0
  44. package/build/api/schema/read.d.ts +85 -11
  45. package/build/api/schema/read.d.ts.map +1 -1
  46. package/build/api/schema/read.js +15 -6
  47. package/build/api/schema/read.js.map +1 -1
  48. package/build/api/schema/schema.d.ts +33 -2
  49. package/build/api/schema/schema.d.ts.map +1 -1
  50. package/build/api/schema/schema.js +42 -0
  51. package/build/api/schema/schema.js.map +1 -1
  52. package/build/api/schema-source/index.d.ts +2 -0
  53. package/build/api/schema-source/index.d.ts.map +1 -0
  54. package/build/api/schema-source/index.js +2 -0
  55. package/build/api/schema-source/index.js.map +1 -0
  56. package/build/api/schema-source/schema-source.d.ts +33 -0
  57. package/build/api/schema-source/schema-source.d.ts.map +1 -0
  58. package/build/api/schema-source/schema-source.js +137 -0
  59. package/build/api/schema-source/schema-source.js.map +1 -0
  60. package/build/api/static/manifest.d.ts +1 -2
  61. package/build/api/static/manifest.d.ts.map +1 -1
  62. package/build/api/static/manifest.js +1 -1
  63. package/build/api/static/manifest.js.map +1 -1
  64. package/build/api/vite/plugins/build.d.ts.map +1 -1
  65. package/build/api/vite/plugins/build.js +3 -0
  66. package/build/api/vite/plugins/build.js.map +1 -1
  67. package/build/api/vite/plugins/core.d.ts +1 -0
  68. package/build/api/vite/plugins/core.d.ts.map +1 -1
  69. package/build/api/vite/plugins/core.js +25 -22
  70. package/build/api/vite/plugins/core.js.map +1 -1
  71. package/build/api/vite/plugins/main.d.ts.map +1 -1
  72. package/build/api/vite/plugins/main.js +1 -8
  73. package/build/api/vite/plugins/main.js.map +1 -1
  74. package/build/api/vite/plugins/schema-assets.d.ts +22 -0
  75. package/build/api/vite/plugins/schema-assets.d.ts.map +1 -0
  76. package/build/api/vite/plugins/schema-assets.js +310 -0
  77. package/build/api/vite/plugins/schema-assets.js.map +1 -0
  78. package/build/api/vite/plugins/serve.d.ts.map +1 -1
  79. package/build/api/vite/plugins/serve.js +11 -0
  80. package/build/api/vite/plugins/serve.js.map +1 -1
  81. package/build/cli/commands/open.js +1 -1
  82. package/build/cli/commands/open.js.map +1 -1
  83. package/build/lib/grafaid/schema/schema.d.ts +1 -1
  84. package/build/lib/grafaid/schema/schema.d.ts.map +1 -1
  85. package/build/lib/grafaid/schema/schema.js +1 -1
  86. package/build/lib/grafaid/schema/schema.js.map +1 -1
  87. package/build/lib/graphql-change/change-groups.d.ts +2 -0
  88. package/build/lib/graphql-change/change-groups.d.ts.map +1 -1
  89. package/build/lib/graphql-change/change-groups.js +54 -0
  90. package/build/lib/graphql-change/change-groups.js.map +1 -1
  91. package/build/lib/kit-temp.d.ts +9 -0
  92. package/build/lib/kit-temp.d.ts.map +1 -1
  93. package/build/lib/kit-temp.js +14 -2
  94. package/build/lib/kit-temp.js.map +1 -1
  95. package/build/lib/path-map/path-map.d.ts.map +1 -1
  96. package/build/lib/path-map/path-map.js +3 -1
  97. package/build/lib/path-map/path-map.js.map +1 -1
  98. package/build/lib/react-router-aid/react-router-aid.d.ts +5 -3
  99. package/build/lib/react-router-aid/react-router-aid.d.ts.map +1 -1
  100. package/build/lib/react-router-aid/react-router-aid.js +7 -4
  101. package/build/lib/react-router-aid/react-router-aid.js.map +1 -1
  102. package/build/project-data.d.ts +3 -11
  103. package/build/project-data.d.ts.map +1 -1
  104. package/build/template/components/Changelog.d.ts +3 -3
  105. package/build/template/components/Changelog.d.ts.map +1 -1
  106. package/build/template/components/Changelog.js +8 -84
  107. package/build/template/components/Changelog.js.map +1 -1
  108. package/build/template/components/CodeBlock.d.ts +2 -0
  109. package/build/template/components/CodeBlock.d.ts.map +1 -1
  110. package/build/template/components/CodeBlock.js +1 -4
  111. package/build/template/components/CodeBlock.js.map +1 -1
  112. package/build/template/components/ComponentDispatch.d.ts +34 -0
  113. package/build/template/components/ComponentDispatch.d.ts.map +1 -0
  114. package/build/template/components/ComponentDispatch.js +33 -0
  115. package/build/template/components/ComponentDispatch.js.map +1 -0
  116. package/build/template/components/ReferenceLink.d.ts +19 -0
  117. package/build/template/components/ReferenceLink.d.ts.map +1 -0
  118. package/build/template/components/ReferenceLink.js +19 -0
  119. package/build/template/components/ReferenceLink.js.map +1 -0
  120. package/build/template/components/TypeAnnotation.d.ts.map +1 -1
  121. package/build/template/components/TypeAnnotation.js +3 -3
  122. package/build/template/components/TypeAnnotation.js.map +1 -1
  123. package/build/template/components/TypeFieldsLinkList.d.ts.map +1 -1
  124. package/build/template/components/TypeFieldsLinkList.js +4 -4
  125. package/build/template/components/TypeFieldsLinkList.js.map +1 -1
  126. package/build/template/components/TypeIndex.js +2 -2
  127. package/build/template/components/TypeIndex.js.map +1 -1
  128. package/build/template/components/VersionSelector.d.ts +7 -0
  129. package/build/template/components/VersionSelector.d.ts.map +1 -0
  130. package/build/template/components/VersionSelector.js +30 -0
  131. package/build/template/components/VersionSelector.js.map +1 -0
  132. package/build/template/components/graphql/type-link.d.ts.map +1 -1
  133. package/build/template/components/graphql/type-link.js +2 -2
  134. package/build/template/components/graphql/type-link.js.map +1 -1
  135. package/build/template/hooks/useVersionPath.d.ts +6 -0
  136. package/build/template/hooks/useVersionPath.d.ts.map +1 -0
  137. package/build/template/hooks/useVersionPath.js +10 -0
  138. package/build/template/hooks/useVersionPath.js.map +1 -0
  139. package/build/template/layouts/ChangelogLayout.d.ts.map +1 -0
  140. package/build/template/{components → layouts}/ChangelogLayout.js +1 -1
  141. package/build/template/layouts/ChangelogLayout.js.map +1 -0
  142. package/build/template/layouts/index.d.ts +1 -0
  143. package/build/template/layouts/index.d.ts.map +1 -1
  144. package/build/template/layouts/index.js +1 -0
  145. package/build/template/layouts/index.js.map +1 -1
  146. package/build/template/lib/fetch-text.d.ts +8 -0
  147. package/build/template/lib/fetch-text.d.ts.map +1 -0
  148. package/build/template/lib/fetch-text.js +14 -0
  149. package/build/template/lib/fetch-text.js.map +1 -0
  150. package/build/template/lib/polen-url.d.ts +14 -0
  151. package/build/template/lib/polen-url.d.ts.map +1 -1
  152. package/build/template/lib/polen-url.js +16 -0
  153. package/build/template/lib/polen-url.js.map +1 -1
  154. package/build/template/lib/schema-utils/constants.d.ts +5 -0
  155. package/build/template/lib/schema-utils/constants.d.ts.map +1 -0
  156. package/build/template/lib/schema-utils/constants.js +5 -0
  157. package/build/template/lib/schema-utils/constants.js.map +1 -0
  158. package/build/template/lib/schema-utils/schema-utils.d.ts +15 -0
  159. package/build/template/lib/schema-utils/schema-utils.d.ts.map +1 -0
  160. package/build/template/lib/schema-utils/schema-utils.js +37 -0
  161. package/build/template/lib/schema-utils/schema-utils.js.map +1 -0
  162. package/build/template/routes/changelog.d.ts +4 -3
  163. package/build/template/routes/changelog.d.ts.map +1 -1
  164. package/build/template/routes/changelog.js +15 -9
  165. package/build/template/routes/changelog.js.map +1 -1
  166. package/build/template/routes/index.js +2 -2
  167. package/build/template/routes/index.js.map +1 -1
  168. package/build/template/routes/pages.d.ts +10 -0
  169. package/build/template/routes/pages.d.ts.map +1 -0
  170. package/build/template/routes/pages.js +76 -0
  171. package/build/template/routes/pages.js.map +1 -0
  172. package/build/template/routes/reference.d.ts +35 -6
  173. package/build/template/routes/reference.d.ts.map +1 -1
  174. package/build/template/routes/reference.js +97 -14
  175. package/build/template/routes/reference.js.map +1 -1
  176. package/build/template/routes/root.d.ts.map +1 -1
  177. package/build/template/routes/root.js +11 -75
  178. package/build/template/routes/root.js.map +1 -1
  179. package/build/template/server/app.d.ts +22 -1
  180. package/build/template/server/app.d.ts.map +1 -1
  181. package/build/template/server/app.js +19 -9
  182. package/build/template/server/app.js.map +1 -1
  183. package/build/template/server/main.js +9 -1
  184. package/build/template/server/main.js.map +1 -1
  185. package/build/template/server/ssg/generate.js +2 -2
  186. package/build/template/server/ssg/generate.js.map +1 -1
  187. package/build/template/server/ssg/get-route-paths.d.ts +1 -1
  188. package/build/template/server/ssg/get-route-paths.d.ts.map +1 -1
  189. package/build/template/server/ssg/get-route-paths.js +90 -27
  190. package/build/template/server/ssg/get-route-paths.js.map +1 -1
  191. package/build/template/sources/schema-source.d.ts +15 -0
  192. package/build/template/sources/schema-source.d.ts.map +1 -0
  193. package/build/template/sources/schema-source.js +64 -0
  194. package/build/template/sources/schema-source.js.map +1 -0
  195. package/package.json +16 -17
  196. package/src/api/api.ts +1 -0
  197. package/src/api/config/configurator.ts +86 -36
  198. package/src/api/config/merge.ts +0 -16
  199. package/src/api/content/metadata.ts +1 -1
  200. package/src/api/schema/data-sources/data-sources.ts +1 -0
  201. package/src/api/schema/data-sources/introspection/introspection.ts +213 -0
  202. package/src/api/schema/data-sources/memory/memory.ts +3 -5
  203. package/src/api/schema/data-sources/schema-directory/file-name-expression/file-name-expression.ts +29 -13
  204. package/src/api/schema/data-sources/schema-directory/schema-directory.ts +56 -16
  205. package/src/api/schema/data-sources/schema-file/schema-file.ts +16 -7
  206. package/src/api/schema/metadata.ts +23 -0
  207. package/src/api/schema/read.ts +109 -18
  208. package/src/api/schema/schema.ts +62 -2
  209. package/src/api/schema-source/index.ts +1 -0
  210. package/src/api/schema-source/schema-source.ts +189 -0
  211. package/src/api/static/manifest.ts +1 -1
  212. package/src/api/vite/plugins/build.ts +3 -0
  213. package/src/api/vite/plugins/core.ts +27 -22
  214. package/src/api/vite/plugins/main.ts +1 -9
  215. package/src/api/vite/plugins/schema-assets.ts +364 -0
  216. package/src/api/vite/plugins/serve.ts +15 -8
  217. package/src/cli/commands/open.ts +1 -1
  218. package/src/lib/grafaid/schema/schema.ts +1 -0
  219. package/src/lib/graphql-change/change-groups.ts +57 -0
  220. package/src/lib/kit-temp.ts +15 -2
  221. package/src/lib/mask/$.test.ts +3 -3
  222. package/src/lib/path-map/$.test.ts +22 -19
  223. package/src/lib/path-map/path-map.ts +3 -1
  224. package/src/lib/react-router-aid/react-router-aid.ts +12 -6
  225. package/src/project-data.ts +3 -11
  226. package/src/template/components/Changelog.tsx +16 -67
  227. package/src/template/components/CodeBlock.tsx +3 -5
  228. package/src/template/components/ComponentDispatch.tsx +42 -0
  229. package/src/template/components/ReferenceLink.tsx +34 -0
  230. package/src/template/components/TypeAnnotation.tsx +5 -7
  231. package/src/template/components/TypeFieldsLinkList.tsx +20 -23
  232. package/src/template/components/TypeIndex.tsx +10 -12
  233. package/src/template/components/VersionSelector.tsx +50 -0
  234. package/src/template/components/graphql/type-link.tsx +4 -3
  235. package/src/template/hooks/useVersionPath.ts +10 -0
  236. package/src/template/{components → layouts}/ChangelogLayout.tsx +1 -1
  237. package/src/template/layouts/index.ts +1 -0
  238. package/src/template/lib/fetch-text.ts +13 -0
  239. package/src/template/lib/polen-url.ts +20 -0
  240. package/src/template/lib/schema-utils/constants.ts +4 -0
  241. package/src/template/lib/schema-utils/schema-utils.ts +42 -0
  242. package/src/template/routes/changelog.tsx +19 -10
  243. package/src/template/routes/index.tsx +2 -2
  244. package/src/template/routes/pages.tsx +109 -0
  245. package/src/template/routes/reference.tsx +112 -12
  246. package/src/template/routes/root.tsx +11 -112
  247. package/src/template/server/app.ts +47 -14
  248. package/src/template/server/main.ts +9 -1
  249. package/src/template/server/ssg/generate.ts +2 -2
  250. package/src/template/server/ssg/get-route-paths.test.ts +132 -0
  251. package/src/template/server/ssg/get-route-paths.ts +91 -27
  252. package/src/template/sources/schema-source.ts +69 -0
  253. package/build/lib/graphql-document/$$.d.ts +0 -5
  254. package/build/lib/graphql-document/$$.d.ts.map +0 -1
  255. package/build/lib/graphql-document/$$.js +0 -5
  256. package/build/lib/graphql-document/$$.js.map +0 -1
  257. package/build/lib/graphql-document/$.d.ts +0 -2
  258. package/build/lib/graphql-document/$.d.ts.map +0 -1
  259. package/build/lib/graphql-document/$.js +0 -2
  260. package/build/lib/graphql-document/$.js.map +0 -1
  261. package/build/lib/graphql-document/analysis.d.ts +0 -44
  262. package/build/lib/graphql-document/analysis.d.ts.map +0 -1
  263. package/build/lib/graphql-document/analysis.js +0 -361
  264. package/build/lib/graphql-document/analysis.js.map +0 -1
  265. package/build/lib/graphql-document/components/GraphQLDocument.d.ts +0 -38
  266. package/build/lib/graphql-document/components/GraphQLDocument.d.ts.map +0 -1
  267. package/build/lib/graphql-document/components/GraphQLDocument.js +0 -151
  268. package/build/lib/graphql-document/components/GraphQLDocument.js.map +0 -1
  269. package/build/lib/graphql-document/components/GraphQLDocumentWithSchema.d.ts +0 -7
  270. package/build/lib/graphql-document/components/GraphQLDocumentWithSchema.d.ts.map +0 -1
  271. package/build/lib/graphql-document/components/GraphQLDocumentWithSchema.js +0 -27
  272. package/build/lib/graphql-document/components/GraphQLDocumentWithSchema.js.map +0 -1
  273. package/build/lib/graphql-document/components/GraphQLIdentifierPopover.d.ts +0 -33
  274. package/build/lib/graphql-document/components/GraphQLIdentifierPopover.d.ts.map +0 -1
  275. package/build/lib/graphql-document/components/GraphQLIdentifierPopover.js +0 -50
  276. package/build/lib/graphql-document/components/GraphQLIdentifierPopover.js.map +0 -1
  277. package/build/lib/graphql-document/components/IdentifierLink.d.ts +0 -39
  278. package/build/lib/graphql-document/components/IdentifierLink.d.ts.map +0 -1
  279. package/build/lib/graphql-document/components/IdentifierLink.js +0 -75
  280. package/build/lib/graphql-document/components/IdentifierLink.js.map +0 -1
  281. package/build/lib/graphql-document/components/graphql-document-styles.d.ts +0 -5
  282. package/build/lib/graphql-document/components/graphql-document-styles.d.ts.map +0 -1
  283. package/build/lib/graphql-document/components/graphql-document-styles.js +0 -144
  284. package/build/lib/graphql-document/components/graphql-document-styles.js.map +0 -1
  285. package/build/lib/graphql-document/components/index.d.ts +0 -5
  286. package/build/lib/graphql-document/components/index.d.ts.map +0 -1
  287. package/build/lib/graphql-document/components/index.js +0 -5
  288. package/build/lib/graphql-document/components/index.js.map +0 -1
  289. package/build/lib/graphql-document/example.d.ts +0 -25
  290. package/build/lib/graphql-document/example.d.ts.map +0 -1
  291. package/build/lib/graphql-document/example.js +0 -140
  292. package/build/lib/graphql-document/example.js.map +0 -1
  293. package/build/lib/graphql-document/graphql-document.d.ts +0 -35
  294. package/build/lib/graphql-document/graphql-document.d.ts.map +0 -1
  295. package/build/lib/graphql-document/graphql-document.js +0 -36
  296. package/build/lib/graphql-document/graphql-document.js.map +0 -1
  297. package/build/lib/graphql-document/hooks/use-tooltip-state.d.ts +0 -43
  298. package/build/lib/graphql-document/hooks/use-tooltip-state.d.ts.map +0 -1
  299. package/build/lib/graphql-document/hooks/use-tooltip-state.js +0 -132
  300. package/build/lib/graphql-document/hooks/use-tooltip-state.js.map +0 -1
  301. package/build/lib/graphql-document/positioning-simple.d.ts +0 -63
  302. package/build/lib/graphql-document/positioning-simple.d.ts.map +0 -1
  303. package/build/lib/graphql-document/positioning-simple.js +0 -185
  304. package/build/lib/graphql-document/positioning-simple.js.map +0 -1
  305. package/build/lib/graphql-document/schema-context.d.ts +0 -8
  306. package/build/lib/graphql-document/schema-context.d.ts.map +0 -1
  307. package/build/lib/graphql-document/schema-context.js +0 -11
  308. package/build/lib/graphql-document/schema-context.js.map +0 -1
  309. package/build/lib/graphql-document/schema-integration.d.ts +0 -135
  310. package/build/lib/graphql-document/schema-integration.d.ts.map +0 -1
  311. package/build/lib/graphql-document/schema-integration.js +0 -328
  312. package/build/lib/graphql-document/schema-integration.js.map +0 -1
  313. package/build/lib/graphql-document/types.d.ts +0 -117
  314. package/build/lib/graphql-document/types.d.ts.map +0 -1
  315. package/build/lib/graphql-document/types.js +0 -2
  316. package/build/lib/graphql-document/types.js.map +0 -1
  317. package/build/template/components/ChangelogLayout.d.ts.map +0 -1
  318. package/build/template/components/ChangelogLayout.js.map +0 -1
  319. package/build/template/components/CodeHikePre.d.ts +0 -16
  320. package/build/template/components/CodeHikePre.d.ts.map +0 -1
  321. package/build/template/components/CodeHikePre.js +0 -37
  322. package/build/template/components/CodeHikePre.js.map +0 -1
  323. package/build/template/routes/reference.$type.$field.d.ts +0 -5
  324. package/build/template/routes/reference.$type.$field.d.ts.map +0 -1
  325. package/build/template/routes/reference.$type.$field.js +0 -31
  326. package/build/template/routes/reference.$type.$field.js.map +0 -1
  327. package/build/template/routes/reference.$type.d.ts +0 -5
  328. package/build/template/routes/reference.$type.d.ts.map +0 -1
  329. package/build/template/routes/reference.$type.js +0 -23
  330. package/build/template/routes/reference.$type.js.map +0 -1
  331. package/src/lib/graphql-document/$$.ts +0 -4
  332. package/src/lib/graphql-document/$.test.ts +0 -132
  333. package/src/lib/graphql-document/$.ts +0 -1
  334. package/src/lib/graphql-document/README.md +0 -102
  335. package/src/lib/graphql-document/analysis.ts +0 -415
  336. package/src/lib/graphql-document/components/GraphQLDocument.tsx +0 -265
  337. package/src/lib/graphql-document/components/GraphQLDocument.unit.test.ts +0 -188
  338. package/src/lib/graphql-document/components/GraphQLDocumentWithSchema.tsx +0 -46
  339. package/src/lib/graphql-document/components/GraphQLIdentifierPopover.tsx +0 -199
  340. package/src/lib/graphql-document/components/IdentifierLink.tsx +0 -160
  341. package/src/lib/graphql-document/components/graphql-document-styles.ts +0 -144
  342. package/src/lib/graphql-document/components/index.ts +0 -4
  343. package/src/lib/graphql-document/demo.md +0 -155
  344. package/src/lib/graphql-document/example.ts +0 -163
  345. package/src/lib/graphql-document/graphql-document.ts +0 -37
  346. package/src/lib/graphql-document/hooks/use-tooltip-state.test.ts +0 -76
  347. package/src/lib/graphql-document/hooks/use-tooltip-state.ts +0 -191
  348. package/src/lib/graphql-document/positioning-simple.test.ts +0 -248
  349. package/src/lib/graphql-document/positioning-simple.ts +0 -260
  350. package/src/lib/graphql-document/schema-context.tsx +0 -20
  351. package/src/lib/graphql-document/schema-integration.test.ts +0 -365
  352. package/src/lib/graphql-document/schema-integration.ts +0 -488
  353. package/src/lib/graphql-document/types.ts +0 -129
  354. package/src/template/components/CodeHikePre.tsx +0 -51
  355. package/src/template/routes/reference.$type.$field.tsx +0 -34
  356. package/src/template/routes/reference.$type.tsx +0 -27
  357. /package/build/template/{components → layouts}/ChangelogLayout.d.ts +0 -0
@@ -1,160 +0,0 @@
1
- /**
2
- * Interactive overlay for GraphQL identifiers
3
- */
4
-
5
- import type { React } from '#dep/react/index'
6
- import type { DOMPosition } from '../positioning-simple.js'
7
- import type { SchemaResolution } from '../schema-integration.js'
8
- import type { Identifier } from '../types.js'
9
- import { GraphQLIdentifierPopover } from './GraphQLIdentifierPopover.js'
10
-
11
- export interface IdentifierLinkProps {
12
- /** The GraphQL identifier */
13
- identifier: Identifier
14
- /** Schema resolution information */
15
- resolution: SchemaResolution
16
- /** DOM position for overlay placement */
17
- position: DOMPosition
18
- /** Navigation handler */
19
- onNavigate: (url: string) => void
20
- /** Whether to show debug visuals */
21
- debug?: boolean
22
- /** Whether this tooltip is open */
23
- isOpen: boolean
24
- /** Whether this tooltip is pinned */
25
- isPinned: boolean
26
- /** Handle hover start */
27
- onHoverStart: () => void
28
- /** Handle hover end */
29
- onHoverEnd: () => void
30
- /** Toggle pin state */
31
- onTogglePin: () => void
32
- /** Handle tooltip hover */
33
- onTooltipHover: () => void
34
- }
35
-
36
- /**
37
- * Interactive overlay for a GraphQL identifier
38
- *
39
- * Renders an invisible clickable area over the identifier text
40
- * with hover popovers and navigation to schema reference pages.
41
- */
42
- export const IdentifierLink: React.FC<IdentifierLinkProps> = ({
43
- identifier,
44
- resolution,
45
- position,
46
- onNavigate,
47
- debug = false,
48
- isOpen,
49
- isPinned,
50
- onHoverStart,
51
- onHoverEnd,
52
- onTogglePin,
53
- onTooltipHover,
54
- }) => {
55
- // Determine visual state
56
- const isClickable = resolution.exists
57
- const hasError = !resolution.exists && (identifier.kind === `Type` || identifier.kind === `Field`)
58
- const isDeprecated = !!resolution.deprecated
59
-
60
- // Build class names
61
- const classNames = [
62
- `graphql-identifier-overlay`,
63
- `graphql-${identifier.kind.toLowerCase()}`,
64
- isClickable && `graphql-clickable`,
65
- hasError && `graphql-error`,
66
- isDeprecated && `graphql-deprecated`,
67
- isOpen && `graphql-hovered`,
68
- isOpen && `graphql-tooltip-open`,
69
- debug && `graphql-debug`,
70
- ].filter(Boolean).join(` `)
71
-
72
- const handleClick = (e: React.MouseEvent) => {
73
- e.preventDefault()
74
- e.stopPropagation()
75
- onTogglePin()
76
- }
77
-
78
- // Create trigger element
79
- const triggerElement = isClickable
80
- ? (
81
- <a
82
- href={resolution.referenceUrl}
83
- className={classNames + ` graphql-identifier-link`}
84
- style={{
85
- position: `absolute`,
86
- top: position.top,
87
- left: position.left,
88
- width: position.width,
89
- height: position.height,
90
- cursor: `pointer`,
91
- zIndex: 10,
92
- pointerEvents: `auto`,
93
- display: `block`,
94
- textDecoration: `none`,
95
- // Debug mode visual
96
- ...(debug && {
97
- backgroundColor: hasError ? `rgba(239, 68, 68, 0.1)` : `rgba(59, 130, 246, 0.1)`,
98
- border: `1px solid ${hasError ? `rgba(239, 68, 68, 0.3)` : `rgba(59, 130, 246, 0.3)`}`,
99
- }),
100
- }}
101
- onClick={handleClick}
102
- onMouseEnter={onHoverStart}
103
- onMouseLeave={onHoverEnd}
104
- aria-label={`${identifier.kind} ${identifier.name} - Click to view documentation`}
105
- data-graphql-identifier={identifier.name}
106
- data-graphql-kind={identifier.kind}
107
- />
108
- )
109
- : (
110
- <div
111
- className={classNames}
112
- style={{
113
- position: `absolute`,
114
- top: position.top,
115
- left: position.left,
116
- width: position.width,
117
- height: position.height,
118
- cursor: `pointer`, // Make it clickable even for errors
119
- zIndex: 10,
120
- pointerEvents: `auto`,
121
- // Debug mode visual
122
- ...(debug && {
123
- backgroundColor: `rgba(239, 68, 68, 0.1)`,
124
- border: `1px solid rgba(239, 68, 68, 0.3)`,
125
- }),
126
- }}
127
- onClick={handleClick}
128
- onMouseEnter={onHoverStart}
129
- onMouseLeave={onHoverEnd}
130
- role='button'
131
- aria-label={`${identifier.kind} ${identifier.name} - Click to view information`}
132
- data-graphql-identifier={identifier.name}
133
- data-graphql-kind={identifier.kind}
134
- />
135
- )
136
-
137
- return (
138
- <GraphQLIdentifierPopover
139
- identifier={identifier}
140
- documentation={resolution.documentation || {
141
- description: hasError
142
- ? `${identifier.kind} "${identifier.name}" not found in schema. This ${identifier.kind.toLowerCase()} does not exist in the current GraphQL schema.`
143
- : `${identifier.kind}: ${identifier.name}`,
144
- typeInfo: identifier.kind,
145
- }}
146
- hasError={hasError}
147
- referenceUrl={resolution.referenceUrl}
148
- open={isOpen}
149
- isPinned={isPinned}
150
- onOpenChange={(open) => {
151
- if (!open && isPinned) {
152
- onTogglePin() // Unpin when closing
153
- }
154
- }}
155
- onNavigate={isClickable ? onNavigate : undefined}
156
- >
157
- {triggerElement}
158
- </GraphQLIdentifierPopover>
159
- )
160
- }
@@ -1,144 +0,0 @@
1
- /**
2
- * Minimal styles for GraphQL Document interactive code blocks
3
- */
4
-
5
- export const graphqlDocumentStyles = `
6
- /* Container styles */
7
- .graphql-document {
8
- position: relative;
9
- }
10
-
11
- .graphql-interaction-layer {
12
- position: absolute;
13
- top: 0;
14
- left: 0;
15
- right: 0;
16
- bottom: 0;
17
- pointer-events: none;
18
- }
19
-
20
- .graphql-interaction-layer > * {
21
- pointer-events: auto;
22
- }
23
-
24
- /* Identifier overlay styles */
25
- .graphql-identifier-overlay {
26
- transition: background-color 0.2s ease;
27
- }
28
-
29
- /* Clickable identifiers get visual feedback */
30
- .graphql-identifier-overlay.graphql-clickable {
31
- /* Subtle underline effect using box-shadow to not affect layout */
32
- box-shadow: 0 1px 0 0 rgba(var(--accent-9), 0.3);
33
- transition: box-shadow 0.2s ease, background-color 0.2s ease;
34
- }
35
-
36
- .graphql-identifier-overlay.graphql-clickable:hover {
37
- background-color: rgba(var(--accent-3), 0.5);
38
- box-shadow: 0 1px 0 0 rgba(var(--accent-9), 0.6);
39
- }
40
-
41
- /* Active/open state */
42
- .graphql-identifier-overlay.graphql-tooltip-open {
43
- background-color: rgba(var(--accent-3), 0.5);
44
- box-shadow: 0 1px 0 0 var(--accent-9);
45
- }
46
-
47
- /* Error state */
48
- .graphql-identifier-overlay.graphql-error {
49
- box-shadow: 0 1.5px 0 0 var(--red-9);
50
- }
51
-
52
- .graphql-identifier-overlay.graphql-error:hover {
53
- background-color: rgba(var(--red-3), 0.5);
54
- }
55
-
56
- /* Deprecated state */
57
- .graphql-identifier-overlay.graphql-deprecated {
58
- text-decoration: line-through;
59
- opacity: 0.7;
60
- }
61
-
62
- /* Debug mode */
63
- .graphql-identifier-overlay.graphql-debug {
64
- background-color: rgba(59, 130, 246, 0.1) !important;
65
- border: 1px solid rgba(59, 130, 246, 0.3) !important;
66
- }
67
-
68
- /* Kind-specific colors */
69
- .graphql-identifier-overlay.graphql-type.graphql-clickable {
70
- box-shadow: 0 1px 0 0 rgba(var(--blue-9), 0.3);
71
- }
72
-
73
- .graphql-identifier-overlay.graphql-field.graphql-clickable {
74
- box-shadow: 0 1px 0 0 rgba(var(--green-9), 0.3);
75
- }
76
-
77
- .graphql-identifier-overlay.graphql-argument.graphql-clickable {
78
- box-shadow: 0 1px 0 0 rgba(var(--orange-9), 0.3);
79
- }
80
-
81
- .graphql-identifier-overlay.graphql-variable {
82
- box-shadow: 0 1px 0 0 rgba(var(--purple-9), 0.3);
83
- }
84
-
85
- .graphql-identifier-overlay.graphql-directive.graphql-clickable {
86
- box-shadow: 0 1px 0 0 rgba(var(--amber-9), 0.3);
87
- }
88
-
89
- /* Popover animation */
90
- .graphql-identifier-popover {
91
- animation: graphql-popover-show 150ms ease-out;
92
- }
93
-
94
- @keyframes graphql-popover-show {
95
- from {
96
- opacity: 0;
97
- transform: translateY(2px);
98
- }
99
- to {
100
- opacity: 1;
101
- transform: translateY(0);
102
- }
103
- }
104
-
105
- /* Validation errors */
106
- .graphql-validation-errors {
107
- margin-top: 1rem;
108
- padding: 0.5rem;
109
- background-color: var(--red-2);
110
- border: 1px solid var(--red-6);
111
- border-radius: 4px;
112
- }
113
-
114
- .graphql-error {
115
- color: var(--red-11);
116
- font-size: 0.875rem;
117
- margin: 0.25rem 0;
118
- }
119
-
120
- /* Loading state */
121
- .graphql-document.graphql-loading {
122
- opacity: 0.6;
123
- pointer-events: none;
124
- }
125
-
126
- .graphql-document.graphql-loading::after {
127
- content: '';
128
- position: absolute;
129
- top: 50%;
130
- left: 50%;
131
- width: 20px;
132
- height: 20px;
133
- margin: -10px 0 0 -10px;
134
- border: 2px solid var(--gray-6);
135
- border-top-color: var(--accent-9);
136
- border-radius: 50%;
137
- animation: graphql-spinner 0.8s linear infinite;
138
- }
139
-
140
- @keyframes graphql-spinner {
141
- to {
142
- transform: rotate(360deg);
143
- }
144
- }`
@@ -1,4 +0,0 @@
1
- export * from './GraphQLDocument.js'
2
- export * from './GraphQLDocumentWithSchema.js'
3
- export * from './GraphQLIdentifierPopover.js'
4
- export * from './IdentifierLink.js'
@@ -1,155 +0,0 @@
1
- # GraphQL Document Component Demo
2
-
3
- This page demonstrates the interactive GraphQL Document component that transforms static code blocks into rich, interactive documentation.
4
-
5
- ## Basic Query Example
6
-
7
- Hover over the identifiers below to see type information and documentation. Click on types and fields to navigate to their reference pages.
8
-
9
- ```graphql
10
- query GetUser($id: ID!) {
11
- user(id: $id) {
12
- id
13
- name
14
- email
15
- posts(first: 10) {
16
- id
17
- title
18
- content
19
- author {
20
- name
21
- }
22
- }
23
- }
24
- }
25
- ```
26
-
27
- ## Mutation Example
28
-
29
- This mutation creates a new post. Notice how the component provides information about input types and return values.
30
-
31
- ```graphql
32
- mutation CreatePost($input: CreatePostInput!) {
33
- createPost(input: $input) {
34
- id
35
- title
36
- content
37
- createdAt
38
- author {
39
- id
40
- name
41
- }
42
- }
43
- }
44
- ```
45
-
46
- ## Subscription Example
47
-
48
- Subscriptions work the same way - all GraphQL operations are fully interactive.
49
-
50
- ```graphql
51
- subscription OnCommentAdded($postId: ID!) {
52
- commentAdded(postId: $postId) {
53
- id
54
- content
55
- author {
56
- name
57
- avatar
58
- }
59
- createdAt
60
- }
61
- }
62
- ```
63
-
64
- ## Fragment Example
65
-
66
- Fragments are also supported with full type information and navigation.
67
-
68
- ```graphql
69
- fragment UserInfo on User {
70
- id
71
- name
72
- email
73
- profile {
74
- bio
75
- avatar
76
- website
77
- }
78
- }
79
-
80
- query GetUserWithFragment($id: ID!) {
81
- user(id: $id) {
82
- ...UserInfo
83
- posts {
84
- id
85
- title
86
- }
87
- }
88
- }
89
- ```
90
-
91
- ## Error Handling
92
-
93
- The component validates GraphQL against the schema and highlights errors. Try hovering over the invalid field below:
94
-
95
- ```graphql
96
- query InvalidQuery {
97
- user {
98
- nonExistentField
99
- name
100
- }
101
- }
102
- ```
103
-
104
- ## Plain Mode
105
-
106
- Sometimes you want to show GraphQL without interactivity. Use the `plain` option:
107
-
108
- ```graphql plain
109
- query SimpleQuery {
110
- users {
111
- name
112
- }
113
- }
114
- ```
115
-
116
- ## Debug Mode
117
-
118
- Enable debug mode to see the overlay boundaries:
119
-
120
- ```graphql debug
121
- query DebugExample {
122
- user {
123
- id
124
- name
125
- }
126
- }
127
- ```
128
-
129
- ## Features
130
-
131
- The GraphQL Document component provides:
132
-
133
- - **Interactive Navigation**: Click on any type or field to navigate to its reference documentation
134
- - **Hover Tooltips**: See type information, descriptions, and deprecation warnings
135
- - **Schema Validation**: Invalid queries are highlighted with error messages
136
- - **Syntax Highlighting**: Beautiful syntax highlighting
137
- - **Smart Positioning**: Tooltips automatically position themselves to stay within the viewport
138
- - **Accessibility**: Full keyboard navigation and screen reader support
139
-
140
- ## Configuration Options
141
-
142
- ```graphql validate=false
143
- # This query won't be validated at build time
144
- query {
145
- anything {
146
- goes
147
- }
148
- }
149
- ```
150
-
151
- Available options:
152
-
153
- - `plain` - Disable all interactive features
154
- - `debug` - Show overlay boundaries for debugging
155
- - `validate=false` - Skip validation for this block
@@ -1,163 +0,0 @@
1
- /**
2
- * Example usage of the GraphQL Document Analysis library
3
- *
4
- * This demonstrates how to use the foundational layer for extracting
5
- * identifiers and context from GraphQL documents - the building block
6
- * for the interactive GraphQL Document Component.
7
- */
8
-
9
- import { GraphQLDocument } from './$.js'
10
-
11
- // Example GraphQL query with various constructs
12
- const exampleQuery = `
13
- query GetUserWithProjects($id: ID!, $limit: Int = 10) {
14
- user(id: $id) {
15
- name
16
- projects(first: $limit) {
17
- name
18
- isPrivate
19
- owner {
20
- name
21
- }
22
- }
23
- ... on EnterpriseUser {
24
- organization
25
- }
26
- }
27
- }
28
-
29
- fragment UserBasics on User {
30
- name
31
- email
32
- role
33
- }
34
- `
35
-
36
- /**
37
- * Demonstrate basic analysis
38
- */
39
- export const analyzeExample = () => {
40
- console.log(`🔍 Analyzing GraphQL Document...\n`)
41
-
42
- const result = GraphQLDocument.analyze(exampleQuery)
43
-
44
- console.log(`✅ Valid: ${result.isValid}`)
45
- console.log(`📊 Total identifiers: ${result.identifiers.all.length}`)
46
- console.log(`🚨 Errors: ${result.errors.length}\n`)
47
-
48
- // Show identifiers by kind
49
- for (const [kind, identifiers] of result.identifiers.byKind) {
50
- console.log(`${getKindEmoji(kind)} ${kind} (${identifiers.length}):`)
51
- for (const identifier of identifiers) {
52
- const pos = `${identifier.position.line}:${identifier.position.column}`
53
- const path = identifier.schemaPath.join(` → `)
54
- const parent = identifier.parentType ? ` (in ${identifier.parentType})` : ``
55
- console.log(` • ${identifier.name}${parent} → ${path} @ ${pos}`)
56
- }
57
- console.log()
58
- }
59
-
60
- return result
61
- }
62
-
63
- /**
64
- * Demonstrate identifier lookup by position
65
- */
66
- export const demonstratePositionLookup = () => {
67
- console.log(`📍 Position-based Identifier Lookup...\n`)
68
-
69
- const identifiers = GraphQLDocument.extractIdentifiers(exampleQuery)
70
-
71
- // Find identifier at a specific position (e.g., cursor position in an editor)
72
- const targetPosition = 180 // Approximate position of "abilities" field
73
-
74
- // Find the closest identifier to this position
75
- let closestIdentifier = null
76
- let closestDistance = Infinity
77
-
78
- for (const identifier of identifiers.all) {
79
- const distance = Math.abs(identifier.position.start - targetPosition)
80
- if (distance < closestDistance) {
81
- closestDistance = distance
82
- closestIdentifier = identifier
83
- }
84
- }
85
-
86
- if (closestIdentifier) {
87
- console.log(`🎯 Identifier near position ${targetPosition}:`)
88
- console.log(` Name: ${closestIdentifier.name}`)
89
- console.log(` Kind: ${closestIdentifier.kind}`)
90
- console.log(` Schema Path: ${closestIdentifier.schemaPath.join(` → `)}`)
91
- console.log(` Context: ${JSON.stringify(closestIdentifier.context, null, 2)}`)
92
- }
93
- }
94
-
95
- /**
96
- * Demonstrate how this enables hyperlink generation
97
- */
98
- export const demonstrateHyperlinkGeneration = () => {
99
- console.log(`🔗 Hyperlink Generation Preview...\n`)
100
-
101
- const identifiers = GraphQLDocument.extractIdentifiers(exampleQuery)
102
-
103
- // Show how each identifier could become a hyperlink
104
- const typeIdentifiers = identifiers.byKind.get(`Type`) || []
105
- const fieldIdentifiers = identifiers.byKind.get(`Field`) || []
106
-
107
- console.log(`📝 Type References → Schema Links:`)
108
- for (const identifier of typeIdentifiers) {
109
- const referenceUrl = `/reference/${identifier.name}`
110
- console.log(` ${identifier.name} → ${referenceUrl}`)
111
- }
112
-
113
- console.log(`\n📝 Field References → Schema Links:`)
114
- for (const identifier of fieldIdentifiers.slice(0, 5)) { // Show first 5
115
- const referenceUrl = identifier.parentType
116
- ? `/reference/${identifier.parentType}#${identifier.name}`
117
- : `/reference/${identifier.name}`
118
- console.log(` ${identifier.name} → ${referenceUrl}`)
119
- }
120
- }
121
-
122
- /**
123
- * Show the foundation for hover tooltips
124
- */
125
- export const demonstrateTooltipFoundation = () => {
126
- console.log(`💬 Tooltip Foundation...\n`)
127
-
128
- const identifiers = GraphQLDocument.extractIdentifiers(exampleQuery)
129
-
130
- // Show context information that would be displayed in tooltips
131
- const fieldIdentifiers = identifiers.byKind.get(`Field`) || []
132
-
133
- for (const identifier of fieldIdentifiers.slice(0, 3)) { // Show first 3
134
- console.log(`🏷️ ${identifier.name}:`)
135
- console.log(` Position: Line ${identifier.position.line}, Column ${identifier.position.column}`)
136
- console.log(` Schema Path: ${identifier.schemaPath.join(` → `)}`)
137
- console.log(` Parent Type: ${identifier.parentType || `Root`}`)
138
- console.log(` Operation: ${identifier.context.operationType || `None`}`)
139
- console.log(` Selection Path: ${identifier.context.selectionPath.join(` → `)}`)
140
- console.log()
141
- }
142
- }
143
-
144
- // Helper function
145
- const getKindEmoji = (kind: string): string => {
146
- const emojis: Record<string, string> = {
147
- 'Type': `🏷️`,
148
- 'Field': `📋`,
149
- 'Argument': `⚙️`,
150
- 'Variable': `💰`,
151
- 'Directive': `🎯`,
152
- 'Fragment': `🧩`,
153
- }
154
- return emojis[kind] || `❓`
155
- }
156
-
157
- // Run example if executed directly
158
- if (import.meta.url === `file://${process.argv[1]}`) {
159
- analyzeExample()
160
- demonstratePositionLookup()
161
- demonstrateHyperlinkGeneration()
162
- demonstrateTooltipFoundation()
163
- }
@@ -1,37 +0,0 @@
1
- /**
2
- * GraphQL Document Component Library
3
- *
4
- * Transform static GraphQL code blocks into interactive documentation with
5
- * hyperlinks, tooltips, and schema validation.
6
- *
7
- * ## Features
8
- * - Hyperlinked identifiers that navigate to reference documentation
9
- * - Hover tooltips showing type information and descriptions
10
- * - Schema validation with error highlighting
11
- * - Build-time GraphQL validation
12
- * - Support for all GraphQL operations (queries, mutations, subscriptions, fragments)
13
- *
14
- * ## Usage
15
- * ```typescript
16
- * import { GraphQLDocument } from 'polen/lib/graphql-document'
17
- *
18
- * <GraphQLDocument schema={schema}>
19
- * {`query { user { name } }`}
20
- * </GraphQLDocument>
21
- * ```
22
- *
23
- * @see {@link GraphQLDocumentWithSchema} for MDX integration
24
- * @see {@link GraphQLDocument} for the main React component
25
- */
26
-
27
- export * from './analysis.js'
28
- export * from './components/index.js'
29
- export * from './positioning-simple.js'
30
- export * from './schema-integration.js'
31
- export * from './types.js'
32
-
33
- // Re-export key functions for convenience
34
- export { analyze, analyzer, extractIdentifiers } from './analysis.js'
35
- export { GraphQLDocument } from './components/GraphQLDocument.js'
36
- export { createSimpleOverlay, createSimplePositionCalculator } from './positioning-simple.js'
37
- export { analyzeWithSchema, createPolenSchemaResolver } from './schema-integration.js'