@fluid-topics/ft-reader-context 2.1.3 → 2.1.4

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.
@@ -110,8 +110,18 @@ class EnrichedTocBuilder {
110
110
  add(node.tocId, node.pageConfiguration.isVisible);
111
111
  }
112
112
  page.topics.push(...this.tocIds((_h = node.pageToc) !== null && _h !== void 0 ? _h : []));
113
+ const overridenRootTocId = this.resolveOverridenRootTocIdByParentForcedByPagination(page.breadcrumb, parentsVisibility);
114
+ page.rootTocId = overridenRootTocId !== null && overridenRootTocId !== void 0 ? overridenRootTocId : page.rootTocId;
113
115
  return page;
114
116
  }
117
+ resolveOverridenRootTocIdByParentForcedByPagination(breadcrumb, visibility) {
118
+ for (let index = 0; index < breadcrumb.length; index++) {
119
+ if (visibility[index]) {
120
+ return breadcrumb[index];
121
+ }
122
+ }
123
+ return undefined;
124
+ }
115
125
  registerPage(page) {
116
126
  for (const tocId of [...page.topics, ...page.hiddenTopics]) {
117
127
  if (!this.pageByTocId[tocId]) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluid-topics/ft-reader-context",
3
- "version": "2.1.3",
3
+ "version": "2.1.4",
4
4
  "description": "Context block for integrated reader components",
5
5
  "keywords": [
6
6
  "Lit"
@@ -19,12 +19,12 @@
19
19
  "url": "ssh://git@scm.mrs.antidot.net:2222/fluidtopics/ft-web-components.git"
20
20
  },
21
21
  "dependencies": {
22
- "@fluid-topics/ft-app-context": "2.1.3",
23
- "@fluid-topics/ft-wc-utils": "2.1.3",
22
+ "@fluid-topics/ft-app-context": "2.1.4",
23
+ "@fluid-topics/ft-wc-utils": "2.1.4",
24
24
  "lit": "3.1.0"
25
25
  },
26
26
  "devDependencies": {
27
27
  "@fluid-topics/public-api": "1.0.127"
28
28
  },
29
- "gitHead": "1432414b3c12e054e03bab4d15c0959e25699faf"
29
+ "gitHead": "ae3c3a818dc16962d6026a12b9f45060e8833184"
30
30
  }