@fluid-topics/ft-reader-search-in-document 2.2.7 → 2.2.9
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.
|
@@ -15,7 +15,7 @@ import { readerSearchInDocumentContext } from "./ReaderSearchInDocumentMessages"
|
|
|
15
15
|
import { FtCard } from "@fluid-topics/ft-card";
|
|
16
16
|
import { SearchResultClickEvent, SearchResultOpenContextMenuEvent, } from "@fluid-topics/ft-search-context/build/utils";
|
|
17
17
|
import { FtTypographyVariants } from "@fluid-topics/ft-typography";
|
|
18
|
-
import { i18nAttribute } from "@fluid-topics/ft-i18n/build/decorators/i18nAttribute";
|
|
18
|
+
import { i18nAttribute, } from "@fluid-topics/ft-i18n/build/decorators/i18nAttribute";
|
|
19
19
|
export class FtReaderSearchInDocument extends withI18n(FtReaderComponent) {
|
|
20
20
|
constructor() {
|
|
21
21
|
super();
|
|
@@ -43,7 +43,7 @@ export class FtReaderSearchInDocument extends withI18n(FtReaderComponent) {
|
|
|
43
43
|
var _a;
|
|
44
44
|
return html `
|
|
45
45
|
<style> ${resultStyles}</style>
|
|
46
|
-
<a href="${getResultUrl(result)}" @click=${() => this.onLinkClick(result, rank)}
|
|
46
|
+
<a href="${getResultUrl(result)}" @click=${(e) => this.onLinkClick(e, result, rank)}
|
|
47
47
|
@auxclick=${(e) => this.onAuxClick(e, result, rank)}
|
|
48
48
|
@contextmenu=${() => this.onContextMenu(result, rank)}>
|
|
49
49
|
<ft-card clickable noheader>
|
|
@@ -51,7 +51,9 @@ export class FtReaderSearchInDocument extends withI18n(FtReaderComponent) {
|
|
|
51
51
|
${this.hideResultTitle ? nothing : html `
|
|
52
52
|
<ft-search-result-title withoutLink="true"></ft-search-result-title>`}
|
|
53
53
|
${this.hideResultBreadcrumb ? nothing : html `
|
|
54
|
-
<ft-typography class="breadcrumb" variant="${FtTypographyVariants.caption}"
|
|
54
|
+
<ft-typography class="breadcrumb" variant="${FtTypographyVariants.caption}">
|
|
55
|
+
${(_a = result.topic) === null || _a === void 0 ? void 0 : _a.breadcrumb.join(" > ")}
|
|
56
|
+
</ft-typography>
|
|
55
57
|
`}
|
|
56
58
|
${this.hideResultAbstract ? nothing : html `
|
|
57
59
|
<ft-search-result-abstract></ft-search-result-abstract>
|
|
@@ -63,7 +65,7 @@ export class FtReaderSearchInDocument extends withI18n(FtReaderComponent) {
|
|
|
63
65
|
}
|
|
64
66
|
onAuxClick(e, result, rank) {
|
|
65
67
|
if (e.button == 1) {
|
|
66
|
-
this.
|
|
68
|
+
this.dispatchEvent(new SearchResultClickEvent(result, rank));
|
|
67
69
|
}
|
|
68
70
|
}
|
|
69
71
|
onContextMenu(result, rank) {
|
|
@@ -117,8 +119,11 @@ export class FtReaderSearchInDocument extends withI18n(FtReaderComponent) {
|
|
|
117
119
|
eventManager.initAppInfo();
|
|
118
120
|
});
|
|
119
121
|
}
|
|
120
|
-
onLinkClick(result, rank) {
|
|
122
|
+
onLinkClick(e, result, rank) {
|
|
123
|
+
var _a, _b;
|
|
121
124
|
this.dispatchEvent(new SearchResultClickEvent(result, rank));
|
|
125
|
+
(_a = this.stateManager) === null || _a === void 0 ? void 0 : _a.navigateToTopic((_b = result.topic) === null || _b === void 0 ? void 0 : _b.tocId, undefined, undefined);
|
|
126
|
+
e.preventDefault();
|
|
122
127
|
}
|
|
123
128
|
importDynamicDependencies() {
|
|
124
129
|
super.importDynamicDependencies();
|