@tanstack/vue-router-devtools 1.166.8 → 1.166.9
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/esm/TanStackRouterDevtools.js +71 -61
- package/dist/esm/TanStackRouterDevtools.js.map +1 -1
- package/dist/esm/TanStackRouterDevtoolsPanel.js +61 -56
- package/dist/esm/TanStackRouterDevtoolsPanel.js.map +1 -1
- package/dist/esm/index.js +15 -17
- package/dist/esm/index.js.map +1 -1
- package/package.json +4 -4
|
@@ -1,64 +1,74 @@
|
|
|
1
|
+
import { defineComponent, h, onMounted, onUnmounted, ref, watch } from "vue";
|
|
1
2
|
import { TanStackRouterDevtoolsCore } from "@tanstack/router-devtools-core";
|
|
2
|
-
import { defineComponent, ref, watch, onMounted, onUnmounted, h } from "vue";
|
|
3
3
|
import { useRouter, useRouterState } from "@tanstack/vue-router";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
4
|
+
//#region src/TanStackRouterDevtools.tsx
|
|
5
|
+
var TanStackRouterDevtools = /* @__PURE__ */ defineComponent({
|
|
6
|
+
name: "TanStackRouterDevtools",
|
|
7
|
+
props: [
|
|
8
|
+
"initialIsOpen",
|
|
9
|
+
"panelProps",
|
|
10
|
+
"closeButtonProps",
|
|
11
|
+
"toggleButtonProps",
|
|
12
|
+
"position",
|
|
13
|
+
"containerElement",
|
|
14
|
+
"router",
|
|
15
|
+
"shadowDOMTarget"
|
|
16
|
+
],
|
|
17
|
+
setup(props) {
|
|
18
|
+
const devToolRef = ref(null);
|
|
19
|
+
let isMounted = false;
|
|
20
|
+
const hookRouter = useRouter({ warn: false });
|
|
21
|
+
const activeRouter = props.router ?? hookRouter;
|
|
22
|
+
const activeRouterState = useRouterState({ router: activeRouter });
|
|
23
|
+
const devtools = new TanStackRouterDevtoolsCore({
|
|
24
|
+
initialIsOpen: props.initialIsOpen,
|
|
25
|
+
panelProps: props.panelProps,
|
|
26
|
+
closeButtonProps: props.closeButtonProps,
|
|
27
|
+
toggleButtonProps: props.toggleButtonProps,
|
|
28
|
+
position: props.position,
|
|
29
|
+
containerElement: props.containerElement,
|
|
30
|
+
shadowDOMTarget: props.shadowDOMTarget,
|
|
31
|
+
router: activeRouter,
|
|
32
|
+
routerState: activeRouterState.value
|
|
33
|
+
});
|
|
34
|
+
watch(() => activeRouter, (router) => {
|
|
35
|
+
devtools.setRouter(router);
|
|
36
|
+
});
|
|
37
|
+
watch(activeRouterState, (routerState) => {
|
|
38
|
+
devtools.setRouterState(routerState);
|
|
39
|
+
});
|
|
40
|
+
watch(() => [
|
|
41
|
+
props.initialIsOpen,
|
|
42
|
+
props.panelProps,
|
|
43
|
+
props.closeButtonProps,
|
|
44
|
+
props.toggleButtonProps,
|
|
45
|
+
props.position,
|
|
46
|
+
props.containerElement,
|
|
47
|
+
props.shadowDOMTarget
|
|
48
|
+
], () => {
|
|
49
|
+
devtools.setOptions({
|
|
50
|
+
initialIsOpen: props.initialIsOpen,
|
|
51
|
+
panelProps: props.panelProps,
|
|
52
|
+
closeButtonProps: props.closeButtonProps,
|
|
53
|
+
toggleButtonProps: props.toggleButtonProps,
|
|
54
|
+
position: props.position,
|
|
55
|
+
containerElement: props.containerElement,
|
|
56
|
+
shadowDOMTarget: props.shadowDOMTarget
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
onMounted(() => {
|
|
60
|
+
if (devToolRef.value) {
|
|
61
|
+
devtools.mount(devToolRef.value);
|
|
62
|
+
isMounted = true;
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
onUnmounted(() => {
|
|
66
|
+
if (isMounted) devtools.unmount();
|
|
67
|
+
});
|
|
68
|
+
return () => h("div", { ref: devToolRef });
|
|
69
|
+
}
|
|
60
70
|
});
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
//# sourceMappingURL=TanStackRouterDevtools.js.map
|
|
71
|
+
//#endregion
|
|
72
|
+
export { TanStackRouterDevtools };
|
|
73
|
+
|
|
74
|
+
//# sourceMappingURL=TanStackRouterDevtools.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TanStackRouterDevtools.js","sources":["../../src/TanStackRouterDevtools.tsx"],"sourcesContent":["import { TanStackRouterDevtoolsCore } from '@tanstack/router-devtools-core'\nimport { defineComponent, h, onMounted, onUnmounted, ref, watch } from 'vue'\nimport { useRouter, useRouterState } from '@tanstack/vue-router'\nimport type { AnyRouter } from '@tanstack/vue-router'\n\nexport interface TanStackRouterDevtoolsOptions {\n /**\n * Set this true if you want the dev tools to default to being open\n */\n initialIsOpen?: boolean\n /**\n * Use this to add props to the panel. For example, you can add className, style (merge and override default style), etc.\n */\n panelProps?: Record<string, any>\n /**\n * Use this to add props to the close button. For example, you can add className, style (merge and override default style), onClick (extend default handler), etc.\n */\n closeButtonProps?: Record<string, any>\n /**\n * Use this to add props to the toggle button. For example, you can add className, style (merge and override default style), onClick (extend default handler), etc.\n */\n toggleButtonProps?: Record<string, any>\n /**\n * The position of the TanStack Router logo to open and close the devtools panel.\n * Defaults to 'bottom-left'.\n */\n position?: 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right'\n /**\n * Use this to render the devtools inside a different type of container element for a11y purposes.\n * Any string which corresponds to a valid intrinsic JSX element is allowed.\n * Defaults to 'footer'.\n */\n containerElement?: string | any\n /**\n * The router instance to use for the devtools.\n */\n router?: AnyRouter\n /**\n * Use this to attach the devtool's styles to specific element in the DOM.\n */\n shadowDOMTarget?: ShadowRoot\n}\n\nexport const TanStackRouterDevtools = /* #__PURE__ */ defineComponent({\n name: 'TanStackRouterDevtools',\n props: [\n 'initialIsOpen',\n 'panelProps',\n 'closeButtonProps',\n 'toggleButtonProps',\n 'position',\n 'containerElement',\n 'router',\n 'shadowDOMTarget',\n ] as unknown as undefined,\n setup(props: TanStackRouterDevtoolsOptions) {\n const devToolRef = ref<HTMLDivElement | null>(null)\n let isMounted = false\n\n const hookRouter = useRouter({ warn: false })\n const activeRouter = props.router ?? hookRouter\n\n const activeRouterState = useRouterState({ router: activeRouter })\n\n const devtools = new TanStackRouterDevtoolsCore({\n initialIsOpen: props.initialIsOpen,\n panelProps: props.panelProps,\n closeButtonProps: props.closeButtonProps,\n toggleButtonProps: props.toggleButtonProps,\n position: props.position,\n containerElement: props.containerElement,\n shadowDOMTarget: props.shadowDOMTarget,\n router: activeRouter,\n routerState: activeRouterState.value,\n })\n\n // Update devtools when router changes\n watch(\n () => activeRouter,\n (router) => {\n devtools.setRouter(router)\n },\n )\n\n // Update devtools when router state changes\n watch(activeRouterState, (routerState) => {\n devtools.setRouterState(routerState)\n })\n\n // Update devtools when options change\n watch(\n () => [\n props.initialIsOpen,\n props.panelProps,\n props.closeButtonProps,\n props.toggleButtonProps,\n props.position,\n props.containerElement,\n props.shadowDOMTarget,\n ],\n () => {\n devtools.setOptions({\n initialIsOpen: props.initialIsOpen,\n panelProps: props.panelProps,\n closeButtonProps: props.closeButtonProps,\n toggleButtonProps: props.toggleButtonProps,\n position: props.position,\n containerElement: props.containerElement,\n shadowDOMTarget: props.shadowDOMTarget,\n })\n },\n )\n\n onMounted(() => {\n if (devToolRef.value) {\n devtools.mount(devToolRef.value)\n isMounted = true\n }\n })\n\n onUnmounted(() => {\n if (isMounted) {\n devtools.unmount()\n }\n })\n\n return () => h('div', { ref: devToolRef })\n },\n})\n"],"
|
|
1
|
+
{"version":3,"file":"TanStackRouterDevtools.js","names":["TanStackRouterDevtoolsCore","defineComponent","h","onMounted","onUnmounted","ref","watch","useRouter","useRouterState","TanStackRouterDevtools","name","props","setup","devToolRef","isMounted","hookRouter","warn","activeRouter","router","activeRouterState","devtools","initialIsOpen","panelProps","closeButtonProps","toggleButtonProps","position","containerElement","shadowDOMTarget","routerState","value","setRouter","setRouterState","setOptions","mount","unmount"],"sources":["../../src/TanStackRouterDevtools.tsx"],"sourcesContent":["import { TanStackRouterDevtoolsCore } from '@tanstack/router-devtools-core'\nimport { defineComponent, h, onMounted, onUnmounted, ref, watch } from 'vue'\nimport { useRouter, useRouterState } from '@tanstack/vue-router'\nimport type { AnyRouter } from '@tanstack/vue-router'\n\nexport interface TanStackRouterDevtoolsOptions {\n /**\n * Set this true if you want the dev tools to default to being open\n */\n initialIsOpen?: boolean\n /**\n * Use this to add props to the panel. For example, you can add className, style (merge and override default style), etc.\n */\n panelProps?: Record<string, any>\n /**\n * Use this to add props to the close button. For example, you can add className, style (merge and override default style), onClick (extend default handler), etc.\n */\n closeButtonProps?: Record<string, any>\n /**\n * Use this to add props to the toggle button. For example, you can add className, style (merge and override default style), onClick (extend default handler), etc.\n */\n toggleButtonProps?: Record<string, any>\n /**\n * The position of the TanStack Router logo to open and close the devtools panel.\n * Defaults to 'bottom-left'.\n */\n position?: 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right'\n /**\n * Use this to render the devtools inside a different type of container element for a11y purposes.\n * Any string which corresponds to a valid intrinsic JSX element is allowed.\n * Defaults to 'footer'.\n */\n containerElement?: string | any\n /**\n * The router instance to use for the devtools.\n */\n router?: AnyRouter\n /**\n * Use this to attach the devtool's styles to specific element in the DOM.\n */\n shadowDOMTarget?: ShadowRoot\n}\n\nexport const TanStackRouterDevtools = /* #__PURE__ */ defineComponent({\n name: 'TanStackRouterDevtools',\n props: [\n 'initialIsOpen',\n 'panelProps',\n 'closeButtonProps',\n 'toggleButtonProps',\n 'position',\n 'containerElement',\n 'router',\n 'shadowDOMTarget',\n ] as unknown as undefined,\n setup(props: TanStackRouterDevtoolsOptions) {\n const devToolRef = ref<HTMLDivElement | null>(null)\n let isMounted = false\n\n const hookRouter = useRouter({ warn: false })\n const activeRouter = props.router ?? hookRouter\n\n const activeRouterState = useRouterState({ router: activeRouter })\n\n const devtools = new TanStackRouterDevtoolsCore({\n initialIsOpen: props.initialIsOpen,\n panelProps: props.panelProps,\n closeButtonProps: props.closeButtonProps,\n toggleButtonProps: props.toggleButtonProps,\n position: props.position,\n containerElement: props.containerElement,\n shadowDOMTarget: props.shadowDOMTarget,\n router: activeRouter,\n routerState: activeRouterState.value,\n })\n\n // Update devtools when router changes\n watch(\n () => activeRouter,\n (router) => {\n devtools.setRouter(router)\n },\n )\n\n // Update devtools when router state changes\n watch(activeRouterState, (routerState) => {\n devtools.setRouterState(routerState)\n })\n\n // Update devtools when options change\n watch(\n () => [\n props.initialIsOpen,\n props.panelProps,\n props.closeButtonProps,\n props.toggleButtonProps,\n props.position,\n props.containerElement,\n props.shadowDOMTarget,\n ],\n () => {\n devtools.setOptions({\n initialIsOpen: props.initialIsOpen,\n panelProps: props.panelProps,\n closeButtonProps: props.closeButtonProps,\n toggleButtonProps: props.toggleButtonProps,\n position: props.position,\n containerElement: props.containerElement,\n shadowDOMTarget: props.shadowDOMTarget,\n })\n },\n )\n\n onMounted(() => {\n if (devToolRef.value) {\n devtools.mount(devToolRef.value)\n isMounted = true\n }\n })\n\n onUnmounted(() => {\n if (isMounted) {\n devtools.unmount()\n }\n })\n\n return () => h('div', { ref: devToolRef })\n },\n})\n"],"mappings":";;;;AA2CA,IAAaS,yBAAyCR,gCAAgB;CACpES,MAAM;CACNC,OAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACuB;CACzBC,MAAMD,OAAsC;EAC1C,MAAME,aAAaR,IAA2B,KAAK;EACnD,IAAIS,YAAY;EAEhB,MAAMC,aAAaR,UAAU,EAAES,MAAM,OAAO,CAAC;EAC7C,MAAMC,eAAeN,MAAMO,UAAUH;EAErC,MAAMI,oBAAoBX,eAAe,EAAEU,QAAQD,cAAc,CAAC;EAElE,MAAMG,WAAW,IAAIpB,2BAA2B;GAC9CqB,eAAeV,MAAMU;GACrBC,YAAYX,MAAMW;GAClBC,kBAAkBZ,MAAMY;GACxBC,mBAAmBb,MAAMa;GACzBC,UAAUd,MAAMc;GAChBC,kBAAkBf,MAAMe;GACxBC,iBAAiBhB,MAAMgB;GACvBT,QAAQD;GACRW,aAAaT,kBAAkBU;GAChC,CAAC;AAGFvB,cACQW,eACLC,WAAW;AACVE,YAASU,UAAUZ,OAAO;IAE7B;AAGDZ,QAAMa,oBAAoBS,gBAAgB;AACxCR,YAASW,eAAeH,YAAY;IACpC;AAGFtB,cACQ;GACJK,MAAMU;GACNV,MAAMW;GACNX,MAAMY;GACNZ,MAAMa;GACNb,MAAMc;GACNd,MAAMe;GACNf,MAAMgB;GACP,QACK;AACJP,YAASY,WAAW;IAClBX,eAAeV,MAAMU;IACrBC,YAAYX,MAAMW;IAClBC,kBAAkBZ,MAAMY;IACxBC,mBAAmBb,MAAMa;IACzBC,UAAUd,MAAMc;IAChBC,kBAAkBf,MAAMe;IACxBC,iBAAiBhB,MAAMgB;IACxB,CAAC;IAEL;AAEDxB,kBAAgB;AACd,OAAIU,WAAWgB,OAAO;AACpBT,aAASa,MAAMpB,WAAWgB,MAAM;AAChCf,gBAAY;;IAEd;AAEFV,oBAAkB;AAChB,OAAIU,UACFM,UAASc,SAAS;IAEpB;AAEF,eAAahC,EAAE,OAAO,EAAEG,KAAKQ,YAAY,CAAC;;CAE7C,CAAC"}
|
|
@@ -1,59 +1,64 @@
|
|
|
1
|
+
import { defineComponent, h, onMounted, onUnmounted, ref, watch } from "vue";
|
|
1
2
|
import { TanStackRouterDevtoolsPanelCore } from "@tanstack/router-devtools-core";
|
|
2
|
-
import { defineComponent, ref, watch, onMounted, onUnmounted, h } from "vue";
|
|
3
3
|
import { useRouter, useRouterState } from "@tanstack/vue-router";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
4
|
+
//#region src/TanStackRouterDevtoolsPanel.tsx
|
|
5
|
+
var TanStackRouterDevtoolsPanel = /* @__PURE__ */ defineComponent({
|
|
6
|
+
name: "TanStackRouterDevtoolsPanel",
|
|
7
|
+
props: [
|
|
8
|
+
"style",
|
|
9
|
+
"className",
|
|
10
|
+
"isOpen",
|
|
11
|
+
"setIsOpen",
|
|
12
|
+
"handleDragStart",
|
|
13
|
+
"router",
|
|
14
|
+
"shadowDOMTarget"
|
|
15
|
+
],
|
|
16
|
+
setup(props) {
|
|
17
|
+
const devToolRef = ref(null);
|
|
18
|
+
let isMounted = false;
|
|
19
|
+
const hookRouter = useRouter({ warn: false });
|
|
20
|
+
const activeRouter = props.router ?? hookRouter;
|
|
21
|
+
const activeRouterState = useRouterState({ router: activeRouter });
|
|
22
|
+
const devtools = new TanStackRouterDevtoolsPanelCore({
|
|
23
|
+
style: props.style,
|
|
24
|
+
className: props.className,
|
|
25
|
+
isOpen: props.isOpen,
|
|
26
|
+
setIsOpen: props.setIsOpen,
|
|
27
|
+
handleDragStart: props.handleDragStart,
|
|
28
|
+
shadowDOMTarget: props.shadowDOMTarget,
|
|
29
|
+
router: activeRouter,
|
|
30
|
+
routerState: activeRouterState.value
|
|
31
|
+
});
|
|
32
|
+
watch(() => activeRouter, (router) => {
|
|
33
|
+
devtools.setRouter(router);
|
|
34
|
+
});
|
|
35
|
+
watch(activeRouterState, (routerState) => {
|
|
36
|
+
devtools.setRouterState(routerState);
|
|
37
|
+
});
|
|
38
|
+
watch(() => [
|
|
39
|
+
props.className,
|
|
40
|
+
props.style,
|
|
41
|
+
props.shadowDOMTarget
|
|
42
|
+
], () => {
|
|
43
|
+
devtools.setOptions({
|
|
44
|
+
className: props.className,
|
|
45
|
+
style: props.style,
|
|
46
|
+
shadowDOMTarget: props.shadowDOMTarget
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
onMounted(() => {
|
|
50
|
+
if (devToolRef.value) {
|
|
51
|
+
devtools.mount(devToolRef.value);
|
|
52
|
+
isMounted = true;
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
onUnmounted(() => {
|
|
56
|
+
if (isMounted) devtools.unmount();
|
|
57
|
+
});
|
|
58
|
+
return () => h("div", { ref: devToolRef });
|
|
59
|
+
}
|
|
55
60
|
});
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
//# sourceMappingURL=TanStackRouterDevtoolsPanel.js.map
|
|
61
|
+
//#endregion
|
|
62
|
+
export { TanStackRouterDevtoolsPanel };
|
|
63
|
+
|
|
64
|
+
//# sourceMappingURL=TanStackRouterDevtoolsPanel.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TanStackRouterDevtoolsPanel.js","sources":["../../src/TanStackRouterDevtoolsPanel.tsx"],"sourcesContent":["import { TanStackRouterDevtoolsPanelCore } from '@tanstack/router-devtools-core'\nimport { defineComponent, h, onMounted, onUnmounted, ref, watch } from 'vue'\nimport { useRouter, useRouterState } from '@tanstack/vue-router'\nimport type { AnyRouter } from '@tanstack/vue-router'\n\nexport interface TanStackRouterDevtoolsPanelOptions {\n /**\n * The standard style object used to style a component with inline styles\n */\n style?: any\n /**\n * The standard class property used to style a component with classes\n */\n className?: string\n /**\n * A boolean variable indicating whether the panel is open or closed\n */\n isOpen?: boolean\n /**\n * A function that toggles the open and close state of the panel\n */\n setIsOpen?: (isOpen: boolean) => void\n /**\n * Handles the opening and closing the devtools panel\n */\n handleDragStart?: (e: any) => void\n /**\n * The router instance to use for the devtools.\n */\n router?: AnyRouter\n /**\n * Use this to attach the devtool's styles to specific element in the DOM.\n */\n shadowDOMTarget?: ShadowRoot\n}\n\nexport const TanStackRouterDevtoolsPanel = /* #__PURE__ */ defineComponent({\n name: 'TanStackRouterDevtoolsPanel',\n props: [\n 'style',\n 'className',\n 'isOpen',\n 'setIsOpen',\n 'handleDragStart',\n 'router',\n 'shadowDOMTarget',\n ] as unknown as undefined,\n setup(props: TanStackRouterDevtoolsPanelOptions) {\n const devToolRef = ref<HTMLDivElement | null>(null)\n let isMounted = false\n\n const hookRouter = useRouter({ warn: false })\n const activeRouter = props.router ?? hookRouter\n\n const activeRouterState = useRouterState({ router: activeRouter })\n\n const devtools = new TanStackRouterDevtoolsPanelCore({\n style: props.style,\n className: props.className,\n isOpen: props.isOpen,\n setIsOpen: props.setIsOpen,\n handleDragStart: props.handleDragStart,\n shadowDOMTarget: props.shadowDOMTarget,\n router: activeRouter,\n routerState: activeRouterState.value,\n })\n\n // Update devtools when router changes\n watch(\n () => activeRouter,\n (router) => {\n devtools.setRouter(router)\n },\n )\n\n // Update devtools when router state changes\n watch(activeRouterState, (routerState) => {\n devtools.setRouterState(routerState)\n })\n\n // Update devtools when options change\n watch(\n () => [props.className, props.style, props.shadowDOMTarget],\n () => {\n devtools.setOptions({\n className: props.className,\n style: props.style,\n shadowDOMTarget: props.shadowDOMTarget,\n })\n },\n )\n\n onMounted(() => {\n if (devToolRef.value) {\n devtools.mount(devToolRef.value)\n isMounted = true\n }\n })\n\n onUnmounted(() => {\n if (isMounted) {\n devtools.unmount()\n }\n })\n\n return () => h('div', { ref: devToolRef })\n },\n})\n"],"
|
|
1
|
+
{"version":3,"file":"TanStackRouterDevtoolsPanel.js","names":["TanStackRouterDevtoolsPanelCore","defineComponent","h","onMounted","onUnmounted","ref","watch","useRouter","useRouterState","TanStackRouterDevtoolsPanel","name","props","setup","devToolRef","isMounted","hookRouter","warn","activeRouter","router","activeRouterState","devtools","style","className","isOpen","setIsOpen","handleDragStart","shadowDOMTarget","routerState","value","setRouter","setRouterState","setOptions","mount","unmount"],"sources":["../../src/TanStackRouterDevtoolsPanel.tsx"],"sourcesContent":["import { TanStackRouterDevtoolsPanelCore } from '@tanstack/router-devtools-core'\nimport { defineComponent, h, onMounted, onUnmounted, ref, watch } from 'vue'\nimport { useRouter, useRouterState } from '@tanstack/vue-router'\nimport type { AnyRouter } from '@tanstack/vue-router'\n\nexport interface TanStackRouterDevtoolsPanelOptions {\n /**\n * The standard style object used to style a component with inline styles\n */\n style?: any\n /**\n * The standard class property used to style a component with classes\n */\n className?: string\n /**\n * A boolean variable indicating whether the panel is open or closed\n */\n isOpen?: boolean\n /**\n * A function that toggles the open and close state of the panel\n */\n setIsOpen?: (isOpen: boolean) => void\n /**\n * Handles the opening and closing the devtools panel\n */\n handleDragStart?: (e: any) => void\n /**\n * The router instance to use for the devtools.\n */\n router?: AnyRouter\n /**\n * Use this to attach the devtool's styles to specific element in the DOM.\n */\n shadowDOMTarget?: ShadowRoot\n}\n\nexport const TanStackRouterDevtoolsPanel = /* #__PURE__ */ defineComponent({\n name: 'TanStackRouterDevtoolsPanel',\n props: [\n 'style',\n 'className',\n 'isOpen',\n 'setIsOpen',\n 'handleDragStart',\n 'router',\n 'shadowDOMTarget',\n ] as unknown as undefined,\n setup(props: TanStackRouterDevtoolsPanelOptions) {\n const devToolRef = ref<HTMLDivElement | null>(null)\n let isMounted = false\n\n const hookRouter = useRouter({ warn: false })\n const activeRouter = props.router ?? hookRouter\n\n const activeRouterState = useRouterState({ router: activeRouter })\n\n const devtools = new TanStackRouterDevtoolsPanelCore({\n style: props.style,\n className: props.className,\n isOpen: props.isOpen,\n setIsOpen: props.setIsOpen,\n handleDragStart: props.handleDragStart,\n shadowDOMTarget: props.shadowDOMTarget,\n router: activeRouter,\n routerState: activeRouterState.value,\n })\n\n // Update devtools when router changes\n watch(\n () => activeRouter,\n (router) => {\n devtools.setRouter(router)\n },\n )\n\n // Update devtools when router state changes\n watch(activeRouterState, (routerState) => {\n devtools.setRouterState(routerState)\n })\n\n // Update devtools when options change\n watch(\n () => [props.className, props.style, props.shadowDOMTarget],\n () => {\n devtools.setOptions({\n className: props.className,\n style: props.style,\n shadowDOMTarget: props.shadowDOMTarget,\n })\n },\n )\n\n onMounted(() => {\n if (devToolRef.value) {\n devtools.mount(devToolRef.value)\n isMounted = true\n }\n })\n\n onUnmounted(() => {\n if (isMounted) {\n devtools.unmount()\n }\n })\n\n return () => h('div', { ref: devToolRef })\n },\n})\n"],"mappings":";;;;AAoCA,IAAaS,8BAA8CR,gCAAgB;CACzES,MAAM;CACNC,OAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACuB;CACzBC,MAAMD,OAA2C;EAC/C,MAAME,aAAaR,IAA2B,KAAK;EACnD,IAAIS,YAAY;EAEhB,MAAMC,aAAaR,UAAU,EAAES,MAAM,OAAO,CAAC;EAC7C,MAAMC,eAAeN,MAAMO,UAAUH;EAErC,MAAMI,oBAAoBX,eAAe,EAAEU,QAAQD,cAAc,CAAC;EAElE,MAAMG,WAAW,IAAIpB,gCAAgC;GACnDqB,OAAOV,MAAMU;GACbC,WAAWX,MAAMW;GACjBC,QAAQZ,MAAMY;GACdC,WAAWb,MAAMa;GACjBC,iBAAiBd,MAAMc;GACvBC,iBAAiBf,MAAMe;GACvBR,QAAQD;GACRU,aAAaR,kBAAkBS;GAChC,CAAC;AAGFtB,cACQW,eACLC,WAAW;AACVE,YAASS,UAAUX,OAAO;IAE7B;AAGDZ,QAAMa,oBAAoBQ,gBAAgB;AACxCP,YAASU,eAAeH,YAAY;IACpC;AAGFrB,cACQ;GAACK,MAAMW;GAAWX,MAAMU;GAAOV,MAAMe;GAAgB,QACrD;AACJN,YAASW,WAAW;IAClBT,WAAWX,MAAMW;IACjBD,OAAOV,MAAMU;IACbK,iBAAiBf,MAAMe;IACxB,CAAC;IAEL;AAEDvB,kBAAgB;AACd,OAAIU,WAAWe,OAAO;AACpBR,aAASY,MAAMnB,WAAWe,MAAM;AAChCd,gBAAY;;IAEd;AAEFV,oBAAkB;AAChB,OAAIU,UACFM,UAASa,SAAS;IAEpB;AAEF,eAAa/B,EAAE,OAAO,EAAEG,KAAKQ,YAAY,CAAC;;CAE7C,CAAC"}
|
package/dist/esm/index.js
CHANGED
|
@@ -1,20 +1,18 @@
|
|
|
1
|
-
import { defineComponent } from "vue";
|
|
2
1
|
import { TanStackRouterDevtools as TanStackRouterDevtools$1 } from "./TanStackRouterDevtools.js";
|
|
3
2
|
import { TanStackRouterDevtoolsPanel as TanStackRouterDevtoolsPanel$1 } from "./TanStackRouterDevtoolsPanel.js";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
import { defineComponent } from "vue";
|
|
4
|
+
//#region src/index.tsx
|
|
5
|
+
var NullComponent = /* @__PURE__ */ defineComponent({
|
|
6
|
+
name: "NullTanStackRouterDevtools",
|
|
7
|
+
setup() {
|
|
8
|
+
return () => null;
|
|
9
|
+
}
|
|
9
10
|
});
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
TanStackRouterDevtoolsPanelInProd
|
|
19
|
-
};
|
|
20
|
-
//# sourceMappingURL=index.js.map
|
|
11
|
+
var TanStackRouterDevtools = process.env.NODE_ENV !== "development" ? NullComponent : TanStackRouterDevtools$1;
|
|
12
|
+
var TanStackRouterDevtoolsInProd = TanStackRouterDevtools$1;
|
|
13
|
+
var TanStackRouterDevtoolsPanel = process.env.NODE_ENV !== "development" ? NullComponent : TanStackRouterDevtoolsPanel$1;
|
|
14
|
+
var TanStackRouterDevtoolsPanelInProd = TanStackRouterDevtoolsPanel$1;
|
|
15
|
+
//#endregion
|
|
16
|
+
export { TanStackRouterDevtools, TanStackRouterDevtoolsInProd, TanStackRouterDevtoolsPanel, TanStackRouterDevtoolsPanelInProd };
|
|
17
|
+
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/index.tsx"],"sourcesContent":["import { defineComponent } from 'vue'\nimport { TanStackRouterDevtools as DevToolsComponent } from './TanStackRouterDevtools'\nimport { TanStackRouterDevtoolsPanel as DevToolsPanelComponent } from './TanStackRouterDevtoolsPanel'\n\n// Re-export types\nexport type { TanStackRouterDevtoolsOptions } from './TanStackRouterDevtools'\nexport type { TanStackRouterDevtoolsPanelOptions } from './TanStackRouterDevtoolsPanel'\n\n// Create a null component for production\nconst NullComponent = /* #__PURE__ */ defineComponent({\n name: 'NullTanStackRouterDevtools',\n setup() {\n return () => null\n },\n})\n\nexport const TanStackRouterDevtools =\n process.env.NODE_ENV !== 'development' ? NullComponent : DevToolsComponent\n\nexport const TanStackRouterDevtoolsInProd = DevToolsComponent\n\nexport const TanStackRouterDevtoolsPanel =\n process.env.NODE_ENV !== 'development'\n ? NullComponent\n : DevToolsPanelComponent\n\nexport const TanStackRouterDevtoolsPanelInProd = DevToolsPanelComponent\n"],"
|
|
1
|
+
{"version":3,"file":"index.js","names":["defineComponent","TanStackRouterDevtools","DevToolsComponent","TanStackRouterDevtoolsPanel","DevToolsPanelComponent","NullComponent","name","setup","process","env","NODE_ENV","TanStackRouterDevtoolsInProd","TanStackRouterDevtoolsPanelInProd"],"sources":["../../src/index.tsx"],"sourcesContent":["import { defineComponent } from 'vue'\nimport { TanStackRouterDevtools as DevToolsComponent } from './TanStackRouterDevtools'\nimport { TanStackRouterDevtoolsPanel as DevToolsPanelComponent } from './TanStackRouterDevtoolsPanel'\n\n// Re-export types\nexport type { TanStackRouterDevtoolsOptions } from './TanStackRouterDevtools'\nexport type { TanStackRouterDevtoolsPanelOptions } from './TanStackRouterDevtoolsPanel'\n\n// Create a null component for production\nconst NullComponent = /* #__PURE__ */ defineComponent({\n name: 'NullTanStackRouterDevtools',\n setup() {\n return () => null\n },\n})\n\nexport const TanStackRouterDevtools =\n process.env.NODE_ENV !== 'development' ? NullComponent : DevToolsComponent\n\nexport const TanStackRouterDevtoolsInProd = DevToolsComponent\n\nexport const TanStackRouterDevtoolsPanel =\n process.env.NODE_ENV !== 'development'\n ? NullComponent\n : DevToolsPanelComponent\n\nexport const TanStackRouterDevtoolsPanelInProd = DevToolsPanelComponent\n"],"mappings":";;;;AASA,IAAMK,gBAAgCL,gCAAgB;CACpDM,MAAM;CACNC,QAAQ;AACN,eAAa;;CAEhB,CAAC;AAEF,IAAaN,yBAAAA,QAAAA,IAAAA,aACc,gBAAgBI,gBAAgBH;AAE3D,IAAaS,+BAA+BT;AAE5C,IAAaC,8BAAAA,QAAAA,IAAAA,aACc,gBACrBE,gBACAD;AAEN,IAAaQ,oCAAoCR"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tanstack/vue-router-devtools",
|
|
3
|
-
"version": "1.166.
|
|
3
|
+
"version": "1.166.9",
|
|
4
4
|
"description": "Modern and scalable routing for Vue applications",
|
|
5
5
|
"author": "Tanner Linsley",
|
|
6
6
|
"license": "MIT",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
47
|
"vite": "*",
|
|
48
|
-
"@tanstack/router-devtools-core": "1.166.
|
|
48
|
+
"@tanstack/router-devtools-core": "1.166.9"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"@vitejs/plugin-vue-jsx": "^4.1.2",
|
|
@@ -53,8 +53,8 @@
|
|
|
53
53
|
},
|
|
54
54
|
"peerDependencies": {
|
|
55
55
|
"vue": "^3.5.13",
|
|
56
|
-
"@tanstack/vue-router": "^1.167.
|
|
57
|
-
"@tanstack/router-core": "^1.167.
|
|
56
|
+
"@tanstack/vue-router": "^1.167.2",
|
|
57
|
+
"@tanstack/router-core": "^1.167.2"
|
|
58
58
|
},
|
|
59
59
|
"peerDependenciesMeta": {
|
|
60
60
|
"@tanstack/router-core": {
|