@graphiql/plugin-doc-explorer 0.0.2 → 0.0.3-canary-1be1da67.0
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/dist/components/default-value.d.ts +2 -2
- package/dist/components/default-value.js.map +1 -1
- package/dist/components/doc-explorer.js +114 -124
- package/dist/components/doc-explorer.js.map +1 -1
- package/dist/components/field-documentation.d.ts +2 -2
- package/dist/components/field-documentation.js.map +1 -1
- package/dist/components/field-link.d.ts +2 -2
- package/dist/components/field-link.js +17 -26
- package/dist/components/field-link.js.map +1 -1
- package/dist/components/search.js +113 -137
- package/dist/components/search.js.map +1 -1
- package/dist/components/type-documentation.js.map +1 -1
- package/dist/components/type-link.js +17 -27
- package/dist/components/type-link.js.map +1 -1
- package/dist/context.d.ts +47 -26
- package/dist/context.js +204 -183
- package/dist/context.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +5 -4
- package/dist/index.js.map +1 -1
- package/package.json +4 -3
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { DocExplorerFieldDef } from '../context';
|
|
3
3
|
declare type DefaultValueProps = {
|
|
4
4
|
/**
|
|
5
5
|
* The field or argument for which to render the default value.
|
|
6
6
|
*/
|
|
7
|
-
field:
|
|
7
|
+
field: DocExplorerFieldDef;
|
|
8
8
|
};
|
|
9
9
|
export declare const DefaultValue: FC<DefaultValueProps>;
|
|
10
10
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"default-value.js","sources":["../../src/components/default-value.tsx"],"sourcesContent":["import { FC } from 'react';\nimport { astFromValue, print, ValueNode } from 'graphql';\nimport {
|
|
1
|
+
{"version":3,"file":"default-value.js","sources":["../../src/components/default-value.tsx"],"sourcesContent":["import { FC } from 'react';\nimport { astFromValue, print, ValueNode } from 'graphql';\nimport { DocExplorerFieldDef } from '../context';\nimport './default-value.css';\n\nconst printDefault = (ast?: ValueNode | null): string => {\n if (!ast) {\n return '';\n }\n return print(ast);\n};\n\ntype DefaultValueProps = {\n /**\n * The field or argument for which to render the default value.\n */\n field: DocExplorerFieldDef;\n};\n\nexport const DefaultValue: FC<DefaultValueProps> = ({ field }) => {\n if (!('defaultValue' in field) || field.defaultValue === undefined) {\n return null;\n }\n const ast = astFromValue(field.defaultValue, field.type);\n if (!ast) {\n return null;\n }\n return (\n <>\n {' = '}\n <span className=\"graphiql-doc-explorer-default-value\">\n {printDefault(ast)}\n </span>\n </>\n );\n};\n"],"names":["printDefault","ast","print","DefaultValue","t0","$","_c","field","defaultValue","undefined","t1","t2","type","t3","t4","t5","t6","Symbol","for","astFromValue","bb0","t7","t8"],"mappings":";;;;AAKA,MAAMA,eAAeA,CAACC,QAAmC;AACvD,MAAI,CAACA,KAAK;AACD,WAAA;AAAA,EAAA;AAET,SAAOC,MAAMD,GAAG;AAClB;AASO,MAAME,eAAsCC,CAAA,OAAA;AAAAC,QAAAA,IAAAC,EAAA,EAAA;AAAC,QAAA;AAAA,IAAAC;AAAAA,EAAAA,IAAAH;AAAS,MACvD,EAAE,kBAAkBG,UAAUA,MAAKC,iBAAAC,QAA2B;AAAA,WAAA;AAAA,EAAA;AAGzC,QAAAC,KAAAH,MAAKC;AAAe,QAAAG,KAAAJ,MAAKK;AAAKC,MAAAA;AAAAC,MAAAA;AAAAC,MAAAA;AAAAC,MAAAA;AAAAX,MAAAA,EAAAE,CAAAA,MAAAA,MAAAC,gBAAAH,EAAA,CAAA,MAAAE,MAAAK,MAAA;AAE9CK,SAAAA,OAAAC,iCAAG;AAAC,SAAA;AAFbjB,YAAAA,MAAYkB,aAAaT,IAAoBC,EAAU;AAAE,UAAA,CACpDV,KAAG;AACC,aAAA;AAAImB,cAAAA;AAAAA,MAAAA;AAIH,WAAA;AAC+C,WAAA;AAClDN,WAAAd,aAAaC,GAAG;AAAA,IAAA;AAAC,MAAA,CAAA,IAAAM,MAAAC;AAAA,MAAA,CAAA,IAAAD,MAAAK;AAAAP,WAAAQ;AAAAR,WAAAS;AAAAT,WAAAU;AAAAV,WAAAW;AAAAA,EAAAA,OAAA;AAAAH,SAAAR,EAAA,CAAA;AAAAS,SAAAT,EAAA,CAAA;AAAAU,SAAAV,EAAA,CAAA;AAAAW,SAAAX,EAAA,CAAA;AAAA,EAAA;AAAA,MAAAW,OAAAC,OAAAC,IAAA,6BAAA,GAAA;AAAAF,WAAAA;AAAAA,EAAAA;AAAAK,MAAAA;AAAA,MAAAhB,EAAAQ,CAAAA,MAAAA,MAAAR,SAAAS,IAAA;AADpBO,SAEO,oBAAA,QAAA,EAFS,WAAAR,IACbC,UACH,IAAA;AAAOT,WAAAQ;AAAAR,WAAAS;AAAAT,WAAAgB;AAAAA,EAAAA,OAAA;AAAAA,SAAAhB,EAAA,CAAA;AAAA,EAAA;AAAAiB,MAAAA;AAAA,MAAAjB,EAAAU,CAAAA,MAAAA,MAAAV,UAAAgB,IAAA;AAJTC,SACGP,qBAAAA,UAAAA,EAAAA,UAAAA;AAAAA,MAAAA;AAAAA,MACDM;AAAAA,IAAAA,GAEO;AACNhB,WAAAU;AAAAV,YAAAgB;AAAAhB,YAAAiB;AAAAA,EAAAA,OAAA;AAAAA,SAAAjB,EAAA,EAAA;AAAA,EAAA;AALHiB,SAAAA;AAKG;"}
|
|
@@ -2,14 +2,14 @@ import { jsxs, jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { c } from "react-compiler-runtime";
|
|
3
3
|
import { isType } from "graphql";
|
|
4
4
|
import { useSchemaContext, Spinner, ChevronLeftIcon } from "@graphiql/react";
|
|
5
|
-
import {
|
|
5
|
+
import { useDocExplorer, useDocExplorerActions } from "../context.js";
|
|
6
6
|
import { FieldDocumentation } from "./field-documentation.js";
|
|
7
7
|
import { SchemaDocumentation } from "./schema-documentation.js";
|
|
8
8
|
import { Search } from "./search.js";
|
|
9
9
|
import { TypeDocumentation } from "./type-documentation.js";
|
|
10
10
|
/* empty css */
|
|
11
11
|
const DocExplorer = () => {
|
|
12
|
-
const $ = c(
|
|
12
|
+
const $ = c(39);
|
|
13
13
|
let t0;
|
|
14
14
|
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
15
15
|
t0 = {
|
|
@@ -26,101 +26,91 @@ const DocExplorer = () => {
|
|
|
26
26
|
schema,
|
|
27
27
|
validationErrors
|
|
28
28
|
} = useSchemaContext(t0);
|
|
29
|
-
|
|
30
|
-
if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
|
|
31
|
-
t1 = {
|
|
32
|
-
nonNull: true,
|
|
33
|
-
caller: DocExplorer
|
|
34
|
-
};
|
|
35
|
-
$[1] = t1;
|
|
36
|
-
} else {
|
|
37
|
-
t1 = $[1];
|
|
38
|
-
}
|
|
29
|
+
const explorerNavStack = useDocExplorer();
|
|
39
30
|
const {
|
|
40
|
-
explorerNavStack,
|
|
41
31
|
pop
|
|
42
|
-
} =
|
|
32
|
+
} = useDocExplorerActions();
|
|
43
33
|
let content;
|
|
44
34
|
let navItem;
|
|
45
|
-
if ($[
|
|
35
|
+
if ($[1] !== explorerNavStack || $[2] !== fetchError || $[3] !== isFetching || $[4] !== schema || $[5] !== validationErrors) {
|
|
46
36
|
navItem = explorerNavStack.at(-1);
|
|
47
37
|
content = null;
|
|
48
38
|
if (fetchError) {
|
|
49
|
-
let
|
|
50
|
-
if ($[
|
|
51
|
-
|
|
52
|
-
$[
|
|
39
|
+
let t12;
|
|
40
|
+
if ($[8] === Symbol.for("react.memo_cache_sentinel")) {
|
|
41
|
+
t12 = /* @__PURE__ */ jsx("div", { className: "graphiql-doc-explorer-error", children: "Error fetching schema" });
|
|
42
|
+
$[8] = t12;
|
|
53
43
|
} else {
|
|
54
|
-
|
|
44
|
+
t12 = $[8];
|
|
55
45
|
}
|
|
56
|
-
content =
|
|
46
|
+
content = t12;
|
|
57
47
|
} else {
|
|
58
48
|
if (validationErrors.length > 0) {
|
|
59
|
-
let
|
|
60
|
-
if ($[
|
|
61
|
-
|
|
49
|
+
let t12;
|
|
50
|
+
if ($[9] !== validationErrors[0].message) {
|
|
51
|
+
t12 = /* @__PURE__ */ jsxs("div", { className: "graphiql-doc-explorer-error", children: [
|
|
62
52
|
"Schema is invalid: ",
|
|
63
53
|
validationErrors[0].message
|
|
64
54
|
] });
|
|
65
|
-
$[
|
|
66
|
-
$[
|
|
55
|
+
$[9] = validationErrors[0].message;
|
|
56
|
+
$[10] = t12;
|
|
67
57
|
} else {
|
|
68
|
-
|
|
58
|
+
t12 = $[10];
|
|
69
59
|
}
|
|
70
|
-
content =
|
|
60
|
+
content = t12;
|
|
71
61
|
} else {
|
|
72
62
|
if (isFetching) {
|
|
73
|
-
let
|
|
74
|
-
if ($[
|
|
75
|
-
|
|
76
|
-
$[
|
|
63
|
+
let t12;
|
|
64
|
+
if ($[11] === Symbol.for("react.memo_cache_sentinel")) {
|
|
65
|
+
t12 = /* @__PURE__ */ jsx(Spinner, {});
|
|
66
|
+
$[11] = t12;
|
|
77
67
|
} else {
|
|
78
|
-
|
|
68
|
+
t12 = $[11];
|
|
79
69
|
}
|
|
80
|
-
content =
|
|
70
|
+
content = t12;
|
|
81
71
|
} else {
|
|
82
72
|
if (!schema) {
|
|
83
|
-
let
|
|
84
|
-
if ($[
|
|
85
|
-
|
|
86
|
-
$[
|
|
73
|
+
let t12;
|
|
74
|
+
if ($[12] === Symbol.for("react.memo_cache_sentinel")) {
|
|
75
|
+
t12 = /* @__PURE__ */ jsx("div", { className: "graphiql-doc-explorer-error", children: "No GraphQL schema available" });
|
|
76
|
+
$[12] = t12;
|
|
87
77
|
} else {
|
|
88
|
-
|
|
78
|
+
t12 = $[12];
|
|
89
79
|
}
|
|
90
|
-
content =
|
|
80
|
+
content = t12;
|
|
91
81
|
} else {
|
|
92
82
|
if (explorerNavStack.length === 1) {
|
|
93
|
-
let
|
|
94
|
-
if ($[
|
|
95
|
-
|
|
96
|
-
$[
|
|
97
|
-
$[
|
|
83
|
+
let t12;
|
|
84
|
+
if ($[13] !== schema) {
|
|
85
|
+
t12 = /* @__PURE__ */ jsx(SchemaDocumentation, { schema });
|
|
86
|
+
$[13] = schema;
|
|
87
|
+
$[14] = t12;
|
|
98
88
|
} else {
|
|
99
|
-
|
|
89
|
+
t12 = $[14];
|
|
100
90
|
}
|
|
101
|
-
content =
|
|
91
|
+
content = t12;
|
|
102
92
|
} else {
|
|
103
93
|
if (isType(navItem.def)) {
|
|
104
|
-
let
|
|
105
|
-
if ($[
|
|
106
|
-
|
|
107
|
-
$[
|
|
108
|
-
$[
|
|
94
|
+
let t12;
|
|
95
|
+
if ($[15] !== navItem.def) {
|
|
96
|
+
t12 = /* @__PURE__ */ jsx(TypeDocumentation, { type: navItem.def });
|
|
97
|
+
$[15] = navItem.def;
|
|
98
|
+
$[16] = t12;
|
|
109
99
|
} else {
|
|
110
|
-
|
|
100
|
+
t12 = $[16];
|
|
111
101
|
}
|
|
112
|
-
content =
|
|
102
|
+
content = t12;
|
|
113
103
|
} else {
|
|
114
104
|
if (navItem.def) {
|
|
115
|
-
let
|
|
116
|
-
if ($[
|
|
117
|
-
|
|
118
|
-
$[
|
|
119
|
-
$[
|
|
105
|
+
let t12;
|
|
106
|
+
if ($[17] !== navItem.def) {
|
|
107
|
+
t12 = /* @__PURE__ */ jsx(FieldDocumentation, { field: navItem.def });
|
|
108
|
+
$[17] = navItem.def;
|
|
109
|
+
$[18] = t12;
|
|
120
110
|
} else {
|
|
121
|
-
|
|
111
|
+
t12 = $[18];
|
|
122
112
|
}
|
|
123
|
-
content =
|
|
113
|
+
content = t12;
|
|
124
114
|
}
|
|
125
115
|
}
|
|
126
116
|
}
|
|
@@ -128,105 +118,105 @@ const DocExplorer = () => {
|
|
|
128
118
|
}
|
|
129
119
|
}
|
|
130
120
|
}
|
|
131
|
-
$[
|
|
132
|
-
$[
|
|
133
|
-
$[
|
|
134
|
-
$[
|
|
135
|
-
$[
|
|
136
|
-
$[
|
|
137
|
-
$[
|
|
121
|
+
$[1] = explorerNavStack;
|
|
122
|
+
$[2] = fetchError;
|
|
123
|
+
$[3] = isFetching;
|
|
124
|
+
$[4] = schema;
|
|
125
|
+
$[5] = validationErrors;
|
|
126
|
+
$[6] = content;
|
|
127
|
+
$[7] = navItem;
|
|
138
128
|
} else {
|
|
139
|
-
content = $[
|
|
140
|
-
navItem = $[
|
|
129
|
+
content = $[6];
|
|
130
|
+
navItem = $[7];
|
|
141
131
|
}
|
|
142
132
|
let prevName;
|
|
143
133
|
if (explorerNavStack.length > 1) {
|
|
144
|
-
let
|
|
145
|
-
if ($[
|
|
146
|
-
|
|
147
|
-
$[
|
|
148
|
-
$[
|
|
134
|
+
let t12;
|
|
135
|
+
if ($[19] !== explorerNavStack) {
|
|
136
|
+
t12 = explorerNavStack.at(-2);
|
|
137
|
+
$[19] = explorerNavStack;
|
|
138
|
+
$[20] = t12;
|
|
149
139
|
} else {
|
|
150
|
-
|
|
140
|
+
t12 = $[20];
|
|
151
141
|
}
|
|
152
|
-
prevName =
|
|
142
|
+
prevName = t12.name;
|
|
153
143
|
}
|
|
154
|
-
let
|
|
155
|
-
if ($[
|
|
156
|
-
|
|
144
|
+
let t1;
|
|
145
|
+
if ($[21] !== pop || $[22] !== prevName) {
|
|
146
|
+
t1 = prevName && /* @__PURE__ */ jsxs("a", { href: "#", className: "graphiql-doc-explorer-back", onClick: (event) => {
|
|
157
147
|
event.preventDefault();
|
|
158
148
|
pop();
|
|
159
149
|
}, "aria-label": `Go back to ${prevName}`, children: [
|
|
160
150
|
/* @__PURE__ */ jsx(ChevronLeftIcon, {}),
|
|
161
151
|
prevName
|
|
162
152
|
] });
|
|
163
|
-
$[
|
|
164
|
-
$[
|
|
165
|
-
$[
|
|
153
|
+
$[21] = pop;
|
|
154
|
+
$[22] = prevName;
|
|
155
|
+
$[23] = t1;
|
|
166
156
|
} else {
|
|
167
|
-
|
|
157
|
+
t1 = $[23];
|
|
168
158
|
}
|
|
169
|
-
let
|
|
170
|
-
if ($[
|
|
171
|
-
|
|
172
|
-
$[
|
|
173
|
-
$[
|
|
159
|
+
let t2;
|
|
160
|
+
if ($[24] !== navItem.name) {
|
|
161
|
+
t2 = /* @__PURE__ */ jsx("div", { className: "graphiql-doc-explorer-title", children: navItem.name });
|
|
162
|
+
$[24] = navItem.name;
|
|
163
|
+
$[25] = t2;
|
|
174
164
|
} else {
|
|
175
|
-
|
|
165
|
+
t2 = $[25];
|
|
176
166
|
}
|
|
177
|
-
let
|
|
178
|
-
if ($[
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
167
|
+
let t3;
|
|
168
|
+
if ($[26] !== t1 || $[27] !== t2) {
|
|
169
|
+
t3 = /* @__PURE__ */ jsxs("div", { className: "graphiql-doc-explorer-header-content", children: [
|
|
170
|
+
t1,
|
|
171
|
+
t2
|
|
182
172
|
] });
|
|
173
|
+
$[26] = t1;
|
|
183
174
|
$[27] = t2;
|
|
184
175
|
$[28] = t3;
|
|
185
|
-
$[29] = t4;
|
|
186
176
|
} else {
|
|
187
|
-
|
|
177
|
+
t3 = $[28];
|
|
188
178
|
}
|
|
189
|
-
let
|
|
190
|
-
if ($[
|
|
191
|
-
|
|
192
|
-
$[
|
|
193
|
-
$[
|
|
179
|
+
let t4;
|
|
180
|
+
if ($[29] !== navItem.name) {
|
|
181
|
+
t4 = /* @__PURE__ */ jsx(Search, {}, navItem.name);
|
|
182
|
+
$[29] = navItem.name;
|
|
183
|
+
$[30] = t4;
|
|
194
184
|
} else {
|
|
195
|
-
|
|
185
|
+
t4 = $[30];
|
|
196
186
|
}
|
|
197
|
-
let
|
|
198
|
-
if ($[
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
187
|
+
let t5;
|
|
188
|
+
if ($[31] !== t3 || $[32] !== t4) {
|
|
189
|
+
t5 = /* @__PURE__ */ jsxs("div", { className: "graphiql-doc-explorer-header", children: [
|
|
190
|
+
t3,
|
|
191
|
+
t4
|
|
202
192
|
] });
|
|
193
|
+
$[31] = t3;
|
|
203
194
|
$[32] = t4;
|
|
204
195
|
$[33] = t5;
|
|
205
|
-
$[34] = t6;
|
|
206
196
|
} else {
|
|
207
|
-
|
|
197
|
+
t5 = $[33];
|
|
208
198
|
}
|
|
209
|
-
let
|
|
210
|
-
if ($[
|
|
211
|
-
|
|
212
|
-
$[
|
|
213
|
-
$[
|
|
199
|
+
let t6;
|
|
200
|
+
if ($[34] !== content) {
|
|
201
|
+
t6 = /* @__PURE__ */ jsx("div", { className: "graphiql-doc-explorer-content", children: content });
|
|
202
|
+
$[34] = content;
|
|
203
|
+
$[35] = t6;
|
|
214
204
|
} else {
|
|
215
|
-
|
|
205
|
+
t6 = $[35];
|
|
216
206
|
}
|
|
217
|
-
let
|
|
218
|
-
if ($[
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
207
|
+
let t7;
|
|
208
|
+
if ($[36] !== t5 || $[37] !== t6) {
|
|
209
|
+
t7 = /* @__PURE__ */ jsxs("section", { className: "graphiql-doc-explorer", "aria-label": "Documentation Explorer", children: [
|
|
210
|
+
t5,
|
|
211
|
+
t6
|
|
222
212
|
] });
|
|
213
|
+
$[36] = t5;
|
|
223
214
|
$[37] = t6;
|
|
224
215
|
$[38] = t7;
|
|
225
|
-
$[39] = t8;
|
|
226
216
|
} else {
|
|
227
|
-
|
|
217
|
+
t7 = $[38];
|
|
228
218
|
}
|
|
229
|
-
return
|
|
219
|
+
return t7;
|
|
230
220
|
};
|
|
231
221
|
export {
|
|
232
222
|
DocExplorer
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"doc-explorer.js","sources":["../../src/components/doc-explorer.tsx"],"sourcesContent":["import { isType } from 'graphql';\nimport { FC, ReactNode } from 'react';\nimport { ChevronLeftIcon, Spinner, useSchemaContext } from '@graphiql/react';\nimport {
|
|
1
|
+
{"version":3,"file":"doc-explorer.js","sources":["../../src/components/doc-explorer.tsx"],"sourcesContent":["import { isType } from 'graphql';\nimport { FC, ReactNode } from 'react';\nimport { ChevronLeftIcon, Spinner, useSchemaContext } from '@graphiql/react';\nimport { useDocExplorer, useDocExplorerActions } from '../context';\nimport { FieldDocumentation } from './field-documentation';\nimport { SchemaDocumentation } from './schema-documentation';\nimport { Search } from './search';\nimport { TypeDocumentation } from './type-documentation';\nimport './doc-explorer.css';\n\nexport const DocExplorer: FC = () => {\n const { fetchError, isFetching, schema, validationErrors } = useSchemaContext(\n { nonNull: true, caller: DocExplorer },\n );\n const explorerNavStack = useDocExplorer();\n const { pop } = useDocExplorerActions();\n const navItem = explorerNavStack.at(-1)!;\n\n let content: ReactNode = null;\n if (fetchError) {\n content = (\n <div className=\"graphiql-doc-explorer-error\">Error fetching schema</div>\n );\n } else if (validationErrors.length > 0) {\n content = (\n <div className=\"graphiql-doc-explorer-error\">\n Schema is invalid: {validationErrors[0].message}\n </div>\n );\n } else if (isFetching) {\n // Schema is undefined when it is being loaded via introspection.\n content = <Spinner />;\n } else if (!schema) {\n // Schema is null when it explicitly does not exist, typically due to\n // an error during introspection.\n content = (\n <div className=\"graphiql-doc-explorer-error\">\n No GraphQL schema available\n </div>\n );\n } else if (explorerNavStack.length === 1) {\n content = <SchemaDocumentation schema={schema} />;\n } else if (isType(navItem.def)) {\n content = <TypeDocumentation type={navItem.def} />;\n } else if (navItem.def) {\n content = <FieldDocumentation field={navItem.def} />;\n }\n\n let prevName;\n if (explorerNavStack.length > 1) {\n prevName = explorerNavStack.at(-2)!.name;\n }\n\n return (\n <section\n className=\"graphiql-doc-explorer\"\n aria-label=\"Documentation Explorer\"\n >\n <div className=\"graphiql-doc-explorer-header\">\n <div className=\"graphiql-doc-explorer-header-content\">\n {prevName && (\n <a\n href=\"#\"\n className=\"graphiql-doc-explorer-back\"\n onClick={event => {\n event.preventDefault();\n pop();\n }}\n aria-label={`Go back to ${prevName}`}\n >\n <ChevronLeftIcon />\n {prevName}\n </a>\n )}\n <div className=\"graphiql-doc-explorer-title\">{navItem.name}</div>\n </div>\n <Search key={navItem.name} />\n </div>\n <div className=\"graphiql-doc-explorer-content\">{content}</div>\n </section>\n );\n};\n"],"names":["DocExplorer","$","_c","t0","Symbol","for","nonNull","caller","fetchError","isFetching","schema","validationErrors","useSchemaContext","explorerNavStack","useDocExplorer","pop","useDocExplorerActions","content","navItem","at","t1","length","message","isType","def","prevName","event","preventDefault","t2","name","t3","t4","t5","t6","t7"],"mappings":";;;;;;;;;;AAUO,MAAMA,cAAkBA,MAAA;AAAAC,QAAAA,IAAAC,EAAA,EAAA;AAAAC,MAAAA;AAAA,MAAAF,EAAA,CAAA,MAAAG,OAAAC,IAAA,2BAAA,GAAA;AAE3B,SAAA;AAAA,MAAAC,SAAA;AAAA,MAAAC,QAAAP;AAAAA,IAAA;AAAsCC,WAAAE;AAAAA,EAAAA,OAAA;AAAAA,SAAAF,EAAA,CAAA;AAAA,EAAA;AADxC,QAAA;AAAA,IAAAO;AAAAA,IAAAC;AAAAA,IAAAC;AAAAA,IAAAC;AAAAA,EAAAA,IAA6DC,iBAC3DT,EACF;AACA,QAAAU,mBAAyBC,eAAe;AACxC,QAAA;AAAA,IAAAC;AAAAA,MAAgBC,sBAAsB;AAAEC,MAAAA;AAAAC,MAAAA;AAAA,MAAAjB,EAAAY,CAAAA,MAAAA,oBAAAZ,EAAA,CAAA,MAAAO,cAAAP,EAAAQ,CAAAA,MAAAA,cAAAR,EAAA,CAAA,MAAAS,UAAAT,SAAAU,kBAAA;AACxBE,cAAAA,iBAAgBM,KAAM;AAEtC,cAAA;AAA8B,QAC1BX,YAAU;AAAAY,UAAAA;AAAA,UAAAnB,EAAA,CAAA,MAAAG,OAAAC,IAAA,2BAAA,GAAA;AAEVe,cAAA,oBAAA,OAAe,EAAA,WAAA,+BAA8B,UAAqB,yBAAA;AAAMnB,eAAAmB;AAAAA,MAAAA,OAAA;AAAAA,cAAAnB,EAAA,CAAA;AAAA,MAAA;AAAxEgB,gBAAAA;AAAAA,IAAAA,OADK;AAGEN,UAAAA,iBAAgBU,SAAW,GAAA;AAAAD,YAAAA;AAAA,YAAAnB,EAAA,CAAA,MAAA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MAAAA;AAAAhC,MAAAA,UAAAgB,SAAA;AACNgB,SAAA,oBAAA,OAAA,EAAe,WAAA,iCAAiChB,UAAQ,SAAA;AAAMhB,YAAAgB;AAAAhB,YAAAgC;AAAAA,EAAAA,OAAA;AAAAA,SAAAhC,EAAA,EAAA;AAAA,EAAA;AAAAiC,MAAAA;AAAA,MAAAjC,EAAA+B,EAAAA,MAAAA,MAAA/B,UAAAgC,IAAA;AAxBhEC,2CACY,WAAA,yBACC,cAAA,0BAEXF,UAAAA;AAAAA,MAAAA;AAAAA,MAoBAC;AAAAA,IAAAA,GACF;AAAUhC,YAAA+B;AAAA/B,YAAAgC;AAAAhC,YAAAiC;AAAAA,EAAAA,OAAA;AAAAA,SAAAjC,EAAA,EAAA;AAAA,EAAA;AAzBViC,SAAAA;AAyBU;"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { DocExplorerFieldDef } from '../context';
|
|
3
3
|
declare type FieldDocumentationProps = {
|
|
4
4
|
/**
|
|
5
5
|
* The field or argument that should be rendered.
|
|
6
6
|
*/
|
|
7
|
-
field:
|
|
7
|
+
field: DocExplorerFieldDef;
|
|
8
8
|
};
|
|
9
9
|
export declare const FieldDocumentation: FC<FieldDocumentationProps>;
|
|
10
10
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"field-documentation.js","sources":["../../src/components/field-documentation.tsx"],"sourcesContent":["import { GraphQLArgument } from 'graphql';\nimport { FC, useState } from 'react';\nimport { Button, MarkdownContent } from '@graphiql/react';\nimport {
|
|
1
|
+
{"version":3,"file":"field-documentation.js","sources":["../../src/components/field-documentation.tsx"],"sourcesContent":["import { GraphQLArgument } from 'graphql';\nimport { FC, useState } from 'react';\nimport { Button, MarkdownContent } from '@graphiql/react';\nimport { DocExplorerFieldDef } from '../context';\nimport { Argument } from './argument';\nimport { DeprecationReason } from './deprecation-reason';\nimport { Directive } from './directive';\nimport { ExplorerSection } from './section';\nimport { TypeLink } from './type-link';\n\ntype FieldDocumentationProps = {\n /**\n * The field or argument that should be rendered.\n */\n field: DocExplorerFieldDef;\n};\n\nexport const FieldDocumentation: FC<FieldDocumentationProps> = ({ field }) => {\n return (\n <>\n {field.description ? (\n <MarkdownContent type=\"description\">\n {field.description}\n </MarkdownContent>\n ) : null}\n <DeprecationReason preview={false}>\n {field.deprecationReason}\n </DeprecationReason>\n <ExplorerSection title=\"Type\">\n <TypeLink type={field.type} />\n </ExplorerSection>\n <Arguments field={field} />\n <Directives field={field} />\n </>\n );\n};\n\nconst Arguments: FC<{ field: DocExplorerFieldDef }> = ({ field }) => {\n const [showDeprecated, setShowDeprecated] = useState(false);\n const handleShowDeprecated = () => {\n setShowDeprecated(true);\n };\n\n if (!('args' in field)) {\n return null;\n }\n\n const args: GraphQLArgument[] = [];\n const deprecatedArgs: GraphQLArgument[] = [];\n for (const argument of field.args) {\n if (argument.deprecationReason) {\n deprecatedArgs.push(argument);\n } else {\n args.push(argument);\n }\n }\n\n return (\n <>\n {args.length > 0 ? (\n <ExplorerSection title=\"Arguments\">\n {args.map(arg => (\n <Argument key={arg.name} arg={arg} />\n ))}\n </ExplorerSection>\n ) : null}\n {deprecatedArgs.length > 0 ? (\n showDeprecated || args.length === 0 ? (\n <ExplorerSection title=\"Deprecated Arguments\">\n {deprecatedArgs.map(arg => (\n <Argument key={arg.name} arg={arg} />\n ))}\n </ExplorerSection>\n ) : (\n <Button type=\"button\" onClick={handleShowDeprecated}>\n Show Deprecated Arguments\n </Button>\n )\n ) : null}\n </>\n );\n};\n\nconst Directives: FC<{ field: DocExplorerFieldDef }> = ({ field }) => {\n const directives = field.astNode?.directives;\n if (!directives?.length) {\n return null;\n }\n return (\n <ExplorerSection title=\"Directives\">\n {directives.map(directive => (\n <div key={directive.name.value}>\n <Directive directive={directive} />\n </div>\n ))}\n </ExplorerSection>\n );\n};\n"],"names":["FieldDocumentation","t0","$","_c","field","t1","description","t2","deprecationReason","t3","type","t4","t5","t6","Arguments","showDeprecated","setShowDeprecated","useState","Symbol","for","handleShowDeprecated","args","deprecatedArgs","argument","push","length","map","_temp","_temp2","Directives","directives","astNode","_temp3","arg","name","arg_0","directive","value"],"mappings":";;;;;;;;;AAiBO,MAAMA,qBAAkDC,CAAA,OAAA;AAAAC,QAAAA,IAAAC,EAAA,EAAA;AAAC,QAAA;AAAA,IAAAC;AAAAA,EAAAA,IAAAH;AAASI,MAAAA;AAAA,MAAAH,EAAA,CAAA,MAAAE,MAAAE,aAAA;AAGlEF,SAAAA,MAAKE,cACH,oBAAA,iBAAA,EAAqB,MAAA,eACnBF,UAAAA,MAAKE,aACR,IACM;AAAA,MAAA,CAAA,IAAAF,MAAAE;AAAAJ,WAAAG;AAAAA,EAAAA,OAAA;AAAAA,SAAAH,EAAA,CAAA;AAAA,EAAA;AAAAK,MAAAA;AAAA,MAAAL,EAAA,CAAA,MAAAE,MAAAI,mBAAA;AACRD,SAAC,oBAAA,mBAAA,EAA2B,SAAI,OAC7BH,gBAAKI,mBACR;AAAoB,MAAA,CAAA,IAAAJ,MAAAI;AAAAN,WAAAK;AAAAA,EAAAA,OAAA;AAAAA,SAAAL,EAAA,CAAA;AAAA,EAAA;AAAAO,MAAAA;AAAA,MAAAP,EAAA,CAAA,MAAAE,MAAAM,MAAA;AACpB,SAAA,oBAAC,mBAAsB,OAAA,QACrB,8BAAC,UAAe,EAAA,MAAAN,MAAKM,KAAAA,CACvB,EAAA,CAAA;AAAkB,MAAA,CAAA,IAAAN,MAAAM;AAAAR,WAAAO;AAAAA,EAAAA,OAAA;AAAAA,SAAAP,EAAA,CAAA;AAAA,EAAA;AAAAS,MAAAA;AAAAC,MAAAA;AAAAV,MAAAA,SAAAE,OAAA;6BACjB,aAAiBA,MAAS,CAAA;6BAC1B,cAAkBA,MAAS,CAAA;AAAAF,WAAAE;AAAAF,WAAAS;AAAAT,WAAAU;AAAAA,EAAAA,OAAA;AAAAD,SAAAT,EAAA,CAAA;AAAAU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A,EAAAA,yCAAUL,SAAA;AAAA,WAAA;AAAA,EAAA;AAAApB,MAAAA;AAAAH,MAAAA,SAAA4B,YAAA;AAKVA,SAAAA,WAAUJ,IAAAM,MAIV;AAAC9B,WAAA4B;AAAA5B,WAAAG;AAAAA,EAAAA,OAAA;AAAAA,SAAAH,EAAA,CAAA;AAAA,EAAA;AAAAK,MAAAA;AAAAL,MAAAA,SAAAG,IAAA;AALJE,SAAC,oBAAA,iBAAA,EAAsB,OAAA,cACpBF,UAKH,IAAA;AAAkBH,WAAAG;AAAAH,WAAAK;AAAAA,EAAAA,OAAA;AAAAA,SAAAL,EAAA,CAAA;AAAA,EAAA;AANlBK,SAAAA;AAMkB;AA1DgC,SAAAoB,MAAAM,KAAA;AAAA,SAyBzC,oBAAA,UAAA,EAA6BA,IAAfA,GAAAA,IAAGC,IAAmB;AAAA;AAzBK,SAAAN,OAAAO,OAAA;AAAA,SAiCvC,oBAAA,UAAA,EAA6BF,KAAAA,MAAAA,GAAfA,MAAGC,IAAmB;AAAA;AAaI,SAAAF,OAAAI,WAAA;AAQ/C,SAAA,oBAAA,SACE,UAAC,oBAAA,WAAA,EAAqBA,UACxB,CAAA,EAFUA,GAAAA,UAASF,KAAAG,KAEnB;AAAM;"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { DocExplorerFieldDef } from '../context';
|
|
3
3
|
declare type FieldLinkProps = {
|
|
4
4
|
/**
|
|
5
5
|
* The field or argument that should be linked to.
|
|
6
6
|
*/
|
|
7
|
-
field:
|
|
7
|
+
field: DocExplorerFieldDef;
|
|
8
8
|
};
|
|
9
9
|
export declare const FieldLink: FC<FieldLinkProps>;
|
|
10
10
|
export {};
|
|
@@ -1,49 +1,40 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { c } from "react-compiler-runtime";
|
|
3
|
-
import {
|
|
3
|
+
import { useDocExplorerActions } from "../context.js";
|
|
4
4
|
/* empty css */
|
|
5
5
|
const FieldLink = (t0) => {
|
|
6
|
-
const $ = c(
|
|
6
|
+
const $ = c(6);
|
|
7
7
|
const {
|
|
8
8
|
field
|
|
9
9
|
} = t0;
|
|
10
|
-
let t1;
|
|
11
|
-
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
12
|
-
t1 = {
|
|
13
|
-
nonNull: true
|
|
14
|
-
};
|
|
15
|
-
$[0] = t1;
|
|
16
|
-
} else {
|
|
17
|
-
t1 = $[0];
|
|
18
|
-
}
|
|
19
10
|
const {
|
|
20
11
|
push
|
|
21
|
-
} =
|
|
22
|
-
let
|
|
23
|
-
if ($[
|
|
24
|
-
|
|
12
|
+
} = useDocExplorerActions();
|
|
13
|
+
let t1;
|
|
14
|
+
if ($[0] !== field || $[1] !== push) {
|
|
15
|
+
t1 = (event) => {
|
|
25
16
|
event.preventDefault();
|
|
26
17
|
push({
|
|
27
18
|
name: field.name,
|
|
28
19
|
def: field
|
|
29
20
|
});
|
|
30
21
|
};
|
|
31
|
-
$[
|
|
32
|
-
$[
|
|
33
|
-
$[
|
|
22
|
+
$[0] = field;
|
|
23
|
+
$[1] = push;
|
|
24
|
+
$[2] = t1;
|
|
34
25
|
} else {
|
|
35
|
-
|
|
26
|
+
t1 = $[2];
|
|
36
27
|
}
|
|
37
|
-
let
|
|
38
|
-
if ($[
|
|
39
|
-
|
|
40
|
-
$[
|
|
28
|
+
let t2;
|
|
29
|
+
if ($[3] !== field.name || $[4] !== t1) {
|
|
30
|
+
t2 = /* @__PURE__ */ jsx("a", { className: "graphiql-doc-explorer-field-name", onClick: t1, href: "#", children: field.name });
|
|
31
|
+
$[3] = field.name;
|
|
32
|
+
$[4] = t1;
|
|
41
33
|
$[5] = t2;
|
|
42
|
-
$[6] = t3;
|
|
43
34
|
} else {
|
|
44
|
-
|
|
35
|
+
t2 = $[5];
|
|
45
36
|
}
|
|
46
|
-
return
|
|
37
|
+
return t2;
|
|
47
38
|
};
|
|
48
39
|
export {
|
|
49
40
|
FieldLink
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"field-link.js","sources":["../../src/components/field-link.tsx"],"sourcesContent":["import { FC } from 'react';\nimport {
|
|
1
|
+
{"version":3,"file":"field-link.js","sources":["../../src/components/field-link.tsx"],"sourcesContent":["import { FC } from 'react';\nimport { DocExplorerFieldDef, useDocExplorerActions } from '../context';\nimport './field-link.css';\n\ntype FieldLinkProps = {\n /**\n * The field or argument that should be linked to.\n */\n field: DocExplorerFieldDef;\n};\n\nexport const FieldLink: FC<FieldLinkProps> = ({ field }) => {\n const { push } = useDocExplorerActions();\n\n return (\n <a\n className=\"graphiql-doc-explorer-field-name\"\n onClick={event => {\n event.preventDefault();\n push({ name: field.name, def: field });\n }}\n href=\"#\"\n >\n {field.name}\n </a>\n );\n};\n"],"names":["FieldLink","t0","$","_c","field","push","useDocExplorerActions","t1","event","preventDefault","name","def","t2"],"mappings":";;;;AAWO,MAAMA,YAAgCC,CAAA,OAAA;AAAAC,QAAAA,IAAAC,EAAA,CAAA;AAAC,QAAA;AAAA,IAAAC;AAAAA,EAAAA,IAAAH;AAC5C,QAAA;AAAA,IAAAI;AAAAA,MAAiBC,sBAAsB;AAAEC,MAAAA;AAAA,MAAAL,EAAAE,CAAAA,MAAAA,SAAAF,SAAAG,MAAA;AAK5BE,SAAAC,CAAA,UAAA;AACPA,YAAKC,eAAgB;AACjB,WAAA;AAAA,QAAAC,MAASN,MAAKM;AAAAA,QAAAC,KAAYP;AAAAA,MAAAA,CAAO;AAAA,IAAC;AACvCF,WAAAE;AAAAF,WAAAG;AAAAH,WAAAK;AAAAA,EAAAA,OAAA;AAAAA,SAAAL,EAAA,CAAA;AAAA,EAAA;AAAAU,MAAAA;AAAAV,MAAAA,SAAAE,MAAAM,QAAAR,SAAAK,IAAA;AALH,SAAA,oBAAA,OACY,WAAA,oCACD,SAAAA,IAIJ,MAAA,KAEJH,UAAAA,MAAKM,KACR,CAAA;AAAI,MAAA,CAAA,IAAAN,MAAAM;AAAAR,WAAAK;AAAAL,WAAAU;AAAAA,EAAAA,OAAA;AAAAA,SAAAV,EAAA,CAAA;AAAA,EAAA;AATJU,SAAAA;AASI;"}
|