@tanstack/solid-devtools 0.6.10 → 0.7.1

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/core.js CHANGED
@@ -20,7 +20,7 @@ function SolidDevtoolsCore({
20
20
  ...plugin,
21
21
  name: typeof plugin.name === "string" ? plugin.name : (
22
22
  // The check above confirms that `plugin.name` is of Render type
23
- (el, theme) => convertRender(el, plugin.name, theme)
23
+ ((el, theme) => convertRender(el, plugin.name, theme))
24
24
  ),
25
25
  render: (el, theme) => convertRender(el, plugin.render, theme)
26
26
  }))
@@ -1 +1 @@
1
- {"version":3,"file":"core.js","sources":["../../src/core.tsx"],"sourcesContent":["import { TanStackDevtoolsCore } from '@tanstack/devtools'\nimport { createEffect, createSignal, onCleanup, onMount } from 'solid-js'\nimport { Portal } from 'solid-js/web'\nimport type { JSX } from 'solid-js'\nimport type {\n ClientEventBusConfig,\n TanStackDevtoolsConfig,\n TanStackDevtoolsPlugin,\n} from '@tanstack/devtools'\n\ntype SolidPluginRender =\n | JSX.Element\n | ((\n el: HTMLDivElement | HTMLHeadingElement,\n theme: 'dark' | 'light',\n ) => JSX.Element)\nconst convertRender = (\n el: HTMLDivElement | HTMLHeadingElement,\n Component: SolidPluginRender,\n theme: 'dark' | 'light',\n) => (\n <Portal mount={el}>\n {typeof Component === 'function' ? Component(el, theme) : Component}\n </Portal>\n)\n\nexport type TanStackDevtoolsSolidPlugin = Omit<\n TanStackDevtoolsPlugin,\n 'render' | 'name'\n> & {\n /**\n * The render function can be a SolidJS element or a function that returns a SolidJS element.\n * If it's a function, it will be called to render the plugin, otherwise it will be rendered directly.\n *\n * Example:\n * ```ts\n * {\n * render: () => <CustomPluginComponent />,\n * }\n * ```\n * or\n * ```ts\n * {\n * render: <CustomPluginComponent />,\n * }\n * ```\n */\n render: SolidPluginRender\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 * name: \"Your Plugin\",\n * render: () => <CustomPluginComponent />,\n * }\n * ```\n * or\n * ```ts\n * {\n * name: <h1>Your Plugin title</h1>,\n * render: () => <CustomPluginComponent />,\n * }\n * ```\n */\n name: string | SolidPluginRender\n}\nexport interface TanStackDevtoolsInit {\n /**\n * Array of plugins to be used in the devtools.\n * Each plugin should have a `render` function that returns a React element or a function\n *\n * Example:\n * ```jsx\n * <TanStackDevtools\n * plugins={[\n * {\n * id: \"your-plugin-id\",\n * name: \"Your Plugin\",\n * render: <CustomPluginComponent />,\n * }\n * ]}\n * />\n * ```\n */\n plugins?: Array<TanStackDevtoolsSolidPlugin>\n /**\n * Configuration for the devtools shell. These configuration options are used to set the\n * initial state of the devtools when it is started for the first time. Afterwards,\n * the settings are persisted in local storage and changed through the settings panel.\n */\n config?: Partial<TanStackDevtoolsConfig>\n /**\n * Configuration for the TanStack Devtools client event bus.\n */\n eventBusConfig?: ClientEventBusConfig\n}\n\nexport default function SolidDevtoolsCore({\n config,\n plugins,\n eventBusConfig,\n}: TanStackDevtoolsInit) {\n const [devtools] = createSignal(\n new TanStackDevtoolsCore({\n config,\n eventBusConfig,\n plugins: plugins?.map((plugin) => ({\n ...plugin,\n name:\n typeof plugin.name === 'string'\n ? plugin.name\n : // The check above confirms that `plugin.name` is of Render type\n (el, theme) =>\n convertRender(el, plugin.name as SolidPluginRender, theme),\n render: (el: HTMLDivElement, theme: 'dark' | 'light') =>\n convertRender(el, plugin.render, theme),\n })),\n }),\n )\n let devToolRef: HTMLDivElement | undefined\n createEffect(() => {\n devtools().setConfig({ config })\n })\n onMount(() => {\n if (devToolRef) {\n devtools().mount(devToolRef)\n\n onCleanup(() => {\n devtools().unmount()\n })\n }\n })\n return <div style={{ position: 'absolute' }} ref={devToolRef} />\n}\n"],"names":["convertRender","el","Component","theme","_$createComponent","Portal","mount","children","SolidDevtoolsCore","config","plugins","eventBusConfig","devtools","createSignal","TanStackDevtoolsCore","map","plugin","name","render","devToolRef","createEffect","setConfig","onMount","onCleanup","unmount","_el$","_tmpl$","_ref$","_$use","style","setProperty"],"mappings":";;;;AAgBA,MAAMA,gBAAgBA,CACpBC,IACAC,WACAC,UAAuBC,gBAEtBC,QAAM;AAAA,EAACC,OAAOL;AAAAA,EAAE,IAAAM,WAAA;AAAA,WACd,OAAOL,cAAc,aAAaA,UAAUD,IAAIE,KAAK,IAAID;AAAAA,EAAS;AAAA,CAAA;AA+EvE,SAAwBM,kBAAkB;AAAA,EACxCC;AAAAA,EACAC;AAAAA,EACAC;AACoB,GAAG;AACvB,QAAM,CAACC,QAAQ,IAAIC,aACjB,IAAIC,qBAAqB;AAAA,IACvBL;AAAAA,IACAE;AAAAA,IACAD,SAASA,SAASK,IAAKC,CAAAA,YAAY;AAAA,MACjC,GAAGA;AAAAA,MACHC,MACE,OAAOD,OAAOC,SAAS,WACnBD,OAAOC;AAAAA;AAAAA,QAEP,CAAChB,IAAIE,UACHH,cAAcC,IAAIe,OAAOC,MAA2Bd,KAAK;AAAA;AAAA,MACjEe,QAAQA,CAACjB,IAAoBE,UAC3BH,cAAcC,IAAIe,OAAOE,QAAQf,KAAK;AAAA,IAAA,EACxC;AAAA,EAAA,CACH,CACH;AACA,MAAIgB;AACJC,eAAa,MAAM;AACjBR,aAAAA,EAAWS,UAAU;AAAA,MAAEZ;AAAAA,IAAAA,CAAQ;AAAA,EACjC,CAAC;AACDa,UAAQ,MAAM;AACZ,QAAIH,YAAY;AACdP,eAAAA,EAAWN,MAAMa,UAAU;AAE3BI,gBAAU,MAAM;AACdX,iBAAAA,EAAWY,QAAAA;AAAAA,MACb,CAAC;AAAA,IACH;AAAA,EACF,CAAC;AACD,UAAA,MAAA;AAAA,QAAAC,OAAAC,OAAAA;AAAA,QAAAC,QAAkDR;AAAU,WAAAQ,UAAA,aAAAC,IAAAD,OAAAF,IAAA,IAAVN,aAAUM;AAAAA,SAAAI,MAAAC,YAAA,YAAA,UAAA;AAAA,WAAAL;AAAAA,EAAA,GAAA;AAC9D;"}
1
+ {"version":3,"file":"core.js","sources":["../../src/core.tsx"],"sourcesContent":["import { TanStackDevtoolsCore } from '@tanstack/devtools'\nimport { createEffect, createSignal, onCleanup, onMount } from 'solid-js'\nimport { Portal } from 'solid-js/web'\nimport type { JSX } from 'solid-js'\nimport type {\n ClientEventBusConfig,\n TanStackDevtoolsConfig,\n TanStackDevtoolsPlugin,\n} from '@tanstack/devtools'\n\ntype SolidPluginRender =\n | JSX.Element\n | ((\n el: HTMLDivElement | HTMLHeadingElement,\n theme: 'dark' | 'light',\n ) => JSX.Element)\nconst convertRender = (\n el: HTMLDivElement | HTMLHeadingElement,\n Component: SolidPluginRender,\n theme: 'dark' | 'light',\n) => (\n <Portal mount={el}>\n {typeof Component === 'function' ? Component(el, theme) : Component}\n </Portal>\n)\n\nexport type TanStackDevtoolsSolidPlugin = Omit<\n TanStackDevtoolsPlugin,\n 'render' | 'name'\n> & {\n /**\n * The render function can be a SolidJS element or a function that returns a SolidJS element.\n * If it's a function, it will be called to render the plugin, otherwise it will be rendered directly.\n *\n * Example:\n * ```ts\n * {\n * render: () => <CustomPluginComponent />,\n * }\n * ```\n * or\n * ```ts\n * {\n * render: <CustomPluginComponent />,\n * }\n * ```\n */\n render: SolidPluginRender\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 * name: \"Your Plugin\",\n * render: () => <CustomPluginComponent />,\n * }\n * ```\n * or\n * ```ts\n * {\n * name: <h1>Your Plugin title</h1>,\n * render: () => <CustomPluginComponent />,\n * }\n * ```\n */\n name: string | SolidPluginRender\n}\nexport interface TanStackDevtoolsInit {\n /**\n * Array of plugins to be used in the devtools.\n * Each plugin should have a `render` function that returns a React element or a function\n *\n * Example:\n * ```jsx\n * <TanStackDevtools\n * plugins={[\n * {\n * id: \"your-plugin-id\",\n * name: \"Your Plugin\",\n * render: <CustomPluginComponent />,\n * }\n * ]}\n * />\n * ```\n */\n plugins?: Array<TanStackDevtoolsSolidPlugin>\n /**\n * Configuration for the devtools shell. These configuration options are used to set the\n * initial state of the devtools when it is started for the first time. Afterwards,\n * the settings are persisted in local storage and changed through the settings panel.\n */\n config?: Partial<TanStackDevtoolsConfig>\n /**\n * Configuration for the TanStack Devtools client event bus.\n */\n eventBusConfig?: ClientEventBusConfig\n}\n\nexport default function SolidDevtoolsCore({\n config,\n plugins,\n eventBusConfig,\n}: TanStackDevtoolsInit) {\n const [devtools] = createSignal(\n new TanStackDevtoolsCore({\n config,\n eventBusConfig,\n plugins: plugins?.map((plugin) => ({\n ...plugin,\n name:\n typeof plugin.name === 'string'\n ? plugin.name\n : // The check above confirms that `plugin.name` is of Render type\n (el, theme) =>\n convertRender(el, plugin.name as SolidPluginRender, theme),\n render: (el: HTMLDivElement, theme: 'dark' | 'light') =>\n convertRender(el, plugin.render, theme),\n })),\n }),\n )\n let devToolRef: HTMLDivElement | undefined\n createEffect(() => {\n devtools().setConfig({ config })\n })\n onMount(() => {\n if (devToolRef) {\n devtools().mount(devToolRef)\n\n onCleanup(() => {\n devtools().unmount()\n })\n }\n })\n return <div style={{ position: 'absolute' }} ref={devToolRef} />\n}\n"],"names":["convertRender","el","Component","theme","_$createComponent","Portal","mount","children","SolidDevtoolsCore","config","plugins","eventBusConfig","devtools","createSignal","TanStackDevtoolsCore","map","plugin","name","render","devToolRef","createEffect","setConfig","onMount","onCleanup","unmount","_el$","_tmpl$","_ref$","_$use","style","setProperty"],"mappings":";;;;AAgBA,MAAMA,gBAAgBA,CACpBC,IACAC,WACAC,UAAuBC,gBAEtBC,QAAM;AAAA,EAACC,OAAOL;AAAAA,EAAE,IAAAM,WAAA;AAAA,WACd,OAAOL,cAAc,aAAaA,UAAUD,IAAIE,KAAK,IAAID;AAAAA,EAAS;AAAA,CAAA;AA+EvE,SAAwBM,kBAAkB;AAAA,EACxCC;AAAAA,EACAC;AAAAA,EACAC;AACoB,GAAG;AACvB,QAAM,CAACC,QAAQ,IAAIC,aACjB,IAAIC,qBAAqB;AAAA,IACvBL;AAAAA,IACAE;AAAAA,IACAD,SAASA,SAASK,IAAKC,CAAAA,YAAY;AAAA,MACjC,GAAGA;AAAAA,MACHC,MACE,OAAOD,OAAOC,SAAS,WACnBD,OAAOC;AAAAA;AAAAA,SAEP,CAAChB,IAAIE,UACHH,cAAcC,IAAIe,OAAOC,MAA2Bd,KAAK;AAAA;AAAA,MACjEe,QAAQA,CAACjB,IAAoBE,UAC3BH,cAAcC,IAAIe,OAAOE,QAAQf,KAAK;AAAA,IAAA,EACxC;AAAA,EAAA,CACH,CACH;AACA,MAAIgB;AACJC,eAAa,MAAM;AACjBR,aAAAA,EAAWS,UAAU;AAAA,MAAEZ;AAAAA,IAAAA,CAAQ;AAAA,EACjC,CAAC;AACDa,UAAQ,MAAM;AACZ,QAAIH,YAAY;AACdP,eAAAA,EAAWN,MAAMa,UAAU;AAE3BI,gBAAU,MAAM;AACdX,iBAAAA,EAAWY,QAAAA;AAAAA,MACb,CAAC;AAAA,IACH;AAAA,EACF,CAAC;AACD,UAAA,MAAA;AAAA,QAAAC,OAAAC,OAAAA;AAAA,QAAAC,QAAkDR;AAAU,WAAAQ,UAAA,aAAAC,IAAAD,OAAAF,IAAA,IAAVN,aAAUM;AAAAA,SAAAI,MAAAC,YAAA,YAAA,UAAA;AAAA,WAAAL;AAAAA,EAAA,GAAA;AAC9D;"}
@@ -1,3 +1,2 @@
1
- import * as Devtools from './devtools.js';
2
- export declare const TanStackDevtools: (typeof Devtools)['TanStackDevtools'];
1
+ export { TanStackDevtools } from './devtools.js';
3
2
  export type { TanStackDevtoolsSolidPlugin } from './core.js';
package/dist/esm/index.js CHANGED
@@ -1,8 +1,4 @@
1
- import { isDev } from "solid-js/web";
2
- import { TanStackDevtools as TanStackDevtools$1 } from "./devtools.js";
3
- const TanStackDevtools = isDev ? TanStackDevtools$1 : function() {
4
- return null;
5
- };
1
+ import { TanStackDevtools } from "./devtools.js";
6
2
  export {
7
3
  TanStackDevtools
8
4
  };
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../src/index.ts"],"sourcesContent":["import { isDev } from 'solid-js/web'\nimport * as Devtools from './devtools'\n\nexport const TanStackDevtools: (typeof Devtools)['TanStackDevtools'] = isDev\n ? Devtools.TanStackDevtools\n : function () {\n return null\n }\n\nexport type { TanStackDevtoolsSolidPlugin } from './core'\n"],"names":["Devtools.TanStackDevtools"],"mappings":";;AAGO,MAAM,mBAA0D,QACnEA,qBACA,WAAY;AACV,SAAO;AACT;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tanstack/solid-devtools",
3
- "version": "0.6.10",
3
+ "version": "0.7.1",
4
4
  "description": "TanStack Devtools is a set of tools for building advanced devtools for your Solid application.",
5
5
  "author": "Tanner Linsley",
6
6
  "license": "MIT",
@@ -28,12 +28,6 @@
28
28
  "default": "./dist/esm/index.js"
29
29
  }
30
30
  },
31
- "./production": {
32
- "import": {
33
- "types": "./dist/esm/production.d.ts",
34
- "default": "./dist/esm/production.js"
35
- }
36
- },
37
31
  "./package.json": "./package.json"
38
32
  },
39
33
  "sideEffects": false,
@@ -45,11 +39,11 @@
45
39
  "src"
46
40
  ],
47
41
  "dependencies": {
48
- "@tanstack/devtools": "0.6.14"
42
+ "@tanstack/devtools": "0.6.15"
49
43
  },
50
44
  "devDependencies": {
51
- "solid-js": "^1.9.7",
52
- "vite-plugin-solid": "^2.11.6"
45
+ "solid-js": "^1.9.9",
46
+ "vite-plugin-solid": "^2.11.8"
53
47
  },
54
48
  "peerDependencies": {
55
49
  "solid-js": ">=1.9.7"
package/src/index.ts CHANGED
@@ -1,10 +1,3 @@
1
- import { isDev } from 'solid-js/web'
2
- import * as Devtools from './devtools'
3
-
4
- export const TanStackDevtools: (typeof Devtools)['TanStackDevtools'] = isDev
5
- ? Devtools.TanStackDevtools
6
- : function () {
7
- return null
8
- }
1
+ export { TanStackDevtools } from './devtools'
9
2
 
10
3
  export type { TanStackDevtoolsSolidPlugin } from './core'
@@ -1,3 +0,0 @@
1
- import * as Devtools from './devtools.js';
2
- export declare const TanStackDevtools: (typeof Devtools)['TanStackDevtools'];
3
- export type { TanStackDevtoolsSolidPlugin } from './core.js';
@@ -1,6 +0,0 @@
1
- import { TanStackDevtools as TanStackDevtools$1 } from "./devtools.js";
2
- const TanStackDevtools = TanStackDevtools$1;
3
- export {
4
- TanStackDevtools
5
- };
6
- //# sourceMappingURL=production.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"production.js","sources":["../../src/production.ts"],"sourcesContent":["import * as Devtools from './devtools'\n\nexport const TanStackDevtools: (typeof Devtools)['TanStackDevtools'] =\n Devtools.TanStackDevtools\n\nexport type { TanStackDevtoolsSolidPlugin } from './core'\n"],"names":["Devtools.TanStackDevtools"],"mappings":";AAEO,MAAM,mBACXA;"}
package/src/production.ts DELETED
@@ -1,6 +0,0 @@
1
- import * as Devtools from './devtools'
2
-
3
- export const TanStackDevtools: (typeof Devtools)['TanStackDevtools'] =
4
- Devtools.TanStackDevtools
5
-
6
- export type { TanStackDevtoolsSolidPlugin } from './core'