@tanstack/query-devtools 5.0.0-beta.20 → 5.0.0-beta.34
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/{MUGBGUTD.js → 26QOLXHC.js} +542 -1609
- package/build/Devtools/{AZTKLNIS.jsx → DK6B4TZH.jsx} +664 -1753
- package/build/Devtools/{4VMGNIF2.js → HUV7AL53.js} +546 -1794
- package/build/Devtools/{PI4AXB4J.jsx → R2CQWG4T.jsx} +668 -1829
- package/build/dev.cjs +1005 -2350
- package/build/dev.js +1 -1
- package/build/dev.jsx +1 -1
- package/build/index.cjs +1005 -2176
- package/build/index.js +1 -1
- package/build/index.jsx +1 -1
- package/package.json +6 -4
- package/src/Devtools.tsx +262 -141
- package/src/Explorer.tsx +2 -1
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'
|
|
@@ -110,50 +111,56 @@ export const Devtools = () => {
|
|
|
110
111
|
return localStore.position || useQueryDevtoolsContext().position || POSITION
|
|
111
112
|
})
|
|
112
113
|
|
|
114
|
+
createEffect(() => {
|
|
115
|
+
const root = document.querySelector('.tsqd-parent-container') as HTMLElement
|
|
116
|
+
const height = localStore.height || DEFAULT_HEIGHT
|
|
117
|
+
const width = localStore.width || DEFAULT_WIDTH
|
|
118
|
+
const panelPosition = position()
|
|
119
|
+
root.style.setProperty(
|
|
120
|
+
'--tsqd-panel-height',
|
|
121
|
+
`${panelPosition === 'top' ? '-' : ''}${height}px`,
|
|
122
|
+
)
|
|
123
|
+
root.style.setProperty(
|
|
124
|
+
'--tsqd-panel-width',
|
|
125
|
+
`${panelPosition === 'left' ? '-' : ''}${width}px`,
|
|
126
|
+
)
|
|
127
|
+
})
|
|
128
|
+
|
|
113
129
|
return (
|
|
114
130
|
<div
|
|
115
131
|
// styles for animating the panel in and out
|
|
116
|
-
class={
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
132
|
+
class={cx(
|
|
133
|
+
css`
|
|
134
|
+
& .tsqd-panel-transition-exit-active,
|
|
135
|
+
& .tsqd-panel-transition-enter-active {
|
|
136
|
+
transition: opacity 0.3s, transform 0.3s;
|
|
137
|
+
}
|
|
121
138
|
|
|
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
|
-
}
|
|
139
|
+
& .tsqd-panel-transition-exit-to,
|
|
140
|
+
& .tsqd-panel-transition-enter {
|
|
141
|
+
${position() === 'top' || position() === 'bottom'
|
|
142
|
+
? `transform: translateY(var(--tsqd-panel-height));`
|
|
143
|
+
: `transform: translateX(var(--tsqd-panel-width));`}
|
|
144
|
+
}
|
|
140
145
|
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
146
|
+
& .tsqd-button-transition-exit-active,
|
|
147
|
+
& .tsqd-button-transition-enter-active {
|
|
148
|
+
transition: opacity 0.3s, transform 0.3s;
|
|
149
|
+
}
|
|
145
150
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
151
|
+
& .tsqd-button-transition-exit-to,
|
|
152
|
+
& .tsqd-button-transition-enter {
|
|
153
|
+
transform: ${buttonPosition() === 'top-left'
|
|
154
|
+
? `translateX(-72px);`
|
|
155
|
+
: buttonPosition() === 'top-right'
|
|
156
|
+
? `translateX(72px);`
|
|
157
|
+
: `translateY(72px);`};
|
|
158
|
+
}
|
|
159
|
+
`,
|
|
160
|
+
'tsqd-transitions-container',
|
|
161
|
+
)}
|
|
155
162
|
>
|
|
156
|
-
<TransitionGroup name="
|
|
163
|
+
<TransitionGroup name="tsqd-panel-transition">
|
|
157
164
|
<Show when={isOpen()}>
|
|
158
165
|
<DevtoolsPanel
|
|
159
166
|
localStore={localStore}
|
|
@@ -161,7 +168,7 @@ export const Devtools = () => {
|
|
|
161
168
|
/>
|
|
162
169
|
</Show>
|
|
163
170
|
</TransitionGroup>
|
|
164
|
-
<TransitionGroup name="
|
|
171
|
+
<TransitionGroup name="tsqd-button-transition">
|
|
165
172
|
<Show when={!isOpen()}>
|
|
166
173
|
<div
|
|
167
174
|
class={cx(
|
|
@@ -361,18 +368,24 @@ export const DevtoolsPanel: Component<DevtoolsPanelProps> = (props) => {
|
|
|
361
368
|
// -
|
|
362
369
|
// min-width - When the panel is in the left or right position, the panel
|
|
363
370
|
// 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
|
-
|
|
371
|
+
class={cx(
|
|
372
|
+
styles.panel,
|
|
373
|
+
styles[`panel-position-${position()}`],
|
|
374
|
+
css`
|
|
375
|
+
flex-direction: ${panelWidth() < secondBreakpoint ? 'column' : 'row'};
|
|
376
|
+
background-color: ${panelWidth() < secondBreakpoint
|
|
377
|
+
? tokens.colors.gray[600]
|
|
378
|
+
: tokens.colors.darkGray[900]};
|
|
379
|
+
`,
|
|
380
|
+
{
|
|
381
|
+
[css`
|
|
372
382
|
min-width: min-content;
|
|
373
|
-
`
|
|
374
|
-
|
|
375
|
-
|
|
383
|
+
`]:
|
|
384
|
+
panelWidth() < thirdBreakpoint &&
|
|
385
|
+
(position() === 'right' || position() === 'left'),
|
|
386
|
+
},
|
|
387
|
+
'tsqd-main-panel',
|
|
388
|
+
)}
|
|
376
389
|
style={{
|
|
377
390
|
height:
|
|
378
391
|
position() === 'bottom' || position() === 'top'
|
|
@@ -390,12 +403,17 @@ export const DevtoolsPanel: Component<DevtoolsPanelProps> = (props) => {
|
|
|
390
403
|
class={cx(
|
|
391
404
|
styles.dragHandle,
|
|
392
405
|
styles[`dragHandle-position-${position()}`],
|
|
406
|
+
'tsqd-drag-handle',
|
|
393
407
|
)}
|
|
394
408
|
onMouseDown={handleDragStart}
|
|
395
409
|
></div>
|
|
396
410
|
<button
|
|
397
411
|
aria-label="Close tanstack query devtools"
|
|
398
|
-
class={cx(
|
|
412
|
+
class={cx(
|
|
413
|
+
styles.closeBtn,
|
|
414
|
+
styles[`closeBtn-position-${position()}`],
|
|
415
|
+
'tsqd-minimize-btn',
|
|
416
|
+
)}
|
|
399
417
|
onClick={() => props.setLocalStore('open', 'false')}
|
|
400
418
|
>
|
|
401
419
|
<ChevronDown />
|
|
@@ -404,23 +422,29 @@ export const DevtoolsPanel: Component<DevtoolsPanelProps> = (props) => {
|
|
|
404
422
|
ref={queriesContainerRef}
|
|
405
423
|
// When the panels are stacked we use the height style
|
|
406
424
|
// to divide the panels into two equal parts
|
|
407
|
-
class={
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
425
|
+
class={cx(
|
|
426
|
+
styles.queriesContainer,
|
|
427
|
+
panelWidth() < secondBreakpoint &&
|
|
428
|
+
selectedQueryHash() &&
|
|
429
|
+
css`
|
|
430
|
+
height: 50%;
|
|
431
|
+
max-height: 50%;
|
|
432
|
+
`,
|
|
433
|
+
'tsqd-queries-container',
|
|
434
|
+
)}
|
|
415
435
|
>
|
|
416
|
-
<div class={cx(styles.row)}>
|
|
436
|
+
<div class={cx(styles.row, 'tsqd-header')}>
|
|
417
437
|
<button
|
|
418
|
-
class={styles.logo}
|
|
438
|
+
class={cx(styles.logo, 'tsqd-text-logo-container')}
|
|
419
439
|
onClick={() => props.setLocalStore('open', 'false')}
|
|
420
440
|
aria-label="Close Tanstack query devtools"
|
|
421
441
|
>
|
|
422
|
-
<span class={styles.tanstackLogo}>
|
|
423
|
-
|
|
442
|
+
<span class={cx(styles.tanstackLogo, 'tsqd-text-logo-tanstack')}>
|
|
443
|
+
TANSTACK
|
|
444
|
+
</span>
|
|
445
|
+
<span
|
|
446
|
+
class={cx(styles.queryFlavorLogo, 'tsqd-text-logo-query-flavor')}
|
|
447
|
+
>
|
|
424
448
|
{useQueryDevtoolsContext().queryFlavor} v
|
|
425
449
|
{useQueryDevtoolsContext().version}
|
|
426
450
|
</span>
|
|
@@ -433,10 +457,16 @@ export const DevtoolsPanel: Component<DevtoolsPanelProps> = (props) => {
|
|
|
433
457
|
css`
|
|
434
458
|
gap: ${tokens.size[2.5]};
|
|
435
459
|
`,
|
|
460
|
+
'tsqd-filters-actions-container',
|
|
436
461
|
)}
|
|
437
462
|
>
|
|
438
|
-
<div class={styles.filtersContainer}>
|
|
439
|
-
<div
|
|
463
|
+
<div class={cx(styles.filtersContainer, 'tsqd-filters-container')}>
|
|
464
|
+
<div
|
|
465
|
+
class={cx(
|
|
466
|
+
styles.filterInput,
|
|
467
|
+
'tsqd-query-filter-textfield-container',
|
|
468
|
+
)}
|
|
469
|
+
>
|
|
440
470
|
<Search />
|
|
441
471
|
<input
|
|
442
472
|
aria-label="Filter queries by query key"
|
|
@@ -445,10 +475,16 @@ export const DevtoolsPanel: Component<DevtoolsPanelProps> = (props) => {
|
|
|
445
475
|
onInput={(e) =>
|
|
446
476
|
props.setLocalStore('filter', e.currentTarget.value)
|
|
447
477
|
}
|
|
478
|
+
class="tsqd-query-filter-textfield"
|
|
448
479
|
value={props.localStore.filter || ''}
|
|
449
480
|
/>
|
|
450
481
|
</div>
|
|
451
|
-
<div
|
|
482
|
+
<div
|
|
483
|
+
class={cx(
|
|
484
|
+
styles.filterSelect,
|
|
485
|
+
'tsqd-query-filter-sort-container',
|
|
486
|
+
)}
|
|
487
|
+
>
|
|
452
488
|
<select
|
|
453
489
|
value={sort()}
|
|
454
490
|
onChange={(e) =>
|
|
@@ -469,6 +505,7 @@ export const DevtoolsPanel: Component<DevtoolsPanelProps> = (props) => {
|
|
|
469
505
|
sortOrder() === -1 ? 'descending' : 'ascending'
|
|
470
506
|
}`}
|
|
471
507
|
aria-pressed={sortOrder() === -1}
|
|
508
|
+
class="tsqd-query-filter-sort-order-btn"
|
|
472
509
|
>
|
|
473
510
|
<Show when={sortOrder() === 1}>
|
|
474
511
|
<span>Asc</span>
|
|
@@ -481,7 +518,7 @@ export const DevtoolsPanel: Component<DevtoolsPanelProps> = (props) => {
|
|
|
481
518
|
</button>
|
|
482
519
|
</div>
|
|
483
520
|
|
|
484
|
-
<div class={styles.actionsContainer}>
|
|
521
|
+
<div class={cx(styles.actionsContainer, 'tsqd-actions-container')}>
|
|
485
522
|
<button
|
|
486
523
|
onClick={() => {
|
|
487
524
|
if (offline()) {
|
|
@@ -492,7 +529,11 @@ export const DevtoolsPanel: Component<DevtoolsPanelProps> = (props) => {
|
|
|
492
529
|
setOffline(true)
|
|
493
530
|
}
|
|
494
531
|
}}
|
|
495
|
-
class={
|
|
532
|
+
class={cx(
|
|
533
|
+
styles.actionsBtn,
|
|
534
|
+
'tsqd-actions-btn',
|
|
535
|
+
'tsqd-action-mock-offline-behavior',
|
|
536
|
+
)}
|
|
496
537
|
aria-label={`${
|
|
497
538
|
offline()
|
|
498
539
|
? 'Unset offline mocking behavior'
|
|
@@ -505,13 +546,17 @@ export const DevtoolsPanel: Component<DevtoolsPanelProps> = (props) => {
|
|
|
505
546
|
<div style={{ position: 'relative' }}>
|
|
506
547
|
<button
|
|
507
548
|
onClick={() => setSettingsOpen((prev) => !prev)}
|
|
508
|
-
class={
|
|
509
|
-
|
|
549
|
+
class={cx(
|
|
550
|
+
styles.actionsBtn,
|
|
551
|
+
'tsqd-actions-btn',
|
|
552
|
+
'tsqd-action-settings',
|
|
553
|
+
)}
|
|
554
|
+
id="tsqd-settings-menu-btn"
|
|
510
555
|
aria-label={`${
|
|
511
556
|
settingsOpen() ? 'Close' : 'Open'
|
|
512
557
|
} settings menu`}
|
|
513
558
|
aria-haspopup="true"
|
|
514
|
-
aria-controls="
|
|
559
|
+
aria-controls="tsqd-settings-menu"
|
|
515
560
|
>
|
|
516
561
|
<Settings />
|
|
517
562
|
</button>
|
|
@@ -519,17 +564,30 @@ export const DevtoolsPanel: Component<DevtoolsPanelProps> = (props) => {
|
|
|
519
564
|
<div
|
|
520
565
|
role="menu"
|
|
521
566
|
tabindex="-1"
|
|
522
|
-
aria-labelledby="
|
|
523
|
-
id="
|
|
524
|
-
class={styles.settingsMenu}
|
|
567
|
+
aria-labelledby="tsqd-settings-menu-btn"
|
|
568
|
+
id="tsqd-settings-menu"
|
|
569
|
+
class={cx(styles.settingsMenu, 'tsqd-settings-menu')}
|
|
525
570
|
>
|
|
526
|
-
<div
|
|
527
|
-
|
|
571
|
+
<div
|
|
572
|
+
class={cx(
|
|
573
|
+
styles.settingsMenuHeader,
|
|
574
|
+
'tsqd-settings-menu-header',
|
|
575
|
+
)}
|
|
576
|
+
>
|
|
577
|
+
Position
|
|
578
|
+
</div>
|
|
579
|
+
<div
|
|
580
|
+
class={cx(
|
|
581
|
+
styles.settingsMenuSection,
|
|
582
|
+
'tsqd-settings-menu-section',
|
|
583
|
+
)}
|
|
584
|
+
>
|
|
528
585
|
<button
|
|
529
586
|
onClick={() => {
|
|
530
587
|
setDevtoolsPosition('top')
|
|
531
588
|
}}
|
|
532
589
|
aria-label="Position top"
|
|
590
|
+
class="tsqd-settings-menu-position-btn tsqd-settings-menu-position-btn-top"
|
|
533
591
|
>
|
|
534
592
|
<ArrowUp />
|
|
535
593
|
<span>Top</span>
|
|
@@ -539,6 +597,7 @@ export const DevtoolsPanel: Component<DevtoolsPanelProps> = (props) => {
|
|
|
539
597
|
setDevtoolsPosition('bottom')
|
|
540
598
|
}}
|
|
541
599
|
aria-label="Position bottom"
|
|
600
|
+
class="tsqd-settings-menu-position-btn tsqd-settings-menu-position-btn-bottom"
|
|
542
601
|
>
|
|
543
602
|
<ArrowDown />
|
|
544
603
|
<span>Bottom</span>
|
|
@@ -548,6 +607,7 @@ export const DevtoolsPanel: Component<DevtoolsPanelProps> = (props) => {
|
|
|
548
607
|
setDevtoolsPosition('left')
|
|
549
608
|
}}
|
|
550
609
|
aria-label="Position left"
|
|
610
|
+
class="tsqd-settings-menu-position-btn tsqd-settings-menu-position-btn-left"
|
|
551
611
|
>
|
|
552
612
|
<ArrowDown />
|
|
553
613
|
<span>Left</span>
|
|
@@ -557,6 +617,7 @@ export const DevtoolsPanel: Component<DevtoolsPanelProps> = (props) => {
|
|
|
557
617
|
setDevtoolsPosition('right')
|
|
558
618
|
}}
|
|
559
619
|
aria-label="Position right"
|
|
620
|
+
class="tsqd-settings-menu-position-btn tsqd-settings-menu-position-btn-right"
|
|
560
621
|
>
|
|
561
622
|
<ArrowDown />
|
|
562
623
|
<span>Right</span>
|
|
@@ -567,8 +628,13 @@ export const DevtoolsPanel: Component<DevtoolsPanelProps> = (props) => {
|
|
|
567
628
|
</div>
|
|
568
629
|
</div>
|
|
569
630
|
</div>
|
|
570
|
-
<div
|
|
571
|
-
|
|
631
|
+
<div
|
|
632
|
+
class={cx(
|
|
633
|
+
styles.overflowQueryContainer,
|
|
634
|
+
'tsqd-queries-overflow-container',
|
|
635
|
+
)}
|
|
636
|
+
>
|
|
637
|
+
<div class="tsqd-queries-container">
|
|
572
638
|
<Key by={(q) => q.queryHash} each={queries()}>
|
|
573
639
|
{(query) => <QueryRow query={query()} />}
|
|
574
640
|
</Key>
|
|
@@ -641,12 +707,12 @@ export const QueryRow: Component<{ query: Query }> = (props) => {
|
|
|
641
707
|
styles.queryRow,
|
|
642
708
|
selectedQueryHash() === props.query.queryHash &&
|
|
643
709
|
styles.selectedQueryRow,
|
|
710
|
+
'tsqd-query-row',
|
|
644
711
|
)}
|
|
645
712
|
aria-label={`Query key ${props.query.queryHash}`}
|
|
646
713
|
>
|
|
647
714
|
<div
|
|
648
715
|
class={cx(
|
|
649
|
-
'TSQDObserverCount',
|
|
650
716
|
color() === 'gray'
|
|
651
717
|
? css`
|
|
652
718
|
background-color: ${tokens.colors[color()][700]};
|
|
@@ -654,15 +720,16 @@ export const QueryRow: Component<{ query: Query }> = (props) => {
|
|
|
654
720
|
`
|
|
655
721
|
: css`
|
|
656
722
|
background-color: ${tokens.colors[color()][900]};
|
|
657
|
-
color: ${tokens.colors[color()][300]}
|
|
723
|
+
color: ${tokens.colors[color()][300]};
|
|
658
724
|
`,
|
|
725
|
+
'tsqd-query-observer-count',
|
|
659
726
|
)}
|
|
660
727
|
>
|
|
661
728
|
{observers()}
|
|
662
729
|
</div>
|
|
663
|
-
<code class="
|
|
730
|
+
<code class="tsqd-query-hash">{props.query.queryHash}</code>
|
|
664
731
|
<Show when={isDisabled()}>
|
|
665
|
-
<div class="
|
|
732
|
+
<div class="tsqd-query-disabled-indicator">disabled</div>
|
|
666
733
|
</Show>
|
|
667
734
|
</button>
|
|
668
735
|
</Show>
|
|
@@ -708,7 +775,7 @@ export const QueryStatusCount: Component = () => {
|
|
|
708
775
|
const styles = getStyles()
|
|
709
776
|
|
|
710
777
|
return (
|
|
711
|
-
<div class={styles.queryStatusContainer}>
|
|
778
|
+
<div class={cx(styles.queryStatusContainer, 'tsqd-query-status-container')}>
|
|
712
779
|
<QueryStatus label="Fresh" color="green" count={fresh()} />
|
|
713
780
|
<QueryStatus label="Fetching" color="blue" count={fetching()} />
|
|
714
781
|
<QueryStatus label="Paused" color="purple" count={paused()} />
|
|
@@ -752,40 +819,44 @@ export const QueryStatus: Component<QueryStatusProps> = (props) => {
|
|
|
752
819
|
ref={tagRef}
|
|
753
820
|
class={cx(
|
|
754
821
|
styles.queryStatusTag,
|
|
755
|
-
!showLabel()
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
822
|
+
!showLabel() &&
|
|
823
|
+
css`
|
|
824
|
+
cursor: pointer;
|
|
825
|
+
&:hover {
|
|
826
|
+
background: ${tokens.colors.darkGray[400]}${tokens.alpha[80]};
|
|
827
|
+
}
|
|
828
|
+
`,
|
|
829
|
+
'tsqd-query-status-tag',
|
|
830
|
+
`tsqd-query-status-tag-${props.label.toLowerCase()}`,
|
|
763
831
|
)}
|
|
764
832
|
{...(mouseOver() || focused()
|
|
765
833
|
? {
|
|
766
|
-
'aria-describedby': '
|
|
834
|
+
'aria-describedby': 'tsqd-status-tooltip',
|
|
767
835
|
}
|
|
768
836
|
: {})}
|
|
769
837
|
>
|
|
770
838
|
<Show when={!showLabel() && (mouseOver() || focused())}>
|
|
771
839
|
<div
|
|
772
840
|
role="tooltip"
|
|
773
|
-
id="
|
|
774
|
-
class={cx(styles.statusTooltip)}
|
|
841
|
+
id="tsqd-status-tooltip"
|
|
842
|
+
class={cx(styles.statusTooltip, 'tsqd-query-status-tooltip')}
|
|
775
843
|
>
|
|
776
844
|
{props.label}
|
|
777
845
|
</div>
|
|
778
846
|
</Show>
|
|
779
847
|
<span
|
|
780
|
-
class={
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
848
|
+
class={cx(
|
|
849
|
+
css`
|
|
850
|
+
width: ${tokens.size[2]};
|
|
851
|
+
height: ${tokens.size[2]};
|
|
852
|
+
border-radius: ${tokens.border.radius.full};
|
|
853
|
+
background-color: ${tokens.colors[props.color][500]};
|
|
854
|
+
`,
|
|
855
|
+
'tsqd-query-status-tag-dot',
|
|
856
|
+
)}
|
|
786
857
|
/>
|
|
787
858
|
<Show when={showLabel()}>
|
|
788
|
-
<span>{props.label}</span>
|
|
859
|
+
<span class="tsqd-query-status-tag-label">{props.label}</span>
|
|
789
860
|
</Show>
|
|
790
861
|
<span
|
|
791
862
|
class={cx(
|
|
@@ -793,11 +864,12 @@ export const QueryStatus: Component<QueryStatusProps> = (props) => {
|
|
|
793
864
|
props.count > 0 && props.color !== 'gray'
|
|
794
865
|
? css`
|
|
795
866
|
background-color: ${tokens.colors[props.color][900]};
|
|
796
|
-
color: ${tokens.colors[props.color][300]}
|
|
867
|
+
color: ${tokens.colors[props.color][300]};
|
|
797
868
|
`
|
|
798
869
|
: css`
|
|
799
|
-
color: ${tokens.colors['gray'][400]}
|
|
870
|
+
color: ${tokens.colors['gray'][400]};
|
|
800
871
|
`,
|
|
872
|
+
'tsqd-query-status-tag-count',
|
|
801
873
|
)}
|
|
802
874
|
>
|
|
803
875
|
{props.count}
|
|
@@ -915,10 +987,14 @@ const QueryDetails = () => {
|
|
|
915
987
|
|
|
916
988
|
return (
|
|
917
989
|
<Show when={activeQuery() && activeQueryState()}>
|
|
918
|
-
<div class={styles.detailsContainer}>
|
|
919
|
-
<div class={styles.detailsHeader}>
|
|
920
|
-
|
|
921
|
-
|
|
990
|
+
<div class={cx(styles.detailsContainer, 'tsqd-query-details-container')}>
|
|
991
|
+
<div class={cx(styles.detailsHeader, 'tsqd-query-details-header')}>
|
|
992
|
+
Query Details
|
|
993
|
+
</div>
|
|
994
|
+
<div
|
|
995
|
+
class={cx(styles.detailsBody, 'tsqd-query-details-summary-container')}
|
|
996
|
+
>
|
|
997
|
+
<div class="tsqd-query-details-summary">
|
|
922
998
|
<pre>
|
|
923
999
|
<code>{displayValue(activeQuery()!.queryKey, true)}</code>
|
|
924
1000
|
</pre>
|
|
@@ -941,23 +1017,31 @@ const QueryDetails = () => {
|
|
|
941
1017
|
{statusLabel()}
|
|
942
1018
|
</span>
|
|
943
1019
|
</div>
|
|
944
|
-
<div>
|
|
1020
|
+
<div class="tsqd-query-details-observers-count">
|
|
945
1021
|
<span>Observers:</span>
|
|
946
1022
|
<span>{observerCount()}</span>
|
|
947
1023
|
</div>
|
|
948
|
-
<div>
|
|
1024
|
+
<div class="tsqd-query-details-last-updated">
|
|
949
1025
|
<span>Last Updated:</span>
|
|
950
1026
|
<span>
|
|
951
1027
|
{new Date(activeQueryState()!.dataUpdatedAt).toLocaleTimeString()}
|
|
952
1028
|
</span>
|
|
953
1029
|
</div>
|
|
954
1030
|
</div>
|
|
955
|
-
<div class={styles.detailsHeader}>
|
|
956
|
-
|
|
1031
|
+
<div class={cx(styles.detailsHeader, 'tsqd-query-details-header')}>
|
|
1032
|
+
Actions
|
|
1033
|
+
</div>
|
|
1034
|
+
<div
|
|
1035
|
+
class={cx(styles.actionsBody, 'tsqd-query-details-actions-container')}
|
|
1036
|
+
>
|
|
957
1037
|
<button
|
|
958
|
-
class={
|
|
959
|
-
|
|
960
|
-
|
|
1038
|
+
class={cx(
|
|
1039
|
+
css`
|
|
1040
|
+
color: ${tokens.colors.blue[400]};
|
|
1041
|
+
`,
|
|
1042
|
+
'tsqd-query-details-actions-btn',
|
|
1043
|
+
'tsqd-query-details-action-refetch',
|
|
1044
|
+
)}
|
|
961
1045
|
onClick={handleRefetch}
|
|
962
1046
|
disabled={statusLabel() === 'fetching'}
|
|
963
1047
|
>
|
|
@@ -969,10 +1053,15 @@ const QueryDetails = () => {
|
|
|
969
1053
|
Refetch
|
|
970
1054
|
</button>
|
|
971
1055
|
<button
|
|
972
|
-
class={
|
|
973
|
-
|
|
974
|
-
|
|
1056
|
+
class={cx(
|
|
1057
|
+
css`
|
|
1058
|
+
color: ${tokens.colors.yellow[400]};
|
|
1059
|
+
`,
|
|
1060
|
+
'tsqd-query-details-actions-btn',
|
|
1061
|
+
'tsqd-query-details-action-invalidate',
|
|
1062
|
+
)}
|
|
975
1063
|
onClick={() => queryClient.invalidateQueries(activeQuery())}
|
|
1064
|
+
disabled={queryStatus() === 'pending'}
|
|
976
1065
|
>
|
|
977
1066
|
<span
|
|
978
1067
|
class={css`
|
|
@@ -982,10 +1071,15 @@ const QueryDetails = () => {
|
|
|
982
1071
|
Invalidate
|
|
983
1072
|
</button>
|
|
984
1073
|
<button
|
|
985
|
-
class={
|
|
986
|
-
|
|
987
|
-
|
|
1074
|
+
class={cx(
|
|
1075
|
+
css`
|
|
1076
|
+
color: ${tokens.colors.gray[300]};
|
|
1077
|
+
`,
|
|
1078
|
+
'tsqd-query-details-actions-btn',
|
|
1079
|
+
'tsqd-query-details-action-reset',
|
|
1080
|
+
)}
|
|
988
1081
|
onClick={() => queryClient.resetQueries(activeQuery())}
|
|
1082
|
+
disabled={queryStatus() === 'pending'}
|
|
989
1083
|
>
|
|
990
1084
|
<span
|
|
991
1085
|
class={css`
|
|
@@ -995,9 +1089,13 @@ const QueryDetails = () => {
|
|
|
995
1089
|
Reset
|
|
996
1090
|
</button>
|
|
997
1091
|
<button
|
|
998
|
-
class={
|
|
999
|
-
|
|
1000
|
-
|
|
1092
|
+
class={cx(
|
|
1093
|
+
css`
|
|
1094
|
+
color: ${tokens.colors.cyan[400]};
|
|
1095
|
+
`,
|
|
1096
|
+
'tsqd-query-details-actions-btn',
|
|
1097
|
+
'tsqd-query-details-action-loading',
|
|
1098
|
+
)}
|
|
1001
1099
|
disabled={restoringLoading()}
|
|
1002
1100
|
onClick={() => {
|
|
1003
1101
|
if (activeQuery()?.state.data === undefined) {
|
|
@@ -1034,13 +1132,17 @@ const QueryDetails = () => {
|
|
|
1034
1132
|
background-color: ${tokens.colors.cyan[400]};
|
|
1035
1133
|
`}
|
|
1036
1134
|
></span>
|
|
1037
|
-
{
|
|
1135
|
+
{queryStatus() === 'pending' ? 'Restore' : 'Trigger'} Loading
|
|
1038
1136
|
</button>
|
|
1039
1137
|
<Show when={errorTypes().length === 0 || queryStatus() === 'error'}>
|
|
1040
1138
|
<button
|
|
1041
|
-
class={
|
|
1042
|
-
|
|
1043
|
-
|
|
1139
|
+
class={cx(
|
|
1140
|
+
css`
|
|
1141
|
+
color: ${tokens.colors.red[400]};
|
|
1142
|
+
`,
|
|
1143
|
+
'tsqd-query-details-actions-btn',
|
|
1144
|
+
'tsqd-query-details-action-error',
|
|
1145
|
+
)}
|
|
1044
1146
|
onClick={() => {
|
|
1045
1147
|
if (!activeQuery()!.state.error) {
|
|
1046
1148
|
triggerError()
|
|
@@ -1048,6 +1150,7 @@ const QueryDetails = () => {
|
|
|
1048
1150
|
queryClient.resetQueries(activeQuery())
|
|
1049
1151
|
}
|
|
1050
1152
|
}}
|
|
1153
|
+
disabled={queryStatus() === 'pending'}
|
|
1051
1154
|
>
|
|
1052
1155
|
<span
|
|
1053
1156
|
class={css`
|
|
@@ -1060,7 +1163,13 @@ const QueryDetails = () => {
|
|
|
1060
1163
|
<Show
|
|
1061
1164
|
when={!(errorTypes().length === 0 || queryStatus() === 'error')}
|
|
1062
1165
|
>
|
|
1063
|
-
<div
|
|
1166
|
+
<div
|
|
1167
|
+
class={cx(
|
|
1168
|
+
styles.actionsSelect,
|
|
1169
|
+
'tsqd-query-details-actions-btn',
|
|
1170
|
+
'tsqd-query-details-action-error-multiple',
|
|
1171
|
+
)}
|
|
1172
|
+
>
|
|
1064
1173
|
<span
|
|
1065
1174
|
class={css`
|
|
1066
1175
|
background-color: ${tokens.colors.red[400]};
|
|
@@ -1088,11 +1197,14 @@ const QueryDetails = () => {
|
|
|
1088
1197
|
</div>
|
|
1089
1198
|
</Show>
|
|
1090
1199
|
</div>
|
|
1091
|
-
<div class={styles.detailsHeader}>
|
|
1200
|
+
<div class={cx(styles.detailsHeader, 'tsqd-query-details-header')}>
|
|
1201
|
+
Data Explorer
|
|
1202
|
+
</div>
|
|
1092
1203
|
<div
|
|
1093
1204
|
style={{
|
|
1094
1205
|
padding: '0.5rem',
|
|
1095
1206
|
}}
|
|
1207
|
+
class="tsqd-query-details-explorer-container tsqd-query-details-data-explorer"
|
|
1096
1208
|
>
|
|
1097
1209
|
<Explorer
|
|
1098
1210
|
label="Data"
|
|
@@ -1101,11 +1213,14 @@ const QueryDetails = () => {
|
|
|
1101
1213
|
copyable={true}
|
|
1102
1214
|
/>
|
|
1103
1215
|
</div>
|
|
1104
|
-
<div class={styles.detailsHeader}>
|
|
1216
|
+
<div class={cx(styles.detailsHeader, 'tsqd-query-details-header')}>
|
|
1217
|
+
Query Explorer
|
|
1218
|
+
</div>
|
|
1105
1219
|
<div
|
|
1106
1220
|
style={{
|
|
1107
1221
|
padding: '0.5rem',
|
|
1108
1222
|
}}
|
|
1223
|
+
class="tsqd-query-details-explorer-container tsqd-query-details-query-explorer"
|
|
1109
1224
|
>
|
|
1110
1225
|
<Explorer
|
|
1111
1226
|
label="Query"
|
|
@@ -1179,6 +1294,7 @@ const getStyles = () => {
|
|
|
1179
1294
|
z-index: 100000;
|
|
1180
1295
|
position: fixed;
|
|
1181
1296
|
padding: 4px;
|
|
1297
|
+
text-align: left;
|
|
1182
1298
|
|
|
1183
1299
|
display: flex;
|
|
1184
1300
|
align-items: center;
|
|
@@ -1470,6 +1586,7 @@ const getStyles = () => {
|
|
|
1470
1586
|
font-size: ${font.size.sm};
|
|
1471
1587
|
background: linear-gradient(to right, #dd524b, #e9a03b);
|
|
1472
1588
|
background-clip: text;
|
|
1589
|
+
-webkit-background-clip: text;
|
|
1473
1590
|
line-height: ${font.lineHeight.xs};
|
|
1474
1591
|
-webkit-text-fill-color: transparent;
|
|
1475
1592
|
white-space: nowrap;
|
|
@@ -1653,8 +1770,8 @@ const getStyles = () => {
|
|
|
1653
1770
|
actionsBtn: css`
|
|
1654
1771
|
border-radius: ${tokens.border.radius.md};
|
|
1655
1772
|
background-color: ${colors.darkGray[400]};
|
|
1656
|
-
width: 2.125rem;
|
|
1657
|
-
height: 2.125rem;
|
|
1773
|
+
width: 2.125rem;
|
|
1774
|
+
height: 2.125rem;
|
|
1658
1775
|
justify-content: center;
|
|
1659
1776
|
display: flex;
|
|
1660
1777
|
align-items: center;
|
|
@@ -1691,20 +1808,23 @@ const getStyles = () => {
|
|
|
1691
1808
|
background-color: inherit;
|
|
1692
1809
|
border: none;
|
|
1693
1810
|
cursor: pointer;
|
|
1811
|
+
&:focus {
|
|
1812
|
+
outline: none;
|
|
1813
|
+
}
|
|
1694
1814
|
&:focus-visible {
|
|
1695
1815
|
outline-offset: -2px;
|
|
1696
1816
|
border-radius: ${border.radius.xs};
|
|
1697
1817
|
outline: 2px solid ${colors.blue[800]};
|
|
1698
1818
|
}
|
|
1699
|
-
&:hover .
|
|
1819
|
+
&:hover .tsqd-query-hash {
|
|
1700
1820
|
background-color: ${colors.darkGray[600]};
|
|
1701
1821
|
}
|
|
1702
1822
|
|
|
1703
|
-
& .
|
|
1823
|
+
& .tsqd-query-observer-count {
|
|
1704
1824
|
padding: 0 ${tokens.size[1]};
|
|
1705
1825
|
user-select: none;
|
|
1706
1826
|
min-width: ${tokens.size[8]};
|
|
1707
|
-
align-self: stretch
|
|
1827
|
+
align-self: stretch;
|
|
1708
1828
|
display: flex;
|
|
1709
1829
|
align-items: center;
|
|
1710
1830
|
justify-content: center;
|
|
@@ -1712,7 +1832,7 @@ const getStyles = () => {
|
|
|
1712
1832
|
font-weight: ${font.weight.medium};
|
|
1713
1833
|
border-bottom: 1px solid ${colors.darkGray[700]};
|
|
1714
1834
|
}
|
|
1715
|
-
& .
|
|
1835
|
+
& .tsqd-query-hash {
|
|
1716
1836
|
user-select: text;
|
|
1717
1837
|
font-size: ${font.size.sm};
|
|
1718
1838
|
display: flex;
|
|
@@ -1720,16 +1840,15 @@ const getStyles = () => {
|
|
|
1720
1840
|
min-height: ${tokens.size[8]};
|
|
1721
1841
|
flex: 1;
|
|
1722
1842
|
padding: ${tokens.size[1]} ${tokens.size[2]};
|
|
1723
|
-
font-family: 'Menlo', 'Fira Code', monospace
|
|
1843
|
+
font-family: 'Menlo', 'Fira Code', monospace;
|
|
1724
1844
|
border-bottom: 1px solid ${colors.darkGray[400]};
|
|
1725
1845
|
text-align: left;
|
|
1726
1846
|
text-overflow: clip;
|
|
1727
1847
|
word-break: break-word;
|
|
1728
1848
|
}
|
|
1729
1849
|
|
|
1730
|
-
& .
|
|
1850
|
+
& .tsqd-query-disabled-indicator {
|
|
1731
1851
|
align-self: stretch;
|
|
1732
|
-
align-self: stretch !important;
|
|
1733
1852
|
display: flex;
|
|
1734
1853
|
align-items: center;
|
|
1735
1854
|
padding: 0 ${tokens.size[3]};
|
|
@@ -1746,6 +1865,7 @@ const getStyles = () => {
|
|
|
1746
1865
|
flex-direction: column;
|
|
1747
1866
|
overflow-y: auto;
|
|
1748
1867
|
display: flex;
|
|
1868
|
+
text-align: left;
|
|
1749
1869
|
`,
|
|
1750
1870
|
detailsHeader: css`
|
|
1751
1871
|
position: sticky;
|
|
@@ -1755,6 +1875,7 @@ const getStyles = () => {
|
|
|
1755
1875
|
padding: ${tokens.size[2]} ${tokens.size[2]};
|
|
1756
1876
|
font-weight: ${font.weight.medium};
|
|
1757
1877
|
font-size: ${font.size.sm};
|
|
1878
|
+
text-align: left;
|
|
1758
1879
|
`,
|
|
1759
1880
|
detailsBody: css`
|
|
1760
1881
|
margin: ${tokens.size[2]} 0px ${tokens.size[3]} 0px;
|
|
@@ -1777,7 +1898,7 @@ const getStyles = () => {
|
|
|
1777
1898
|
}
|
|
1778
1899
|
|
|
1779
1900
|
& code {
|
|
1780
|
-
font-family: 'Menlo', 'Fira Code', monospace
|
|
1901
|
+
font-family: 'Menlo', 'Fira Code', monospace;
|
|
1781
1902
|
margin: 0;
|
|
1782
1903
|
font-size: ${font.size.sm};
|
|
1783
1904
|
line-height: ${font.lineHeight.sm};
|
|
@@ -1870,7 +1991,7 @@ const getStyles = () => {
|
|
|
1870
1991
|
}
|
|
1871
1992
|
|
|
1872
1993
|
& svg path {
|
|
1873
|
-
stroke: ${tokens.colors.red[400]}
|
|
1994
|
+
stroke: ${tokens.colors.red[400]};
|
|
1874
1995
|
}
|
|
1875
1996
|
`,
|
|
1876
1997
|
settingsMenu: css`
|