stream-chat 10.1.1 → 10.2.0

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.
@@ -1391,7 +1391,7 @@ var parseVersion = (raw) => {
1391
1391
  };
1392
1392
  var readInjectedVersion = () => {
1393
1393
  try {
1394
- return "10.1.1";
1394
+ return "10.2.0";
1395
1395
  } catch {
1396
1396
  return void 0;
1397
1397
  }
@@ -4972,6 +4972,11 @@ var BasePaginator = class {
4972
4972
  cursor: this.config.initialCursor,
4973
4973
  offset: this.config.initialOffset ?? 0
4974
4974
  });
4975
+ this.state.addPreprocessor((next) => {
4976
+ if (!next.isLoading && next.loadingDirection !== void 0) {
4977
+ next.loadingDirection = void 0;
4978
+ }
4979
+ });
4975
4980
  this.rebuildStatePublishThrottles(this.config.stateThrottleMs);
4976
4981
  this.intervalViews = new StateStore8({
4977
4982
  logicalHead: [],
@@ -5018,6 +5023,10 @@ var BasePaginator = class {
5018
5023
  get isLoading() {
5019
5024
  return this.state.getLatestValue().isLoading;
5020
5025
  }
5026
+ /** See {@link PaginatorState.loadingDirection}. */
5027
+ get loadingDirection() {
5028
+ return this.state.getLatestValue().loadingDirection;
5029
+ }
5021
5030
  /**
5022
5031
  * True once a query has run or a non-empty interval was loaded without one (`setItems`, or a
5023
5032
  * subclass calling `recordLoadedIntervalQueryShape`). Cleared by `resetState`.
@@ -5047,6 +5056,7 @@ var BasePaginator = class {
5047
5056
  hasMoreHead: true,
5048
5057
  hasMoreTail: true,
5049
5058
  isLoading: false,
5059
+ loadingDirection: void 0,
5050
5060
  items: void 0,
5051
5061
  lastQueryError: void 0,
5052
5062
  cursor: this.config.initialCursor,
@@ -6841,7 +6851,11 @@ var BasePaginator = class {
6841
6851
  })();
6842
6852
  }
6843
6853
  } else if (!silent) {
6844
- this.state.partialNext({ isLoading: true });
6854
+ const loadsAtEdge = !isFirstPage && !forcedQueryShape;
6855
+ this.state.partialNext({
6856
+ isLoading: true,
6857
+ loadingDirection: loadsAtEdge ? direction : void 0
6858
+ });
6845
6859
  }
6846
6860
  const isAtCallersShape = !!forcedQueryShape;
6847
6861
  const continuesOwnCursor = !isFirstPage && !isAtCallersShape;
@@ -9405,6 +9419,15 @@ var MessageIntervalPaginator = class extends BasePaginator {
9405
9419
  offlineDb.hardDeleteMessages({ ids }).catch(() => {
9406
9420
  });
9407
9421
  }
9422
+ /**
9423
+ * Also drops the focus signal of an earlier jump. Whatever claims the active interval decides what
9424
+ * is shown, so the earlier target must not be scrolled to or highlighted there. A jump claims
9425
+ * before it emits its own signal, so it keeps that one.
9426
+ */
9427
+ claimActiveInterval() {
9428
+ this.clearMessageFocusSignal();
9429
+ return super.claimActiveInterval();
9430
+ }
9408
9431
  clearStateAndCache() {
9409
9432
  this.resetState();
9410
9433
  this._itemIndex.clear();