@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,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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
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
|
-
|
|
264
|
+
return state.schema;
|
|
278
265
|
}
|
|
279
266
|
function isMatch(sourceText, searchValue) {
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
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
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
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
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
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
|
-
|
|
357
|
+
return /* @__PURE__ */ jsx(Type, { type: namedType });
|
|
360
358
|
}
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
//# sourceMappingURL=search.js.map
|
|
359
|
+
//#endregion
|
|
360
|
+
export { Search, useSearchResults };
|
|
361
|
+
|
|
362
|
+
//# sourceMappingURL=search.js.map
|