@graphiql/plugin-collections 0.0.0 → 1.0.0-beta.1
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/README.md +162 -0
- package/dist/collections.stories.d.ts +14 -0
- package/dist/components/collection-item-row.d.ts +25 -0
- package/dist/components/collection-item-row.js +286 -0
- package/dist/components/collection-item-row.js.map +1 -0
- package/dist/components/collection-row.d.ts +32 -0
- package/dist/components/collection-row.js +162 -0
- package/dist/components/collection-row.js.map +1 -0
- package/dist/components/collections-panel.d.ts +9 -0
- package/dist/components/collections-panel.js +508 -0
- package/dist/components/collections-panel.js.map +1 -0
- package/dist/components/conflict-dialog.d.ts +11 -0
- package/dist/components/conflict-dialog.js +169 -0
- package/dist/components/conflict-dialog.js.map +1 -0
- package/dist/components/export-dialog.d.ts +7 -0
- package/dist/components/export-dialog.js +54 -0
- package/dist/components/export-dialog.js.map +1 -0
- package/dist/components/import-dialog.d.ts +10 -0
- package/dist/components/import-dialog.js +114 -0
- package/dist/components/import-dialog.js.map +1 -0
- package/dist/components/save-dialog.d.ts +7 -0
- package/dist/components/save-dialog.js +125 -0
- package/dist/components/save-dialog.js.map +1 -0
- package/dist/components/session-actions.d.ts +9 -0
- package/dist/components/session-actions.js +34 -0
- package/dist/components/session-actions.js.map +1 -0
- package/dist/icons/check.js +10 -0
- package/dist/icons/check.js.map +1 -0
- package/dist/icons/collections.js +10 -0
- package/dist/icons/collections.js.map +1 -0
- package/dist/icons/download.js +10 -0
- package/dist/icons/download.js.map +1 -0
- package/dist/icons/upload.js +10 -0
- package/dist/icons/upload.js.map +1 -0
- package/dist/index.d.ts +17 -0
- package/dist/index.js +46 -0
- package/dist/index.js.map +1 -0
- package/dist/operation-method.d.ts +10 -0
- package/dist/operation-method.js +28 -0
- package/dist/operation-method.js.map +1 -0
- package/dist/storage/local-storage.d.ts +3 -0
- package/dist/storage/local-storage.js +39 -0
- package/dist/storage/local-storage.js.map +1 -0
- package/dist/storage/tab-links.d.ts +7 -0
- package/dist/storage/tab-links.js +36 -0
- package/dist/storage/tab-links.js.map +1 -0
- package/dist/store.d.ts +78 -0
- package/dist/store.js +413 -0
- package/dist/store.js.map +1 -0
- package/dist/style.css +442 -0
- package/dist/types.d.ts +80 -0
- package/dist/types.js +9 -0
- package/dist/types.js.map +1 -0
- package/dist/utility/uuid.d.ts +4 -0
- package/dist/utility/uuid.js +11 -0
- package/dist/utility/uuid.js.map +1 -0
- package/package.json +60 -1
|
@@ -0,0 +1,508 @@
|
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useState, useRef, useEffect } from "react";
|
|
3
|
+
import { useGraphiQLActions, useGraphiQL, pick, PanelHeader, Dialog, Button } from "@graphiql/react";
|
|
4
|
+
import { useCollectionsStore, collectionsStore } from "../store.js";
|
|
5
|
+
import { CollectionRow } from "./collection-row.js";
|
|
6
|
+
import { ImportDialog } from "./import-dialog.js";
|
|
7
|
+
import { ExportDialog } from "./export-dialog.js";
|
|
8
|
+
import { ConflictDialog } from "./conflict-dialog.js";
|
|
9
|
+
import SvgDownload from "../icons/download.js";
|
|
10
|
+
import SvgUpload from "../icons/upload.js";
|
|
11
|
+
function parseCollectionsExport(text) {
|
|
12
|
+
try {
|
|
13
|
+
const parsed = JSON.parse(text);
|
|
14
|
+
const list = Array.isArray(parsed == null ? void 0 : parsed.collections) ? parsed.collections : Array.isArray(parsed) ? parsed : null;
|
|
15
|
+
if (!(list == null ? void 0 : list.length) || !list.every(
|
|
16
|
+
(c) => c && typeof c === "object" && Array.isArray(c.items)
|
|
17
|
+
)) {
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
return list.length;
|
|
21
|
+
} catch {
|
|
22
|
+
return null;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
function isEditableTarget(el) {
|
|
26
|
+
if (!el) {
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
29
|
+
return el.tagName === "INPUT" || el.tagName === "TEXTAREA" || el.isContentEditable || Boolean(el.closest(".monaco-editor"));
|
|
30
|
+
}
|
|
31
|
+
function deriveSourceLabel(incoming) {
|
|
32
|
+
if (incoming.length === 1 && incoming[0]) {
|
|
33
|
+
return incoming[0].name;
|
|
34
|
+
}
|
|
35
|
+
return `${incoming.length} collections`;
|
|
36
|
+
}
|
|
37
|
+
const CollectionsPanel = ({
|
|
38
|
+
readOnly = false,
|
|
39
|
+
allowImportExport = true,
|
|
40
|
+
allowReplace = true
|
|
41
|
+
}) => {
|
|
42
|
+
const allowImport = !readOnly && allowImportExport;
|
|
43
|
+
const actions = useCollectionsStore((s) => s.actions);
|
|
44
|
+
const collections = useCollectionsStore((s) => s.collections);
|
|
45
|
+
const loaded = useCollectionsStore((s) => s.loaded);
|
|
46
|
+
const [openDialog, setOpenDialog] = useState(
|
|
47
|
+
null
|
|
48
|
+
);
|
|
49
|
+
const [isDragOver, setIsDragOver] = useState(false);
|
|
50
|
+
const [status, setStatus] = useState(
|
|
51
|
+
null
|
|
52
|
+
);
|
|
53
|
+
const [pendingConflict, setPendingConflict] = useState(null);
|
|
54
|
+
const [pendingReplace, setPendingReplace] = useState(null);
|
|
55
|
+
const [collapsed, setCollapsed] = useState(/* @__PURE__ */ new Set());
|
|
56
|
+
const [grabbed, setGrabbed] = useState(null);
|
|
57
|
+
const [origin, setOrigin] = useState(null);
|
|
58
|
+
const [liveMessage, setLiveMessage] = useState("");
|
|
59
|
+
const listRef = useRef(null);
|
|
60
|
+
const cancelledItemRef = useRef(null);
|
|
61
|
+
useEffect(() => {
|
|
62
|
+
if (!status) {
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
const timer = setTimeout(() => setStatus(null), 4e3);
|
|
66
|
+
return () => clearTimeout(timer);
|
|
67
|
+
}, [status]);
|
|
68
|
+
const applyReplace = (text) => {
|
|
69
|
+
const analysis = collectionsStore.getState().actions.analyzeImport(text);
|
|
70
|
+
collectionsStore.getState().actions.applyImport(analysis, { mode: "replace" });
|
|
71
|
+
};
|
|
72
|
+
const runImport = (text, mode) => {
|
|
73
|
+
if (mode === "replace") {
|
|
74
|
+
setPendingReplace(text);
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
const count = parseCollectionsExport(text);
|
|
78
|
+
if (count === null) {
|
|
79
|
+
setStatus({
|
|
80
|
+
ok: false,
|
|
81
|
+
message: "That file isn't a collections export."
|
|
82
|
+
});
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
const analysis = collectionsStore.getState().actions.analyzeImport(text);
|
|
86
|
+
if (!analysis.ok) {
|
|
87
|
+
setStatus({ ok: false, message: "Invalid collections export." });
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
if (analysis.changedItems.length === 0) {
|
|
91
|
+
collectionsStore.getState().actions.applyImport(analysis, { mode: "merge", applyChanges: true });
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
setPendingConflict({
|
|
95
|
+
analysis,
|
|
96
|
+
sourceLabel: deriveSourceLabel(analysis._incoming)
|
|
97
|
+
});
|
|
98
|
+
};
|
|
99
|
+
const handleConflictResolve = (resolution) => {
|
|
100
|
+
if (!pendingConflict) {
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
const { analysis } = pendingConflict;
|
|
104
|
+
collectionsStore.getState().actions.applyImport(analysis, resolution);
|
|
105
|
+
setPendingConflict(null);
|
|
106
|
+
};
|
|
107
|
+
const importDroppedFile = async (file) => {
|
|
108
|
+
const text = await file.text();
|
|
109
|
+
if (parseCollectionsExport(text) === null) {
|
|
110
|
+
setStatus({
|
|
111
|
+
ok: false,
|
|
112
|
+
message: "That file isn't a collections export."
|
|
113
|
+
});
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
runImport(text, "merge");
|
|
117
|
+
};
|
|
118
|
+
const allowImportRef = useRef(allowImport);
|
|
119
|
+
allowImportRef.current = allowImport;
|
|
120
|
+
useEffect(() => {
|
|
121
|
+
const onPaste = (event) => {
|
|
122
|
+
var _a;
|
|
123
|
+
if (!allowImportRef.current) {
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
if (isEditableTarget(document.activeElement)) {
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
129
|
+
const text = ((_a = event.clipboardData) == null ? void 0 : _a.getData("text")) ?? "";
|
|
130
|
+
if (parseCollectionsExport(text) === null) {
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
133
|
+
event.preventDefault();
|
|
134
|
+
runImport(text, "merge");
|
|
135
|
+
};
|
|
136
|
+
document.addEventListener("paste", onPaste);
|
|
137
|
+
return () => document.removeEventListener("paste", onPaste);
|
|
138
|
+
}, []);
|
|
139
|
+
const { addTab, changeTab, updateActiveTabValues } = useGraphiQLActions();
|
|
140
|
+
const { queryEditor, variableEditor, headerEditor } = useGraphiQL(
|
|
141
|
+
pick("queryEditor", "variableEditor", "headerEditor")
|
|
142
|
+
);
|
|
143
|
+
const tabs = useGraphiQL((s) => s.tabs);
|
|
144
|
+
const activeTabId = useGraphiQL((s) => {
|
|
145
|
+
var _a;
|
|
146
|
+
return (_a = s.tabs[s.activeTabIndex]) == null ? void 0 : _a.id;
|
|
147
|
+
});
|
|
148
|
+
const pendingLink = useRef(
|
|
149
|
+
null
|
|
150
|
+
);
|
|
151
|
+
useEffect(() => {
|
|
152
|
+
const link = pendingLink.current;
|
|
153
|
+
if (link && activeTabId) {
|
|
154
|
+
actions.linkTab(activeTabId, link.collectionId, link.itemId);
|
|
155
|
+
pendingLink.current = null;
|
|
156
|
+
}
|
|
157
|
+
}, [activeTabId, actions]);
|
|
158
|
+
const handleOpen = (item) => {
|
|
159
|
+
var _a;
|
|
160
|
+
const { links } = collectionsStore.getState();
|
|
161
|
+
const openIndex = tabs.findIndex(
|
|
162
|
+
(t) => {
|
|
163
|
+
var _a2;
|
|
164
|
+
return t.id && ((_a2 = links[t.id]) == null ? void 0 : _a2.itemId) === item.id;
|
|
165
|
+
}
|
|
166
|
+
);
|
|
167
|
+
if (openIndex !== -1) {
|
|
168
|
+
changeTab(openIndex);
|
|
169
|
+
return;
|
|
170
|
+
}
|
|
171
|
+
const collectionId = (_a = collections.find(
|
|
172
|
+
(c) => c.items.some((i) => i.id === item.id)
|
|
173
|
+
)) == null ? void 0 : _a.id;
|
|
174
|
+
if (collectionId) {
|
|
175
|
+
pendingLink.current = { collectionId, itemId: item.id };
|
|
176
|
+
}
|
|
177
|
+
addTab();
|
|
178
|
+
queryEditor == null ? void 0 : queryEditor.setValue(item.query ?? "");
|
|
179
|
+
variableEditor == null ? void 0 : variableEditor.setValue(item.variables ?? "");
|
|
180
|
+
headerEditor == null ? void 0 : headerEditor.setValue(item.headers ?? "");
|
|
181
|
+
updateActiveTabValues({
|
|
182
|
+
query: item.query,
|
|
183
|
+
variables: item.variables ?? "",
|
|
184
|
+
headers: item.headers ?? "",
|
|
185
|
+
lastSavedQuery: item.query ?? null
|
|
186
|
+
});
|
|
187
|
+
};
|
|
188
|
+
const announce = (message) => setLiveMessage(message);
|
|
189
|
+
const handleShareCollection = async (collectionId) => {
|
|
190
|
+
const json = collectionsStore.getState().actions.exportCollection(collectionId);
|
|
191
|
+
await navigator.clipboard.writeText(json);
|
|
192
|
+
};
|
|
193
|
+
const handleShareItem = async (itemId) => {
|
|
194
|
+
const json = collectionsStore.getState().actions.exportItem(itemId);
|
|
195
|
+
await navigator.clipboard.writeText(json);
|
|
196
|
+
};
|
|
197
|
+
const handleRename = actions.renameCollection;
|
|
198
|
+
const handleDelete = actions.deleteCollection;
|
|
199
|
+
const handleDeleteItem = actions.deleteItem;
|
|
200
|
+
const handleMoveItem = actions.moveItem;
|
|
201
|
+
const handleAddItem = actions.addItem;
|
|
202
|
+
const handleRenameItem = (collectionId, itemId, updates) => {
|
|
203
|
+
collectionsStore.getState().actions.updateItem(collectionId, itemId, {
|
|
204
|
+
name: updates.name,
|
|
205
|
+
description: updates.description || void 0
|
|
206
|
+
});
|
|
207
|
+
};
|
|
208
|
+
const toggleExpand = (id) => setCollapsed((prev) => {
|
|
209
|
+
const next = new Set(prev);
|
|
210
|
+
if (next.has(id)) {
|
|
211
|
+
next.delete(id);
|
|
212
|
+
} else {
|
|
213
|
+
next.add(id);
|
|
214
|
+
}
|
|
215
|
+
return next;
|
|
216
|
+
});
|
|
217
|
+
const expand = (id) => setCollapsed((prev) => {
|
|
218
|
+
if (!prev.has(id)) {
|
|
219
|
+
return prev;
|
|
220
|
+
}
|
|
221
|
+
const next = new Set(prev);
|
|
222
|
+
next.delete(id);
|
|
223
|
+
return next;
|
|
224
|
+
});
|
|
225
|
+
const handleGrabToggle = (collectionId, index, itemId) => {
|
|
226
|
+
var _a;
|
|
227
|
+
if (grabbed) {
|
|
228
|
+
const cols = collectionsStore.getState().collections;
|
|
229
|
+
const col = cols.find((c) => c.id === grabbed.collectionId);
|
|
230
|
+
const droppedItem = col == null ? void 0 : col.items[grabbed.index];
|
|
231
|
+
setLiveMessage(
|
|
232
|
+
`Dropped ${(droppedItem == null ? void 0 : droppedItem.name) ?? grabbed.itemId} in ${(col == null ? void 0 : col.name) ?? ""} at position ${grabbed.index + 1}.`
|
|
233
|
+
);
|
|
234
|
+
setGrabbed(null);
|
|
235
|
+
setOrigin(null);
|
|
236
|
+
return;
|
|
237
|
+
}
|
|
238
|
+
setGrabbed({ collectionId, index, itemId });
|
|
239
|
+
setOrigin({ collectionId, index });
|
|
240
|
+
const item = (_a = collectionsStore.getState().collections.find((c) => c.id === collectionId)) == null ? void 0 : _a.items[index];
|
|
241
|
+
setLiveMessage(
|
|
242
|
+
`Grabbed ${(item == null ? void 0 : item.name) ?? itemId}. Use arrow keys to move, space to drop, escape to cancel.`
|
|
243
|
+
);
|
|
244
|
+
};
|
|
245
|
+
const handleGrabMove = (direction) => {
|
|
246
|
+
if (!grabbed) {
|
|
247
|
+
return;
|
|
248
|
+
}
|
|
249
|
+
const cols = collectionsStore.getState().collections;
|
|
250
|
+
const cIdx = cols.findIndex((c) => c.id === grabbed.collectionId);
|
|
251
|
+
const col = cols[cIdx];
|
|
252
|
+
if (!col) {
|
|
253
|
+
return;
|
|
254
|
+
}
|
|
255
|
+
const { moveItem } = collectionsStore.getState().actions;
|
|
256
|
+
if (direction === "down") {
|
|
257
|
+
if (grabbed.index < col.items.length - 1) {
|
|
258
|
+
moveItem(col.id, grabbed.index, col.id, grabbed.index + 1);
|
|
259
|
+
const next = { ...grabbed, index: grabbed.index + 1 };
|
|
260
|
+
setGrabbed(next);
|
|
261
|
+
setLiveMessage(
|
|
262
|
+
`Position ${next.index + 1} of ${col.items.length} in ${col.name}.`
|
|
263
|
+
);
|
|
264
|
+
} else if (cIdx < cols.length - 1) {
|
|
265
|
+
const dest = cols[cIdx + 1];
|
|
266
|
+
expand(dest.id);
|
|
267
|
+
moveItem(col.id, grabbed.index, dest.id, 0);
|
|
268
|
+
setGrabbed({ collectionId: dest.id, index: 0, itemId: grabbed.itemId });
|
|
269
|
+
setLiveMessage(
|
|
270
|
+
`Moved to ${dest.name}, position 1 of ${dest.items.length + 1}.`
|
|
271
|
+
);
|
|
272
|
+
} else {
|
|
273
|
+
setLiveMessage("Already at the end.");
|
|
274
|
+
}
|
|
275
|
+
} else if (grabbed.index > 0) {
|
|
276
|
+
moveItem(col.id, grabbed.index, col.id, grabbed.index - 1);
|
|
277
|
+
const next = { ...grabbed, index: grabbed.index - 1 };
|
|
278
|
+
setGrabbed(next);
|
|
279
|
+
setLiveMessage(
|
|
280
|
+
`Position ${next.index + 1} of ${col.items.length} in ${col.name}.`
|
|
281
|
+
);
|
|
282
|
+
} else if (cIdx > 0) {
|
|
283
|
+
const dest = cols[cIdx - 1];
|
|
284
|
+
expand(dest.id);
|
|
285
|
+
const toIndex = dest.items.length;
|
|
286
|
+
moveItem(col.id, grabbed.index, dest.id, toIndex);
|
|
287
|
+
setGrabbed({
|
|
288
|
+
collectionId: dest.id,
|
|
289
|
+
index: toIndex,
|
|
290
|
+
itemId: grabbed.itemId
|
|
291
|
+
});
|
|
292
|
+
setLiveMessage(
|
|
293
|
+
`Moved to ${dest.name}, position ${toIndex + 1} of ${dest.items.length + 1}.`
|
|
294
|
+
);
|
|
295
|
+
} else {
|
|
296
|
+
setLiveMessage("Already at the start.");
|
|
297
|
+
}
|
|
298
|
+
};
|
|
299
|
+
const handleGrabCancel = () => {
|
|
300
|
+
if (!grabbed || !origin) {
|
|
301
|
+
return;
|
|
302
|
+
}
|
|
303
|
+
collectionsStore.getState().actions.moveItem(
|
|
304
|
+
grabbed.collectionId,
|
|
305
|
+
grabbed.index,
|
|
306
|
+
origin.collectionId,
|
|
307
|
+
origin.index
|
|
308
|
+
);
|
|
309
|
+
cancelledItemRef.current = grabbed.itemId;
|
|
310
|
+
setGrabbed(null);
|
|
311
|
+
setOrigin(null);
|
|
312
|
+
setLiveMessage("Move cancelled.");
|
|
313
|
+
};
|
|
314
|
+
useEffect(() => {
|
|
315
|
+
var _a, _b, _c, _d;
|
|
316
|
+
if (grabbed) {
|
|
317
|
+
(_b = (_a = listRef.current) == null ? void 0 : _a.querySelector(
|
|
318
|
+
`[data-collection-drag-handle="${grabbed.itemId}"]`
|
|
319
|
+
)) == null ? void 0 : _b.focus();
|
|
320
|
+
} else if (cancelledItemRef.current) {
|
|
321
|
+
(_d = (_c = listRef.current) == null ? void 0 : _c.querySelector(
|
|
322
|
+
`[data-collection-drag-handle="${cancelledItemRef.current}"]`
|
|
323
|
+
)) == null ? void 0 : _d.focus();
|
|
324
|
+
cancelledItemRef.current = null;
|
|
325
|
+
}
|
|
326
|
+
}, [grabbed]);
|
|
327
|
+
return /* @__PURE__ */ jsxs(
|
|
328
|
+
"div",
|
|
329
|
+
{
|
|
330
|
+
className: `graphiql-collections-panel${isDragOver ? " graphiql-collections-drop-active" : ""}`,
|
|
331
|
+
onDragOver: (e) => {
|
|
332
|
+
if (!allowImport || !e.dataTransfer.types.includes("Files")) {
|
|
333
|
+
return;
|
|
334
|
+
}
|
|
335
|
+
e.preventDefault();
|
|
336
|
+
setIsDragOver(true);
|
|
337
|
+
},
|
|
338
|
+
onDragLeave: (e) => {
|
|
339
|
+
if (e.currentTarget.contains(e.relatedTarget)) {
|
|
340
|
+
return;
|
|
341
|
+
}
|
|
342
|
+
setIsDragOver(false);
|
|
343
|
+
},
|
|
344
|
+
onDrop: (e) => {
|
|
345
|
+
if (!allowImport) {
|
|
346
|
+
return;
|
|
347
|
+
}
|
|
348
|
+
const file = e.dataTransfer.files[0];
|
|
349
|
+
if (!file) {
|
|
350
|
+
return;
|
|
351
|
+
}
|
|
352
|
+
e.preventDefault();
|
|
353
|
+
setIsDragOver(false);
|
|
354
|
+
void importDroppedFile(file);
|
|
355
|
+
},
|
|
356
|
+
children: [
|
|
357
|
+
/* @__PURE__ */ jsx(
|
|
358
|
+
PanelHeader,
|
|
359
|
+
{
|
|
360
|
+
title: "Operation Collections",
|
|
361
|
+
subtitle: "Save and organize operations into collections."
|
|
362
|
+
}
|
|
363
|
+
),
|
|
364
|
+
(!readOnly || allowImportExport) && /* @__PURE__ */ jsxs("div", { className: "graphiql-collections-toolbar", children: [
|
|
365
|
+
/* @__PURE__ */ jsx("div", { className: "graphiql-collections-toolbar-left", children: !readOnly && /* @__PURE__ */ jsx(
|
|
366
|
+
"button",
|
|
367
|
+
{
|
|
368
|
+
type: "button",
|
|
369
|
+
className: "graphiql-collections-action",
|
|
370
|
+
onClick: () => collectionsStore.getState().actions.createCollection("New Collection"),
|
|
371
|
+
"aria-label": "New collection",
|
|
372
|
+
title: "New collection",
|
|
373
|
+
children: "+ New Collection"
|
|
374
|
+
}
|
|
375
|
+
) }),
|
|
376
|
+
/* @__PURE__ */ jsxs("div", { className: "graphiql-collections-toolbar-right", children: [
|
|
377
|
+
allowImport && /* @__PURE__ */ jsx(
|
|
378
|
+
"button",
|
|
379
|
+
{
|
|
380
|
+
type: "button",
|
|
381
|
+
className: "graphiql-collections-action",
|
|
382
|
+
onClick: () => setOpenDialog("import"),
|
|
383
|
+
"aria-label": "Import collections",
|
|
384
|
+
title: "Import collections",
|
|
385
|
+
children: /* @__PURE__ */ jsx(SvgDownload, {})
|
|
386
|
+
}
|
|
387
|
+
),
|
|
388
|
+
allowImportExport && /* @__PURE__ */ jsx(
|
|
389
|
+
"button",
|
|
390
|
+
{
|
|
391
|
+
type: "button",
|
|
392
|
+
className: "graphiql-collections-action",
|
|
393
|
+
onClick: () => setOpenDialog("export"),
|
|
394
|
+
"aria-label": "Export collections",
|
|
395
|
+
title: "Export collections",
|
|
396
|
+
children: /* @__PURE__ */ jsx(SvgUpload, {})
|
|
397
|
+
}
|
|
398
|
+
)
|
|
399
|
+
] })
|
|
400
|
+
] }),
|
|
401
|
+
status && /* @__PURE__ */ jsx(
|
|
402
|
+
"div",
|
|
403
|
+
{
|
|
404
|
+
className: `graphiql-collections-status${status.ok ? "" : " graphiql-collections-status-error"}`,
|
|
405
|
+
role: "status",
|
|
406
|
+
children: status.message
|
|
407
|
+
}
|
|
408
|
+
),
|
|
409
|
+
!loaded && /* @__PURE__ */ jsx("div", { className: "graphiql-collections-loading", children: "Loading…" }),
|
|
410
|
+
loaded && collections.length === 0 && /* @__PURE__ */ jsx("div", { className: "graphiql-collections-empty", children: readOnly ? "No collections." : allowImport ? "No collections yet. Save an operation to get started, or drop or paste a collections export to import one." : "No collections yet. Save an operation to get started." }),
|
|
411
|
+
/* @__PURE__ */ jsx(
|
|
412
|
+
"div",
|
|
413
|
+
{
|
|
414
|
+
className: "graphiql-sr-only",
|
|
415
|
+
"aria-live": "assertive",
|
|
416
|
+
"aria-atomic": "true",
|
|
417
|
+
children: liveMessage
|
|
418
|
+
}
|
|
419
|
+
),
|
|
420
|
+
/* @__PURE__ */ jsx("div", { className: "graphiql-collections-list", ref: listRef, children: collections.map((collection) => /* @__PURE__ */ jsx(
|
|
421
|
+
CollectionRow,
|
|
422
|
+
{
|
|
423
|
+
collection,
|
|
424
|
+
readOnly,
|
|
425
|
+
expanded: !collapsed.has(collection.id),
|
|
426
|
+
onToggleExpand: () => toggleExpand(collection.id),
|
|
427
|
+
grabbed,
|
|
428
|
+
onGrabToggle: handleGrabToggle,
|
|
429
|
+
onGrabMove: handleGrabMove,
|
|
430
|
+
onGrabCancel: handleGrabCancel,
|
|
431
|
+
onRename: handleRename,
|
|
432
|
+
onDelete: handleDelete,
|
|
433
|
+
onShareCollection: handleShareCollection,
|
|
434
|
+
onOpenItem: handleOpen,
|
|
435
|
+
onShare: handleShareItem,
|
|
436
|
+
onAnnounce: announce,
|
|
437
|
+
onDeleteItem: handleDeleteItem,
|
|
438
|
+
onMoveItem: handleMoveItem,
|
|
439
|
+
onAddItem: handleAddItem,
|
|
440
|
+
onRenameItem: handleRenameItem
|
|
441
|
+
},
|
|
442
|
+
collection.id
|
|
443
|
+
)) }),
|
|
444
|
+
allowImportExport && /* @__PURE__ */ jsx(
|
|
445
|
+
ExportDialog,
|
|
446
|
+
{
|
|
447
|
+
open: openDialog === "export",
|
|
448
|
+
onClose: () => setOpenDialog(null)
|
|
449
|
+
}
|
|
450
|
+
),
|
|
451
|
+
allowImport && /* @__PURE__ */ jsx(
|
|
452
|
+
ImportDialog,
|
|
453
|
+
{
|
|
454
|
+
open: openDialog === "import",
|
|
455
|
+
onClose: () => setOpenDialog(null),
|
|
456
|
+
onImport: runImport,
|
|
457
|
+
allowReplace
|
|
458
|
+
}
|
|
459
|
+
),
|
|
460
|
+
pendingConflict && /* @__PURE__ */ jsx(
|
|
461
|
+
ConflictDialog,
|
|
462
|
+
{
|
|
463
|
+
analysis: pendingConflict.analysis,
|
|
464
|
+
sourceLabel: pendingConflict.sourceLabel,
|
|
465
|
+
open: true,
|
|
466
|
+
onClose: () => setPendingConflict(null),
|
|
467
|
+
onResolve: handleConflictResolve
|
|
468
|
+
}
|
|
469
|
+
),
|
|
470
|
+
/* @__PURE__ */ jsxs(
|
|
471
|
+
Dialog,
|
|
472
|
+
{
|
|
473
|
+
open: pendingReplace !== null,
|
|
474
|
+
onOpenChange: (o) => !o && setPendingReplace(null),
|
|
475
|
+
children: [
|
|
476
|
+
/* @__PURE__ */ jsx(Dialog.Header, { children: "Replace all collections?" }),
|
|
477
|
+
/* @__PURE__ */ jsxs(Dialog.Body, { children: [
|
|
478
|
+
/* @__PURE__ */ jsx("p", { className: "graphiql-conflict-summary", children: "This will remove all existing collections and replace them with the imported data. This cannot be undone." }),
|
|
479
|
+
/* @__PURE__ */ jsxs("div", { className: "graphiql-conflict-actions", children: [
|
|
480
|
+
/* @__PURE__ */ jsx(
|
|
481
|
+
Button,
|
|
482
|
+
{
|
|
483
|
+
type: "button",
|
|
484
|
+
variant: "primary",
|
|
485
|
+
onClick: () => {
|
|
486
|
+
const text = pendingReplace;
|
|
487
|
+
setPendingReplace(null);
|
|
488
|
+
if (text !== null) {
|
|
489
|
+
applyReplace(text);
|
|
490
|
+
}
|
|
491
|
+
},
|
|
492
|
+
children: "Replace"
|
|
493
|
+
}
|
|
494
|
+
),
|
|
495
|
+
/* @__PURE__ */ jsx(Button, { type: "button", onClick: () => setPendingReplace(null), children: "Cancel" })
|
|
496
|
+
] })
|
|
497
|
+
] })
|
|
498
|
+
]
|
|
499
|
+
}
|
|
500
|
+
)
|
|
501
|
+
]
|
|
502
|
+
}
|
|
503
|
+
);
|
|
504
|
+
};
|
|
505
|
+
export {
|
|
506
|
+
CollectionsPanel
|
|
507
|
+
};
|
|
508
|
+
//# sourceMappingURL=collections-panel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collections-panel.js","sources":["../../src/components/collections-panel.tsx"],"sourcesContent":["import { FC, useEffect, useRef, useState } from 'react';\nimport {\n Button,\n Dialog,\n PanelHeader,\n pick,\n useGraphiQL,\n useGraphiQLActions,\n} from '@graphiql/react';\nimport { useCollectionsStore, collectionsStore } from '../store';\nimport { CollectionRow } from './collection-row';\nimport { ImportDialog } from './import-dialog';\nimport { ExportDialog } from './export-dialog';\nimport { ConflictDialog } from './conflict-dialog';\nimport DownloadIcon from '../icons/download.svg?react';\nimport UploadIcon from '../icons/upload.svg?react';\nimport type {\n CollectionItem,\n ImportAnalysis,\n ImportResolution,\n} from '../types';\n\ntype CollectionsPanelProps = {\n /** Capability flags; all default on. See `CollectionsConfig`. */\n readOnly?: boolean;\n allowImportExport?: boolean;\n allowReplace?: boolean;\n};\n\n/**\n * Returns how many collections `text` holds if it is a valid collections\n * export, otherwise `null`. Used to guard paste/drop so non-collections content\n * is ignored rather than mangled.\n */\nfunction parseCollectionsExport(text: string): number | null {\n try {\n const parsed = JSON.parse(text);\n const list = Array.isArray(parsed?.collections)\n ? parsed.collections\n : Array.isArray(parsed)\n ? parsed\n : null;\n if (\n !list?.length ||\n !list.every(\n (c: unknown) =>\n c &&\n typeof c === 'object' &&\n Array.isArray((c as { items?: unknown }).items),\n )\n ) {\n return null;\n }\n return list.length;\n } catch {\n return null;\n }\n}\n\nfunction isEditableTarget(el: Element | null): boolean {\n if (!el) {\n return false;\n }\n return (\n el.tagName === 'INPUT' ||\n el.tagName === 'TEXTAREA' ||\n (el as HTMLElement).isContentEditable ||\n Boolean(el.closest('.monaco-editor'))\n );\n}\n\n/** Derive a human-readable label from the parsed incoming collections. */\nfunction deriveSourceLabel(incoming: ImportAnalysis['_incoming']): string {\n if (incoming.length === 1 && incoming[0]) {\n return incoming[0].name;\n }\n return `${incoming.length} collections`;\n}\n\nexport const CollectionsPanel: FC<CollectionsPanelProps> = ({\n readOnly = false,\n allowImportExport = true,\n allowReplace = true,\n}) => {\n // Importing is a write; it's available only when both writes and the\n // import/export feature are enabled.\n const allowImport = !readOnly && allowImportExport;\n const actions = useCollectionsStore(s => s.actions);\n const collections = useCollectionsStore(s => s.collections);\n const loaded = useCollectionsStore(s => s.loaded);\n const [openDialog, setOpenDialog] = useState<'import' | 'export' | null>(\n null,\n );\n const [isDragOver, setIsDragOver] = useState(false);\n const [status, setStatus] = useState<{ ok: boolean; message: string } | null>(\n null,\n );\n const [pendingConflict, setPendingConflict] = useState<{\n analysis: ImportAnalysis;\n sourceLabel: string;\n } | null>(null);\n // Text awaiting replace confirmation (destructive, so we prompt before applying).\n const [pendingReplace, setPendingReplace] = useState<string | null>(null);\n\n // Expand/collapse state (collapsed collection ids).\n const [collapsed, setCollapsed] = useState<Set<string>>(new Set());\n const [grabbed, setGrabbed] = useState<{\n collectionId: string;\n index: number;\n itemId: string;\n } | null>(null);\n const [origin, setOrigin] = useState<{\n collectionId: string;\n index: number;\n } | null>(null);\n const [liveMessage, setLiveMessage] = useState('');\n const listRef = useRef<HTMLDivElement>(null);\n const cancelledItemRef = useRef<string | null>(null);\n\n // Clear the import feedback after a few seconds.\n useEffect(() => {\n if (!status) {\n return;\n }\n const timer = setTimeout(() => setStatus(null), 4000);\n return () => clearTimeout(timer);\n }, [status]);\n\n const applyReplace = (text: string) => {\n const analysis = collectionsStore.getState().actions.analyzeImport(text);\n collectionsStore\n .getState()\n .actions.applyImport(analysis, { mode: 'replace' });\n };\n\n const runImport = (text: string, mode: 'merge' | 'replace') => {\n if (mode === 'replace') {\n setPendingReplace(text);\n return;\n }\n\n // merge path\n const count = parseCollectionsExport(text);\n if (count === null) {\n setStatus({\n ok: false,\n message: \"That file isn't a collections export.\",\n });\n return;\n }\n const analysis = collectionsStore.getState().actions.analyzeImport(text);\n if (!analysis.ok) {\n setStatus({ ok: false, message: 'Invalid collections export.' });\n return;\n }\n if (analysis.changedItems.length === 0) {\n // No conflicts — apply immediately.\n collectionsStore\n .getState()\n .actions.applyImport(analysis, { mode: 'merge', applyChanges: true });\n return;\n }\n // Conflicts present — open the dialog.\n setPendingConflict({\n analysis,\n sourceLabel: deriveSourceLabel(analysis._incoming),\n });\n };\n\n const handleConflictResolve = (resolution: ImportResolution) => {\n if (!pendingConflict) {\n return;\n }\n const { analysis } = pendingConflict;\n collectionsStore.getState().actions.applyImport(analysis, resolution);\n setPendingConflict(null);\n };\n\n const importDroppedFile = async (file: File) => {\n const text = await file.text();\n if (parseCollectionsExport(text) === null) {\n setStatus({\n ok: false,\n message: \"That file isn't a collections export.\",\n });\n return;\n }\n runImport(text, 'merge');\n };\n\n // Keep a live ref so the once-bound paste listener honors current config.\n const allowImportRef = useRef(allowImport);\n allowImportRef.current = allowImport;\n\n // Paste a collections export anywhere in the open panel to merge it in.\n // Guarded so it never hijacks a normal paste: ignored while typing in an\n // editor/input, ignored unless the clipboard parses as an export, and\n // ignored entirely when importing is disabled.\n useEffect(() => {\n const onPaste = (event: ClipboardEvent) => {\n if (!allowImportRef.current) {\n return;\n }\n if (isEditableTarget(document.activeElement)) {\n return;\n }\n const text = event.clipboardData?.getData('text') ?? '';\n if (parseCollectionsExport(text) === null) {\n return;\n }\n event.preventDefault();\n runImport(text, 'merge');\n };\n document.addEventListener('paste', onPaste);\n return () => document.removeEventListener('paste', onPaste);\n // bound once: only stable refs (store, setStatus) are used\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n const { addTab, changeTab, updateActiveTabValues } = useGraphiQLActions();\n const { queryEditor, variableEditor, headerEditor } = useGraphiQL(\n pick('queryEditor', 'variableEditor', 'headerEditor'),\n );\n const tabs = useGraphiQL(s => s.tabs);\n const activeTabId = useGraphiQL(s => s.tabs[s.activeTabIndex]?.id);\n\n // Opening an item creates a tab, then links it once the new tab is active so\n // ⌘S updates the saved item in place rather than reopening the dialog.\n const pendingLink = useRef<{ collectionId: string; itemId: string } | null>(\n null,\n );\n useEffect(() => {\n const link = pendingLink.current;\n if (link && activeTabId) {\n actions.linkTab(activeTabId, link.collectionId, link.itemId);\n pendingLink.current = null;\n }\n }, [activeTabId, actions]);\n\n const handleOpen = (item: CollectionItem) => {\n // A saved operation is married to its tab. If that tab is still open, just\n // focus it rather than opening a duplicate — and leave its contents alone so\n // any in-progress edits survive. Links persist across reloads, so this holds\n // after a page refresh too.\n const { links } = collectionsStore.getState();\n const openIndex = tabs.findIndex(\n t => t.id && links[t.id]?.itemId === item.id,\n );\n if (openIndex !== -1) {\n changeTab(openIndex);\n return;\n }\n\n const collectionId = collections.find(c =>\n c.items.some(i => i.id === item.id),\n )?.id;\n if (collectionId) {\n pendingLink.current = { collectionId, itemId: item.id };\n }\n addTab();\n // `addTab` resets the editors to the new empty tab, so populate them with\n // the saved operation. The editors' change handlers sync this back to tab\n // state; `updateActiveTabValues` covers the case where an editor isn't\n // mounted yet. Seed `lastSavedQuery` too so the freshly opened tab matches\n // its saved item and doesn't show as dirty.\n queryEditor?.setValue(item.query ?? '');\n variableEditor?.setValue(item.variables ?? '');\n headerEditor?.setValue(item.headers ?? '');\n updateActiveTabValues({\n query: item.query,\n variables: item.variables ?? '',\n headers: item.headers ?? '',\n lastSavedQuery: item.query ?? null,\n });\n };\n\n const announce = (message: string) => setLiveMessage(message);\n\n const handleShareCollection = async (collectionId: string) => {\n const json = collectionsStore\n .getState()\n .actions.exportCollection(collectionId);\n await navigator.clipboard.writeText(json);\n };\n\n const handleShareItem = async (itemId: string) => {\n const json = collectionsStore.getState().actions.exportItem(itemId);\n await navigator.clipboard.writeText(json);\n };\n\n const handleRename = actions.renameCollection;\n const handleDelete = actions.deleteCollection;\n const handleDeleteItem = actions.deleteItem;\n const handleMoveItem = actions.moveItem;\n const handleAddItem = actions.addItem;\n const handleRenameItem = (\n collectionId: string,\n itemId: string,\n updates: { name: string; description: string },\n ) => {\n collectionsStore.getState().actions.updateItem(collectionId, itemId, {\n name: updates.name,\n description: updates.description || undefined,\n });\n };\n\n const toggleExpand = (id: string) =>\n setCollapsed(prev => {\n const next = new Set(prev);\n if (next.has(id)) {\n next.delete(id);\n } else {\n next.add(id);\n }\n return next;\n });\n\n const expand = (id: string) =>\n setCollapsed(prev => {\n if (!prev.has(id)) {\n return prev;\n }\n const next = new Set(prev);\n next.delete(id);\n return next;\n });\n\n const handleGrabToggle = (\n collectionId: string,\n index: number,\n itemId: string,\n ) => {\n if (grabbed) {\n const cols = collectionsStore.getState().collections;\n const col = cols.find(c => c.id === grabbed.collectionId);\n const droppedItem = col?.items[grabbed.index];\n setLiveMessage(\n `Dropped ${droppedItem?.name ?? grabbed.itemId} in ${col?.name ?? ''} at position ${grabbed.index + 1}.`,\n );\n setGrabbed(null);\n setOrigin(null);\n return;\n }\n setGrabbed({ collectionId, index, itemId });\n setOrigin({ collectionId, index });\n const item = collectionsStore\n .getState()\n .collections.find(c => c.id === collectionId)?.items[index];\n setLiveMessage(\n `Grabbed ${item?.name ?? itemId}. Use arrow keys to move, space to drop, escape to cancel.`,\n );\n };\n\n const handleGrabMove = (direction: 'up' | 'down') => {\n if (!grabbed) {\n return;\n }\n const cols = collectionsStore.getState().collections;\n const cIdx = cols.findIndex(c => c.id === grabbed.collectionId);\n const col = cols[cIdx];\n if (!col) {\n return;\n }\n const { moveItem } = collectionsStore.getState().actions;\n\n if (direction === 'down') {\n if (grabbed.index < col.items.length - 1) {\n moveItem(col.id, grabbed.index, col.id, grabbed.index + 1);\n const next = { ...grabbed, index: grabbed.index + 1 };\n setGrabbed(next);\n setLiveMessage(\n `Position ${next.index + 1} of ${col.items.length} in ${col.name}.`,\n );\n } else if (cIdx < cols.length - 1) {\n const dest = cols[cIdx + 1]!;\n expand(dest.id);\n moveItem(col.id, grabbed.index, dest.id, 0);\n setGrabbed({ collectionId: dest.id, index: 0, itemId: grabbed.itemId });\n setLiveMessage(\n `Moved to ${dest.name}, position 1 of ${dest.items.length + 1}.`,\n );\n } else {\n setLiveMessage('Already at the end.');\n }\n } else if (grabbed.index > 0) {\n moveItem(col.id, grabbed.index, col.id, grabbed.index - 1);\n const next = { ...grabbed, index: grabbed.index - 1 };\n setGrabbed(next);\n setLiveMessage(\n `Position ${next.index + 1} of ${col.items.length} in ${col.name}.`,\n );\n } else if (cIdx > 0) {\n const dest = cols[cIdx - 1]!;\n expand(dest.id);\n const toIndex = dest.items.length;\n moveItem(col.id, grabbed.index, dest.id, toIndex);\n setGrabbed({\n collectionId: dest.id,\n index: toIndex,\n itemId: grabbed.itemId,\n });\n setLiveMessage(\n `Moved to ${dest.name}, position ${toIndex + 1} of ${dest.items.length + 1}.`,\n );\n } else {\n setLiveMessage('Already at the start.');\n }\n };\n\n const handleGrabCancel = () => {\n if (!grabbed || !origin) {\n return;\n }\n collectionsStore\n .getState()\n .actions.moveItem(\n grabbed.collectionId,\n grabbed.index,\n origin.collectionId,\n origin.index,\n );\n cancelledItemRef.current = grabbed.itemId;\n setGrabbed(null);\n setOrigin(null);\n setLiveMessage('Move cancelled.');\n };\n\n useEffect(() => {\n if (grabbed) {\n listRef.current\n ?.querySelector<HTMLElement>(\n `[data-collection-drag-handle=\"${grabbed.itemId}\"]`,\n )\n ?.focus();\n } else if (cancelledItemRef.current) {\n listRef.current\n ?.querySelector<HTMLElement>(\n `[data-collection-drag-handle=\"${cancelledItemRef.current}\"]`,\n )\n ?.focus();\n cancelledItemRef.current = null;\n }\n }, [grabbed]);\n\n return (\n <div\n className={`graphiql-collections-panel${isDragOver ? ' graphiql-collections-drop-active' : ''}`}\n onDragOver={e => {\n if (!allowImport || !e.dataTransfer.types.includes('Files')) {\n return;\n }\n e.preventDefault();\n setIsDragOver(true);\n }}\n onDragLeave={e => {\n if (e.currentTarget.contains(e.relatedTarget as Node | null)) {\n return;\n }\n setIsDragOver(false);\n }}\n onDrop={e => {\n if (!allowImport) {\n return;\n }\n const file = e.dataTransfer.files[0];\n if (!file) {\n return; // not a file drop (e.g. an item being reordered)\n }\n e.preventDefault();\n setIsDragOver(false);\n void importDroppedFile(file);\n }}\n >\n <PanelHeader\n title=\"Operation Collections\"\n subtitle=\"Save and organize operations into collections.\"\n />\n {(!readOnly || allowImportExport) && (\n <div className=\"graphiql-collections-toolbar\">\n <div className=\"graphiql-collections-toolbar-left\">\n {!readOnly && (\n <button\n type=\"button\"\n className=\"graphiql-collections-action\"\n onClick={() =>\n collectionsStore\n .getState()\n .actions.createCollection('New Collection')\n }\n aria-label=\"New collection\"\n title=\"New collection\"\n >\n + New Collection\n </button>\n )}\n </div>\n <div className=\"graphiql-collections-toolbar-right\">\n {allowImport && (\n <button\n type=\"button\"\n className=\"graphiql-collections-action\"\n onClick={() => setOpenDialog('import')}\n aria-label=\"Import collections\"\n title=\"Import collections\"\n >\n <DownloadIcon />\n </button>\n )}\n {allowImportExport && (\n <button\n type=\"button\"\n className=\"graphiql-collections-action\"\n onClick={() => setOpenDialog('export')}\n aria-label=\"Export collections\"\n title=\"Export collections\"\n >\n <UploadIcon />\n </button>\n )}\n </div>\n </div>\n )}\n {status && (\n <div\n className={`graphiql-collections-status${status.ok ? '' : ' graphiql-collections-status-error'}`}\n role=\"status\"\n >\n {status.message}\n </div>\n )}\n {!loaded && <div className=\"graphiql-collections-loading\">Loading…</div>}\n {loaded && collections.length === 0 && (\n <div className=\"graphiql-collections-empty\">\n {readOnly\n ? 'No collections.'\n : allowImport\n ? 'No collections yet. Save an operation to get started, or drop or paste a collections export to import one.'\n : 'No collections yet. Save an operation to get started.'}\n </div>\n )}\n <div\n className=\"graphiql-sr-only\"\n aria-live=\"assertive\"\n aria-atomic=\"true\"\n >\n {liveMessage}\n </div>\n <div className=\"graphiql-collections-list\" ref={listRef}>\n {collections.map(collection => (\n <CollectionRow\n key={collection.id}\n collection={collection}\n readOnly={readOnly}\n expanded={!collapsed.has(collection.id)}\n onToggleExpand={() => toggleExpand(collection.id)}\n grabbed={grabbed}\n onGrabToggle={handleGrabToggle}\n onGrabMove={handleGrabMove}\n onGrabCancel={handleGrabCancel}\n onRename={handleRename}\n onDelete={handleDelete}\n onShareCollection={handleShareCollection}\n onOpenItem={handleOpen}\n onShare={handleShareItem}\n onAnnounce={announce}\n onDeleteItem={handleDeleteItem}\n onMoveItem={handleMoveItem}\n onAddItem={handleAddItem}\n onRenameItem={handleRenameItem}\n />\n ))}\n </div>\n {allowImportExport && (\n <ExportDialog\n open={openDialog === 'export'}\n onClose={() => setOpenDialog(null)}\n />\n )}\n {allowImport && (\n <ImportDialog\n open={openDialog === 'import'}\n onClose={() => setOpenDialog(null)}\n onImport={runImport}\n allowReplace={allowReplace}\n />\n )}\n {pendingConflict && (\n <ConflictDialog\n analysis={pendingConflict.analysis}\n sourceLabel={pendingConflict.sourceLabel}\n open\n onClose={() => setPendingConflict(null)}\n onResolve={handleConflictResolve}\n />\n )}\n <Dialog\n open={pendingReplace !== null}\n onOpenChange={o => !o && setPendingReplace(null)}\n >\n <Dialog.Header>Replace all collections?</Dialog.Header>\n <Dialog.Body>\n <p className=\"graphiql-conflict-summary\">\n This will remove all existing collections and replace them with the\n imported data. This cannot be undone.\n </p>\n <div className=\"graphiql-conflict-actions\">\n <Button\n type=\"button\"\n variant=\"primary\"\n onClick={() => {\n const text = pendingReplace;\n setPendingReplace(null);\n if (text !== null) {\n applyReplace(text);\n }\n }}\n >\n Replace\n </Button>\n <Button type=\"button\" onClick={() => setPendingReplace(null)}>\n Cancel\n </Button>\n </div>\n </Dialog.Body>\n </Dialog>\n </div>\n );\n};\n"],"names":["_a","DownloadIcon","UploadIcon"],"mappings":";;;;;;;;;;AAkCA,SAAS,uBAAuB,MAA6B;AACvD,MAAA;AACI,UAAA,SAAS,KAAK,MAAM,IAAI;AAC9B,UAAM,OAAO,MAAM,QAAQ,iCAAQ,WAAW,IAC1C,OAAO,cACP,MAAM,QAAQ,MAAM,IAClB,SACA;AACN,QACE,EAAC,6BAAM,WACP,CAAC,KAAK;AAAA,MACJ,CAAC,MACC,KACA,OAAO,MAAM,YACb,MAAM,QAAS,EAA0B,KAAK;AAAA,IAAA,GAElD;AACO,aAAA;AAAA,IAAA;AAET,WAAO,KAAK;AAAA,EAAA,QACN;AACC,WAAA;AAAA,EAAA;AAEX;AAEA,SAAS,iBAAiB,IAA6B;AACrD,MAAI,CAAC,IAAI;AACA,WAAA;AAAA,EAAA;AAET,SACE,GAAG,YAAY,WACf,GAAG,YAAY,cACd,GAAmB,qBACpB,QAAQ,GAAG,QAAQ,gBAAgB,CAAC;AAExC;AAGA,SAAS,kBAAkB,UAA+C;AACxE,MAAI,SAAS,WAAW,KAAK,SAAS,CAAC,GAAG;AACjC,WAAA,SAAS,CAAC,EAAE;AAAA,EAAA;AAEd,SAAA,GAAG,SAAS,MAAM;AAC3B;AAEO,MAAM,mBAA8C,CAAC;AAAA,EA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AAO,MAAP,EACC,UAAA;AAAA,gBAAC,oBAAA,KAAA,EAAE,WAAU,6BAA4B,UAGzC,6GAAA;AAAA,gBACA,qBAAC,OAAI,EAAA,WAAU,6BACb,UAAA;AAAA,kBAAA;AAAA,oBAAC;AAAA,oBAAA;AAAA,sBACC,MAAK;AAAA,sBACL,SAAQ;AAAA,sBACR,SAAS,MAAM;AACb,8BAAM,OAAO;AACb,0CAAkB,IAAI;AACtB,4BAAI,SAAS,MAAM;AACjB,uCAAa,IAAI;AAAA,wBAAA;AAAA,sBAErB;AAAA,sBACD,UAAA;AAAA,oBAAA;AAAA,kBAED;AAAA,kBACA,oBAAC,UAAO,MAAK,UAAS,SAAS,MAAM,kBAAkB,IAAI,GAAG,UAE9D,SAAA,CAAA;AAAA,gBAAA,EACF,CAAA;AAAA,cAAA,EACF,CAAA;AAAA,YAAA;AAAA,UAAA;AAAA,QAAA;AAAA,MACF;AAAA,IAAA;AAAA,EACF;AAEJ;"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { ImportAnalysis, ImportResolution } from '../types';
|
|
3
|
+
type ConflictDialogProps = {
|
|
4
|
+
analysis: ImportAnalysis;
|
|
5
|
+
sourceLabel: string;
|
|
6
|
+
open: boolean;
|
|
7
|
+
onClose(): void;
|
|
8
|
+
onResolve(resolution: ImportResolution): void;
|
|
9
|
+
};
|
|
10
|
+
export declare const ConflictDialog: FC<ConflictDialogProps>;
|
|
11
|
+
export {};
|