@fluid-topics/ft-reader-topic-content 1.2.4 → 1.2.5
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,7 +53,7 @@ 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.
|
|
56
|
+
target.dispatchEvent(new Event("scroll-into-view", { bubbles: true, composed: true }));
|
|
57
57
|
(_f = this.stateManager) === null || _f === void 0 ? void 0 : _f.scrollDone();
|
|
58
58
|
}
|
|
59
59
|
if (this.topicContainer) {
|
|
@@ -71,11 +71,11 @@ class FtReaderTopicContent extends FtReaderTopicComponent {
|
|
|
71
71
|
this.shadowRoot.querySelectorAll(".ft-expanding-block-link").forEach(expandingBlockLink => {
|
|
72
72
|
expandingBlockLink.onclick = function () {
|
|
73
73
|
var _a, _b, _c;
|
|
74
|
-
if (expandingBlockLink.classList.contains(
|
|
75
|
-
Array.from(((_a = expandingBlockLink.closest(
|
|
74
|
+
if (expandingBlockLink.classList.contains("ft-expanding-exclusive") && !expandingBlockLink.classList.contains("ft-expanding-block-expanded")) {
|
|
75
|
+
Array.from(((_a = expandingBlockLink.closest(".topic")) === null || _a === void 0 ? void 0 : _a.querySelectorAll(".ft-expanding-block-expanded")) || []).forEach(el => el.classList.remove("ft-expanding-block-expanded"));
|
|
76
76
|
}
|
|
77
|
-
expandingBlockLink.classList.toggle(
|
|
78
|
-
(_c = (_b = expandingBlockLink.closest(
|
|
77
|
+
expandingBlockLink.classList.toggle("ft-expanding-block-expanded");
|
|
78
|
+
(_c = (_b = expandingBlockLink.closest(".topic")) === null || _b === void 0 ? void 0 : _b.querySelector(`[id='` + expandingBlockLink.getAttribute("data-expanding-block-target-id") + `']`)) === null || _c === void 0 ? void 0 : _c.classList.toggle("ft-expanding-block-expanded");
|
|
79
79
|
};
|
|
80
80
|
});
|
|
81
81
|
}
|
|
@@ -83,8 +83,8 @@ class FtReaderTopicContent extends FtReaderTopicComponent {
|
|
|
83
83
|
this.shadowRoot.querySelectorAll(".ft-openapi-select").forEach(select => {
|
|
84
84
|
select.onchange = function (event) {
|
|
85
85
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
86
|
-
(_d = (_c = (_b = (_a = event.target) === null || _a === void 0 ? void 0 : _a.parentElement) === null || _b === void 0 ? void 0 : _b.parentElement) === null || _c === void 0 ? void 0 : _c.querySelector(
|
|
87
|
-
(_j = (_g = (_f = (_e = event.target) === null || _e === void 0 ? void 0 : _e.parentElement) === null || _f === void 0 ? void 0 : _f.parentElement) === null || _g === void 0 ? void 0 : _g.querySelector(
|
|
86
|
+
(_d = (_c = (_b = (_a = event.target) === null || _a === void 0 ? void 0 : _a.parentElement) === null || _b === void 0 ? void 0 : _b.parentElement) === null || _c === void 0 ? void 0 : _c.querySelector(".selected-example")) === null || _d === void 0 ? void 0 : _d.classList.remove("selected-example");
|
|
87
|
+
(_j = (_g = (_f = (_e = event.target) === null || _e === void 0 ? void 0 : _e.parentElement) === null || _f === void 0 ? void 0 : _f.parentElement) === null || _g === void 0 ? void 0 : _g.querySelector(".select-example[content-type=\"" + ((_h = event.target) === null || _h === void 0 ? void 0 : _h.value) + "\"]")) === null || _j === void 0 ? void 0 : _j.classList.add("selected-example");
|
|
88
88
|
};
|
|
89
89
|
});
|
|
90
90
|
}
|
|
@@ -91,7 +91,7 @@
|
|
|
91
91
|
<section class="topic" lang="${(r=this.map)===null||r===void 0?void 0:r.lang}">
|
|
92
92
|
${this.renderTopicContent()}
|
|
93
93
|
</section>
|
|
94
|
-
`}update(t){super.update(t),(t.has("map")||t.has("tocNode"))&&this.updateContent()}updateContent(){var t;this.error=void 0,this.content=void 0,this.map&&this.tocNode&&((t=this.service)===null||t===void 0||t.getTopicContent(this.tocNode).then(r=>this.contentPreprocessor(r||'<div class="empty-topic"></div>')).then(r=>this.content=r).catch(r=>this.error=r))}contentAvailableCallback(t){var r,n,o,i,a,s,c;super.contentAvailableCallback(t),!this.disableContextInteractions&&(!((r=this.scrollTarget)===null||r===void 0)&&r.section)&&(!((n=this.tocNode)===null||n===void 0)&&n.tocId)&&((o=this.tocNode)===null||o===void 0?void 0:o.tocId)===this.scrollTarget.tocId&&this.content&&(((a=(i=this.shadowRoot)===null||i===void 0?void 0:i.querySelector(`[id="${this.scrollTarget.section}"], [name="${this.scrollTarget.section}"]`))!==null&&a!==void 0?a:this).
|
|
94
|
+
`}update(t){super.update(t),(t.has("map")||t.has("tocNode"))&&this.updateContent()}updateContent(){var t;this.error=void 0,this.content=void 0,this.map&&this.tocNode&&((t=this.service)===null||t===void 0||t.getTopicContent(this.tocNode).then(r=>this.contentPreprocessor(r||'<div class="empty-topic"></div>')).then(r=>this.content=r).catch(r=>this.error=r))}contentAvailableCallback(t){var r,n,o,i,a,s,c;super.contentAvailableCallback(t),!this.disableContextInteractions&&(!((r=this.scrollTarget)===null||r===void 0)&&r.section)&&(!((n=this.tocNode)===null||n===void 0)&&n.tocId)&&((o=this.tocNode)===null||o===void 0?void 0:o.tocId)===this.scrollTarget.tocId&&this.content&&(((a=(i=this.shadowRoot)===null||i===void 0?void 0:i.querySelector(`[id="${this.scrollTarget.section}"], [name="${this.scrollTarget.section}"]`))!==null&&a!==void 0?a:this).dispatchEvent(new Event("scroll-into-view",{bubbles:!0,composed:!0})),(s=this.stateManager)===null||s===void 0||s.scrollDone()),this.topicContainer&&(this.onContentAvailable(this.topicContainer,this.shadowRoot),(0,ne.highlightHtml)(this.topicContainer,this.searchInDocumentQuery,{attributes:{part:"kwicmatch"}}),this.moveSvgInShadowRoot(),this.processExpandingBlocks(),this.processOpenApiSelect()),(t.has("content")&&this.content||t.has("error")&&this.error)&&performance.mark("fluid_topics__reader_topic_displayed__"+((c=this.tocNode)===null||c===void 0?void 0:c.tocId))}processExpandingBlocks(){this.shadowRoot.querySelectorAll(".ft-expanding-block-link").forEach(t=>{t.onclick=function(){var r,n,o;t.classList.contains("ft-expanding-exclusive")&&!t.classList.contains("ft-expanding-block-expanded")&&Array.from(((r=t.closest(".topic"))===null||r===void 0?void 0:r.querySelectorAll(".ft-expanding-block-expanded"))||[]).forEach(i=>i.classList.remove("ft-expanding-block-expanded")),t.classList.toggle("ft-expanding-block-expanded"),(o=(n=t.closest(".topic"))===null||n===void 0?void 0:n.querySelector("[id='"+t.getAttribute("data-expanding-block-target-id")+"']"))===null||o===void 0||o.classList.toggle("ft-expanding-block-expanded")}})}processOpenApiSelect(){this.shadowRoot.querySelectorAll(".ft-openapi-select").forEach(t=>{t.onchange=function(r){var n,o,i,a,s,c,u,l,h;(a=(i=(o=(n=r.target)===null||n===void 0?void 0:n.parentElement)===null||o===void 0?void 0:o.parentElement)===null||i===void 0?void 0:i.querySelector(".selected-example"))===null||a===void 0||a.classList.remove("selected-example"),(h=(u=(c=(s=r.target)===null||s===void 0?void 0:s.parentElement)===null||c===void 0?void 0:c.parentElement)===null||u===void 0?void 0:u.querySelector('.select-example[content-type="'+((l=r.target)===null||l===void 0?void 0:l.value)+'"]'))===null||h===void 0||h.classList.add("selected-example")}})}moveSvgInShadowRoot(){this.shadowRoot.querySelectorAll(".ft-svg-container").forEach(t=>{if(!t.shadowRoot){let r=t.innerHTML;t.innerHTML="";let n=t.attachShadow({mode:"open"}),o=document.createRange().createContextualFragment(r),i=document.importNode(o,!0);n.append(i)}})}onStoreAvailable(){super.onStoreAvailable(),this.updateContent()}renderTopicContent(){var t,r,n,o;if(this.error)return le.html`
|
|
95
95
|
<div class="topic-on-error">
|
|
96
96
|
<ft-icon>WARNING</ft-icon>
|
|
97
97
|
<div>
|
|
@@ -140,7 +140,7 @@ Also for action icons.`,c.colorGray200),contentGlobalSubtle:o.extend("--ft-conte
|
|
|
140
140
|
<section class="topic" lang="${(r=this.map)===null||r===void 0?void 0:r.lang}">
|
|
141
141
|
${this.renderTopicContent()}
|
|
142
142
|
</section>
|
|
143
|
-
`}update(e){super.update(e),(e.has("map")||e.has("tocNode"))&&this.updateContent()}updateContent(){var e;this.error=void 0,this.content=void 0,this.map&&this.tocNode&&((e=this.service)===null||e===void 0||e.getTopicContent(this.tocNode).then(r=>this.contentPreprocessor(r||'<div class="empty-topic"></div>')).then(r=>this.content=r).catch(r=>this.error=r))}contentAvailableCallback(e){var r,n,a,i,s,l,d;super.contentAvailableCallback(e),!this.disableContextInteractions&&(!((r=this.scrollTarget)===null||r===void 0)&&r.section)&&(!((n=this.tocNode)===null||n===void 0)&&n.tocId)&&((a=this.tocNode)===null||a===void 0?void 0:a.tocId)===this.scrollTarget.tocId&&this.content&&(((s=(i=this.shadowRoot)===null||i===void 0?void 0:i.querySelector(`[id="${this.scrollTarget.section}"], [name="${this.scrollTarget.section}"]`))!==null&&s!==void 0?s:this).
|
|
143
|
+
`}update(e){super.update(e),(e.has("map")||e.has("tocNode"))&&this.updateContent()}updateContent(){var e;this.error=void 0,this.content=void 0,this.map&&this.tocNode&&((e=this.service)===null||e===void 0||e.getTopicContent(this.tocNode).then(r=>this.contentPreprocessor(r||'<div class="empty-topic"></div>')).then(r=>this.content=r).catch(r=>this.error=r))}contentAvailableCallback(e){var r,n,a,i,s,l,d;super.contentAvailableCallback(e),!this.disableContextInteractions&&(!((r=this.scrollTarget)===null||r===void 0)&&r.section)&&(!((n=this.tocNode)===null||n===void 0)&&n.tocId)&&((a=this.tocNode)===null||a===void 0?void 0:a.tocId)===this.scrollTarget.tocId&&this.content&&(((s=(i=this.shadowRoot)===null||i===void 0?void 0:i.querySelector(`[id="${this.scrollTarget.section}"], [name="${this.scrollTarget.section}"]`))!==null&&s!==void 0?s:this).dispatchEvent(new Event("scroll-into-view",{bubbles:!0,composed:!0})),(l=this.stateManager)===null||l===void 0||l.scrollDone()),this.topicContainer&&(this.onContentAvailable(this.topicContainer,this.shadowRoot),ur(this.topicContainer,this.searchInDocumentQuery,{attributes:{part:"kwicmatch"}}),this.moveSvgInShadowRoot(),this.processExpandingBlocks(),this.processOpenApiSelect()),(e.has("content")&&this.content||e.has("error")&&this.error)&&performance.mark("fluid_topics__reader_topic_displayed__"+((d=this.tocNode)===null||d===void 0?void 0:d.tocId))}processExpandingBlocks(){this.shadowRoot.querySelectorAll(".ft-expanding-block-link").forEach(e=>{e.onclick=function(){var r,n,a;e.classList.contains("ft-expanding-exclusive")&&!e.classList.contains("ft-expanding-block-expanded")&&Array.from(((r=e.closest(".topic"))===null||r===void 0?void 0:r.querySelectorAll(".ft-expanding-block-expanded"))||[]).forEach(i=>i.classList.remove("ft-expanding-block-expanded")),e.classList.toggle("ft-expanding-block-expanded"),(a=(n=e.closest(".topic"))===null||n===void 0?void 0:n.querySelector("[id='"+e.getAttribute("data-expanding-block-target-id")+"']"))===null||a===void 0||a.classList.toggle("ft-expanding-block-expanded")}})}processOpenApiSelect(){this.shadowRoot.querySelectorAll(".ft-openapi-select").forEach(e=>{e.onchange=function(r){var n,a,i,s,l,d,u,p,h;(s=(i=(a=(n=r.target)===null||n===void 0?void 0:n.parentElement)===null||a===void 0?void 0:a.parentElement)===null||i===void 0?void 0:i.querySelector(".selected-example"))===null||s===void 0||s.classList.remove("selected-example"),(h=(u=(d=(l=r.target)===null||l===void 0?void 0:l.parentElement)===null||d===void 0?void 0:d.parentElement)===null||u===void 0?void 0:u.querySelector('.select-example[content-type="'+((p=r.target)===null||p===void 0?void 0:p.value)+'"]'))===null||h===void 0||h.classList.add("selected-example")}})}moveSvgInShadowRoot(){this.shadowRoot.querySelectorAll(".ft-svg-container").forEach(e=>{if(!e.shadowRoot){let r=e.innerHTML;e.innerHTML="";let n=e.attachShadow({mode:"open"}),a=document.createRange().createContextualFragment(r),i=document.importNode(a,!0);n.append(i)}})}onStoreAvailable(){super.onStoreAvailable(),this.updateContent()}renderTopicContent(){var e,r,n,a;if(this.error)return oe`
|
|
144
144
|
<div class="topic-on-error">
|
|
145
145
|
<ft-icon>WARNING</ft-icon>
|
|
146
146
|
<div>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluid-topics/ft-reader-topic-content",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.5",
|
|
4
4
|
"description": "Content of a topic in integrated reader.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Lit"
|
|
@@ -19,14 +19,14 @@
|
|
|
19
19
|
"url": "ssh://git@scm.mrs.antidot.net:2222/fluidtopics/ft-web-components.git"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@fluid-topics/ft-chip": "1.2.
|
|
23
|
-
"@fluid-topics/ft-i18n": "1.2.
|
|
24
|
-
"@fluid-topics/ft-reader-context": "1.2.
|
|
25
|
-
"@fluid-topics/ft-reader-topic-context": "1.2.
|
|
26
|
-
"@fluid-topics/ft-tooltip": "1.2.
|
|
27
|
-
"@fluid-topics/ft-wc-utils": "1.2.
|
|
22
|
+
"@fluid-topics/ft-chip": "1.2.5",
|
|
23
|
+
"@fluid-topics/ft-i18n": "1.2.5",
|
|
24
|
+
"@fluid-topics/ft-reader-context": "1.2.5",
|
|
25
|
+
"@fluid-topics/ft-reader-topic-context": "1.2.5",
|
|
26
|
+
"@fluid-topics/ft-tooltip": "1.2.5",
|
|
27
|
+
"@fluid-topics/ft-wc-utils": "1.2.5",
|
|
28
28
|
"@fluid-topics/public-api": "1.0.78",
|
|
29
29
|
"lit": "3.1.0"
|
|
30
30
|
},
|
|
31
|
-
"gitHead": "
|
|
31
|
+
"gitHead": "aec75d3dcbb3256c079ecf330a0f2755e7469584"
|
|
32
32
|
}
|