@tanstack/query-devtools 5.0.0-beta.33 → 5.0.0-beta.36
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/build/Devtools/{PS2NMF43.jsx → DWELN6EN.jsx} +711 -1831
- package/build/Devtools/{AL7POTVF.jsx → FASZSC6H.jsx} +707 -1755
- package/build/Devtools/{AO4SNFEU.js → OXAQM7EL.js} +684 -1736
- package/build/Devtools/{GFOHVLUL.js → PCOU65Y2.js} +688 -1921
- package/build/dev.cjs +1150 -2480
- package/build/dev.js +1 -1
- package/build/dev.jsx +1 -1
- package/build/index.cjs +1150 -2306
- package/build/index.js +1 -1
- package/build/index.jsx +1 -1
- package/package.json +6 -4
- package/src/Devtools.tsx +293 -143
- package/src/Explorer.tsx +2 -1
- package/src/icons/index.tsx +20 -0
package/src/Devtools.tsx
CHANGED
|
@@ -9,7 +9,8 @@ import {
|
|
|
9
9
|
onMount,
|
|
10
10
|
} from 'solid-js'
|
|
11
11
|
import { rankItem } from '@tanstack/match-sorter-utils'
|
|
12
|
-
import { css
|
|
12
|
+
import { css } from 'goober'
|
|
13
|
+
import { clsx as cx } from 'clsx'
|
|
13
14
|
import { TransitionGroup } from 'solid-transition-group'
|
|
14
15
|
import { Key } from '@solid-primitives/keyed'
|
|
15
16
|
import { createLocalStorage } from '@solid-primitives/storage'
|
|
@@ -32,6 +33,7 @@ import {
|
|
|
32
33
|
Search,
|
|
33
34
|
Settings,
|
|
34
35
|
TanstackLogo,
|
|
36
|
+
Trash,
|
|
35
37
|
Wifi,
|
|
36
38
|
} from './icons'
|
|
37
39
|
import Explorer from './Explorer'
|
|
@@ -110,50 +112,56 @@ export const Devtools = () => {
|
|
|
110
112
|
return localStore.position || useQueryDevtoolsContext().position || POSITION
|
|
111
113
|
})
|
|
112
114
|
|
|
115
|
+
createEffect(() => {
|
|
116
|
+
const root = document.querySelector('.tsqd-parent-container') as HTMLElement
|
|
117
|
+
const height = localStore.height || DEFAULT_HEIGHT
|
|
118
|
+
const width = localStore.width || DEFAULT_WIDTH
|
|
119
|
+
const panelPosition = position()
|
|
120
|
+
root.style.setProperty(
|
|
121
|
+
'--tsqd-panel-height',
|
|
122
|
+
`${panelPosition === 'top' ? '-' : ''}${height}px`,
|
|
123
|
+
)
|
|
124
|
+
root.style.setProperty(
|
|
125
|
+
'--tsqd-panel-width',
|
|
126
|
+
`${panelPosition === 'left' ? '-' : ''}${width}px`,
|
|
127
|
+
)
|
|
128
|
+
})
|
|
129
|
+
|
|
113
130
|
return (
|
|
114
131
|
<div
|
|
115
132
|
// styles for animating the panel in and out
|
|
116
|
-
class={
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
133
|
+
class={cx(
|
|
134
|
+
css`
|
|
135
|
+
& .tsqd-panel-transition-exit-active,
|
|
136
|
+
& .tsqd-panel-transition-enter-active {
|
|
137
|
+
transition: opacity 0.3s, transform 0.3s;
|
|
138
|
+
}
|
|
121
139
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
: position() === 'left'
|
|
129
|
-
? `transform: translateX(-${Number(
|
|
130
|
-
localStore.width || DEFAULT_WIDTH,
|
|
131
|
-
)}px);`
|
|
132
|
-
: position() === 'right'
|
|
133
|
-
? `transform: translateX(${Number(
|
|
134
|
-
localStore.width || DEFAULT_WIDTH,
|
|
135
|
-
)}px);`
|
|
136
|
-
: `transform: translateY(${Number(
|
|
137
|
-
localStore.height || DEFAULT_HEIGHT,
|
|
138
|
-
)}px);`}
|
|
139
|
-
}
|
|
140
|
+
& .tsqd-panel-transition-exit-to,
|
|
141
|
+
& .tsqd-panel-transition-enter {
|
|
142
|
+
${position() === 'top' || position() === 'bottom'
|
|
143
|
+
? `transform: translateY(var(--tsqd-panel-height));`
|
|
144
|
+
: `transform: translateX(var(--tsqd-panel-width));`}
|
|
145
|
+
}
|
|
140
146
|
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
147
|
+
& .tsqd-button-transition-exit-active,
|
|
148
|
+
& .tsqd-button-transition-enter-active {
|
|
149
|
+
transition: opacity 0.3s, transform 0.3s;
|
|
150
|
+
}
|
|
145
151
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
152
|
+
& .tsqd-button-transition-exit-to,
|
|
153
|
+
& .tsqd-button-transition-enter {
|
|
154
|
+
transform: ${buttonPosition() === 'top-left'
|
|
155
|
+
? `translateX(-72px);`
|
|
156
|
+
: buttonPosition() === 'top-right'
|
|
157
|
+
? `translateX(72px);`
|
|
158
|
+
: `translateY(72px);`};
|
|
159
|
+
}
|
|
160
|
+
`,
|
|
161
|
+
'tsqd-transitions-container',
|
|
162
|
+
)}
|
|
155
163
|
>
|
|
156
|
-
<TransitionGroup name="
|
|
164
|
+
<TransitionGroup name="tsqd-panel-transition">
|
|
157
165
|
<Show when={isOpen()}>
|
|
158
166
|
<DevtoolsPanel
|
|
159
167
|
localStore={localStore}
|
|
@@ -161,7 +169,7 @@ export const Devtools = () => {
|
|
|
161
169
|
/>
|
|
162
170
|
</Show>
|
|
163
171
|
</TransitionGroup>
|
|
164
|
-
<TransitionGroup name="
|
|
172
|
+
<TransitionGroup name="tsqd-button-transition">
|
|
165
173
|
<Show when={!isOpen()}>
|
|
166
174
|
<div
|
|
167
175
|
class={cx(
|
|
@@ -361,18 +369,24 @@ export const DevtoolsPanel: Component<DevtoolsPanelProps> = (props) => {
|
|
|
361
369
|
// -
|
|
362
370
|
// min-width - When the panel is in the left or right position, the panel
|
|
363
371
|
// width is set to min-content to allow the panel to shrink to the lowest possible width
|
|
364
|
-
class={
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
:
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
+
class={cx(
|
|
373
|
+
styles.panel,
|
|
374
|
+
styles[`panel-position-${position()}`],
|
|
375
|
+
css`
|
|
376
|
+
flex-direction: ${panelWidth() < secondBreakpoint ? 'column' : 'row'};
|
|
377
|
+
background-color: ${panelWidth() < secondBreakpoint
|
|
378
|
+
? tokens.colors.gray[600]
|
|
379
|
+
: tokens.colors.darkGray[900]};
|
|
380
|
+
`,
|
|
381
|
+
{
|
|
382
|
+
[css`
|
|
372
383
|
min-width: min-content;
|
|
373
|
-
`
|
|
374
|
-
|
|
375
|
-
|
|
384
|
+
`]:
|
|
385
|
+
panelWidth() < thirdBreakpoint &&
|
|
386
|
+
(position() === 'right' || position() === 'left'),
|
|
387
|
+
},
|
|
388
|
+
'tsqd-main-panel',
|
|
389
|
+
)}
|
|
376
390
|
style={{
|
|
377
391
|
height:
|
|
378
392
|
position() === 'bottom' || position() === 'top'
|
|
@@ -390,12 +404,17 @@ export const DevtoolsPanel: Component<DevtoolsPanelProps> = (props) => {
|
|
|
390
404
|
class={cx(
|
|
391
405
|
styles.dragHandle,
|
|
392
406
|
styles[`dragHandle-position-${position()}`],
|
|
407
|
+
'tsqd-drag-handle',
|
|
393
408
|
)}
|
|
394
409
|
onMouseDown={handleDragStart}
|
|
395
410
|
></div>
|
|
396
411
|
<button
|
|
397
412
|
aria-label="Close tanstack query devtools"
|
|
398
|
-
class={cx(
|
|
413
|
+
class={cx(
|
|
414
|
+
styles.closeBtn,
|
|
415
|
+
styles[`closeBtn-position-${position()}`],
|
|
416
|
+
'tsqd-minimize-btn',
|
|
417
|
+
)}
|
|
399
418
|
onClick={() => props.setLocalStore('open', 'false')}
|
|
400
419
|
>
|
|
401
420
|
<ChevronDown />
|
|
@@ -404,23 +423,29 @@ export const DevtoolsPanel: Component<DevtoolsPanelProps> = (props) => {
|
|
|
404
423
|
ref={queriesContainerRef}
|
|
405
424
|
// When the panels are stacked we use the height style
|
|
406
425
|
// to divide the panels into two equal parts
|
|
407
|
-
class={
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
426
|
+
class={cx(
|
|
427
|
+
styles.queriesContainer,
|
|
428
|
+
panelWidth() < secondBreakpoint &&
|
|
429
|
+
selectedQueryHash() &&
|
|
430
|
+
css`
|
|
431
|
+
height: 50%;
|
|
432
|
+
max-height: 50%;
|
|
433
|
+
`,
|
|
434
|
+
'tsqd-queries-container',
|
|
435
|
+
)}
|
|
415
436
|
>
|
|
416
|
-
<div class={cx(styles.row)}>
|
|
437
|
+
<div class={cx(styles.row, 'tsqd-header')}>
|
|
417
438
|
<button
|
|
418
|
-
class={styles.logo}
|
|
439
|
+
class={cx(styles.logo, 'tsqd-text-logo-container')}
|
|
419
440
|
onClick={() => props.setLocalStore('open', 'false')}
|
|
420
441
|
aria-label="Close Tanstack query devtools"
|
|
421
442
|
>
|
|
422
|
-
<span class={styles.tanstackLogo}>
|
|
423
|
-
|
|
443
|
+
<span class={cx(styles.tanstackLogo, 'tsqd-text-logo-tanstack')}>
|
|
444
|
+
TANSTACK
|
|
445
|
+
</span>
|
|
446
|
+
<span
|
|
447
|
+
class={cx(styles.queryFlavorLogo, 'tsqd-text-logo-query-flavor')}
|
|
448
|
+
>
|
|
424
449
|
{useQueryDevtoolsContext().queryFlavor} v
|
|
425
450
|
{useQueryDevtoolsContext().version}
|
|
426
451
|
</span>
|
|
@@ -433,10 +458,16 @@ export const DevtoolsPanel: Component<DevtoolsPanelProps> = (props) => {
|
|
|
433
458
|
css`
|
|
434
459
|
gap: ${tokens.size[2.5]};
|
|
435
460
|
`,
|
|
461
|
+
'tsqd-filters-actions-container',
|
|
436
462
|
)}
|
|
437
463
|
>
|
|
438
|
-
<div class={styles.filtersContainer}>
|
|
439
|
-
<div
|
|
464
|
+
<div class={cx(styles.filtersContainer, 'tsqd-filters-container')}>
|
|
465
|
+
<div
|
|
466
|
+
class={cx(
|
|
467
|
+
styles.filterInput,
|
|
468
|
+
'tsqd-query-filter-textfield-container',
|
|
469
|
+
)}
|
|
470
|
+
>
|
|
440
471
|
<Search />
|
|
441
472
|
<input
|
|
442
473
|
aria-label="Filter queries by query key"
|
|
@@ -445,10 +476,16 @@ export const DevtoolsPanel: Component<DevtoolsPanelProps> = (props) => {
|
|
|
445
476
|
onInput={(e) =>
|
|
446
477
|
props.setLocalStore('filter', e.currentTarget.value)
|
|
447
478
|
}
|
|
479
|
+
class="tsqd-query-filter-textfield"
|
|
448
480
|
value={props.localStore.filter || ''}
|
|
449
481
|
/>
|
|
450
482
|
</div>
|
|
451
|
-
<div
|
|
483
|
+
<div
|
|
484
|
+
class={cx(
|
|
485
|
+
styles.filterSelect,
|
|
486
|
+
'tsqd-query-filter-sort-container',
|
|
487
|
+
)}
|
|
488
|
+
>
|
|
452
489
|
<select
|
|
453
490
|
value={sort()}
|
|
454
491
|
onChange={(e) =>
|
|
@@ -469,6 +506,7 @@ export const DevtoolsPanel: Component<DevtoolsPanelProps> = (props) => {
|
|
|
469
506
|
sortOrder() === -1 ? 'descending' : 'ascending'
|
|
470
507
|
}`}
|
|
471
508
|
aria-pressed={sortOrder() === -1}
|
|
509
|
+
class="tsqd-query-filter-sort-order-btn"
|
|
472
510
|
>
|
|
473
511
|
<Show when={sortOrder() === 1}>
|
|
474
512
|
<span>Asc</span>
|
|
@@ -481,7 +519,20 @@ export const DevtoolsPanel: Component<DevtoolsPanelProps> = (props) => {
|
|
|
481
519
|
</button>
|
|
482
520
|
</div>
|
|
483
521
|
|
|
484
|
-
<div class={styles.actionsContainer}>
|
|
522
|
+
<div class={cx(styles.actionsContainer, 'tsqd-actions-container')}>
|
|
523
|
+
<button
|
|
524
|
+
onClick={() => {
|
|
525
|
+
cache().clear()
|
|
526
|
+
}}
|
|
527
|
+
class={cx(
|
|
528
|
+
styles.actionsBtn,
|
|
529
|
+
'tsqd-actions-btn',
|
|
530
|
+
'tsqd-action-clear-cache',
|
|
531
|
+
)}
|
|
532
|
+
aria-label="Clear query cache"
|
|
533
|
+
>
|
|
534
|
+
<Trash />
|
|
535
|
+
</button>
|
|
485
536
|
<button
|
|
486
537
|
onClick={() => {
|
|
487
538
|
if (offline()) {
|
|
@@ -492,7 +543,11 @@ export const DevtoolsPanel: Component<DevtoolsPanelProps> = (props) => {
|
|
|
492
543
|
setOffline(true)
|
|
493
544
|
}
|
|
494
545
|
}}
|
|
495
|
-
class={
|
|
546
|
+
class={cx(
|
|
547
|
+
styles.actionsBtn,
|
|
548
|
+
'tsqd-actions-btn',
|
|
549
|
+
'tsqd-action-mock-offline-behavior',
|
|
550
|
+
)}
|
|
496
551
|
aria-label={`${
|
|
497
552
|
offline()
|
|
498
553
|
? 'Unset offline mocking behavior'
|
|
@@ -505,13 +560,17 @@ export const DevtoolsPanel: Component<DevtoolsPanelProps> = (props) => {
|
|
|
505
560
|
<div style={{ position: 'relative' }}>
|
|
506
561
|
<button
|
|
507
562
|
onClick={() => setSettingsOpen((prev) => !prev)}
|
|
508
|
-
class={
|
|
509
|
-
|
|
563
|
+
class={cx(
|
|
564
|
+
styles.actionsBtn,
|
|
565
|
+
'tsqd-actions-btn',
|
|
566
|
+
'tsqd-action-settings',
|
|
567
|
+
)}
|
|
568
|
+
id="tsqd-settings-menu-btn"
|
|
510
569
|
aria-label={`${
|
|
511
570
|
settingsOpen() ? 'Close' : 'Open'
|
|
512
571
|
} settings menu`}
|
|
513
572
|
aria-haspopup="true"
|
|
514
|
-
aria-controls="
|
|
573
|
+
aria-controls="tsqd-settings-menu"
|
|
515
574
|
>
|
|
516
575
|
<Settings />
|
|
517
576
|
</button>
|
|
@@ -519,17 +578,30 @@ export const DevtoolsPanel: Component<DevtoolsPanelProps> = (props) => {
|
|
|
519
578
|
<div
|
|
520
579
|
role="menu"
|
|
521
580
|
tabindex="-1"
|
|
522
|
-
aria-labelledby="
|
|
523
|
-
id="
|
|
524
|
-
class={styles.settingsMenu}
|
|
581
|
+
aria-labelledby="tsqd-settings-menu-btn"
|
|
582
|
+
id="tsqd-settings-menu"
|
|
583
|
+
class={cx(styles.settingsMenu, 'tsqd-settings-menu')}
|
|
525
584
|
>
|
|
526
|
-
<div
|
|
527
|
-
|
|
585
|
+
<div
|
|
586
|
+
class={cx(
|
|
587
|
+
styles.settingsMenuHeader,
|
|
588
|
+
'tsqd-settings-menu-header',
|
|
589
|
+
)}
|
|
590
|
+
>
|
|
591
|
+
Position
|
|
592
|
+
</div>
|
|
593
|
+
<div
|
|
594
|
+
class={cx(
|
|
595
|
+
styles.settingsMenuSection,
|
|
596
|
+
'tsqd-settings-menu-section',
|
|
597
|
+
)}
|
|
598
|
+
>
|
|
528
599
|
<button
|
|
529
600
|
onClick={() => {
|
|
530
601
|
setDevtoolsPosition('top')
|
|
531
602
|
}}
|
|
532
603
|
aria-label="Position top"
|
|
604
|
+
class="tsqd-settings-menu-position-btn tsqd-settings-menu-position-btn-top"
|
|
533
605
|
>
|
|
534
606
|
<ArrowUp />
|
|
535
607
|
<span>Top</span>
|
|
@@ -539,6 +611,7 @@ export const DevtoolsPanel: Component<DevtoolsPanelProps> = (props) => {
|
|
|
539
611
|
setDevtoolsPosition('bottom')
|
|
540
612
|
}}
|
|
541
613
|
aria-label="Position bottom"
|
|
614
|
+
class="tsqd-settings-menu-position-btn tsqd-settings-menu-position-btn-bottom"
|
|
542
615
|
>
|
|
543
616
|
<ArrowDown />
|
|
544
617
|
<span>Bottom</span>
|
|
@@ -548,6 +621,7 @@ export const DevtoolsPanel: Component<DevtoolsPanelProps> = (props) => {
|
|
|
548
621
|
setDevtoolsPosition('left')
|
|
549
622
|
}}
|
|
550
623
|
aria-label="Position left"
|
|
624
|
+
class="tsqd-settings-menu-position-btn tsqd-settings-menu-position-btn-left"
|
|
551
625
|
>
|
|
552
626
|
<ArrowDown />
|
|
553
627
|
<span>Left</span>
|
|
@@ -557,6 +631,7 @@ export const DevtoolsPanel: Component<DevtoolsPanelProps> = (props) => {
|
|
|
557
631
|
setDevtoolsPosition('right')
|
|
558
632
|
}}
|
|
559
633
|
aria-label="Position right"
|
|
634
|
+
class="tsqd-settings-menu-position-btn tsqd-settings-menu-position-btn-right"
|
|
560
635
|
>
|
|
561
636
|
<ArrowDown />
|
|
562
637
|
<span>Right</span>
|
|
@@ -567,8 +642,13 @@ export const DevtoolsPanel: Component<DevtoolsPanelProps> = (props) => {
|
|
|
567
642
|
</div>
|
|
568
643
|
</div>
|
|
569
644
|
</div>
|
|
570
|
-
<div
|
|
571
|
-
|
|
645
|
+
<div
|
|
646
|
+
class={cx(
|
|
647
|
+
styles.overflowQueryContainer,
|
|
648
|
+
'tsqd-queries-overflow-container',
|
|
649
|
+
)}
|
|
650
|
+
>
|
|
651
|
+
<div class="tsqd-queries-container">
|
|
572
652
|
<Key by={(q) => q.queryHash} each={queries()}>
|
|
573
653
|
{(query) => <QueryRow query={query()} />}
|
|
574
654
|
</Key>
|
|
@@ -641,12 +721,12 @@ export const QueryRow: Component<{ query: Query }> = (props) => {
|
|
|
641
721
|
styles.queryRow,
|
|
642
722
|
selectedQueryHash() === props.query.queryHash &&
|
|
643
723
|
styles.selectedQueryRow,
|
|
724
|
+
'tsqd-query-row',
|
|
644
725
|
)}
|
|
645
726
|
aria-label={`Query key ${props.query.queryHash}`}
|
|
646
727
|
>
|
|
647
728
|
<div
|
|
648
729
|
class={cx(
|
|
649
|
-
'TSQDObserverCount',
|
|
650
730
|
color() === 'gray'
|
|
651
731
|
? css`
|
|
652
732
|
background-color: ${tokens.colors[color()][700]};
|
|
@@ -654,15 +734,16 @@ export const QueryRow: Component<{ query: Query }> = (props) => {
|
|
|
654
734
|
`
|
|
655
735
|
: css`
|
|
656
736
|
background-color: ${tokens.colors[color()][900]};
|
|
657
|
-
color: ${tokens.colors[color()][300]}
|
|
737
|
+
color: ${tokens.colors[color()][300]};
|
|
658
738
|
`,
|
|
739
|
+
'tsqd-query-observer-count',
|
|
659
740
|
)}
|
|
660
741
|
>
|
|
661
742
|
{observers()}
|
|
662
743
|
</div>
|
|
663
|
-
<code class="
|
|
744
|
+
<code class="tsqd-query-hash">{props.query.queryHash}</code>
|
|
664
745
|
<Show when={isDisabled()}>
|
|
665
|
-
<div class="
|
|
746
|
+
<div class="tsqd-query-disabled-indicator">disabled</div>
|
|
666
747
|
</Show>
|
|
667
748
|
</button>
|
|
668
749
|
</Show>
|
|
@@ -708,7 +789,7 @@ export const QueryStatusCount: Component = () => {
|
|
|
708
789
|
const styles = getStyles()
|
|
709
790
|
|
|
710
791
|
return (
|
|
711
|
-
<div class={styles.queryStatusContainer}>
|
|
792
|
+
<div class={cx(styles.queryStatusContainer, 'tsqd-query-status-container')}>
|
|
712
793
|
<QueryStatus label="Fresh" color="green" count={fresh()} />
|
|
713
794
|
<QueryStatus label="Fetching" color="blue" count={fetching()} />
|
|
714
795
|
<QueryStatus label="Paused" color="purple" count={paused()} />
|
|
@@ -752,40 +833,44 @@ export const QueryStatus: Component<QueryStatusProps> = (props) => {
|
|
|
752
833
|
ref={tagRef}
|
|
753
834
|
class={cx(
|
|
754
835
|
styles.queryStatusTag,
|
|
755
|
-
!showLabel()
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
836
|
+
!showLabel() &&
|
|
837
|
+
css`
|
|
838
|
+
cursor: pointer;
|
|
839
|
+
&:hover {
|
|
840
|
+
background: ${tokens.colors.darkGray[400]}${tokens.alpha[80]};
|
|
841
|
+
}
|
|
842
|
+
`,
|
|
843
|
+
'tsqd-query-status-tag',
|
|
844
|
+
`tsqd-query-status-tag-${props.label.toLowerCase()}`,
|
|
763
845
|
)}
|
|
764
846
|
{...(mouseOver() || focused()
|
|
765
847
|
? {
|
|
766
|
-
'aria-describedby': '
|
|
848
|
+
'aria-describedby': 'tsqd-status-tooltip',
|
|
767
849
|
}
|
|
768
850
|
: {})}
|
|
769
851
|
>
|
|
770
852
|
<Show when={!showLabel() && (mouseOver() || focused())}>
|
|
771
853
|
<div
|
|
772
854
|
role="tooltip"
|
|
773
|
-
id="
|
|
774
|
-
class={cx(styles.statusTooltip)}
|
|
855
|
+
id="tsqd-status-tooltip"
|
|
856
|
+
class={cx(styles.statusTooltip, 'tsqd-query-status-tooltip')}
|
|
775
857
|
>
|
|
776
858
|
{props.label}
|
|
777
859
|
</div>
|
|
778
860
|
</Show>
|
|
779
861
|
<span
|
|
780
|
-
class={
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
862
|
+
class={cx(
|
|
863
|
+
css`
|
|
864
|
+
width: ${tokens.size[2]};
|
|
865
|
+
height: ${tokens.size[2]};
|
|
866
|
+
border-radius: ${tokens.border.radius.full};
|
|
867
|
+
background-color: ${tokens.colors[props.color][500]};
|
|
868
|
+
`,
|
|
869
|
+
'tsqd-query-status-tag-dot',
|
|
870
|
+
)}
|
|
786
871
|
/>
|
|
787
872
|
<Show when={showLabel()}>
|
|
788
|
-
<span>{props.label}</span>
|
|
873
|
+
<span class="tsqd-query-status-tag-label">{props.label}</span>
|
|
789
874
|
</Show>
|
|
790
875
|
<span
|
|
791
876
|
class={cx(
|
|
@@ -793,11 +878,12 @@ export const QueryStatus: Component<QueryStatusProps> = (props) => {
|
|
|
793
878
|
props.count > 0 && props.color !== 'gray'
|
|
794
879
|
? css`
|
|
795
880
|
background-color: ${tokens.colors[props.color][900]};
|
|
796
|
-
color: ${tokens.colors[props.color][300]}
|
|
881
|
+
color: ${tokens.colors[props.color][300]};
|
|
797
882
|
`
|
|
798
883
|
: css`
|
|
799
|
-
color: ${tokens.colors['gray'][400]}
|
|
884
|
+
color: ${tokens.colors['gray'][400]};
|
|
800
885
|
`,
|
|
886
|
+
'tsqd-query-status-tag-count',
|
|
801
887
|
)}
|
|
802
888
|
>
|
|
803
889
|
{props.count}
|
|
@@ -915,10 +1001,14 @@ const QueryDetails = () => {
|
|
|
915
1001
|
|
|
916
1002
|
return (
|
|
917
1003
|
<Show when={activeQuery() && activeQueryState()}>
|
|
918
|
-
<div class={styles.detailsContainer}>
|
|
919
|
-
<div class={styles.detailsHeader}>
|
|
920
|
-
|
|
921
|
-
|
|
1004
|
+
<div class={cx(styles.detailsContainer, 'tsqd-query-details-container')}>
|
|
1005
|
+
<div class={cx(styles.detailsHeader, 'tsqd-query-details-header')}>
|
|
1006
|
+
Query Details
|
|
1007
|
+
</div>
|
|
1008
|
+
<div
|
|
1009
|
+
class={cx(styles.detailsBody, 'tsqd-query-details-summary-container')}
|
|
1010
|
+
>
|
|
1011
|
+
<div class="tsqd-query-details-summary">
|
|
922
1012
|
<pre>
|
|
923
1013
|
<code>{displayValue(activeQuery()!.queryKey, true)}</code>
|
|
924
1014
|
</pre>
|
|
@@ -941,23 +1031,31 @@ const QueryDetails = () => {
|
|
|
941
1031
|
{statusLabel()}
|
|
942
1032
|
</span>
|
|
943
1033
|
</div>
|
|
944
|
-
<div>
|
|
1034
|
+
<div class="tsqd-query-details-observers-count">
|
|
945
1035
|
<span>Observers:</span>
|
|
946
1036
|
<span>{observerCount()}</span>
|
|
947
1037
|
</div>
|
|
948
|
-
<div>
|
|
1038
|
+
<div class="tsqd-query-details-last-updated">
|
|
949
1039
|
<span>Last Updated:</span>
|
|
950
1040
|
<span>
|
|
951
1041
|
{new Date(activeQueryState()!.dataUpdatedAt).toLocaleTimeString()}
|
|
952
1042
|
</span>
|
|
953
1043
|
</div>
|
|
954
1044
|
</div>
|
|
955
|
-
<div class={styles.detailsHeader}>
|
|
956
|
-
|
|
1045
|
+
<div class={cx(styles.detailsHeader, 'tsqd-query-details-header')}>
|
|
1046
|
+
Actions
|
|
1047
|
+
</div>
|
|
1048
|
+
<div
|
|
1049
|
+
class={cx(styles.actionsBody, 'tsqd-query-details-actions-container')}
|
|
1050
|
+
>
|
|
957
1051
|
<button
|
|
958
|
-
class={
|
|
959
|
-
|
|
960
|
-
|
|
1052
|
+
class={cx(
|
|
1053
|
+
css`
|
|
1054
|
+
color: ${tokens.colors.blue[400]};
|
|
1055
|
+
`,
|
|
1056
|
+
'tsqd-query-details-actions-btn',
|
|
1057
|
+
'tsqd-query-details-action-refetch',
|
|
1058
|
+
)}
|
|
961
1059
|
onClick={handleRefetch}
|
|
962
1060
|
disabled={statusLabel() === 'fetching'}
|
|
963
1061
|
>
|
|
@@ -969,9 +1067,13 @@ const QueryDetails = () => {
|
|
|
969
1067
|
Refetch
|
|
970
1068
|
</button>
|
|
971
1069
|
<button
|
|
972
|
-
class={
|
|
973
|
-
|
|
974
|
-
|
|
1070
|
+
class={cx(
|
|
1071
|
+
css`
|
|
1072
|
+
color: ${tokens.colors.yellow[400]};
|
|
1073
|
+
`,
|
|
1074
|
+
'tsqd-query-details-actions-btn',
|
|
1075
|
+
'tsqd-query-details-action-invalidate',
|
|
1076
|
+
)}
|
|
975
1077
|
onClick={() => queryClient.invalidateQueries(activeQuery())}
|
|
976
1078
|
disabled={queryStatus() === 'pending'}
|
|
977
1079
|
>
|
|
@@ -983,9 +1085,13 @@ const QueryDetails = () => {
|
|
|
983
1085
|
Invalidate
|
|
984
1086
|
</button>
|
|
985
1087
|
<button
|
|
986
|
-
class={
|
|
987
|
-
|
|
988
|
-
|
|
1088
|
+
class={cx(
|
|
1089
|
+
css`
|
|
1090
|
+
color: ${tokens.colors.gray[300]};
|
|
1091
|
+
`,
|
|
1092
|
+
'tsqd-query-details-actions-btn',
|
|
1093
|
+
'tsqd-query-details-action-reset',
|
|
1094
|
+
)}
|
|
989
1095
|
onClick={() => queryClient.resetQueries(activeQuery())}
|
|
990
1096
|
disabled={queryStatus() === 'pending'}
|
|
991
1097
|
>
|
|
@@ -997,9 +1103,34 @@ const QueryDetails = () => {
|
|
|
997
1103
|
Reset
|
|
998
1104
|
</button>
|
|
999
1105
|
<button
|
|
1000
|
-
class={
|
|
1001
|
-
|
|
1002
|
-
|
|
1106
|
+
class={cx(
|
|
1107
|
+
css`
|
|
1108
|
+
color: ${tokens.colors.pink[400]};
|
|
1109
|
+
`,
|
|
1110
|
+
'tsqd-query-details-actions-btn',
|
|
1111
|
+
'tsqd-query-details-action-remove',
|
|
1112
|
+
)}
|
|
1113
|
+
onClick={() => {
|
|
1114
|
+
queryClient.removeQueries(activeQuery())
|
|
1115
|
+
setSelectedQueryHash(null)
|
|
1116
|
+
}}
|
|
1117
|
+
disabled={statusLabel() === 'fetching'}
|
|
1118
|
+
>
|
|
1119
|
+
<span
|
|
1120
|
+
class={css`
|
|
1121
|
+
background-color: ${tokens.colors.pink[400]};
|
|
1122
|
+
`}
|
|
1123
|
+
></span>
|
|
1124
|
+
Remove
|
|
1125
|
+
</button>
|
|
1126
|
+
<button
|
|
1127
|
+
class={cx(
|
|
1128
|
+
css`
|
|
1129
|
+
color: ${tokens.colors.cyan[400]};
|
|
1130
|
+
`,
|
|
1131
|
+
'tsqd-query-details-actions-btn',
|
|
1132
|
+
'tsqd-query-details-action-loading',
|
|
1133
|
+
)}
|
|
1003
1134
|
disabled={restoringLoading()}
|
|
1004
1135
|
onClick={() => {
|
|
1005
1136
|
if (activeQuery()?.state.data === undefined) {
|
|
@@ -1040,9 +1171,13 @@ const QueryDetails = () => {
|
|
|
1040
1171
|
</button>
|
|
1041
1172
|
<Show when={errorTypes().length === 0 || queryStatus() === 'error'}>
|
|
1042
1173
|
<button
|
|
1043
|
-
class={
|
|
1044
|
-
|
|
1045
|
-
|
|
1174
|
+
class={cx(
|
|
1175
|
+
css`
|
|
1176
|
+
color: ${tokens.colors.red[400]};
|
|
1177
|
+
`,
|
|
1178
|
+
'tsqd-query-details-actions-btn',
|
|
1179
|
+
'tsqd-query-details-action-error',
|
|
1180
|
+
)}
|
|
1046
1181
|
onClick={() => {
|
|
1047
1182
|
if (!activeQuery()!.state.error) {
|
|
1048
1183
|
triggerError()
|
|
@@ -1063,7 +1198,13 @@ const QueryDetails = () => {
|
|
|
1063
1198
|
<Show
|
|
1064
1199
|
when={!(errorTypes().length === 0 || queryStatus() === 'error')}
|
|
1065
1200
|
>
|
|
1066
|
-
<div
|
|
1201
|
+
<div
|
|
1202
|
+
class={cx(
|
|
1203
|
+
styles.actionsSelect,
|
|
1204
|
+
'tsqd-query-details-actions-btn',
|
|
1205
|
+
'tsqd-query-details-action-error-multiple',
|
|
1206
|
+
)}
|
|
1207
|
+
>
|
|
1067
1208
|
<span
|
|
1068
1209
|
class={css`
|
|
1069
1210
|
background-color: ${tokens.colors.red[400]};
|
|
@@ -1091,11 +1232,14 @@ const QueryDetails = () => {
|
|
|
1091
1232
|
</div>
|
|
1092
1233
|
</Show>
|
|
1093
1234
|
</div>
|
|
1094
|
-
<div class={styles.detailsHeader}>
|
|
1235
|
+
<div class={cx(styles.detailsHeader, 'tsqd-query-details-header')}>
|
|
1236
|
+
Data Explorer
|
|
1237
|
+
</div>
|
|
1095
1238
|
<div
|
|
1096
1239
|
style={{
|
|
1097
1240
|
padding: '0.5rem',
|
|
1098
1241
|
}}
|
|
1242
|
+
class="tsqd-query-details-explorer-container tsqd-query-details-data-explorer"
|
|
1099
1243
|
>
|
|
1100
1244
|
<Explorer
|
|
1101
1245
|
label="Data"
|
|
@@ -1104,11 +1248,14 @@ const QueryDetails = () => {
|
|
|
1104
1248
|
copyable={true}
|
|
1105
1249
|
/>
|
|
1106
1250
|
</div>
|
|
1107
|
-
<div class={styles.detailsHeader}>
|
|
1251
|
+
<div class={cx(styles.detailsHeader, 'tsqd-query-details-header')}>
|
|
1252
|
+
Query Explorer
|
|
1253
|
+
</div>
|
|
1108
1254
|
<div
|
|
1109
1255
|
style={{
|
|
1110
1256
|
padding: '0.5rem',
|
|
1111
1257
|
}}
|
|
1258
|
+
class="tsqd-query-details-explorer-container tsqd-query-details-query-explorer"
|
|
1112
1259
|
>
|
|
1113
1260
|
<Explorer
|
|
1114
1261
|
label="Query"
|
|
@@ -1182,6 +1329,7 @@ const getStyles = () => {
|
|
|
1182
1329
|
z-index: 100000;
|
|
1183
1330
|
position: fixed;
|
|
1184
1331
|
padding: 4px;
|
|
1332
|
+
text-align: left;
|
|
1185
1333
|
|
|
1186
1334
|
display: flex;
|
|
1187
1335
|
align-items: center;
|
|
@@ -1473,6 +1621,7 @@ const getStyles = () => {
|
|
|
1473
1621
|
font-size: ${font.size.sm};
|
|
1474
1622
|
background: linear-gradient(to right, #dd524b, #e9a03b);
|
|
1475
1623
|
background-clip: text;
|
|
1624
|
+
-webkit-background-clip: text;
|
|
1476
1625
|
line-height: ${font.lineHeight.xs};
|
|
1477
1626
|
-webkit-text-fill-color: transparent;
|
|
1478
1627
|
white-space: nowrap;
|
|
@@ -1500,9 +1649,6 @@ const getStyles = () => {
|
|
|
1500
1649
|
outline-offset: 2px;
|
|
1501
1650
|
outline: 2px solid ${colors.blue[800]};
|
|
1502
1651
|
}
|
|
1503
|
-
& span:nth-child(2) {
|
|
1504
|
-
color: ${colors.gray[300]}${alpha[80]};
|
|
1505
|
-
}
|
|
1506
1652
|
`,
|
|
1507
1653
|
statusTooltip: css`
|
|
1508
1654
|
position: absolute;
|
|
@@ -1656,8 +1802,8 @@ const getStyles = () => {
|
|
|
1656
1802
|
actionsBtn: css`
|
|
1657
1803
|
border-radius: ${tokens.border.radius.md};
|
|
1658
1804
|
background-color: ${colors.darkGray[400]};
|
|
1659
|
-
width: 2.125rem;
|
|
1660
|
-
height: 2.125rem;
|
|
1805
|
+
width: 2.125rem;
|
|
1806
|
+
height: 2.125rem;
|
|
1661
1807
|
justify-content: center;
|
|
1662
1808
|
display: flex;
|
|
1663
1809
|
align-items: center;
|
|
@@ -1694,20 +1840,23 @@ const getStyles = () => {
|
|
|
1694
1840
|
background-color: inherit;
|
|
1695
1841
|
border: none;
|
|
1696
1842
|
cursor: pointer;
|
|
1843
|
+
&:focus {
|
|
1844
|
+
outline: none;
|
|
1845
|
+
}
|
|
1697
1846
|
&:focus-visible {
|
|
1698
1847
|
outline-offset: -2px;
|
|
1699
1848
|
border-radius: ${border.radius.xs};
|
|
1700
1849
|
outline: 2px solid ${colors.blue[800]};
|
|
1701
1850
|
}
|
|
1702
|
-
&:hover .
|
|
1851
|
+
&:hover .tsqd-query-hash {
|
|
1703
1852
|
background-color: ${colors.darkGray[600]};
|
|
1704
1853
|
}
|
|
1705
1854
|
|
|
1706
|
-
& .
|
|
1855
|
+
& .tsqd-query-observer-count {
|
|
1707
1856
|
padding: 0 ${tokens.size[1]};
|
|
1708
1857
|
user-select: none;
|
|
1709
1858
|
min-width: ${tokens.size[8]};
|
|
1710
|
-
align-self: stretch
|
|
1859
|
+
align-self: stretch;
|
|
1711
1860
|
display: flex;
|
|
1712
1861
|
align-items: center;
|
|
1713
1862
|
justify-content: center;
|
|
@@ -1715,7 +1864,7 @@ const getStyles = () => {
|
|
|
1715
1864
|
font-weight: ${font.weight.medium};
|
|
1716
1865
|
border-bottom: 1px solid ${colors.darkGray[700]};
|
|
1717
1866
|
}
|
|
1718
|
-
& .
|
|
1867
|
+
& .tsqd-query-hash {
|
|
1719
1868
|
user-select: text;
|
|
1720
1869
|
font-size: ${font.size.sm};
|
|
1721
1870
|
display: flex;
|
|
@@ -1723,16 +1872,15 @@ const getStyles = () => {
|
|
|
1723
1872
|
min-height: ${tokens.size[8]};
|
|
1724
1873
|
flex: 1;
|
|
1725
1874
|
padding: ${tokens.size[1]} ${tokens.size[2]};
|
|
1726
|
-
font-family: 'Menlo', 'Fira Code', monospace
|
|
1875
|
+
font-family: 'Menlo', 'Fira Code', monospace;
|
|
1727
1876
|
border-bottom: 1px solid ${colors.darkGray[400]};
|
|
1728
1877
|
text-align: left;
|
|
1729
1878
|
text-overflow: clip;
|
|
1730
1879
|
word-break: break-word;
|
|
1731
1880
|
}
|
|
1732
1881
|
|
|
1733
|
-
& .
|
|
1882
|
+
& .tsqd-query-disabled-indicator {
|
|
1734
1883
|
align-self: stretch;
|
|
1735
|
-
align-self: stretch !important;
|
|
1736
1884
|
display: flex;
|
|
1737
1885
|
align-items: center;
|
|
1738
1886
|
padding: 0 ${tokens.size[3]};
|
|
@@ -1749,6 +1897,7 @@ const getStyles = () => {
|
|
|
1749
1897
|
flex-direction: column;
|
|
1750
1898
|
overflow-y: auto;
|
|
1751
1899
|
display: flex;
|
|
1900
|
+
text-align: left;
|
|
1752
1901
|
`,
|
|
1753
1902
|
detailsHeader: css`
|
|
1754
1903
|
position: sticky;
|
|
@@ -1758,6 +1907,7 @@ const getStyles = () => {
|
|
|
1758
1907
|
padding: ${tokens.size[2]} ${tokens.size[2]};
|
|
1759
1908
|
font-weight: ${font.weight.medium};
|
|
1760
1909
|
font-size: ${font.size.sm};
|
|
1910
|
+
text-align: left;
|
|
1761
1911
|
`,
|
|
1762
1912
|
detailsBody: css`
|
|
1763
1913
|
margin: ${tokens.size[2]} 0px ${tokens.size[3]} 0px;
|
|
@@ -1780,7 +1930,7 @@ const getStyles = () => {
|
|
|
1780
1930
|
}
|
|
1781
1931
|
|
|
1782
1932
|
& code {
|
|
1783
|
-
font-family: 'Menlo', 'Fira Code', monospace
|
|
1933
|
+
font-family: 'Menlo', 'Fira Code', monospace;
|
|
1784
1934
|
margin: 0;
|
|
1785
1935
|
font-size: ${font.size.sm};
|
|
1786
1936
|
line-height: ${font.lineHeight.sm};
|
|
@@ -1873,7 +2023,7 @@ const getStyles = () => {
|
|
|
1873
2023
|
}
|
|
1874
2024
|
|
|
1875
2025
|
& svg path {
|
|
1876
|
-
stroke: ${tokens.colors.red[400]}
|
|
2026
|
+
stroke: ${tokens.colors.red[400]};
|
|
1877
2027
|
}
|
|
1878
2028
|
`,
|
|
1879
2029
|
settingsMenu: css`
|