@fluid-topics/ft-search-result-metadata 1.1.27 → 1.1.29

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.
@@ -6,7 +6,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
6
6
  };
7
7
  import { html, nothing } from "lit";
8
8
  import { property, state } from "lit/decorators.js";
9
- import { redux } from "@fluid-topics/ft-wc-utils";
9
+ import { ClusteringHelper, redux } from "@fluid-topics/ft-wc-utils";
10
10
  import { styles } from "./ft-search-result-metadata.css";
11
11
  import { FtSearchResultComponent } from "@fluid-topics/ft-search-result-context/build/registration";
12
12
  import { ftAppInfoStore } from "@fluid-topics/ft-app-context";
@@ -15,8 +15,7 @@ import { searchResultMetadataContext } from "./SearchResultMetadataMessages";
15
15
  import { FtTooltip } from "@fluid-topics/ft-tooltip";
16
16
  import { FtChip } from "@fluid-topics/ft-chip";
17
17
  import { FtFloatingMenu, FtFloatingMenuItem, FtFloatingMenuLabel } from "@fluid-topics/ft-floating-menu";
18
- import { extractResultMetadata, getResultUrl, SearchResultClickEvent } from "@fluid-topics/ft-search-result-context/build/utils";
19
- import { ClusteringHelper } from "@fluid-topics/ft-search-result-context/build/ClusteringHelper";
18
+ import { getResultUrl, SearchResultClickEvent } from "@fluid-topics/ft-search-result-context/build/utils";
20
19
  import { repeat } from "lit/directives/repeat.js";
21
20
  class FtSearchResultMetadata extends withI18n(FtSearchResultComponent) {
22
21
  constructor() {
@@ -73,10 +72,10 @@ class FtSearchResultMetadata extends withI18n(FtSearchResultComponent) {
73
72
  (_a = this.resultStateManager) === null || _a === void 0 ? void 0 : _a.selectResult(this.clustersByValue[e.detail].result);
74
73
  }
75
74
  computeClusters() {
76
- var _a;
75
+ var _a, _b;
77
76
  const clustersByValue = {};
78
- const clusteringHelper = new ClusteringHelper(this.cluster, this.result, this.resultStateManager.registeredMetadata, this.metadataDescriptors);
79
- this.clusters = clusteringHelper.computeClustersItemsForMetadata(this.key, ((_a = this.request) === null || _a === void 0 ? void 0 : _a.contentLocale) || "en");
77
+ const clusteringHelper = new ClusteringHelper((_a = this.cluster) === null || _a === void 0 ? void 0 : _a.entries, this.result, this.resultStateManager.registeredMetadata, this.metadataDescriptors);
78
+ this.clusters = clusteringHelper.computeClustersItemsForMetadata(this.key, ((_b = this.request) === null || _b === void 0 ? void 0 : _b.contentLocale) || "en");
80
79
  this.clusters.forEach(item => {
81
80
  clustersByValue[item.metadata.value] = item;
82
81
  });
@@ -146,7 +145,7 @@ class FtSearchResultMetadata extends withI18n(FtSearchResultComponent) {
146
145
  }
147
146
  get clusterHasMultipleValues() {
148
147
  var _a, _b, _c;
149
- let values = (_c = (_b = (_a = this.cluster) === null || _a === void 0 ? void 0 : _a.entries) === null || _b === void 0 ? void 0 : _b.map(e => extractResultMetadata(e))) === null || _c === void 0 ? void 0 : _c.map(e => { var _a; return (_a = e.find(m => m.key == this.key)) === null || _a === void 0 ? void 0 : _a.value; });
148
+ let values = (_c = (_b = (_a = this.cluster) === null || _a === void 0 ? void 0 : _a.entries) === null || _b === void 0 ? void 0 : _b.map(e => ClusteringHelper.extractResultMetadata(e))) === null || _c === void 0 ? void 0 : _c.map(e => { var _a; return (_a = e.find(m => m.key == this.key)) === null || _a === void 0 ? void 0 : _a.value; });
150
149
  return new Set(values).size > 1;
151
150
  }
152
151
  getEllipsis(text) {