@fluid-topics/ft-reader-metadata 1.3.30 → 1.3.32
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.
- package/build/ft-reader-metadata.js +8 -8
- package/build/ft-reader-metadata.light.js +152 -157
- package/build/ft-reader-metadata.min.js +139 -144
- package/package.json +9 -9
|
@@ -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 { ClusteringHelper, redux, reduxEventListener, reduxReactive } from "@fluid-topics/ft-wc-utils";
|
|
9
|
+
import { ClusteringHelper, numberProperty, redux, reduxEventListener, reduxReactive } from "@fluid-topics/ft-wc-utils";
|
|
10
10
|
import { styles } from "./ft-reader-metadata.styles";
|
|
11
11
|
import { FtReaderComponent } from "@fluid-topics/ft-reader-context/build/registration";
|
|
12
12
|
import { FtTooltip } from "@fluid-topics/ft-tooltip";
|
|
@@ -63,7 +63,7 @@ class FtReaderMetadata extends withDateFormat(withI18n(FtReaderComponent)) {
|
|
|
63
63
|
<ft-floating-menu part="floating-menu" text="Toggle collapsible" trailingIcon>
|
|
64
64
|
${this.renderChip(true)}
|
|
65
65
|
<ft-floating-menu-label>${this.metadataLabel}</ft-floating-menu-label>
|
|
66
|
-
${repeat(this.relatives, relative => relative.metadata.value, relative => this.renderRelativeItem(relative.result, relative.metadata))}
|
|
66
|
+
${repeat(this.relatives, (relative) => relative.metadata.value, (relative) => this.renderRelativeItem(relative.result, relative.metadata))}
|
|
67
67
|
</ft-floating-menu>
|
|
68
68
|
</div>
|
|
69
69
|
`;
|
|
@@ -149,11 +149,11 @@ class FtReaderMetadata extends withDateFormat(withI18n(FtReaderComponent)) {
|
|
|
149
149
|
e.stopPropagation();
|
|
150
150
|
e.preventDefault();
|
|
151
151
|
const tocNode = this.service.getTocNodeNow(currentTocId);
|
|
152
|
-
this.service.getTopicInfo(tocNode).then(topicInfo => {
|
|
153
|
-
const topicPivotMetadataValue = topicInfo === null || topicInfo === void 0 ? void 0 : topicInfo.metadata.find(metadata => metadata.key == this.relativeTopicPivotMetadata);
|
|
152
|
+
this.service.getTopicInfo(tocNode).then((topicInfo) => {
|
|
153
|
+
const topicPivotMetadataValue = topicInfo === null || topicInfo === void 0 ? void 0 : topicInfo.metadata.find((metadata) => metadata.key == this.relativeTopicPivotMetadata);
|
|
154
154
|
const url = new URL(getResultUrl(result));
|
|
155
155
|
if (topicPivotMetadataValue) {
|
|
156
|
-
topicPivotMetadataValue.values.forEach(value => url.searchParams.append("topicPivot", value));
|
|
156
|
+
topicPivotMetadataValue.values.forEach((value) => url.searchParams.append("topicPivot", value));
|
|
157
157
|
}
|
|
158
158
|
const link = document.createElement("a");
|
|
159
159
|
link.href = url.toString();
|
|
@@ -198,7 +198,7 @@ class FtReaderMetadata extends withDateFormat(withI18n(FtReaderComponent)) {
|
|
|
198
198
|
if (this.metadata) {
|
|
199
199
|
return this.metadata.label;
|
|
200
200
|
}
|
|
201
|
-
return (_f = (_d = (_c = (_b = (_a = this.stateManager) === null || _a === void 0 ? void 0 : _a.clusteringHelper) === null || _b === void 0 ? void 0 : _b.getMetadataDescriptor(this.key)) === null || _c === void 0 ? void 0 : _c.label) !== null && _d !== void 0 ? _d : (_e = this.relatives.find(item => item.metadata.value)) === null || _e === void 0 ? void 0 : _e.metadata.label) !== null && _f !== void 0 ? _f : this.key;
|
|
201
|
+
return (_f = (_d = (_c = (_b = (_a = this.stateManager) === null || _a === void 0 ? void 0 : _a.clusteringHelper) === null || _b === void 0 ? void 0 : _b.getMetadataDescriptor(this.key)) === null || _c === void 0 ? void 0 : _c.label) !== null && _d !== void 0 ? _d : (_e = this.relatives.find((item) => item.metadata.value)) === null || _e === void 0 ? void 0 : _e.metadata.label) !== null && _f !== void 0 ? _f : this.key;
|
|
202
202
|
}
|
|
203
203
|
}
|
|
204
204
|
FtReaderMetadata.elementDefinitions = {
|
|
@@ -224,7 +224,7 @@ __decorate([
|
|
|
224
224
|
property({ type: Boolean })
|
|
225
225
|
], FtReaderMetadata.prototype, "displayLabel", void 0);
|
|
226
226
|
__decorate([
|
|
227
|
-
|
|
227
|
+
numberProperty()
|
|
228
228
|
], FtReaderMetadata.prototype, "hierarchicalValueTruncatingLevel", void 0);
|
|
229
229
|
__decorate([
|
|
230
230
|
property({ type: Boolean })
|
|
@@ -236,7 +236,7 @@ __decorate([
|
|
|
236
236
|
property({ type: Boolean })
|
|
237
237
|
], FtReaderMetadata.prototype, "translateValues", void 0);
|
|
238
238
|
__decorate([
|
|
239
|
-
redux({ store: "reader", selector: (s, e) => { var _a, _b; return (_b = (_a = s.map) === null || _a === void 0 ? void 0 : _a.metadata) === null || _b === void 0 ? void 0 : _b.find(m => m.key === e.key); } })
|
|
239
|
+
redux({ store: "reader", selector: (s, e) => { var _a, _b; return (_b = (_a = s.map) === null || _a === void 0 ? void 0 : _a.metadata) === null || _b === void 0 ? void 0 : _b.find((m) => m.key === e.key); } })
|
|
240
240
|
], FtReaderMetadata.prototype, "metadata", void 0);
|
|
241
241
|
__decorate([
|
|
242
242
|
state()
|