@tanstack/devtools 0.8.0 → 0.8.2
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/dev.js +1 -1
- package/dist/devtools/{MYTOQ6G4.js → GGWR254Q.js} +9 -1
- package/dist/devtools/{RHZRAMXS.js → I7ZVYS6Q.js} +9 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/src/components/source-inspector.tsx +7 -3
- package/src/context/devtools-context.tsx +2 -0
- package/src/context/use-devtools-context.ts +8 -0
package/dist/dev.js
CHANGED
|
@@ -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/GGWR254Q.js'));
|
|
34
34
|
const Devtools = this.#Component;
|
|
35
35
|
this.#eventBus = new ClientEventBus(this.#eventBusConfig);
|
|
36
36
|
this.#eventBus.start();
|
|
@@ -93,6 +93,12 @@ var usePlugins = () => {
|
|
|
93
93
|
const toggleActivePlugins = (pluginId) => {
|
|
94
94
|
setStore((prev) => {
|
|
95
95
|
const isActive = prev.state.activePlugins.includes(pluginId);
|
|
96
|
+
const currentPlugin = store.plugins?.find(
|
|
97
|
+
(plugin) => plugin.id === pluginId
|
|
98
|
+
);
|
|
99
|
+
if (currentPlugin?.destroy && isActive) {
|
|
100
|
+
currentPlugin.destroy(pluginId);
|
|
101
|
+
}
|
|
96
102
|
const updatedPlugins = isActive ? prev.state.activePlugins.filter((id) => id !== pluginId) : [...prev.state.activePlugins, pluginId];
|
|
97
103
|
if (updatedPlugins.length > MAX_ACTIVE_PLUGINS) return prev;
|
|
98
104
|
return {
|
|
@@ -4035,7 +4041,9 @@ var SourceInspector = () => {
|
|
|
4035
4041
|
window.getSelection()?.removeAllRanges();
|
|
4036
4042
|
e.preventDefault();
|
|
4037
4043
|
e.stopPropagation();
|
|
4038
|
-
|
|
4044
|
+
const baseUrl = new URL(import.meta.env?.BASE_URL ?? "/", location.origin);
|
|
4045
|
+
const url = new URL(`__tsd/open-source?source=${encodeURIComponent(highlightState.dataSource)}`, baseUrl);
|
|
4046
|
+
fetch(url).catch(() => {
|
|
4039
4047
|
});
|
|
4040
4048
|
});
|
|
4041
4049
|
const currentElementBoxStyles = createMemo(() => {
|
|
@@ -93,6 +93,12 @@ var usePlugins = () => {
|
|
|
93
93
|
const toggleActivePlugins = (pluginId) => {
|
|
94
94
|
setStore((prev) => {
|
|
95
95
|
const isActive = prev.state.activePlugins.includes(pluginId);
|
|
96
|
+
const currentPlugin = store.plugins?.find(
|
|
97
|
+
(plugin) => plugin.id === pluginId
|
|
98
|
+
);
|
|
99
|
+
if (currentPlugin?.destroy && isActive) {
|
|
100
|
+
currentPlugin.destroy(pluginId);
|
|
101
|
+
}
|
|
96
102
|
const updatedPlugins = isActive ? prev.state.activePlugins.filter((id) => id !== pluginId) : [...prev.state.activePlugins, pluginId];
|
|
97
103
|
if (updatedPlugins.length > MAX_ACTIVE_PLUGINS) return prev;
|
|
98
104
|
return {
|
|
@@ -3498,7 +3504,9 @@ var SourceInspector = () => {
|
|
|
3498
3504
|
window.getSelection()?.removeAllRanges();
|
|
3499
3505
|
e.preventDefault();
|
|
3500
3506
|
e.stopPropagation();
|
|
3501
|
-
|
|
3507
|
+
const baseUrl = new URL(import.meta.env?.BASE_URL ?? "/", location.origin);
|
|
3508
|
+
const url = new URL(`__tsd/open-source?source=${encodeURIComponent(highlightState.dataSource)}`, baseUrl);
|
|
3509
|
+
fetch(url).catch(() => {
|
|
3502
3510
|
});
|
|
3503
3511
|
});
|
|
3504
3512
|
const currentElementBoxStyles = createMemo(() => {
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -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/GGWR254Q.js'));
|
|
34
34
|
const Devtools = this.#Component;
|
|
35
35
|
this.#eventBus = new ClientEventBus(this.#eventBusConfig);
|
|
36
36
|
this.#eventBus.start();
|
package/package.json
CHANGED
|
@@ -78,11 +78,15 @@ export const SourceInspector = () => {
|
|
|
78
78
|
e.preventDefault()
|
|
79
79
|
e.stopPropagation()
|
|
80
80
|
|
|
81
|
-
|
|
82
|
-
|
|
81
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
82
|
+
const baseUrl = new URL(import.meta.env?.BASE_URL ?? '/', location.origin)
|
|
83
|
+
const url = new URL(
|
|
84
|
+
`__tsd/open-source?source=${encodeURIComponent(
|
|
83
85
|
highlightState.dataSource,
|
|
84
86
|
)}`,
|
|
85
|
-
|
|
87
|
+
baseUrl,
|
|
88
|
+
)
|
|
89
|
+
fetch(url).catch(() => {})
|
|
86
90
|
})
|
|
87
91
|
|
|
88
92
|
const currentElementBoxStyles = createMemo(() => {
|
|
@@ -48,6 +48,14 @@ export const usePlugins = () => {
|
|
|
48
48
|
setStore((prev) => {
|
|
49
49
|
const isActive = prev.state.activePlugins.includes(pluginId)
|
|
50
50
|
|
|
51
|
+
const currentPlugin = store.plugins?.find(
|
|
52
|
+
(plugin) => plugin.id === pluginId,
|
|
53
|
+
)
|
|
54
|
+
|
|
55
|
+
if (currentPlugin?.destroy && isActive) {
|
|
56
|
+
currentPlugin.destroy(pluginId)
|
|
57
|
+
}
|
|
58
|
+
|
|
51
59
|
const updatedPlugins = isActive
|
|
52
60
|
? prev.state.activePlugins.filter((id) => id !== pluginId)
|
|
53
61
|
: [...prev.state.activePlugins, pluginId]
|