@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
@@ -1,365 +1,362 @@
1
- import { jsxs, jsx, Fragment } from "react/jsx-runtime";
2
- import { c } from "react-compiler-runtime";
3
- import { isObjectType, isInterfaceType, isInputObjectType } from "graphql";
4
- import { useRef, useState, useEffect } from "react";
5
- import { ComboboxOptions, ComboboxOption, ComboboxInput, Combobox } from "@headlessui/react";
6
- import { debounce, formatShortcutForOS, KEY_MAP, useGraphiQL, MagnifyingGlassIcon, KeycapHint } from "@graphiql/react";
7
1
  import { useDocExplorer, useDocExplorerActions } from "../context.js";
8
2
  import { renderType } from "./utils.js";
9
3
  /* empty css */
10
- const Search = () => {
11
- const $ = c(39);
12
- const explorerNavStack = useDocExplorer();
13
- const {
14
- push
15
- } = useDocExplorerActions();
16
- const inputRef = useRef(null);
17
- const getSearchResults = useSearchResults();
18
- const [searchValue, setSearchValue] = useState("");
19
- let t0;
20
- if ($[0] !== getSearchResults || $[1] !== searchValue) {
21
- t0 = () => getSearchResults(searchValue);
22
- $[0] = getSearchResults;
23
- $[1] = searchValue;
24
- $[2] = t0;
25
- } else {
26
- t0 = $[2];
27
- }
28
- const [results, setResults] = useState(t0);
29
- const [isFocused, setIsFocused] = useState(false);
30
- let t1;
31
- if ($[3] !== getSearchResults) {
32
- t1 = debounce(200, (search) => {
33
- setResults(getSearchResults(search));
34
- });
35
- $[3] = getSearchResults;
36
- $[4] = t1;
37
- } else {
38
- t1 = $[4];
39
- }
40
- const debouncedGetSearchResults = t1;
41
- let t2;
42
- let t3;
43
- if ($[5] !== debouncedGetSearchResults || $[6] !== searchValue) {
44
- t2 = () => {
45
- debouncedGetSearchResults(searchValue);
46
- };
47
- t3 = [debouncedGetSearchResults, searchValue];
48
- $[5] = debouncedGetSearchResults;
49
- $[6] = searchValue;
50
- $[7] = t2;
51
- $[8] = t3;
52
- } else {
53
- t2 = $[7];
54
- t3 = $[8];
55
- }
56
- useEffect(t2, t3);
57
- let navItem;
58
- let onSelect;
59
- let shortcutKeys;
60
- let t4;
61
- if ($[9] !== explorerNavStack || $[10] !== push) {
62
- navItem = explorerNavStack.at(-1);
63
- let t52;
64
- if ($[15] !== push) {
65
- t52 = (def) => {
66
- if (!def) {
67
- return;
68
- }
69
- push("field" in def ? {
70
- name: def.field.name,
71
- def: def.field
72
- } : {
73
- name: def.type.name,
74
- def: def.type
75
- });
76
- };
77
- $[15] = push;
78
- $[16] = t52;
79
- } else {
80
- t52 = $[16];
81
- }
82
- onSelect = t52;
83
- let t62;
84
- if ($[17] === Symbol.for("react.memo_cache_sentinel")) {
85
- t62 = formatShortcutForOS(KEY_MAP.searchInDocs.key).split("-");
86
- $[17] = t62;
87
- } else {
88
- t62 = $[17];
89
- }
90
- shortcutKeys = t62;
91
- t4 = explorerNavStack.length === 1 || isObjectType(navItem.def) || isInterfaceType(navItem.def) || isInputObjectType(navItem.def);
92
- $[9] = explorerNavStack;
93
- $[10] = push;
94
- $[11] = navItem;
95
- $[12] = onSelect;
96
- $[13] = shortcutKeys;
97
- $[14] = t4;
98
- } else {
99
- navItem = $[11];
100
- onSelect = $[12];
101
- shortcutKeys = $[13];
102
- t4 = $[14];
103
- }
104
- const shouldSearchBoxAppear = t4;
105
- if (!shouldSearchBoxAppear) {
106
- return null;
107
- }
108
- const t5 = isFocused ? void 0 : "idle";
109
- const t6 = `Search ${navItem.name}...`;
110
- let t7;
111
- let t8;
112
- if ($[18] === Symbol.for("react.memo_cache_sentinel")) {
113
- t7 = () => {
114
- inputRef.current.focus();
115
- };
116
- t8 = /* @__PURE__ */ jsx(MagnifyingGlassIcon, { "aria-hidden": "true" });
117
- $[18] = t7;
118
- $[19] = t8;
119
- } else {
120
- t7 = $[18];
121
- t8 = $[19];
122
- }
123
- let t10;
124
- let t11;
125
- let t9;
126
- if ($[20] === Symbol.for("react.memo_cache_sentinel")) {
127
- t9 = (event) => setSearchValue(event.target.value);
128
- t10 = () => setIsFocused(true);
129
- t11 = () => setIsFocused(false);
130
- $[20] = t10;
131
- $[21] = t11;
132
- $[22] = t9;
133
- } else {
134
- t10 = $[20];
135
- t11 = $[21];
136
- t9 = $[22];
137
- }
138
- let t12;
139
- if ($[23] !== searchValue) {
140
- t12 = /* @__PURE__ */ jsx(ComboboxInput, { autoComplete: "off", onChange: t9, onFocus: t10, onBlur: t11, placeholder: "Search Docs", ref: inputRef, value: searchValue, "data-cy": "doc-explorer-input" });
141
- $[23] = searchValue;
142
- $[24] = t12;
143
- } else {
144
- t12 = $[24];
145
- }
146
- let t13;
147
- if ($[25] !== shortcutKeys) {
148
- t13 = /* @__PURE__ */ jsx(KeycapHint, { keys: shortcutKeys, ariaLabel: "Search docs shortcut" });
149
- $[25] = shortcutKeys;
150
- $[26] = t13;
151
- } else {
152
- t13 = $[26];
153
- }
154
- let t14;
155
- if ($[27] !== t12 || $[28] !== t13) {
156
- t14 = /* @__PURE__ */ jsxs("div", { className: "graphiql-doc-explorer-search-input", onClick: t7, children: [
157
- t8,
158
- t12,
159
- t13
160
- ] });
161
- $[27] = t12;
162
- $[28] = t13;
163
- $[29] = t14;
164
- } else {
165
- t14 = $[29];
166
- }
167
- let t15;
168
- if ($[30] !== isFocused || $[31] !== results) {
169
- t15 = isFocused && /* @__PURE__ */ jsxs(ComboboxOptions, { "data-cy": "doc-explorer-list", children: [
170
- results.within.length + results.types.length + results.fields.length === 0 ? /* @__PURE__ */ jsx("div", { className: "graphiql-doc-explorer-search-empty", children: "No results found" }) : results.within.map(_temp),
171
- results.within.length > 0 && results.types.length + results.fields.length > 0 ? /* @__PURE__ */ jsx("div", { className: "graphiql-doc-explorer-search-divider", children: "Other results" }) : null,
172
- results.types.map(_temp2),
173
- results.fields.map(_temp3)
174
- ] });
175
- $[30] = isFocused;
176
- $[31] = results;
177
- $[32] = t15;
178
- } else {
179
- t15 = $[32];
180
- }
181
- let t16;
182
- if ($[33] !== onSelect || $[34] !== t14 || $[35] !== t15 || $[36] !== t5 || $[37] !== t6) {
183
- t16 = /* @__PURE__ */ jsxs(Combobox, { as: "div", className: "graphiql-doc-explorer-search", onChange: onSelect, "data-state": t5, "aria-label": t6, children: [
184
- t14,
185
- t15
186
- ] });
187
- $[33] = onSelect;
188
- $[34] = t14;
189
- $[35] = t15;
190
- $[36] = t5;
191
- $[37] = t6;
192
- $[38] = t16;
193
- } else {
194
- t16 = $[38];
195
- }
196
- return t16;
4
+ import { c } from "react-compiler-runtime";
5
+ import { KEY_MAP, KeycapHint, MagnifyingGlassIcon, debounce, formatShortcutForOS, useGraphiQL } from "@graphiql/react";
6
+ import { isInputObjectType, isInterfaceType, isObjectType } from "graphql";
7
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
8
+ import { useEffect, useRef, useState } from "react";
9
+ import { Combobox, ComboboxInput, ComboboxOption, ComboboxOptions } from "@headlessui/react";
10
+ //#region src/components/search.tsx
11
+ var Search = () => {
12
+ const $ = c(39);
13
+ const explorerNavStack = useDocExplorer();
14
+ const { push } = useDocExplorerActions();
15
+ const inputRef = useRef(null);
16
+ const getSearchResults = useSearchResults();
17
+ const [searchValue, setSearchValue] = useState("");
18
+ let t0;
19
+ if ($[0] !== getSearchResults || $[1] !== searchValue) {
20
+ t0 = () => getSearchResults(searchValue);
21
+ $[0] = getSearchResults;
22
+ $[1] = searchValue;
23
+ $[2] = t0;
24
+ } else t0 = $[2];
25
+ const [results, setResults] = useState(t0);
26
+ const [isFocused, setIsFocused] = useState(false);
27
+ let t1;
28
+ if ($[3] !== getSearchResults) {
29
+ t1 = debounce(200, (search) => {
30
+ setResults(getSearchResults(search));
31
+ });
32
+ $[3] = getSearchResults;
33
+ $[4] = t1;
34
+ } else t1 = $[4];
35
+ const debouncedGetSearchResults = t1;
36
+ let t2;
37
+ let t3;
38
+ if ($[5] !== debouncedGetSearchResults || $[6] !== searchValue) {
39
+ t2 = () => {
40
+ debouncedGetSearchResults(searchValue);
41
+ };
42
+ t3 = [debouncedGetSearchResults, searchValue];
43
+ $[5] = debouncedGetSearchResults;
44
+ $[6] = searchValue;
45
+ $[7] = t2;
46
+ $[8] = t3;
47
+ } else {
48
+ t2 = $[7];
49
+ t3 = $[8];
50
+ }
51
+ useEffect(t2, t3);
52
+ let navItem;
53
+ let onSelect;
54
+ let shortcutKeys;
55
+ let t4;
56
+ if ($[9] !== explorerNavStack || $[10] !== push) {
57
+ navItem = explorerNavStack.at(-1);
58
+ let t5;
59
+ if ($[15] !== push) {
60
+ t5 = (def) => {
61
+ if (!def) return;
62
+ push("field" in def ? {
63
+ name: def.field.name,
64
+ def: def.field
65
+ } : {
66
+ name: def.type.name,
67
+ def: def.type
68
+ });
69
+ };
70
+ $[15] = push;
71
+ $[16] = t5;
72
+ } else t5 = $[16];
73
+ onSelect = t5;
74
+ let t6;
75
+ if ($[17] === Symbol.for("react.memo_cache_sentinel")) {
76
+ t6 = formatShortcutForOS(KEY_MAP.searchInDocs.key).split("-");
77
+ $[17] = t6;
78
+ } else t6 = $[17];
79
+ shortcutKeys = t6;
80
+ t4 = explorerNavStack.length === 1 || isObjectType(navItem.def) || isInterfaceType(navItem.def) || isInputObjectType(navItem.def);
81
+ $[9] = explorerNavStack;
82
+ $[10] = push;
83
+ $[11] = navItem;
84
+ $[12] = onSelect;
85
+ $[13] = shortcutKeys;
86
+ $[14] = t4;
87
+ } else {
88
+ navItem = $[11];
89
+ onSelect = $[12];
90
+ shortcutKeys = $[13];
91
+ t4 = $[14];
92
+ }
93
+ if (!t4) return null;
94
+ const t5 = isFocused ? void 0 : "idle";
95
+ const t6 = `Search ${navItem.name}...`;
96
+ let t7;
97
+ let t8;
98
+ if ($[18] === Symbol.for("react.memo_cache_sentinel")) {
99
+ t7 = () => {
100
+ inputRef.current.focus();
101
+ };
102
+ t8 = /* @__PURE__ */ jsx(MagnifyingGlassIcon, { "aria-hidden": "true" });
103
+ $[18] = t7;
104
+ $[19] = t8;
105
+ } else {
106
+ t7 = $[18];
107
+ t8 = $[19];
108
+ }
109
+ let t10;
110
+ let t11;
111
+ let t9;
112
+ if ($[20] === Symbol.for("react.memo_cache_sentinel")) {
113
+ t9 = (event) => setSearchValue(event.target.value);
114
+ t10 = () => setIsFocused(true);
115
+ t11 = () => setIsFocused(false);
116
+ $[20] = t10;
117
+ $[21] = t11;
118
+ $[22] = t9;
119
+ } else {
120
+ t10 = $[20];
121
+ t11 = $[21];
122
+ t9 = $[22];
123
+ }
124
+ let t12;
125
+ if ($[23] !== searchValue) {
126
+ t12 = /* @__PURE__ */ jsx(ComboboxInput, {
127
+ autoComplete: "off",
128
+ onChange: t9,
129
+ onFocus: t10,
130
+ onBlur: t11,
131
+ placeholder: "Search Docs",
132
+ ref: inputRef,
133
+ value: searchValue,
134
+ "data-cy": "doc-explorer-input"
135
+ });
136
+ $[23] = searchValue;
137
+ $[24] = t12;
138
+ } else t12 = $[24];
139
+ let t13;
140
+ if ($[25] !== shortcutKeys) {
141
+ t13 = /* @__PURE__ */ jsx(KeycapHint, {
142
+ keys: shortcutKeys,
143
+ ariaLabel: "Search docs shortcut"
144
+ });
145
+ $[25] = shortcutKeys;
146
+ $[26] = t13;
147
+ } else t13 = $[26];
148
+ let t14;
149
+ if ($[27] !== t12 || $[28] !== t13) {
150
+ t14 = /* @__PURE__ */ jsxs("div", {
151
+ className: "graphiql-doc-explorer-search-input",
152
+ onClick: t7,
153
+ children: [
154
+ t8,
155
+ t12,
156
+ t13
157
+ ]
158
+ });
159
+ $[27] = t12;
160
+ $[28] = t13;
161
+ $[29] = t14;
162
+ } else t14 = $[29];
163
+ let t15;
164
+ if ($[30] !== isFocused || $[31] !== results) {
165
+ t15 = isFocused && /* @__PURE__ */ jsxs(ComboboxOptions, {
166
+ "data-cy": "doc-explorer-list",
167
+ children: [
168
+ results.within.length + results.types.length + results.fields.length === 0 ? /* @__PURE__ */ jsx("div", {
169
+ className: "graphiql-doc-explorer-search-empty",
170
+ children: "No results found"
171
+ }) : results.within.map(_temp),
172
+ results.within.length > 0 && results.types.length + results.fields.length > 0 ? /* @__PURE__ */ jsx("div", {
173
+ className: "graphiql-doc-explorer-search-divider",
174
+ children: "Other results"
175
+ }) : null,
176
+ results.types.map(_temp2),
177
+ results.fields.map(_temp3)
178
+ ]
179
+ });
180
+ $[30] = isFocused;
181
+ $[31] = results;
182
+ $[32] = t15;
183
+ } else t15 = $[32];
184
+ let t16;
185
+ if ($[33] !== onSelect || $[34] !== t14 || $[35] !== t15 || $[36] !== t5 || $[37] !== t6) {
186
+ t16 = /* @__PURE__ */ jsxs(Combobox, {
187
+ as: "div",
188
+ className: "graphiql-doc-explorer-search",
189
+ onChange: onSelect,
190
+ "data-state": t5,
191
+ "aria-label": t6,
192
+ children: [t14, t15]
193
+ });
194
+ $[33] = onSelect;
195
+ $[34] = t14;
196
+ $[35] = t15;
197
+ $[36] = t5;
198
+ $[37] = t6;
199
+ $[38] = t16;
200
+ } else t16 = $[38];
201
+ return t16;
197
202
  };
198
203
  function useSearchResults() {
199
- const $ = c(5);
200
- const explorerNavStack = useDocExplorer();
201
- const schema = useGraphiQL(_temp4);
202
- let t0;
203
- if ($[0] !== explorerNavStack) {
204
- t0 = explorerNavStack.at(-1);
205
- $[0] = explorerNavStack;
206
- $[1] = t0;
207
- } else {
208
- t0 = $[1];
209
- }
210
- const navItem = t0;
211
- let t1;
212
- if ($[2] !== navItem || $[3] !== schema) {
213
- t1 = (searchValue) => {
214
- const matches = {
215
- within: [],
216
- types: [],
217
- fields: []
218
- };
219
- if (!schema) {
220
- return matches;
221
- }
222
- const withinType = navItem.def;
223
- const typeMap = schema.getTypeMap();
224
- let typeNames = Object.keys(typeMap);
225
- if (withinType) {
226
- typeNames = typeNames.filter((n) => n !== withinType.name);
227
- typeNames.unshift(withinType.name);
228
- }
229
- for (const typeName of typeNames) {
230
- if (matches.within.length + matches.types.length + matches.fields.length >= 100) {
231
- break;
232
- }
233
- const type = typeMap[typeName];
234
- if (withinType !== type && isMatch(typeName, searchValue)) {
235
- matches.types.push({
236
- type
237
- });
238
- }
239
- if (!isObjectType(type) && !isInterfaceType(type) && !isInputObjectType(type)) {
240
- continue;
241
- }
242
- const fields = type.getFields();
243
- for (const fieldName in fields) {
244
- const field = fields[fieldName];
245
- let matchingArgs;
246
- if (!isMatch(fieldName, searchValue)) {
247
- if ("args" in field) {
248
- matchingArgs = field.args.filter((arg) => isMatch(arg.name, searchValue));
249
- if (matchingArgs.length === 0) {
250
- continue;
251
- }
252
- } else {
253
- continue;
254
- }
255
- }
256
- matches[withinType === type ? "within" : "fields"].push(...matchingArgs ? matchingArgs.map((argument) => ({
257
- type,
258
- field,
259
- argument
260
- })) : [{
261
- type,
262
- field
263
- }]);
264
- }
265
- }
266
- return matches;
267
- };
268
- $[2] = navItem;
269
- $[3] = schema;
270
- $[4] = t1;
271
- } else {
272
- t1 = $[4];
273
- }
274
- return t1;
204
+ const $ = c(5);
205
+ const explorerNavStack = useDocExplorer();
206
+ const schema = useGraphiQL(_temp4);
207
+ let t0;
208
+ if ($[0] !== explorerNavStack) {
209
+ t0 = explorerNavStack.at(-1);
210
+ $[0] = explorerNavStack;
211
+ $[1] = t0;
212
+ } else t0 = $[1];
213
+ const navItem = t0;
214
+ let t1;
215
+ if ($[2] !== navItem || $[3] !== schema) {
216
+ t1 = (searchValue) => {
217
+ const matches = {
218
+ within: [],
219
+ types: [],
220
+ fields: []
221
+ };
222
+ if (!schema) return matches;
223
+ const withinType = navItem.def;
224
+ const typeMap = schema.getTypeMap();
225
+ let typeNames = Object.keys(typeMap);
226
+ if (withinType) {
227
+ typeNames = typeNames.filter((n) => n !== withinType.name);
228
+ typeNames.unshift(withinType.name);
229
+ }
230
+ for (const typeName of typeNames) {
231
+ if (matches.within.length + matches.types.length + matches.fields.length >= 100) break;
232
+ const type = typeMap[typeName];
233
+ if (withinType !== type && isMatch(typeName, searchValue)) matches.types.push({ type });
234
+ if (!isObjectType(type) && !isInterfaceType(type) && !isInputObjectType(type)) continue;
235
+ const fields = type.getFields();
236
+ for (const fieldName in fields) {
237
+ const field = fields[fieldName];
238
+ let matchingArgs;
239
+ if (!isMatch(fieldName, searchValue)) {
240
+ if ("args" in field) {
241
+ matchingArgs = field.args.filter((arg) => isMatch(arg.name, searchValue));
242
+ if (matchingArgs.length === 0) continue;
243
+ } else continue;
244
+ }
245
+ matches[withinType === type ? "within" : "fields"].push(...matchingArgs ? matchingArgs.map((argument) => ({
246
+ type,
247
+ field,
248
+ argument
249
+ })) : [{
250
+ type,
251
+ field
252
+ }]);
253
+ }
254
+ }
255
+ return matches;
256
+ };
257
+ $[2] = navItem;
258
+ $[3] = schema;
259
+ $[4] = t1;
260
+ } else t1 = $[4];
261
+ return t1;
275
262
  }
276
263
  function _temp4(state) {
277
- return state.schema;
264
+ return state.schema;
278
265
  }
279
266
  function isMatch(sourceText, searchValue) {
280
- try {
281
- const escaped = searchValue.replaceAll(/[^_0-9A-Za-z]/g, (ch) => "\\" + ch);
282
- return new RegExp(escaped, "i").test(sourceText);
283
- } catch {
284
- return sourceText.toLowerCase().includes(searchValue.toLowerCase());
285
- }
267
+ try {
268
+ const escaped = searchValue.replaceAll(/[^_0-9A-Za-z]/g, (ch) => "\\" + ch);
269
+ return new RegExp(escaped, "i").test(sourceText);
270
+ } catch {
271
+ return sourceText.toLowerCase().includes(searchValue.toLowerCase());
272
+ }
286
273
  }
287
- const Type = (t0) => {
288
- const $ = c(2);
289
- const {
290
- type
291
- } = t0;
292
- let t1;
293
- if ($[0] !== type.name) {
294
- t1 = /* @__PURE__ */ jsx("span", { className: "graphiql-doc-explorer-search-type", children: type.name });
295
- $[0] = type.name;
296
- $[1] = t1;
297
- } else {
298
- t1 = $[1];
299
- }
300
- return t1;
274
+ var Type = (t0) => {
275
+ const $ = c(2);
276
+ const { type } = t0;
277
+ let t1;
278
+ if ($[0] !== type.name) {
279
+ t1 = /* @__PURE__ */ jsx("span", {
280
+ className: "graphiql-doc-explorer-search-type",
281
+ children: type.name
282
+ });
283
+ $[0] = type.name;
284
+ $[1] = t1;
285
+ } else t1 = $[1];
286
+ return t1;
301
287
  };
302
- const Field = (t0) => {
303
- const $ = c(7);
304
- const {
305
- field,
306
- argument
307
- } = t0;
308
- let t1;
309
- if ($[0] !== field.name) {
310
- t1 = /* @__PURE__ */ jsx("span", { className: "graphiql-doc-explorer-search-field", children: field.name });
311
- $[0] = field.name;
312
- $[1] = t1;
313
- } else {
314
- t1 = $[1];
315
- }
316
- let t2;
317
- if ($[2] !== argument) {
318
- t2 = argument ? /* @__PURE__ */ jsxs(Fragment, { children: [
319
- "(",
320
- /* @__PURE__ */ jsx("span", { className: "graphiql-doc-explorer-search-argument", children: argument.name }),
321
- ":",
322
- " ",
323
- renderType(argument.type, _temp5),
324
- ")"
325
- ] }) : null;
326
- $[2] = argument;
327
- $[3] = t2;
328
- } else {
329
- t2 = $[3];
330
- }
331
- let t3;
332
- if ($[4] !== t1 || $[5] !== t2) {
333
- t3 = /* @__PURE__ */ jsxs(Fragment, { children: [
334
- t1,
335
- t2
336
- ] });
337
- $[4] = t1;
338
- $[5] = t2;
339
- $[6] = t3;
340
- } else {
341
- t3 = $[6];
342
- }
343
- return t3;
288
+ var Field = (t0) => {
289
+ const $ = c(7);
290
+ const { field, argument } = t0;
291
+ let t1;
292
+ if ($[0] !== field.name) {
293
+ t1 = /* @__PURE__ */ jsx("span", {
294
+ className: "graphiql-doc-explorer-search-field",
295
+ children: field.name
296
+ });
297
+ $[0] = field.name;
298
+ $[1] = t1;
299
+ } else t1 = $[1];
300
+ let t2;
301
+ if ($[2] !== argument) {
302
+ t2 = argument ? /* @__PURE__ */ jsxs(Fragment, { children: [
303
+ "(",
304
+ /* @__PURE__ */ jsx("span", {
305
+ className: "graphiql-doc-explorer-search-argument",
306
+ children: argument.name
307
+ }),
308
+ ":",
309
+ " ",
310
+ renderType(argument.type, _temp5),
311
+ ")"
312
+ ] }) : null;
313
+ $[2] = argument;
314
+ $[3] = t2;
315
+ } else t2 = $[3];
316
+ let t3;
317
+ if ($[4] !== t1 || $[5] !== t2) {
318
+ t3 = /* @__PURE__ */ jsxs(Fragment, { children: [t1, t2] });
319
+ $[4] = t1;
320
+ $[5] = t2;
321
+ $[6] = t3;
322
+ } else t3 = $[6];
323
+ return t3;
344
324
  };
345
325
  function _temp(result, i) {
346
- return /* @__PURE__ */ jsx(ComboboxOption, { value: result, "data-cy": "doc-explorer-option", children: /* @__PURE__ */ jsx(Field, { field: result.field, argument: result.argument }) }, `within-${i}`);
326
+ return /* @__PURE__ */ jsx(ComboboxOption, {
327
+ value: result,
328
+ "data-cy": "doc-explorer-option",
329
+ children: /* @__PURE__ */ jsx(Field, {
330
+ field: result.field,
331
+ argument: result.argument
332
+ })
333
+ }, `within-${i}`);
347
334
  }
348
335
  function _temp2(result_0, i_0) {
349
- return /* @__PURE__ */ jsx(ComboboxOption, { value: result_0, "data-cy": "doc-explorer-option", children: /* @__PURE__ */ jsx(Type, { type: result_0.type }) }, `type-${i_0}`);
336
+ return /* @__PURE__ */ jsx(ComboboxOption, {
337
+ value: result_0,
338
+ "data-cy": "doc-explorer-option",
339
+ children: /* @__PURE__ */ jsx(Type, { type: result_0.type })
340
+ }, `type-${i_0}`);
350
341
  }
351
342
  function _temp3(result_1, i_1) {
352
- return /* @__PURE__ */ jsxs(ComboboxOption, { value: result_1, "data-cy": "doc-explorer-option", children: [
353
- /* @__PURE__ */ jsx(Type, { type: result_1.type }),
354
- ".",
355
- /* @__PURE__ */ jsx(Field, { field: result_1.field, argument: result_1.argument })
356
- ] }, `field-${i_1}`);
343
+ return /* @__PURE__ */ jsxs(ComboboxOption, {
344
+ value: result_1,
345
+ "data-cy": "doc-explorer-option",
346
+ children: [
347
+ /* @__PURE__ */ jsx(Type, { type: result_1.type }),
348
+ ".",
349
+ /* @__PURE__ */ jsx(Field, {
350
+ field: result_1.field,
351
+ argument: result_1.argument
352
+ })
353
+ ]
354
+ }, `field-${i_1}`);
357
355
  }
358
356
  function _temp5(namedType) {
359
- return /* @__PURE__ */ jsx(Type, { type: namedType });
357
+ return /* @__PURE__ */ jsx(Type, { type: namedType });
360
358
  }
361
- export {
362
- Search,
363
- useSearchResults
364
- };
365
- //# sourceMappingURL=search.js.map
359
+ //#endregion
360
+ export { Search, useSearchResults };
361
+
362
+ //# sourceMappingURL=search.js.map