polen 0.10.0-next.11 → 0.10.0-next.12
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.
- package/build/api/builder/builder.js +1 -1
- package/build/api/builder/builder.js.map +1 -1
- package/build/api/config/load.js +1 -1
- package/build/api/config/load.js.map +1 -1
- package/build/api/vite/plugins/build.js +1 -1
- package/build/api/vite/plugins/build.js.map +1 -1
- package/build/api/vite/plugins/core.d.ts.map +1 -1
- package/build/api/vite/plugins/core.js +0 -2
- package/build/api/vite/plugins/core.js.map +1 -1
- package/build/api/vite/plugins/pages.js +1 -1
- package/build/api/vite/plugins/pages.js.map +1 -1
- package/build/exports/components.d.ts +4 -1
- package/build/exports/components.d.ts.map +1 -1
- package/build/exports/components.js +4 -1
- package/build/exports/components.js.map +1 -1
- package/build/lib/demos/config-schema.d.ts +6 -6
- package/build/lib/github-actions/runner.js +2 -2
- package/build/lib/github-actions/runner.js.map +1 -1
- package/build/lib/graphql-document/$$.d.ts +5 -0
- package/build/lib/graphql-document/$$.d.ts.map +1 -0
- package/build/lib/graphql-document/$$.js +5 -0
- package/build/lib/graphql-document/$$.js.map +1 -0
- package/build/lib/graphql-document/$.d.ts +2 -0
- package/build/lib/graphql-document/$.d.ts.map +1 -0
- package/build/lib/graphql-document/$.js +2 -0
- package/build/lib/graphql-document/$.js.map +1 -0
- package/build/lib/graphql-document/analysis.d.ts +44 -0
- package/build/lib/graphql-document/analysis.d.ts.map +1 -0
- package/build/lib/graphql-document/analysis.js +361 -0
- package/build/lib/graphql-document/analysis.js.map +1 -0
- package/build/lib/graphql-document/components/GraphQLDocument.d.ts +42 -0
- package/build/lib/graphql-document/components/GraphQLDocument.d.ts.map +1 -0
- package/build/lib/graphql-document/components/GraphQLDocument.js +173 -0
- package/build/lib/graphql-document/components/GraphQLDocument.js.map +1 -0
- package/build/lib/graphql-document/components/GraphQLDocumentWithSchema.d.ts +7 -0
- package/build/lib/graphql-document/components/GraphQLDocumentWithSchema.d.ts.map +1 -0
- package/build/lib/graphql-document/components/GraphQLDocumentWithSchema.js +45 -0
- package/build/lib/graphql-document/components/GraphQLDocumentWithSchema.js.map +1 -0
- package/build/lib/graphql-document/components/HoverTooltip.d.ts +35 -0
- package/build/lib/graphql-document/components/HoverTooltip.d.ts.map +1 -0
- package/build/lib/graphql-document/components/HoverTooltip.js +132 -0
- package/build/lib/graphql-document/components/HoverTooltip.js.map +1 -0
- package/build/lib/graphql-document/components/IdentifierLink.d.ts +37 -0
- package/build/lib/graphql-document/components/IdentifierLink.d.ts.map +1 -0
- package/build/lib/graphql-document/components/IdentifierLink.js +141 -0
- package/build/lib/graphql-document/components/IdentifierLink.js.map +1 -0
- package/build/lib/graphql-document/components/index.d.ts +5 -0
- package/build/lib/graphql-document/components/index.d.ts.map +1 -0
- package/build/lib/graphql-document/components/index.js +5 -0
- package/build/lib/graphql-document/components/index.js.map +1 -0
- package/build/lib/graphql-document/example.d.ts +25 -0
- package/build/lib/graphql-document/example.d.ts.map +1 -0
- package/build/lib/graphql-document/example.js +140 -0
- package/build/lib/graphql-document/example.js.map +1 -0
- package/build/lib/graphql-document/graphql-document.d.ts +35 -0
- package/build/lib/graphql-document/graphql-document.d.ts.map +1 -0
- package/build/lib/graphql-document/graphql-document.js +36 -0
- package/build/lib/graphql-document/graphql-document.js.map +1 -0
- package/build/lib/graphql-document/positioning-simple.d.ts +68 -0
- package/build/lib/graphql-document/positioning-simple.d.ts.map +1 -0
- package/build/lib/graphql-document/positioning-simple.js +197 -0
- package/build/lib/graphql-document/positioning-simple.js.map +1 -0
- package/build/lib/graphql-document/schema-context.d.ts +8 -0
- package/build/lib/graphql-document/schema-context.d.ts.map +1 -0
- package/build/lib/graphql-document/schema-context.js +11 -0
- package/build/lib/graphql-document/schema-context.js.map +1 -0
- package/build/lib/graphql-document/schema-integration-example.d.ts +27 -0
- package/build/lib/graphql-document/schema-integration-example.d.ts.map +1 -0
- package/build/lib/graphql-document/schema-integration-example.js +297 -0
- package/build/lib/graphql-document/schema-integration-example.js.map +1 -0
- package/build/lib/graphql-document/schema-integration.d.ts +135 -0
- package/build/lib/graphql-document/schema-integration.d.ts.map +1 -0
- package/build/lib/graphql-document/schema-integration.js +328 -0
- package/build/lib/graphql-document/schema-integration.js.map +1 -0
- package/build/lib/graphql-document/types.d.ts +117 -0
- package/build/lib/graphql-document/types.d.ts.map +1 -0
- package/build/lib/graphql-document/types.js +2 -0
- package/build/lib/graphql-document/types.js.map +1 -0
- package/build/template/components/ArgumentAnnotation.js +10 -0
- package/build/template/components/ArgumentAnnotation.js.map +1 -0
- package/build/template/components/ArgumentList.js +9 -0
- package/build/template/components/ArgumentList.js.map +1 -0
- package/build/template/components/ArgumentListAnnotation.js +15 -0
- package/build/template/components/ArgumentListAnnotation.js.map +1 -0
- package/build/template/components/Changelog.js +44 -0
- package/build/template/components/Changelog.js.map +1 -0
- package/build/template/components/{CodeBlock.jsx → CodeBlock.js} +4 -5
- package/build/template/components/{CodeBlock.jsx.map → CodeBlock.js.map} +1 -1
- package/build/template/components/{CodeBlockEnhancer.jsx → CodeBlockEnhancer.js} +4 -4
- package/build/template/components/CodeBlockEnhancer.js.map +1 -0
- package/build/template/components/DeprecationReason.js +9 -0
- package/build/template/components/DeprecationReason.js.map +1 -0
- package/build/template/components/Description.js +9 -0
- package/build/template/components/Description.js.map +1 -0
- package/build/template/components/Field.js +14 -0
- package/build/template/components/Field.js.map +1 -0
- package/build/template/components/{FieldList.jsx → FieldList.js} +4 -5
- package/build/template/components/FieldList.js.map +1 -0
- package/build/template/components/{FieldListSection.jsx → FieldListSection.js} +4 -6
- package/build/template/components/FieldListSection.js.map +1 -0
- package/build/template/components/HamburgerMenu.js +30 -0
- package/build/template/components/HamburgerMenu.js.map +1 -0
- package/build/template/components/Link.d.ts +1 -1
- package/build/template/components/{Link.jsx → Link.js} +4 -5
- package/build/template/components/Link.js.map +1 -0
- package/build/template/components/Logo.js +20 -0
- package/build/template/components/Logo.js.map +1 -0
- package/build/template/components/MDXComponents.d.ts +11 -0
- package/build/template/components/MDXComponents.d.ts.map +1 -0
- package/build/template/components/MDXComponents.js +70 -0
- package/build/template/components/MDXComponents.js.map +1 -0
- package/build/template/components/{Markdown.jsx → Markdown.js} +3 -2
- package/build/template/components/Markdown.js.map +1 -0
- package/build/template/components/MissingSchema.d.ts +1 -1
- package/build/template/components/MissingSchema.d.ts.map +1 -1
- package/build/template/components/MissingSchema.js +5 -0
- package/build/template/components/MissingSchema.js.map +1 -0
- package/build/template/components/NamedType.js +12 -0
- package/build/template/components/NamedType.js.map +1 -0
- package/build/template/components/NotFound.js +7 -0
- package/build/template/components/NotFound.js.map +1 -0
- package/build/template/components/{RadixLink.jsx → RadixLink.js} +1 -1
- package/build/template/components/RadixLink.js.map +1 -0
- package/build/template/components/TestComponent.d.ts +5 -0
- package/build/template/components/TestComponent.d.ts.map +1 -0
- package/build/template/components/TestComponent.js +7 -0
- package/build/template/components/TestComponent.js.map +1 -0
- package/build/template/components/Texts/{MinorHeading.jsx → MinorHeading.js} +4 -3
- package/build/template/components/Texts/MinorHeading.js.map +1 -0
- package/build/template/components/Texts/texts.js +1 -1
- package/build/template/components/Texts/texts.js.map +1 -1
- package/build/template/components/ThemeToggle.js +9 -0
- package/build/template/components/ThemeToggle.js.map +1 -0
- package/build/template/components/{TypeAnnotation.jsx → TypeAnnotation.js} +8 -18
- package/build/template/components/TypeAnnotation.js.map +1 -0
- package/build/template/components/TypeFieldsLinkList.js +9 -0
- package/build/template/components/TypeFieldsLinkList.js.map +1 -0
- package/build/template/components/TypeIndex.js +17 -0
- package/build/template/components/TypeIndex.js.map +1 -0
- package/build/template/components/content/$$.d.ts +1 -0
- package/build/template/components/content/$$.d.ts.map +1 -1
- package/build/template/components/content/$$.js +1 -0
- package/build/template/components/content/$$.js.map +1 -1
- package/build/template/components/content/GraphQLDocumentWithSchema.d.ts +8 -0
- package/build/template/components/content/GraphQLDocumentWithSchema.d.ts.map +1 -0
- package/build/template/components/content/GraphQLDocumentWithSchema.js +16 -0
- package/build/template/components/content/GraphQLDocumentWithSchema.js.map +1 -0
- package/build/template/components/content/GraphQLDocumentWrapper.d.ts +7 -0
- package/build/template/components/content/GraphQLDocumentWrapper.d.ts.map +1 -0
- package/build/template/components/content/GraphQLDocumentWrapper.js +62 -0
- package/build/template/components/content/GraphQLDocumentWrapper.js.map +1 -0
- package/build/template/components/graphql/graphql.d.ts +2 -2
- package/build/template/components/graphql/graphql.js +3 -0
- package/build/template/components/graphql/graphql.js.map +1 -0
- package/build/template/components/graphql/index.d.ts +1 -1
- package/build/template/components/graphql/index.js +1 -1
- package/build/template/components/graphql/index.js.map +1 -1
- package/build/template/components/graphql/{type-kind-icon.jsx → type-kind-icon.js} +3 -2
- package/build/template/components/graphql/type-kind-icon.js.map +1 -0
- package/build/template/components/graphql/type-link.js +11 -0
- package/build/template/components/graphql/type-link.js.map +1 -0
- package/build/template/components/sidebar/Sidebar.d.ts +1 -1
- package/build/template/components/sidebar/Sidebar.d.ts.map +1 -1
- package/build/template/components/sidebar/Sidebar.js +11 -0
- package/build/template/components/sidebar/Sidebar.js.map +1 -0
- package/build/template/components/sidebar/{SidebarItem.jsx → SidebarItem.js} +15 -32
- package/build/template/components/sidebar/SidebarItem.js.map +1 -0
- package/build/template/components/sidebar/ToggleButton.d.ts +1 -1
- package/build/template/components/sidebar/ToggleButton.d.ts.map +1 -1
- package/build/template/components/sidebar/ToggleButton.js +5 -0
- package/build/template/components/sidebar/ToggleButton.js.map +1 -0
- package/build/template/contexts/{ThemeContext.jsx → ThemeContext.js} +3 -4
- package/build/template/contexts/{ThemeContext.jsx.map → ThemeContext.js.map} +1 -1
- package/build/template/entry.client.d.ts +1 -0
- package/build/template/entry.client.d.ts.map +1 -1
- package/build/template/{entry.client.jsx → entry.client.js} +5 -6
- package/build/template/entry.client.js.map +1 -0
- package/build/template/routes/changelog.d.ts +1 -1
- package/build/template/routes/{changelog.jsx → changelog.js} +5 -4
- package/build/template/routes/changelog.js.map +1 -0
- package/build/template/routes/{index.jsx → index.js} +3 -2
- package/build/template/routes/index.js.map +1 -0
- package/build/template/routes/reference.$type.$field.d.ts +1 -1
- package/build/template/routes/{reference.$type.$field.jsx → reference.$type.$field.js} +6 -5
- package/build/template/routes/reference.$type.$field.js.map +1 -0
- package/build/template/routes/reference.$type.d.ts +1 -1
- package/build/template/routes/{reference.$type.jsx → reference.$type.js} +6 -5
- package/build/template/routes/reference.$type.js.map +1 -0
- package/build/template/routes/reference.d.ts +2 -2
- package/build/template/routes/{reference.jsx → reference.js} +6 -7
- package/build/template/routes/reference.js.map +1 -0
- package/build/template/routes/root.d.ts +2 -2
- package/build/template/routes/root.d.ts.map +1 -1
- package/build/template/routes/{root.jsx → root.js} +46 -88
- package/build/template/routes/root.js.map +1 -0
- package/build/template/routes.js +5 -0
- package/build/template/routes.js.map +1 -0
- package/build/template/server/app.js +1 -1
- package/build/template/server/app.js.map +1 -1
- package/build/template/server/{render-page.jsx → render-page.js} +3 -4
- package/build/template/server/render-page.js.map +1 -0
- package/build/template/server/ssg/generate.js +1 -1
- package/build/template/server/ssg/generate.js.map +1 -1
- package/build/template/server/ssg/get-route-paths.js +1 -1
- package/build/template/server/ssg/get-route-paths.js.map +1 -1
- package/build/template/server/view.js +1 -1
- package/build/template/server/view.js.map +1 -1
- package/package.json +56 -8
- package/src/api/vite/plugins/core.ts +0 -3
- package/src/api/vite/plugins/pages.ts +1 -1
- package/src/exports/components.ts +4 -1
- package/src/lib/graphql-document/$$.ts +4 -0
- package/src/lib/graphql-document/$.test.ts +132 -0
- package/src/lib/graphql-document/$.ts +1 -0
- package/src/lib/graphql-document/README.md +102 -0
- package/src/lib/graphql-document/analysis.ts +415 -0
- package/src/lib/graphql-document/components/GraphQLDocument.tsx +284 -0
- package/src/lib/graphql-document/components/GraphQLDocument.unit.test.ts +188 -0
- package/src/lib/graphql-document/components/GraphQLDocumentWithSchema.tsx +70 -0
- package/src/lib/graphql-document/components/HoverTooltip.tsx +282 -0
- package/src/lib/graphql-document/components/IdentifierLink.tsx +221 -0
- package/src/lib/graphql-document/components/index.ts +4 -0
- package/src/lib/graphql-document/demo.md +155 -0
- package/src/lib/graphql-document/example.ts +163 -0
- package/src/lib/graphql-document/graphql-document.ts +37 -0
- package/src/lib/graphql-document/positioning-simple.test.ts +252 -0
- package/src/lib/graphql-document/positioning-simple.ts +271 -0
- package/src/lib/graphql-document/schema-context.tsx +20 -0
- package/src/lib/graphql-document/schema-integration-example.ts +341 -0
- package/src/lib/graphql-document/schema-integration.test.ts +365 -0
- package/src/lib/graphql-document/schema-integration.ts +497 -0
- package/src/lib/graphql-document/types.ts +129 -0
- package/src/template/components/ArgumentAnnotation.tsx +1 -1
- package/src/template/components/ArgumentList.tsx +1 -1
- package/src/template/components/ArgumentListAnnotation.tsx +2 -2
- package/src/template/components/CodeBlockEnhancer.tsx +21 -21
- package/src/template/components/DeprecationReason.tsx +1 -1
- package/src/template/components/Description.tsx +1 -1
- package/src/template/components/Field.tsx +4 -4
- package/src/template/components/FieldList.tsx +1 -1
- package/src/template/components/FieldListSection.tsx +1 -1
- package/src/template/components/Link.tsx +2 -2
- package/src/template/components/MDXComponents.tsx +101 -0
- package/src/template/components/NamedType.tsx +2 -2
- package/src/template/components/TestComponent.tsx +6 -0
- package/src/template/components/TypeAnnotation.tsx +1 -1
- package/src/template/components/TypeFieldsLinkList.tsx +1 -1
- package/src/template/components/TypeIndex.tsx +1 -1
- package/src/template/components/content/$$.ts +1 -0
- package/src/template/components/content/GraphQLDocumentWithSchema.tsx +18 -0
- package/src/template/components/content/GraphQLDocumentWrapper.tsx +82 -0
- package/src/template/components/graphql/graphql.tsx +2 -2
- package/src/template/components/graphql/index.ts +1 -1
- package/src/template/components/graphql/type-link.tsx +2 -2
- package/src/template/entry.client.tsx +2 -2
- package/src/template/routes/changelog.tsx +1 -1
- package/src/template/routes/reference.$type.$field.tsx +3 -3
- package/src/template/routes/reference.$type.tsx +3 -3
- package/src/template/routes/reference.tsx +3 -3
- package/src/template/routes/root.tsx +36 -25
- package/src/template/routes.tsx +1 -1
- package/src/template/server/app.ts +1 -1
- package/src/template/server/ssg/generate.ts +1 -1
- package/src/template/server/ssg/get-route-paths.ts +1 -1
- package/src/template/server/view.ts +1 -1
- package/src/template/styles/code-block.css +32 -0
- package/build/template/components/ArgumentAnnotation.jsx +0 -16
- package/build/template/components/ArgumentAnnotation.jsx.map +0 -1
- package/build/template/components/ArgumentList.jsx +0 -16
- package/build/template/components/ArgumentList.jsx.map +0 -1
- package/build/template/components/ArgumentListAnnotation.jsx +0 -23
- package/build/template/components/ArgumentListAnnotation.jsx.map +0 -1
- package/build/template/components/Changelog.jsx +0 -68
- package/build/template/components/Changelog.jsx.map +0 -1
- package/build/template/components/CodeBlockEnhancer.jsx.map +0 -1
- package/build/template/components/DeprecationReason.jsx +0 -10
- package/build/template/components/DeprecationReason.jsx.map +0 -1
- package/build/template/components/Description.jsx +0 -10
- package/build/template/components/Description.jsx.map +0 -1
- package/build/template/components/Field.jsx +0 -22
- package/build/template/components/Field.jsx.map +0 -1
- package/build/template/components/FieldList.jsx.map +0 -1
- package/build/template/components/FieldListSection.jsx.map +0 -1
- package/build/template/components/HamburgerMenu.jsx +0 -53
- package/build/template/components/HamburgerMenu.jsx.map +0 -1
- package/build/template/components/Link.jsx.map +0 -1
- package/build/template/components/Logo.jsx +0 -29
- package/build/template/components/Logo.jsx.map +0 -1
- package/build/template/components/Markdown.jsx.map +0 -1
- package/build/template/components/MissingSchema.jsx +0 -4
- package/build/template/components/MissingSchema.jsx.map +0 -1
- package/build/template/components/NamedType.jsx +0 -17
- package/build/template/components/NamedType.jsx.map +0 -1
- package/build/template/components/NotFound.jsx +0 -26
- package/build/template/components/NotFound.jsx.map +0 -1
- package/build/template/components/RadixLink.jsx.map +0 -1
- package/build/template/components/Texts/MinorHeading.jsx.map +0 -1
- package/build/template/components/ThemeToggle.jsx +0 -10
- package/build/template/components/ThemeToggle.jsx.map +0 -1
- package/build/template/components/TypeAnnotation.jsx.map +0 -1
- package/build/template/components/TypeFieldsLinkList.jsx +0 -17
- package/build/template/components/TypeFieldsLinkList.jsx.map +0 -1
- package/build/template/components/TypeIndex.jsx +0 -27
- package/build/template/components/TypeIndex.jsx.map +0 -1
- package/build/template/components/graphql/graphql.jsx +0 -3
- package/build/template/components/graphql/graphql.jsx.map +0 -1
- package/build/template/components/graphql/type-kind-icon.jsx.map +0 -1
- package/build/template/components/graphql/type-link.jsx +0 -16
- package/build/template/components/graphql/type-link.jsx.map +0 -1
- package/build/template/components/sidebar/Sidebar.jsx +0 -15
- package/build/template/components/sidebar/Sidebar.jsx.map +0 -1
- package/build/template/components/sidebar/SidebarItem.jsx.map +0 -1
- package/build/template/components/sidebar/ToggleButton.jsx +0 -6
- package/build/template/components/sidebar/ToggleButton.jsx.map +0 -1
- package/build/template/entry.client.jsx.map +0 -1
- package/build/template/routes/changelog.jsx.map +0 -1
- package/build/template/routes/index.jsx.map +0 -1
- package/build/template/routes/reference.$type.$field.jsx.map +0 -1
- package/build/template/routes/reference.$type.jsx.map +0 -1
- package/build/template/routes/reference.jsx.map +0 -1
- package/build/template/routes/root.jsx.map +0 -1
- package/build/template/routes.jsx +0 -5
- package/build/template/routes.jsx.map +0 -1
- package/build/template/server/render-page.jsx.map +0 -1
@@ -0,0 +1,35 @@
|
|
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
|
+
export * from './analysis.ts';
|
27
|
+
export * from './components/index.ts';
|
28
|
+
export * from './positioning-simple.ts';
|
29
|
+
export * from './schema-integration.ts';
|
30
|
+
export * from './types.ts';
|
31
|
+
export { analyze, analyzer, extractIdentifiers } from './analysis.ts';
|
32
|
+
export { GraphQLDocument } from './components/GraphQLDocument.tsx';
|
33
|
+
export { createSimpleOverlay, createSimplePositionCalculator } from './positioning-simple.ts';
|
34
|
+
export { analyzeWithSchema, createPolenSchemaResolver } from './schema-integration.ts';
|
35
|
+
//# sourceMappingURL=graphql-document.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"graphql-document.d.ts","sourceRoot":"","sources":["../../../src/lib/graphql-document/graphql-document.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,cAAc,eAAe,CAAA;AAC7B,cAAc,uBAAuB,CAAA;AACrC,cAAc,yBAAyB,CAAA;AACvC,cAAc,yBAAyB,CAAA;AACvC,cAAc,YAAY,CAAA;AAG1B,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAA;AACrE,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAA;AAClE,OAAO,EAAE,mBAAmB,EAAE,8BAA8B,EAAE,MAAM,yBAAyB,CAAA;AAC7F,OAAO,EAAE,iBAAiB,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAA"}
|
@@ -0,0 +1,36 @@
|
|
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
|
+
export * from "./analysis.js";
|
27
|
+
export * from "./components/index.js";
|
28
|
+
export * from "./positioning-simple.js";
|
29
|
+
export * from "./schema-integration.js";
|
30
|
+
export * from "./types.js";
|
31
|
+
// Re-export key functions for convenience
|
32
|
+
export { analyze, analyzer, extractIdentifiers } from "./analysis.js";
|
33
|
+
export { GraphQLDocument } from "./components/GraphQLDocument.js";
|
34
|
+
export { createSimpleOverlay, createSimplePositionCalculator } from "./positioning-simple.js";
|
35
|
+
export { analyzeWithSchema, createPolenSchemaResolver } from "./schema-integration.js";
|
36
|
+
//# sourceMappingURL=graphql-document.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"graphql-document.js","sourceRoot":"","sources":["../../../src/lib/graphql-document/graphql-document.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,cAAc,eAAe,CAAA;AAC7B,cAAc,uBAAuB,CAAA;AACrC,cAAc,yBAAyB,CAAA;AACvC,cAAc,yBAAyB,CAAA;AACvC,cAAc,YAAY,CAAA;AAE1B,0CAA0C;AAC1C,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAA;AACrE,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAkC,CAAA;AAClE,OAAO,EAAE,mBAAmB,EAAE,8BAA8B,EAAE,MAAM,yBAAyB,CAAA;AAC7F,OAAO,EAAE,iBAAiB,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAA"}
|
@@ -0,0 +1,68 @@
|
|
1
|
+
/**
|
2
|
+
* Layer 3: Simplified Positioning & Layout Engine
|
3
|
+
*
|
4
|
+
* Maps GraphQL AST positions to DOM coordinates for overlay placement.
|
5
|
+
* This simplified version focuses on working with Polen's existing infrastructure.
|
6
|
+
*/
|
7
|
+
import type { Identifier } from './types.ts';
|
8
|
+
/**
|
9
|
+
* DOM position for rendering overlays
|
10
|
+
*/
|
11
|
+
export interface DOMPosition {
|
12
|
+
/** Distance from top of container in pixels */
|
13
|
+
top: number;
|
14
|
+
/** Distance from left of container in pixels */
|
15
|
+
left: number;
|
16
|
+
/** Width of the identifier in pixels */
|
17
|
+
width: number;
|
18
|
+
/** Height of the identifier in pixels */
|
19
|
+
height: number;
|
20
|
+
}
|
21
|
+
/**
|
22
|
+
* Position calculation result
|
23
|
+
*/
|
24
|
+
export interface PositionResult {
|
25
|
+
/** The calculated DOM position */
|
26
|
+
position: DOMPosition;
|
27
|
+
/** The identifier this position is for */
|
28
|
+
identifier: Identifier;
|
29
|
+
}
|
30
|
+
/**
|
31
|
+
* Simplified position calculator for Shiki-rendered code
|
32
|
+
*
|
33
|
+
* This version uses a more straightforward approach:
|
34
|
+
* 1. Find the line element by line number
|
35
|
+
* 2. Search for the identifier text within that line
|
36
|
+
* 3. Create a span around the identifier for positioning
|
37
|
+
*
|
38
|
+
* This approach modifies the DOM but is more reliable for testing
|
39
|
+
* and works well with React's reconciliation.
|
40
|
+
*/
|
41
|
+
export declare class SimplePositionCalculator {
|
42
|
+
/**
|
43
|
+
* Prepare a code block for positioning by wrapping identifiers in spans
|
44
|
+
*/
|
45
|
+
prepareCodeBlock(containerElement: Element, identifiers: Identifier[]): void;
|
46
|
+
/**
|
47
|
+
* Get positions of all wrapped identifiers
|
48
|
+
*/
|
49
|
+
getIdentifierPositions(containerElement: Element, relativeToElement?: Element): Map<string, PositionResult>;
|
50
|
+
/**
|
51
|
+
* Wrap an identifier in a span for positioning
|
52
|
+
* Returns true if the identifier was successfully wrapped
|
53
|
+
*/
|
54
|
+
private wrapIdentifier;
|
55
|
+
}
|
56
|
+
/**
|
57
|
+
* Create invisible overlay for a position
|
58
|
+
*/
|
59
|
+
export declare const createSimpleOverlay: (position: DOMPosition, identifier: Identifier, options?: {
|
60
|
+
onClick?: (identifier: Identifier) => void;
|
61
|
+
onHover?: (identifier: Identifier, event: MouseEvent) => void;
|
62
|
+
className?: string;
|
63
|
+
}) => HTMLElement;
|
64
|
+
/**
|
65
|
+
* Factory function for position calculator
|
66
|
+
*/
|
67
|
+
export declare const createSimplePositionCalculator: () => SimplePositionCalculator;
|
68
|
+
//# sourceMappingURL=positioning-simple.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"positioning-simple.d.ts","sourceRoot":"","sources":["../../../src/lib/graphql-document/positioning-simple.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAE5C;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,+CAA+C;IAC/C,GAAG,EAAE,MAAM,CAAA;IACX,gDAAgD;IAChD,IAAI,EAAE,MAAM,CAAA;IACZ,wCAAwC;IACxC,KAAK,EAAE,MAAM,CAAA;IACb,yCAAyC;IACzC,MAAM,EAAE,MAAM,CAAA;CACf;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,kCAAkC;IAClC,QAAQ,EAAE,WAAW,CAAA;IACrB,0CAA0C;IAC1C,UAAU,EAAE,UAAU,CAAA;CACvB;AAED;;;;;;;;;;GAUG;AACH,qBAAa,wBAAwB;IACnC;;OAEG;IACH,gBAAgB,CACd,gBAAgB,EAAE,OAAO,EACzB,WAAW,EAAE,UAAU,EAAE,GACxB,IAAI;IAmBP;;OAEG;IACH,sBAAsB,CACpB,gBAAgB,EAAE,OAAO,EACzB,iBAAiB,CAAC,EAAE,OAAO,GAC1B,GAAG,CAAC,MAAM,EAAE,cAAc,CAAC;IA4C9B;;;OAGG;IACH,OAAO,CAAC,cAAc;CAyFvB;AAED;;GAEG;AACH,eAAO,MAAM,mBAAmB,GAC9B,UAAU,WAAW,EACrB,YAAY,UAAU,EACtB,UAAU;IACR,OAAO,CAAC,EAAE,CAAC,UAAU,EAAE,UAAU,KAAK,IAAI,CAAA;IAC1C,OAAO,CAAC,EAAE,CAAC,UAAU,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,KAAK,IAAI,CAAA;IAC7D,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,KACA,WAqCF,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,8BAA8B,QAAO,wBAEjD,CAAA"}
|
@@ -0,0 +1,197 @@
|
|
1
|
+
/**
|
2
|
+
* Layer 3: Simplified Positioning & Layout Engine
|
3
|
+
*
|
4
|
+
* Maps GraphQL AST positions to DOM coordinates for overlay placement.
|
5
|
+
* This simplified version focuses on working with Polen's existing infrastructure.
|
6
|
+
*/
|
7
|
+
/**
|
8
|
+
* Simplified position calculator for Shiki-rendered code
|
9
|
+
*
|
10
|
+
* This version uses a more straightforward approach:
|
11
|
+
* 1. Find the line element by line number
|
12
|
+
* 2. Search for the identifier text within that line
|
13
|
+
* 3. Create a span around the identifier for positioning
|
14
|
+
*
|
15
|
+
* This approach modifies the DOM but is more reliable for testing
|
16
|
+
* and works well with React's reconciliation.
|
17
|
+
*/
|
18
|
+
export class SimplePositionCalculator {
|
19
|
+
/**
|
20
|
+
* Prepare a code block for positioning by wrapping identifiers in spans
|
21
|
+
*/
|
22
|
+
prepareCodeBlock(containerElement, identifiers) {
|
23
|
+
// Sort all identifiers by position (right to left, bottom to top)
|
24
|
+
const sortedIdentifiers = [...identifiers].sort((a, b) => {
|
25
|
+
// Sort by line first (bottom to top)
|
26
|
+
if (a.position.line !== b.position.line) {
|
27
|
+
return b.position.line - a.position.line;
|
28
|
+
}
|
29
|
+
// Then by column (right to left)
|
30
|
+
return b.position.column - a.position.column;
|
31
|
+
});
|
32
|
+
// Process all identifiers
|
33
|
+
let wrappedCount = 0;
|
34
|
+
for (const identifier of sortedIdentifiers) {
|
35
|
+
const wrapped = this.wrapIdentifier(containerElement, identifier);
|
36
|
+
if (wrapped)
|
37
|
+
wrappedCount++;
|
38
|
+
}
|
39
|
+
}
|
40
|
+
/**
|
41
|
+
* Get positions of all wrapped identifiers
|
42
|
+
*/
|
43
|
+
getIdentifierPositions(containerElement, relativeToElement) {
|
44
|
+
const results = new Map();
|
45
|
+
// Find all wrapped identifiers
|
46
|
+
const wrappedIdentifiers = containerElement.querySelectorAll('[data-graphql-id]');
|
47
|
+
// Use the provided element for relative positioning, or the container itself
|
48
|
+
const referenceElement = relativeToElement || containerElement;
|
49
|
+
for (const element of wrappedIdentifiers) {
|
50
|
+
const id = element.getAttribute('data-graphql-id');
|
51
|
+
if (!id)
|
52
|
+
continue;
|
53
|
+
// Get position relative to the reference element
|
54
|
+
const referenceRect = referenceElement.getBoundingClientRect();
|
55
|
+
const elementRect = element.getBoundingClientRect();
|
56
|
+
const position = {
|
57
|
+
top: elementRect.top - referenceRect.top,
|
58
|
+
left: elementRect.left - referenceRect.left,
|
59
|
+
width: elementRect.width,
|
60
|
+
height: elementRect.height,
|
61
|
+
};
|
62
|
+
// Reconstruct identifier from data attributes
|
63
|
+
const identifier = {
|
64
|
+
name: element.getAttribute('data-graphql-name') || '',
|
65
|
+
kind: (element.getAttribute('data-graphql-kind') || 'Field'),
|
66
|
+
position: {
|
67
|
+
start: parseInt(element.getAttribute('data-graphql-start') || '0'),
|
68
|
+
end: parseInt(element.getAttribute('data-graphql-end') || '0'),
|
69
|
+
line: parseInt(element.getAttribute('data-graphql-line') || '1'),
|
70
|
+
column: parseInt(element.getAttribute('data-graphql-column') || '1'),
|
71
|
+
},
|
72
|
+
schemaPath: (element.getAttribute('data-graphql-path') || '').split(',').filter(Boolean),
|
73
|
+
context: { selectionPath: [] },
|
74
|
+
};
|
75
|
+
results.set(id, { position, identifier });
|
76
|
+
}
|
77
|
+
return results;
|
78
|
+
}
|
79
|
+
/**
|
80
|
+
* Wrap an identifier in a span for positioning
|
81
|
+
* Returns true if the identifier was successfully wrapped
|
82
|
+
*/
|
83
|
+
wrapIdentifier(containerElement, identifier) {
|
84
|
+
const walker = document.createTreeWalker(containerElement, NodeFilter.SHOW_TEXT, null);
|
85
|
+
let currentLine = 1;
|
86
|
+
let currentColumn = 1;
|
87
|
+
let node;
|
88
|
+
while (node = walker.nextNode()) {
|
89
|
+
const textNode = node;
|
90
|
+
const text = textNode.textContent || '';
|
91
|
+
// Check if already wrapped
|
92
|
+
if (textNode.parentElement?.hasAttribute('data-graphql-id')) {
|
93
|
+
// Update position tracking and continue
|
94
|
+
for (const char of text) {
|
95
|
+
if (char === '\n') {
|
96
|
+
currentLine++;
|
97
|
+
currentColumn = 1;
|
98
|
+
}
|
99
|
+
else {
|
100
|
+
currentColumn++;
|
101
|
+
}
|
102
|
+
}
|
103
|
+
continue;
|
104
|
+
}
|
105
|
+
// Track position in the text
|
106
|
+
let textIndex = 0;
|
107
|
+
while (textIndex < text.length) {
|
108
|
+
// Check if we're at the identifier's position
|
109
|
+
if (currentLine === identifier.position.line
|
110
|
+
&& currentColumn === identifier.position.column) {
|
111
|
+
// Verify it's actually our identifier
|
112
|
+
const remainingText = text.substring(textIndex);
|
113
|
+
if (remainingText.startsWith(identifier.name)) {
|
114
|
+
// Create a unique ID for this identifier
|
115
|
+
const id = `${identifier.position.start}-${identifier.name}-${identifier.kind}`;
|
116
|
+
// Split the text node and wrap the identifier
|
117
|
+
const before = text.substring(0, textIndex);
|
118
|
+
const after = text.substring(textIndex + identifier.name.length);
|
119
|
+
const span = document.createElement('span');
|
120
|
+
span.setAttribute('data-graphql-id', id);
|
121
|
+
span.setAttribute('data-graphql-name', identifier.name);
|
122
|
+
span.setAttribute('data-graphql-kind', identifier.kind);
|
123
|
+
span.setAttribute('data-graphql-start', String(identifier.position.start));
|
124
|
+
span.setAttribute('data-graphql-end', String(identifier.position.end));
|
125
|
+
span.setAttribute('data-graphql-line', String(identifier.position.line));
|
126
|
+
span.setAttribute('data-graphql-column', String(identifier.position.column));
|
127
|
+
span.setAttribute('data-graphql-path', identifier.schemaPath.join(','));
|
128
|
+
span.textContent = identifier.name;
|
129
|
+
const parent = textNode.parentNode;
|
130
|
+
if (before) {
|
131
|
+
parent.insertBefore(document.createTextNode(before), textNode);
|
132
|
+
}
|
133
|
+
parent.insertBefore(span, textNode);
|
134
|
+
if (after) {
|
135
|
+
parent.insertBefore(document.createTextNode(after), textNode);
|
136
|
+
}
|
137
|
+
parent.removeChild(textNode);
|
138
|
+
return true;
|
139
|
+
}
|
140
|
+
}
|
141
|
+
// Update position tracking
|
142
|
+
const char = text[textIndex];
|
143
|
+
if (char === '\n') {
|
144
|
+
currentLine++;
|
145
|
+
currentColumn = 1;
|
146
|
+
}
|
147
|
+
else {
|
148
|
+
currentColumn++;
|
149
|
+
}
|
150
|
+
textIndex++;
|
151
|
+
}
|
152
|
+
}
|
153
|
+
return false; // Identifier not found
|
154
|
+
}
|
155
|
+
}
|
156
|
+
/**
|
157
|
+
* Create invisible overlay for a position
|
158
|
+
*/
|
159
|
+
export const createSimpleOverlay = (position, identifier, options) => {
|
160
|
+
const overlay = document.createElement('div');
|
161
|
+
// Base styles for positioning
|
162
|
+
overlay.style.position = 'absolute';
|
163
|
+
overlay.style.top = `${position.top}px`;
|
164
|
+
overlay.style.left = `${position.left}px`;
|
165
|
+
overlay.style.width = `${position.width}px`;
|
166
|
+
overlay.style.height = `${position.height}px`;
|
167
|
+
overlay.style.cursor = 'pointer';
|
168
|
+
overlay.style.zIndex = '10';
|
169
|
+
// Add custom class if provided
|
170
|
+
if (options?.className) {
|
171
|
+
overlay.className = options.className;
|
172
|
+
}
|
173
|
+
// Data attributes
|
174
|
+
overlay.setAttribute('data-graphql-overlay', 'true');
|
175
|
+
overlay.setAttribute('data-graphql-name', identifier.name);
|
176
|
+
overlay.setAttribute('data-graphql-kind', identifier.kind);
|
177
|
+
// Event handlers
|
178
|
+
if (options?.onClick) {
|
179
|
+
overlay.addEventListener('click', (e) => {
|
180
|
+
e.preventDefault();
|
181
|
+
options.onClick(identifier);
|
182
|
+
});
|
183
|
+
}
|
184
|
+
if (options?.onHover) {
|
185
|
+
overlay.addEventListener('mouseenter', (e) => {
|
186
|
+
options.onHover(identifier, e);
|
187
|
+
});
|
188
|
+
}
|
189
|
+
return overlay;
|
190
|
+
};
|
191
|
+
/**
|
192
|
+
* Factory function for position calculator
|
193
|
+
*/
|
194
|
+
export const createSimplePositionCalculator = () => {
|
195
|
+
return new SimplePositionCalculator();
|
196
|
+
};
|
197
|
+
//# sourceMappingURL=positioning-simple.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"positioning-simple.js","sourceRoot":"","sources":["../../../src/lib/graphql-document/positioning-simple.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AA4BH;;;;;;;;;;GAUG;AACH,MAAM,OAAO,wBAAwB;IACnC;;OAEG;IACH,gBAAgB,CACd,gBAAyB,EACzB,WAAyB;QAEzB,kEAAkE;QAClE,MAAM,iBAAiB,GAAG,CAAC,GAAG,WAAW,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;YACvD,qCAAqC;YACrC,IAAI,CAAC,CAAC,QAAQ,CAAC,IAAI,KAAK,CAAC,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;gBACxC,OAAO,CAAC,CAAC,QAAQ,CAAC,IAAI,GAAG,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAA;YAC1C,CAAC;YACD,iCAAiC;YACjC,OAAO,CAAC,CA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Y,CAAC,mBAAmB,EAAE,UAAU,CAAC,IAAI,CAAC,CAAA;IAC1D,OAAO,CAAC,YAAY,CAAC,mBAAmB,EAAE,UAAU,CAAC,IAAI,CAAC,CAAA;IAE1D,iBAAiB;IACjB,IAAI,OAAO,EAAE,OAAO,EAAE,CAAC;QACrB,OAAO,CAAC,gBAAgB,CAAC,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE;YACtC,CAAC,CAAC,cAAc,EAAE,CAAA;YAClB,OAAO,CAAC,OAAQ,CAAC,UAAU,CAAC,CAAA;QAC9B,CAAC,CAAC,CAAA;IACJ,CAAC;IAED,IAAI,OAAO,EAAE,OAAO,EAAE,CAAC;QACrB,OAAO,CAAC,gBAAgB,CAAC,YAAY,EAAE,CAAC,CAAC,EAAE,EAAE;YAC3C,OAAO,CAAC,OAAQ,CAAC,UAAU,EAAE,CAAC,CAAC,CAAA;QACjC,CAAC,CAAC,CAAA;IACJ,CAAC;IAED,OAAO,OAAO,CAAA;AAChB,CAAC,CAAA;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,8BAA8B,GAAG,GAA6B,EAAE;IAC3E,OAAO,IAAI,wBAAwB,EAAE,CAAA;AACvC,CAAC,CAAA"}
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import type { GraphQLSchema } from 'graphql';
|
2
|
+
import React from 'react';
|
3
|
+
export declare const GraphQLSchemaContext: React.Context<GraphQLSchema | null>;
|
4
|
+
export declare const useGraphQLSchema: () => GraphQLSchema | null;
|
5
|
+
export declare const GraphQLSchemaProvider: React.FC<React.PropsWithChildren<{
|
6
|
+
schema: GraphQLSchema | null;
|
7
|
+
}>>;
|
8
|
+
//# sourceMappingURL=schema-context.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"schema-context.d.ts","sourceRoot":"","sources":["../../../src/lib/graphql-document/schema-context.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAC5C,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,eAAO,MAAM,oBAAoB,qCAAkD,CAAA;AAEnF,eAAO,MAAM,gBAAgB,4BAG5B,CAAA;AAED,eAAO,MAAM,qBAAqB,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,iBAAiB,CAAC;IAAE,MAAM,EAAE,aAAa,GAAG,IAAI,CAAA;CAAE,CAAC,CASrG,CAAA"}
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
2
|
+
import React from 'react';
|
3
|
+
export const GraphQLSchemaContext = React.createContext(null);
|
4
|
+
export const useGraphQLSchema = () => {
|
5
|
+
const schema = React.useContext(GraphQLSchemaContext);
|
6
|
+
return schema;
|
7
|
+
};
|
8
|
+
export const GraphQLSchemaProvider = ({ children, schema, }) => {
|
9
|
+
return (_jsx(GraphQLSchemaContext.Provider, { value: schema, children: children }));
|
10
|
+
};
|
11
|
+
//# sourceMappingURL=schema-context.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"schema-context.js","sourceRoot":"","sources":["../../../src/lib/graphql-document/schema-context.tsx"],"names":[],"mappings":";AACA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,MAAM,CAAC,MAAM,oBAAoB,GAAG,KAAK,CAAC,aAAa,CAAuB,IAAI,CAAC,CAAA;AAEnF,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,EAAE;IACnC,MAAM,MAAM,GAAG,KAAK,CAAC,UAAU,CAAC,oBAAoB,CAAC,CAAA;IACrD,OAAO,MAAM,CAAA;AACf,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,qBAAqB,GAAwE,CAAC,EACzG,QAAQ,EACR,MAAM,GACP,EAAE,EAAE;IACH,OAAO,CACL,KAAC,oBAAoB,CAAC,QAAQ,IAAC,KAAK,EAAE,MAAM,YACzC,QAAQ,GACqB,CACjC,CAAA;AACH,CAAC,CAAA"}
|
@@ -0,0 +1,27 @@
|
|
1
|
+
/**
|
2
|
+
* Example usage of Schema Integration (Layer 2)
|
3
|
+
*
|
4
|
+
* Demonstrates how the schema integration layer resolves GraphQL identifiers
|
5
|
+
* against actual schemas, extracts documentation, and generates reference URLs.
|
6
|
+
*/
|
7
|
+
/**
|
8
|
+
* Demonstrate basic schema resolution
|
9
|
+
*/
|
10
|
+
export declare const demonstrateSchemaResolution: () => void;
|
11
|
+
/**
|
12
|
+
* Demonstrate full schema-aware analysis
|
13
|
+
*/
|
14
|
+
export declare const demonstrateSchemaAwareAnalysis: () => void;
|
15
|
+
/**
|
16
|
+
* Demonstrate tooltip data extraction
|
17
|
+
*/
|
18
|
+
export declare const demonstrateTooltipData: () => void;
|
19
|
+
/**
|
20
|
+
* Demonstrate URL generation customization
|
21
|
+
*/
|
22
|
+
export declare const demonstrateCustomURLGeneration: () => void;
|
23
|
+
/**
|
24
|
+
* Show integration with Polen's reference system
|
25
|
+
*/
|
26
|
+
export declare const demonstratePolenIntegration: () => void;
|
27
|
+
//# sourceMappingURL=schema-integration-example.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"schema-integration-example.d.ts","sourceRoot":"","sources":["../../../src/lib/graphql-document/schema-integration-example.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAmFH;;GAEG;AACH,eAAO,MAAM,2BAA2B,YAkEvC,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,8BAA8B,YA+C1C,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,sBAAsB,YAoClC,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,8BAA8B,YA2B1C,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,2BAA2B,YA4CvC,CAAA"}
|