@tanstack/query-devtools 5.105.3 → 5.106.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.
Files changed (50) hide show
  1. package/build/Devtools-75tXP6g3.cjs +1269 -0
  2. package/build/Devtools-DJ2H9xNC.js +1270 -0
  3. package/build/Devtools-DJ2H9xNC.js.map +1 -0
  4. package/build/{Devtools-DICxXjAp.js → Devtools-rtsOXx72.js} +6164 -3805
  5. package/build/{Devtools-2V_Pd-w1.cjs → Devtools-v4_2Fgnd.cjs} +6152 -3787
  6. package/build/DevtoolsComponent-BhxzD0Z_.cjs +2 -0
  7. package/build/{DevtoolsComponent-BAslf3AU.cjs → DevtoolsComponent-D-GGWO6D.cjs} +11 -5
  8. package/build/{DevtoolsComponent-CLOdqERu.js → DevtoolsComponent-DjX8H_OS.js} +11 -5
  9. package/build/DevtoolsComponent-Y_UD6BDS.js +3 -0
  10. package/build/DevtoolsComponent-Y_UD6BDS.js.map +1 -0
  11. package/build/{DevtoolsPanelComponent-BZiLbaMl.js → DevtoolsPanelComponent-BryTHuft.js} +18 -12
  12. package/build/{DevtoolsPanelComponent-BIzP-MqF.cjs → DevtoolsPanelComponent-BtyHS22R.cjs} +18 -12
  13. package/build/DevtoolsPanelComponent-azgDvAlF.js +3 -0
  14. package/build/DevtoolsPanelComponent-azgDvAlF.js.map +1 -0
  15. package/build/DevtoolsPanelComponent-ecGfyOWI.cjs +2 -0
  16. package/build/dev.cjs +4 -3
  17. package/build/dev.js +4 -3
  18. package/build/index.cjs +2 -1
  19. package/build/index.d.cts +1 -0
  20. package/build/index.d.cts.map +1 -1
  21. package/build/index.d.ts +1 -0
  22. package/build/index.d.ts.map +1 -1
  23. package/build/index.js +2 -1
  24. package/build/index.js.map +1 -1
  25. package/build/{utils-CiEaQT28.cjs → utils-CzP8C7c0.cjs} +170 -51
  26. package/build/{utils-CsIEjnKb.js → utils-D7iZi04l.js} +147 -52
  27. package/build/utils-DC2pN79q.js +3 -0
  28. package/build/utils-DC2pN79q.js.map +1 -0
  29. package/build/utils-DJl-N7L2.cjs +2 -0
  30. package/package.json +4 -3
  31. package/src/Devtools.tsx +82 -165
  32. package/src/DevtoolsComponent.tsx +7 -4
  33. package/src/DevtoolsPanelComponent.tsx +11 -8
  34. package/src/Explorer.tsx +349 -28
  35. package/src/VirtualList.tsx +105 -0
  36. package/src/explorerSearch.ts +159 -0
  37. package/src/nativeObjectType.ts +70 -0
  38. package/src/utils.tsx +74 -34
  39. package/build/Devtools-CD2ZvU1I.js +0 -1238
  40. package/build/Devtools-CD2ZvU1I.js.map +0 -1
  41. package/build/Devtools-DDcV5oIp.cjs +0 -1237
  42. package/build/DevtoolsComponent-D1MmpObN.js +0 -2
  43. package/build/DevtoolsComponent-D1MmpObN.js.map +0 -1
  44. package/build/DevtoolsComponent-zpIDe7Wu.cjs +0 -1
  45. package/build/DevtoolsPanelComponent-CRFy_L77.js +0 -2
  46. package/build/DevtoolsPanelComponent-CRFy_L77.js.map +0 -1
  47. package/build/DevtoolsPanelComponent-DJuL4CDS.cjs +0 -1
  48. package/build/utils-CpoIvKO8.cjs +0 -1
  49. package/build/utils-LNrmpo6y.js +0 -2
  50. package/build/utils-LNrmpo6y.js.map +0 -1
@@ -1,4 +1,5 @@
1
- // ../../node_modules/.pnpm/solid-js@1.9.15/node_modules/solid-js/dist/solid.js
1
+ /* @refresh skip */
2
+ // ../../node_modules/.pnpm/solid-js@1.9.18/node_modules/solid-js/dist/solid.js
2
3
  const sharedConfig = {
3
4
  context: void 0,
4
5
  registry: void 0,
@@ -45,7 +46,7 @@ function createRoot(fn, detachedOwner) {
45
46
  cleanups: null,
46
47
  context: current ? current.context : null,
47
48
  owner: current
48
- }, updateFn = unowned ? fn : () => fn(() => untrack(() => cleanNode(root)));
49
+ }, updateFn = unowned ? fn : () => fn(createDisposer(root));
49
50
  Owner = root;
50
51
  Listener = null;
51
52
  try {
@@ -55,6 +56,9 @@ function createRoot(fn, detachedOwner) {
55
56
  Owner = owner;
56
57
  }
57
58
  }
59
+ function createDisposer(root) {
60
+ return () => untrack(() => cleanNode(root));
61
+ }
58
62
  function createSignal(value, options) {
59
63
  options = options ? Object.assign({}, signalOptions, options) : signalOptions;
60
64
  const s = {
@@ -269,6 +273,9 @@ function onCleanup(fn) {
269
273
  else Owner.cleanups.push(fn);
270
274
  return fn;
271
275
  }
276
+ function getListener() {
277
+ return Listener;
278
+ }
272
279
  function getOwner() {
273
280
  return Owner;
274
281
  }
@@ -1007,7 +1014,9 @@ function lazy(fn) {
1007
1014
  } else if (!comp) {
1008
1015
  const [s] = createResource(() => load().then((mod) => mod.default));
1009
1016
  comp = s;
1010
- onCleanup(() => comp = void 0);
1017
+ onCleanup(() => {
1018
+ if (comp === s) comp = void 0;
1019
+ });
1011
1020
  }
1012
1021
  let Comp;
1013
1022
  return createMemo(() => (Comp = comp?.()) ? untrack(() => {
@@ -1085,7 +1094,7 @@ function Switch(props) {
1085
1094
  function Match(props) {
1086
1095
  return props;
1087
1096
  }
1088
- // ../../node_modules/.pnpm/solid-js@1.9.15/node_modules/solid-js/web/dist/web.js
1097
+ // ../../node_modules/.pnpm/solid-js@1.9.18/node_modules/solid-js/web/dist/web.js
1089
1098
  const Properties = /*#__PURE__*/ new Set([
1090
1099
  "className",
1091
1100
  "value",
@@ -1412,7 +1421,7 @@ function render(code, element, init, options = {}) {
1412
1421
  let disposer;
1413
1422
  createRoot((dispose) => {
1414
1423
  disposer = dispose;
1415
- element === document ? code() : insert(element, code(), element.firstChild ? null : void 0, init);
1424
+ element === document ? code() : insert(element, code(), !init && element.firstChild ? null : void 0, init);
1416
1425
  }, options.owner);
1417
1426
  return () => {
1418
1427
  disposer();
@@ -1640,21 +1649,25 @@ function eventHandler(e) {
1640
1649
  }
1641
1650
  });
1642
1651
  if (sharedConfig.registry && !sharedConfig.done) sharedConfig.done = _$HY.done = true;
1643
- if (e.composedPath) {
1644
- const path = e.composedPath();
1645
- retarget(path[0]);
1646
- for (let i = 0; i < path.length - 2; i++) {
1647
- node = path[i];
1648
- if (!handleNode()) break;
1649
- if (node._$host) {
1650
- node = node._$host;
1651
- walkUpTree();
1652
- break;
1652
+ try {
1653
+ if (e.composedPath) {
1654
+ const path = e.composedPath();
1655
+ retarget(path[0]);
1656
+ for (let i = 0; i < path.length - 2; i++) {
1657
+ node = path[i];
1658
+ if (!handleNode()) break;
1659
+ if (node._$host) {
1660
+ node = node._$host;
1661
+ walkUpTree();
1662
+ break;
1663
+ }
1664
+ if (node.parentNode === oriCurrentTarget) break;
1653
1665
  }
1654
- if (node.parentNode === oriCurrentTarget) break;
1655
- }
1656
- } else walkUpTree();
1657
- retarget(oriTarget);
1666
+ } else walkUpTree();
1667
+ retarget(oriTarget);
1668
+ } finally {
1669
+ e = node = null;
1670
+ }
1658
1671
  }
1659
1672
  function insertExpression(parent, value, current, marker, unwrapArray) {
1660
1673
  const hydrating = isHydrating(parent);
@@ -1934,13 +1947,13 @@ var CustomTransformerRegistry = class {
1934
1947
  const getType$1 = (payload) => Object.prototype.toString.call(payload).slice(8, -1);
1935
1948
  const isUndefined = (payload) => typeof payload === "undefined";
1936
1949
  const isNull = (payload) => payload === null;
1937
- const isPlainObject$1 = (payload) => {
1950
+ const isPlainObject$2 = (payload) => {
1938
1951
  if (typeof payload !== "object" || payload === null) return false;
1939
1952
  if (payload === Object.prototype) return false;
1940
1953
  if (Object.getPrototypeOf(payload) === null) return true;
1941
1954
  return Object.getPrototypeOf(payload) === Object.prototype;
1942
1955
  };
1943
- const isEmptyObject = (payload) => isPlainObject$1(payload) && Object.keys(payload).length === 0;
1956
+ const isEmptyObject = (payload) => isPlainObject$2(payload) && Object.keys(payload).length === 0;
1944
1957
  const isArray$1 = (payload) => Array.isArray(payload);
1945
1958
  const isString = (payload) => typeof payload === "string";
1946
1959
  const isNumber = (payload) => typeof payload === "number" && !isNaN(payload);
@@ -2188,7 +2201,7 @@ const setDeep = (object, path, mapper) => {
2188
2201
  if (isArray$1(parent)) {
2189
2202
  const index = +key;
2190
2203
  parent = parent[index];
2191
- } else if (isPlainObject$1(parent)) parent = parent[key];
2204
+ } else if (isPlainObject$2(parent)) parent = parent[key];
2192
2205
  else if (isSet(parent)) {
2193
2206
  const row = +key;
2194
2207
  parent = getNthKey(parent, row);
@@ -2207,7 +2220,7 @@ const setDeep = (object, path, mapper) => {
2207
2220
  }
2208
2221
  const lastKey = path[path.length - 1];
2209
2222
  if (isArray$1(parent)) parent[+lastKey] = mapper(parent[+lastKey]);
2210
- else if (isPlainObject$1(parent)) parent[lastKey] = mapper(parent[lastKey]);
2223
+ else if (isPlainObject$2(parent)) parent[lastKey] = mapper(parent[lastKey]);
2211
2224
  if (isSet(parent)) {
2212
2225
  const oldValue = getNthKey(parent, +lastKey);
2213
2226
  const newValue = mapper(oldValue);
@@ -2269,7 +2282,7 @@ function applyReferentialEqualityAnnotations(plain, annotations, version) {
2269
2282
  } else forEach(annotations, apply);
2270
2283
  return plain;
2271
2284
  }
2272
- const isDeep = (object, superJson) => isPlainObject$1(object) || isArray$1(object) || isMap(object) || isSet(object) || isError(object) || isInstanceOfRegisteredClass(object, superJson);
2285
+ const isDeep = (object, superJson) => isPlainObject$2(object) || isArray$1(object) || isMap(object) || isSet(object) || isError(object) || isInstanceOfRegisteredClass(object, superJson);
2273
2286
  function addIdentity(object, path, identities) {
2274
2287
  const existingSet = identities.get(object);
2275
2288
  if (existingSet) existingSet.push(path);
@@ -2316,7 +2329,7 @@ const walker = (object, identities, superJson, dedupe, path = [], objectsInThisP
2316
2329
  const recursiveResult = walker(value, identities, superJson, dedupe, [...path, index], [...objectsInThisPath, object], seenObjects);
2317
2330
  transformedValue[index] = recursiveResult.transformedValue;
2318
2331
  if (isArray$1(recursiveResult.annotations)) innerAnnotations[escapeKey(index)] = recursiveResult.annotations;
2319
- else if (isPlainObject$1(recursiveResult.annotations)) forEach(recursiveResult.annotations, (tree, key) => {
2332
+ else if (isPlainObject$2(recursiveResult.annotations)) forEach(recursiveResult.annotations, (tree, key) => {
2320
2333
  innerAnnotations[escapeKey(index) + "." + key] = tree;
2321
2334
  });
2322
2335
  });
@@ -2345,7 +2358,7 @@ function isArray(payload) {
2345
2358
  * Returns whether the payload is a plain JavaScript object (excluding special classes or objects
2346
2359
  * with other prototypes)
2347
2360
  */
2348
- function isPlainObject(payload) {
2361
+ function isPlainObject$1(payload) {
2349
2362
  if (getType(payload) !== "Object") return false;
2350
2363
  const prototype = Object.getPrototypeOf(payload);
2351
2364
  return !!prototype && prototype.constructor === Object && prototype === Object.prototype;
@@ -2377,7 +2390,7 @@ function assignProp(carry, key, newVal, originalObject, includeNonenumerable) {
2377
2390
  */
2378
2391
  function copy(target, options = {}) {
2379
2392
  if (isArray(target)) return target.map((item) => copy(item, options));
2380
- if (!isPlainObject(target)) return target;
2393
+ if (!isPlainObject$1(target)) return target;
2381
2394
  const props = Object.getOwnPropertyNames(target);
2382
2395
  const symbols = Object.getOwnPropertySymbols(target);
2383
2396
  return [...props, ...symbols].reduce((carry, key) => {
@@ -2462,6 +2475,59 @@ SuperJSON.registerClass;
2462
2475
  SuperJSON.registerCustom;
2463
2476
  SuperJSON.registerSymbol;
2464
2477
  SuperJSON.allowErrorProps;
2478
+ // src/nativeObjectType.ts
2479
+ /**
2480
+ * Checks an object's internal slots with an intrinsic operation.
2481
+ * @param value - The inspected object.
2482
+ * @param type - The native brand to check.
2483
+ * @returns Whether the intrinsic operation accepts the object.
2484
+ */
2485
+ function hasNativeBrand(value, type) {
2486
+ try {
2487
+ switch (type) {
2488
+ case "Map":
2489
+ Map.prototype.has.call(value, void 0);
2490
+ return true;
2491
+ case "Set":
2492
+ Set.prototype.has.call(value, void 0);
2493
+ return true;
2494
+ case "String":
2495
+ String.prototype.valueOf.call(value);
2496
+ return true;
2497
+ }
2498
+ } catch {
2499
+ return false;
2500
+ }
2501
+ }
2502
+ /**
2503
+ * Identifies native collections and String wrappers across realms without reading accessors.
2504
+ * @param value - The inspected value.
2505
+ * @returns Its native brand, or undefined for other values and failed inspections.
2506
+ */
2507
+ function getNativeObjectType(value) {
2508
+ if (value === null || typeof value !== "object") return void 0;
2509
+ try {
2510
+ if (Array.isArray(value) || ArrayBuffer.isView(value)) return void 0;
2511
+ const length = Object.getOwnPropertyDescriptor(value, "length");
2512
+ if (typeof length?.value === "number" && !length.enumerable && !length.writable && !length.configurable && hasNativeBrand(value, "String")) return "String";
2513
+ const parent = Object.getPrototypeOf(value);
2514
+ if (parent === null) {
2515
+ if (hasNativeBrand(value, "Map")) return "Map";
2516
+ if (hasNativeBrand(value, "Set")) return "Set";
2517
+ return;
2518
+ }
2519
+ if (parent === Object.prototype) return void 0;
2520
+ let prototype = value;
2521
+ for (let depth = 0; prototype && depth <= 500; depth++) {
2522
+ const tag = Object.getOwnPropertyDescriptor(prototype, Symbol.toStringTag)?.value;
2523
+ if ((tag === "Map" || tag === "Set") && hasNativeBrand(value, tag)) return tag;
2524
+ prototype = Object.getPrototypeOf(prototype);
2525
+ }
2526
+ return;
2527
+ } catch {
2528
+ return;
2529
+ }
2530
+ }
2465
2531
  // src/utils.tsx
2466
2532
  /**
2467
2533
  * Returns the status label of a query: fetching, inactive (no observers), paused, stale, or fresh,
@@ -2569,6 +2635,22 @@ const getPreferredColorScheme = () => {
2569
2635
  return colorScheme;
2570
2636
  };
2571
2637
  /**
2638
+ * Checks whether a value is a plain object without invoking accessors, including across realms.
2639
+ * @param value - The data to inspect.
2640
+ * @returns Whether the value can be copied as a record.
2641
+ */
2642
+ function isPlainObject(value) {
2643
+ if (value === null || typeof value !== "object") return false;
2644
+ try {
2645
+ const prototype = Object.getPrototypeOf(value);
2646
+ if (prototype === null) return true;
2647
+ const constructor = Object.getOwnPropertyDescriptor(prototype, "constructor")?.value;
2648
+ return typeof constructor === "function" && Object.getOwnPropertyDescriptor(constructor, "prototype")?.value === prototype && Function.prototype.toString.call(constructor) === Function.prototype.toString.call(Object);
2649
+ } catch {
2650
+ return false;
2651
+ }
2652
+ }
2653
+ /**
2572
2654
  * Updates nested data by path.
2573
2655
  * @param oldData - Data to be updated
2574
2656
  * @param updatePath - Path to the data to be updated
@@ -2577,8 +2659,9 @@ const getPreferredColorScheme = () => {
2577
2659
  */
2578
2660
  const updateNestedDataByPath = (oldData, updatePath, value) => {
2579
2661
  if (updatePath.length === 0) return value;
2580
- if (oldData instanceof Map) {
2581
- const newData = new Map(oldData);
2662
+ const type = getNativeObjectType(oldData);
2663
+ if (type === "Map") {
2664
+ const newData = new Map(Map.prototype.entries.call(oldData));
2582
2665
  if (updatePath.length === 1) {
2583
2666
  newData.set(updatePath[0], value);
2584
2667
  return newData;
@@ -2587,8 +2670,8 @@ const updateNestedDataByPath = (oldData, updatePath, value) => {
2587
2670
  newData.set(head, updateNestedDataByPath(newData.get(head), tail, value));
2588
2671
  return newData;
2589
2672
  }
2590
- if (oldData instanceof Set) {
2591
- const setAsArray = updateNestedDataByPath(Array.from(oldData), updatePath, value);
2673
+ if (type === "Set") {
2674
+ const setAsArray = updateNestedDataByPath(Array.from(Set.prototype.values.call(oldData)), updatePath, value);
2592
2675
  return new Set(setAsArray);
2593
2676
  }
2594
2677
  if (Array.isArray(oldData)) {
@@ -2601,15 +2684,21 @@ const updateNestedDataByPath = (oldData, updatePath, value) => {
2601
2684
  newData[head] = updateNestedDataByPath(newData[head], tail, value);
2602
2685
  return newData;
2603
2686
  }
2604
- if (oldData instanceof Object) {
2605
- const newData = { ...oldData };
2606
- if (updatePath.length === 1) {
2607
- newData[updatePath[0]] = value;
2608
- return newData;
2609
- }
2687
+ if (isPlainObject(oldData)) {
2688
+ const descriptors = Object.getOwnPropertyDescriptors(oldData);
2610
2689
  const [head, ...tail] = updatePath;
2611
- newData[head] = updateNestedDataByPath(newData[head], tail, value);
2612
- return newData;
2690
+ if (head === void 0) return oldData;
2691
+ const previous = Object.getOwnPropertyDescriptor(oldData, head);
2692
+ if (tail.length && (!previous || !("value" in previous))) return oldData;
2693
+ return Object.create(Object.getPrototypeOf(oldData), {
2694
+ ...descriptors,
2695
+ [head]: {
2696
+ value: tail.length ? updateNestedDataByPath(previous?.value, tail, value) : value,
2697
+ enumerable: previous?.enumerable ?? true,
2698
+ configurable: true,
2699
+ writable: true
2700
+ }
2701
+ });
2613
2702
  }
2614
2703
  return oldData;
2615
2704
  };
@@ -2620,8 +2709,9 @@ const updateNestedDataByPath = (oldData, updatePath, value) => {
2620
2709
  * @returns newData without the deleted items by path
2621
2710
  */
2622
2711
  const deleteNestedDataByPath = (oldData, deletePath) => {
2623
- if (oldData instanceof Map) {
2624
- const newData = new Map(oldData);
2712
+ const type = getNativeObjectType(oldData);
2713
+ if (type === "Map") {
2714
+ const newData = new Map(Map.prototype.entries.call(oldData));
2625
2715
  if (deletePath.length === 1) {
2626
2716
  newData.delete(deletePath[0]);
2627
2717
  return newData;
@@ -2630,8 +2720,8 @@ const deleteNestedDataByPath = (oldData, deletePath) => {
2630
2720
  newData.set(head, deleteNestedDataByPath(newData.get(head), tail));
2631
2721
  return newData;
2632
2722
  }
2633
- if (oldData instanceof Set) {
2634
- const setAsArray = deleteNestedDataByPath(Array.from(oldData), deletePath);
2723
+ if (type === "Set") {
2724
+ const setAsArray = deleteNestedDataByPath(Array.from(Set.prototype.values.call(oldData)), deletePath);
2635
2725
  return new Set(setAsArray);
2636
2726
  }
2637
2727
  if (Array.isArray(oldData)) {
@@ -2641,15 +2731,20 @@ const deleteNestedDataByPath = (oldData, deletePath) => {
2641
2731
  newData[head] = deleteNestedDataByPath(newData[head], tail);
2642
2732
  return newData;
2643
2733
  }
2644
- if (oldData instanceof Object) {
2645
- const newData = { ...oldData };
2646
- if (deletePath.length === 1) {
2647
- delete newData[deletePath[0]];
2648
- return newData;
2649
- }
2734
+ if (isPlainObject(oldData)) {
2735
+ const descriptors = Object.getOwnPropertyDescriptors(oldData);
2650
2736
  const [head, ...tail] = deletePath;
2651
- newData[head] = deleteNestedDataByPath(newData[head], tail);
2652
- return newData;
2737
+ if (head === void 0) return oldData;
2738
+ if (tail.length === 0) delete descriptors[head];
2739
+ else {
2740
+ const previous = Object.getOwnPropertyDescriptor(oldData, head);
2741
+ if (!previous || !("value" in previous)) return oldData;
2742
+ descriptors[head] = {
2743
+ ...previous,
2744
+ value: deleteNestedDataByPath(previous.value, tail)
2745
+ };
2746
+ }
2747
+ return Object.create(Object.getPrototypeOf(oldData), descriptors);
2653
2748
  }
2654
2749
  return oldData;
2655
2750
  };
@@ -2671,6 +2766,12 @@ const setupStyleSheet = (nonce, target) => {
2671
2766
  styleTag.setAttribute("nonce", nonce);
2672
2767
  root.appendChild(styleTag);
2673
2768
  };
2769
+ Object.defineProperty(exports, "$PROXY", {
2770
+ enumerable: true,
2771
+ get: function() {
2772
+ return $PROXY;
2773
+ }
2774
+ });
2674
2775
  Object.defineProperty(exports, "$TRACK", {
2675
2776
  enumerable: true,
2676
2777
  get: function() {
@@ -2821,12 +2922,24 @@ Object.defineProperty(exports, "displayValue", {
2821
2922
  return displayValue;
2822
2923
  }
2823
2924
  });
2925
+ Object.defineProperty(exports, "getListener", {
2926
+ enumerable: true,
2927
+ get: function() {
2928
+ return getListener;
2929
+ }
2930
+ });
2824
2931
  Object.defineProperty(exports, "getMutationStatusColor", {
2825
2932
  enumerable: true,
2826
2933
  get: function() {
2827
2934
  return getMutationStatusColor;
2828
2935
  }
2829
2936
  });
2937
+ Object.defineProperty(exports, "getNativeObjectType", {
2938
+ enumerable: true,
2939
+ get: function() {
2940
+ return getNativeObjectType;
2941
+ }
2942
+ });
2830
2943
  Object.defineProperty(exports, "getOwner", {
2831
2944
  enumerable: true,
2832
2945
  get: function() {
@@ -2869,6 +2982,12 @@ Object.defineProperty(exports, "insert", {
2869
2982
  return insert;
2870
2983
  }
2871
2984
  });
2985
+ Object.defineProperty(exports, "isPlainObject", {
2986
+ enumerable: true,
2987
+ get: function() {
2988
+ return isPlainObject;
2989
+ }
2990
+ });
2872
2991
  Object.defineProperty(exports, "lazy", {
2873
2992
  enumerable: true,
2874
2993
  get: function() {