@tanstack/devtools 0.4.1 → 0.4.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.
|
@@ -19,7 +19,7 @@ const generatePluginId = (plugin, index) => {
|
|
|
19
19
|
return plugin.id;
|
|
20
20
|
}
|
|
21
21
|
if (typeof plugin.name === "string") {
|
|
22
|
-
return plugin.name.toLowerCase().replace(" ", "-")
|
|
22
|
+
return `${plugin.name.toLowerCase().replace(" ", "-")}-${index}`;
|
|
23
23
|
}
|
|
24
24
|
return index.toString();
|
|
25
25
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"devtools-context.cjs","sources":["../../../src/context/devtools-context.tsx"],"sourcesContent":["import { createContext } from 'solid-js'\nimport { createStore } from 'solid-js/store'\nimport { tryParseJson } from '../utils/sanitize'\nimport {\n TANSTACK_DEVTOOLS_SETTINGS,\n TANSTACK_DEVTOOLS_STATE,\n getStorageItem,\n setStorageItem,\n} from '../utils/storage'\nimport { initialState } from './devtools-store'\nimport type { DevtoolsStore } from './devtools-store'\nimport type { JSX, Setter } from 'solid-js'\n\nexport interface TanStackDevtoolsPlugin {\n /**\n * Name to be displayed in the devtools UI.\n * If a string, it will be used as the plugin name.\n * If a function, it will be called with the mount element.\n *\n * Example:\n * ```ts\n * {\n * // If a string, it will be used as the plugin name\n * name: \"Your Plugin\",\n * render: () => {}\n * }\n * ```\n * or\n *\n * ```ts\n * {\n * // If a function, it will be called with the mount element\n * name: (el) => {\n * el.innerText = \"Your Plugin Name\"\n * // Your name logic here\n * },\n * render: () => {}\n * }\n * ```\n */\n name: string | ((el: HTMLHeadingElement) => void)\n /**\n * Unique identifier for the plugin.\n * If not provided, it will be generated based on the name.\n */\n id?: string\n /**\n * Render the plugin UI by using the provided element. This function will be called\n * when the plugin tab is clicked and expected to be mounted.\n * @param el The mount element for the plugin.\n * @returns void\n *\n * Example:\n * ```ts\n * render: (el) => {\n * el.innerHTML = \"<h1>Your Plugin</h1>\"\n * }\n * ```\n */\n render: (el: HTMLDivElement) => void\n}\nexport const DevtoolsContext = createContext<{\n store: DevtoolsStore\n setStore: Setter<DevtoolsStore>\n}>()\n\ninterface ContextProps {\n children: JSX.Element\n plugins?: Array<TanStackDevtoolsPlugin>\n config?: TanStackDevtoolsConfig\n}\n\nconst getSettings = () => {\n const settingsString = getStorageItem(TANSTACK_DEVTOOLS_SETTINGS)\n const settings = tryParseJson<DevtoolsStore['settings']>(settingsString)\n return {\n ...settings,\n }\n}\n\nconst generatePluginId = (plugin: TanStackDevtoolsPlugin, index: number) => {\n // if set by user, return the plugin id\n if (plugin.id) {\n return plugin.id\n }\n if (typeof plugin.name === 'string') {\n // if name is a string, use it to generate an id\n return plugin.name.toLowerCase().replace(' ', '-')
|
|
1
|
+
{"version":3,"file":"devtools-context.cjs","sources":["../../../src/context/devtools-context.tsx"],"sourcesContent":["import { createContext } from 'solid-js'\nimport { createStore } from 'solid-js/store'\nimport { tryParseJson } from '../utils/sanitize'\nimport {\n TANSTACK_DEVTOOLS_SETTINGS,\n TANSTACK_DEVTOOLS_STATE,\n getStorageItem,\n setStorageItem,\n} from '../utils/storage'\nimport { initialState } from './devtools-store'\nimport type { DevtoolsStore } from './devtools-store'\nimport type { JSX, Setter } from 'solid-js'\n\nexport interface TanStackDevtoolsPlugin {\n /**\n * Name to be displayed in the devtools UI.\n * If a string, it will be used as the plugin name.\n * If a function, it will be called with the mount element.\n *\n * Example:\n * ```ts\n * {\n * // If a string, it will be used as the plugin name\n * name: \"Your Plugin\",\n * render: () => {}\n * }\n * ```\n * or\n *\n * ```ts\n * {\n * // If a function, it will be called with the mount element\n * name: (el) => {\n * el.innerText = \"Your Plugin Name\"\n * // Your name logic here\n * },\n * render: () => {}\n * }\n * ```\n */\n name: string | ((el: HTMLHeadingElement) => void)\n /**\n * Unique identifier for the plugin.\n * If not provided, it will be generated based on the name.\n */\n id?: string\n /**\n * Render the plugin UI by using the provided element. This function will be called\n * when the plugin tab is clicked and expected to be mounted.\n * @param el The mount element for the plugin.\n * @returns void\n *\n * Example:\n * ```ts\n * render: (el) => {\n * el.innerHTML = \"<h1>Your Plugin</h1>\"\n * }\n * ```\n */\n render: (el: HTMLDivElement) => void\n}\nexport const DevtoolsContext = createContext<{\n store: DevtoolsStore\n setStore: Setter<DevtoolsStore>\n}>()\n\ninterface ContextProps {\n children: JSX.Element\n plugins?: Array<TanStackDevtoolsPlugin>\n config?: TanStackDevtoolsConfig\n}\n\nconst getSettings = () => {\n const settingsString = getStorageItem(TANSTACK_DEVTOOLS_SETTINGS)\n const settings = tryParseJson<DevtoolsStore['settings']>(settingsString)\n return {\n ...settings,\n }\n}\n\nconst generatePluginId = (plugin: TanStackDevtoolsPlugin, index: number) => {\n // if set by user, return the plugin id\n if (plugin.id) {\n return plugin.id\n }\n if (typeof plugin.name === 'string') {\n // if name is a string, use it to generate an id\n return `${plugin.name.toLowerCase().replace(' ', '-')}-${index}`\n }\n // Name is JSX? return the index as a string\n return index.toString()\n}\n\nconst getExistingStateFromStorage = (\n config?: TanStackDevtoolsConfig,\n plugins?: Array<TanStackDevtoolsPlugin>,\n) => {\n const existingState = getStorageItem(TANSTACK_DEVTOOLS_STATE)\n const settings = getSettings()\n\n const state: DevtoolsStore = {\n ...initialState,\n plugins:\n plugins?.map((plugin, i) => {\n const id = generatePluginId(plugin, i)\n return {\n ...plugin,\n id,\n }\n }) || [],\n state: {\n ...initialState.state,\n ...(existingState ? JSON.parse(existingState) : {}),\n },\n settings: {\n ...initialState.settings,\n ...config,\n ...settings,\n },\n }\n return state\n}\n\nexport type TanStackDevtoolsConfig = DevtoolsStore['settings']\n\nexport const DevtoolsProvider = (props: ContextProps) => {\n const [store, setStore] = createStore(\n getExistingStateFromStorage(props.config, props.plugins),\n )\n\n const value = {\n store,\n setStore: (\n updater: (prev: DevtoolsStore) => DevtoolsStore | Partial<DevtoolsStore>,\n ) => {\n const newState = updater(store)\n const { settings, state: internalState } = newState\n // Store user settings for dev tools into local storage\n setStorageItem(TANSTACK_DEVTOOLS_SETTINGS, JSON.stringify(settings))\n // Store general state into local storage\n setStorageItem(TANSTACK_DEVTOOLS_STATE, JSON.stringify(internalState))\n setStore((prev) => ({\n ...prev,\n ...newState,\n }))\n },\n }\n\n return (\n <DevtoolsContext.Provider value={value}>\n {props.children}\n </DevtoolsContext.Provider>\n )\n}\n"],"names":["DevtoolsContext","createContext","getSettings","settingsString","getStorageItem","TANSTACK_DEVTOOLS_SETTINGS","settings","tryParseJson","generatePluginId","plugin","index","id","name","toLowerCase","replace","toString","getExistingStateFromStorage","config","plugins","existingState","TANSTACK_DEVTOOLS_STATE","state","initialState","map","i","JSON","parse","DevtoolsProvider","props","store","setStore","createStore","value","updater","newState","internalState","setStorageItem","stringify","prev","_$createComponent","Provider","children"],"mappings":";;;;;;;;AA6DO,MAAMA,kBAAkBC,QAAAA,cAAAA;AAW/B,MAAMC,cAAcA,MAAM;AACxB,QAAMC,iBAAiBC,QAAAA,eAAeC,kCAA0B;AAChE,QAAMC,WAAWC,SAAAA,aAAwCJ,cAAc;AACvE,SAAO;AAAA,IACL,GAAGG;AAAAA,EAAAA;AAEP;AAEA,MAAME,mBAAmBA,CAACC,QAAgCC,UAAkB;AAE1E,MAAID,OAAOE,IAAI;AACb,WAAOF,OAAOE;AAAAA,EAChB;AACA,MAAI,OAAOF,OAAOG,SAAS,UAAU;AAEnC,WAAO,GAAGH,OAAOG,KAAKC,YAAAA,EAAcC,QAAQ,KAAK,GAAG,CAAC,IAAIJ,KAAK;AAAA,EAChE;AAEA,SAAOA,MAAMK,SAAAA;AACf;AAEA,MAAMC,8BAA8BA,CAClCC,QACAC,YACG;AACH,QAAMC,gBAAgBf,QAAAA,eAAegB,+BAAuB;AAC5D,QAAMd,WAAWJ,YAAAA;AAEjB,QAAMmB,QAAuB;AAAA,IAC3B,GAAGC,cAAAA;AAAAA,IACHJ,SACEA,SAASK,IAAI,CAACd,QAAQe,MAAM;AAC1B,YAAMb,KAAKH,iBAAiBC,QAAQe,CAAC;AACrC,aAAO;AAAA,QACL,GAAGf;AAAAA,QACHE;AAAAA,MAAAA;AAAAA,IAEJ,CAAC,KAAK,CAAA;AAAA,IACRU,OAAO;AAAA,MACL,GAAGC,cAAAA,aAAaD;AAAAA,MAChB,GAAIF,gBAAgBM,KAAKC,MAAMP,aAAa,IAAI,CAAA;AAAA,IAAC;AAAA,IAEnDb,UAAU;AAAA,MACR,GAAGgB,cAAAA,aAAahB;AAAAA,MAChB,GAAGW;AAAAA,MACH,GAAGX;AAAAA,IAAAA;AAAAA,EACL;AAEF,SAAOe;AACT;AAIO,MAAMM,mBAAmBA,CAACC,UAAwB;AACvD,QAAM,CAACC,SAAOC,QAAQ,IAAIC,MAAAA,YACxBf,4BAA4BY,MAAMX,QAAQW,MAAMV,OAAO,CACzD;AAEA,QAAMc,QAAQ;AAAA,IAAA,OACZH;AAAAA,IACAC,UAAUA,CACRG,YACG;AACH,YAAMC,WAAWD,QAAQJ,OAAK;AAC9B,YAAM;AAAA,QAAEvB;AAAAA,QAAUe,OAAOc;AAAAA,MAAAA,IAAkBD;AAE3CE,cAAAA,eAAe/B,QAAAA,4BAA4BoB,KAAKY,UAAU/B,QAAQ,CAAC;AAEnE8B,cAAAA,eAAehB,QAAAA,yBAAyBK,KAAKY,UAAUF,aAAa,CAAC;AACrEL,eAAUQ,CAAAA,UAAU;AAAA,QAClB,GAAGA;AAAAA,QACH,GAAGJ;AAAAA,MAAAA,EACH;AAAA,IACJ;AAAA,EAAA;AAGF,SAAAK,IAAAA,gBACGvC,gBAAgBwC,UAAQ;AAAA,IAACR;AAAAA,IAAY,IAAAS,WAAA;AAAA,aACnCb,MAAMa;AAAAA,IAAQ;AAAA,EAAA,CAAA;AAGrB;;;"}
|
|
@@ -17,7 +17,7 @@ const generatePluginId = (plugin, index) => {
|
|
|
17
17
|
return plugin.id;
|
|
18
18
|
}
|
|
19
19
|
if (typeof plugin.name === "string") {
|
|
20
|
-
return plugin.name.toLowerCase().replace(" ", "-")
|
|
20
|
+
return `${plugin.name.toLowerCase().replace(" ", "-")}-${index}`;
|
|
21
21
|
}
|
|
22
22
|
return index.toString();
|
|
23
23
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"devtools-context.js","sources":["../../../src/context/devtools-context.tsx"],"sourcesContent":["import { createContext } from 'solid-js'\nimport { createStore } from 'solid-js/store'\nimport { tryParseJson } from '../utils/sanitize'\nimport {\n TANSTACK_DEVTOOLS_SETTINGS,\n TANSTACK_DEVTOOLS_STATE,\n getStorageItem,\n setStorageItem,\n} from '../utils/storage'\nimport { initialState } from './devtools-store'\nimport type { DevtoolsStore } from './devtools-store'\nimport type { JSX, Setter } from 'solid-js'\n\nexport interface TanStackDevtoolsPlugin {\n /**\n * Name to be displayed in the devtools UI.\n * If a string, it will be used as the plugin name.\n * If a function, it will be called with the mount element.\n *\n * Example:\n * ```ts\n * {\n * // If a string, it will be used as the plugin name\n * name: \"Your Plugin\",\n * render: () => {}\n * }\n * ```\n * or\n *\n * ```ts\n * {\n * // If a function, it will be called with the mount element\n * name: (el) => {\n * el.innerText = \"Your Plugin Name\"\n * // Your name logic here\n * },\n * render: () => {}\n * }\n * ```\n */\n name: string | ((el: HTMLHeadingElement) => void)\n /**\n * Unique identifier for the plugin.\n * If not provided, it will be generated based on the name.\n */\n id?: string\n /**\n * Render the plugin UI by using the provided element. This function will be called\n * when the plugin tab is clicked and expected to be mounted.\n * @param el The mount element for the plugin.\n * @returns void\n *\n * Example:\n * ```ts\n * render: (el) => {\n * el.innerHTML = \"<h1>Your Plugin</h1>\"\n * }\n * ```\n */\n render: (el: HTMLDivElement) => void\n}\nexport const DevtoolsContext = createContext<{\n store: DevtoolsStore\n setStore: Setter<DevtoolsStore>\n}>()\n\ninterface ContextProps {\n children: JSX.Element\n plugins?: Array<TanStackDevtoolsPlugin>\n config?: TanStackDevtoolsConfig\n}\n\nconst getSettings = () => {\n const settingsString = getStorageItem(TANSTACK_DEVTOOLS_SETTINGS)\n const settings = tryParseJson<DevtoolsStore['settings']>(settingsString)\n return {\n ...settings,\n }\n}\n\nconst generatePluginId = (plugin: TanStackDevtoolsPlugin, index: number) => {\n // if set by user, return the plugin id\n if (plugin.id) {\n return plugin.id\n }\n if (typeof plugin.name === 'string') {\n // if name is a string, use it to generate an id\n return plugin.name.toLowerCase().replace(' ', '-')
|
|
1
|
+
{"version":3,"file":"devtools-context.js","sources":["../../../src/context/devtools-context.tsx"],"sourcesContent":["import { createContext } from 'solid-js'\nimport { createStore } from 'solid-js/store'\nimport { tryParseJson } from '../utils/sanitize'\nimport {\n TANSTACK_DEVTOOLS_SETTINGS,\n TANSTACK_DEVTOOLS_STATE,\n getStorageItem,\n setStorageItem,\n} from '../utils/storage'\nimport { initialState } from './devtools-store'\nimport type { DevtoolsStore } from './devtools-store'\nimport type { JSX, Setter } from 'solid-js'\n\nexport interface TanStackDevtoolsPlugin {\n /**\n * Name to be displayed in the devtools UI.\n * If a string, it will be used as the plugin name.\n * If a function, it will be called with the mount element.\n *\n * Example:\n * ```ts\n * {\n * // If a string, it will be used as the plugin name\n * name: \"Your Plugin\",\n * render: () => {}\n * }\n * ```\n * or\n *\n * ```ts\n * {\n * // If a function, it will be called with the mount element\n * name: (el) => {\n * el.innerText = \"Your Plugin Name\"\n * // Your name logic here\n * },\n * render: () => {}\n * }\n * ```\n */\n name: string | ((el: HTMLHeadingElement) => void)\n /**\n * Unique identifier for the plugin.\n * If not provided, it will be generated based on the name.\n */\n id?: string\n /**\n * Render the plugin UI by using the provided element. This function will be called\n * when the plugin tab is clicked and expected to be mounted.\n * @param el The mount element for the plugin.\n * @returns void\n *\n * Example:\n * ```ts\n * render: (el) => {\n * el.innerHTML = \"<h1>Your Plugin</h1>\"\n * }\n * ```\n */\n render: (el: HTMLDivElement) => void\n}\nexport const DevtoolsContext = createContext<{\n store: DevtoolsStore\n setStore: Setter<DevtoolsStore>\n}>()\n\ninterface ContextProps {\n children: JSX.Element\n plugins?: Array<TanStackDevtoolsPlugin>\n config?: TanStackDevtoolsConfig\n}\n\nconst getSettings = () => {\n const settingsString = getStorageItem(TANSTACK_DEVTOOLS_SETTINGS)\n const settings = tryParseJson<DevtoolsStore['settings']>(settingsString)\n return {\n ...settings,\n }\n}\n\nconst generatePluginId = (plugin: TanStackDevtoolsPlugin, index: number) => {\n // if set by user, return the plugin id\n if (plugin.id) {\n return plugin.id\n }\n if (typeof plugin.name === 'string') {\n // if name is a string, use it to generate an id\n return `${plugin.name.toLowerCase().replace(' ', '-')}-${index}`\n }\n // Name is JSX? return the index as a string\n return index.toString()\n}\n\nconst getExistingStateFromStorage = (\n config?: TanStackDevtoolsConfig,\n plugins?: Array<TanStackDevtoolsPlugin>,\n) => {\n const existingState = getStorageItem(TANSTACK_DEVTOOLS_STATE)\n const settings = getSettings()\n\n const state: DevtoolsStore = {\n ...initialState,\n plugins:\n plugins?.map((plugin, i) => {\n const id = generatePluginId(plugin, i)\n return {\n ...plugin,\n id,\n }\n }) || [],\n state: {\n ...initialState.state,\n ...(existingState ? JSON.parse(existingState) : {}),\n },\n settings: {\n ...initialState.settings,\n ...config,\n ...settings,\n },\n }\n return state\n}\n\nexport type TanStackDevtoolsConfig = DevtoolsStore['settings']\n\nexport const DevtoolsProvider = (props: ContextProps) => {\n const [store, setStore] = createStore(\n getExistingStateFromStorage(props.config, props.plugins),\n )\n\n const value = {\n store,\n setStore: (\n updater: (prev: DevtoolsStore) => DevtoolsStore | Partial<DevtoolsStore>,\n ) => {\n const newState = updater(store)\n const { settings, state: internalState } = newState\n // Store user settings for dev tools into local storage\n setStorageItem(TANSTACK_DEVTOOLS_SETTINGS, JSON.stringify(settings))\n // Store general state into local storage\n setStorageItem(TANSTACK_DEVTOOLS_STATE, JSON.stringify(internalState))\n setStore((prev) => ({\n ...prev,\n ...newState,\n }))\n },\n }\n\n return (\n <DevtoolsContext.Provider value={value}>\n {props.children}\n </DevtoolsContext.Provider>\n )\n}\n"],"names":["DevtoolsContext","createContext","getSettings","settingsString","getStorageItem","TANSTACK_DEVTOOLS_SETTINGS","settings","tryParseJson","generatePluginId","plugin","index","id","name","toLowerCase","replace","toString","getExistingStateFromStorage","config","plugins","existingState","TANSTACK_DEVTOOLS_STATE","state","initialState","map","i","JSON","parse","DevtoolsProvider","props","store","setStore","createStore","value","updater","newState","internalState","setStorageItem","stringify","prev","_$createComponent","Provider","children"],"mappings":";;;;;;AA6DO,MAAMA,kBAAkBC,cAAAA;AAW/B,MAAMC,cAAcA,MAAM;AACxB,QAAMC,iBAAiBC,eAAeC,0BAA0B;AAChE,QAAMC,WAAWC,aAAwCJ,cAAc;AACvE,SAAO;AAAA,IACL,GAAGG;AAAAA,EAAAA;AAEP;AAEA,MAAME,mBAAmBA,CAACC,QAAgCC,UAAkB;AAE1E,MAAID,OAAOE,IAAI;AACb,WAAOF,OAAOE;AAAAA,EAChB;AACA,MAAI,OAAOF,OAAOG,SAAS,UAAU;AAEnC,WAAO,GAAGH,OAAOG,KAAKC,YAAAA,EAAcC,QAAQ,KAAK,GAAG,CAAC,IAAIJ,KAAK;AAAA,EAChE;AAEA,SAAOA,MAAMK,SAAAA;AACf;AAEA,MAAMC,8BAA8BA,CAClCC,QACAC,YACG;AACH,QAAMC,gBAAgBf,eAAegB,uBAAuB;AAC5D,QAAMd,WAAWJ,YAAAA;AAEjB,QAAMmB,QAAuB;AAAA,IAC3B,GAAGC;AAAAA,IACHJ,SACEA,SAASK,IAAI,CAACd,QAAQe,MAAM;AAC1B,YAAMb,KAAKH,iBAAiBC,QAAQe,CAAC;AACrC,aAAO;AAAA,QACL,GAAGf;AAAAA,QACHE;AAAAA,MAAAA;AAAAA,IAEJ,CAAC,KAAK,CAAA;AAAA,IACRU,OAAO;AAAA,MACL,GAAGC,aAAaD;AAAAA,MAChB,GAAIF,gBAAgBM,KAAKC,MAAMP,aAAa,IAAI,CAAA;AAAA,IAAC;AAAA,IAEnDb,UAAU;AAAA,MACR,GAAGgB,aAAahB;AAAAA,MAChB,GAAGW;AAAAA,MACH,GAAGX;AAAAA,IAAAA;AAAAA,EACL;AAEF,SAAOe;AACT;AAIO,MAAMM,mBAAmBA,CAACC,UAAwB;AACvD,QAAM,CAACC,OAAOC,QAAQ,IAAIC,YACxBf,4BAA4BY,MAAMX,QAAQW,MAAMV,OAAO,CACzD;AAEA,QAAMc,QAAQ;AAAA,IACZH;AAAAA,IACAC,UAAUA,CACRG,YACG;AACH,YAAMC,WAAWD,QAAQJ,KAAK;AAC9B,YAAM;AAAA,QAAEvB;AAAAA,QAAUe,OAAOc;AAAAA,MAAAA,IAAkBD;AAE3CE,qBAAe/B,4BAA4BoB,KAAKY,UAAU/B,QAAQ,CAAC;AAEnE8B,qBAAehB,yBAAyBK,KAAKY,UAAUF,aAAa,CAAC;AACrEL,eAAUQ,CAAAA,UAAU;AAAA,QAClB,GAAGA;AAAAA,QACH,GAAGJ;AAAAA,MAAAA,EACH;AAAA,IACJ;AAAA,EAAA;AAGF,SAAAK,gBACGvC,gBAAgBwC,UAAQ;AAAA,IAACR;AAAAA,IAAY,IAAAS,WAAA;AAAA,aACnCb,MAAMa;AAAAA,IAAQ;AAAA,EAAA,CAAA;AAGrB;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tanstack/devtools",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.2",
|
|
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",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"clsx": "^2.1.1",
|
|
48
48
|
"goober": "^2.1.16",
|
|
49
49
|
"solid-js": "^1.9.7",
|
|
50
|
-
"@tanstack/devtools-event-bus": "0.2.
|
|
50
|
+
"@tanstack/devtools-event-bus": "0.2.2",
|
|
51
51
|
"@tanstack/devtools-ui": "0.3.1"
|
|
52
52
|
},
|
|
53
53
|
"peerDependencies": {
|
|
@@ -85,7 +85,7 @@ const generatePluginId = (plugin: TanStackDevtoolsPlugin, index: number) => {
|
|
|
85
85
|
}
|
|
86
86
|
if (typeof plugin.name === 'string') {
|
|
87
87
|
// if name is a string, use it to generate an id
|
|
88
|
-
return plugin.name.toLowerCase().replace(' ', '-')
|
|
88
|
+
return `${plugin.name.toLowerCase().replace(' ', '-')}-${index}`
|
|
89
89
|
}
|
|
90
90
|
// Name is JSX? return the index as a string
|
|
91
91
|
return index.toString()
|