@deepseek-ai/dsh-experimental-session-inspector 0.2.1-alpha.1 → 0.2.1-alpha.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.
Files changed (2) hide show
  1. package/lib/client.js +15 -7
  2. package/package.json +16 -16
package/lib/client.js CHANGED
@@ -2133,7 +2133,7 @@ window.__ModuleLoader__.load({
2133
2133
  };
2134
2134
  }
2135
2135
  //#endregion
2136
- //#region ../../../node_modules/.pnpm/@tanstack+virtual-core@3.17.7/node_modules/@tanstack/virtual-core/dist/esm/lazy-measurements.js
2136
+ //#region ../../../node_modules/.pnpm/@tanstack+virtual-core@3.17.8/node_modules/@tanstack/virtual-core/dist/esm/lazy-measurements.js
2137
2137
  function createLazyMeasurementsView(count, flat, getItemKey) {
2138
2138
  const cache = new Array(count);
2139
2139
  return new Proxy(cache, { get(target, prop, receiver) {
@@ -2163,7 +2163,7 @@ window.__ModuleLoader__.load({
2163
2163
  } });
2164
2164
  }
2165
2165
  //#endregion
2166
- //#region ../../../node_modules/.pnpm/@tanstack+virtual-core@3.17.7/node_modules/@tanstack/virtual-core/dist/esm/utils.js
2166
+ //#region ../../../node_modules/.pnpm/@tanstack+virtual-core@3.17.8/node_modules/@tanstack/virtual-core/dist/esm/utils.js
2167
2167
  function memo$1(getDeps, fn, opts) {
2168
2168
  let deps = opts.initialDeps ?? [];
2169
2169
  let result;
@@ -2189,13 +2189,15 @@ window.__ModuleLoader__.load({
2189
2189
  const approxEqual = (a, b) => Math.abs(a - b) < 1.01;
2190
2190
  const debounce = (targetWindow, fn, ms) => {
2191
2191
  let timeoutId;
2192
- return function(...args) {
2192
+ return Object.assign(function(...args) {
2193
2193
  targetWindow.clearTimeout(timeoutId);
2194
2194
  timeoutId = targetWindow.setTimeout(() => fn.apply(this, args), ms);
2195
- };
2195
+ }, { cancel: () => {
2196
+ targetWindow.clearTimeout(timeoutId);
2197
+ } });
2196
2198
  };
2197
2199
  //#endregion
2198
- //#region ../../../node_modules/.pnpm/@tanstack+virtual-core@3.17.7/node_modules/@tanstack/virtual-core/dist/esm/index.js
2200
+ //#region ../../../node_modules/.pnpm/@tanstack+virtual-core@3.17.8/node_modules/@tanstack/virtual-core/dist/esm/index.js
2199
2201
  let _isIOSResult;
2200
2202
  const isIOSWebKit = () => {
2201
2203
  if (_isIOSResult !== void 0) return _isIOSResult;
@@ -2277,6 +2279,7 @@ window.__ModuleLoader__.load({
2277
2279
  return () => {
2278
2280
  element.removeEventListener("scroll", handler);
2279
2281
  if (registerScrollendEvent) element.removeEventListener("scrollend", endHandler);
2282
+ fallback?.cancel();
2280
2283
  };
2281
2284
  };
2282
2285
  const observeElementOffset = (instance, cb) => observeOffset(instance, cb, (el) => {
@@ -2358,6 +2361,7 @@ window.__ModuleLoader__.load({
2358
2361
  }
2359
2362
  return;
2360
2363
  }
2364
+ if (!this.isIndexInRange(index)) return;
2361
2365
  if (this.shouldMeasureDuringScroll(index)) this.resizeItem(index, this.options.measureElement(node, entry, this));
2362
2366
  };
2363
2367
  this.options.useAnimationFrameWithResizeObserver ? requestAnimationFrame(run) : run();
@@ -2501,6 +2505,8 @@ window.__ModuleLoader__.load({
2501
2505
  this.rafId = null;
2502
2506
  }
2503
2507
  this.scrollState = null;
2508
+ this.isScrolling = false;
2509
+ this.scrollDirection = null;
2504
2510
  this._iosDeferredAdjustment = 0;
2505
2511
  this._iosTouching = false;
2506
2512
  this._iosJustTouchEnded = false;
@@ -2653,6 +2659,7 @@ window.__ModuleLoader__.load({
2653
2659
  gap
2654
2660
  };
2655
2661
  }, { key: false });
2662
+ this.isIndexInRange = (index) => index >= 0 && index < this.options.count;
2656
2663
  this.getMeasurements = memo$1(() => [this.getMeasurementOptions(), this.itemSizeCacheVersion], ({ count, paddingStart, scrollMargin, getItemKey, enabled, lanes, laneAssignmentMode, gap }, _itemSizeCacheVersion) => {
2657
2664
  const itemSizeCache = this.itemSizeCache;
2658
2665
  if (!enabled) {
@@ -2851,6 +2858,7 @@ window.__ModuleLoader__.load({
2851
2858
  return;
2852
2859
  }
2853
2860
  const index = this.indexFromElement(node);
2861
+ if (!this.isIndexInRange(index)) return;
2854
2862
  const key = this.options.getItemKey(index);
2855
2863
  const prevNode = this.elementsCache.get(key);
2856
2864
  if (prevNode !== node) {
@@ -2862,7 +2870,7 @@ window.__ModuleLoader__.load({
2862
2870
  };
2863
2871
  this.resizeItem = (index, size) => {
2864
2872
  var _a, _b;
2865
- if (index < 0 || index >= this.options.count) return;
2873
+ if (!this.isIndexInRange(index)) return;
2866
2874
  let cachedSize;
2867
2875
  let itemStart;
2868
2876
  let key;
@@ -3209,7 +3217,7 @@ window.__ModuleLoader__.load({
3209
3217
  };
3210
3218
  }
3211
3219
  //#endregion
3212
- //#region ../../../node_modules/.pnpm/@tanstack+react-virtual@3.14.9_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@tanstack/react-virtual/dist/esm/index.js
3220
+ //#region ../../../node_modules/.pnpm/@tanstack+react-virtual@3.14.10_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@tanstack/react-virtual/dist/esm/index.js
3213
3221
  const useIsomorphicLayoutEffect = typeof document !== "undefined" ? react.useLayoutEffect : react.useEffect;
3214
3222
  function useVirtualizerBase({ useFlushSync = true, directDomUpdates = false, directDomUpdatesMode = "transform", ...options }) {
3215
3223
  const rerender = react.useReducer((x) => x + 1, 0)[1];
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@deepseek-ai/dsh-experimental-session-inspector",
3
3
  "description": "Experimental virtualized Session log and live Chat group/node inspectors",
4
- "version": "0.2.1-alpha.1",
4
+ "version": "0.2.1-alpha.2",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -49,26 +49,26 @@
49
49
  "@deepseek-ai/cordis": "~4.0.5-alpha.1"
50
50
  },
51
51
  "devDependencies": {
52
- "@testing-library/react": "^16.1.0",
52
+ "@deepseek-ai/dsh-client-test-runtime": "0.2.1-alpha.2",
53
+ "@testing-library/react": "^16.3.3",
53
54
  "@types/react-dom": "~18.3.0",
54
55
  "react-dom": "^18.2.0",
55
- "@tanstack/react-virtual": "^3.14.9",
56
+ "@deepseek-ai/dsh-api-session-controller": "0.2.1-alpha.2",
57
+ "@deepseek-ai/dsh-client-store": "0.2.1-alpha.2",
58
+ "@deepseek-ai/dsh-client-ui-chat": "0.2.1-alpha.2",
59
+ "@deepseek-ai/dsh-client-ui-primitives": "0.2.1-alpha.2",
60
+ "@deepseek-ai/dsh-client-ui-sidebar-right": "0.2.1-alpha.2",
61
+ "@deepseek-ai/dsh-client-ui-session": "0.2.1-alpha.2",
62
+ "@deepseek-ai/dsh-session": "0.2.1-alpha.2",
63
+ "@deepseek-ai/dsh-llm": "0.2.1-alpha.2",
64
+ "@tanstack/react-virtual": "^3.14.10",
56
65
  "@types/react": "~18.3.1",
57
66
  "react": "^18.2.0",
58
- "@deepseek-ai/dsh-client-test-runtime": "0.2.1-alpha.1",
59
- "@deepseek-ai/dsh-api-session-controller": "0.2.1-alpha.1",
60
- "@deepseek-ai/dsh-client-store": "0.2.1-alpha.1",
61
- "@deepseek-ai/dsh-client-ui-chat": "0.2.1-alpha.1",
62
- "@deepseek-ai/dsh-client-ui-primitives": "0.2.1-alpha.1",
63
- "@deepseek-ai/dsh-client-ui-sidebar-right": "0.2.1-alpha.1",
64
- "@deepseek-ai/dsh-client-ui-session": "0.2.1-alpha.1",
65
- "@deepseek-ai/dsh-session": "0.2.1-alpha.1",
66
67
  "@deepseek-ai/cordis": "~4.0.5-alpha.1",
67
- "@deepseek-ai/dsh-client-locale": "0.2.1-alpha.1",
68
- "@deepseek-ai/dsh-llm": "0.2.1-alpha.1",
69
- "@deepseek-ai/dsh-client-ui-renderer": "0.2.1-alpha.1",
70
- "@deepseek-ai/dsh-client-ui-slots": "0.2.1-alpha.1",
71
- "@deepseek-ai/dsh-client-ui-conversation": "0.2.1-alpha.1"
68
+ "@deepseek-ai/dsh-client-locale": "0.2.1-alpha.2",
69
+ "@deepseek-ai/dsh-client-ui-conversation": "0.2.1-alpha.2",
70
+ "@deepseek-ai/dsh-client-ui-renderer": "0.2.1-alpha.2",
71
+ "@deepseek-ai/dsh-client-ui-slots": "0.2.1-alpha.2"
72
72
  },
73
73
  "scripts": {
74
74
  "bundle": "tsdown",