@graphiql/plugin-collections 0.0.0 → 1.0.0-beta.0

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 (57) hide show
  1. package/README.md +162 -0
  2. package/dist/collections.stories.d.ts +14 -0
  3. package/dist/components/collection-item-row.d.ts +25 -0
  4. package/dist/components/collection-item-row.js +286 -0
  5. package/dist/components/collection-item-row.js.map +1 -0
  6. package/dist/components/collection-row.d.ts +32 -0
  7. package/dist/components/collection-row.js +162 -0
  8. package/dist/components/collection-row.js.map +1 -0
  9. package/dist/components/collections-panel.d.ts +9 -0
  10. package/dist/components/collections-panel.js +508 -0
  11. package/dist/components/collections-panel.js.map +1 -0
  12. package/dist/components/conflict-dialog.d.ts +11 -0
  13. package/dist/components/conflict-dialog.js +169 -0
  14. package/dist/components/conflict-dialog.js.map +1 -0
  15. package/dist/components/export-dialog.d.ts +7 -0
  16. package/dist/components/export-dialog.js +54 -0
  17. package/dist/components/export-dialog.js.map +1 -0
  18. package/dist/components/import-dialog.d.ts +10 -0
  19. package/dist/components/import-dialog.js +114 -0
  20. package/dist/components/import-dialog.js.map +1 -0
  21. package/dist/components/save-dialog.d.ts +7 -0
  22. package/dist/components/save-dialog.js +125 -0
  23. package/dist/components/save-dialog.js.map +1 -0
  24. package/dist/components/session-actions.d.ts +9 -0
  25. package/dist/components/session-actions.js +34 -0
  26. package/dist/components/session-actions.js.map +1 -0
  27. package/dist/icons/check.js +10 -0
  28. package/dist/icons/check.js.map +1 -0
  29. package/dist/icons/collections.js +10 -0
  30. package/dist/icons/collections.js.map +1 -0
  31. package/dist/icons/download.js +10 -0
  32. package/dist/icons/download.js.map +1 -0
  33. package/dist/icons/upload.js +10 -0
  34. package/dist/icons/upload.js.map +1 -0
  35. package/dist/index.d.ts +17 -0
  36. package/dist/index.js +46 -0
  37. package/dist/index.js.map +1 -0
  38. package/dist/operation-method.d.ts +10 -0
  39. package/dist/operation-method.js +28 -0
  40. package/dist/operation-method.js.map +1 -0
  41. package/dist/storage/local-storage.d.ts +3 -0
  42. package/dist/storage/local-storage.js +39 -0
  43. package/dist/storage/local-storage.js.map +1 -0
  44. package/dist/storage/tab-links.d.ts +7 -0
  45. package/dist/storage/tab-links.js +36 -0
  46. package/dist/storage/tab-links.js.map +1 -0
  47. package/dist/store.d.ts +78 -0
  48. package/dist/store.js +413 -0
  49. package/dist/store.js.map +1 -0
  50. package/dist/style.css +442 -0
  51. package/dist/types.d.ts +80 -0
  52. package/dist/types.js +9 -0
  53. package/dist/types.js.map +1 -0
  54. package/dist/utility/uuid.d.ts +4 -0
  55. package/dist/utility/uuid.js +11 -0
  56. package/dist/utility/uuid.js.map +1 -0
  57. package/package.json +60 -1
package/dist/style.css ADDED
@@ -0,0 +1,442 @@
1
+ .graphiql-collections-panel {
2
+ flex-direction: column;
3
+ height: 100%;
4
+ display: flex;
5
+ overflow: hidden;
6
+ }
7
+
8
+ .graphiql-collections-drop-active {
9
+ outline: 2px dashed oklch(var(--accent-blue));
10
+ outline-offset: -4px;
11
+ }
12
+
13
+ .graphiql-collections-status {
14
+ padding: var(--px-4) var(--px-12);
15
+ font-size: var(--font-size-eyebrow);
16
+ color: oklch(var(--accent-green));
17
+ }
18
+
19
+ .graphiql-collections-status-error {
20
+ color: oklch(var(--accent-red));
21
+ }
22
+
23
+ .graphiql-collections-list {
24
+ flex: 1;
25
+ overflow-y: auto;
26
+ }
27
+
28
+ .graphiql-collections-empty, .graphiql-collections-loading {
29
+ padding: var(--px-8) var(--px-12);
30
+ color: oklch(var(--fg-subtle));
31
+ font-size: var(--font-size-eyebrow);
32
+ }
33
+
34
+ .graphiql-collections-toolbar {
35
+ padding: var(--px-6) var(--px-8);
36
+ border-bottom: 1px solid oklch(var(--border-default) / .5);
37
+ justify-content: space-between;
38
+ align-items: center;
39
+ gap: var(--px-4);
40
+ flex-shrink: 0;
41
+ display: flex;
42
+ }
43
+
44
+ .graphiql-collections-toolbar-left, .graphiql-collections-toolbar-right {
45
+ align-items: center;
46
+ gap: var(--px-4);
47
+ display: flex;
48
+ }
49
+
50
+ .graphiql-collections-action {
51
+ all: unset;
52
+ cursor: pointer;
53
+ padding: var(--px-4) var(--px-8);
54
+ border-radius: var(--border-radius-4);
55
+ color: oklch(var(--fg-subtle));
56
+ font-size: var(--font-size-eyebrow);
57
+ }
58
+
59
+ .graphiql-collections-action:hover {
60
+ background: oklch(var(--bg-subtle));
61
+ color: oklch(var(--fg-default));
62
+ }
63
+
64
+ .graphiql-collections-action svg {
65
+ width: var(--px-16);
66
+ height: var(--px-16);
67
+ display: block;
68
+ }
69
+
70
+ .graphiql-collection-row {
71
+ border-bottom: 1px solid oklch(var(--border-default) / .5);
72
+ }
73
+
74
+ .graphiql-collection-header {
75
+ align-items: center;
76
+ gap: var(--px-8);
77
+ padding: var(--px-8) var(--px-12);
78
+ cursor: pointer;
79
+ -webkit-user-select: none;
80
+ user-select: none;
81
+ display: flex;
82
+ }
83
+
84
+ .graphiql-collection-header:hover {
85
+ background: oklch(var(--bg-subtle));
86
+ }
87
+
88
+ .graphiql-collection-toggle {
89
+ all: unset;
90
+ align-items: center;
91
+ gap: var(--px-8);
92
+ cursor: pointer;
93
+ flex: 1;
94
+ min-width: 0;
95
+ display: flex;
96
+ }
97
+
98
+ .graphiql-collection-toggle:focus-visible {
99
+ outline: 2px solid oklch(var(--accent-blue));
100
+ outline-offset: -2px;
101
+ border-radius: var(--border-radius-4);
102
+ }
103
+
104
+ .graphiql-collection-name {
105
+ min-width: 0;
106
+ font-size: var(--font-size-body);
107
+ color: oklch(var(--fg-default));
108
+ text-overflow: ellipsis;
109
+ white-space: nowrap;
110
+ flex: 1;
111
+ font-weight: 500;
112
+ overflow: hidden;
113
+ }
114
+
115
+ .graphiql-collection-rename-input {
116
+ font-size: var(--font-size-body);
117
+ background: oklch(var(--bg-subtle));
118
+ border: 1px solid oklch(var(--border-default));
119
+ border-radius: var(--border-radius-4);
120
+ padding: 2px var(--px-6);
121
+ color: oklch(var(--fg-default));
122
+ flex: 1;
123
+ }
124
+
125
+ .graphiql-collection-badge {
126
+ font-size: var(--font-size-eyebrow);
127
+ color: oklch(var(--fg-subtle));
128
+ background: oklch(var(--bg-subtle));
129
+ padding: 0 var(--px-6);
130
+ border-radius: 9999px;
131
+ }
132
+
133
+ .graphiql-collection-chevron {
134
+ font-size: var(--font-size-eyebrow);
135
+ color: oklch(var(--fg-subtle));
136
+ flex-shrink: 0;
137
+ }
138
+
139
+ .graphiql-collection-header-actions, .graphiql-collection-item-actions {
140
+ align-items: center;
141
+ gap: var(--px-2);
142
+ flex-shrink: 0;
143
+ display: flex;
144
+ }
145
+
146
+ .graphiql-collection-header-action, .graphiql-collection-item-action {
147
+ all: unset;
148
+ cursor: pointer;
149
+ padding: var(--px-4);
150
+ border-radius: var(--border-radius-4);
151
+ color: oklch(var(--fg-subtle));
152
+ opacity: 0;
153
+ align-items: center;
154
+ transition: opacity .1s;
155
+ display: flex;
156
+ }
157
+
158
+ .graphiql-collection-header:hover .graphiql-collection-header-action, .graphiql-collection-item-row:hover .graphiql-collection-item-action {
159
+ opacity: 1;
160
+ }
161
+
162
+ .graphiql-collection-header-action:focus-visible {
163
+ opacity: 1;
164
+ }
165
+
166
+ .graphiql-collection-item-action:focus-visible {
167
+ opacity: 1;
168
+ }
169
+
170
+ .graphiql-collection-header-action:hover, .graphiql-collection-item-action:hover {
171
+ color: oklch(var(--fg-default));
172
+ background: oklch(var(--bg-subtle));
173
+ }
174
+
175
+ .graphiql-collection-header-action:focus-visible {
176
+ outline: 2px solid oklch(var(--accent-blue));
177
+ outline-offset: -2px;
178
+ }
179
+
180
+ .graphiql-collection-item-action:focus-visible {
181
+ outline: 2px solid oklch(var(--accent-blue));
182
+ outline-offset: -2px;
183
+ }
184
+
185
+ .graphiql-collection-header-action[data-confirmed], .graphiql-collection-item-action[data-confirmed] {
186
+ color: oklch(var(--accent-green));
187
+ }
188
+
189
+ .graphiql-collection-header-action svg, .graphiql-collection-item-action svg {
190
+ width: var(--px-16);
191
+ height: var(--px-16);
192
+ display: block;
193
+ }
194
+
195
+ .graphiql-collection-items {
196
+ padding: 0 0 var(--px-4);
197
+ }
198
+
199
+ .graphiql-collection-empty-hint {
200
+ padding: var(--px-6) var(--px-12) var(--px-8) var(--px-20);
201
+ font-size: var(--font-size-eyebrow);
202
+ color: oklch(var(--fg-subtle));
203
+ font-style: italic;
204
+ }
205
+
206
+ .graphiql-collection-item-row {
207
+ align-items: center;
208
+ gap: var(--px-8);
209
+ padding: var(--px-6) var(--px-12) var(--px-6) var(--px-20);
210
+ cursor: pointer;
211
+ display: flex;
212
+ }
213
+
214
+ .graphiql-collection-item-row:hover {
215
+ background: oklch(var(--bg-subtle));
216
+ }
217
+
218
+ .graphiql-collection-item-row[data-grabbed="true"] {
219
+ opacity: .5;
220
+ }
221
+
222
+ .graphiql-collection-item-name {
223
+ font-size: var(--font-size-body);
224
+ color: oklch(var(--fg-default));
225
+ text-overflow: ellipsis;
226
+ white-space: nowrap;
227
+ overflow: hidden;
228
+ }
229
+
230
+ .graphiql-collection-drag-handle {
231
+ all: unset;
232
+ cursor: grab;
233
+ color: oklch(var(--fg-subtle));
234
+ flex-shrink: 0;
235
+ }
236
+
237
+ .graphiql-collection-drag-handle:focus-visible {
238
+ outline: 2px solid oklch(var(--accent-blue));
239
+ outline-offset: -2px;
240
+ border-radius: var(--border-radius-4);
241
+ }
242
+
243
+ .graphiql-collection-drag-handle:disabled {
244
+ cursor: default;
245
+ }
246
+
247
+ .graphiql-collection-drop-target {
248
+ outline: 2px solid oklch(var(--accent-blue));
249
+ outline-offset: -2px;
250
+ }
251
+
252
+ .graphiql-collection-method-pill-mix {
253
+ color: #f8f8f8;
254
+ color: color(display-p3 .973691 .973691 .973691);
255
+ color: lab(97.68% -.0000298023 .0000119209);
256
+ background: #6d717e;
257
+ background: color(display-p3 .429873 .443602 .48851);
258
+ background: lab(47.6814% .289828 -7.49383);
259
+ }
260
+
261
+ .graphiql-collection-item-main {
262
+ flex-direction: column;
263
+ flex: 1;
264
+ min-width: 0;
265
+ display: flex;
266
+ }
267
+
268
+ .graphiql-collection-item-description {
269
+ font-size: var(--font-size-eyebrow);
270
+ color: oklch(var(--fg-subtle));
271
+ text-overflow: ellipsis;
272
+ white-space: nowrap;
273
+ overflow: hidden;
274
+ }
275
+
276
+ .graphiql-collection-item-edit-form {
277
+ gap: var(--px-4);
278
+ flex-direction: column;
279
+ flex: 1;
280
+ min-width: 0;
281
+ display: flex;
282
+ }
283
+
284
+ .graphiql-collection-item-edit-input {
285
+ font-size: var(--font-size-body);
286
+ background: oklch(var(--bg-subtle));
287
+ border: 1px solid oklch(var(--border-default));
288
+ border-radius: var(--border-radius-4);
289
+ padding: 2px var(--px-6);
290
+ color: oklch(var(--fg-default));
291
+ width: 100%;
292
+ }
293
+
294
+ .graphiql-save-dialog-field {
295
+ gap: var(--px-4);
296
+ font-size: var(--font-size-eyebrow);
297
+ color: oklch(var(--fg-subtle));
298
+ flex-direction: column;
299
+ display: flex;
300
+ }
301
+
302
+ .graphiql-save-dialog-input, .graphiql-save-dialog-select {
303
+ background: oklch(var(--bg-subtle));
304
+ border: 1px solid oklch(var(--border-default));
305
+ border-radius: var(--radius-sm);
306
+ padding: var(--px-6) var(--px-8);
307
+ color: oklch(var(--fg-default));
308
+ font-size: var(--font-size-body);
309
+ }
310
+
311
+ .graphiql-save-dialog-input:focus-visible {
312
+ outline: 2px solid oklch(var(--accent-blue));
313
+ outline-offset: -1px;
314
+ }
315
+
316
+ .graphiql-save-dialog-select:focus-visible {
317
+ outline: 2px solid oklch(var(--accent-blue));
318
+ outline-offset: -1px;
319
+ }
320
+
321
+ .graphiql-import-export-section {
322
+ gap: var(--px-8);
323
+ flex-direction: column;
324
+ display: flex;
325
+ }
326
+
327
+ .graphiql-import-export-textarea {
328
+ background: oklch(var(--bg-subtle));
329
+ border: 1px solid oklch(var(--border-default));
330
+ border-radius: var(--radius-sm);
331
+ width: 100%;
332
+ padding: var(--px-8);
333
+ color: oklch(var(--fg-default));
334
+ font-family: var(--font-family-mono);
335
+ resize: vertical;
336
+ font-size: 12px;
337
+ }
338
+
339
+ .graphiql-import-export-actions {
340
+ gap: var(--px-8);
341
+ align-self: flex-start;
342
+ display: flex;
343
+ }
344
+
345
+ .graphiql-import-export-mode {
346
+ gap: var(--px-4);
347
+ border: none;
348
+ flex-direction: column;
349
+ margin: 0;
350
+ padding: 0;
351
+ display: flex;
352
+ }
353
+
354
+ .graphiql-import-export-mode legend {
355
+ font-size: var(--font-size-eyebrow);
356
+ color: oklch(var(--fg-subtle));
357
+ margin-bottom: var(--px-4);
358
+ }
359
+
360
+ .graphiql-import-export-error {
361
+ color: oklch(var(--accent-red));
362
+ font-size: var(--font-size-eyebrow);
363
+ }
364
+
365
+ .graphiql-conflict-summary {
366
+ margin: 0 0 var(--px-12);
367
+ font-size: var(--font-size-body);
368
+ color: oklch(var(--fg-default));
369
+ }
370
+
371
+ .graphiql-conflict-actions {
372
+ gap: var(--px-8);
373
+ flex-wrap: wrap;
374
+ display: flex;
375
+ }
376
+
377
+ .graphiql-conflict-review {
378
+ gap: var(--px-8);
379
+ flex-direction: column;
380
+ display: flex;
381
+ }
382
+
383
+ .graphiql-conflict-review-hint-label {
384
+ font-size: var(--font-size-eyebrow);
385
+ color: oklch(var(--fg-subtle));
386
+ margin: 0;
387
+ }
388
+
389
+ .graphiql-conflict-review-list {
390
+ gap: var(--px-4);
391
+ border: 1px solid oklch(var(--border-default));
392
+ border-radius: var(--border-radius-4);
393
+ max-height: 240px;
394
+ padding: var(--px-4) var(--px-8);
395
+ flex-direction: column;
396
+ display: flex;
397
+ overflow-y: auto;
398
+ }
399
+
400
+ .graphiql-conflict-review-row {
401
+ align-items: center;
402
+ gap: var(--px-8);
403
+ padding: var(--px-4) 0;
404
+ cursor: pointer;
405
+ font-size: var(--font-size-body);
406
+ display: flex;
407
+ }
408
+
409
+ .graphiql-conflict-review-checkbox {
410
+ flex-shrink: 0;
411
+ }
412
+
413
+ .graphiql-conflict-review-name {
414
+ color: oklch(var(--fg-default));
415
+ text-overflow: ellipsis;
416
+ white-space: nowrap;
417
+ flex: 1;
418
+ overflow: hidden;
419
+ }
420
+
421
+ .graphiql-conflict-review-collection, .graphiql-conflict-review-hint {
422
+ font-size: var(--font-size-eyebrow);
423
+ color: oklch(var(--fg-subtle));
424
+ white-space: nowrap;
425
+ }
426
+
427
+ .graphiql-conflict-review-confirm {
428
+ gap: var(--px-8);
429
+ display: flex;
430
+ }
431
+
432
+ .graphiql-sr-only {
433
+ clip: rect(0, 0, 0, 0);
434
+ white-space: nowrap;
435
+ border: 0;
436
+ width: 1px;
437
+ height: 1px;
438
+ margin: -1px;
439
+ padding: 0;
440
+ position: absolute;
441
+ overflow: hidden;
442
+ }
@@ -0,0 +1,80 @@
1
+ export type Collection = {
2
+ id: string;
3
+ name: string;
4
+ description?: string;
5
+ createdAt: number;
6
+ updatedAt: number;
7
+ items: CollectionItem[];
8
+ };
9
+ export type CollectionItem = {
10
+ id: string;
11
+ name: string;
12
+ query: string;
13
+ variables?: string;
14
+ headers?: string;
15
+ description?: string;
16
+ createdAt: number;
17
+ updatedAt: number;
18
+ };
19
+ /**
20
+ * Host-controlled capability flags. All capabilities are on by default; a host
21
+ * can turn any of them off to run a governed, read-only, or share-disabled
22
+ * collections experience.
23
+ */
24
+ export type CollectionsConfig = {
25
+ /** When true, no write operations are possible (export & copy still allowed). */
26
+ readOnly: boolean;
27
+ /** Master switch for the import/export feature (hides both import and export). */
28
+ allowImportExport: boolean;
29
+ /** When false, the destructive "Replace" import option is hidden. */
30
+ allowReplace: boolean;
31
+ };
32
+ export declare const DEFAULT_COLLECTIONS_CONFIG: CollectionsConfig;
33
+ /** Pluggable storage interface. Default localStorage adapter ships with the plugin. */
34
+ export type CollectionsStorage = {
35
+ storageKey?: string;
36
+ load(): Promise<Collection[]>;
37
+ save(collections: Collection[]): Promise<void>;
38
+ };
39
+ /** An incoming item paired with the collection it should land in. */
40
+ export type PlacedItem = {
41
+ item: CollectionItem;
42
+ targetCollectionId: string;
43
+ };
44
+ /** An incoming item whose id matches a local item but whose content differs. */
45
+ export type ItemConflict = {
46
+ incoming: CollectionItem;
47
+ /** The local copy of the item before any merge. */
48
+ current: CollectionItem;
49
+ /** The collection where the recipient currently keeps this item (may differ from incoming parent). */
50
+ currentCollectionId: string;
51
+ };
52
+ /** Result of `analyzeImport`. Pure — does not mutate store state. */
53
+ export type ImportAnalysis = {
54
+ ok: boolean;
55
+ /** Collection shells (no items) whose id is absent locally — to be created on apply. */
56
+ newCollections: Collection[];
57
+ /** Items whose id exists nowhere locally. */
58
+ newItems: PlacedItem[];
59
+ /** Items whose id matches a local item but content differs. */
60
+ changedItems: ItemConflict[];
61
+ /** Items that are byte-for-byte identical to the local copy — nothing to do. */
62
+ unchangedCount: number;
63
+ /** @internal Full parsed incoming list, needed for replace mode in applyImport. */
64
+ _incoming: Collection[];
65
+ };
66
+ /**
67
+ * How to resolve the import when applying.
68
+ * - `replace` — wholesale overwrite (equivalent to old replace mode).
69
+ * - `merge` with `applyChanges` — apply all or none of the changed items.
70
+ * - `merge` with `changedItemIds` — apply only the listed subset of changed items.
71
+ */
72
+ export type ImportResolution = {
73
+ mode: 'replace';
74
+ } | {
75
+ mode: 'merge';
76
+ applyChanges: boolean;
77
+ } | {
78
+ mode: 'merge';
79
+ changedItemIds: Set<string>;
80
+ };
package/dist/types.js ADDED
@@ -0,0 +1,9 @@
1
+ const DEFAULT_COLLECTIONS_CONFIG = {
2
+ readOnly: false,
3
+ allowImportExport: true,
4
+ allowReplace: true
5
+ };
6
+ export {
7
+ DEFAULT_COLLECTIONS_CONFIG
8
+ };
9
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sources":["../src/types.ts"],"sourcesContent":["export type Collection = {\n id: string;\n name: string;\n description?: string;\n createdAt: number;\n updatedAt: number;\n items: CollectionItem[];\n};\n\nexport type CollectionItem = {\n id: string;\n name: string;\n query: string;\n variables?: string;\n headers?: string;\n description?: string;\n createdAt: number;\n updatedAt: number;\n};\n\n/**\n * Host-controlled capability flags. All capabilities are on by default; a host\n * can turn any of them off to run a governed, read-only, or share-disabled\n * collections experience.\n */\nexport type CollectionsConfig = {\n /** When true, no write operations are possible (export & copy still allowed). */\n readOnly: boolean;\n /** Master switch for the import/export feature (hides both import and export). */\n allowImportExport: boolean;\n /** When false, the destructive \"Replace\" import option is hidden. */\n allowReplace: boolean;\n};\n\nexport const DEFAULT_COLLECTIONS_CONFIG: CollectionsConfig = {\n readOnly: false,\n allowImportExport: true,\n allowReplace: true,\n};\n\n/** Pluggable storage interface. Default localStorage adapter ships with the plugin. */\nexport type CollectionsStorage = {\n storageKey?: string;\n load(): Promise<Collection[]>;\n save(collections: Collection[]): Promise<void>;\n};\n\n/** An incoming item paired with the collection it should land in. */\nexport type PlacedItem = {\n item: CollectionItem;\n targetCollectionId: string;\n};\n\n/** An incoming item whose id matches a local item but whose content differs. */\nexport type ItemConflict = {\n incoming: CollectionItem;\n /** The local copy of the item before any merge. */\n current: CollectionItem;\n /** The collection where the recipient currently keeps this item (may differ from incoming parent). */\n currentCollectionId: string;\n};\n\n/** Result of `analyzeImport`. Pure — does not mutate store state. */\nexport type ImportAnalysis = {\n ok: boolean;\n /** Collection shells (no items) whose id is absent locally — to be created on apply. */\n newCollections: Collection[];\n /** Items whose id exists nowhere locally. */\n newItems: PlacedItem[];\n /** Items whose id matches a local item but content differs. */\n changedItems: ItemConflict[];\n /** Items that are byte-for-byte identical to the local copy — nothing to do. */\n unchangedCount: number;\n /** @internal Full parsed incoming list, needed for replace mode in applyImport. */\n _incoming: Collection[];\n};\n\n/**\n * How to resolve the import when applying.\n * - `replace` — wholesale overwrite (equivalent to old replace mode).\n * - `merge` with `applyChanges` — apply all or none of the changed items.\n * - `merge` with `changedItemIds` — apply only the listed subset of changed items.\n */\nexport type ImportResolution =\n | { mode: 'replace' }\n | { mode: 'merge'; applyChanges: boolean }\n | { mode: 'merge'; changedItemIds: Set<string> };\n"],"names":[],"mappings":"AAkCO,MAAM,6BAAgD;AAAA,EAC3D,UAAU;AAAA,EACV,mBAAmB;AAAA,EACnB,cAAc;AAChB;"}
@@ -0,0 +1,4 @@
1
+ /** Stable unique id for collections and operations. Uses `crypto.randomUUID`
2
+ * when available, falling back to a timestamp + random suffix on plain http
3
+ * where `crypto.randomUUID` is undefined. */
4
+ export declare function randomId(): string;
@@ -0,0 +1,11 @@
1
+ function randomId() {
2
+ const c = globalThis.crypto;
3
+ if (c && typeof c.randomUUID === "function") {
4
+ return c.randomUUID();
5
+ }
6
+ return `${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 10)}`;
7
+ }
8
+ export {
9
+ randomId
10
+ };
11
+ //# sourceMappingURL=uuid.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"uuid.js","sources":["../../src/utility/uuid.ts"],"sourcesContent":["/** Stable unique id for collections and operations. Uses `crypto.randomUUID`\n * when available, falling back to a timestamp + random suffix on plain http\n * where `crypto.randomUUID` is undefined. */\nexport function randomId(): string {\n const c = globalThis.crypto;\n if (c && typeof c.randomUUID === 'function') {\n return c.randomUUID();\n }\n return `${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 10)}`;\n}\n"],"names":[],"mappings":"AAGO,SAAS,WAAmB;AACjC,QAAM,IAAI,WAAW;AACrB,MAAI,KAAK,OAAO,EAAE,eAAe,YAAY;AAC3C,WAAO,EAAE,WAAW;AAAA,EAAA;AAEtB,SAAO,GAAG,KAAK,IAAA,EAAM,SAAS,EAAE,CAAC,IAAI,KAAK,SAAS,SAAS,EAAE,EAAE,MAAM,GAAG,EAAE,CAAC;AAC9E;"}
package/package.json CHANGED
@@ -1,4 +1,63 @@
1
1
  {
2
2
  "name": "@graphiql/plugin-collections",
3
- "version": "0.0.0"
3
+ "version": "1.0.0-beta.0",
4
+ "sideEffects": [
5
+ "*.css"
6
+ ],
7
+ "description": "A first-party operation collections plugin for GraphiQL.",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "https://github.com/graphql/graphiql",
11
+ "directory": "packages/graphiql-plugin-collections"
12
+ },
13
+ "homepage": "https://github.com/graphql/graphiql/tree/master/packages/graphiql-plugin-collections#readme",
14
+ "bugs": {
15
+ "url": "https://github.com/graphql/graphiql/issues?q=issue+label:@graphiql/plugin-collections"
16
+ },
17
+ "license": "MIT",
18
+ "exports": {
19
+ "./package.json": "./package.json",
20
+ "./style.css": "./dist/style.css",
21
+ ".": "./dist/index.js"
22
+ },
23
+ "types": "dist/index.d.ts",
24
+ "keywords": [
25
+ "react",
26
+ "graphql",
27
+ "graphiql",
28
+ "plugin",
29
+ "collections"
30
+ ],
31
+ "files": [
32
+ "dist"
33
+ ],
34
+ "scripts": {
35
+ "types:check": "tsgo --noEmit",
36
+ "dev": "vite build --watch --emptyOutDir=false",
37
+ "build": "vite build",
38
+ "test": "vitest run"
39
+ },
40
+ "dependencies": {
41
+ "zod": "^4.0.0",
42
+ "zustand": "^5"
43
+ },
44
+ "peerDependencies": {
45
+ "@graphiql/react": "^1.0.0-beta.0",
46
+ "graphql": "^15.5.0 || ^16.0.0 || ^17.0.0",
47
+ "react": "^18 || ^19",
48
+ "react-dom": "^18 || ^19"
49
+ },
50
+ "devDependencies": {
51
+ "@graphiql/react": "^1.0.0-beta.0",
52
+ "@testing-library/dom": "^10.4.0",
53
+ "@testing-library/jest-dom": "^6.6.3",
54
+ "@testing-library/react": "^16.3.0",
55
+ "@vitejs/plugin-react": "^4.4.1",
56
+ "graphql": "^16.9.0",
57
+ "react": "^19.1.0",
58
+ "react-dom": "^19.1.0",
59
+ "vite": "^6.3.4",
60
+ "vite-plugin-dts": "^4.5.3",
61
+ "vite-plugin-svgr": "^4.3.0"
62
+ }
4
63
  }