@tanstack/devtools 0.6.19 → 0.6.21

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.
@@ -238,6 +238,21 @@ var getExistingStateFromStorage = (config, plugins) => {
238
238
  };
239
239
  var DevtoolsProvider = (props) => {
240
240
  const [store, setStore] = createStore(getExistingStateFromStorage(props.config, props.plugins));
241
+ const updatePlugins = (newPlugins) => {
242
+ const pluginsWithIds = newPlugins.map((plugin, i) => {
243
+ const id = generatePluginId(plugin, i);
244
+ return {
245
+ ...plugin,
246
+ id
247
+ };
248
+ });
249
+ setStore("plugins", pluginsWithIds);
250
+ };
251
+ createEffect(() => {
252
+ if (props.onSetPlugins) {
253
+ props.onSetPlugins(updatePlugins);
254
+ }
255
+ });
241
256
  const value = {
242
257
  store,
243
258
  setStore: (updater) => {
package/dist/dev.js CHANGED
@@ -1,5 +1,5 @@
1
- import { initialState, DevtoolsProvider, PiPProvider } from './chunk/XFQ6P775.js';
2
- export { PLUGIN_CONTAINER_ID, PLUGIN_TITLE_CONTAINER_ID } from './chunk/XFQ6P775.js';
1
+ import { initialState, DevtoolsProvider, PiPProvider } from './chunk/XF4JFOLU.js';
2
+ export { PLUGIN_CONTAINER_ID, PLUGIN_TITLE_CONTAINER_ID } from './chunk/XF4JFOLU.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';
@@ -14,6 +14,7 @@ var TanStackDevtoolsCore = class {
14
14
  #Component;
15
15
  #eventBus;
16
16
  #eventBusConfig;
17
+ #setPlugins;
17
18
  constructor(init) {
18
19
  this.#plugins = init.plugins || [];
19
20
  this.#eventBusConfig = init.eventBusConfig;
@@ -29,7 +30,7 @@ var TanStackDevtoolsCore = class {
29
30
  const mountTo = el;
30
31
  const dispose = render(() => {
31
32
  const _self$ = this;
32
- this.#Component = lazy(() => import('./devtools/3YT62TLF.js'));
33
+ this.#Component = lazy(() => import('./devtools/YRFZDV5N.js'));
33
34
  const Devtools = this.#Component;
34
35
  this.#eventBus = new ClientEventBus(this.#eventBusConfig);
35
36
  this.#eventBus.start();
@@ -40,6 +41,9 @@ var TanStackDevtoolsCore = class {
40
41
  get config() {
41
42
  return _self$.#config;
42
43
  },
44
+ onSetPlugins: (setPlugins) => {
45
+ _self$.#setPlugins = setPlugins;
46
+ },
43
47
  get children() {
44
48
  return createComponent(PiPProvider, {
45
49
  get children() {
@@ -70,6 +74,12 @@ var TanStackDevtoolsCore = class {
70
74
  ...this.#config,
71
75
  ...config
72
76
  };
77
+ if (config.plugins) {
78
+ this.#plugins = config.plugins;
79
+ if (this.#isMounted && this.#setPlugins) {
80
+ this.#setPlugins(config.plugins);
81
+ }
82
+ }
73
83
  }
74
84
  };
75
85