polen 0.11.0-next.25 → 0.11.0-next.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/api/config/input.d.ts +183 -0
- package/build/api/config/input.d.ts.map +1 -1
- package/build/api/config/input.js +2 -0
- package/build/api/config/input.js.map +1 -1
- package/build/api/config/normalized.d.ts +297 -0
- package/build/api/config/normalized.d.ts.map +1 -1
- package/build/api/config/normalized.js +47 -0
- package/build/api/config/normalized.js.map +1 -1
- package/build/api/config-template/template.d.ts +81 -0
- package/build/api/config-template/template.d.ts.map +1 -1
- package/build/api/config-template/template.js +18 -1
- package/build/api/config-template/template.js.map +1 -1
- package/build/api/examples/scanner.d.ts.map +1 -1
- package/build/api/examples/scanner.js +11 -0
- package/build/api/examples/scanner.js.map +1 -1
- package/build/api/examples/schemas/catalog.d.ts +36 -0
- package/build/api/examples/schemas/catalog.d.ts.map +1 -1
- package/build/api/examples/schemas/example/example.d.ts +37 -0
- package/build/api/examples/schemas/example/example.d.ts.map +1 -1
- package/build/api/examples/schemas/example/example.js +5 -0
- package/build/api/examples/schemas/example/example.js.map +1 -1
- package/build/api/reference/$.d.ts +4 -0
- package/build/api/reference/$.d.ts.map +1 -0
- package/build/api/reference/$.js +4 -0
- package/build/api/reference/$.js.map +1 -0
- package/build/api/reference/catalog.d.ts +69 -0
- package/build/api/reference/catalog.d.ts.map +1 -0
- package/build/api/reference/catalog.js +44 -0
- package/build/api/reference/catalog.js.map +1 -0
- package/build/api/reference/config.d.ts +616 -0
- package/build/api/reference/config.d.ts.map +1 -0
- package/build/api/reference/config.js +162 -0
- package/build/api/reference/config.js.map +1 -0
- package/build/api/reference/scanner.d.ts +26 -0
- package/build/api/reference/scanner.d.ts.map +1 -0
- package/build/api/reference/scanner.js +27 -0
- package/build/api/reference/scanner.js.map +1 -0
- package/build/lib/grafaid/schema/format-default-value.d.ts +11 -0
- package/build/lib/grafaid/schema/format-default-value.d.ts.map +1 -0
- package/build/lib/grafaid/schema/format-default-value.js +20 -0
- package/build/lib/grafaid/schema/format-default-value.js.map +1 -0
- package/build/lib/grafaid/schema/schema.d.ts +1 -0
- package/build/lib/grafaid/schema/schema.d.ts.map +1 -1
- package/build/lib/grafaid/schema/schema.js +1 -0
- package/build/lib/grafaid/schema/schema.js.map +1 -1
- package/build/template/components/ArgumentAnnotation.d.ts +2 -1
- package/build/template/components/ArgumentAnnotation.d.ts.map +1 -1
- package/build/template/components/ArgumentAnnotation.js +14 -4
- package/build/template/components/ArgumentAnnotation.js.map +1 -1
- package/build/template/components/ArgumentListAnnotation.d.ts +1 -0
- package/build/template/components/ArgumentListAnnotation.d.ts.map +1 -1
- package/build/template/components/ArgumentListAnnotation.js +21 -8
- package/build/template/components/ArgumentListAnnotation.js.map +1 -1
- package/build/template/components/Changelog/groups/FieldArgument.d.ts.map +1 -1
- package/build/template/components/Changelog/groups/FieldArgument.js +0 -1
- package/build/template/components/Changelog/groups/FieldArgument.js.map +1 -1
- package/build/template/components/CodeBlock.d.ts.map +1 -1
- package/build/template/components/CodeBlock.js +1 -1
- package/build/template/components/CodeBlock.js.map +1 -1
- package/build/template/components/Description.js +1 -1
- package/build/template/components/Description.js.map +1 -1
- package/build/template/components/ExampleLink.d.ts.map +1 -1
- package/build/template/components/ExampleLink.js +2 -1
- package/build/template/components/ExampleLink.js.map +1 -1
- package/build/template/components/Field.d.ts +2 -0
- package/build/template/components/Field.d.ts.map +1 -1
- package/build/template/components/Field.js +42 -4
- package/build/template/components/Field.js.map +1 -1
- package/build/template/components/FieldList.d.ts +2 -1
- package/build/template/components/FieldList.d.ts.map +1 -1
- package/build/template/components/FieldList.js +14 -3
- package/build/template/components/FieldList.js.map +1 -1
- package/build/template/components/FieldListSection.d.ts.map +1 -1
- package/build/template/components/FieldListSection.js +6 -1
- package/build/template/components/FieldListSection.js.map +1 -1
- package/build/template/components/GraphQLDocument.d.ts.map +1 -1
- package/build/template/components/GraphQLDocument.js +2 -1
- package/build/template/components/GraphQLDocument.js.map +1 -1
- package/build/template/components/GraphQLInteractive/GraphQLInteractive.d.ts +2 -0
- package/build/template/components/GraphQLInteractive/GraphQLInteractive.d.ts.map +1 -1
- package/build/template/components/GraphQLInteractive/GraphQLInteractive.js +4 -3
- package/build/template/components/GraphQLInteractive/GraphQLInteractive.js.map +1 -1
- package/build/template/components/GraphQLInteractive/lib/parser.d.ts +2 -2
- package/build/template/components/GraphQLInteractive/lib/parser.d.ts.map +1 -1
- package/build/template/components/GraphQLInteractive/lib/parser.js +17 -12
- package/build/template/components/GraphQLInteractive/lib/parser.js.map +1 -1
- package/build/template/components/IAPIndicator.d.ts +12 -0
- package/build/template/components/IAPIndicator.d.ts.map +1 -0
- package/build/template/components/IAPIndicator.js +21 -0
- package/build/template/components/IAPIndicator.js.map +1 -0
- package/build/template/components/Link.d.ts +1 -2
- package/build/template/components/Link.d.ts.map +1 -1
- package/build/template/components/Link.js +5 -2
- package/build/template/components/Link.js.map +1 -1
- package/build/template/components/NamedType.d.ts.map +1 -1
- package/build/template/components/NamedType.js +9 -5
- package/build/template/components/NamedType.js.map +1 -1
- package/build/template/components/ReferenceLink.d.ts +2 -2
- package/build/template/components/ReferenceLink.d.ts.map +1 -1
- package/build/template/components/ReferenceLink.js +5 -3
- package/build/template/components/ReferenceLink.js.map +1 -1
- package/build/template/components/TypeAnnotation.d.ts +2 -0
- package/build/template/components/TypeAnnotation.d.ts.map +1 -1
- package/build/template/components/TypeAnnotation.js +4 -4
- package/build/template/components/TypeAnnotation.js.map +1 -1
- package/build/template/components/ViewModeToggle.d.ts +3 -0
- package/build/template/components/ViewModeToggle.d.ts.map +1 -0
- package/build/template/components/ViewModeToggle.js +9 -0
- package/build/template/components/ViewModeToggle.js.map +1 -0
- package/build/template/components/graphql/type-link.d.ts +2 -0
- package/build/template/components/graphql/type-link.d.ts.map +1 -1
- package/build/template/components/graphql/type-link.js +15 -3
- package/build/template/components/graphql/type-link.js.map +1 -1
- package/build/template/components/home/PlaygroundPreview.d.ts.map +1 -1
- package/build/template/components/home/PlaygroundPreview.js +3 -2
- package/build/template/components/home/PlaygroundPreview.js.map +1 -1
- package/build/template/components/sidebar/SidebarItem.d.ts.map +1 -1
- package/build/template/components/sidebar/SidebarItem.js +18 -5
- package/build/template/components/sidebar/SidebarItem.js.map +1 -1
- package/build/template/contexts/ReferenceConfigContext.d.ts +16 -0
- package/build/template/contexts/ReferenceConfigContext.d.ts.map +1 -0
- package/build/template/contexts/ReferenceConfigContext.js +14 -0
- package/build/template/contexts/ReferenceConfigContext.js.map +1 -0
- package/build/template/contexts/ViewModeContext.d.ts +14 -0
- package/build/template/contexts/ViewModeContext.d.ts.map +1 -0
- package/build/template/contexts/ViewModeContext.js +40 -0
- package/build/template/contexts/ViewModeContext.js.map +1 -0
- package/build/template/hooks/use-examples.d.ts +3 -0
- package/build/template/hooks/use-examples.d.ts.map +1 -1
- package/build/template/hooks/useAlignedColumns.d.ts +10 -0
- package/build/template/hooks/useAlignedColumns.d.ts.map +1 -0
- package/build/template/hooks/useAlignedColumns.js +17 -0
- package/build/template/hooks/useAlignedColumns.js.map +1 -0
- package/build/template/routes/examples/_.d.ts +9 -0
- package/build/template/routes/examples/_.d.ts.map +1 -1
- package/build/template/routes/examples/_index.d.ts +6 -0
- package/build/template/routes/examples/_index.d.ts.map +1 -1
- package/build/template/routes/examples/name.d.ts +9 -0
- package/build/template/routes/examples/name.d.ts.map +1 -1
- package/build/template/routes/examples/name.js +6 -2
- package/build/template/routes/examples/name.js.map +1 -1
- package/build/template/routes/reference.d.ts.map +1 -1
- package/build/template/routes/reference.js +37 -10
- package/build/template/routes/reference.js.map +1 -1
- package/build/vite/plugins/core.d.ts.map +1 -1
- package/build/vite/plugins/core.js +6 -0
- package/build/vite/plugins/core.js.map +1 -1
- package/build/vite/plugins/examples.d.ts.map +1 -1
- package/build/vite/plugins/examples.js +10 -1
- package/build/vite/plugins/examples.js.map +1 -1
- package/build/vite/plugins/index.d.ts +1 -0
- package/build/vite/plugins/index.d.ts.map +1 -1
- package/build/vite/plugins/index.js +1 -0
- package/build/vite/plugins/index.js.map +1 -1
- package/build/vite/plugins/navbar.d.ts.map +1 -1
- package/build/vite/plugins/navbar.js +3 -1
- package/build/vite/plugins/navbar.js.map +1 -1
- package/build/vite/plugins/reference.d.ts +19 -0
- package/build/vite/plugins/reference.d.ts.map +1 -0
- package/build/vite/plugins/reference.js +96 -0
- package/build/vite/plugins/reference.js.map +1 -0
- package/package.json +1 -1
- package/src/api/config/input.ts +2 -0
- package/src/api/config/normalized.ts +54 -0
- package/src/api/config-template/template.ts +18 -1
- package/src/api/examples/scanner.ts +14 -0
- package/src/api/examples/schemas/example/example.ts +6 -0
- package/src/api/reference/$.ts +3 -0
- package/src/api/reference/catalog.ts +55 -0
- package/src/api/reference/config.ts +193 -0
- package/src/api/reference/scanner.ts +53 -0
- package/src/lib/grafaid/schema/format-default-value.ts +22 -0
- package/src/lib/grafaid/schema/schema.ts +2 -0
- package/src/template/components/ArgumentAnnotation.tsx +58 -9
- package/src/template/components/ArgumentListAnnotation.tsx +50 -17
- package/src/template/components/Changelog/groups/FieldArgument.tsx +0 -1
- package/src/template/components/CodeBlock.tsx +1 -0
- package/src/template/components/Description.tsx +1 -1
- package/src/template/components/ExampleLink.tsx +2 -1
- package/src/template/components/Field.tsx +148 -20
- package/src/template/components/FieldList.tsx +28 -13
- package/src/template/components/FieldListSection.tsx +12 -2
- package/src/template/components/GraphQLDocument.tsx +2 -0
- package/src/template/components/GraphQLInteractive/GraphQLInteractive.tsx +6 -1
- package/src/template/components/GraphQLInteractive/lib/parser.ts +16 -3
- package/src/template/components/IAPIndicator.tsx +73 -0
- package/src/template/components/Link.tsx +9 -3
- package/src/template/components/NamedType.tsx +54 -28
- package/src/template/components/ReferenceLink.tsx +16 -10
- package/src/template/components/TypeAnnotation.tsx +17 -5
- package/src/template/components/ViewModeToggle.tsx +27 -0
- package/src/template/components/graphql/type-link.tsx +34 -3
- package/src/template/components/home/PlaygroundPreview.tsx +3 -0
- package/src/template/components/sidebar/SidebarItem.tsx +21 -5
- package/src/template/contexts/ReferenceConfigContext.tsx +37 -0
- package/src/template/contexts/ViewModeContext.tsx +64 -0
- package/src/template/hooks/useAlignedColumns.ts +19 -0
- package/src/template/routes/examples/name.tsx +13 -1
- package/src/template/routes/reference.tsx +67 -23
- package/src/types/virtual-modules.d.ts +5 -0
- package/src/vite/plugins/core.ts +6 -0
- package/src/vite/plugins/examples.ts +12 -0
- package/src/vite/plugins/index.ts +1 -0
- package/src/vite/plugins/navbar.ts +4 -1
- package/src/vite/plugins/reference.ts +130 -0
- package/build/template/components/ArgumentList.d.ts +0 -6
- package/build/template/components/ArgumentList.d.ts.map +0 -1
- package/build/template/components/ArgumentList.js +0 -9
- package/build/template/components/ArgumentList.js.map +0 -1
- package/src/template/components/ArgumentList.tsx +0 -22
@@ -0,0 +1,162 @@
|
|
1
|
+
import { Diagnostic } from '#lib/diagnostic/$';
|
2
|
+
import { S } from '#lib/kit-temp/effect';
|
3
|
+
// ============================================================================
|
4
|
+
// Schema - Reference Diagnostics
|
5
|
+
// ============================================================================
|
6
|
+
/**
|
7
|
+
* Diagnostic controls for reference documentation.
|
8
|
+
*/
|
9
|
+
export const ReferenceDiagnostics = S.Struct({
|
10
|
+
/**
|
11
|
+
* Control diagnostics for missing or invalid reference content.
|
12
|
+
*
|
13
|
+
* @default true (info in dev, warning in build)
|
14
|
+
*/
|
15
|
+
validation: S.optional(S.Union(S.Boolean, Diagnostic.Control)),
|
16
|
+
}).annotations({
|
17
|
+
identifier: 'ReferenceDiagnostics',
|
18
|
+
description: 'Diagnostic controls for reference documentation',
|
19
|
+
});
|
20
|
+
// ============================================================================
|
21
|
+
// Schema - Descriptions View
|
22
|
+
// ============================================================================
|
23
|
+
/**
|
24
|
+
* Configuration for how descriptions are displayed in reference documentation.
|
25
|
+
*/
|
26
|
+
export const DescriptionsView = S.Struct({
|
27
|
+
/**
|
28
|
+
* Default view mode for descriptions.
|
29
|
+
* - 'expanded': Show full descriptions (default)
|
30
|
+
* - 'compact': Show condensed view
|
31
|
+
*
|
32
|
+
* @default 'expanded'
|
33
|
+
*/
|
34
|
+
defaultMode: S.optional(S.Literal('compact', 'expanded')),
|
35
|
+
/**
|
36
|
+
* Whether to show the view mode toggle control.
|
37
|
+
* Allows users to switch between compact and expanded views.
|
38
|
+
*
|
39
|
+
* @default true
|
40
|
+
*/
|
41
|
+
showControl: S.optional(S.Boolean),
|
42
|
+
}).annotations({
|
43
|
+
identifier: 'DescriptionsView',
|
44
|
+
description: 'Configuration for descriptions display in reference documentation',
|
45
|
+
});
|
46
|
+
// ============================================================================
|
47
|
+
// Schema - Reference Config
|
48
|
+
// ============================================================================
|
49
|
+
export const ReferenceConfigObject = S.Struct({
|
50
|
+
/**
|
51
|
+
* Control whether the reference documentation is enabled.
|
52
|
+
* - true: Always enabled (show in nav even if no schema exists)
|
53
|
+
* - false: Always disabled (hide even if schema exists)
|
54
|
+
* - undefined: Auto-detect based on schema presence (default behavior)
|
55
|
+
*
|
56
|
+
* @default undefined (auto-detect based on schema presence)
|
57
|
+
* @example
|
58
|
+
* // Always show reference section
|
59
|
+
* reference: { enabled: true }
|
60
|
+
*
|
61
|
+
* @example
|
62
|
+
* // Never show reference
|
63
|
+
* reference: { enabled: false }
|
64
|
+
*
|
65
|
+
* @example
|
66
|
+
* // Auto-detect based on schema (default)
|
67
|
+
* reference: { }
|
68
|
+
*/
|
69
|
+
enabled: S.optional(S.Boolean),
|
70
|
+
/**
|
71
|
+
* Configuration for how descriptions are displayed.
|
72
|
+
*
|
73
|
+
* @example
|
74
|
+
* // Use compact mode by default
|
75
|
+
* descriptionsView: {
|
76
|
+
* defaultMode: 'compact'
|
77
|
+
* }
|
78
|
+
*
|
79
|
+
* @example
|
80
|
+
* // Hide the view mode toggle
|
81
|
+
* descriptionsView: {
|
82
|
+
* showControl: false
|
83
|
+
* }
|
84
|
+
*/
|
85
|
+
descriptionsView: S.optional(DescriptionsView),
|
86
|
+
/**
|
87
|
+
* Configuration for how field nullability is rendered.
|
88
|
+
* - 'bangMark': Show '!' after non-nullable types (GraphQL style)
|
89
|
+
* - 'questionMark': Show '?' after nullable field names (TypeScript style)
|
90
|
+
*
|
91
|
+
* @default 'bangMark'
|
92
|
+
* @example
|
93
|
+
* // Use TypeScript-style nullability rendering
|
94
|
+
* nullabilityRendering: 'questionMark'
|
95
|
+
*/
|
96
|
+
nullabilityRendering: S.optional(S.Literal('questionMark', 'bangMark')),
|
97
|
+
/**
|
98
|
+
* Diagnostic controls for reference documentation.
|
99
|
+
*
|
100
|
+
* @example
|
101
|
+
* // Enable all diagnostics with defaults
|
102
|
+
* diagnostics: {
|
103
|
+
* validation: true
|
104
|
+
* }
|
105
|
+
*
|
106
|
+
* @example
|
107
|
+
* // Fine-grained control
|
108
|
+
* diagnostics: {
|
109
|
+
* validation: {
|
110
|
+
* enabled: true,
|
111
|
+
* dev: { severity: 'error' },
|
112
|
+
* build: { severity: 'warning' }
|
113
|
+
* }
|
114
|
+
* }
|
115
|
+
*/
|
116
|
+
diagnostics: S.optional(ReferenceDiagnostics),
|
117
|
+
}).annotations({
|
118
|
+
identifier: 'ReferenceConfigObject',
|
119
|
+
title: 'Reference Configuration',
|
120
|
+
description: 'Configuration for reference documentation feature',
|
121
|
+
});
|
122
|
+
/**
|
123
|
+
* Reference configuration with boolean shorthand support.
|
124
|
+
* - true: Enable with defaults
|
125
|
+
* - false: Disable completely
|
126
|
+
* - object: Fine-grained control
|
127
|
+
*/
|
128
|
+
export const ReferenceConfig = S.transform(S.Union(S.Boolean, ReferenceConfigObject), ReferenceConfigObject, {
|
129
|
+
strict: false,
|
130
|
+
decode: (input) => {
|
131
|
+
if (typeof input === 'boolean') {
|
132
|
+
return {
|
133
|
+
enabled: input,
|
134
|
+
descriptionsView: {},
|
135
|
+
nullabilityRendering: undefined,
|
136
|
+
diagnostics: {},
|
137
|
+
};
|
138
|
+
}
|
139
|
+
return input;
|
140
|
+
},
|
141
|
+
encode: (config) => config,
|
142
|
+
}).annotations({
|
143
|
+
identifier: 'ReferenceConfig',
|
144
|
+
title: 'Reference Configuration',
|
145
|
+
description: 'Reference documentation configuration with boolean shortcuts',
|
146
|
+
});
|
147
|
+
// ============================================================================
|
148
|
+
// Constructors
|
149
|
+
// ============================================================================
|
150
|
+
export const make = ReferenceConfigObject.make;
|
151
|
+
// ============================================================================
|
152
|
+
// Type Guards
|
153
|
+
// ============================================================================
|
154
|
+
export const is = S.is(ReferenceConfig);
|
155
|
+
// ============================================================================
|
156
|
+
// Codecs
|
157
|
+
// ============================================================================
|
158
|
+
export const decode = S.decode(ReferenceConfig);
|
159
|
+
export const decodeSync = S.decodeSync(ReferenceConfig);
|
160
|
+
export const encode = S.encode(ReferenceConfig);
|
161
|
+
export const encodeSync = S.encodeSync(ReferenceConfig);
|
162
|
+
//# sourceMappingURL=config.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src/api/reference/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAC9C,OAAO,EAAE,CAAC,EAAE,MAAM,sBAAsB,CAAA;AAExC,+EAA+E;AAC/E,iCAAiC;AACjC,+EAA+E;AAE/E;;GAEG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3C;;;;OAIG;IACH,UAAU,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,EAAE,UAAU,CAAC,OAAO,CAAC,CAAC;CAC/D,CAAC,CAAC,WAAW,CAAC;IACb,UAAU,EAAE,sBAAsB;IAClC,WAAW,EAAE,iDAAiD;CAC/D,CAAC,CAAA;AAIF,+EAA+E;AAC/E,6BAA6B;AAC7B,+EAA+E;AAE/E;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC;IACvC;;;;;;OAMG;IACH,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,EAAE,EAAE;gBACpB,oBAAoB,EAAE,SAAS;gBAC/B,WAAW,EAAE,EAAE;aAChB,CAAA;QACH,CAAC;QACD,OAAO,KAAK,CAAA;IACd,CAAC;IACD,MAAM,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM;CAC3B,CACF,CAAC,WAAW,CAAC;IACZ,UAAU,EAAE,iBAAiB;IAC7B,KAAK,EAAE,yBAAyB;IAChC,WAAW,EAAE,8DAA8D;CAC5E,CAAC,CAAA;AAIF,+EAA+E;AAC/E,eAAe;AACf,+EAA+E;AAE/E,MAAM,CAAC,MAAM,IAAI,GAAG,qBAAqB,CAAC,IAAI,CAAA;AAE9C,+EAA+E;AAC/E,cAAc;AACd,+EAA+E;AAE/E,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,EAAE,CAAC,eAAe,CAAC,CAAA;AAEvC,+EAA+E;AAC/E,SAAS;AACT,+EAA+E;AAE/E,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC,eAAe,CAAC,CAAA;AAC/C,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,CAAC,UAAU,CAAC,eAAe,CAAC,CAAA;AACvD,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC,eAAe,CAAC,CAAA;AAC/C,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,CAAC,UAAU,CAAC,eAAe,CAAC,CAAA"}
|
@@ -0,0 +1,26 @@
|
|
1
|
+
import { Diagnostic } from '#lib/diagnostic/$';
|
2
|
+
import { FileSystem } from '@effect/platform';
|
3
|
+
import { Effect } from 'effect';
|
4
|
+
import * as Catalog from './catalog.js';
|
5
|
+
export interface ScanOptions {
|
6
|
+
/**
|
7
|
+
* The directory to scan for reference content
|
8
|
+
*/
|
9
|
+
dir: string;
|
10
|
+
}
|
11
|
+
export interface ScanResult {
|
12
|
+
/**
|
13
|
+
* The reference catalog with index metadata
|
14
|
+
*/
|
15
|
+
catalog: Catalog.Catalog;
|
16
|
+
/**
|
17
|
+
* Any diagnostics generated during scanning
|
18
|
+
*/
|
19
|
+
diagnostics: Diagnostic.Diagnostic[];
|
20
|
+
}
|
21
|
+
/**
|
22
|
+
* Scan for reference documentation content.
|
23
|
+
* Currently looks for index.md or index.mdx files for custom landing pages.
|
24
|
+
*/
|
25
|
+
export declare const scan: (options: ScanOptions) => Effect.Effect<ScanResult, Error, FileSystem.FileSystem>;
|
26
|
+
//# sourceMappingURL=scanner.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"scanner.d.ts","sourceRoot":"","sources":["../../../src/api/reference/scanner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAE/B,OAAO,KAAK,OAAO,MAAM,cAAc,CAAA;AAEvC,MAAM,WAAW,WAAW;IAC1B;;OAEG;IACH,GAAG,EAAE,MAAM,CAAA;CACZ;AAED,MAAM,WAAW,UAAU;IACzB;;OAEG;IACH,OAAO,EAAE,OAAO,CAAC,OAAO,CAAA;IACxB;;OAEG;IACH,WAAW,EAAE,UAAU,CAAC,UAAU,EAAE,CAAA;CACrC;AAED;;;GAGG;AACH,eAAO,MAAM,IAAI,GACf,SAAS,WAAW,KACnB,MAAM,CAAC,MAAM,CAAC,UAAU,EAAE,KAAK,EAAE,UAAU,CAAC,UAAU,CAsBrD,CAAA"}
|
@@ -0,0 +1,27 @@
|
|
1
|
+
import { Diagnostic } from '#lib/diagnostic/$';
|
2
|
+
import { FileSystem } from '@effect/platform';
|
3
|
+
import { Effect } from 'effect';
|
4
|
+
import * as Path from 'node:path';
|
5
|
+
import * as Catalog from './catalog.js';
|
6
|
+
/**
|
7
|
+
* Scan for reference documentation content.
|
8
|
+
* Currently looks for index.md or index.mdx files for custom landing pages.
|
9
|
+
*/
|
10
|
+
export const scan = (options) => Effect.gen(function* () {
|
11
|
+
const fs = yield* FileSystem.FileSystem;
|
12
|
+
const diagnostics = [];
|
13
|
+
// Check for index.md or index.mdx file
|
14
|
+
const indexMdPath = Path.join(options.dir, 'reference', 'index.md');
|
15
|
+
const indexMdxPath = Path.join(options.dir, 'reference', 'index.mdx');
|
16
|
+
// Try index.md first, then index.mdx
|
17
|
+
const indexPath = (yield* fs.exists(indexMdPath))
|
18
|
+
? indexMdPath
|
19
|
+
: (yield* fs.exists(indexMdxPath))
|
20
|
+
? indexMdxPath
|
21
|
+
: null;
|
22
|
+
const catalog = Catalog.make({
|
23
|
+
index: indexPath ? { path: indexPath } : undefined,
|
24
|
+
});
|
25
|
+
return { catalog, diagnostics };
|
26
|
+
});
|
27
|
+
//# sourceMappingURL=scanner.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"scanner.js","sourceRoot":"","sources":["../../../src/api/reference/scanner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC/B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAA;AACjC,OAAO,KAAK,OAAO,MAAM,cAAc,CAAA;AAoBvC;;;GAGG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG,CAClB,OAAoB,EACqC,EAAE,CAC3D,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;IAClB,MAAM,EAAE,GAAG,KAAK,CAAC,CAAC,UAAU,CAAC,UAAU,CAAA;IAEvC,MAAM,WAAW,GAA4B,EAAE,CAAA;IAE/C,uCAAuC;IACvC,MAAM,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,WAAW,EAAE,UAAU,CAAC,CAAA;IACnE,MAAM,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,WAAW,EAAE,WAAW,CAAC,CAAA;IAErE,qCAAqC;IACrC,MAAM,SAAS,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;QAC/C,CAAC,CAAC,WAAW;QACb,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;YAClC,CAAC,CAAC,YAAY;YACd,CAAC,CAAC,IAAI,CAAA;IAER,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;QAC3B,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,SAAS;KACnD,CAAC,CAAA;IAEF,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,CAAA;AACjC,CAAC,CAAC,CAAA"}
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import type { GraphQLInputType } from 'graphql';
|
2
|
+
/**
|
3
|
+
* Formats a GraphQL default value into a string representation.
|
4
|
+
* Returns just the value part (e.g., "20", "true", '"hello"')
|
5
|
+
*
|
6
|
+
* @param value - The default value from a GraphQL argument or input field
|
7
|
+
* @param type - The GraphQL input type of the field
|
8
|
+
* @returns The formatted value string, or null if value is undefined
|
9
|
+
*/
|
10
|
+
export declare const formatDefaultValue: (value: unknown, type: GraphQLInputType) => string | null;
|
11
|
+
//# sourceMappingURL=format-default-value.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"format-default-value.d.ts","sourceRoot":"","sources":["../../../../src/lib/grafaid/schema/format-default-value.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAE/C;;;;;;;GAOG;AACH,eAAO,MAAM,kBAAkB,GAAI,OAAO,OAAO,EAAE,MAAM,gBAAgB,KAAG,MAAM,GAAG,IAUpF,CAAA"}
|
@@ -0,0 +1,20 @@
|
|
1
|
+
import { astFromValue, print } from 'graphql';
|
2
|
+
/**
|
3
|
+
* Formats a GraphQL default value into a string representation.
|
4
|
+
* Returns just the value part (e.g., "20", "true", '"hello"')
|
5
|
+
*
|
6
|
+
* @param value - The default value from a GraphQL argument or input field
|
7
|
+
* @param type - The GraphQL input type of the field
|
8
|
+
* @returns The formatted value string, or null if value is undefined
|
9
|
+
*/
|
10
|
+
export const formatDefaultValue = (value, type) => {
|
11
|
+
if (value === undefined)
|
12
|
+
return null;
|
13
|
+
const ast = astFromValue(value, type);
|
14
|
+
if (!ast) {
|
15
|
+
// Fallback for edge cases where astFromValue fails
|
16
|
+
return JSON.stringify(value);
|
17
|
+
}
|
18
|
+
return print(ast);
|
19
|
+
};
|
20
|
+
//# sourceMappingURL=format-default-value.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"format-default-value.js","sourceRoot":"","sources":["../../../../src/lib/grafaid/schema/format-default-value.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAG7C;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,KAAc,EAAE,IAAsB,EAAiB,EAAE;IAC1F,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,IAAI,CAAA;IAEpC,MAAM,GAAG,GAAG,YAAY,CAAC,KAAK,EAAE,IAAI,CAAC,CAAA;IACrC,IAAI,CAAC,GAAG,EAAE,CAAC;QACT,mDAAmD;QACnD,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAA;IAC9B,CAAC;IAED,OAAO,KAAK,CAAC,GAAG,CAAC,CAAA;AACnB,CAAC,CAAA"}
|
@@ -17,6 +17,7 @@ export * as Args from './args.js';
|
|
17
17
|
export * as TypesLike from './types-like.js';
|
18
18
|
export * as NodesLike from './nodes-like.js';
|
19
19
|
export * from './read.js';
|
20
|
+
export * from './format-default-value.js';
|
20
21
|
import * as AST from './ast.js';
|
21
22
|
export declare const empty: GraphQLSchema;
|
22
23
|
//# sourceMappingURL=schema.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../src/lib/grafaid/schema/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC/B,OAAO,EAAkB,KAAK,aAAa,EAAE,MAAM,SAAS,CAAA;AAC5D,OAAO,EAAkB,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAE9D,OAAO,EACL,iBAAiB,IAAI,sBAAsB,EAC3C,aAAa,IAAI,MAAM,EACvB,uBAAuB,IAAI,oBAAoB,EAC/C,WAAW,IAAI,KAAK,GACrB,MAAM,SAAS,CAAA;AAGhB,eAAO,MAAM,OAAO,GAAI,KAAK,GAAG,CAAC,QAAQ,KAAG,MAAM,CAAC,MAAM,CAAC,aAAa,EAAE,UAAU,CAW/E,CAAA;AAEJ,OAAO,KAAK,GAAG,MAAM,UAAU,CAAA;AAE/B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAA;AAEjC,cAAc,sBAAsB,CAAA;AAEpC,cAAc,qBAAqB,CAAA;AAEnC,cAAc,kBAAkB,CAAA;AAEhC,cAAc,kBAAkB,CAAA;AAEhC,cAAc,2BAA2B,CAAA;AAEzC,cAAc,iBAAiB,CAAA;AAE/B,cAAc,iBAAiB,CAAA;AAE/B,cAAc,cAAc,CAAA;AAE5B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAA;AAEjC,OAAO,KAAK,SAAS,MAAM,iBAAiB,CAAA;AAE5C,OAAO,KAAK,SAAS,MAAM,iBAAiB,CAAA;AAE5C,cAAc,WAAW,CAAA;AAEzB,OAAO,KAAK,GAAG,MAAM,UAAU,CAAA;AAE/B,eAAO,MAAM,KAAK,EAAE,aAAyC,CAAA"}
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../src/lib/grafaid/schema/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC/B,OAAO,EAAkB,KAAK,aAAa,EAAE,MAAM,SAAS,CAAA;AAC5D,OAAO,EAAkB,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAE9D,OAAO,EACL,iBAAiB,IAAI,sBAAsB,EAC3C,aAAa,IAAI,MAAM,EACvB,uBAAuB,IAAI,oBAAoB,EAC/C,WAAW,IAAI,KAAK,GACrB,MAAM,SAAS,CAAA;AAGhB,eAAO,MAAM,OAAO,GAAI,KAAK,GAAG,CAAC,QAAQ,KAAG,MAAM,CAAC,MAAM,CAAC,aAAa,EAAE,UAAU,CAW/E,CAAA;AAEJ,OAAO,KAAK,GAAG,MAAM,UAAU,CAAA;AAE/B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAA;AAEjC,cAAc,sBAAsB,CAAA;AAEpC,cAAc,qBAAqB,CAAA;AAEnC,cAAc,kBAAkB,CAAA;AAEhC,cAAc,kBAAkB,CAAA;AAEhC,cAAc,2BAA2B,CAAA;AAEzC,cAAc,iBAAiB,CAAA;AAE/B,cAAc,iBAAiB,CAAA;AAE/B,cAAc,cAAc,CAAA;AAE5B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAA;AAEjC,OAAO,KAAK,SAAS,MAAM,iBAAiB,CAAA;AAE5C,OAAO,KAAK,SAAS,MAAM,iBAAiB,CAAA;AAE5C,cAAc,WAAW,CAAA;AAEzB,cAAc,2BAA2B,CAAA;AAEzC,OAAO,KAAK,GAAG,MAAM,UAAU,CAAA;AAE/B,eAAO,MAAM,KAAK,EAAE,aAAyC,CAAA"}
|
@@ -24,6 +24,7 @@ export * as Args from './args.js';
|
|
24
24
|
export * as TypesLike from './types-like.js';
|
25
25
|
export * as NodesLike from './nodes-like.js';
|
26
26
|
export * from './read.js';
|
27
|
+
export * from './format-default-value.js';
|
27
28
|
import * as AST from './ast.js';
|
28
29
|
export const empty = buildASTSchema(AST.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kB,CAAA;AAEhC,cAAc,2BAA2B,CAAA;AAEzC,cAAc,iBAAiB,CAAA;AAE/B,cAAc,iBAAiB,CAAA;AAE/B,cAAc,cAAc,CAAA;AAE5B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAA;AAEjC,OAAO,KAAK,SAAS,MAAM,iBAAiB,CAAA;AAE5C,OAAO,KAAK,SAAS,MAAM,iBAAiB,CAAA;AAE5C,cAAc,WAAW,CAAA;AAEzB,cAAc,2BAA2B,CAAA;AAEzC,OAAO,KAAK,GAAG,MAAM,UAAU,CAAA;AAE/B,MAAM,CAAC,MAAM,KAAK,GAAkB,cAAc,CAAC,GAAG,CAAC,KAAK,CAAC,CAAA"}
|
@@ -2,9 +2,10 @@ import type { GraphQLArgument } from 'graphql';
|
|
2
2
|
import type { FC } from 'react';
|
3
3
|
export interface Props {
|
4
4
|
data: GraphQLArgument;
|
5
|
+
nameWidth?: number;
|
5
6
|
}
|
6
7
|
/**
|
7
|
-
* Renders a single GraphQL argument
|
8
|
+
* Renders a single GraphQL argument with aligned columns
|
8
9
|
*/
|
9
10
|
export declare const ArgumentAnnotation: FC<Props>;
|
10
11
|
//# sourceMappingURL=ArgumentAnnotation.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ArgumentAnnotation.d.ts","sourceRoot":"","sources":["../../../src/template/components/ArgumentAnnotation.tsx"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"ArgumentAnnotation.d.ts","sourceRoot":"","sources":["../../../src/template/components/ArgumentAnnotation.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAC9C,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAK/B,MAAM,WAAW,KAAK;IACpB,IAAI,EAAE,eAAe,CAAA;IACrB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED;;GAEG;AACH,eAAO,MAAM,kBAAkB,EAAE,EAAE,CAAC,KAAK,CAwDxC,CAAA"}
|
@@ -1,10 +1,20 @@
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
2
|
-
import {
|
2
|
+
import { Grafaid } from '#lib/grafaid';
|
3
|
+
import { Box, Flex, HoverCard, Text } from '@radix-ui/themes';
|
4
|
+
import { useViewMode } from '../contexts/ViewModeContext.js';
|
5
|
+
import { Description } from './Description.js';
|
3
6
|
import { TypeAnnotation } from './TypeAnnotation.js';
|
4
7
|
/**
|
5
|
-
* Renders a single GraphQL argument
|
8
|
+
* Renders a single GraphQL argument with aligned columns
|
6
9
|
*/
|
7
|
-
export const ArgumentAnnotation = ({ data }) => {
|
8
|
-
|
10
|
+
export const ArgumentAnnotation = ({ data, nameWidth }) => {
|
11
|
+
const { viewMode } = useViewMode();
|
12
|
+
const nameElement = (_jsx(Text, { size: '2', weight: 'bold', color: 'gray', children: data.name }));
|
13
|
+
return (_jsxs(Box, { children: [_jsxs(Flex, { align: 'baseline', gap: '2', children: [_jsx(Box, { style: {
|
14
|
+
minWidth: nameWidth ? `${nameWidth}ch` : 'auto',
|
15
|
+
flexShrink: 0,
|
16
|
+
}, children: viewMode === 'compact' && data.description
|
17
|
+
? (_jsxs(HoverCard.Root, { children: [_jsx(HoverCard.Trigger, { children: nameElement }), _jsx(HoverCard.Content, { size: '2', maxWidth: '400px', side: 'top', align: 'center', children: _jsx(Text, { size: '2', color: 'gray', children: _jsx(Description, { data: data }) }) })] }))
|
18
|
+
: nameElement }), _jsx(TypeAnnotation, { type: data.type, showDescription: true }), data.defaultValue !== undefined && (_jsxs(Text, { size: '2', color: 'gray', children: [' = ', Grafaid.Schema.formatDefaultValue(data.defaultValue, data.type)] }))] }), data.description && viewMode === 'expanded' && (_jsx(Box, { mt: '2', children: _jsx(Text, { size: '2', color: 'gray', style: { lineHeight: '1.5' }, children: _jsx(Description, { data: data }) }) }))] }));
|
9
19
|
};
|
10
20
|
//# sourceMappingURL=ArgumentAnnotation.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ArgumentAnnotation.js","sourceRoot":"","sources":["../../../src/template/components/ArgumentAnnotation.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAA;
|
1
|
+
{"version":3,"file":"ArgumentAnnotation.js","sourceRoot":"","sources":["../../../src/template/components/ArgumentAnnotation.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AACtC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAA;AAG7D,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAA;AAC5D,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AAOpD;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAc,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,EAAE;IACnE,MAAM,EAAE,QAAQ,EAAE,GAAG,WAAW,EAAE,CAAA;IAElC,MAAM,WAAW,GAAG,CAClB,KAAC,IAAI,IAAC,IAAI,EAAC,GAAG,EAAC,MAAM,EAAC,MAAM,EAAC,KAAK,EAAC,MAAM,YACtC,IAAI,CAAC,IAAI,GACL,CACR,CAAA;IAED,OAAO,CACL,MAAC,GAAG,eACF,MAAC,IAAI,IAAC,KAAK,EAAC,UAAU,EAAC,GAAG,EAAC,GAAG,aAC5B,KAAC,GAAG,IACF,KAAK,EAAE;4BACL,QAAQ,EAAE,SAAS,CAAC,CAAC,CAAC,GAAG,SAAS,IAAI,CAAC,CAAC,CAAC,MAAM;4BAC/C,UAAU,EAAE,CAAC;yBACd,YAEA,QAAQ,KAAK,SAAS,IAAI,IAAI,CAAC,WAAW;4BACzC,CAAC,CAAC,CACA,MAAC,SAAS,CAAC,IAAI,eACb,KAAC,SAAS,CAAC,OAAO,cACf,WAAW,GACM,EACpB,KAAC,SAAS,CAAC,OAAO,IAChB,IAAI,EAAC,GAAG,EACR,QAAQ,EAAC,OAAO,EAChB,IAAI,EAAC,KAAK,EACV,KAAK,EAAC,QAAQ,YAEd,KAAC,IAAI,IAAC,IAAI,EAAC,GAAG,EAAC,KAAK,EAAC,MAAM,YACzB,KAAC,WAAW,IAAC,IAAI,EAAE,IAAI,GAAI,GACtB,GACW,IACL,CAClB;4BACD,CAAC,CAAC,WAAW,GACX,EACN,KAAC,cAAc,IAAC,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,eAAe,EAAE,IAAI,GAAI,EACzD,IAAI,CAAC,YAAY,KAAK,SAAS,IAAI,CAClC,MAAC,IAAI,IAAC,IAAI,EAAC,GAAG,EAAC,KAAK,EAAC,MAAM,aACxB,KAAK,EACL,OAAO,CAAC,MAAM,CAAC,kBAAkB,CAAC,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC,IAAI,CAAC,IAC3D,CACR,IACI,EAEN,IAAI,CAAC,WAAW,IAAI,QAAQ,KAAK,UAAU,IAAI,CAC9C,KAAC,GAAG,IAAC,EAAE,EAAC,GAAG,YACT,KAAC,IAAI,IAAC,IAAI,EAAC,GAAG,EAAC,KAAK,EAAC,MAAM,EAAC,KAAK,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE,YACtD,KAAC,WAAW,IAAC,IAAI,EAAE,IAAI,GAAI,GACtB,GACH,CACP,IACG,CACP,CAAA;AACH,CAAC,CAAA"}
|
@@ -2,6 +2,7 @@ import type { GraphQLField } from 'graphql';
|
|
2
2
|
import type { FC } from 'react';
|
3
3
|
export interface Props {
|
4
4
|
field: GraphQLField<any, any>;
|
5
|
+
argumentNameWidth?: number;
|
5
6
|
}
|
6
7
|
export declare const ArgumentListAnnotation: FC<Props>;
|
7
8
|
//# sourceMappingURL=ArgumentListAnnotation.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ArgumentListAnnotation.d.ts","sourceRoot":"","sources":["../../../src/template/components/ArgumentListAnnotation.tsx"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"ArgumentListAnnotation.d.ts","sourceRoot":"","sources":["../../../src/template/components/ArgumentListAnnotation.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAmB,YAAY,EAAE,MAAM,SAAS,CAAA;AAC5D,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAK/B,MAAM,WAAW,KAAK;IACpB,KAAK,EAAE,YAAY,CAAC,GAAG,EAAE,GAAG,CAAC,CAAA;IAC7B,iBAAiB,CAAC,EAAE,MAAM,CAAA;CAC3B;AAED,eAAO,MAAM,sBAAsB,EAAE,EAAE,CAAC,KAAK,CAoD5C,CAAA"}
|
@@ -1,15 +1,28 @@
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
2
|
+
import { Grafaid } from '#lib/grafaid';
|
2
3
|
import { GrafaidOld } from '#lib/grafaid-old';
|
3
|
-
import { Box,
|
4
|
+
import { Box, Flex } from '@radix-ui/themes';
|
5
|
+
import { useAlignedColumns } from '../hooks/useAlignedColumns.js';
|
4
6
|
import { ArgumentAnnotation } from './ArgumentAnnotation.js';
|
5
|
-
import {
|
6
|
-
export const ArgumentListAnnotation = ({ field }) => {
|
7
|
+
import { IAPIndicator } from './IAPIndicator.js';
|
8
|
+
export const ArgumentListAnnotation = ({ field, argumentNameWidth }) => {
|
7
9
|
if (field.args.length === 0)
|
8
10
|
return null;
|
9
11
|
const inputObject = GrafaidOld.getIAP(field);
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
12
|
+
// If it's IAP, show indicator and input object's fields directly
|
13
|
+
if (inputObject) {
|
14
|
+
const inputFields = Grafaid.Schema.NodesLike.getFields(inputObject);
|
15
|
+
const nameWidth = argumentNameWidth ?? useAlignedColumns(inputFields, field => field.name);
|
16
|
+
return (_jsx(Box, { children: _jsxs(Flex, { direction: 'column', gap: '2', children: [_jsx(Box, { ml: '3', children: _jsx(IAPIndicator, { inputObject: inputObject }) }), inputFields.map(field => (_jsx(Box, { ml: '3', children: _jsx(ArgumentAnnotation, { data: {
|
17
|
+
name: field.name,
|
18
|
+
type: field.type,
|
19
|
+
description: field.description,
|
20
|
+
defaultValue: field.defaultValue,
|
21
|
+
deprecationReason: field.deprecationReason,
|
22
|
+
}, nameWidth: nameWidth }) }, field.name)))] }) }));
|
23
|
+
}
|
24
|
+
// Regular non-IAP arguments
|
25
|
+
const nameWidth = argumentNameWidth ?? useAlignedColumns([...field.args], arg => arg.name);
|
26
|
+
return (_jsx(Box, { children: _jsx(Flex, { direction: 'column', gap: '2', children: field.args.map(arg => (_jsx(Box, { ml: '3', children: _jsx(ArgumentAnnotation, { data: arg, nameWidth: nameWidth }) }, arg.name))) }) }));
|
14
27
|
};
|
15
28
|
//# sourceMappingURL=ArgumentListAnnotation.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ArgumentListAnnotation.js","sourceRoot":"","sources":["../../../src/template/components/ArgumentListAnnotation.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAC7C,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAA;AAG5C,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAC5D,OAAO,EAAE,
|
1
|
+
{"version":3,"file":"ArgumentListAnnotation.js","sourceRoot":"","sources":["../../../src/template/components/ArgumentListAnnotation.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAC7C,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAA;AAG5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,C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AED,4BAA4B;IAC5B,MAAM,SAAS,GAAG,iBAAiB,IAAI,iBAAiB,CAAC,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;IAE1F,OAAO,CACL,KAAC,GAAG,cACF,KAAC,IAAI,IAAC,SAAS,EAAC,QAAQ,EAAC,GAAG,EAAC,GAAG,YAC7B,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,CACrB,KAAC,GAAG,IAAgB,EAAE,EAAC,GAAG,YACxB,KAAC,kBAAkB,IAAC,IAAI,EAAE,GAAG,EAAE,SAAS,EAAE,SAAS,GAAI,IAD/C,GAAG,CAAC,IAAI,CAEZ,CACP,CAAC,GACG,GACH,CACP,CAAA;AACH,CAAC,CAAA"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"FieldArgument.d.ts","sourceRoot":"","sources":["../../../../../src/template/components/Changelog/groups/FieldArgument.tsx"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"FieldArgument.d.ts","sourceRoot":"","sources":["../../../../../src/template/components/Changelog/groups/FieldArgument.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAG9B,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC;IAAE,MAAM,EAAE,GAAG,CAAA;CAAE,CAkBnD,CAAA"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"FieldArgument.js","sourceRoot":"","sources":["../../../../../src/template/components/Changelog/groups/FieldArgument.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,
|
1
|
+
{"version":3,"file":"FieldArgument.js","sourceRoot":"","sources":["../../../../../src/template/components/Changelog/groups/FieldArgument.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAA;AAEvC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB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AAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,cAAc,
|
1
|
+
{"version":3,"file":"CodeBlock.d.ts","sourceRoot":"","sources":["../../../src/template/components/CodeBlock.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,eAAe,EAAO,MAAM,eAAe,CAAA;AACzD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAC5C,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,UAAU,cAAc;IACtB,SAAS,EAAE,eAAe,CAAA;IAC1B,MAAM,CAAC,EAAE,aAAa,CAAA;CACvB;AAED;;;GAGG;AACH,eAAO,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,cAAc,CAmB9C,CAAA"}
|
@@ -14,7 +14,7 @@ export const CodeBlock = ({ codeblock, schema }) => {
|
|
14
14
|
if (!schema) {
|
15
15
|
return _jsx(Pre, { code: codeblock });
|
16
16
|
}
|
17
|
-
return (_jsx(GraphQLInteractive, { codeblock: codeblock, schema: schema, showWarningIfNoSchema: templateConfig.warnings.interactiveWithoutSchema.enabled }));
|
17
|
+
return (_jsx(GraphQLInteractive, { codeblock: codeblock, schema: schema, showWarningIfNoSchema: templateConfig.warnings.interactiveWithoutSchema.enabled, referenceEnabled: templateConfig.reference.enabled }));
|
18
18
|
}
|
19
19
|
// For regular code blocks, use Code Hike's Pre component with pre-highlighted code
|
20
20
|
return _jsx(Pre, { code: codeblock });
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"CodeBlock.js","sourceRoot":"","sources":["../../../src/template/components/CodeBlock.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAwB,GAAG,EAAE,MAAM,eAAe,CAAA;AAEzD,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAA;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAA;AAOlE;;;GAGG;AACH,MAAM,CAAC,MAAM,S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,gBAAgB,EAAE,cAAc,CAAC,SAAS,CAAC,OAAO,GAClD,CACH,CAAA;IACH,CAAC;IAED,mFAAmF;IACnF,OAAO,KAAC,GAAG,IAAC,IAAI,EAAE,SAAS,GAAI,CAAA;AACjC,CAAC,CAAA"}
|
@@ -4,6 +4,6 @@ import { Markdown } from './Markdown.js';
|
|
4
4
|
export const Description = ({ data }) => {
|
5
5
|
if (!data.description)
|
6
6
|
return null;
|
7
|
-
return (_jsx(Text, { as: 'div', color: 'gray', children: _jsx(Markdown, { children: data.description }) }));
|
7
|
+
return (_jsx(Text, { as: 'div', size: '2', color: 'gray', style: { lineHeight: '1.5' }, children: _jsx(Markdown, { children: data.description }) }));
|
8
8
|
};
|
9
9
|
//# sourceMappingURL=Description.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Description.js","sourceRoot":"","sources":["../../../src/template/components/Description.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAA;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAKxC,MAAM,CAAC,MAAM,WAAW,GAAmE,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE;IACtG,IAAI,CAAC,IAAI,CAAC,WAAW;QAAE,OAAO,IAAI,CAAA;IAElC,OAAO,CACL,KAAC,IAAI,IAAC,EAAE,EAAC,KAAK,EAAC,KAAK,EAAC,MAAM,
|
1
|
+
{"version":3,"file":"Description.js","sourceRoot":"","sources":["../../../src/template/components/Description.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAA;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAKxC,MAAM,CAAC,MAAM,WAAW,GAAmE,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE;IACtG,IAAI,CAAC,IAAI,CAAC,WAAW;QAAE,OAAO,IAAI,CAAA;IAElC,OAAO,CACL,KAAC,IAAI,IAAC,EAAE,EAAC,KAAK,EAAC,IAAI,EAAC,GAAG,EAAC,KAAK,EAAC,MAAM,EAAC,KAAK,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE,YAC/D,KAAC,QAAQ,cAAE,IAAI,CAAC,WAAW,GAAY,GAClC,CACR,CAAA;AACH,CAAC,CAAA"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ExampleLink.d.ts","sourceRoot":"","sources":["../../../src/template/components/ExampleLink.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wCAAwC,CAAA;
|
1
|
+
{"version":3,"file":"ExampleLink.d.ts","sourceRoot":"","sources":["../../../src/template/components/ExampleLink.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wCAAwC,CAAA;AAI9E,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAE/B,MAAM,WAAW,KAAK;IACpB,UAAU,EAAE,gBAAgB,CAAA;CAC7B;AAED;;;GAGG;AACH,eAAO,MAAM,WAAW,EAAE,EAAE,CAAC,KAAK,CAajC,CAAA"}
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
2
2
|
import { Version } from '#lib/version/$';
|
3
3
|
import { Badge, Link } from '@radix-ui/themes';
|
4
|
+
import { Str } from '@wollybeard/kit';
|
4
5
|
/**
|
5
6
|
* Component for rendering a link to an example at a specific version.
|
6
7
|
* Always includes the version query parameter for consistent behavior.
|
@@ -10,6 +11,6 @@ export const ExampleLink = ({ exampleRef }) => {
|
|
10
11
|
const href = exampleRef.version
|
11
12
|
? `/examples/${exampleRef.name}?version=${Version.encodeSync(exampleRef.version)}`
|
12
13
|
: `/examples/${exampleRef.name}`;
|
13
|
-
return (_jsx(Link, { href: href, style: { textDecoration: 'none' }, children: _jsx(Badge, { variant: 'soft', size: '2', style: { cursor: 'pointer' }, children: exampleRef.name }) }));
|
14
|
+
return (_jsx(Link, { href: href, style: { textDecoration: 'none' }, children: _jsx(Badge, { variant: 'soft', size: '2', style: { cursor: 'pointer' }, children: Str.titlizeSlug(exampleRef.name) }) }));
|
14
15
|
};
|
15
16
|
//# sourceMappingURL=ExampleLink.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ExampleLink.js","sourceRoot":"","sources":["../../../src/template/components/ExampleLink.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAA;AACxC,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAA;
|
1
|
+
{"version":3,"file":"ExampleLink.js","sourceRoot":"","sources":["../../../src/template/components/ExampleLink.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAA;AACxC,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAA;AAC9C,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAA;AAOrC;;;GAGG;AACH,MAAM,CAAC,MAAM,WAAW,GAAc,CAAC,EAAE,UAAU,EAAE,EAAE,EAAE;IACvD,mDAAmD;IACnD,MAAM,IAAI,GAAG,UAAU,CAAC,OAAO;QAC7B,CAAC,CAAC,aAAa,UAAU,CAAC,IAAI,YAAY,OAAO,CAAC,UAAU,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE;QAClF,CAAC,CAAC,aAAa,UAAU,CAAC,IAAI,EAAE,CAAA;IAElC,OAAO,CACL,KAAC,IAAI,IAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,cAAc,EAAE,MAAM,EAAE,YACjD,KAAC,KAAK,IAAC,OAAO,EAAC,MAAM,EAAC,IAAI,EAAC,GAAG,EAAC,KAAK,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,YACxD,GAAG,CAAC,WAAW,CAAC,UAAU,CAAC,IAAI,CAAC,GAC3B,GACH,CACR,CAAA;AACH,CAAC,CAAA"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Field.d.ts","sourceRoot":"","sources":["../../../src/template/components/Field.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAA;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAE7C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;
|
1
|
+
{"version":3,"file":"Field.d.ts","sourceRoot":"","sources":["../../../src/template/components/Field.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAA;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAE7C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAYhD,eAAO,MAAM,KAAK,EAAE,KAAK,CAAC,EAAE,CAC1B,QAAQ,GAAG;IACT,IAAI,EAAE,UAAU,CAAC,YAAY,CAAA;IAC7B,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,iBAAiB,CAAC,EAAE,MAAM,CAAA;CAC3B,CA+JF,CAAA"}
|
@@ -2,18 +2,27 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Api } from '#api/iso';
|
3
3
|
import { GrafaidOld } from '#lib/grafaid-old';
|
4
4
|
import { Lifecycles } from '#lib/lifecycles/$';
|
5
|
-
import { Badge, Box, Text } from '@radix-ui/themes';
|
5
|
+
import { Badge, Box, Card, Flex, HoverCard, Link, Text } from '@radix-ui/themes';
|
6
|
+
import { isNonNullType } from 'graphql';
|
6
7
|
import { useSchema } from '../contexts/GraphqlLifecycleContext.js';
|
8
|
+
import { useReferenceConfig } from '../contexts/ReferenceConfigContext.js';
|
9
|
+
import { useViewMode } from '../contexts/ViewModeContext.js';
|
7
10
|
import { ArgumentListAnnotation } from './ArgumentListAnnotation.js';
|
8
11
|
import { DeprecationReason } from './DeprecationReason.js';
|
9
12
|
import { Description } from './Description.js';
|
10
13
|
import { SinceBadge } from './SinceBadge.js';
|
11
14
|
import { TypeAnnotation } from './TypeAnnotation.js';
|
12
|
-
export const Field = ({ data, parentTypeName, ...boxProps }) => {
|
15
|
+
export const Field = ({ data, parentTypeName, fieldNameWidth, argumentNameWidth, ...boxProps }) => {
|
13
16
|
const { schema, lifecycles } = useSchema();
|
17
|
+
const { viewMode } = useViewMode();
|
18
|
+
const referenceConfig = useReferenceConfig();
|
14
19
|
const argumentList = GrafaidOld.isOutputField(data)
|
15
|
-
?
|
20
|
+
? argumentNameWidth !== undefined
|
21
|
+
? _jsx(ArgumentListAnnotation, { field: data, argumentNameWidth: argumentNameWidth })
|
22
|
+
: _jsx(ArgumentListAnnotation, { field: data })
|
16
23
|
: null;
|
24
|
+
// Check if the field is nullable (for questionMark mode)
|
25
|
+
const isFieldNullable = !isNonNullType(data.type);
|
17
26
|
// Get field lifecycle information if available
|
18
27
|
const since = parentTypeName
|
19
28
|
? Lifecycles.getFieldSince(lifecycles, parentTypeName, data.name, schema)
|
@@ -21,6 +30,35 @@ export const Field = ({ data, parentTypeName, ...boxProps }) => {
|
|
21
30
|
const removedDate = parentTypeName
|
22
31
|
? Lifecycles.getFieldRemovedDate(lifecycles, parentTypeName, data.name, schema)
|
23
32
|
: null;
|
24
|
-
|
33
|
+
// Only show since badge if it's NOT the initial version
|
34
|
+
const showSinceBadge = since && since._tag !== 'initial';
|
35
|
+
return (_jsxs(Card, { ...boxProps, variant: 'ghost', id: data.name, style: { overflow: 'visible' }, children: [_jsx("style", { children: `
|
36
|
+
.field-name-anchor {
|
37
|
+
position: absolute;
|
38
|
+
left: 0;
|
39
|
+
top: 50%;
|
40
|
+
transform: translateY(-50%) translateX(0);
|
41
|
+
opacity: 0;
|
42
|
+
transition: all 0.2s ease-in-out;
|
43
|
+
pointer-events: none;
|
44
|
+
z-index: 10;
|
45
|
+
}
|
46
|
+
|
47
|
+
.field-name-wrapper:hover .field-name-anchor {
|
48
|
+
transform: translateY(-50%) translateX(-24px);
|
49
|
+
opacity: 1;
|
50
|
+
pointer-events: auto;
|
51
|
+
}
|
52
|
+
` }), _jsxs(Flex, { align: 'baseline', mb: '2', gap: '2', children: [_jsxs(Box, { className: 'field-name-wrapper', style: {
|
53
|
+
minWidth: fieldNameWidth ? `${fieldNameWidth}ch` : 'auto',
|
54
|
+
flexShrink: 0,
|
55
|
+
position: 'relative',
|
56
|
+
}, children: [_jsx(Link, { className: 'field-name-anchor', href: `#${data.name}`, color: 'gray', style: {
|
57
|
+
textDecoration: 'none',
|
58
|
+
display: 'inline-flex',
|
59
|
+
alignItems: 'center',
|
60
|
+
}, children: _jsx(Text, { size: '3', color: 'gray', children: "#" }) }), viewMode === 'compact' && data.description
|
61
|
+
? (_jsxs(HoverCard.Root, { children: [_jsx(HoverCard.Trigger, { children: _jsx(Link, { href: `#${data.name}`, color: 'gray', underline: 'hover', style: { textDecoration: 'none', display: 'inline-block' }, children: _jsxs(Text, { size: '3', weight: 'bold', children: [data.name, referenceConfig.nullabilityRendering === 'questionMark' && isFieldNullable && '?'] }) }) }), _jsx(HoverCard.Content, { size: '2', maxWidth: '400px', side: 'top', align: 'center', children: _jsx(Text, { size: '2', color: 'gray', children: _jsx(Description, { data: data }) }) })] }))
|
62
|
+
: (_jsx(Link, { href: `#${data.name}`, color: 'gray', underline: 'hover', style: { textDecoration: 'none', display: 'inline-block' }, children: _jsxs(Text, { size: '3', weight: 'bold', children: [data.name, referenceConfig.nullabilityRendering === 'questionMark' && isFieldNullable && '?'] }) }))] }), _jsx(TypeAnnotation, { type: data.type, showDescription: true, nullabilityRendering: referenceConfig.nullabilityRendering })] }), (showSinceBadge || removedDate) && (_jsxs(Flex, { gap: '2', mb: '2', children: [showSinceBadge && _jsx(SinceBadge, { since: since }), removedDate && (_jsxs(Badge, { color: 'red', variant: 'soft', size: '1', children: ["Removed ", Api.Schema.dateToVersionString(removedDate)] }))] })), data.description && viewMode === 'expanded' && (_jsx(Box, { mb: '2', children: _jsx(Text, { size: '2', color: 'gray', style: { lineHeight: '1.5' }, children: _jsx(Description, { data: data }) }) })), _jsx(DeprecationReason, { data: data }), argumentList && GrafaidOld.isOutputField(data) && data.args.length > 0 && (_jsx(Box, { mt: '2', ml: '3', pl: '3', style: { borderLeft: '2px solid var(--gray-4)' }, children: argumentList }))] }));
|
25
63
|
};
|
26
64
|
//# sourceMappingURL=Field.js.map
|