@graphiql/plugin-doc-explorer 1.0.0-beta.1 → 1.0.0-beta.3
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,102 +1,108 @@
|
|
|
1
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { c } from "react-compiler-runtime";
|
|
3
|
-
import { DeprecationReason } from "./deprecation-reason.js";
|
|
4
|
-
import { TypeLink } from "./type-link.js";
|
|
5
1
|
import { renderType } from "./utils.js";
|
|
2
|
+
import { TypeLink } from "./type-link.js";
|
|
3
|
+
import { DeprecationReason } from "./deprecation-reason.js";
|
|
6
4
|
/* empty css */
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
5
|
+
import { c } from "react-compiler-runtime";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
//#region src/components/field-card.tsx
|
|
8
|
+
var FieldCard = (t0) => {
|
|
9
|
+
const $ = c(19);
|
|
10
|
+
const { field } = t0;
|
|
11
|
+
let t1;
|
|
12
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
13
|
+
t1 = /* @__PURE__ */ jsx("span", {
|
|
14
|
+
className: "graphiql-doc-explorer-type-badge",
|
|
15
|
+
children: "FIELD"
|
|
16
|
+
});
|
|
17
|
+
$[0] = t1;
|
|
18
|
+
} else t1 = $[0];
|
|
19
|
+
let t2;
|
|
20
|
+
if ($[1] !== field.name) {
|
|
21
|
+
t2 = /* @__PURE__ */ jsx("span", {
|
|
22
|
+
className: "graphiql-doc-explorer-field-card-name",
|
|
23
|
+
children: field.name
|
|
24
|
+
});
|
|
25
|
+
$[1] = field.name;
|
|
26
|
+
$[2] = t2;
|
|
27
|
+
} else t2 = $[2];
|
|
28
|
+
let t3;
|
|
29
|
+
if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
|
|
30
|
+
t3 = /* @__PURE__ */ jsx("span", {
|
|
31
|
+
className: "graphiql-doc-explorer-field-card-colon",
|
|
32
|
+
"aria-hidden": "true",
|
|
33
|
+
children: ":"
|
|
34
|
+
});
|
|
35
|
+
$[3] = t3;
|
|
36
|
+
} else t3 = $[3];
|
|
37
|
+
let t4;
|
|
38
|
+
if ($[4] !== field.type) {
|
|
39
|
+
t4 = renderType(field.type, _temp);
|
|
40
|
+
$[4] = field.type;
|
|
41
|
+
$[5] = t4;
|
|
42
|
+
} else t4 = $[5];
|
|
43
|
+
let t5;
|
|
44
|
+
if ($[6] !== t4) {
|
|
45
|
+
t5 = /* @__PURE__ */ jsx("span", {
|
|
46
|
+
className: "graphiql-doc-explorer-field-card-type",
|
|
47
|
+
children: t4
|
|
48
|
+
});
|
|
49
|
+
$[6] = t4;
|
|
50
|
+
$[7] = t5;
|
|
51
|
+
} else t5 = $[7];
|
|
52
|
+
let t6;
|
|
53
|
+
if ($[8] !== t2 || $[9] !== t5) {
|
|
54
|
+
t6 = /* @__PURE__ */ jsxs("div", {
|
|
55
|
+
className: "graphiql-doc-explorer-field-card-header",
|
|
56
|
+
children: [
|
|
57
|
+
t1,
|
|
58
|
+
t2,
|
|
59
|
+
t3,
|
|
60
|
+
t5
|
|
61
|
+
]
|
|
62
|
+
});
|
|
63
|
+
$[8] = t2;
|
|
64
|
+
$[9] = t5;
|
|
65
|
+
$[10] = t6;
|
|
66
|
+
} else t6 = $[10];
|
|
67
|
+
let t7;
|
|
68
|
+
if ($[11] !== field.description) {
|
|
69
|
+
t7 = field.description && /* @__PURE__ */ jsx("p", {
|
|
70
|
+
className: "graphiql-doc-explorer-field-card-description",
|
|
71
|
+
children: field.description
|
|
72
|
+
});
|
|
73
|
+
$[11] = field.description;
|
|
74
|
+
$[12] = t7;
|
|
75
|
+
} else t7 = $[12];
|
|
76
|
+
let t8;
|
|
77
|
+
if ($[13] !== field) {
|
|
78
|
+
t8 = "deprecationReason" in field && field.deprecationReason ? /* @__PURE__ */ jsx(DeprecationReason, {
|
|
79
|
+
preview: false,
|
|
80
|
+
children: field.deprecationReason
|
|
81
|
+
}) : null;
|
|
82
|
+
$[13] = field;
|
|
83
|
+
$[14] = t8;
|
|
84
|
+
} else t8 = $[14];
|
|
85
|
+
let t9;
|
|
86
|
+
if ($[15] !== t6 || $[16] !== t7 || $[17] !== t8) {
|
|
87
|
+
t9 = /* @__PURE__ */ jsxs("div", {
|
|
88
|
+
className: "graphiql-doc-explorer-field-card",
|
|
89
|
+
children: [
|
|
90
|
+
t6,
|
|
91
|
+
t7,
|
|
92
|
+
t8
|
|
93
|
+
]
|
|
94
|
+
});
|
|
95
|
+
$[15] = t6;
|
|
96
|
+
$[16] = t7;
|
|
97
|
+
$[17] = t8;
|
|
98
|
+
$[18] = t9;
|
|
99
|
+
} else t9 = $[18];
|
|
100
|
+
return t9;
|
|
95
101
|
};
|
|
96
102
|
function _temp(namedType) {
|
|
97
|
-
|
|
103
|
+
return /* @__PURE__ */ jsx(TypeLink, { type: namedType });
|
|
98
104
|
}
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
//# sourceMappingURL=field-card.js.map
|
|
105
|
+
//#endregion
|
|
106
|
+
export { FieldCard };
|
|
107
|
+
|
|
108
|
+
//# sourceMappingURL=field-card.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"field-card.js","sources":["../../src/components/field-card.tsx"],"sourcesContent":["import type { FC } from 'react';\nimport type { DocExplorerFieldDef } from '../context';\nimport { DeprecationReason } from './deprecation-reason';\nimport { TypeLink } from './type-link';\nimport { renderType } from './utils';\nimport './field-card.css';\n\ntype FieldCardProps = {\n field: DocExplorerFieldDef;\n};\n\nexport const FieldCard: FC<FieldCardProps> = ({ field }) => {\n return (\n <div className=\"graphiql-doc-explorer-field-card\">\n <div className=\"graphiql-doc-explorer-field-card-header\">\n <span className=\"graphiql-doc-explorer-type-badge\">FIELD</span>\n <span className=\"graphiql-doc-explorer-field-card-name\">\n {field.name}\n </span>\n <span\n className=\"graphiql-doc-explorer-field-card-colon\"\n aria-hidden=\"true\"\n >\n :\n </span>\n <span className=\"graphiql-doc-explorer-field-card-type\">\n {renderType(field.type, namedType => (\n <TypeLink type={namedType} />\n ))}\n </span>\n </div>\n {field.description && (\n <p className=\"graphiql-doc-explorer-field-card-description\">\n {field.description}\n </p>\n )}\n {'deprecationReason' in field && field.deprecationReason ? (\n <DeprecationReason preview={false}>\n {field.deprecationReason}\n </DeprecationReason>\n ) : null}\n </div>\n );\n};\n"],"
|
|
1
|
+
{"version":3,"file":"field-card.js","names":["FC","DocExplorerFieldDef","DeprecationReason","TypeLink","renderType","FieldCardProps","field","FieldCard","t0","$","_c","t1","Symbol","for","t2","name","t3","t4","type","_temp","t5","t6","t7","description","t8","deprecationReason","t9","namedType"],"sources":["../../src/components/field-card.tsx"],"sourcesContent":["import type { FC } from 'react';\nimport type { DocExplorerFieldDef } from '../context';\nimport { DeprecationReason } from './deprecation-reason';\nimport { TypeLink } from './type-link';\nimport { renderType } from './utils';\nimport './field-card.css';\n\ntype FieldCardProps = {\n field: DocExplorerFieldDef;\n};\n\nexport const FieldCard: FC<FieldCardProps> = ({ field }) => {\n return (\n <div className=\"graphiql-doc-explorer-field-card\">\n <div className=\"graphiql-doc-explorer-field-card-header\">\n <span className=\"graphiql-doc-explorer-type-badge\">FIELD</span>\n <span className=\"graphiql-doc-explorer-field-card-name\">\n {field.name}\n </span>\n <span\n className=\"graphiql-doc-explorer-field-card-colon\"\n aria-hidden=\"true\"\n >\n :\n </span>\n <span className=\"graphiql-doc-explorer-field-card-type\">\n {renderType(field.type, namedType => (\n <TypeLink type={namedType} />\n ))}\n </span>\n </div>\n {field.description && (\n <p className=\"graphiql-doc-explorer-field-card-description\">\n {field.description}\n </p>\n )}\n {'deprecationReason' in field && field.deprecationReason ? (\n <DeprecationReason preview={false}>\n {field.deprecationReason}\n </DeprecationReason>\n ) : null}\n </div>\n );\n};\n"],"mappings":";;;;;;;AAWA,IAAaO,aAAgCC,OAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CAAC,MAAA,EAAAJ,UAAAE;CAAS,IAAAG;CAAA,IAAAF,EAAA,OAAAG,OAAAC,IAAA,2BAAA,GAAA;EAI/CF,KAAA,oBAAA,QAAA;GAAgB,WAAA;GAAmC,UAAA;EAAY,CAAA;EAAAF,EAAA,KAAAE;CAAA,OAAAA,KAAAF,EAAA;CAAA,IAAAK;CAAA,IAAAL,EAAA,OAAAH,MAAAS,MAAA;EAC/DD,KAAA,oBAAA,QAAA;GAAgB,WAAA;GACbR,UAAAA,MAAK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AA,IAEE;EACdhB,EAAA,MAAAH;EAAAG,EAAA,MAAAe;CAAA,OAAAA,KAAAf,EAAA;CAAA,IAAAiB;CAAA,IAAAjB,EAAA,QAAAY,MAAAZ,EAAA,QAAAa,MAAAb,EAAA,QAAAe,IAAA;EA3BVE,KAAA,qBAAA,OAAA;GAAe,WAAA;GAAf,UAAA;IACEL;IAiBCC;IAKAE;GAKG;;EAAAf,EAAA,MAAAY;EAAAZ,EAAA,MAAAa;EAAAb,EAAA,MAAAe;EAAAf,EAAA,MAAAiB;CAAA,OAAAA,KAAAjB,EAAA;CAAA,OA5BNiB;AA4BM;AA9BmC,SAAAP,MAAAQ,WAAA;CAAA,OAgBjC,oBAAC,UAAD,EAAgBA,MAAAA,UAAS,CAAA;AAAI"}
|
|
@@ -1,143 +1,126 @@
|
|
|
1
|
-
import { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
2
|
-
import { c } from "react-compiler-runtime";
|
|
3
|
-
import { useState } from "react";
|
|
4
1
|
import { ArgumentsList, ShowDeprecatedArgumentsButton } from "./arguments-list.js";
|
|
5
2
|
import { Directive } from "./directive.js";
|
|
6
3
|
import { FieldCard } from "./field-card.js";
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
4
|
+
import { c } from "react-compiler-runtime";
|
|
5
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import { useState } from "react";
|
|
7
|
+
//#region src/components/field-documentation.tsx
|
|
8
|
+
var FieldDocumentation = (t0) => {
|
|
9
|
+
const $ = c(2);
|
|
10
|
+
const { field } = t0;
|
|
11
|
+
let t1;
|
|
12
|
+
if ($[0] !== field) {
|
|
13
|
+
t1 = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
14
|
+
/* @__PURE__ */ jsx(FieldCard, { field }),
|
|
15
|
+
/* @__PURE__ */ jsx(Arguments, { field }),
|
|
16
|
+
/* @__PURE__ */ jsx(Directives, { field })
|
|
17
|
+
] });
|
|
18
|
+
$[0] = field;
|
|
19
|
+
$[1] = t1;
|
|
20
|
+
} else t1 = $[1];
|
|
21
|
+
return t1;
|
|
25
22
|
};
|
|
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
|
-
t1,
|
|
72
|
-
t2
|
|
73
|
-
] });
|
|
74
|
-
$[8] = t1;
|
|
75
|
-
$[9] = t2;
|
|
76
|
-
$[10] = t3;
|
|
77
|
-
} else {
|
|
78
|
-
t3 = $[10];
|
|
79
|
-
}
|
|
80
|
-
return t3;
|
|
23
|
+
var Arguments = (t0) => {
|
|
24
|
+
const $ = c(11);
|
|
25
|
+
const { field } = t0;
|
|
26
|
+
const [showDeprecated, setShowDeprecated] = useState(false);
|
|
27
|
+
if (!("args" in field)) return null;
|
|
28
|
+
let args;
|
|
29
|
+
let deprecatedArgs;
|
|
30
|
+
let t1;
|
|
31
|
+
if ($[0] !== field.args) {
|
|
32
|
+
args = [];
|
|
33
|
+
deprecatedArgs = [];
|
|
34
|
+
for (const argument of field.args) if (argument.deprecationReason) deprecatedArgs.push(argument);
|
|
35
|
+
else args.push(argument);
|
|
36
|
+
t1 = /* @__PURE__ */ jsx(ArgumentsList, {
|
|
37
|
+
title: "ARGUMENTS",
|
|
38
|
+
args
|
|
39
|
+
});
|
|
40
|
+
$[0] = field.args;
|
|
41
|
+
$[1] = args;
|
|
42
|
+
$[2] = deprecatedArgs;
|
|
43
|
+
$[3] = t1;
|
|
44
|
+
} else {
|
|
45
|
+
args = $[1];
|
|
46
|
+
deprecatedArgs = $[2];
|
|
47
|
+
t1 = $[3];
|
|
48
|
+
}
|
|
49
|
+
let t2;
|
|
50
|
+
if ($[4] !== args || $[5] !== deprecatedArgs || $[6] !== showDeprecated) {
|
|
51
|
+
t2 = deprecatedArgs.length > 0 && (showDeprecated || args.length === 0 ? /* @__PURE__ */ jsx(ArgumentsList, {
|
|
52
|
+
title: "DEPRECATED ARGUMENTS",
|
|
53
|
+
args: deprecatedArgs
|
|
54
|
+
}) : /* @__PURE__ */ jsx(ShowDeprecatedArgumentsButton, { onClick: () => setShowDeprecated(true) }));
|
|
55
|
+
$[4] = args;
|
|
56
|
+
$[5] = deprecatedArgs;
|
|
57
|
+
$[6] = showDeprecated;
|
|
58
|
+
$[7] = t2;
|
|
59
|
+
} else t2 = $[7];
|
|
60
|
+
let t3;
|
|
61
|
+
if ($[8] !== t1 || $[9] !== t2) {
|
|
62
|
+
t3 = /* @__PURE__ */ jsxs(Fragment, { children: [t1, t2] });
|
|
63
|
+
$[8] = t1;
|
|
64
|
+
$[9] = t2;
|
|
65
|
+
$[10] = t3;
|
|
66
|
+
} else t3 = $[10];
|
|
67
|
+
return t3;
|
|
81
68
|
};
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
$[6] = t1;
|
|
130
|
-
$[7] = t3;
|
|
131
|
-
$[8] = t4;
|
|
132
|
-
} else {
|
|
133
|
-
t4 = $[8];
|
|
134
|
-
}
|
|
135
|
-
return t4;
|
|
69
|
+
var Directives = (t0) => {
|
|
70
|
+
const $ = c(9);
|
|
71
|
+
const { field } = t0;
|
|
72
|
+
const directives = field.astNode?.directives;
|
|
73
|
+
if (!directives?.length) return null;
|
|
74
|
+
let t1;
|
|
75
|
+
if ($[0] !== directives.length) {
|
|
76
|
+
t1 = /* @__PURE__ */ jsxs("div", {
|
|
77
|
+
className: "graphiql-doc-explorer-directives-list-header",
|
|
78
|
+
children: [
|
|
79
|
+
"DIRECTIVES",
|
|
80
|
+
" ",
|
|
81
|
+
/* @__PURE__ */ jsxs("span", {
|
|
82
|
+
className: "graphiql-doc-explorer-directives-list-count",
|
|
83
|
+
children: ["· ", directives.length]
|
|
84
|
+
})
|
|
85
|
+
]
|
|
86
|
+
});
|
|
87
|
+
$[0] = directives.length;
|
|
88
|
+
$[1] = t1;
|
|
89
|
+
} else t1 = $[1];
|
|
90
|
+
let t2;
|
|
91
|
+
if ($[2] !== directives) {
|
|
92
|
+
t2 = directives.map(_temp);
|
|
93
|
+
$[2] = directives;
|
|
94
|
+
$[3] = t2;
|
|
95
|
+
} else t2 = $[3];
|
|
96
|
+
let t3;
|
|
97
|
+
if ($[4] !== t2) {
|
|
98
|
+
t3 = /* @__PURE__ */ jsx("div", {
|
|
99
|
+
className: "graphiql-doc-explorer-directives-list-body",
|
|
100
|
+
children: t2
|
|
101
|
+
});
|
|
102
|
+
$[4] = t2;
|
|
103
|
+
$[5] = t3;
|
|
104
|
+
} else t3 = $[5];
|
|
105
|
+
let t4;
|
|
106
|
+
if ($[6] !== t1 || $[7] !== t3) {
|
|
107
|
+
t4 = /* @__PURE__ */ jsxs("div", {
|
|
108
|
+
className: "graphiql-doc-explorer-directives-list",
|
|
109
|
+
children: [t1, t3]
|
|
110
|
+
});
|
|
111
|
+
$[6] = t1;
|
|
112
|
+
$[7] = t3;
|
|
113
|
+
$[8] = t4;
|
|
114
|
+
} else t4 = $[8];
|
|
115
|
+
return t4;
|
|
136
116
|
};
|
|
137
117
|
function _temp(directive) {
|
|
138
|
-
|
|
118
|
+
return /* @__PURE__ */ jsx("div", {
|
|
119
|
+
className: "graphiql-doc-explorer-directive-row",
|
|
120
|
+
children: /* @__PURE__ */ jsx(Directive, { directive })
|
|
121
|
+
}, directive.name.value);
|
|
139
122
|
}
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
//# sourceMappingURL=field-documentation.js.map
|
|
123
|
+
//#endregion
|
|
124
|
+
export { FieldDocumentation };
|
|
125
|
+
|
|
126
|
+
//# sourceMappingURL=field-documentation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"field-documentation.js","sources":["../../src/components/field-documentation.tsx"],"sourcesContent":["import type { ConstDirectiveNode, GraphQLArgument } from 'graphql';\nimport { FC, useState } from 'react';\nimport type { DocExplorerFieldDef } from '../context';\nimport { ArgumentsList, ShowDeprecatedArgumentsButton } from './arguments-list';\nimport { Directive } from './directive';\nimport { FieldCard } from './field-card';\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 <FieldCard field={field} />\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\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 <ArgumentsList title=\"ARGUMENTS\" args={args} />\n {deprecatedArgs.length > 0 &&\n (showDeprecated || args.length === 0 ? (\n <ArgumentsList title=\"DEPRECATED ARGUMENTS\" args={deprecatedArgs} />\n ) : (\n <ShowDeprecatedArgumentsButton\n onClick={() => setShowDeprecated(true)}\n />\n ))}\n </>\n );\n};\n\nconst Directives: FC<{ field: DocExplorerFieldDef }> = ({ field }) => {\n const directives = field.astNode?.directives as\n | readonly ConstDirectiveNode[]\n | undefined;\n if (!directives?.length) {\n return null;\n }\n return (\n <div className=\"graphiql-doc-explorer-directives-list\">\n <div className=\"graphiql-doc-explorer-directives-list-header\">\n DIRECTIVES{' '}\n <span className=\"graphiql-doc-explorer-directives-list-count\">\n · {directives.length}\n </span>\n </div>\n <div className=\"graphiql-doc-explorer-directives-list-body\">\n {directives.map(directive => (\n <div\n key={directive.name.value}\n className=\"graphiql-doc-explorer-directive-row\"\n >\n <Directive directive={directive} />\n </div>\n ))}\n </div>\n </div>\n );\n};\n"],"
|
|
1
|
+
{"version":3,"file":"field-documentation.js","names":["ConstDirectiveNode","GraphQLArgument","FC","useState","DocExplorerFieldDef","ArgumentsList","ShowDeprecatedArgumentsButton","Directive","FieldCard","FieldDocumentationProps","field","FieldDocumentation","t0","$","_c","t1","Arguments","showDeprecated","setShowDeprecated","args","deprecatedArgs","argument","deprecationReason","push","t2","length","t3","Directives","directives","astNode","map","_temp","t4","directive","name","value"],"sources":["../../src/components/field-documentation.tsx"],"sourcesContent":["import type { ConstDirectiveNode, GraphQLArgument } from 'graphql';\nimport { FC, useState } from 'react';\nimport type { DocExplorerFieldDef } from '../context';\nimport { ArgumentsList, ShowDeprecatedArgumentsButton } from './arguments-list';\nimport { Directive } from './directive';\nimport { FieldCard } from './field-card';\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 <FieldCard field={field} />\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\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 <ArgumentsList title=\"ARGUMENTS\" args={args} />\n {deprecatedArgs.length > 0 &&\n (showDeprecated || args.length === 0 ? (\n <ArgumentsList title=\"DEPRECATED ARGUMENTS\" args={deprecatedArgs} />\n ) : (\n <ShowDeprecatedArgumentsButton\n onClick={() => setShowDeprecated(true)}\n />\n ))}\n </>\n );\n};\n\nconst Directives: FC<{ field: DocExplorerFieldDef }> = ({ field }) => {\n const directives = field.astNode?.directives as\n | readonly ConstDirectiveNode[]\n | undefined;\n if (!directives?.length) {\n return null;\n }\n return (\n <div className=\"graphiql-doc-explorer-directives-list\">\n <div className=\"graphiql-doc-explorer-directives-list-header\">\n DIRECTIVES{' '}\n <span className=\"graphiql-doc-explorer-directives-list-count\">\n · {directives.length}\n </span>\n </div>\n <div className=\"graphiql-doc-explorer-directives-list-body\">\n {directives.map(directive => (\n <div\n key={directive.name.value}\n className=\"graphiql-doc-explorer-directive-row\"\n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,OAAAA,KAAAb,EAAA;CAAA,IAAAmB;CAAA,IAAAnB,EAAA,OAAAE,MAAAF,EAAA,OAAAa,IAAA;EAhBRM,KAAA,qBAAA,OAAA;GAAe,WAAA;GAAf,UAAA,CACEjB,IAMAW,EAUI;;EAAAb,EAAA,KAAAE;EAAAF,EAAA,KAAAa;EAAAb,EAAA,KAAAmB;CAAA,OAAAA,KAAAnB,EAAA;CAAA,OAjBNmB;AAiBM;AAzB6C,SAAAD,MAAAE,WAAA;CAAA,OAiB7C,oBAAA,OAAA;EAEY,WAAA;EAEV,UAAA,oBAAC,WAAD,EAAsBA,UAAS,CAAA;CAC3B,GAJCA,UAASC,KAAAC,KAIV;AAAA"}
|
|
@@ -1,42 +1,40 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { c } from "react-compiler-runtime";
|
|
3
1
|
import { useDocExplorerActions } from "../context.js";
|
|
4
2
|
/* empty css */
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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
|
-
export {
|
|
40
|
-
FieldLink
|
|
3
|
+
import { c } from "react-compiler-runtime";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
//#region src/components/field-link.tsx
|
|
6
|
+
var FieldLink = (t0) => {
|
|
7
|
+
const $ = c(6);
|
|
8
|
+
const { field } = t0;
|
|
9
|
+
const { push } = useDocExplorerActions();
|
|
10
|
+
let t1;
|
|
11
|
+
if ($[0] !== field || $[1] !== push) {
|
|
12
|
+
t1 = (event) => {
|
|
13
|
+
event.preventDefault();
|
|
14
|
+
push({
|
|
15
|
+
name: field.name,
|
|
16
|
+
def: field
|
|
17
|
+
});
|
|
18
|
+
};
|
|
19
|
+
$[0] = field;
|
|
20
|
+
$[1] = push;
|
|
21
|
+
$[2] = t1;
|
|
22
|
+
} else t1 = $[2];
|
|
23
|
+
let t2;
|
|
24
|
+
if ($[3] !== field.name || $[4] !== t1) {
|
|
25
|
+
t2 = /* @__PURE__ */ jsx("a", {
|
|
26
|
+
className: "graphiql-doc-explorer-field-name",
|
|
27
|
+
onClick: t1,
|
|
28
|
+
href: "#",
|
|
29
|
+
children: field.name
|
|
30
|
+
});
|
|
31
|
+
$[3] = field.name;
|
|
32
|
+
$[4] = t1;
|
|
33
|
+
$[5] = t2;
|
|
34
|
+
} else t2 = $[5];
|
|
35
|
+
return t2;
|
|
41
36
|
};
|
|
42
|
-
//#
|
|
37
|
+
//#endregion
|
|
38
|
+
export { FieldLink };
|
|
39
|
+
|
|
40
|
+
//# sourceMappingURL=field-link.js.map
|