@fluid-topics/ft-reader-topic-content 1.2.58 → 1.2.60

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,6 +53,8 @@ class FtReaderTopicContent extends FtReaderTopicComponent {
53
53
  super.contentAvailableCallback(props);
54
54
  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) {
55
55
  const target = (_e = (_d = this.shadowRoot) === null || _d === void 0 ? void 0 : _d.querySelector(`[id="${this.scrollTarget.section}"], [name="${this.scrollTarget.section}"]`)) !== null && _e !== void 0 ? _e : this;
56
+ target.tabIndex = -1;
57
+ target.focus();
56
58
  target.dispatchEvent(new Event("scroll-into-view", { bubbles: true, composed: true }));
57
59
  (_f = this.stateManager) === null || _f === void 0 ? void 0 : _f.scrollDone();
58
60
  }
@@ -129,11 +131,12 @@ class FtReaderTopicContent extends FtReaderTopicComponent {
129
131
  `;
130
132
  }
131
133
  const customClasses = (_b = (_a = this.map) === null || _a === void 0 ? void 0 : _a.contentStyles.customCssClasses.join(" ")) !== null && _b !== void 0 ? _b : "";
134
+ const topicLevel = (((_c = this.tocNode) === null || _c === void 0 ? void 0 : _c.depth) || 1) + this.headingLevelsShift;
132
135
  return this.translationLoading || !this.content
133
136
  ? html `
134
137
  <ft-skeleton></ft-skeleton>`
135
138
  : html `
136
- <div class="depth-${(_c = this.tocNode) === null || _c === void 0 ? void 0 : _c.depth} content-locale-${this.getTopicLanguage()} ${customClasses}">
139
+ <div class="depth-${topicLevel} content-locale-${this.getTopicLanguage()} ${customClasses}">
137
140
  ${this.content != null ? unsafeHTML(`${this.content}`) : nothing}
138
141
  </div>
139
142
  `;