@fluid-topics/ft-reader-topic-content 2.2.18 → 2.2.20
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.
|
@@ -53,14 +53,15 @@ export class FtReaderTopicContent extends FtReaderTopicComponent {
|
|
|
53
53
|
return this.tocNode && ((_a = this.filteredTocNodes) === null || _a === void 0 ? void 0 : _a[this.tocNode.tocId]);
|
|
54
54
|
}
|
|
55
55
|
contentAvailableCallback(props) {
|
|
56
|
-
var _a, _b, _c, _d, _e, _f
|
|
56
|
+
var _a, _b, _c, _d, _e, _f;
|
|
57
|
+
var _g;
|
|
57
58
|
super.contentAvailableCallback(props);
|
|
58
59
|
if (!this.disableContextInteractions && ((_a = this.scrollTarget) === null || _a === void 0 ? void 0 : _a.section) && ((_b = this.tocNode) === null || _b === void 0 ? void 0 : _b.tocId) && ((_c = this.tocNode) === null || _c === void 0 ? void 0 : _c.tocId) === this.scrollTarget.tocId && this.content) {
|
|
59
|
-
const target = (
|
|
60
|
+
const target = (_g = (_d = this.shadowRoot) === null || _d === void 0 ? void 0 : _d.querySelector(`[id="${this.scrollTarget.section}"], [name="${this.scrollTarget.section}"]`)) !== null && _g !== void 0 ? _g : this;
|
|
60
61
|
target.tabIndex = -1;
|
|
61
62
|
target.focus();
|
|
62
63
|
target.dispatchEvent(new Event("scroll-into-view", { bubbles: true, composed: true }));
|
|
63
|
-
(
|
|
64
|
+
(_e = this.stateManager) === null || _e === void 0 ? void 0 : _e.scrollDone();
|
|
64
65
|
}
|
|
65
66
|
if ((props.has("searchInDocumentQuery") || props.has("content")) && this.content) {
|
|
66
67
|
waitFor(() => this.topicContainer).then((topicContainer) => {
|
|
@@ -81,24 +82,25 @@ export class FtReaderTopicContent extends FtReaderTopicComponent {
|
|
|
81
82
|
});
|
|
82
83
|
}
|
|
83
84
|
if ((props.has("content") && this.content) || (props.has("error") && this.error)) {
|
|
84
|
-
performance.mark("fluid_topics__reader_topic_displayed__" + ((
|
|
85
|
+
performance.mark("fluid_topics__reader_topic_displayed__" + ((_f = this.tocNode) === null || _f === void 0 ? void 0 : _f.tocId));
|
|
85
86
|
}
|
|
86
87
|
}
|
|
87
88
|
processExpandingBlocks() {
|
|
88
89
|
for (const link of this.shadowRoot.querySelectorAll(".ft-expanding-block-link")) {
|
|
89
90
|
link.onclick = (e) => {
|
|
90
|
-
var _a, _b, _c
|
|
91
|
+
var _a, _b, _c;
|
|
92
|
+
var _d;
|
|
91
93
|
e.stopPropagation();
|
|
92
94
|
e.preventDefault();
|
|
93
95
|
if (link.classList.contains("ft-expanding-exclusive")
|
|
94
96
|
&& !link.classList.contains("ft-expanding-block-expanded")) {
|
|
95
|
-
for (const block of Array.from((
|
|
97
|
+
for (const block of Array.from((_d = (_a = this.topicContainer) === null || _a === void 0 ? void 0 : _a.querySelectorAll(".ft-expanding-block-expanded")) !== null && _d !== void 0 ? _d : [])) {
|
|
96
98
|
block.classList.remove("ft-expanding-block-expanded");
|
|
97
99
|
}
|
|
98
100
|
}
|
|
99
101
|
link.classList.toggle("ft-expanding-block-expanded");
|
|
100
102
|
const targetId = link.getAttribute("data-expanding-block-target-id");
|
|
101
|
-
(
|
|
103
|
+
(_c = (_b = this.topicContainer) === null || _b === void 0 ? void 0 : _b.querySelector(`[id='` + targetId + `']`)) === null || _c === void 0 ? void 0 : _c.classList.toggle("ft-expanding-block-expanded");
|
|
102
104
|
};
|
|
103
105
|
}
|
|
104
106
|
}
|
|
@@ -131,7 +133,8 @@ export class FtReaderTopicContent extends FtReaderTopicComponent {
|
|
|
131
133
|
this.updateContent();
|
|
132
134
|
}
|
|
133
135
|
renderTopicContent() {
|
|
134
|
-
var _a, _b, _c, _d, _e
|
|
136
|
+
var _a, _b, _c, _d, _e;
|
|
137
|
+
var _f;
|
|
135
138
|
if (this.error) {
|
|
136
139
|
return html `
|
|
137
140
|
<div class="topic-on-error">
|
|
@@ -142,10 +145,10 @@ export class FtReaderTopicContent extends FtReaderTopicComponent {
|
|
|
142
145
|
</div>
|
|
143
146
|
`;
|
|
144
147
|
}
|
|
145
|
-
const customClasses = (
|
|
146
|
-
let topicLevel = (((
|
|
147
|
-
if (this.headingStartLevel != null && ((
|
|
148
|
-
topicLevel = (((
|
|
148
|
+
const customClasses = (_f = (_a = this.map) === null || _a === void 0 ? void 0 : _a.contentStyles.customCssClasses.join(" ")) !== null && _f !== void 0 ? _f : "";
|
|
149
|
+
let topicLevel = (((_b = this.tocNode) === null || _b === void 0 ? void 0 : _b.depth) || 1) + this.headingLevelsShift;
|
|
150
|
+
if (this.headingStartLevel != null && ((_c = this.currentPage) === null || _c === void 0 ? void 0 : _c.rootTocId)) {
|
|
151
|
+
topicLevel = (((_d = this.tocNode) === null || _d === void 0 ? void 0 : _d.depth) || 1) - (((_e = this.currentPage) === null || _e === void 0 ? void 0 : _e.rootDepth) || 1) + this.headingStartLevel;
|
|
149
152
|
}
|
|
150
153
|
return this.translationLoading || (!this.content && !this.isFiltered)
|
|
151
154
|
? html `
|