@fluid-topics/ft-reader-topic-content 1.2.63 → 1.2.65
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.
|
@@ -77,8 +77,10 @@ class FtReaderTopicContent extends FtReaderTopicComponent {
|
|
|
77
77
|
}
|
|
78
78
|
processExpandingBlocks() {
|
|
79
79
|
for (let link of this.shadowRoot.querySelectorAll(".ft-expanding-block-link")) {
|
|
80
|
-
link.onclick = () => {
|
|
80
|
+
link.onclick = (e) => {
|
|
81
81
|
var _a, _b, _c, _d;
|
|
82
|
+
e.stopPropagation();
|
|
83
|
+
e.preventDefault();
|
|
82
84
|
if (link.classList.contains("ft-expanding-exclusive")
|
|
83
85
|
&& !link.classList.contains("ft-expanding-block-expanded")) {
|
|
84
86
|
for (let block of Array.from((_b = (_a = this.topicContainer) === null || _a === void 0 ? void 0 : _a.querySelectorAll(".ft-expanding-block-expanded")) !== null && _b !== void 0 ? _b : [])) {
|
|
@@ -96,7 +96,7 @@
|
|
|
96
96
|
<section class="topic" lang="${this.getTopicLanguage()}">
|
|
97
97
|
${this.renderTopicContent()}
|
|
98
98
|
</section>
|
|
99
|
-
`}update(t){super.update(t),["map","tocNode","translationDestinationLanguage","translationProfileId"].some(r=>t.has(r))&&this.updateContent()}updateContent(){var t;this.error=void 0,this.content=void 0,this.map&&this.tocNode&&((t=this.stateManager)===null||t===void 0||t.fetchTopicContent(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,i,a,s,o,l;if(super.contentAvailableCallback(t),!this.disableContextInteractions&&(!((r=this.scrollTarget)===null||r===void 0)&&r.section)&&(!((n=this.tocNode)===null||n===void 0)&&n.tocId)&&((i=this.tocNode)===null||i===void 0?void 0:i.tocId)===this.scrollTarget.tocId&&this.content){let c=(s=(a=this.shadowRoot)===null||a===void 0?void 0:a.querySelector(`[id="${this.scrollTarget.section}"], [name="${this.scrollTarget.section}"]`))!==null&&s!==void 0?s:this;c.tabIndex=-1,c.focus(),c.dispatchEvent(new Event("scroll-into-view",{bubbles:!0,composed:!0})),(o=this.stateManager)===null||o===void 0||o.scrollDone()}(t.has("searchInDocumentQuery")||t.has("content"))&&this.content&&(0,B.waitFor)(()=>this.topicContainer).then(c=>{(0,B.highlightHtml)(c,this.searchInDocumentQuery,{attributes:{part:"kwicmatch"}})}),t.has("content")&&this.content&&(0,B.waitFor)(()=>this.topicContainer).then(c=>{this.moveSvgInShadowRoot(),this.processExpandingBlocks(),this.processOpenApiSelect(),this.onContentAvailable(c,this.shadowRoot)}),(t.has("content")&&this.content||t.has("error")&&this.error)&&performance.mark("fluid_topics__reader_topic_displayed__"+((l=this.tocNode)===null||l===void 0?void 0:l.tocId))}processExpandingBlocks(){for(let t of this.shadowRoot.querySelectorAll(".ft-expanding-block-link"))t.onclick=
|
|
99
|
+
`}update(t){super.update(t),["map","tocNode","translationDestinationLanguage","translationProfileId"].some(r=>t.has(r))&&this.updateContent()}updateContent(){var t;this.error=void 0,this.content=void 0,this.map&&this.tocNode&&((t=this.stateManager)===null||t===void 0||t.fetchTopicContent(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,i,a,s,o,l;if(super.contentAvailableCallback(t),!this.disableContextInteractions&&(!((r=this.scrollTarget)===null||r===void 0)&&r.section)&&(!((n=this.tocNode)===null||n===void 0)&&n.tocId)&&((i=this.tocNode)===null||i===void 0?void 0:i.tocId)===this.scrollTarget.tocId&&this.content){let c=(s=(a=this.shadowRoot)===null||a===void 0?void 0:a.querySelector(`[id="${this.scrollTarget.section}"], [name="${this.scrollTarget.section}"]`))!==null&&s!==void 0?s:this;c.tabIndex=-1,c.focus(),c.dispatchEvent(new Event("scroll-into-view",{bubbles:!0,composed:!0})),(o=this.stateManager)===null||o===void 0||o.scrollDone()}(t.has("searchInDocumentQuery")||t.has("content"))&&this.content&&(0,B.waitFor)(()=>this.topicContainer).then(c=>{(0,B.highlightHtml)(c,this.searchInDocumentQuery,{attributes:{part:"kwicmatch"}})}),t.has("content")&&this.content&&(0,B.waitFor)(()=>this.topicContainer).then(c=>{this.moveSvgInShadowRoot(),this.processExpandingBlocks(),this.processOpenApiSelect(),this.onContentAvailable(c,this.shadowRoot)}),(t.has("content")&&this.content||t.has("error")&&this.error)&&performance.mark("fluid_topics__reader_topic_displayed__"+((l=this.tocNode)===null||l===void 0?void 0:l.tocId))}processExpandingBlocks(){for(let t of this.shadowRoot.querySelectorAll(".ft-expanding-block-link"))t.onclick=r=>{var n,i,a,s;if(r.stopPropagation(),r.preventDefault(),t.classList.contains("ft-expanding-exclusive")&&!t.classList.contains("ft-expanding-block-expanded"))for(let l of Array.from((i=(n=this.topicContainer)===null||n===void 0?void 0:n.querySelectorAll(".ft-expanding-block-expanded"))!==null&&i!==void 0?i:[]))l.classList.remove("ft-expanding-block-expanded");t.classList.toggle("ft-expanding-block-expanded");let o=t.getAttribute("data-expanding-block-target-id");(s=(a=this.topicContainer)===null||a===void 0?void 0:a.querySelector("[id='"+o+"']"))===null||s===void 0||s.classList.toggle("ft-expanding-block-expanded")}}processOpenApiSelect(){for(let t of this.shadowRoot.querySelectorAll(".ft-openapi-select"))t.onchange=r=>{var n,i,a;let s=r.target,o=(n=s?.parentElement)===null||n===void 0?void 0:n.parentElement,l=o?.querySelector('.select-example[content-type="'+s.value+'"]');(a=(i=l?.parentElement)===null||i===void 0?void 0:i.querySelector(":scope > .selected-example"))===null||a===void 0||a.classList.toggle("selected-example"),l?.classList.toggle("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"}),i=document.createRange().createContextualFragment(r),a=document.importNode(i,!0);n.append(a)}})}onStoreAvailable(){super.onStoreAvailable(),this.updateContent()}renderTopicContent(){var t,r,n;if(this.error)return he.html`
|
|
100
100
|
<div class="topic-on-error">
|
|
101
101
|
<ft-icon>WARNING</ft-icon>
|
|
102
102
|
<div>
|
|
@@ -142,7 +142,7 @@ Also for action icons.`,c.colorGray200),contentGlobalSubtle:r.extend("--ft-conte
|
|
|
142
142
|
<section class="topic" lang="${this.getTopicLanguage()}">
|
|
143
143
|
${this.renderTopicContent()}
|
|
144
144
|
</section>
|
|
145
|
-
`}update(e){super.update(e),["map","tocNode","translationDestinationLanguage","translationProfileId"].some(o=>e.has(o))&&this.updateContent()}updateContent(){var e;this.error=void 0,this.content=void 0,this.map&&this.tocNode&&((e=this.stateManager)===null||e===void 0||e.fetchTopicContent(this.tocNode).then(o=>this.contentPreprocessor(o||'<div class="empty-topic"></div>')).then(o=>this.content=o).catch(o=>this.error=o))}contentAvailableCallback(e){var o,n,a,i,s,l,d;if(super.contentAvailableCallback(e),!this.disableContextInteractions&&(!((o=this.scrollTarget)===null||o===void 0)&&o.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){let p=(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;p.tabIndex=-1,p.focus(),p.dispatchEvent(new Event("scroll-into-view",{bubbles:!0,composed:!0})),(l=this.stateManager)===null||l===void 0||l.scrollDone()}(e.has("searchInDocumentQuery")||e.has("content"))&&this.content&&jt(()=>this.topicContainer).then(p=>{tr(p,this.searchInDocumentQuery,{attributes:{part:"kwicmatch"}})}),e.has("content")&&this.content&&jt(()=>this.topicContainer).then(p=>{this.moveSvgInShadowRoot(),this.processExpandingBlocks(),this.processOpenApiSelect(),this.onContentAvailable(p,this.shadowRoot)}),(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(){for(let e of this.shadowRoot.querySelectorAll(".ft-expanding-block-link"))e.onclick=
|
|
145
|
+
`}update(e){super.update(e),["map","tocNode","translationDestinationLanguage","translationProfileId"].some(o=>e.has(o))&&this.updateContent()}updateContent(){var e;this.error=void 0,this.content=void 0,this.map&&this.tocNode&&((e=this.stateManager)===null||e===void 0||e.fetchTopicContent(this.tocNode).then(o=>this.contentPreprocessor(o||'<div class="empty-topic"></div>')).then(o=>this.content=o).catch(o=>this.error=o))}contentAvailableCallback(e){var o,n,a,i,s,l,d;if(super.contentAvailableCallback(e),!this.disableContextInteractions&&(!((o=this.scrollTarget)===null||o===void 0)&&o.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){let p=(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;p.tabIndex=-1,p.focus(),p.dispatchEvent(new Event("scroll-into-view",{bubbles:!0,composed:!0})),(l=this.stateManager)===null||l===void 0||l.scrollDone()}(e.has("searchInDocumentQuery")||e.has("content"))&&this.content&&jt(()=>this.topicContainer).then(p=>{tr(p,this.searchInDocumentQuery,{attributes:{part:"kwicmatch"}})}),e.has("content")&&this.content&&jt(()=>this.topicContainer).then(p=>{this.moveSvgInShadowRoot(),this.processExpandingBlocks(),this.processOpenApiSelect(),this.onContentAvailable(p,this.shadowRoot)}),(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(){for(let e of this.shadowRoot.querySelectorAll(".ft-expanding-block-link"))e.onclick=o=>{var n,a,i,s;if(o.stopPropagation(),o.preventDefault(),e.classList.contains("ft-expanding-exclusive")&&!e.classList.contains("ft-expanding-block-expanded"))for(let d of Array.from((a=(n=this.topicContainer)===null||n===void 0?void 0:n.querySelectorAll(".ft-expanding-block-expanded"))!==null&&a!==void 0?a:[]))d.classList.remove("ft-expanding-block-expanded");e.classList.toggle("ft-expanding-block-expanded");let l=e.getAttribute("data-expanding-block-target-id");(s=(i=this.topicContainer)===null||i===void 0?void 0:i.querySelector("[id='"+l+"']"))===null||s===void 0||s.classList.toggle("ft-expanding-block-expanded")}}processOpenApiSelect(){for(let e of this.shadowRoot.querySelectorAll(".ft-openapi-select"))e.onchange=o=>{var n,a,i;let s=o.target,l=(n=s?.parentElement)===null||n===void 0?void 0:n.parentElement,d=l?.querySelector('.select-example[content-type="'+s.value+'"]');(i=(a=d?.parentElement)===null||a===void 0?void 0:a.querySelector(":scope > .selected-example"))===null||i===void 0||i.classList.toggle("selected-example"),d?.classList.toggle("selected-example")}}moveSvgInShadowRoot(){this.shadowRoot.querySelectorAll(".ft-svg-container").forEach(e=>{if(!e.shadowRoot){let o=e.innerHTML;e.innerHTML="";let n=e.attachShadow({mode:"open"}),a=document.createRange().createContextualFragment(o),i=document.importNode(a,!0);n.append(i)}})}onStoreAvailable(){super.onStoreAvailable(),this.updateContent()}renderTopicContent(){var e,o,n;if(this.error)return ee`
|
|
146
146
|
<div class="topic-on-error">
|
|
147
147
|
<ft-icon>WARNING</ft-icon>
|
|
148
148
|
<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.65",
|
|
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.65",
|
|
23
|
+
"@fluid-topics/ft-i18n": "1.2.65",
|
|
24
|
+
"@fluid-topics/ft-reader-context": "1.2.65",
|
|
25
|
+
"@fluid-topics/ft-reader-topic-context": "1.2.65",
|
|
26
|
+
"@fluid-topics/ft-tooltip": "1.2.65",
|
|
27
|
+
"@fluid-topics/ft-wc-utils": "1.2.65",
|
|
28
28
|
"@fluid-topics/public-api": "1.0.95",
|
|
29
29
|
"lit": "3.1.0"
|
|
30
30
|
},
|
|
31
|
-
"gitHead": "
|
|
31
|
+
"gitHead": "b8d0b476bbd82accf3db4615d1dad9f47091a3d6"
|
|
32
32
|
}
|