@fluid-topics/ft-reader-topic-content 2.1.10 → 2.1.11
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.
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { PropertyValues } from "lit";
|
|
2
2
|
import { FtReaderTopicContentProperties } from "./ft-reader-topic-content.properties";
|
|
3
3
|
import { FtReaderTopicComponent } from "@fluid-topics/ft-reader-topic-context/build/registration";
|
|
4
|
-
import { FtReaderScrollTarget } from "@fluid-topics/ft-reader-context/build/store/model";
|
|
4
|
+
import { FtReaderPage, FtReaderScrollTarget } from "@fluid-topics/ft-reader-context/build/store/model";
|
|
5
5
|
import { FtMap } from "@fluid-topics/public-api";
|
|
6
6
|
import "@fluid-topics/ft-icon";
|
|
7
7
|
export declare class FtReaderTopicContent extends FtReaderTopicComponent implements FtReaderTopicContentProperties {
|
|
@@ -14,6 +14,7 @@ export declare class FtReaderTopicContent extends FtReaderTopicComponent impleme
|
|
|
14
14
|
private translationError?;
|
|
15
15
|
linkPreviewDialogId?: string;
|
|
16
16
|
scrollTarget?: FtReaderScrollTarget;
|
|
17
|
+
currentPage?: FtReaderPage;
|
|
17
18
|
content?: string;
|
|
18
19
|
error?: Error;
|
|
19
20
|
searchInDocumentQuery?: string;
|
|
@@ -4,12 +4,12 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
4
4
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
|
-
import { html, nothing } from "lit";
|
|
7
|
+
import { html, nothing, } from "lit";
|
|
8
8
|
import { styles } from "./ft-reader-topic-content.styles";
|
|
9
9
|
import { FtReaderTopicComponent } from "@fluid-topics/ft-reader-topic-context/build/registration";
|
|
10
10
|
import { unsafeHTML } from "lit/directives/unsafe-html.js";
|
|
11
|
-
import { highlightHtml, highlightHtmlStyles, redux, waitFor } from "@fluid-topics/ft-wc-utils";
|
|
12
|
-
import { property, query, queryAll, state } from "lit/decorators.js";
|
|
11
|
+
import { highlightHtml, highlightHtmlStyles, redux, waitFor, } from "@fluid-topics/ft-wc-utils";
|
|
12
|
+
import { property, query, queryAll, state, } from "lit/decorators.js";
|
|
13
13
|
import "@fluid-topics/ft-icon";
|
|
14
14
|
import { context } from "./i18n/TopicContentMessages";
|
|
15
15
|
export class FtReaderTopicContent extends FtReaderTopicComponent {
|
|
@@ -127,7 +127,7 @@ export class FtReaderTopicContent extends FtReaderTopicComponent {
|
|
|
127
127
|
this.updateContent();
|
|
128
128
|
}
|
|
129
129
|
renderTopicContent() {
|
|
130
|
-
var _a, _b, _c;
|
|
130
|
+
var _a, _b, _c, _d, _e, _f;
|
|
131
131
|
if (this.error) {
|
|
132
132
|
return html `
|
|
133
133
|
<div class="topic-on-error">
|
|
@@ -139,7 +139,10 @@ export class FtReaderTopicContent extends FtReaderTopicComponent {
|
|
|
139
139
|
`;
|
|
140
140
|
}
|
|
141
141
|
const customClasses = (_b = (_a = this.map) === null || _a === void 0 ? void 0 : _a.contentStyles.customCssClasses.join(" ")) !== null && _b !== void 0 ? _b : "";
|
|
142
|
-
|
|
142
|
+
let topicLevel = (((_c = this.tocNode) === null || _c === void 0 ? void 0 : _c.depth) || 1) + this.headingLevelsShift;
|
|
143
|
+
if (this.headingStartLevel != null && ((_d = this.currentPage) === null || _d === void 0 ? void 0 : _d.rootTocId)) {
|
|
144
|
+
topicLevel = (((_e = this.tocNode) === null || _e === void 0 ? void 0 : _e.depth) || 1) - (((_f = this.currentPage) === null || _f === void 0 ? void 0 : _f.rootDepth) || 1) + this.headingStartLevel;
|
|
145
|
+
}
|
|
143
146
|
return this.translationLoading || !this.content
|
|
144
147
|
? html `
|
|
145
148
|
<ft-skeleton></ft-skeleton>`
|
|
@@ -195,6 +198,9 @@ __decorate([
|
|
|
195
198
|
__decorate([
|
|
196
199
|
redux()
|
|
197
200
|
], FtReaderTopicContent.prototype, "scrollTarget", void 0);
|
|
201
|
+
__decorate([
|
|
202
|
+
redux()
|
|
203
|
+
], FtReaderTopicContent.prototype, "currentPage", void 0);
|
|
198
204
|
__decorate([
|
|
199
205
|
state()
|
|
200
206
|
], FtReaderTopicContent.prototype, "content", void 0);
|