@fluid-topics/ft-search-results 1.3.49 → 1.3.51

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.
@@ -24,6 +24,5 @@ export declare class FtSearchResults extends FtSearchResults_base implements FtS
24
24
  private buildClusters;
25
25
  private buildFullClusters;
26
26
  private buildAllResultsClusters;
27
- private clusterId;
28
27
  }
29
28
  export {};
@@ -7,7 +7,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
7
7
  import { html } from "lit";
8
8
  import { repeat } from "lit/directives/repeat.js";
9
9
  import { property } from "lit/decorators.js";
10
- import { jsonProperty, redux, scrollHelper } from "@fluid-topics/ft-wc-utils";
10
+ import { accessResultId, jsonProperty, redux, scrollHelper } from "@fluid-topics/ft-wc-utils";
11
11
  import { styles } from "./ft-search-results.styles";
12
12
  import { FtSearchComponent } from "@fluid-topics/ft-search-context/build/registration";
13
13
  import "@fluid-topics/ft-search-result-context";
@@ -76,22 +76,18 @@ class FtSearchResults extends withI18n(FtSearchComponent) {
76
76
  buildFullClusters() {
77
77
  var _a, _b;
78
78
  return (_b = (_a = this.results) === null || _a === void 0 ? void 0 : _a.map((cluster) => ({
79
- id: this.clusterId(cluster.entries[0]),
79
+ id: accessResultId(cluster.entries[0]),
80
80
  entries: cluster.entries,
81
81
  }))) !== null && _b !== void 0 ? _b : [];
82
82
  }
83
83
  buildAllResultsClusters() {
84
84
  var _a, _b, _c;
85
85
  const results = (_b = (_a = this.results) === null || _a === void 0 ? void 0 : _a.flatMap((cluster) => cluster.entries.map((entry) => ({
86
- id: this.clusterId(entry),
86
+ id: accessResultId(entry),
87
87
  entries: [entry],
88
88
  })))) !== null && _b !== void 0 ? _b : [];
89
89
  return this.paging && this.paging.page === 1 ? results.slice(0, ((_c = this.paging.perPage) !== null && _c !== void 0 ? _c : 20)) : results;
90
90
  }
91
- clusterId(result) {
92
- var _a, _b, _c, _d, _e;
93
- return (_d = (_b = (_a = result.map) === null || _a === void 0 ? void 0 : _a.mapId) !== null && _b !== void 0 ? _b : (_c = result.topic) === null || _c === void 0 ? void 0 : _c.tocId) !== null && _d !== void 0 ? _d : (_e = result.document) === null || _e === void 0 ? void 0 : _e.documentId;
94
- }
95
91
  }
96
92
  FtSearchResults.styles = styles;
97
93
  __decorate([