@tanstack/devtools 0.8.2 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunk/{G64KXXVZ.js → YGJWPK3G.js} +57 -55
- package/dist/dev.js +3 -3
- package/dist/devtools/{I7ZVYS6Q.js → CMWGZDSU.js} +153 -105
- package/dist/devtools/{GGWR254Q.js → LWN3DL7E.js} +185 -129
- package/dist/index.d.ts +8 -2
- package/dist/index.js +3 -3
- package/dist/server.js +2 -2
- package/package.json +2 -2
- package/src/components/source-inspector.tsx +6 -5
- package/src/context/devtools-store.ts +10 -2
- package/src/devtools.tsx +5 -14
- package/src/styles/use-styles.ts +5 -0
- package/src/tabs/hotkey-config.tsx +97 -0
- package/src/tabs/settings-tab.tsx +23 -86
- package/src/utils/hotkey.test.ts +109 -0
- package/src/utils/hotkey.ts +66 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { usePiPWindow, keyboardModifiers, getAllPermutations,
|
|
1
|
+
import { usePiPWindow, TANSTACK_DEVTOOLS, keyboardModifiers, getAllPermutations, DevtoolsContext, PLUGIN_TITLE_CONTAINER_ID, PLUGIN_CONTAINER_ID, MAX_ACTIVE_PLUGINS, uppercaseFirstLetter } from '../chunk/YGJWPK3G.js';
|
|
2
2
|
import { delegateEvents, createComponent, Portal, template, use, setAttribute, insert, memo, effect, className, addEventListener, style, classList } from 'solid-js/web';
|
|
3
3
|
import { createContext, createSignal, createEffect, onCleanup, Show, createMemo, For, useContext, onMount } from 'solid-js';
|
|
4
4
|
import { createShortcut, useKeyDownList } from '@solid-primitives/keyboard';
|
|
@@ -174,6 +174,46 @@ var useDisableTabbing = (isOpen) => {
|
|
|
174
174
|
});
|
|
175
175
|
};
|
|
176
176
|
|
|
177
|
+
// src/utils/hotkey.ts
|
|
178
|
+
var normalizeHotkey = (keys) => {
|
|
179
|
+
if (!keys.includes("CtrlOrMeta")) {
|
|
180
|
+
return [keys];
|
|
181
|
+
}
|
|
182
|
+
return [
|
|
183
|
+
keys.map((key) => key === "CtrlOrMeta" ? "Control" : key),
|
|
184
|
+
keys.map((key) => key === "CtrlOrMeta" ? "Meta" : key)
|
|
185
|
+
];
|
|
186
|
+
};
|
|
187
|
+
var getHotkeyPermutations = (hotkey) => {
|
|
188
|
+
const normalizedHotkeys = normalizeHotkey(hotkey);
|
|
189
|
+
return normalizedHotkeys.flatMap((normalizedHotkey) => {
|
|
190
|
+
const modifiers = normalizedHotkey.filter(
|
|
191
|
+
(key) => keyboardModifiers.includes(key)
|
|
192
|
+
);
|
|
193
|
+
const nonModifiers = normalizedHotkey.filter(
|
|
194
|
+
(key) => !keyboardModifiers.includes(key)
|
|
195
|
+
);
|
|
196
|
+
if (modifiers.length === 0) {
|
|
197
|
+
return [nonModifiers];
|
|
198
|
+
}
|
|
199
|
+
const allModifierCombinations = getAllPermutations(modifiers);
|
|
200
|
+
return allModifierCombinations.map((combo) => [...combo, ...nonModifiers]);
|
|
201
|
+
});
|
|
202
|
+
};
|
|
203
|
+
var isHotkeyCombinationPressed = (keys, hotkey) => {
|
|
204
|
+
const permutations = getHotkeyPermutations(hotkey);
|
|
205
|
+
const pressedKeys = keys.map((key) => key.toUpperCase());
|
|
206
|
+
return permutations.some(
|
|
207
|
+
(combo) => (
|
|
208
|
+
// every key in the combo must be pressed
|
|
209
|
+
combo.every((key) => pressedKeys.includes(String(key).toUpperCase())) && // and no extra keys beyond the combo
|
|
210
|
+
pressedKeys.every(
|
|
211
|
+
(key) => combo.map((k) => String(k).toUpperCase()).includes(key)
|
|
212
|
+
)
|
|
213
|
+
)
|
|
214
|
+
);
|
|
215
|
+
};
|
|
216
|
+
|
|
177
217
|
// src/styles/tokens.ts
|
|
178
218
|
var tokens = {
|
|
179
219
|
colors: {
|
|
@@ -904,6 +944,11 @@ var stylesFactory = (theme) => {
|
|
|
904
944
|
display: flex;
|
|
905
945
|
gap: 0.5rem;
|
|
906
946
|
`,
|
|
947
|
+
settingsStack: css2`
|
|
948
|
+
display: flex;
|
|
949
|
+
flex-direction: column;
|
|
950
|
+
gap: 1rem;
|
|
951
|
+
`,
|
|
907
952
|
// No Plugins Fallback Styles
|
|
908
953
|
noPluginsFallback: css2`
|
|
909
954
|
display: flex;
|
|
@@ -1911,29 +1956,99 @@ var ContentPanel = (props) => {
|
|
|
1911
1956
|
})();
|
|
1912
1957
|
};
|
|
1913
1958
|
delegateEvents(["mousedown"]);
|
|
1914
|
-
var _tmpl$6 = /* @__PURE__ */ template(`<div
|
|
1915
|
-
var
|
|
1916
|
-
|
|
1959
|
+
var _tmpl$6 = /* @__PURE__ */ template(`<div><h4></h4><div></div>Final shortcut is: `);
|
|
1960
|
+
var MODIFIER_DISPLAY_NAMES = {
|
|
1961
|
+
Shift: "Shift",
|
|
1962
|
+
Alt: "Alt",
|
|
1963
|
+
Meta: "Meta",
|
|
1964
|
+
Control: "Control",
|
|
1965
|
+
CtrlOrMeta: "Ctrl Or Meta"
|
|
1966
|
+
};
|
|
1967
|
+
var HotkeyConfig = (props) => {
|
|
1968
|
+
const styles = useStyles();
|
|
1969
|
+
const toggleModifier = (modifier) => {
|
|
1970
|
+
if (props.hotkey.includes(modifier)) {
|
|
1971
|
+
props.onHotkeyChange(props.hotkey.filter((key) => key !== modifier));
|
|
1972
|
+
} else {
|
|
1973
|
+
const existingModifiers = props.hotkey.filter((key) => props.modifiers.includes(key));
|
|
1974
|
+
const otherKeys = props.hotkey.filter((key) => !props.modifiers.includes(key));
|
|
1975
|
+
props.onHotkeyChange([...existingModifiers, modifier, ...otherKeys]);
|
|
1976
|
+
}
|
|
1977
|
+
};
|
|
1978
|
+
const getNonModifierValue = () => {
|
|
1979
|
+
return props.hotkey.filter((key) => !props.modifiers.includes(key)).join("+");
|
|
1980
|
+
};
|
|
1981
|
+
const handleKeyInput = (input) => {
|
|
1982
|
+
const makeModifierArray = (key) => {
|
|
1983
|
+
if (key.length === 1) return [uppercaseFirstLetter(key)];
|
|
1984
|
+
const modifiersArray = [];
|
|
1985
|
+
for (const character of key) {
|
|
1986
|
+
const newLetter = uppercaseFirstLetter(character);
|
|
1987
|
+
if (!modifiersArray.includes(newLetter)) modifiersArray.push(newLetter);
|
|
1988
|
+
}
|
|
1989
|
+
return modifiersArray;
|
|
1990
|
+
};
|
|
1991
|
+
const hotkeyModifiers = props.hotkey.filter((key) => props.modifiers.includes(key));
|
|
1992
|
+
const newKeys = input.split("+").flatMap((key) => makeModifierArray(key)).filter(Boolean);
|
|
1993
|
+
props.onHotkeyChange([...hotkeyModifiers, ...newKeys]);
|
|
1994
|
+
};
|
|
1995
|
+
const getDisplayHotkey = () => {
|
|
1996
|
+
return props.hotkey.join(" + ");
|
|
1997
|
+
};
|
|
1998
|
+
return (() => {
|
|
1999
|
+
var _el$ = _tmpl$6(), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling, _el$4 = _el$3.nextSibling;
|
|
2000
|
+
_el$2.style.setProperty("margin", "0");
|
|
2001
|
+
insert(_el$2, () => props.description);
|
|
2002
|
+
insert(_el$3, createComponent(Show, {
|
|
2003
|
+
keyed: true,
|
|
2004
|
+
get when() {
|
|
2005
|
+
return props.hotkey;
|
|
2006
|
+
},
|
|
2007
|
+
get children() {
|
|
2008
|
+
return props.modifiers.map((modifier) => createComponent(Button, {
|
|
2009
|
+
variant: "success",
|
|
2010
|
+
onclick: () => toggleModifier(modifier),
|
|
2011
|
+
get outline() {
|
|
2012
|
+
return !props.hotkey.includes(modifier);
|
|
2013
|
+
},
|
|
2014
|
+
get children() {
|
|
2015
|
+
return MODIFIER_DISPLAY_NAMES[modifier] || modifier;
|
|
2016
|
+
}
|
|
2017
|
+
}));
|
|
2018
|
+
}
|
|
2019
|
+
}));
|
|
2020
|
+
insert(_el$, createComponent(Input, {
|
|
2021
|
+
description: "Use '+' to combine keys (e.g., 'a+b' or 'd'). This will be used with the enabled modifiers from above",
|
|
2022
|
+
placeholder: "a",
|
|
2023
|
+
get value() {
|
|
2024
|
+
return getNonModifierValue();
|
|
2025
|
+
},
|
|
2026
|
+
onChange: handleKeyInput
|
|
2027
|
+
}), _el$4);
|
|
2028
|
+
insert(_el$, getDisplayHotkey, null);
|
|
2029
|
+
effect((_p$) => {
|
|
2030
|
+
var _v$ = styles().settingsGroup, _v$2 = styles().settingsModifiers;
|
|
2031
|
+
_v$ !== _p$.e && className(_el$, _p$.e = _v$);
|
|
2032
|
+
_v$2 !== _p$.t && className(_el$3, _p$.t = _v$2);
|
|
2033
|
+
return _p$;
|
|
2034
|
+
}, {
|
|
2035
|
+
e: void 0,
|
|
2036
|
+
t: void 0
|
|
2037
|
+
});
|
|
2038
|
+
return _el$;
|
|
2039
|
+
})();
|
|
2040
|
+
};
|
|
2041
|
+
|
|
2042
|
+
// src/tabs/settings-tab.tsx
|
|
2043
|
+
var _tmpl$7 = /* @__PURE__ */ template(`<div>`);
|
|
2044
|
+
var _tmpl$22 = /* @__PURE__ */ template(`<div><div>`);
|
|
1917
2045
|
var SettingsTab = () => {
|
|
1918
2046
|
const {
|
|
1919
2047
|
setSettings,
|
|
1920
2048
|
settings
|
|
1921
2049
|
} = useDevtoolsSettings();
|
|
1922
2050
|
const styles = useStyles();
|
|
1923
|
-
const
|
|
1924
|
-
const modifiers = ["Control", "Alt", "Meta", "Shift"];
|
|
1925
|
-
const changeHotkey = (newHotkey) => () => {
|
|
1926
|
-
if (hotkey().includes(newHotkey)) {
|
|
1927
|
-
return setSettings({
|
|
1928
|
-
openHotkey: hotkey().filter((key) => key !== newHotkey)
|
|
1929
|
-
});
|
|
1930
|
-
}
|
|
1931
|
-
const existingModifiers = hotkey().filter((key) => modifiers.includes(key));
|
|
1932
|
-
const otherModifiers = hotkey().filter((key) => !modifiers.includes(key));
|
|
1933
|
-
setSettings({
|
|
1934
|
-
openHotkey: [...existingModifiers, newHotkey, ...otherModifiers]
|
|
1935
|
-
});
|
|
1936
|
-
};
|
|
2051
|
+
const modifiers = ["CtrlOrMeta", "Alt", "Shift"];
|
|
1937
2052
|
return createComponent(MainPanel$1, {
|
|
1938
2053
|
withPadding: true,
|
|
1939
2054
|
get children() {
|
|
@@ -1950,7 +2065,7 @@ var SettingsTab = () => {
|
|
|
1950
2065
|
}), createComponent(SectionDescription, {
|
|
1951
2066
|
children: "Configure general behavior of the devtools panel."
|
|
1952
2067
|
}), (() => {
|
|
1953
|
-
var _el$ = _tmpl$
|
|
2068
|
+
var _el$ = _tmpl$7();
|
|
1954
2069
|
insert(_el$, createComponent(Checkbox, {
|
|
1955
2070
|
label: "Default open",
|
|
1956
2071
|
description: "Automatically open the devtools panel when the page loads",
|
|
@@ -2015,7 +2130,7 @@ var SettingsTab = () => {
|
|
|
2015
2130
|
}), createComponent(SectionDescription, {
|
|
2016
2131
|
children: "Control when devtools are available based on URL parameters."
|
|
2017
2132
|
}), (() => {
|
|
2018
|
-
var _el$2 = _tmpl$
|
|
2133
|
+
var _el$2 = _tmpl$7();
|
|
2019
2134
|
insert(_el$2, createComponent(Checkbox, {
|
|
2020
2135
|
label: "Require URL Flag",
|
|
2021
2136
|
description: "Only show devtools when a specific URL parameter is present",
|
|
@@ -2031,7 +2146,7 @@ var SettingsTab = () => {
|
|
|
2031
2146
|
return settings().requireUrlFlag;
|
|
2032
2147
|
},
|
|
2033
2148
|
get children() {
|
|
2034
|
-
var _el$3 = _tmpl$
|
|
2149
|
+
var _el$3 = _tmpl$7();
|
|
2035
2150
|
insert(_el$3, createComponent(Input, {
|
|
2036
2151
|
label: "URL flag",
|
|
2037
2152
|
description: "Enter the URL parameter name (e.g., 'debug' for ?debug=true)",
|
|
@@ -2064,85 +2179,30 @@ var SettingsTab = () => {
|
|
|
2064
2179
|
}), createComponent(SectionDescription, {
|
|
2065
2180
|
children: "Customize keyboard shortcuts for quick access."
|
|
2066
2181
|
}), (() => {
|
|
2067
|
-
var _el$4 = _tmpl$
|
|
2068
|
-
insert(_el$
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2182
|
+
var _el$4 = _tmpl$7();
|
|
2183
|
+
insert(_el$4, createComponent(HotkeyConfig, {
|
|
2184
|
+
title: "Open/Close Devtools",
|
|
2185
|
+
description: "Hotkey to open/close devtools",
|
|
2186
|
+
get hotkey() {
|
|
2187
|
+
return settings().openHotkey;
|
|
2072
2188
|
},
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
}), createComponent(Button, {
|
|
2084
|
-
variant: "success",
|
|
2085
|
-
get onclick() {
|
|
2086
|
-
return changeHotkey("Alt");
|
|
2087
|
-
},
|
|
2088
|
-
get outline() {
|
|
2089
|
-
return !hotkey().includes("Alt");
|
|
2090
|
-
},
|
|
2091
|
-
children: "Alt"
|
|
2092
|
-
}), createComponent(Button, {
|
|
2093
|
-
variant: "success",
|
|
2094
|
-
get onclick() {
|
|
2095
|
-
return changeHotkey("Meta");
|
|
2096
|
-
},
|
|
2097
|
-
get outline() {
|
|
2098
|
-
return !hotkey().includes("Meta");
|
|
2099
|
-
},
|
|
2100
|
-
children: "Meta"
|
|
2101
|
-
}), createComponent(Button, {
|
|
2102
|
-
variant: "success",
|
|
2103
|
-
get onclick() {
|
|
2104
|
-
return changeHotkey("Control");
|
|
2105
|
-
},
|
|
2106
|
-
get outline() {
|
|
2107
|
-
return !hotkey().includes("Control");
|
|
2108
|
-
},
|
|
2109
|
-
children: "Control"
|
|
2110
|
-
})];
|
|
2111
|
-
}
|
|
2112
|
-
}));
|
|
2113
|
-
insert(_el$4, createComponent(Input, {
|
|
2114
|
-
label: "Hotkey to open/close devtools",
|
|
2115
|
-
description: "Use '+' to combine keys (e.g., 'a+b' or 'd'). This will be used with the enabled modifiers from above",
|
|
2116
|
-
placeholder: "a",
|
|
2117
|
-
get value() {
|
|
2118
|
-
return hotkey().filter((key) => !["Shift", "Meta", "Alt", "Ctrl"].includes(key)).join("+");
|
|
2189
|
+
modifiers,
|
|
2190
|
+
onHotkeyChange: (hotkey) => setSettings({
|
|
2191
|
+
openHotkey: hotkey
|
|
2192
|
+
})
|
|
2193
|
+
}), null);
|
|
2194
|
+
insert(_el$4, createComponent(HotkeyConfig, {
|
|
2195
|
+
title: "Source Inspector",
|
|
2196
|
+
description: "Hotkey to open source inspector",
|
|
2197
|
+
get hotkey() {
|
|
2198
|
+
return settings().inspectHotkey;
|
|
2119
2199
|
},
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
if (!modifiers3.includes(newLetter)) modifiers3.push(newLetter);
|
|
2127
|
-
}
|
|
2128
|
-
return modifiers3;
|
|
2129
|
-
};
|
|
2130
|
-
const modifiers2 = e.split("+").flatMap((key) => makeModifierArray(key)).filter(Boolean);
|
|
2131
|
-
return setSettings({
|
|
2132
|
-
openHotkey: [...hotkey().filter((key) => ["Shift", "Meta", "Alt", "Ctrl"].includes(key)), ...modifiers2]
|
|
2133
|
-
});
|
|
2134
|
-
}
|
|
2135
|
-
}), _el$6);
|
|
2136
|
-
insert(_el$4, () => hotkey().join(" + "), null);
|
|
2137
|
-
effect((_p$) => {
|
|
2138
|
-
var _v$ = styles().settingsGroup, _v$2 = styles().settingsModifiers;
|
|
2139
|
-
_v$ !== _p$.e && className(_el$4, _p$.e = _v$);
|
|
2140
|
-
_v$2 !== _p$.t && className(_el$5, _p$.t = _v$2);
|
|
2141
|
-
return _p$;
|
|
2142
|
-
}, {
|
|
2143
|
-
e: void 0,
|
|
2144
|
-
t: void 0
|
|
2145
|
-
});
|
|
2200
|
+
modifiers,
|
|
2201
|
+
onHotkeyChange: (hotkey) => setSettings({
|
|
2202
|
+
inspectHotkey: hotkey
|
|
2203
|
+
})
|
|
2204
|
+
}), null);
|
|
2205
|
+
effect(() => className(_el$4, styles().settingsStack));
|
|
2146
2206
|
return _el$4;
|
|
2147
2207
|
})()];
|
|
2148
2208
|
}
|
|
@@ -2159,8 +2219,8 @@ var SettingsTab = () => {
|
|
|
2159
2219
|
}), createComponent(SectionDescription, {
|
|
2160
2220
|
children: "Adjust the position of the trigger button and devtools panel."
|
|
2161
2221
|
}), (() => {
|
|
2162
|
-
var _el$
|
|
2163
|
-
insert(_el$
|
|
2222
|
+
var _el$5 = _tmpl$22(), _el$6 = _el$5.firstChild;
|
|
2223
|
+
insert(_el$6, createComponent(Select, {
|
|
2164
2224
|
label: "Trigger Position",
|
|
2165
2225
|
options: [{
|
|
2166
2226
|
label: "Bottom Right",
|
|
@@ -2188,7 +2248,7 @@ var SettingsTab = () => {
|
|
|
2188
2248
|
position: value
|
|
2189
2249
|
})
|
|
2190
2250
|
}), null);
|
|
2191
|
-
insert(_el$
|
|
2251
|
+
insert(_el$6, createComponent(Select, {
|
|
2192
2252
|
label: "Panel Position",
|
|
2193
2253
|
get value() {
|
|
2194
2254
|
return settings().panelLocation;
|
|
@@ -2205,15 +2265,15 @@ var SettingsTab = () => {
|
|
|
2205
2265
|
})
|
|
2206
2266
|
}), null);
|
|
2207
2267
|
effect((_p$) => {
|
|
2208
|
-
var _v$
|
|
2209
|
-
_v$
|
|
2210
|
-
_v$
|
|
2268
|
+
var _v$ = styles().settingsGroup, _v$2 = styles().settingRow;
|
|
2269
|
+
_v$ !== _p$.e && className(_el$5, _p$.e = _v$);
|
|
2270
|
+
_v$2 !== _p$.t && className(_el$6, _p$.t = _v$2);
|
|
2211
2271
|
return _p$;
|
|
2212
2272
|
}, {
|
|
2213
2273
|
e: void 0,
|
|
2214
2274
|
t: void 0
|
|
2215
2275
|
});
|
|
2216
|
-
return _el$
|
|
2276
|
+
return _el$5;
|
|
2217
2277
|
})()];
|
|
2218
2278
|
}
|
|
2219
2279
|
})];
|
|
@@ -2297,14 +2357,14 @@ var getBadgeText = (card) => {
|
|
|
2297
2357
|
};
|
|
2298
2358
|
|
|
2299
2359
|
// src/tabs/marketplace/plugin-card.tsx
|
|
2300
|
-
var _tmpl$
|
|
2360
|
+
var _tmpl$8 = /* @__PURE__ */ template(`<div>New`);
|
|
2301
2361
|
var _tmpl$23 = /* @__PURE__ */ template(`<img>`);
|
|
2302
|
-
var _tmpl$
|
|
2362
|
+
var _tmpl$32 = /* @__PURE__ */ template(`<span>\u2713 v<!> \u2022 Min v`);
|
|
2303
2363
|
var _tmpl$42 = /* @__PURE__ */ template(`<p>`);
|
|
2304
2364
|
var _tmpl$52 = /* @__PURE__ */ template(`<a target=_blank rel="noopener noreferrer">Documentation `);
|
|
2305
2365
|
var _tmpl$62 = /* @__PURE__ */ template(`<div>`);
|
|
2306
2366
|
var _tmpl$72 = /* @__PURE__ */ template(`<div><span></span><div></div><div><h3></h3><p></p><p>`);
|
|
2307
|
-
var _tmpl$
|
|
2367
|
+
var _tmpl$82 = /* @__PURE__ */ template(`<span>\u26A0\uFE0F v<!> \u2022 Requires v<!>+`);
|
|
2308
2368
|
var _tmpl$9 = /* @__PURE__ */ template(`<span>`);
|
|
2309
2369
|
var _tmpl$0 = /* @__PURE__ */ template(`<span>Installing...`);
|
|
2310
2370
|
var _tmpl$1 = /* @__PURE__ */ template(`<span>Installed!`);
|
|
@@ -2321,7 +2381,7 @@ var PluginCardComponent = (props) => {
|
|
|
2321
2381
|
return card.metadata?.isNew;
|
|
2322
2382
|
},
|
|
2323
2383
|
get children() {
|
|
2324
|
-
var _el$2 = _tmpl$
|
|
2384
|
+
var _el$2 = _tmpl$8();
|
|
2325
2385
|
effect(() => className(_el$2, styles().pluginMarketplaceNewBanner));
|
|
2326
2386
|
return _el$2;
|
|
2327
2387
|
}
|
|
@@ -2365,7 +2425,7 @@ var PluginCardComponent = (props) => {
|
|
|
2365
2425
|
},
|
|
2366
2426
|
get fallback() {
|
|
2367
2427
|
return (() => {
|
|
2368
|
-
var _el$16 = _tmpl$
|
|
2428
|
+
var _el$16 = _tmpl$82(), _el$17 = _el$16.firstChild, _el$20 = _el$17.nextSibling, _el$18 = _el$20.nextSibling, _el$21 = _el$18.nextSibling; _el$21.nextSibling;
|
|
2369
2429
|
insert(_el$16, () => card.versionInfo?.current, _el$20);
|
|
2370
2430
|
insert(_el$16, () => card.versionInfo?.required, _el$21);
|
|
2371
2431
|
effect(() => className(_el$16, styles().pluginMarketplaceCardVersionUnsatisfied));
|
|
@@ -2373,7 +2433,7 @@ var PluginCardComponent = (props) => {
|
|
|
2373
2433
|
})();
|
|
2374
2434
|
},
|
|
2375
2435
|
get children() {
|
|
2376
|
-
var _el$1 = _tmpl$
|
|
2436
|
+
var _el$1 = _tmpl$32(), _el$10 = _el$1.firstChild, _el$12 = _el$10.nextSibling; _el$12.nextSibling;
|
|
2377
2437
|
insert(_el$1, () => card.versionInfo?.current, _el$12);
|
|
2378
2438
|
insert(_el$1, () => card.versionInfo?.required, null);
|
|
2379
2439
|
effect(() => className(_el$1, styles().pluginMarketplaceCardVersionSatisfied));
|
|
@@ -2528,7 +2588,7 @@ var PluginCardComponent = (props) => {
|
|
|
2528
2588
|
// src/tabs/marketplace/plugin-section.tsx
|
|
2529
2589
|
var _tmpl$10 = /* @__PURE__ */ template(`<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=currentColor><path d="M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z">`);
|
|
2530
2590
|
var _tmpl$24 = /* @__PURE__ */ template(`<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round><rect x=2 y=4 width=20 height=16 rx=2></rect><path d="m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7">`);
|
|
2531
|
-
var _tmpl$
|
|
2591
|
+
var _tmpl$33 = /* @__PURE__ */ template(`<div><div><h4><span></span>Want to be featured here?</h4><p>If you've built a plugin for TanStack Devtools and would like to showcase it in the featured section, we'd love to hear from you! Reach out to us to discuss partnership opportunities.</p><a href="mailto:partners+devtools@tanstack.com?subject=Featured%20Plugin%20Partnership%20Inquiry"><span></span>Contact Us`);
|
|
2532
2592
|
var _tmpl$43 = /* @__PURE__ */ template(`<div>`);
|
|
2533
2593
|
var _tmpl$53 = /* @__PURE__ */ template(`<div><div><div><div></div><h3>`);
|
|
2534
2594
|
var StarIcon = () => _tmpl$10();
|
|
@@ -2550,7 +2610,7 @@ var PluginSectionComponent = (props) => {
|
|
|
2550
2610
|
return props.section.id === "featured";
|
|
2551
2611
|
},
|
|
2552
2612
|
get children() {
|
|
2553
|
-
var _el$8 = _tmpl$
|
|
2613
|
+
var _el$8 = _tmpl$33(), _el$9 = _el$8.firstChild, _el$0 = _el$9.firstChild, _el$1 = _el$0.firstChild, _el$10 = _el$0.nextSibling, _el$11 = _el$10.nextSibling, _el$12 = _el$11.firstChild;
|
|
2554
2614
|
insert(_el$1, createComponent(StarIcon, {}));
|
|
2555
2615
|
insert(_el$12, createComponent(MailIcon, {}));
|
|
2556
2616
|
effect((_p$) => {
|
|
@@ -3381,7 +3441,7 @@ var PluginMarketplace = () => {
|
|
|
3381
3441
|
// src/tabs/plugins-tab.tsx
|
|
3382
3442
|
var _tmpl$15 = /* @__PURE__ */ template(`<div><div><div><div></div><div><h3>Add More`);
|
|
3383
3443
|
var _tmpl$27 = /* @__PURE__ */ template(`<div><h3>`);
|
|
3384
|
-
var _tmpl$
|
|
3444
|
+
var _tmpl$34 = /* @__PURE__ */ template(`<div>`);
|
|
3385
3445
|
var PluginsTab = () => {
|
|
3386
3446
|
const {
|
|
3387
3447
|
plugins,
|
|
@@ -3478,7 +3538,7 @@ var PluginsTab = () => {
|
|
|
3478
3538
|
return activePlugins();
|
|
3479
3539
|
},
|
|
3480
3540
|
children: (pluginId) => (() => {
|
|
3481
|
-
var _el$8 = _tmpl$
|
|
3541
|
+
var _el$8 = _tmpl$34();
|
|
3482
3542
|
use((el) => {
|
|
3483
3543
|
setPluginRefs((prev) => {
|
|
3484
3544
|
const updated = new Map(prev);
|
|
@@ -3584,7 +3644,7 @@ function useHeadChanges(onChange, opts = {}) {
|
|
|
3584
3644
|
// src/tabs/seo-tab.tsx
|
|
3585
3645
|
var _tmpl$16 = /* @__PURE__ */ template(`<div><div> Preview</div><div></div><div></div><div>`);
|
|
3586
3646
|
var _tmpl$28 = /* @__PURE__ */ template(`<img alt=Preview>`);
|
|
3587
|
-
var _tmpl$
|
|
3647
|
+
var _tmpl$35 = /* @__PURE__ */ template(`<div>No Image`);
|
|
3588
3648
|
var _tmpl$44 = /* @__PURE__ */ template(`<div>`);
|
|
3589
3649
|
var _tmpl$54 = /* @__PURE__ */ template(`<div><strong>Missing tags for <!>:</strong><ul>`);
|
|
3590
3650
|
var _tmpl$63 = /* @__PURE__ */ template(`<li>`);
|
|
@@ -3730,7 +3790,7 @@ function SocialPreview(props) {
|
|
|
3730
3790
|
});
|
|
3731
3791
|
return _el$7;
|
|
3732
3792
|
})() : (() => {
|
|
3733
|
-
var _el$8 = _tmpl$
|
|
3793
|
+
var _el$8 = _tmpl$35();
|
|
3734
3794
|
_el$8.style.setProperty("background", "#222");
|
|
3735
3795
|
_el$8.style.setProperty("color", "#888");
|
|
3736
3796
|
_el$8.style.setProperty("display", "flex");
|
|
@@ -3893,7 +3953,7 @@ var tabs = [{
|
|
|
3893
3953
|
// src/components/tabs.tsx
|
|
3894
3954
|
var _tmpl$17 = /* @__PURE__ */ template(`<div>`);
|
|
3895
3955
|
var _tmpl$29 = /* @__PURE__ */ template(`<button type=button>`);
|
|
3896
|
-
var _tmpl$
|
|
3956
|
+
var _tmpl$36 = /* @__PURE__ */ template(`<div><button type=button></button><button type=button>`);
|
|
3897
3957
|
var Tabs = (props) => {
|
|
3898
3958
|
const styles = useStyles();
|
|
3899
3959
|
const {
|
|
@@ -3932,7 +3992,7 @@ var Tabs = (props) => {
|
|
|
3932
3992
|
insert(_el$, (() => {
|
|
3933
3993
|
var _c$ = memo(() => pipWindow().pipWindow !== null);
|
|
3934
3994
|
return () => _c$() ? null : (() => {
|
|
3935
|
-
var _el$3 = _tmpl$
|
|
3995
|
+
var _el$3 = _tmpl$36(), _el$4 = _el$3.firstChild, _el$5 = _el$4.nextSibling;
|
|
3936
3996
|
_el$3.style.setProperty("margin-top", "auto");
|
|
3937
3997
|
_el$4.$$click = handleDetachment;
|
|
3938
3998
|
insert(_el$4, createComponent(PiP, {}));
|
|
@@ -3971,6 +4031,9 @@ var TabContent = () => {
|
|
|
3971
4031
|
};
|
|
3972
4032
|
var _tmpl$19 = /* @__PURE__ */ template(`<div>`);
|
|
3973
4033
|
var SourceInspector = () => {
|
|
4034
|
+
const {
|
|
4035
|
+
settings
|
|
4036
|
+
} = useDevtoolsSettings();
|
|
3974
4037
|
const highlightStateInit = () => ({
|
|
3975
4038
|
element: null,
|
|
3976
4039
|
bounding: {
|
|
@@ -3999,11 +4062,7 @@ var SourceInspector = () => {
|
|
|
3999
4062
|
});
|
|
4000
4063
|
const downList = useKeyDownList();
|
|
4001
4064
|
const isHighlightingKeysHeld = createMemo(() => {
|
|
4002
|
-
|
|
4003
|
-
const isShiftHeld = keys.includes("SHIFT");
|
|
4004
|
-
const isCtrlHeld = keys.includes("CONTROL");
|
|
4005
|
-
const isMetaHeld = keys.includes("META");
|
|
4006
|
-
return isShiftHeld && (isCtrlHeld || isMetaHeld);
|
|
4065
|
+
return isHotkeyCombinationPressed(downList(), settings().inspectHotkey);
|
|
4007
4066
|
});
|
|
4008
4067
|
createEffect(() => {
|
|
4009
4068
|
if (!isHighlightingKeysHeld()) {
|
|
@@ -4239,11 +4298,8 @@ function DevTools() {
|
|
|
4239
4298
|
}
|
|
4240
4299
|
});
|
|
4241
4300
|
createEffect(() => {
|
|
4242
|
-
const
|
|
4243
|
-
const
|
|
4244
|
-
const allModifierCombinations = getAllPermutations(modifiers);
|
|
4245
|
-
for (const combination of allModifierCombinations) {
|
|
4246
|
-
const permutation = [...combination, ...nonModifiers];
|
|
4301
|
+
const permutations = getHotkeyPermutations(settings().openHotkey);
|
|
4302
|
+
for (const permutation of permutations) {
|
|
4247
4303
|
createShortcut(permutation, () => {
|
|
4248
4304
|
toggleOpen();
|
|
4249
4305
|
});
|
package/dist/index.d.ts
CHANGED
|
@@ -23,8 +23,9 @@ declare const tabs: readonly [{
|
|
|
23
23
|
}];
|
|
24
24
|
type TabName = (typeof tabs)[number]['id'];
|
|
25
25
|
|
|
26
|
-
type ModifierKey = 'Alt' | 'Control' | 'Meta' | 'Shift';
|
|
26
|
+
type ModifierKey = 'Alt' | 'Control' | 'Meta' | 'Shift' | 'CtrlOrMeta';
|
|
27
27
|
type KeyboardKey = ModifierKey | (string & {});
|
|
28
|
+
|
|
28
29
|
type TriggerPosition = 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' | 'middle-left' | 'middle-right';
|
|
29
30
|
type TriggerProps = {
|
|
30
31
|
theme: 'light' | 'dark';
|
|
@@ -53,9 +54,14 @@ type DevtoolsStore = {
|
|
|
53
54
|
panelLocation: 'top' | 'bottom';
|
|
54
55
|
/**
|
|
55
56
|
* The hotkey to open the dev tools
|
|
56
|
-
* @default "
|
|
57
|
+
* @default ["Shift", "A"]
|
|
57
58
|
*/
|
|
58
59
|
openHotkey: Array<KeyboardKey>;
|
|
60
|
+
/**
|
|
61
|
+
* The hotkey to open the source inspector
|
|
62
|
+
* @default ["Shift", "CtrlOrMeta"]
|
|
63
|
+
*/
|
|
64
|
+
inspectHotkey: Array<KeyboardKey>;
|
|
59
65
|
/**
|
|
60
66
|
* Whether to require the URL flag to open the dev tools
|
|
61
67
|
* @default false
|
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/YGJWPK3G.js';
|
|
2
|
+
export { PLUGIN_CONTAINER_ID, PLUGIN_TITLE_CONTAINER_ID } from './chunk/YGJWPK3G.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';
|
|
@@ -30,7 +30,7 @@ var TanStackDevtoolsCore = class {
|
|
|
30
30
|
const mountTo = el;
|
|
31
31
|
const dispose = render(() => {
|
|
32
32
|
const _self$ = this;
|
|
33
|
-
this.#Component = lazy(() => import('./devtools/
|
|
33
|
+
this.#Component = lazy(() => import('./devtools/LWN3DL7E.js'));
|
|
34
34
|
const Devtools = this.#Component;
|
|
35
35
|
this.#eventBus = new ClientEventBus(this.#eventBusConfig);
|
|
36
36
|
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/YGJWPK3G.js';
|
|
2
|
+
export { PLUGIN_CONTAINER_ID, PLUGIN_TITLE_CONTAINER_ID } from './chunk/YGJWPK3G.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.
|
|
3
|
+
"version": "0.9.0",
|
|
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",
|
|
@@ -55,8 +55,8 @@
|
|
|
55
55
|
"clsx": "^2.1.1",
|
|
56
56
|
"goober": "^2.1.16",
|
|
57
57
|
"solid-js": "^1.9.9",
|
|
58
|
-
"@tanstack/devtools-client": "0.0.4",
|
|
59
58
|
"@tanstack/devtools-event-bus": "0.3.3",
|
|
59
|
+
"@tanstack/devtools-client": "0.0.4",
|
|
60
60
|
"@tanstack/devtools-ui": "0.4.4"
|
|
61
61
|
},
|
|
62
62
|
"peerDependencies": {
|
|
@@ -4,7 +4,11 @@ import { createElementSize } from '@solid-primitives/resize-observer'
|
|
|
4
4
|
import { useKeyDownList } from '@solid-primitives/keyboard'
|
|
5
5
|
import { createEventListener } from '@solid-primitives/event-listener'
|
|
6
6
|
|
|
7
|
+
import { useDevtoolsSettings } from '../context/use-devtools-context'
|
|
8
|
+
import { isHotkeyCombinationPressed } from '../utils/hotkey'
|
|
9
|
+
|
|
7
10
|
export const SourceInspector = () => {
|
|
11
|
+
const { settings } = useDevtoolsSettings()
|
|
8
12
|
const highlightStateInit = () => ({
|
|
9
13
|
element: null as HTMLElement | null,
|
|
10
14
|
bounding: { width: 0, height: 0, left: 0, top: 0 },
|
|
@@ -25,12 +29,9 @@ export const SourceInspector = () => {
|
|
|
25
29
|
})
|
|
26
30
|
|
|
27
31
|
const downList = useKeyDownList()
|
|
32
|
+
|
|
28
33
|
const isHighlightingKeysHeld = createMemo(() => {
|
|
29
|
-
|
|
30
|
-
const isShiftHeld = keys.includes('SHIFT')
|
|
31
|
-
const isCtrlHeld = keys.includes('CONTROL')
|
|
32
|
-
const isMetaHeld = keys.includes('META')
|
|
33
|
-
return isShiftHeld && (isCtrlHeld || isMetaHeld)
|
|
34
|
+
return isHotkeyCombinationPressed(downList(), settings().inspectHotkey)
|
|
34
35
|
})
|
|
35
36
|
|
|
36
37
|
createEffect(() => {
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import type { TabName } from '../tabs'
|
|
2
2
|
import type { TanStackDevtoolsPlugin } from './devtools-context'
|
|
3
3
|
|
|
4
|
-
type ModifierKey = 'Alt' | 'Control' | 'Meta' | 'Shift'
|
|
4
|
+
type ModifierKey = 'Alt' | 'Control' | 'Meta' | 'Shift' | 'CtrlOrMeta'
|
|
5
5
|
type KeyboardKey = ModifierKey | (string & {})
|
|
6
|
+
export type { ModifierKey, KeyboardKey }
|
|
6
7
|
export const keyboardModifiers: Array<ModifierKey> = [
|
|
7
8
|
'Alt',
|
|
8
9
|
'Control',
|
|
9
10
|
'Meta',
|
|
10
11
|
'Shift',
|
|
12
|
+
'CtrlOrMeta',
|
|
11
13
|
]
|
|
12
14
|
|
|
13
15
|
type TriggerPosition =
|
|
@@ -47,9 +49,14 @@ export type DevtoolsStore = {
|
|
|
47
49
|
panelLocation: 'top' | 'bottom'
|
|
48
50
|
/**
|
|
49
51
|
* The hotkey to open the dev tools
|
|
50
|
-
* @default "
|
|
52
|
+
* @default ["Shift", "A"]
|
|
51
53
|
*/
|
|
52
54
|
openHotkey: Array<KeyboardKey>
|
|
55
|
+
/**
|
|
56
|
+
* The hotkey to open the source inspector
|
|
57
|
+
* @default ["Shift", "CtrlOrMeta"]
|
|
58
|
+
*/
|
|
59
|
+
inspectHotkey: Array<KeyboardKey>
|
|
53
60
|
/**
|
|
54
61
|
* Whether to require the URL flag to open the dev tools
|
|
55
62
|
* @default false
|
|
@@ -93,6 +100,7 @@ export const initialState: DevtoolsStore = {
|
|
|
93
100
|
position: 'bottom-right',
|
|
94
101
|
panelLocation: 'bottom',
|
|
95
102
|
openHotkey: ['Shift', 'A'],
|
|
103
|
+
inspectHotkey: ['Shift', 'CtrlOrMeta'],
|
|
96
104
|
requireUrlFlag: false,
|
|
97
105
|
urlFlag: 'tanstack-devtools',
|
|
98
106
|
theme:
|