@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.
Files changed (47) hide show
  1. package/LICENSE +21 -0
  2. package/dist/components/argument.js +88 -92
  3. package/dist/components/argument.js.map +1 -1
  4. package/dist/components/arguments-list.js +226 -237
  5. package/dist/components/arguments-list.js.map +1 -1
  6. package/dist/components/breadcrumb.js +59 -52
  7. package/dist/components/breadcrumb.js.map +1 -1
  8. package/dist/components/default-value.js +63 -74
  9. package/dist/components/default-value.js.map +1 -1
  10. package/dist/components/deprecation-reason.js +27 -21
  11. package/dist/components/deprecation-reason.js.map +1 -1
  12. package/dist/components/directive.js +20 -23
  13. package/dist/components/directive.js.map +1 -1
  14. package/dist/components/doc-explorer.js +219 -259
  15. package/dist/components/doc-explorer.js.map +1 -1
  16. package/dist/components/field-card.js +103 -97
  17. package/dist/components/field-card.js.map +1 -1
  18. package/dist/components/field-documentation.js +118 -135
  19. package/dist/components/field-documentation.js.map +1 -1
  20. package/dist/components/field-link.js +37 -39
  21. package/dist/components/field-link.js.map +1 -1
  22. package/dist/components/fields-list.js +216 -226
  23. package/dist/components/fields-list.js.map +1 -1
  24. package/dist/components/schema-documentation.js +263 -224
  25. package/dist/components/schema-documentation.js.map +1 -1
  26. package/dist/components/search-row.js +287 -268
  27. package/dist/components/search-row.js.map +1 -1
  28. package/dist/components/search.js +342 -345
  29. package/dist/components/search.js.map +1 -1
  30. package/dist/components/section.js +59 -69
  31. package/dist/components/section.js.map +1 -1
  32. package/dist/components/type-card.js +104 -107
  33. package/dist/components/type-card.js.map +1 -1
  34. package/dist/components/type-documentation.js +340 -363
  35. package/dist/components/type-documentation.js.map +1 -1
  36. package/dist/components/type-link.js +38 -39
  37. package/dist/components/type-link.js.map +1 -1
  38. package/dist/components/utils.js +15 -20
  39. package/dist/components/utils.js.map +1 -1
  40. package/dist/context.js +205 -285
  41. package/dist/context.js.map +1 -1
  42. package/dist/index.js +7 -31
  43. package/dist/schema-reference.js +48 -54
  44. package/dist/schema-reference.js.map +1 -1
  45. package/dist/style.css +24 -28
  46. package/package.json +25 -19
  47. package/dist/index.js.map +0 -1
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) GraphQL Contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -1,96 +1,92 @@
1
- import { jsx, jsxs } from "react/jsx-runtime";
2
- import { c } from "react-compiler-runtime";
3
- import { MarkdownContent } from "@graphiql/react";
4
1
  import { DefaultValue } from "./default-value.js";
5
2
  import { TypeLink } from "./type-link.js";
6
3
  /* empty css */
7
- const Argument = (t0) => {
8
- const $ = c(19);
9
- const {
10
- arg,
11
- showDefaultValue,
12
- inline
13
- } = t0;
14
- let t1;
15
- if ($[0] !== arg.name) {
16
- t1 = /* @__PURE__ */ jsx("span", { className: "graphiql-doc-explorer-argument-name", children: arg.name });
17
- $[0] = arg.name;
18
- $[1] = t1;
19
- } else {
20
- t1 = $[1];
21
- }
22
- let t2;
23
- if ($[2] !== arg.type) {
24
- t2 = /* @__PURE__ */ jsx(TypeLink, { type: arg.type });
25
- $[2] = arg.type;
26
- $[3] = t2;
27
- } else {
28
- t2 = $[3];
29
- }
30
- let t3;
31
- if ($[4] !== arg || $[5] !== showDefaultValue) {
32
- t3 = showDefaultValue !== false && /* @__PURE__ */ jsx(DefaultValue, { field: arg });
33
- $[4] = arg;
34
- $[5] = showDefaultValue;
35
- $[6] = t3;
36
- } else {
37
- t3 = $[6];
38
- }
39
- let t4;
40
- if ($[7] !== t1 || $[8] !== t2 || $[9] !== t3) {
41
- t4 = /* @__PURE__ */ jsxs("span", { children: [
42
- t1,
43
- ": ",
44
- t2,
45
- t3
46
- ] });
47
- $[7] = t1;
48
- $[8] = t2;
49
- $[9] = t3;
50
- $[10] = t4;
51
- } else {
52
- t4 = $[10];
53
- }
54
- const definition = t4;
55
- if (inline) {
56
- return definition;
57
- }
58
- let t5;
59
- if ($[11] !== arg.description) {
60
- t5 = arg.description ? /* @__PURE__ */ jsx(MarkdownContent, { type: "description", children: arg.description }) : null;
61
- $[11] = arg.description;
62
- $[12] = t5;
63
- } else {
64
- t5 = $[12];
65
- }
66
- let t6;
67
- if ($[13] !== arg.deprecationReason) {
68
- t6 = arg.deprecationReason ? /* @__PURE__ */ jsxs("div", { className: "graphiql-doc-explorer-argument-deprecation", children: [
69
- /* @__PURE__ */ jsx("div", { className: "graphiql-doc-explorer-argument-deprecation-label", children: "Deprecated" }),
70
- /* @__PURE__ */ jsx(MarkdownContent, { type: "deprecation", children: arg.deprecationReason })
71
- ] }) : null;
72
- $[13] = arg.deprecationReason;
73
- $[14] = t6;
74
- } else {
75
- t6 = $[14];
76
- }
77
- let t7;
78
- if ($[15] !== definition || $[16] !== t5 || $[17] !== t6) {
79
- t7 = /* @__PURE__ */ jsxs("div", { className: "graphiql-doc-explorer-argument", children: [
80
- definition,
81
- t5,
82
- t6
83
- ] });
84
- $[15] = definition;
85
- $[16] = t5;
86
- $[17] = t6;
87
- $[18] = t7;
88
- } else {
89
- t7 = $[18];
90
- }
91
- return t7;
92
- };
93
- export {
94
- Argument
4
+ import { c } from "react-compiler-runtime";
5
+ import { MarkdownContent } from "@graphiql/react";
6
+ import { jsx, jsxs } from "react/jsx-runtime";
7
+ //#region src/components/argument.tsx
8
+ var Argument = (t0) => {
9
+ const $ = c(19);
10
+ const { arg, showDefaultValue, inline } = t0;
11
+ let t1;
12
+ if ($[0] !== arg.name) {
13
+ t1 = /* @__PURE__ */ jsx("span", {
14
+ className: "graphiql-doc-explorer-argument-name",
15
+ children: arg.name
16
+ });
17
+ $[0] = arg.name;
18
+ $[1] = t1;
19
+ } else t1 = $[1];
20
+ let t2;
21
+ if ($[2] !== arg.type) {
22
+ t2 = /* @__PURE__ */ jsx(TypeLink, { type: arg.type });
23
+ $[2] = arg.type;
24
+ $[3] = t2;
25
+ } else t2 = $[3];
26
+ let t3;
27
+ if ($[4] !== arg || $[5] !== showDefaultValue) {
28
+ t3 = showDefaultValue !== false && /* @__PURE__ */ jsx(DefaultValue, { field: arg });
29
+ $[4] = arg;
30
+ $[5] = showDefaultValue;
31
+ $[6] = t3;
32
+ } else t3 = $[6];
33
+ let t4;
34
+ if ($[7] !== t1 || $[8] !== t2 || $[9] !== t3) {
35
+ t4 = /* @__PURE__ */ jsxs("span", { children: [
36
+ t1,
37
+ ": ",
38
+ t2,
39
+ t3
40
+ ] });
41
+ $[7] = t1;
42
+ $[8] = t2;
43
+ $[9] = t3;
44
+ $[10] = t4;
45
+ } else t4 = $[10];
46
+ const definition = t4;
47
+ if (inline) return definition;
48
+ let t5;
49
+ if ($[11] !== arg.description) {
50
+ t5 = arg.description ? /* @__PURE__ */ jsx(MarkdownContent, {
51
+ type: "description",
52
+ children: arg.description
53
+ }) : null;
54
+ $[11] = arg.description;
55
+ $[12] = t5;
56
+ } else t5 = $[12];
57
+ let t6;
58
+ if ($[13] !== arg.deprecationReason) {
59
+ t6 = arg.deprecationReason ? /* @__PURE__ */ jsxs("div", {
60
+ className: "graphiql-doc-explorer-argument-deprecation",
61
+ children: [/* @__PURE__ */ jsx("div", {
62
+ className: "graphiql-doc-explorer-argument-deprecation-label",
63
+ children: "Deprecated"
64
+ }), /* @__PURE__ */ jsx(MarkdownContent, {
65
+ type: "deprecation",
66
+ children: arg.deprecationReason
67
+ })]
68
+ }) : null;
69
+ $[13] = arg.deprecationReason;
70
+ $[14] = t6;
71
+ } else t6 = $[14];
72
+ let t7;
73
+ if ($[15] !== definition || $[16] !== t5 || $[17] !== t6) {
74
+ t7 = /* @__PURE__ */ jsxs("div", {
75
+ className: "graphiql-doc-explorer-argument",
76
+ children: [
77
+ definition,
78
+ t5,
79
+ t6
80
+ ]
81
+ });
82
+ $[15] = definition;
83
+ $[16] = t5;
84
+ $[17] = t6;
85
+ $[18] = t7;
86
+ } else t7 = $[18];
87
+ return t7;
95
88
  };
96
- //# sourceMappingURL=argument.js.map
89
+ //#endregion
90
+ export { Argument };
91
+
92
+ //# sourceMappingURL=argument.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"argument.js","sources":["../../src/components/argument.tsx"],"sourcesContent":["import type { FC } from 'react';\nimport type { GraphQLArgument } from 'graphql';\nimport { MarkdownContent } from '@graphiql/react';\nimport { DefaultValue } from './default-value';\nimport { TypeLink } from './type-link';\nimport './argument.css';\n\ntype ArgumentProps = {\n /**\n * The argument that should be rendered.\n */\n arg: GraphQLArgument;\n /**\n * Toggle if the default value for the argument is shown (if there is one)\n * @default false\n */\n showDefaultValue?: boolean;\n /**\n * Toggle whether to render the whole argument including description and\n * deprecation reason (`false`) or to just render the argument name, type,\n * and default value in a single line (`true`).\n * @default false\n */\n inline?: boolean;\n};\n\nexport const Argument: FC<ArgumentProps> = ({\n arg,\n showDefaultValue,\n inline,\n}) => {\n const definition = (\n <span>\n <span className=\"graphiql-doc-explorer-argument-name\">{arg.name}</span>\n {': '}\n <TypeLink type={arg.type} />\n {showDefaultValue !== false && <DefaultValue field={arg} />}\n </span>\n );\n if (inline) {\n return definition;\n }\n return (\n <div className=\"graphiql-doc-explorer-argument\">\n {definition}\n {arg.description ? (\n <MarkdownContent type=\"description\">{arg.description}</MarkdownContent>\n ) : null}\n {arg.deprecationReason ? (\n <div className=\"graphiql-doc-explorer-argument-deprecation\">\n <div className=\"graphiql-doc-explorer-argument-deprecation-label\">\n Deprecated\n </div>\n <MarkdownContent type=\"deprecation\">\n {arg.deprecationReason}\n </MarkdownContent>\n </div>\n ) : null}\n </div>\n );\n};\n"],"names":["Argument","t0","$","_c","arg","showDefaultValue","inline","t1","name","t2","type","t3","t4","definition","t5","description","t6","deprecationReason","t7"],"mappings":";;;;;;AA0BO,MAAMA,WAA8BC,CAAA,OAAA;AAAAC,QAAAA,IAAAC,EAAA,EAAA;AAAC,QAAA;AAAA,IAAAC;AAAAA,IAAAC;AAAAA,IAAAC;AAAAA,EAAAA,IAAAL;AAI3CM,MAAAA;AAAA,MAAAL,EAAA,CAAA,MAAAE,IAAAI,MAAA;AAGKD,SAAuE,oBAAA,QAAA,EAAvD,WAAA,uCAAuCH,cAAGI,MAAM;AAAO,MAAA,CAAA,IAAAJ,IAAAI;AAAAN,WAAAK;AAAAA,EAAAA,OAAA;AAAAA,SAAAL,EAAA,CAAA;AAAA,EAAA;AAAAO,MAAAA;AAAA,MAAAP,EAAA,CAAA,MAAAE,IAAAM,MAAA;AAEvED,SAAC,oBAAA,UAAA,EAAe,MAAAL,IAAGM,MAAS;AAAA,MAAA,CAAA,IAAAN,IAAAM;AAAAR,WAAAO;AAAAA,EAAAA,OAAA;AAAAA,SAAAP,EAAA,CAAA;AAAA,EAAA;AAAAS,MAAAA;AAAA,MAAAT,EAAAE,CAAAA,MAAAA,OAAAF,SAAAG,kBAAA;AAC3BM,SAAAN,qBAAgB,SAAe,oBAAA,cAAA,EAAoBD,OAAE,KAAK;AAAAF,WAAAE;AAAAF,WAAAG;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;AAAAA,MAAAA;AAAAA,MACAC;AAAAA,MAGAE;AAAAA,IAAAA,GAUH;AAAMd,YAAAW;AAAAX,YAAAY;AAAAZ,YAAAc;AAAAd,YAAAgB;AAAAA,EAAAA,OAAA;AAAAA,SAAAhB,EAAA,EAAA;AAAA,EAAA;AAfNgB,SAAAA;AAeM;"}
1
+ {"version":3,"file":"argument.js","names":["FC","GraphQLArgument","MarkdownContent","DefaultValue","TypeLink","ArgumentProps","arg","showDefaultValue","inline","Argument","t0","$","_c","t1","name","t2","type","t3","t4","definition","t5","description","t6","deprecationReason","t7"],"sources":["../../src/components/argument.tsx"],"sourcesContent":["import type { FC } from 'react';\nimport type { GraphQLArgument } from 'graphql';\nimport { MarkdownContent } from '@graphiql/react';\nimport { DefaultValue } from './default-value';\nimport { TypeLink } from './type-link';\nimport './argument.css';\n\ntype ArgumentProps = {\n /**\n * The argument that should be rendered.\n */\n arg: GraphQLArgument;\n /**\n * Toggle if the default value for the argument is shown (if there is one)\n * @default false\n */\n showDefaultValue?: boolean;\n /**\n * Toggle whether to render the whole argument including description and\n * deprecation reason (`false`) or to just render the argument name, type,\n * and default value in a single line (`true`).\n * @default false\n */\n inline?: boolean;\n};\n\nexport const Argument: FC<ArgumentProps> = ({\n arg,\n showDefaultValue,\n inline,\n}) => {\n const definition = (\n <span>\n <span className=\"graphiql-doc-explorer-argument-name\">{arg.name}</span>\n {': '}\n <TypeLink type={arg.type} />\n {showDefaultValue !== false && <DefaultValue field={arg} />}\n </span>\n );\n if (inline) {\n return definition;\n }\n return (\n <div className=\"graphiql-doc-explorer-argument\">\n {definition}\n {arg.description ? (\n <MarkdownContent type=\"description\">{arg.description}</MarkdownContent>\n ) : null}\n {arg.deprecationReason ? (\n <div className=\"graphiql-doc-explorer-argument-deprecation\">\n <div className=\"graphiql-doc-explorer-argument-deprecation-label\">\n Deprecated\n </div>\n <MarkdownContent type=\"deprecation\">\n {arg.deprecationReason}\n </MarkdownContent>\n </div>\n ) : null}\n </div>\n );\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