@graphiql/plugin-doc-explorer 1.0.0-beta.0 → 1.0.0-beta.2
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/LICENSE +21 -0
- package/dist/components/argument.js +88 -92
- package/dist/components/argument.js.map +1 -1
- package/dist/components/arguments-list.js +226 -237
- package/dist/components/arguments-list.js.map +1 -1
- package/dist/components/breadcrumb.js +59 -52
- package/dist/components/breadcrumb.js.map +1 -1
- package/dist/components/default-value.js +63 -74
- package/dist/components/default-value.js.map +1 -1
- package/dist/components/deprecation-reason.js +27 -21
- package/dist/components/deprecation-reason.js.map +1 -1
- package/dist/components/directive.js +20 -23
- package/dist/components/directive.js.map +1 -1
- package/dist/components/doc-explorer.js +219 -259
- package/dist/components/doc-explorer.js.map +1 -1
- package/dist/components/field-card.js +103 -97
- package/dist/components/field-card.js.map +1 -1
- package/dist/components/field-documentation.js +118 -135
- package/dist/components/field-documentation.js.map +1 -1
- package/dist/components/field-link.js +37 -39
- package/dist/components/field-link.js.map +1 -1
- package/dist/components/fields-list.js +216 -226
- package/dist/components/fields-list.js.map +1 -1
- package/dist/components/schema-documentation.js +263 -224
- package/dist/components/schema-documentation.js.map +1 -1
- package/dist/components/search-row.js +287 -268
- package/dist/components/search-row.js.map +1 -1
- package/dist/components/search.js +342 -345
- package/dist/components/search.js.map +1 -1
- package/dist/components/section.js +59 -69
- package/dist/components/section.js.map +1 -1
- package/dist/components/type-card.js +104 -107
- package/dist/components/type-card.js.map +1 -1
- package/dist/components/type-documentation.js +340 -363
- package/dist/components/type-documentation.js.map +1 -1
- package/dist/components/type-link.js +38 -39
- package/dist/components/type-link.js.map +1 -1
- package/dist/components/utils.js +15 -20
- package/dist/components/utils.js.map +1 -1
- package/dist/context.js +205 -285
- package/dist/context.js.map +1 -1
- package/dist/index.js +7 -31
- package/dist/schema-reference.js +48 -54
- package/dist/schema-reference.js.map +1 -1
- package/dist/style.css +24 -28
- package/package.json +25 -19
- package/dist/index.js.map +0 -1
|
@@ -1,248 +1,237 @@
|
|
|
1
|
-
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
-
import { c } from "react-compiler-runtime";
|
|
3
|
-
import { useState } from "react";
|
|
4
|
-
import { astFromValue, print } from "graphql";
|
|
5
|
-
import { ChevronDownIcon, ChevronUpIcon, Button } from "@graphiql/react";
|
|
6
|
-
import { DeprecationReason } from "./deprecation-reason.js";
|
|
7
|
-
import { TypeLink } from "./type-link.js";
|
|
8
1
|
import { renderType } from "./utils.js";
|
|
2
|
+
import { TypeLink } from "./type-link.js";
|
|
3
|
+
import { DeprecationReason } from "./deprecation-reason.js";
|
|
9
4
|
/* empty css */
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
$[15] = t5;
|
|
88
|
-
$[16] = t6;
|
|
89
|
-
$[17] = t7;
|
|
90
|
-
} else {
|
|
91
|
-
t7 = $[17];
|
|
92
|
-
}
|
|
93
|
-
return t7;
|
|
5
|
+
import { c } from "react-compiler-runtime";
|
|
6
|
+
import { Button, ChevronDownIcon, ChevronUpIcon } from "@graphiql/react";
|
|
7
|
+
import { astFromValue, print } from "graphql";
|
|
8
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
+
import { useState } from "react";
|
|
10
|
+
//#region src/components/arguments-list.tsx
|
|
11
|
+
var ArgumentsList = (t0) => {
|
|
12
|
+
const $ = c(18);
|
|
13
|
+
const { title, args } = t0;
|
|
14
|
+
const [expanded, setExpanded] = useState(true);
|
|
15
|
+
if (args.length === 0) return null;
|
|
16
|
+
let t1;
|
|
17
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
18
|
+
t1 = () => setExpanded(_temp);
|
|
19
|
+
$[0] = t1;
|
|
20
|
+
} else t1 = $[0];
|
|
21
|
+
let t2;
|
|
22
|
+
if ($[1] !== expanded) {
|
|
23
|
+
t2 = expanded ? /* @__PURE__ */ jsx(ChevronDownIcon, { "aria-hidden": "true" }) : /* @__PURE__ */ jsx(ChevronUpIcon, { "aria-hidden": "true" });
|
|
24
|
+
$[1] = expanded;
|
|
25
|
+
$[2] = t2;
|
|
26
|
+
} else t2 = $[2];
|
|
27
|
+
let t3;
|
|
28
|
+
if ($[3] !== args.length) {
|
|
29
|
+
t3 = /* @__PURE__ */ jsxs("span", {
|
|
30
|
+
className: "graphiql-doc-explorer-arguments-list-count",
|
|
31
|
+
children: ["· ", args.length]
|
|
32
|
+
});
|
|
33
|
+
$[3] = args.length;
|
|
34
|
+
$[4] = t3;
|
|
35
|
+
} else t3 = $[4];
|
|
36
|
+
let t4;
|
|
37
|
+
if ($[5] !== t3 || $[6] !== title) {
|
|
38
|
+
t4 = /* @__PURE__ */ jsxs("span", { children: [
|
|
39
|
+
title,
|
|
40
|
+
" ",
|
|
41
|
+
t3
|
|
42
|
+
] });
|
|
43
|
+
$[5] = t3;
|
|
44
|
+
$[6] = title;
|
|
45
|
+
$[7] = t4;
|
|
46
|
+
} else t4 = $[7];
|
|
47
|
+
let t5;
|
|
48
|
+
if ($[8] !== expanded || $[9] !== t2 || $[10] !== t4) {
|
|
49
|
+
t5 = /* @__PURE__ */ jsxs("button", {
|
|
50
|
+
type: "button",
|
|
51
|
+
className: "graphiql-doc-explorer-arguments-list-header",
|
|
52
|
+
onClick: t1,
|
|
53
|
+
"aria-expanded": expanded,
|
|
54
|
+
children: [t2, t4]
|
|
55
|
+
});
|
|
56
|
+
$[8] = expanded;
|
|
57
|
+
$[9] = t2;
|
|
58
|
+
$[10] = t4;
|
|
59
|
+
$[11] = t5;
|
|
60
|
+
} else t5 = $[11];
|
|
61
|
+
let t6;
|
|
62
|
+
if ($[12] !== args || $[13] !== expanded) {
|
|
63
|
+
t6 = expanded && /* @__PURE__ */ jsx("div", {
|
|
64
|
+
className: "graphiql-doc-explorer-arguments-list-body",
|
|
65
|
+
children: args.map(_temp2)
|
|
66
|
+
});
|
|
67
|
+
$[12] = args;
|
|
68
|
+
$[13] = expanded;
|
|
69
|
+
$[14] = t6;
|
|
70
|
+
} else t6 = $[14];
|
|
71
|
+
let t7;
|
|
72
|
+
if ($[15] !== t5 || $[16] !== t6) {
|
|
73
|
+
t7 = /* @__PURE__ */ jsxs("div", {
|
|
74
|
+
className: "graphiql-doc-explorer-arguments-list",
|
|
75
|
+
children: [t5, t6]
|
|
76
|
+
});
|
|
77
|
+
$[15] = t5;
|
|
78
|
+
$[16] = t6;
|
|
79
|
+
$[17] = t7;
|
|
80
|
+
} else t7 = $[17];
|
|
81
|
+
return t7;
|
|
94
82
|
};
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
83
|
+
var ShowDeprecatedArgumentsButton = (t0) => {
|
|
84
|
+
const $ = c(2);
|
|
85
|
+
const { onClick } = t0;
|
|
86
|
+
let t1;
|
|
87
|
+
if ($[0] !== onClick) {
|
|
88
|
+
t1 = /* @__PURE__ */ jsx(Button, {
|
|
89
|
+
type: "button",
|
|
90
|
+
onClick,
|
|
91
|
+
className: "graphiql-doc-explorer-arguments-list-show-deprecated",
|
|
92
|
+
children: "Show Deprecated Arguments"
|
|
93
|
+
});
|
|
94
|
+
$[0] = onClick;
|
|
95
|
+
$[1] = t1;
|
|
96
|
+
} else t1 = $[1];
|
|
97
|
+
return t1;
|
|
109
98
|
};
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
99
|
+
var ArgumentRow = (t0) => {
|
|
100
|
+
const $ = c(34);
|
|
101
|
+
const { arg } = t0;
|
|
102
|
+
let t1;
|
|
103
|
+
let t2;
|
|
104
|
+
let t3;
|
|
105
|
+
let t4;
|
|
106
|
+
let t5;
|
|
107
|
+
let t6;
|
|
108
|
+
if ($[0] !== arg.defaultValue || $[1] !== arg.deprecationReason || $[2] !== arg.name || $[3] !== arg.type) {
|
|
109
|
+
const defaultAst = arg.defaultValue === void 0 ? null : astFromValue(arg.defaultValue, arg.type);
|
|
110
|
+
const t7 = Boolean(arg.deprecationReason) ? "graphiql-doc-explorer-argument--deprecated" : "";
|
|
111
|
+
let t8;
|
|
112
|
+
if ($[10] !== t7) {
|
|
113
|
+
t8 = ["graphiql-doc-explorer-argument", t7].filter(Boolean);
|
|
114
|
+
$[10] = t7;
|
|
115
|
+
$[11] = t8;
|
|
116
|
+
} else t8 = $[11];
|
|
117
|
+
t6 = t8.join(" ");
|
|
118
|
+
t1 = "graphiql-doc-explorer-argument-sig";
|
|
119
|
+
if ($[12] !== arg.name) {
|
|
120
|
+
t2 = /* @__PURE__ */ jsx("span", {
|
|
121
|
+
className: "graphiql-doc-explorer-argument-name",
|
|
122
|
+
children: arg.name
|
|
123
|
+
});
|
|
124
|
+
$[12] = arg.name;
|
|
125
|
+
$[13] = t2;
|
|
126
|
+
} else t2 = $[13];
|
|
127
|
+
if ($[14] === Symbol.for("react.memo_cache_sentinel")) {
|
|
128
|
+
t3 = /* @__PURE__ */ jsx("span", {
|
|
129
|
+
className: "graphiql-doc-explorer-argument-colon",
|
|
130
|
+
"aria-hidden": "true",
|
|
131
|
+
children: ":"
|
|
132
|
+
});
|
|
133
|
+
$[14] = t3;
|
|
134
|
+
} else t3 = $[14];
|
|
135
|
+
let t9;
|
|
136
|
+
if ($[15] !== arg.type) {
|
|
137
|
+
t9 = renderType(arg.type, _temp3);
|
|
138
|
+
$[15] = arg.type;
|
|
139
|
+
$[16] = t9;
|
|
140
|
+
} else t9 = $[16];
|
|
141
|
+
if ($[17] !== t9) {
|
|
142
|
+
t4 = /* @__PURE__ */ jsx("span", {
|
|
143
|
+
className: "graphiql-doc-explorer-argument-type",
|
|
144
|
+
children: t9
|
|
145
|
+
});
|
|
146
|
+
$[17] = t9;
|
|
147
|
+
$[18] = t4;
|
|
148
|
+
} else t4 = $[18];
|
|
149
|
+
t5 = defaultAst && /* @__PURE__ */ jsxs("span", {
|
|
150
|
+
className: "graphiql-doc-explorer-argument-default",
|
|
151
|
+
children: ["= ", print(defaultAst)]
|
|
152
|
+
});
|
|
153
|
+
$[0] = arg.defaultValue;
|
|
154
|
+
$[1] = arg.deprecationReason;
|
|
155
|
+
$[2] = arg.name;
|
|
156
|
+
$[3] = arg.type;
|
|
157
|
+
$[4] = t1;
|
|
158
|
+
$[5] = t2;
|
|
159
|
+
$[6] = t3;
|
|
160
|
+
$[7] = t4;
|
|
161
|
+
$[8] = t5;
|
|
162
|
+
$[9] = t6;
|
|
163
|
+
} else {
|
|
164
|
+
t1 = $[4];
|
|
165
|
+
t2 = $[5];
|
|
166
|
+
t3 = $[6];
|
|
167
|
+
t4 = $[7];
|
|
168
|
+
t5 = $[8];
|
|
169
|
+
t6 = $[9];
|
|
170
|
+
}
|
|
171
|
+
let t7;
|
|
172
|
+
if ($[19] !== t1 || $[20] !== t2 || $[21] !== t3 || $[22] !== t4 || $[23] !== t5) {
|
|
173
|
+
t7 = /* @__PURE__ */ jsxs("div", {
|
|
174
|
+
className: t1,
|
|
175
|
+
children: [
|
|
176
|
+
t2,
|
|
177
|
+
t3,
|
|
178
|
+
t4,
|
|
179
|
+
t5
|
|
180
|
+
]
|
|
181
|
+
});
|
|
182
|
+
$[19] = t1;
|
|
183
|
+
$[20] = t2;
|
|
184
|
+
$[21] = t3;
|
|
185
|
+
$[22] = t4;
|
|
186
|
+
$[23] = t5;
|
|
187
|
+
$[24] = t7;
|
|
188
|
+
} else t7 = $[24];
|
|
189
|
+
let t8;
|
|
190
|
+
if ($[25] !== arg.description) {
|
|
191
|
+
t8 = arg.description && /* @__PURE__ */ jsx("div", {
|
|
192
|
+
className: "graphiql-doc-explorer-argument-desc",
|
|
193
|
+
children: arg.description
|
|
194
|
+
});
|
|
195
|
+
$[25] = arg.description;
|
|
196
|
+
$[26] = t8;
|
|
197
|
+
} else t8 = $[26];
|
|
198
|
+
let t9;
|
|
199
|
+
if ($[27] !== arg.deprecationReason) {
|
|
200
|
+
t9 = arg.deprecationReason ? /* @__PURE__ */ jsx(DeprecationReason, {
|
|
201
|
+
preview: false,
|
|
202
|
+
children: arg.deprecationReason
|
|
203
|
+
}) : null;
|
|
204
|
+
$[27] = arg.deprecationReason;
|
|
205
|
+
$[28] = t9;
|
|
206
|
+
} else t9 = $[28];
|
|
207
|
+
let t10;
|
|
208
|
+
if ($[29] !== t6 || $[30] !== t7 || $[31] !== t8 || $[32] !== t9) {
|
|
209
|
+
t10 = /* @__PURE__ */ jsxs("div", {
|
|
210
|
+
className: t6,
|
|
211
|
+
children: [
|
|
212
|
+
t7,
|
|
213
|
+
t8,
|
|
214
|
+
t9
|
|
215
|
+
]
|
|
216
|
+
});
|
|
217
|
+
$[29] = t6;
|
|
218
|
+
$[30] = t7;
|
|
219
|
+
$[31] = t8;
|
|
220
|
+
$[32] = t9;
|
|
221
|
+
$[33] = t10;
|
|
222
|
+
} else t10 = $[33];
|
|
223
|
+
return t10;
|
|
234
224
|
};
|
|
235
225
|
function _temp(e) {
|
|
236
|
-
|
|
226
|
+
return !e;
|
|
237
227
|
}
|
|
238
228
|
function _temp2(arg) {
|
|
239
|
-
|
|
229
|
+
return /* @__PURE__ */ jsx(ArgumentRow, { arg }, arg.name);
|
|
240
230
|
}
|
|
241
231
|
function _temp3(namedType) {
|
|
242
|
-
|
|
232
|
+
return /* @__PURE__ */ jsx(TypeLink, { type: namedType });
|
|
243
233
|
}
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
//# sourceMappingURL=arguments-list.js.map
|
|
234
|
+
//#endregion
|
|
235
|
+
export { ArgumentsList, ShowDeprecatedArgumentsButton };
|
|
236
|
+
|
|
237
|
+
//# sourceMappingURL=arguments-list.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"arguments-list.js","sources":["../../src/components/arguments-list.tsx"],"sourcesContent":["import { FC, useState } from 'react';\nimport { astFromValue, print, type GraphQLArgument } from 'graphql';\nimport { Button, ChevronDownIcon, ChevronUpIcon } from '@graphiql/react';\nimport { DeprecationReason } from './deprecation-reason';\nimport { TypeLink } from './type-link';\nimport { renderType } from './utils';\nimport './arguments-list.css';\n\ntype ArgumentsListProps = {\n title: 'ARGUMENTS' | 'DEPRECATED ARGUMENTS';\n args: GraphQLArgument[];\n};\n\nexport const ArgumentsList: FC<ArgumentsListProps> = ({ title, args }) => {\n const [expanded, setExpanded] = useState(true);\n\n if (args.length === 0) {\n return null;\n }\n\n return (\n <div className=\"graphiql-doc-explorer-arguments-list\">\n <button\n type=\"button\"\n className=\"graphiql-doc-explorer-arguments-list-header\"\n onClick={() => setExpanded(e => !e)}\n aria-expanded={expanded}\n >\n {expanded ? (\n <ChevronDownIcon aria-hidden=\"true\" />\n ) : (\n <ChevronUpIcon aria-hidden=\"true\" />\n )}\n <span>\n {title}{' '}\n <span className=\"graphiql-doc-explorer-arguments-list-count\">\n · {args.length}\n </span>\n </span>\n </button>\n {expanded && (\n <div className=\"graphiql-doc-explorer-arguments-list-body\">\n {args.map(arg => (\n <ArgumentRow key={arg.name} arg={arg} />\n ))}\n </div>\n )}\n </div>\n );\n};\n\ntype ShowDeprecatedArgumentsButtonProps = {\n onClick: () => void;\n};\n\nexport const ShowDeprecatedArgumentsButton: FC<\n ShowDeprecatedArgumentsButtonProps\n> = ({ onClick }) => (\n <Button\n type=\"button\"\n onClick={onClick}\n className=\"graphiql-doc-explorer-arguments-list-show-deprecated\"\n >\n Show Deprecated Arguments\n </Button>\n);\n\ntype ArgumentRowProps = {\n arg: GraphQLArgument;\n};\n\nconst ArgumentRow: FC<ArgumentRowProps> = ({ arg }) => {\n const defaultAst =\n arg.defaultValue === undefined\n ? null\n : astFromValue(arg.defaultValue, arg.type);\n const isDeprecated = Boolean(arg.deprecationReason);\n\n return (\n <div\n className={[\n 'graphiql-doc-explorer-argument',\n isDeprecated ? 'graphiql-doc-explorer-argument--deprecated' : '',\n ]\n .filter(Boolean)\n .join(' ')}\n >\n <div className=\"graphiql-doc-explorer-argument-sig\">\n <span className=\"graphiql-doc-explorer-argument-name\">{arg.name}</span>\n <span\n className=\"graphiql-doc-explorer-argument-colon\"\n aria-hidden=\"true\"\n >\n :\n </span>\n <span className=\"graphiql-doc-explorer-argument-type\">\n {renderType(arg.type, namedType => (\n <TypeLink type={namedType} />\n ))}\n </span>\n {defaultAst && (\n <span className=\"graphiql-doc-explorer-argument-default\">\n = {print(defaultAst)}\n </span>\n )}\n </div>\n {arg.description && (\n <div className=\"graphiql-doc-explorer-argument-desc\">\n {arg.description}\n </div>\n )}\n {arg.deprecationReason ? (\n <DeprecationReason preview={false}>\n {arg.deprecationReason}\n </DeprecationReason>\n ) : null}\n </div>\n );\n};\n"],"
|
|
1
|
+
{"version":3,"file":"arguments-list.js","names":["FC","useState","astFromValue","print","GraphQLArgument","Button","ChevronDownIcon","ChevronUpIcon","DeprecationReason","TypeLink","renderType","ArgumentsListProps","title","args","ArgumentsList","t0","$","_c","expanded","setExpanded","length","t1","Symbol","for","_temp","t2","t3","t4","t5","t6","map","_temp2","t7","ShowDeprecatedArgumentsButtonProps","onClick","ShowDeprecatedArgumentsButton","ArgumentRowProps","arg","ArgumentRow","defaultValue","deprecationReason","name","type","defaultAst","undefined","isDeprecated","Boolean","t8","filter","join","t9","_temp3","description","t10","e","namedType"],"sources":["../../src/components/arguments-list.tsx"],"sourcesContent":["import { FC, useState } from 'react';\nimport { astFromValue, print, type GraphQLArgument } from 'graphql';\nimport { Button, ChevronDownIcon, ChevronUpIcon } from '@graphiql/react';\nimport { DeprecationReason } from './deprecation-reason';\nimport { TypeLink } from './type-link';\nimport { renderType } from './utils';\nimport './arguments-list.css';\n\ntype ArgumentsListProps = {\n title: 'ARGUMENTS' | 'DEPRECATED ARGUMENTS';\n args: GraphQLArgument[];\n};\n\nexport const ArgumentsList: FC<ArgumentsListProps> = ({ title, args }) => {\n const [expanded, setExpanded] = useState(true);\n\n if (args.length === 0) {\n return null;\n }\n\n return (\n <div className=\"graphiql-doc-explorer-arguments-list\">\n <button\n type=\"button\"\n className=\"graphiql-doc-explorer-arguments-list-header\"\n onClick={() => setExpanded(e => !e)}\n aria-expanded={expanded}\n >\n {expanded ? (\n <ChevronDownIcon aria-hidden=\"true\" />\n ) : (\n <ChevronUpIcon aria-hidden=\"true\" />\n )}\n <span>\n {title}{' '}\n <span className=\"graphiql-doc-explorer-arguments-list-count\">\n · {args.length}\n </span>\n </span>\n </button>\n {expanded && (\n <div className=\"graphiql-doc-explorer-arguments-list-body\">\n {args.map(arg => (\n <ArgumentRow key={arg.name} arg={arg} />\n ))}\n </div>\n )}\n </div>\n );\n};\n\ntype ShowDeprecatedArgumentsButtonProps = {\n onClick: () => void;\n};\n\nexport const ShowDeprecatedArgumentsButton: FC<\n ShowDeprecatedArgumentsButtonProps\n> = ({ onClick }) => (\n <Button\n type=\"button\"\n onClick={onClick}\n className=\"graphiql-doc-explorer-arguments-list-show-deprecated\"\n >\n Show Deprecated Arguments\n </Button>\n);\n\ntype ArgumentRowProps = {\n arg: GraphQLArgument;\n};\n\nconst ArgumentRow: FC<ArgumentRowProps> = ({ arg }) => {\n const defaultAst =\n arg.defaultValue === undefined\n ? null\n : astFromValue(arg.defaultValue, arg.type);\n const isDeprecated = Boolean(arg.deprecationReason);\n\n return (\n <div\n className={[\n 'graphiql-doc-explorer-argument',\n isDeprecated ? 'graphiql-doc-explorer-argument--deprecated' : '',\n ]\n .filter(Boolean)\n .join(' ')}\n >\n <div className=\"graphiql-doc-explorer-argument-sig\">\n <span className=\"graphiql-doc-explorer-argument-name\">{arg.name}</span>\n <span\n className=\"graphiql-doc-explorer-argument-colon\"\n aria-hidden=\"true\"\n >\n :\n </span>\n <span className=\"graphiql-doc-explorer-argument-type\">\n {renderType(arg.type, namedType => (\n <TypeLink type={namedType} />\n ))}\n </span>\n {defaultAst && (\n <span className=\"graphiql-doc-explorer-argument-default\">\n = {print(defaultAst)}\n </span>\n )}\n </div>\n {arg.description && (\n <div className=\"graphiql-doc-explorer-argument-desc\">\n {arg.description}\n </div>\n )}\n {arg.deprecationReason ? (\n <DeprecationReason preview={false}>\n {arg.deprecationReason}\n </DeprecationReason>\n ) : null}\n </div>\n );\n};\n"],"mappings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