@tanstack/devtools 0.6.18 → 0.6.20
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/dist/chunk/{SFOE7G6Y.js → XFQ6P775.js} +4 -3
- package/dist/dev.js +3 -3
- package/dist/devtools/{LMV5GWDT.js → 6XAY2RKM.js} +88 -61
- package/dist/devtools/{QEKPWHXZ.js → YM72BEIK.js} +84 -56
- package/dist/index.d.ts +4 -0
- package/dist/index.js +3 -3
- package/dist/server.js +2 -2
- package/package.json +2 -2
- package/src/components/trigger.tsx +11 -9
- package/src/context/devtools-context.test.ts +2 -2
- package/src/context/devtools-context.tsx +3 -2
- package/src/context/devtools-store.ts +5 -0
- package/src/styles/use-styles.ts +65 -53
- package/src/tabs/settings-tab.tsx +8 -0
|
@@ -63,7 +63,8 @@ var initialState = {
|
|
|
63
63
|
requireUrlFlag: false,
|
|
64
64
|
urlFlag: "tanstack-devtools",
|
|
65
65
|
theme: typeof window !== "undefined" && typeof window.matchMedia !== "undefined" && window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light",
|
|
66
|
-
triggerImage: ""
|
|
66
|
+
triggerImage: "",
|
|
67
|
+
triggerHidden: false
|
|
67
68
|
},
|
|
68
69
|
state: {
|
|
69
70
|
activeTab: "plugins",
|
|
@@ -201,7 +202,7 @@ var generatePluginId = (plugin, index) => {
|
|
|
201
202
|
function getStateFromLocalStorage(plugins) {
|
|
202
203
|
const existingStateString = getStorageItem(TANSTACK_DEVTOOLS_STATE);
|
|
203
204
|
const existingState = tryParseJson(existingStateString);
|
|
204
|
-
const pluginIds = [];
|
|
205
|
+
const pluginIds = plugins?.map((plugin, i) => generatePluginId(plugin, i)) || [];
|
|
205
206
|
if (existingState?.activePlugins) {
|
|
206
207
|
const originalLength = existingState.activePlugins.length;
|
|
207
208
|
existingState.activePlugins = existingState.activePlugins.filter((id) => pluginIds.includes(id));
|
|
@@ -212,7 +213,7 @@ function getStateFromLocalStorage(plugins) {
|
|
|
212
213
|
return existingState;
|
|
213
214
|
}
|
|
214
215
|
var getExistingStateFromStorage = (config, plugins) => {
|
|
215
|
-
const existingState = getStateFromLocalStorage();
|
|
216
|
+
const existingState = getStateFromLocalStorage(plugins);
|
|
216
217
|
const settings = getSettings();
|
|
217
218
|
const state = {
|
|
218
219
|
...initialState,
|
package/dist/dev.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { initialState, DevtoolsProvider, PiPProvider } from './chunk/
|
|
2
|
-
export { PLUGIN_CONTAINER_ID, PLUGIN_TITLE_CONTAINER_ID } from './chunk/
|
|
1
|
+
import { initialState, DevtoolsProvider, PiPProvider } from './chunk/XFQ6P775.js';
|
|
2
|
+
export { PLUGIN_CONTAINER_ID, PLUGIN_TITLE_CONTAINER_ID } from './chunk/XFQ6P775.js';
|
|
3
3
|
import { render, createComponent, Portal } from 'solid-js/web';
|
|
4
4
|
import { lazy } from 'solid-js';
|
|
5
5
|
import { ClientEventBus } from '@tanstack/devtools-event-bus/client';
|
|
@@ -29,7 +29,7 @@ var TanStackDevtoolsCore = class {
|
|
|
29
29
|
const mountTo = el;
|
|
30
30
|
const dispose = render(() => {
|
|
31
31
|
const _self$ = this;
|
|
32
|
-
this.#Component = lazy(() => import('./devtools/
|
|
32
|
+
this.#Component = lazy(() => import('./devtools/6XAY2RKM.js'));
|
|
33
33
|
const Devtools = this.#Component;
|
|
34
34
|
this.#eventBus = new ClientEventBus(this.#eventBusConfig);
|
|
35
35
|
this.#eventBus.start();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { usePiPWindow, keyboardModifiers, getAllPermutations, TANSTACK_DEVTOOLS, DevtoolsContext, PLUGIN_TITLE_CONTAINER_ID, PLUGIN_CONTAINER_ID, uppercaseFirstLetter } from '../chunk/
|
|
1
|
+
import { usePiPWindow, keyboardModifiers, getAllPermutations, TANSTACK_DEVTOOLS, DevtoolsContext, PLUGIN_TITLE_CONTAINER_ID, PLUGIN_CONTAINER_ID, uppercaseFirstLetter } from '../chunk/XFQ6P775.js';
|
|
2
2
|
import { delegateEvents, createComponent, Portal, template, use, setAttribute, insert, memo, effect, className, addEventListener } from 'solid-js/web';
|
|
3
3
|
import { createContext, createSignal, createEffect, onCleanup, Show, createMemo, For, useContext, onMount } from 'solid-js';
|
|
4
4
|
import { createShortcut } from '@solid-primitives/keyboard';
|
|
@@ -476,8 +476,8 @@ var stylesFactory = (theme) => {
|
|
|
476
476
|
padding: 0;
|
|
477
477
|
margin: 0 auto;
|
|
478
478
|
background: ${t(colors.white, colors.darkGray[700])};
|
|
479
|
-
border-radius:
|
|
480
|
-
box-shadow:
|
|
479
|
+
border-radius: 8px;
|
|
480
|
+
box-shadow: none;
|
|
481
481
|
overflow-y: auto;
|
|
482
482
|
height: 100%;
|
|
483
483
|
display: flex;
|
|
@@ -489,16 +489,16 @@ var stylesFactory = (theme) => {
|
|
|
489
489
|
seoTabTitle: css2`
|
|
490
490
|
font-size: 1.25rem;
|
|
491
491
|
font-weight: 600;
|
|
492
|
-
color: ${t(colors.
|
|
492
|
+
color: ${t(colors.gray[900], colors.gray[100])};
|
|
493
493
|
margin: 0;
|
|
494
494
|
padding: 1rem 1.5rem 0.5rem 1.5rem;
|
|
495
495
|
text-align: left;
|
|
496
|
-
border-bottom: 1px solid ${t(colors.gray[
|
|
496
|
+
border-bottom: 1px solid ${t(colors.gray[200], colors.gray[800])};
|
|
497
497
|
`,
|
|
498
498
|
seoTabSection: css2`
|
|
499
499
|
padding: 1.5rem;
|
|
500
|
-
background: ${t(colors.gray[
|
|
501
|
-
border: 1px solid ${t(colors.gray[
|
|
500
|
+
background: ${t(colors.gray[50], colors.darkGray[800])};
|
|
501
|
+
border: 1px solid ${t(colors.gray[200], colors.gray[800])};
|
|
502
502
|
display: flex;
|
|
503
503
|
flex-direction: column;
|
|
504
504
|
gap: 0.5rem;
|
|
@@ -517,12 +517,12 @@ var stylesFactory = (theme) => {
|
|
|
517
517
|
padding-bottom: 0.5rem;
|
|
518
518
|
`,
|
|
519
519
|
seoPreviewCard: css2`
|
|
520
|
-
border: 1px solid ${t(colors.gray[
|
|
520
|
+
border: 1px solid ${t(colors.gray[200], colors.gray[800])};
|
|
521
521
|
border-radius: 8px;
|
|
522
522
|
padding: 12px 10px;
|
|
523
523
|
background: ${t(colors.white, colors.darkGray[900])};
|
|
524
524
|
margin-bottom: 0;
|
|
525
|
-
box-shadow: 0 1px
|
|
525
|
+
box-shadow: 0 1px 3px ${t("rgba(0,0,0,0.05)", "rgba(0,0,0,0.1)")};
|
|
526
526
|
display: flex;
|
|
527
527
|
flex-direction: column;
|
|
528
528
|
align-items: flex-start;
|
|
@@ -532,10 +532,10 @@ var stylesFactory = (theme) => {
|
|
|
532
532
|
gap: 4px;
|
|
533
533
|
`,
|
|
534
534
|
seoPreviewHeader: css2`
|
|
535
|
-
font-size:
|
|
536
|
-
font-weight:
|
|
537
|
-
margin-bottom:
|
|
538
|
-
color: ${t(colors.
|
|
535
|
+
font-size: 0.875rem;
|
|
536
|
+
font-weight: 600;
|
|
537
|
+
margin-bottom: 0;
|
|
538
|
+
color: ${t(colors.gray[700], colors.gray[300])};
|
|
539
539
|
`,
|
|
540
540
|
seoPreviewImage: css2`
|
|
541
541
|
max-width: 100%;
|
|
@@ -543,28 +543,29 @@ var stylesFactory = (theme) => {
|
|
|
543
543
|
margin-bottom: 6px;
|
|
544
544
|
box-shadow: 0 1px 2px ${t("rgba(0,0,0,0.03)", "rgba(0,0,0,0.06)")};
|
|
545
545
|
height: 160px;
|
|
546
|
+
object-fit: cover;
|
|
546
547
|
`,
|
|
547
548
|
seoPreviewTitle: css2`
|
|
548
|
-
font-size:
|
|
549
|
+
font-size: 0.9rem;
|
|
549
550
|
font-weight: 600;
|
|
550
|
-
margin-bottom:
|
|
551
|
+
margin-bottom: 4px;
|
|
551
552
|
color: ${t(colors.gray[900], colors.gray[100])};
|
|
552
553
|
`,
|
|
553
554
|
seoPreviewDesc: css2`
|
|
554
|
-
color: ${t(colors.gray[
|
|
555
|
-
margin-bottom:
|
|
556
|
-
font-size: 0.
|
|
555
|
+
color: ${t(colors.gray[600], colors.gray[400])};
|
|
556
|
+
margin-bottom: 4px;
|
|
557
|
+
font-size: 0.8rem;
|
|
557
558
|
`,
|
|
558
559
|
seoPreviewUrl: css2`
|
|
559
560
|
color: ${t(colors.gray[500], colors.gray[500])};
|
|
560
|
-
font-size: 0.
|
|
561
|
-
margin-bottom:
|
|
561
|
+
font-size: 0.75rem;
|
|
562
|
+
margin-bottom: 0;
|
|
562
563
|
word-break: break-all;
|
|
563
564
|
`,
|
|
564
565
|
seoMissingTagsSection: css2`
|
|
565
566
|
margin-top: 4px;
|
|
566
|
-
font-size: 0.
|
|
567
|
-
color: ${t(colors.red[
|
|
567
|
+
font-size: 0.875rem;
|
|
568
|
+
color: ${t(colors.red[500], colors.red[400])};
|
|
568
569
|
`,
|
|
569
570
|
seoMissingTagsList: css2`
|
|
570
571
|
margin: 4px 0 0 0;
|
|
@@ -572,22 +573,23 @@ var stylesFactory = (theme) => {
|
|
|
572
573
|
list-style: none;
|
|
573
574
|
display: flex;
|
|
574
575
|
flex-wrap: wrap;
|
|
575
|
-
gap:
|
|
576
|
+
gap: 4px;
|
|
576
577
|
max-width: 240px;
|
|
577
578
|
`,
|
|
578
579
|
seoMissingTag: css2`
|
|
579
580
|
background: ${t(colors.red[100], colors.red[500] + "22")};
|
|
580
581
|
color: ${t(colors.red[700], colors.red[500])};
|
|
581
|
-
border-radius:
|
|
582
|
-
padding:
|
|
583
|
-
font-size: 0.
|
|
582
|
+
border-radius: 3px;
|
|
583
|
+
padding: 2px 6px;
|
|
584
|
+
font-size: 0.75rem;
|
|
584
585
|
font-weight: 500;
|
|
585
586
|
`,
|
|
586
587
|
seoAllTagsFound: css2`
|
|
587
588
|
color: ${t(colors.green[700], colors.green[500])};
|
|
588
589
|
font-weight: 500;
|
|
589
|
-
margin-left:
|
|
590
|
-
|
|
590
|
+
margin-left: 0;
|
|
591
|
+
padding: 0 10px 8px 10px;
|
|
592
|
+
font-size: 0.875rem;
|
|
591
593
|
`,
|
|
592
594
|
devtoolsPanelContainer: (panelLocation, isDetached) => css2`
|
|
593
595
|
direction: ltr;
|
|
@@ -599,7 +601,7 @@ var stylesFactory = (theme) => {
|
|
|
599
601
|
z-index: 99999;
|
|
600
602
|
width: 100%;
|
|
601
603
|
${isDetached ? "" : "max-height: 90%;"}
|
|
602
|
-
border-top: 1px solid ${t(colors.gray[
|
|
604
|
+
border-top: 1px solid ${t(colors.gray[200], colors.gray[800])};
|
|
603
605
|
transform-origin: top;
|
|
604
606
|
`,
|
|
605
607
|
devtoolsPanelContainerVisibility: (isOpen) => {
|
|
@@ -652,7 +654,7 @@ var stylesFactory = (theme) => {
|
|
|
652
654
|
user-select: none;
|
|
653
655
|
z-index: 100000;
|
|
654
656
|
&:hover {
|
|
655
|
-
background-color: ${t(colors.
|
|
657
|
+
background-color: ${t(colors.gray[400], colors.gray[500])};
|
|
656
658
|
}
|
|
657
659
|
`,
|
|
658
660
|
mainCloseBtn: css2`
|
|
@@ -731,9 +733,9 @@ var stylesFactory = (theme) => {
|
|
|
731
733
|
align-items: center;
|
|
732
734
|
justify-content: flex-start;
|
|
733
735
|
height: 100%;
|
|
734
|
-
background-color: ${t(colors.gray[
|
|
735
|
-
border-right: 1px solid ${t(colors.gray[
|
|
736
|
-
box-shadow:
|
|
736
|
+
background-color: ${t(colors.gray[50], colors.darkGray[900])};
|
|
737
|
+
border-right: 1px solid ${t(colors.gray[200], colors.gray[800])};
|
|
738
|
+
box-shadow: none;
|
|
737
739
|
position: relative;
|
|
738
740
|
width: ${size[10]};
|
|
739
741
|
`,
|
|
@@ -746,24 +748,24 @@ var stylesFactory = (theme) => {
|
|
|
746
748
|
cursor: pointer;
|
|
747
749
|
font-size: ${fontSize.sm};
|
|
748
750
|
font-family: ${fontFamily.sans};
|
|
749
|
-
color: ${t(colors.gray[
|
|
751
|
+
color: ${t(colors.gray[600], colors.gray[400])};
|
|
750
752
|
background-color: transparent;
|
|
751
753
|
border: none;
|
|
752
|
-
transition: all 0.
|
|
754
|
+
transition: all 0.15s ease;
|
|
753
755
|
border-left: 2px solid transparent;
|
|
754
756
|
&:hover:not(.close):not(.active):not(.detach) {
|
|
755
|
-
background-color: ${t(colors.gray[
|
|
757
|
+
background-color: ${t(colors.gray[100], colors.gray[800])};
|
|
756
758
|
color: ${t(colors.gray[900], colors.gray[100])};
|
|
757
|
-
border-left: 2px solid ${t(colors.
|
|
759
|
+
border-left: 2px solid ${t(colors.gray[900], colors.gray[100])};
|
|
758
760
|
}
|
|
759
761
|
&.active {
|
|
760
|
-
background-color: ${t(colors.
|
|
762
|
+
background-color: ${t(colors.gray[100], colors.gray[800])};
|
|
761
763
|
color: ${t(colors.gray[900], colors.gray[100])};
|
|
762
|
-
border-left: 2px solid ${t(colors.
|
|
764
|
+
border-left: 2px solid ${t(colors.gray[900], colors.gray[100])};
|
|
763
765
|
}
|
|
764
766
|
&.detach {
|
|
765
767
|
&:hover {
|
|
766
|
-
background-color: ${t(colors.gray[
|
|
768
|
+
background-color: ${t(colors.gray[100], colors.gray[800])};
|
|
767
769
|
}
|
|
768
770
|
&:hover {
|
|
769
771
|
color: ${t(colors.green[700], colors.green[500])};
|
|
@@ -772,7 +774,7 @@ var stylesFactory = (theme) => {
|
|
|
772
774
|
&.close {
|
|
773
775
|
margin-top: auto;
|
|
774
776
|
&:hover {
|
|
775
|
-
background-color: ${t(colors.gray[
|
|
777
|
+
background-color: ${t(colors.gray[100], colors.gray[800])};
|
|
776
778
|
}
|
|
777
779
|
&:hover {
|
|
778
780
|
color: ${t(colors.red[700], colors.red[500])};
|
|
@@ -803,13 +805,13 @@ var stylesFactory = (theme) => {
|
|
|
803
805
|
pluginsTabDraw: (isExpanded) => css2`
|
|
804
806
|
width: ${isExpanded ? size[48] : 0};
|
|
805
807
|
height: 100%;
|
|
806
|
-
background-color: ${t(colors.white, colors.darkGray[
|
|
807
|
-
box-shadow:
|
|
808
|
-
${isExpanded ? `border-right: 1px solid ${t(colors.gray[
|
|
808
|
+
background-color: ${t(colors.white, colors.darkGray[900])};
|
|
809
|
+
box-shadow: none;
|
|
810
|
+
${isExpanded ? `border-right: 1px solid ${t(colors.gray[200], colors.gray[800])};` : ""}
|
|
809
811
|
`,
|
|
810
812
|
pluginsTabDrawExpanded: css2`
|
|
811
813
|
width: ${size[48]};
|
|
812
|
-
border-right: 1px solid ${t(colors.gray[
|
|
814
|
+
border-right: 1px solid ${t(colors.gray[200], colors.gray[800])};
|
|
813
815
|
`,
|
|
814
816
|
pluginsTabDrawTransition: (mSeconds) => {
|
|
815
817
|
return css2`
|
|
@@ -829,38 +831,48 @@ var stylesFactory = (theme) => {
|
|
|
829
831
|
pluginName: css2`
|
|
830
832
|
font-size: ${fontSize.xs};
|
|
831
833
|
font-family: ${fontFamily.sans};
|
|
832
|
-
color: ${t(colors.gray[
|
|
834
|
+
color: ${t(colors.gray[600], colors.gray[400])};
|
|
833
835
|
padding: ${size[2]};
|
|
834
836
|
cursor: pointer;
|
|
835
837
|
text-align: center;
|
|
836
|
-
transition: all 0.
|
|
838
|
+
transition: all 0.15s ease;
|
|
839
|
+
border-left: 2px solid transparent;
|
|
840
|
+
|
|
837
841
|
&:hover {
|
|
838
|
-
background-color: ${t(colors.gray[
|
|
842
|
+
background-color: ${t(colors.gray[100], colors.gray[800])};
|
|
839
843
|
color: ${t(colors.gray[900], colors.gray[100])};
|
|
840
844
|
padding: ${size[2]};
|
|
841
845
|
}
|
|
842
846
|
&.active {
|
|
843
|
-
background-color: ${t(colors.
|
|
847
|
+
background-color: ${t(colors.gray[100], colors.gray[800])};
|
|
844
848
|
color: ${t(colors.gray[900], colors.gray[100])};
|
|
849
|
+
border-left: 2px solid ${t(colors.gray[900], colors.gray[100])};
|
|
850
|
+
}
|
|
851
|
+
&.active:hover {
|
|
852
|
+
background-color: ${t(colors.gray[200], colors.gray[700])};
|
|
845
853
|
}
|
|
846
854
|
`,
|
|
847
855
|
pluginsTabContent: css2`
|
|
848
856
|
width: 100%;
|
|
849
857
|
height: 100%;
|
|
850
858
|
overflow-y: auto;
|
|
859
|
+
|
|
860
|
+
&:not(:last-child) {
|
|
861
|
+
border-right: 5px solid ${t(colors.purple[200], colors.purple[800])};
|
|
862
|
+
}
|
|
851
863
|
`,
|
|
852
864
|
settingsGroup: css2`
|
|
853
865
|
display: flex;
|
|
854
866
|
flex-direction: column;
|
|
855
|
-
gap:
|
|
867
|
+
gap: 0.75rem;
|
|
856
868
|
`,
|
|
857
869
|
conditionalSetting: css2`
|
|
858
870
|
margin-left: 1.5rem;
|
|
859
871
|
padding-left: 1rem;
|
|
860
|
-
border-left: 2px solid ${t(colors.
|
|
861
|
-
background-color: ${t(colors.gray[
|
|
862
|
-
padding:
|
|
863
|
-
border-radius: 0.
|
|
872
|
+
border-left: 2px solid ${t(colors.gray[300], colors.gray[600])};
|
|
873
|
+
background-color: ${t(colors.gray[50], colors.darkGray[900])};
|
|
874
|
+
padding: 0.75rem;
|
|
875
|
+
border-radius: 0.375rem;
|
|
864
876
|
margin-top: 0.5rem;
|
|
865
877
|
`,
|
|
866
878
|
settingRow: css2`
|
|
@@ -904,13 +916,18 @@ var Trigger = ({
|
|
|
904
916
|
const buttonStyle = createMemo(() => {
|
|
905
917
|
return clsx3(styles().mainCloseBtn, styles().mainCloseBtnPosition(settings().position), styles().mainCloseBtnAnimation(isOpen(), settings().hideUntilHover));
|
|
906
918
|
});
|
|
907
|
-
return (
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
919
|
+
return createComponent(Show, {
|
|
920
|
+
get when() {
|
|
921
|
+
return !settings().triggerHidden;
|
|
922
|
+
},
|
|
923
|
+
get children() {
|
|
924
|
+
var _el$ = _tmpl$(), _el$2 = _el$.firstChild;
|
|
925
|
+
_el$.$$click = () => setIsOpen(!isOpen());
|
|
926
|
+
setAttribute(_el$2, "src", image || tanstack_logo_default);
|
|
927
|
+
effect(() => className(_el$, buttonStyle()));
|
|
928
|
+
return _el$;
|
|
929
|
+
}
|
|
930
|
+
});
|
|
914
931
|
};
|
|
915
932
|
delegateEvents(["click"]);
|
|
916
933
|
var _tmpl$2 = /* @__PURE__ */ template(`<div>`);
|
|
@@ -1029,6 +1046,16 @@ var SettingsTab = () => {
|
|
|
1029
1046
|
return settings().hideUntilHover;
|
|
1030
1047
|
}
|
|
1031
1048
|
}), null);
|
|
1049
|
+
insert(_el$, createComponent(Checkbox, {
|
|
1050
|
+
label: "Completely hide trigger",
|
|
1051
|
+
description: "Completely removes the trigger from the DOM (you can still open it with the hotkey)",
|
|
1052
|
+
onChange: () => setSettings({
|
|
1053
|
+
triggerHidden: !settings().triggerHidden
|
|
1054
|
+
}),
|
|
1055
|
+
get checked() {
|
|
1056
|
+
return settings().triggerHidden;
|
|
1057
|
+
}
|
|
1058
|
+
}), null);
|
|
1032
1059
|
insert(_el$, createComponent(Input, {
|
|
1033
1060
|
label: "Trigger Image",
|
|
1034
1061
|
description: "Specify the URL of the image to use for the trigger",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { usePiPWindow, keyboardModifiers, getAllPermutations, TANSTACK_DEVTOOLS, DevtoolsContext, PLUGIN_TITLE_CONTAINER_ID, PLUGIN_CONTAINER_ID, uppercaseFirstLetter } from '../chunk/
|
|
1
|
+
import { usePiPWindow, keyboardModifiers, getAllPermutations, TANSTACK_DEVTOOLS, DevtoolsContext, PLUGIN_TITLE_CONTAINER_ID, PLUGIN_CONTAINER_ID, uppercaseFirstLetter } from '../chunk/XFQ6P775.js';
|
|
2
2
|
import { createComponent, Portal, ssr, ssrAttribute, escape } from 'solid-js/web';
|
|
3
3
|
import { createContext, createSignal, createEffect, onCleanup, Show, createMemo, For, useContext, onMount } from 'solid-js';
|
|
4
4
|
import { createShortcut } from '@solid-primitives/keyboard';
|
|
@@ -476,8 +476,8 @@ var stylesFactory = (theme) => {
|
|
|
476
476
|
padding: 0;
|
|
477
477
|
margin: 0 auto;
|
|
478
478
|
background: ${t(colors.white, colors.darkGray[700])};
|
|
479
|
-
border-radius:
|
|
480
|
-
box-shadow:
|
|
479
|
+
border-radius: 8px;
|
|
480
|
+
box-shadow: none;
|
|
481
481
|
overflow-y: auto;
|
|
482
482
|
height: 100%;
|
|
483
483
|
display: flex;
|
|
@@ -489,16 +489,16 @@ var stylesFactory = (theme) => {
|
|
|
489
489
|
seoTabTitle: css2`
|
|
490
490
|
font-size: 1.25rem;
|
|
491
491
|
font-weight: 600;
|
|
492
|
-
color: ${t(colors.
|
|
492
|
+
color: ${t(colors.gray[900], colors.gray[100])};
|
|
493
493
|
margin: 0;
|
|
494
494
|
padding: 1rem 1.5rem 0.5rem 1.5rem;
|
|
495
495
|
text-align: left;
|
|
496
|
-
border-bottom: 1px solid ${t(colors.gray[
|
|
496
|
+
border-bottom: 1px solid ${t(colors.gray[200], colors.gray[800])};
|
|
497
497
|
`,
|
|
498
498
|
seoTabSection: css2`
|
|
499
499
|
padding: 1.5rem;
|
|
500
|
-
background: ${t(colors.gray[
|
|
501
|
-
border: 1px solid ${t(colors.gray[
|
|
500
|
+
background: ${t(colors.gray[50], colors.darkGray[800])};
|
|
501
|
+
border: 1px solid ${t(colors.gray[200], colors.gray[800])};
|
|
502
502
|
display: flex;
|
|
503
503
|
flex-direction: column;
|
|
504
504
|
gap: 0.5rem;
|
|
@@ -517,12 +517,12 @@ var stylesFactory = (theme) => {
|
|
|
517
517
|
padding-bottom: 0.5rem;
|
|
518
518
|
`,
|
|
519
519
|
seoPreviewCard: css2`
|
|
520
|
-
border: 1px solid ${t(colors.gray[
|
|
520
|
+
border: 1px solid ${t(colors.gray[200], colors.gray[800])};
|
|
521
521
|
border-radius: 8px;
|
|
522
522
|
padding: 12px 10px;
|
|
523
523
|
background: ${t(colors.white, colors.darkGray[900])};
|
|
524
524
|
margin-bottom: 0;
|
|
525
|
-
box-shadow: 0 1px
|
|
525
|
+
box-shadow: 0 1px 3px ${t("rgba(0,0,0,0.05)", "rgba(0,0,0,0.1)")};
|
|
526
526
|
display: flex;
|
|
527
527
|
flex-direction: column;
|
|
528
528
|
align-items: flex-start;
|
|
@@ -532,10 +532,10 @@ var stylesFactory = (theme) => {
|
|
|
532
532
|
gap: 4px;
|
|
533
533
|
`,
|
|
534
534
|
seoPreviewHeader: css2`
|
|
535
|
-
font-size:
|
|
536
|
-
font-weight:
|
|
537
|
-
margin-bottom:
|
|
538
|
-
color: ${t(colors.
|
|
535
|
+
font-size: 0.875rem;
|
|
536
|
+
font-weight: 600;
|
|
537
|
+
margin-bottom: 0;
|
|
538
|
+
color: ${t(colors.gray[700], colors.gray[300])};
|
|
539
539
|
`,
|
|
540
540
|
seoPreviewImage: css2`
|
|
541
541
|
max-width: 100%;
|
|
@@ -543,28 +543,29 @@ var stylesFactory = (theme) => {
|
|
|
543
543
|
margin-bottom: 6px;
|
|
544
544
|
box-shadow: 0 1px 2px ${t("rgba(0,0,0,0.03)", "rgba(0,0,0,0.06)")};
|
|
545
545
|
height: 160px;
|
|
546
|
+
object-fit: cover;
|
|
546
547
|
`,
|
|
547
548
|
seoPreviewTitle: css2`
|
|
548
|
-
font-size:
|
|
549
|
+
font-size: 0.9rem;
|
|
549
550
|
font-weight: 600;
|
|
550
|
-
margin-bottom:
|
|
551
|
+
margin-bottom: 4px;
|
|
551
552
|
color: ${t(colors.gray[900], colors.gray[100])};
|
|
552
553
|
`,
|
|
553
554
|
seoPreviewDesc: css2`
|
|
554
|
-
color: ${t(colors.gray[
|
|
555
|
-
margin-bottom:
|
|
556
|
-
font-size: 0.
|
|
555
|
+
color: ${t(colors.gray[600], colors.gray[400])};
|
|
556
|
+
margin-bottom: 4px;
|
|
557
|
+
font-size: 0.8rem;
|
|
557
558
|
`,
|
|
558
559
|
seoPreviewUrl: css2`
|
|
559
560
|
color: ${t(colors.gray[500], colors.gray[500])};
|
|
560
|
-
font-size: 0.
|
|
561
|
-
margin-bottom:
|
|
561
|
+
font-size: 0.75rem;
|
|
562
|
+
margin-bottom: 0;
|
|
562
563
|
word-break: break-all;
|
|
563
564
|
`,
|
|
564
565
|
seoMissingTagsSection: css2`
|
|
565
566
|
margin-top: 4px;
|
|
566
|
-
font-size: 0.
|
|
567
|
-
color: ${t(colors.red[
|
|
567
|
+
font-size: 0.875rem;
|
|
568
|
+
color: ${t(colors.red[500], colors.red[400])};
|
|
568
569
|
`,
|
|
569
570
|
seoMissingTagsList: css2`
|
|
570
571
|
margin: 4px 0 0 0;
|
|
@@ -572,22 +573,23 @@ var stylesFactory = (theme) => {
|
|
|
572
573
|
list-style: none;
|
|
573
574
|
display: flex;
|
|
574
575
|
flex-wrap: wrap;
|
|
575
|
-
gap:
|
|
576
|
+
gap: 4px;
|
|
576
577
|
max-width: 240px;
|
|
577
578
|
`,
|
|
578
579
|
seoMissingTag: css2`
|
|
579
580
|
background: ${t(colors.red[100], colors.red[500] + "22")};
|
|
580
581
|
color: ${t(colors.red[700], colors.red[500])};
|
|
581
|
-
border-radius:
|
|
582
|
-
padding:
|
|
583
|
-
font-size: 0.
|
|
582
|
+
border-radius: 3px;
|
|
583
|
+
padding: 2px 6px;
|
|
584
|
+
font-size: 0.75rem;
|
|
584
585
|
font-weight: 500;
|
|
585
586
|
`,
|
|
586
587
|
seoAllTagsFound: css2`
|
|
587
588
|
color: ${t(colors.green[700], colors.green[500])};
|
|
588
589
|
font-weight: 500;
|
|
589
|
-
margin-left:
|
|
590
|
-
|
|
590
|
+
margin-left: 0;
|
|
591
|
+
padding: 0 10px 8px 10px;
|
|
592
|
+
font-size: 0.875rem;
|
|
591
593
|
`,
|
|
592
594
|
devtoolsPanelContainer: (panelLocation, isDetached) => css2`
|
|
593
595
|
direction: ltr;
|
|
@@ -599,7 +601,7 @@ var stylesFactory = (theme) => {
|
|
|
599
601
|
z-index: 99999;
|
|
600
602
|
width: 100%;
|
|
601
603
|
${isDetached ? "" : "max-height: 90%;"}
|
|
602
|
-
border-top: 1px solid ${t(colors.gray[
|
|
604
|
+
border-top: 1px solid ${t(colors.gray[200], colors.gray[800])};
|
|
603
605
|
transform-origin: top;
|
|
604
606
|
`,
|
|
605
607
|
devtoolsPanelContainerVisibility: (isOpen) => {
|
|
@@ -652,7 +654,7 @@ var stylesFactory = (theme) => {
|
|
|
652
654
|
user-select: none;
|
|
653
655
|
z-index: 100000;
|
|
654
656
|
&:hover {
|
|
655
|
-
background-color: ${t(colors.
|
|
657
|
+
background-color: ${t(colors.gray[400], colors.gray[500])};
|
|
656
658
|
}
|
|
657
659
|
`,
|
|
658
660
|
mainCloseBtn: css2`
|
|
@@ -731,9 +733,9 @@ var stylesFactory = (theme) => {
|
|
|
731
733
|
align-items: center;
|
|
732
734
|
justify-content: flex-start;
|
|
733
735
|
height: 100%;
|
|
734
|
-
background-color: ${t(colors.gray[
|
|
735
|
-
border-right: 1px solid ${t(colors.gray[
|
|
736
|
-
box-shadow:
|
|
736
|
+
background-color: ${t(colors.gray[50], colors.darkGray[900])};
|
|
737
|
+
border-right: 1px solid ${t(colors.gray[200], colors.gray[800])};
|
|
738
|
+
box-shadow: none;
|
|
737
739
|
position: relative;
|
|
738
740
|
width: ${size[10]};
|
|
739
741
|
`,
|
|
@@ -746,24 +748,24 @@ var stylesFactory = (theme) => {
|
|
|
746
748
|
cursor: pointer;
|
|
747
749
|
font-size: ${fontSize.sm};
|
|
748
750
|
font-family: ${fontFamily.sans};
|
|
749
|
-
color: ${t(colors.gray[
|
|
751
|
+
color: ${t(colors.gray[600], colors.gray[400])};
|
|
750
752
|
background-color: transparent;
|
|
751
753
|
border: none;
|
|
752
|
-
transition: all 0.
|
|
754
|
+
transition: all 0.15s ease;
|
|
753
755
|
border-left: 2px solid transparent;
|
|
754
756
|
&:hover:not(.close):not(.active):not(.detach) {
|
|
755
|
-
background-color: ${t(colors.gray[
|
|
757
|
+
background-color: ${t(colors.gray[100], colors.gray[800])};
|
|
756
758
|
color: ${t(colors.gray[900], colors.gray[100])};
|
|
757
|
-
border-left: 2px solid ${t(colors.
|
|
759
|
+
border-left: 2px solid ${t(colors.gray[900], colors.gray[100])};
|
|
758
760
|
}
|
|
759
761
|
&.active {
|
|
760
|
-
background-color: ${t(colors.
|
|
762
|
+
background-color: ${t(colors.gray[100], colors.gray[800])};
|
|
761
763
|
color: ${t(colors.gray[900], colors.gray[100])};
|
|
762
|
-
border-left: 2px solid ${t(colors.
|
|
764
|
+
border-left: 2px solid ${t(colors.gray[900], colors.gray[100])};
|
|
763
765
|
}
|
|
764
766
|
&.detach {
|
|
765
767
|
&:hover {
|
|
766
|
-
background-color: ${t(colors.gray[
|
|
768
|
+
background-color: ${t(colors.gray[100], colors.gray[800])};
|
|
767
769
|
}
|
|
768
770
|
&:hover {
|
|
769
771
|
color: ${t(colors.green[700], colors.green[500])};
|
|
@@ -772,7 +774,7 @@ var stylesFactory = (theme) => {
|
|
|
772
774
|
&.close {
|
|
773
775
|
margin-top: auto;
|
|
774
776
|
&:hover {
|
|
775
|
-
background-color: ${t(colors.gray[
|
|
777
|
+
background-color: ${t(colors.gray[100], colors.gray[800])};
|
|
776
778
|
}
|
|
777
779
|
&:hover {
|
|
778
780
|
color: ${t(colors.red[700], colors.red[500])};
|
|
@@ -803,13 +805,13 @@ var stylesFactory = (theme) => {
|
|
|
803
805
|
pluginsTabDraw: (isExpanded) => css2`
|
|
804
806
|
width: ${isExpanded ? size[48] : 0};
|
|
805
807
|
height: 100%;
|
|
806
|
-
background-color: ${t(colors.white, colors.darkGray[
|
|
807
|
-
box-shadow:
|
|
808
|
-
${isExpanded ? `border-right: 1px solid ${t(colors.gray[
|
|
808
|
+
background-color: ${t(colors.white, colors.darkGray[900])};
|
|
809
|
+
box-shadow: none;
|
|
810
|
+
${isExpanded ? `border-right: 1px solid ${t(colors.gray[200], colors.gray[800])};` : ""}
|
|
809
811
|
`,
|
|
810
812
|
pluginsTabDrawExpanded: css2`
|
|
811
813
|
width: ${size[48]};
|
|
812
|
-
border-right: 1px solid ${t(colors.gray[
|
|
814
|
+
border-right: 1px solid ${t(colors.gray[200], colors.gray[800])};
|
|
813
815
|
`,
|
|
814
816
|
pluginsTabDrawTransition: (mSeconds) => {
|
|
815
817
|
return css2`
|
|
@@ -829,38 +831,48 @@ var stylesFactory = (theme) => {
|
|
|
829
831
|
pluginName: css2`
|
|
830
832
|
font-size: ${fontSize.xs};
|
|
831
833
|
font-family: ${fontFamily.sans};
|
|
832
|
-
color: ${t(colors.gray[
|
|
834
|
+
color: ${t(colors.gray[600], colors.gray[400])};
|
|
833
835
|
padding: ${size[2]};
|
|
834
836
|
cursor: pointer;
|
|
835
837
|
text-align: center;
|
|
836
|
-
transition: all 0.
|
|
838
|
+
transition: all 0.15s ease;
|
|
839
|
+
border-left: 2px solid transparent;
|
|
840
|
+
|
|
837
841
|
&:hover {
|
|
838
|
-
background-color: ${t(colors.gray[
|
|
842
|
+
background-color: ${t(colors.gray[100], colors.gray[800])};
|
|
839
843
|
color: ${t(colors.gray[900], colors.gray[100])};
|
|
840
844
|
padding: ${size[2]};
|
|
841
845
|
}
|
|
842
846
|
&.active {
|
|
843
|
-
background-color: ${t(colors.
|
|
847
|
+
background-color: ${t(colors.gray[100], colors.gray[800])};
|
|
844
848
|
color: ${t(colors.gray[900], colors.gray[100])};
|
|
849
|
+
border-left: 2px solid ${t(colors.gray[900], colors.gray[100])};
|
|
850
|
+
}
|
|
851
|
+
&.active:hover {
|
|
852
|
+
background-color: ${t(colors.gray[200], colors.gray[700])};
|
|
845
853
|
}
|
|
846
854
|
`,
|
|
847
855
|
pluginsTabContent: css2`
|
|
848
856
|
width: 100%;
|
|
849
857
|
height: 100%;
|
|
850
858
|
overflow-y: auto;
|
|
859
|
+
|
|
860
|
+
&:not(:last-child) {
|
|
861
|
+
border-right: 5px solid ${t(colors.purple[200], colors.purple[800])};
|
|
862
|
+
}
|
|
851
863
|
`,
|
|
852
864
|
settingsGroup: css2`
|
|
853
865
|
display: flex;
|
|
854
866
|
flex-direction: column;
|
|
855
|
-
gap:
|
|
867
|
+
gap: 0.75rem;
|
|
856
868
|
`,
|
|
857
869
|
conditionalSetting: css2`
|
|
858
870
|
margin-left: 1.5rem;
|
|
859
871
|
padding-left: 1rem;
|
|
860
|
-
border-left: 2px solid ${t(colors.
|
|
861
|
-
background-color: ${t(colors.gray[
|
|
862
|
-
padding:
|
|
863
|
-
border-radius: 0.
|
|
872
|
+
border-left: 2px solid ${t(colors.gray[300], colors.gray[600])};
|
|
873
|
+
background-color: ${t(colors.gray[50], colors.darkGray[900])};
|
|
874
|
+
padding: 0.75rem;
|
|
875
|
+
border-radius: 0.375rem;
|
|
864
876
|
margin-top: 0.5rem;
|
|
865
877
|
`,
|
|
866
878
|
settingRow: css2`
|
|
@@ -904,7 +916,14 @@ var Trigger = ({
|
|
|
904
916
|
const buttonStyle = createMemo(() => {
|
|
905
917
|
return clsx3(styles().mainCloseBtn, styles().mainCloseBtnPosition(settings().position), styles().mainCloseBtnAnimation(isOpen(), settings().hideUntilHover));
|
|
906
918
|
});
|
|
907
|
-
return
|
|
919
|
+
return createComponent(Show, {
|
|
920
|
+
get when() {
|
|
921
|
+
return !settings().triggerHidden;
|
|
922
|
+
},
|
|
923
|
+
get children() {
|
|
924
|
+
return ssr(_tmpl$, ssrAttribute("class", escape(buttonStyle(), true), false), ssrAttribute("src", escape(image, true) || escape(tanstack_logo_default, true), false));
|
|
925
|
+
}
|
|
926
|
+
});
|
|
908
927
|
};
|
|
909
928
|
var _tmpl$2 = ["<div", ' style="', '"', ">", "</div>"];
|
|
910
929
|
var MainPanel = (props) => {
|
|
@@ -932,7 +951,7 @@ var ContentPanel = (props) => {
|
|
|
932
951
|
} = useDevtoolsSettings();
|
|
933
952
|
return ssr(_tmpl$3, ssrAttribute("class", escape(styles().devtoolsPanel, true), false), props.handleDragStart ? ssr(_tmpl$22, ssrAttribute("class", escape(styles().dragHandle(settings().panelLocation), true), false)) : escape(null), escape(props.children));
|
|
934
953
|
};
|
|
935
|
-
var _tmpl$4 = ["<div", ">", "", "", "", "</div>"];
|
|
954
|
+
var _tmpl$4 = ["<div", ">", "", "", "", "", "</div>"];
|
|
936
955
|
var _tmpl$23 = ["<div", ">", "</div>"];
|
|
937
956
|
var _tmpl$32 = ["<div", ">", "", "</div>"];
|
|
938
957
|
var _tmpl$42 = ["<div", "><div", ">", "</div>", "Final shortcut is: ", "</div>"];
|
|
@@ -990,6 +1009,15 @@ var SettingsTab = () => {
|
|
|
990
1009
|
get checked() {
|
|
991
1010
|
return settings().hideUntilHover;
|
|
992
1011
|
}
|
|
1012
|
+
})), escape(createComponent(Checkbox, {
|
|
1013
|
+
label: "Completely hide trigger",
|
|
1014
|
+
description: "Completely removes the trigger from the DOM (you can still open it with the hotkey)",
|
|
1015
|
+
onChange: () => setSettings({
|
|
1016
|
+
triggerHidden: !settings().triggerHidden
|
|
1017
|
+
}),
|
|
1018
|
+
get checked() {
|
|
1019
|
+
return settings().triggerHidden;
|
|
1020
|
+
}
|
|
993
1021
|
})), escape(createComponent(Input, {
|
|
994
1022
|
label: "Trigger Image",
|
|
995
1023
|
description: "Specify the URL of the image to use for the trigger",
|
package/dist/index.d.ts
CHANGED
|
@@ -73,6 +73,10 @@ type DevtoolsStore = {
|
|
|
73
73
|
* @default TanStackLogo
|
|
74
74
|
*/
|
|
75
75
|
triggerImage: string;
|
|
76
|
+
/**
|
|
77
|
+
* Whether the trigger should be completely hidden or not (you can still open with the hotkey)
|
|
78
|
+
*/
|
|
79
|
+
triggerHidden?: boolean;
|
|
76
80
|
};
|
|
77
81
|
state: {
|
|
78
82
|
activeTab: TabName;
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { initialState, DevtoolsProvider, PiPProvider } from './chunk/
|
|
2
|
-
export { PLUGIN_CONTAINER_ID, PLUGIN_TITLE_CONTAINER_ID } from './chunk/
|
|
1
|
+
import { initialState, DevtoolsProvider, PiPProvider } from './chunk/XFQ6P775.js';
|
|
2
|
+
export { PLUGIN_CONTAINER_ID, PLUGIN_TITLE_CONTAINER_ID } from './chunk/XFQ6P775.js';
|
|
3
3
|
import { render, createComponent, Portal } from 'solid-js/web';
|
|
4
4
|
import { lazy } from 'solid-js';
|
|
5
5
|
import { ClientEventBus } from '@tanstack/devtools-event-bus/client';
|
|
@@ -29,7 +29,7 @@ var TanStackDevtoolsCore = class {
|
|
|
29
29
|
const mountTo = el;
|
|
30
30
|
const dispose = render(() => {
|
|
31
31
|
const _self$ = this;
|
|
32
|
-
this.#Component = lazy(() => import('./devtools/
|
|
32
|
+
this.#Component = lazy(() => import('./devtools/6XAY2RKM.js'));
|
|
33
33
|
const Devtools = this.#Component;
|
|
34
34
|
this.#eventBus = new ClientEventBus(this.#eventBusConfig);
|
|
35
35
|
this.#eventBus.start();
|
package/dist/server.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { initialState } from './chunk/
|
|
2
|
-
export { PLUGIN_CONTAINER_ID, PLUGIN_TITLE_CONTAINER_ID } from './chunk/
|
|
1
|
+
import { initialState } from './chunk/XFQ6P775.js';
|
|
2
|
+
export { PLUGIN_CONTAINER_ID, PLUGIN_TITLE_CONTAINER_ID } from './chunk/XFQ6P775.js';
|
|
3
3
|
import 'solid-js/web';
|
|
4
4
|
import 'solid-js';
|
|
5
5
|
import '@tanstack/devtools-event-bus/client';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tanstack/devtools",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.20",
|
|
4
4
|
"description": "TanStack Devtools is a set of tools for building advanced devtools for your application.",
|
|
5
5
|
"author": "Tanner Linsley",
|
|
6
6
|
"license": "MIT",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"goober": "^2.1.16",
|
|
55
55
|
"solid-js": "^1.9.9",
|
|
56
56
|
"@tanstack/devtools-event-bus": "0.3.2",
|
|
57
|
-
"@tanstack/devtools-ui": "0.4.
|
|
57
|
+
"@tanstack/devtools-ui": "0.4.2"
|
|
58
58
|
},
|
|
59
59
|
"peerDependencies": {
|
|
60
60
|
"solid-js": ">=1.9.7"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createMemo } from 'solid-js'
|
|
1
|
+
import { Show, createMemo } from 'solid-js'
|
|
2
2
|
import clsx from 'clsx'
|
|
3
3
|
import { useDevtoolsSettings } from '../context/use-devtools-context'
|
|
4
4
|
import { useStyles } from '../styles/use-styles'
|
|
@@ -24,13 +24,15 @@ export const Trigger = ({
|
|
|
24
24
|
)
|
|
25
25
|
})
|
|
26
26
|
return (
|
|
27
|
-
<
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
27
|
+
<Show when={!settings().triggerHidden}>
|
|
28
|
+
<button
|
|
29
|
+
type="button"
|
|
30
|
+
aria-label="Open TanStack Devtools"
|
|
31
|
+
class={buttonStyle()}
|
|
32
|
+
onClick={() => setIsOpen(!isOpen())}
|
|
33
|
+
>
|
|
34
|
+
<img src={image || TanStackLogo} alt="TanStack Devtools" />
|
|
35
|
+
</button>
|
|
36
|
+
</Show>
|
|
35
37
|
)
|
|
36
38
|
}
|
|
@@ -7,7 +7,7 @@ describe('getStateFromLocalStorage', () => {
|
|
|
7
7
|
localStorage.clear()
|
|
8
8
|
})
|
|
9
9
|
it('should return undefined when no data in localStorage', () => {
|
|
10
|
-
const state = getStateFromLocalStorage()
|
|
10
|
+
const state = getStateFromLocalStorage(undefined)
|
|
11
11
|
expect(state).toEqual(undefined)
|
|
12
12
|
})
|
|
13
13
|
it('should return parsed state from localStorage and not remove valid plugins', () => {
|
|
@@ -53,7 +53,7 @@ describe('getStateFromLocalStorage', () => {
|
|
|
53
53
|
})
|
|
54
54
|
it('should handle invalid JSON in localStorage gracefully', () => {
|
|
55
55
|
localStorage.setItem(TANSTACK_DEVTOOLS_STATE, 'invalid json')
|
|
56
|
-
const state = getStateFromLocalStorage()
|
|
56
|
+
const state = getStateFromLocalStorage(undefined)
|
|
57
57
|
expect(state).toEqual(undefined)
|
|
58
58
|
})
|
|
59
59
|
})
|
|
@@ -100,13 +100,14 @@ const generatePluginId = (plugin: TanStackDevtoolsPlugin, index: number) => {
|
|
|
100
100
|
}
|
|
101
101
|
|
|
102
102
|
export function getStateFromLocalStorage(
|
|
103
|
-
plugins
|
|
103
|
+
plugins: Array<TanStackDevtoolsPlugin> | undefined,
|
|
104
104
|
) {
|
|
105
105
|
const existingStateString = getStorageItem(TANSTACK_DEVTOOLS_STATE)
|
|
106
106
|
const existingState =
|
|
107
107
|
tryParseJson<DevtoolsStore['state']>(existingStateString)
|
|
108
108
|
const pluginIds =
|
|
109
109
|
plugins?.map((plugin, i) => generatePluginId(plugin, i)) || []
|
|
110
|
+
|
|
110
111
|
if (existingState?.activePlugins) {
|
|
111
112
|
const originalLength = existingState.activePlugins.length
|
|
112
113
|
// Filter out any active plugins that are no longer available
|
|
@@ -127,7 +128,7 @@ const getExistingStateFromStorage = (
|
|
|
127
128
|
config?: TanStackDevtoolsConfig,
|
|
128
129
|
plugins?: Array<TanStackDevtoolsPlugin>,
|
|
129
130
|
) => {
|
|
130
|
-
const existingState = getStateFromLocalStorage()
|
|
131
|
+
const existingState = getStateFromLocalStorage(plugins)
|
|
131
132
|
const settings = getSettings()
|
|
132
133
|
|
|
133
134
|
const state: DevtoolsStore = {
|
|
@@ -66,6 +66,10 @@ export type DevtoolsStore = {
|
|
|
66
66
|
* @default TanStackLogo
|
|
67
67
|
*/
|
|
68
68
|
triggerImage: string
|
|
69
|
+
/**
|
|
70
|
+
* Whether the trigger should be completely hidden or not (you can still open with the hotkey)
|
|
71
|
+
*/
|
|
72
|
+
triggerHidden?: boolean
|
|
69
73
|
}
|
|
70
74
|
state: {
|
|
71
75
|
activeTab: TabName
|
|
@@ -92,6 +96,7 @@ export const initialState: DevtoolsStore = {
|
|
|
92
96
|
? 'dark'
|
|
93
97
|
: 'light',
|
|
94
98
|
triggerImage: '',
|
|
99
|
+
triggerHidden: false,
|
|
95
100
|
},
|
|
96
101
|
state: {
|
|
97
102
|
activeTab: 'plugins',
|
package/src/styles/use-styles.ts
CHANGED
|
@@ -20,8 +20,8 @@ const stylesFactory = (theme: DevtoolsStore['settings']['theme']) => {
|
|
|
20
20
|
padding: 0;
|
|
21
21
|
margin: 0 auto;
|
|
22
22
|
background: ${t(colors.white, colors.darkGray[700])};
|
|
23
|
-
border-radius:
|
|
24
|
-
box-shadow:
|
|
23
|
+
border-radius: 8px;
|
|
24
|
+
box-shadow: none;
|
|
25
25
|
overflow-y: auto;
|
|
26
26
|
height: 100%;
|
|
27
27
|
display: flex;
|
|
@@ -33,16 +33,16 @@ const stylesFactory = (theme: DevtoolsStore['settings']['theme']) => {
|
|
|
33
33
|
seoTabTitle: css`
|
|
34
34
|
font-size: 1.25rem;
|
|
35
35
|
font-weight: 600;
|
|
36
|
-
color: ${t(colors.
|
|
36
|
+
color: ${t(colors.gray[900], colors.gray[100])};
|
|
37
37
|
margin: 0;
|
|
38
38
|
padding: 1rem 1.5rem 0.5rem 1.5rem;
|
|
39
39
|
text-align: left;
|
|
40
|
-
border-bottom: 1px solid ${t(colors.gray[
|
|
40
|
+
border-bottom: 1px solid ${t(colors.gray[200], colors.gray[800])};
|
|
41
41
|
`,
|
|
42
42
|
seoTabSection: css`
|
|
43
43
|
padding: 1.5rem;
|
|
44
|
-
background: ${t(colors.gray[
|
|
45
|
-
border: 1px solid ${t(colors.gray[
|
|
44
|
+
background: ${t(colors.gray[50], colors.darkGray[800])};
|
|
45
|
+
border: 1px solid ${t(colors.gray[200], colors.gray[800])};
|
|
46
46
|
display: flex;
|
|
47
47
|
flex-direction: column;
|
|
48
48
|
gap: 0.5rem;
|
|
@@ -61,12 +61,12 @@ const stylesFactory = (theme: DevtoolsStore['settings']['theme']) => {
|
|
|
61
61
|
padding-bottom: 0.5rem;
|
|
62
62
|
`,
|
|
63
63
|
seoPreviewCard: css`
|
|
64
|
-
border: 1px solid ${t(colors.gray[
|
|
64
|
+
border: 1px solid ${t(colors.gray[200], colors.gray[800])};
|
|
65
65
|
border-radius: 8px;
|
|
66
66
|
padding: 12px 10px;
|
|
67
67
|
background: ${t(colors.white, colors.darkGray[900])};
|
|
68
68
|
margin-bottom: 0;
|
|
69
|
-
box-shadow: 0 1px
|
|
69
|
+
box-shadow: 0 1px 3px ${t('rgba(0,0,0,0.05)', 'rgba(0,0,0,0.1)')};
|
|
70
70
|
display: flex;
|
|
71
71
|
flex-direction: column;
|
|
72
72
|
align-items: flex-start;
|
|
@@ -76,10 +76,10 @@ const stylesFactory = (theme: DevtoolsStore['settings']['theme']) => {
|
|
|
76
76
|
gap: 4px;
|
|
77
77
|
`,
|
|
78
78
|
seoPreviewHeader: css`
|
|
79
|
-
font-size:
|
|
80
|
-
font-weight:
|
|
81
|
-
margin-bottom:
|
|
82
|
-
color: ${t(colors.
|
|
79
|
+
font-size: 0.875rem;
|
|
80
|
+
font-weight: 600;
|
|
81
|
+
margin-bottom: 0;
|
|
82
|
+
color: ${t(colors.gray[700], colors.gray[300])};
|
|
83
83
|
`,
|
|
84
84
|
seoPreviewImage: css`
|
|
85
85
|
max-width: 100%;
|
|
@@ -87,28 +87,29 @@ const stylesFactory = (theme: DevtoolsStore['settings']['theme']) => {
|
|
|
87
87
|
margin-bottom: 6px;
|
|
88
88
|
box-shadow: 0 1px 2px ${t('rgba(0,0,0,0.03)', 'rgba(0,0,0,0.06)')};
|
|
89
89
|
height: 160px;
|
|
90
|
+
object-fit: cover;
|
|
90
91
|
`,
|
|
91
92
|
seoPreviewTitle: css`
|
|
92
|
-
font-size:
|
|
93
|
+
font-size: 0.9rem;
|
|
93
94
|
font-weight: 600;
|
|
94
|
-
margin-bottom:
|
|
95
|
+
margin-bottom: 4px;
|
|
95
96
|
color: ${t(colors.gray[900], colors.gray[100])};
|
|
96
97
|
`,
|
|
97
98
|
seoPreviewDesc: css`
|
|
98
|
-
color: ${t(colors.gray[
|
|
99
|
-
margin-bottom:
|
|
100
|
-
font-size: 0.
|
|
99
|
+
color: ${t(colors.gray[600], colors.gray[400])};
|
|
100
|
+
margin-bottom: 4px;
|
|
101
|
+
font-size: 0.8rem;
|
|
101
102
|
`,
|
|
102
103
|
seoPreviewUrl: css`
|
|
103
104
|
color: ${t(colors.gray[500], colors.gray[500])};
|
|
104
|
-
font-size: 0.
|
|
105
|
-
margin-bottom:
|
|
105
|
+
font-size: 0.75rem;
|
|
106
|
+
margin-bottom: 0;
|
|
106
107
|
word-break: break-all;
|
|
107
108
|
`,
|
|
108
109
|
seoMissingTagsSection: css`
|
|
109
110
|
margin-top: 4px;
|
|
110
|
-
font-size: 0.
|
|
111
|
-
color: ${t(colors.red[
|
|
111
|
+
font-size: 0.875rem;
|
|
112
|
+
color: ${t(colors.red[500], colors.red[400])};
|
|
112
113
|
`,
|
|
113
114
|
seoMissingTagsList: css`
|
|
114
115
|
margin: 4px 0 0 0;
|
|
@@ -116,22 +117,23 @@ const stylesFactory = (theme: DevtoolsStore['settings']['theme']) => {
|
|
|
116
117
|
list-style: none;
|
|
117
118
|
display: flex;
|
|
118
119
|
flex-wrap: wrap;
|
|
119
|
-
gap:
|
|
120
|
+
gap: 4px;
|
|
120
121
|
max-width: 240px;
|
|
121
122
|
`,
|
|
122
123
|
seoMissingTag: css`
|
|
123
124
|
background: ${t(colors.red[100], colors.red[500] + '22')};
|
|
124
125
|
color: ${t(colors.red[700], colors.red[500])};
|
|
125
|
-
border-radius:
|
|
126
|
-
padding:
|
|
127
|
-
font-size: 0.
|
|
126
|
+
border-radius: 3px;
|
|
127
|
+
padding: 2px 6px;
|
|
128
|
+
font-size: 0.75rem;
|
|
128
129
|
font-weight: 500;
|
|
129
130
|
`,
|
|
130
131
|
seoAllTagsFound: css`
|
|
131
132
|
color: ${t(colors.green[700], colors.green[500])};
|
|
132
133
|
font-weight: 500;
|
|
133
|
-
margin-left:
|
|
134
|
-
|
|
134
|
+
margin-left: 0;
|
|
135
|
+
padding: 0 10px 8px 10px;
|
|
136
|
+
font-size: 0.875rem;
|
|
135
137
|
`,
|
|
136
138
|
devtoolsPanelContainer: (
|
|
137
139
|
panelLocation: TanStackDevtoolsConfig['panelLocation'],
|
|
@@ -146,7 +148,7 @@ const stylesFactory = (theme: DevtoolsStore['settings']['theme']) => {
|
|
|
146
148
|
z-index: 99999;
|
|
147
149
|
width: 100%;
|
|
148
150
|
${isDetached ? '' : 'max-height: 90%;'}
|
|
149
|
-
border-top: 1px solid ${t(colors.gray[
|
|
151
|
+
border-top: 1px solid ${t(colors.gray[200], colors.gray[800])};
|
|
150
152
|
transform-origin: top;
|
|
151
153
|
`,
|
|
152
154
|
devtoolsPanelContainerVisibility: (isOpen: boolean) => {
|
|
@@ -204,7 +206,7 @@ const stylesFactory = (theme: DevtoolsStore['settings']['theme']) => {
|
|
|
204
206
|
user-select: none;
|
|
205
207
|
z-index: 100000;
|
|
206
208
|
&:hover {
|
|
207
|
-
background-color: ${t(colors.
|
|
209
|
+
background-color: ${t(colors.gray[400], colors.gray[500])};
|
|
208
210
|
}
|
|
209
211
|
`,
|
|
210
212
|
|
|
@@ -294,9 +296,9 @@ const stylesFactory = (theme: DevtoolsStore['settings']['theme']) => {
|
|
|
294
296
|
align-items: center;
|
|
295
297
|
justify-content: flex-start;
|
|
296
298
|
height: 100%;
|
|
297
|
-
background-color: ${t(colors.gray[
|
|
298
|
-
border-right: 1px solid ${t(colors.gray[
|
|
299
|
-
box-shadow:
|
|
299
|
+
background-color: ${t(colors.gray[50], colors.darkGray[900])};
|
|
300
|
+
border-right: 1px solid ${t(colors.gray[200], colors.gray[800])};
|
|
301
|
+
box-shadow: none;
|
|
300
302
|
position: relative;
|
|
301
303
|
width: ${size[10]};
|
|
302
304
|
`,
|
|
@@ -310,24 +312,24 @@ const stylesFactory = (theme: DevtoolsStore['settings']['theme']) => {
|
|
|
310
312
|
cursor: pointer;
|
|
311
313
|
font-size: ${fontSize.sm};
|
|
312
314
|
font-family: ${fontFamily.sans};
|
|
313
|
-
color: ${t(colors.gray[
|
|
315
|
+
color: ${t(colors.gray[600], colors.gray[400])};
|
|
314
316
|
background-color: transparent;
|
|
315
317
|
border: none;
|
|
316
|
-
transition: all 0.
|
|
318
|
+
transition: all 0.15s ease;
|
|
317
319
|
border-left: 2px solid transparent;
|
|
318
320
|
&:hover:not(.close):not(.active):not(.detach) {
|
|
319
|
-
background-color: ${t(colors.gray[
|
|
321
|
+
background-color: ${t(colors.gray[100], colors.gray[800])};
|
|
320
322
|
color: ${t(colors.gray[900], colors.gray[100])};
|
|
321
|
-
border-left: 2px solid ${t(colors.
|
|
323
|
+
border-left: 2px solid ${t(colors.gray[900], colors.gray[100])};
|
|
322
324
|
}
|
|
323
325
|
&.active {
|
|
324
|
-
background-color: ${t(colors.
|
|
326
|
+
background-color: ${t(colors.gray[100], colors.gray[800])};
|
|
325
327
|
color: ${t(colors.gray[900], colors.gray[100])};
|
|
326
|
-
border-left: 2px solid ${t(colors.
|
|
328
|
+
border-left: 2px solid ${t(colors.gray[900], colors.gray[100])};
|
|
327
329
|
}
|
|
328
330
|
&.detach {
|
|
329
331
|
&:hover {
|
|
330
|
-
background-color: ${t(colors.gray[
|
|
332
|
+
background-color: ${t(colors.gray[100], colors.gray[800])};
|
|
331
333
|
}
|
|
332
334
|
&:hover {
|
|
333
335
|
color: ${t(colors.green[700], colors.green[500])};
|
|
@@ -336,7 +338,7 @@ const stylesFactory = (theme: DevtoolsStore['settings']['theme']) => {
|
|
|
336
338
|
&.close {
|
|
337
339
|
margin-top: auto;
|
|
338
340
|
&:hover {
|
|
339
|
-
background-color: ${t(colors.gray[
|
|
341
|
+
background-color: ${t(colors.gray[100], colors.gray[800])};
|
|
340
342
|
}
|
|
341
343
|
&:hover {
|
|
342
344
|
color: ${t(colors.red[700], colors.red[500])};
|
|
@@ -368,15 +370,15 @@ const stylesFactory = (theme: DevtoolsStore['settings']['theme']) => {
|
|
|
368
370
|
pluginsTabDraw: (isExpanded: boolean) => css`
|
|
369
371
|
width: ${isExpanded ? size[48] : 0};
|
|
370
372
|
height: 100%;
|
|
371
|
-
background-color: ${t(colors.white, colors.darkGray[
|
|
372
|
-
box-shadow:
|
|
373
|
+
background-color: ${t(colors.white, colors.darkGray[900])};
|
|
374
|
+
box-shadow: none;
|
|
373
375
|
${isExpanded
|
|
374
|
-
? `border-right: 1px solid ${t(colors.gray[
|
|
376
|
+
? `border-right: 1px solid ${t(colors.gray[200], colors.gray[800])};`
|
|
375
377
|
: ''}
|
|
376
378
|
`,
|
|
377
379
|
pluginsTabDrawExpanded: css`
|
|
378
380
|
width: ${size[48]};
|
|
379
|
-
border-right: 1px solid ${t(colors.gray[
|
|
381
|
+
border-right: 1px solid ${t(colors.gray[200], colors.gray[800])};
|
|
380
382
|
`,
|
|
381
383
|
pluginsTabDrawTransition: (mSeconds: number) => {
|
|
382
384
|
return css`
|
|
@@ -399,39 +401,49 @@ const stylesFactory = (theme: DevtoolsStore['settings']['theme']) => {
|
|
|
399
401
|
pluginName: css`
|
|
400
402
|
font-size: ${fontSize.xs};
|
|
401
403
|
font-family: ${fontFamily.sans};
|
|
402
|
-
color: ${t(colors.gray[
|
|
404
|
+
color: ${t(colors.gray[600], colors.gray[400])};
|
|
403
405
|
padding: ${size[2]};
|
|
404
406
|
cursor: pointer;
|
|
405
407
|
text-align: center;
|
|
406
|
-
transition: all 0.
|
|
408
|
+
transition: all 0.15s ease;
|
|
409
|
+
border-left: 2px solid transparent;
|
|
410
|
+
|
|
407
411
|
&:hover {
|
|
408
|
-
background-color: ${t(colors.gray[
|
|
412
|
+
background-color: ${t(colors.gray[100], colors.gray[800])};
|
|
409
413
|
color: ${t(colors.gray[900], colors.gray[100])};
|
|
410
414
|
padding: ${size[2]};
|
|
411
415
|
}
|
|
412
416
|
&.active {
|
|
413
|
-
background-color: ${t(colors.
|
|
417
|
+
background-color: ${t(colors.gray[100], colors.gray[800])};
|
|
414
418
|
color: ${t(colors.gray[900], colors.gray[100])};
|
|
419
|
+
border-left: 2px solid ${t(colors.gray[900], colors.gray[100])};
|
|
420
|
+
}
|
|
421
|
+
&.active:hover {
|
|
422
|
+
background-color: ${t(colors.gray[200], colors.gray[700])};
|
|
415
423
|
}
|
|
416
424
|
`,
|
|
417
425
|
pluginsTabContent: css`
|
|
418
426
|
width: 100%;
|
|
419
427
|
height: 100%;
|
|
420
428
|
overflow-y: auto;
|
|
429
|
+
|
|
430
|
+
&:not(:last-child) {
|
|
431
|
+
border-right: 5px solid ${t(colors.purple[200], colors.purple[800])};
|
|
432
|
+
}
|
|
421
433
|
`,
|
|
422
434
|
|
|
423
435
|
settingsGroup: css`
|
|
424
436
|
display: flex;
|
|
425
437
|
flex-direction: column;
|
|
426
|
-
gap:
|
|
438
|
+
gap: 0.75rem;
|
|
427
439
|
`,
|
|
428
440
|
conditionalSetting: css`
|
|
429
441
|
margin-left: 1.5rem;
|
|
430
442
|
padding-left: 1rem;
|
|
431
|
-
border-left: 2px solid ${t(colors.
|
|
432
|
-
background-color: ${t(colors.gray[
|
|
433
|
-
padding:
|
|
434
|
-
border-radius: 0.
|
|
443
|
+
border-left: 2px solid ${t(colors.gray[300], colors.gray[600])};
|
|
444
|
+
background-color: ${t(colors.gray[50], colors.darkGray[900])};
|
|
445
|
+
padding: 0.75rem;
|
|
446
|
+
border-radius: 0.375rem;
|
|
435
447
|
margin-top: 0.5rem;
|
|
436
448
|
`,
|
|
437
449
|
settingRow: css`
|
|
@@ -71,6 +71,14 @@ export const SettingsTab = () => {
|
|
|
71
71
|
}
|
|
72
72
|
checked={settings().hideUntilHover}
|
|
73
73
|
/>
|
|
74
|
+
<Checkbox
|
|
75
|
+
label="Completely hide trigger"
|
|
76
|
+
description="Completely removes the trigger from the DOM (you can still open it with the hotkey)"
|
|
77
|
+
onChange={() =>
|
|
78
|
+
setSettings({ triggerHidden: !settings().triggerHidden })
|
|
79
|
+
}
|
|
80
|
+
checked={settings().triggerHidden}
|
|
81
|
+
/>
|
|
74
82
|
<Input
|
|
75
83
|
label="Trigger Image"
|
|
76
84
|
description="Specify the URL of the image to use for the trigger"
|