@fluid-topics/ft-reader-topic-title 1.2.35 → 1.2.37
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.
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
import { nothing, PropertyValues } from "lit";
|
|
2
2
|
import { FtReaderTopicTitleProperties } from "./ft-reader-topic-title.properties";
|
|
3
3
|
import { FtReaderTopicComponent } from "@fluid-topics/ft-reader-topic-context/build/registration";
|
|
4
|
+
import { ElementDefinitionsMap } from "@fluid-topics/ft-wc-utils";
|
|
4
5
|
export declare class FtReaderTopicTitle extends FtReaderTopicComponent implements FtReaderTopicTitleProperties {
|
|
6
|
+
static elementDefinitions: ElementDefinitionsMap;
|
|
5
7
|
static styles: import("lit").CSSResult[];
|
|
6
8
|
private map?;
|
|
7
9
|
private searchInDocumentQuery?;
|
|
10
|
+
private translationDestinationLanguage?;
|
|
11
|
+
private translationLoading?;
|
|
12
|
+
private translationError?;
|
|
8
13
|
titleContainer?: HTMLElement;
|
|
9
14
|
protected render(): typeof nothing | import("lit-html").TemplateResult;
|
|
10
15
|
protected updated(props: PropertyValues): void;
|
|
16
|
+
private getTopicLanguage;
|
|
11
17
|
}
|
|
@@ -10,23 +10,27 @@ import { FtReaderTopicComponent } from "@fluid-topics/ft-reader-topic-context/bu
|
|
|
10
10
|
import { highlightHtml, highlightHtmlStyles, redux, waitFor } from "@fluid-topics/ft-wc-utils";
|
|
11
11
|
import { html, unsafeStatic } from "lit/static-html.js";
|
|
12
12
|
import { query } from "lit/decorators.js";
|
|
13
|
+
import { FtSkeleton } from "@fluid-topics/ft-skeleton";
|
|
13
14
|
class FtReaderTopicTitle extends FtReaderTopicComponent {
|
|
14
15
|
render() {
|
|
15
|
-
var _a, _b, _c, _d, _e
|
|
16
|
-
if (!this.map || !this.tocNode) {
|
|
16
|
+
var _a, _b, _c, _d, _e;
|
|
17
|
+
if ((!this.map || !this.tocNode) && !this.translationLoading) {
|
|
17
18
|
return nothing;
|
|
18
19
|
}
|
|
19
20
|
const titleTag = `h${Math.min((((_a = this.tocNode) === null || _a === void 0 ? void 0 : _a.depth) || 1), 6)}`;
|
|
20
21
|
const customClasses = (_c = (_b = this.map) === null || _b === void 0 ? void 0 : _b.contentStyles.customCssClasses.join(" ")) !== null && _c !== void 0 ? _c : "";
|
|
21
|
-
const lang = (_d = this.map) === null || _d === void 0 ? void 0 : _d.lang;
|
|
22
22
|
return html `
|
|
23
23
|
<style>
|
|
24
|
-
@import "${(
|
|
24
|
+
@import "${(_d = this.map) === null || _d === void 0 ? void 0 : _d.contentStyles.titleStylesheetUrl}";
|
|
25
25
|
</style>
|
|
26
|
-
<section class="title" lang="${
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
26
|
+
<section class="title" lang="${this.getTopicLanguage()}">
|
|
27
|
+
${this.translationLoading
|
|
28
|
+
? html `
|
|
29
|
+
<ft-skeleton></ft-skeleton>`
|
|
30
|
+
: html `
|
|
31
|
+
<div class="depth-${(_e = this.tocNode) === null || _e === void 0 ? void 0 : _e.depth} content-locale-${this.getTopicLanguage()} ${customClasses}">
|
|
32
|
+
<${unsafeStatic(titleTag)}>${this.tocNode.title}</${unsafeStatic(titleTag)}>
|
|
33
|
+
</div>`}
|
|
30
34
|
</section>
|
|
31
35
|
`;
|
|
32
36
|
}
|
|
@@ -36,7 +40,14 @@ class FtReaderTopicTitle extends FtReaderTopicComponent {
|
|
|
36
40
|
.then(() => waitFor(() => this.titleContainer))
|
|
37
41
|
.then(titleContainer => highlightHtml(titleContainer, this.disableContextInteractions ? "" : this.searchInDocumentQuery, { attributes: { part: "kwicmatch" } }));
|
|
38
42
|
}
|
|
43
|
+
getTopicLanguage() {
|
|
44
|
+
var _a;
|
|
45
|
+
return (this.translationDestinationLanguage && !this.translationError) ? this.translationDestinationLanguage.code : (_a = this.map) === null || _a === void 0 ? void 0 : _a.lang;
|
|
46
|
+
}
|
|
39
47
|
}
|
|
48
|
+
FtReaderTopicTitle.elementDefinitions = {
|
|
49
|
+
"ft-skeleton": FtSkeleton,
|
|
50
|
+
};
|
|
40
51
|
FtReaderTopicTitle.styles = [
|
|
41
52
|
styles,
|
|
42
53
|
highlightHtmlStyles
|
|
@@ -47,6 +58,15 @@ __decorate([
|
|
|
47
58
|
__decorate([
|
|
48
59
|
redux({ selector: (s, self) => self.disableContextInteractions ? "" : s.searchInDocumentQuery })
|
|
49
60
|
], FtReaderTopicTitle.prototype, "searchInDocumentQuery", void 0);
|
|
61
|
+
__decorate([
|
|
62
|
+
redux({ selector: (s) => s.translation.destinationLanguage })
|
|
63
|
+
], FtReaderTopicTitle.prototype, "translationDestinationLanguage", void 0);
|
|
64
|
+
__decorate([
|
|
65
|
+
redux({ selector: (s) => s.translation.isLoading })
|
|
66
|
+
], FtReaderTopicTitle.prototype, "translationLoading", void 0);
|
|
67
|
+
__decorate([
|
|
68
|
+
redux({ selector: (s) => s.translation.isError })
|
|
69
|
+
], FtReaderTopicTitle.prototype, "translationError", void 0);
|
|
50
70
|
__decorate([
|
|
51
71
|
query("section.title")
|
|
52
72
|
], FtReaderTopicTitle.prototype, "titleContainer", void 0);
|
|
@@ -1,19 +1,53 @@
|
|
|
1
|
-
"use strict";(()=>{var
|
|
1
|
+
"use strict";(()=>{var jt=Object.create;var rt=Object.defineProperty;var Bt=Object.getOwnPropertyDescriptor;var Wt=Object.getOwnPropertyNames;var Ft=Object.getPrototypeOf,Ut=Object.prototype.hasOwnProperty;var U=(i,t)=>()=>(t||i((t={exports:{}}).exports,t),t.exports);var Vt=(i,t,e,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Wt(t))!Ut.call(i,o)&&o!==e&&rt(i,o,{get:()=>t[o],enumerable:!(s=Bt(t,o))||s.enumerable});return i};var u=(i,t,e)=>(e=i!=null?jt(Ft(i)):{},Vt(t||!i||!i.__esModule?rt(e,"default",{value:i,enumerable:!0}):e,i));var v=U((ee,at)=>{at.exports=ftGlobals.wcUtils});var H=U((ie,lt)=>{lt.exports=ftGlobals.lit});var k=U((oe,dt)=>{dt.exports=ftGlobals.litDecorators});var Pt=u(v());var kt=u(H());var ht=u(H()),L=u(v()),Kt={fontFamily:L.FtCssVariableFactory.external(L.designSystemVariables.titleFont,"Design system")},ct=ht.css`
|
|
2
2
|
.title {
|
|
3
|
-
font-family: ${
|
|
3
|
+
font-family: ${Kt.fontFamily};
|
|
4
4
|
}
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
|
|
6
|
+
ft-skeleton {
|
|
7
|
+
width: 150px;
|
|
8
|
+
}
|
|
9
|
+
`;var G=u(k());var ut=u(v()),mt=u(k());var pt;(function(i){i.FEEDBACK="FEEDBACK",i.RATING="RATING",i.PRINT="PRINT",i.BOOKMARK="BOOKMARK",i.COLLECTIONS="COLLECTIONS",i.PERSONAL_BOOKS="PERSONAL_BOOKS"})(pt||(pt={}));var Zt=function(i,t,e,s){var o=arguments.length,n=o<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,e):s,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,t,e,s);else for(var l=i.length-1;l>=0;l--)(r=i[l])&&(n=(o<3?r(n):o>3?r(t,e,n):r(t,e))||n);return o>3&&n&&Object.defineProperty(t,e,n),n},K=class extends Event{constructor(){super("register-ft-reader-component",{bubbles:!0,composed:!0})}},V=Symbol("registerInterval");function Gt(i){var t;class e extends i{constructor(){super(...arguments),this[t]=0}setReaderStateManager(o){this.clearStateManager(),this.stateManager=o,this.addStore(o.store,"reader")}clearStateManager(){this.stateManager&&(this.removeStore("reader"),this.stateManager=void 0)}get service(){var o;return(o=this.stateManager)===null||o===void 0?void 0:o.service}connectedCallback(){super.connectedCallback(),this[V]=window.setInterval(()=>this.tryToRegisterToContext(),50)}tryToRegisterToContext(){this.stateManager!=null?window.clearInterval(this[V]):this.dispatchEvent(new K)}disconnectedCallback(){super.disconnectedCallback(),this.clearStateManager()}}return t=V,Zt([(0,mt.state)()],e.prototype,"stateManager",void 0),e}var D=class extends Gt(ut.FtLitElementRedux){};var ft=function(i,t,e,s){var o=arguments.length,n=o<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,e):s,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,t,e,s);else for(var l=i.length-1;l>=0;l--)(r=i[l])&&(n=(o<3?r(n):o>3?r(t,e,n):r(t,e))||n);return o>3&&n&&Object.defineProperty(t,e,n),n},Q=class extends Event{constructor(){super("register-ft-reader-topic-component",{bubbles:!0,composed:!0})}},Z=Symbol("registerInterval");function Qt(i){var t;class e extends i{constructor(){super(...arguments),this.disableContextInteractions=!1,this[t]=0}connectedCallback(){super.connectedCallback(),this[Z]=window.setInterval(()=>this.tryToRegisterToTopicContext(),50)}tryToRegisterToTopicContext(){this.tocNode!=null?window.clearInterval(this[Z]):this.dispatchEvent(new Q)}disconnectedCallback(){super.disconnectedCallback(),this.tocNode=void 0}}return t=Z,ft([(0,G.state)()],e.prototype,"tocNode",void 0),ft([(0,G.state)()],e.prototype,"disableContextInteractions",void 0),e}var P=class extends Qt(D){};var $=u(v());var et=globalThis,j=et.trustedTypes,$t=j?j.createPolicy("lit-html",{createHTML:i=>i}):void 0,xt="$lit$",y=`lit$${Math.random().toFixed(9).slice(2)}$`,bt="?"+y,zt=`<${bt}>`,S=document,B=()=>S.createComment(""),O=i=>i===null||typeof i!="object"&&typeof i!="function",it=Array.isArray,qt=i=>it(i)||typeof i?.[Symbol.iterator]=="function",z=`[
|
|
10
|
+
\f\r]`,I=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,gt=/-->/g,_t=/>/g,b=RegExp(`>|${z}(?:([^\\s"'>=/]+)(${z}*=${z}*(?:[^
|
|
11
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),At=/'/g,vt=/"/g,Ct=/^(?:script|style|textarea|title)$/i,st=i=>(t,...e)=>({_$litType$:i,strings:t,values:e}),St=st(1),Nt=st(2),Tt=st(3),E=Symbol.for("lit-noChange"),p=Symbol.for("lit-nothing"),yt=new WeakMap,C=S.createTreeWalker(S,129);function wt(i,t){if(!it(i)||!i.hasOwnProperty("raw"))throw Error("invalid template strings array");return $t!==void 0?$t.createHTML(t):t}var Yt=(i,t)=>{let e=i.length-1,s=[],o,n=t===2?"<svg>":t===3?"<math>":"",r=I;for(let l=0;l<e;l++){let a=i[l],h,d,c=-1,_=0;for(;_<a.length&&(r.lastIndex=_,d=r.exec(a),d!==null);)_=r.lastIndex,r===I?d[1]==="!--"?r=gt:d[1]!==void 0?r=_t:d[2]!==void 0?(Ct.test(d[2])&&(o=RegExp("</"+d[2],"g")),r=b):d[3]!==void 0&&(r=b):r===b?d[0]===">"?(r=o??I,c=-1):d[1]===void 0?c=-2:(c=r.lastIndex-d[2].length,h=d[1],r=d[3]===void 0?b:d[3]==='"'?vt:At):r===vt||r===At?r=b:r===gt||r===_t?r=I:(r=b,o=void 0);let A=r===b&&i[l+1].startsWith("/>")?" ":"";n+=r===I?a+zt:c>=0?(s.push(h),a.slice(0,c)+xt+a.slice(c)+y+A):a+y+(c===-2?l:A)}return[wt(i,n+(i[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),s]},M=class i{constructor({strings:t,_$litType$:e},s){let o;this.parts=[];let n=0,r=0,l=t.length-1,a=this.parts,[h,d]=Yt(t,e);if(this.el=i.createElement(h,s),C.currentNode=this.el.content,e===2||e===3){let c=this.el.content.firstChild;c.replaceWith(...c.childNodes)}for(;(o=C.nextNode())!==null&&a.length<l;){if(o.nodeType===1){if(o.hasAttributes())for(let c of o.getAttributeNames())if(c.endsWith(xt)){let _=d[r++],A=o.getAttribute(c).split(y),R=/([.?@])?(.*)/.exec(_);a.push({type:1,index:n,name:R[2],strings:A,ctor:R[1]==="."?Y:R[1]==="?"?J:R[1]==="@"?X:T}),o.removeAttribute(c)}else c.startsWith(y)&&(a.push({type:6,index:n}),o.removeAttribute(c));if(Ct.test(o.tagName)){let c=o.textContent.split(y),_=c.length-1;if(_>0){o.textContent=j?j.emptyScript:"";for(let A=0;A<_;A++)o.append(c[A],B()),C.nextNode(),a.push({type:2,index:++n});o.append(c[_],B())}}}else if(o.nodeType===8)if(o.data===bt)a.push({type:2,index:n});else{let c=-1;for(;(c=o.data.indexOf(y,c+1))!==-1;)a.push({type:7,index:n}),c+=y.length-1}n++}}static createElement(t,e){let s=S.createElement("template");return s.innerHTML=t,s}};function N(i,t,e=i,s){if(t===E)return t;let o=s!==void 0?e._$Co?.[s]:e._$Cl,n=O(t)?void 0:t._$litDirective$;return o?.constructor!==n&&(o?._$AO?.(!1),n===void 0?o=void 0:(o=new n(i),o._$AT(i,e,s)),s!==void 0?(e._$Co??=[])[s]=o:e._$Cl=o),o!==void 0&&(t=N(i,o._$AS(i,t.values),o,s)),t}var q=class{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){let{el:{content:e},parts:s}=this._$AD,o=(t?.creationScope??S).importNode(e,!0);C.currentNode=o;let n=C.nextNode(),r=0,l=0,a=s[0];for(;a!==void 0;){if(r===a.index){let h;a.type===2?h=new W(n,n.nextSibling,this,t):a.type===1?h=new a.ctor(n,a.name,a.strings,this,t):a.type===6&&(h=new tt(n,this,t)),this._$AV.push(h),a=s[++l]}r!==a?.index&&(n=C.nextNode(),r++)}return C.currentNode=S,o}p(t){let e=0;for(let s of this._$AV)s!==void 0&&(s.strings!==void 0?(s._$AI(t,s,e),e+=s.strings.length-2):s._$AI(t[e])),e++}},W=class i{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,s,o){this.type=2,this._$AH=p,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=s,this.options=o,this._$Cv=o?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode,e=this._$AM;return e!==void 0&&t?.nodeType===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=N(this,t,e),O(t)?t===p||t==null||t===""?(this._$AH!==p&&this._$AR(),this._$AH=p):t!==this._$AH&&t!==E&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):qt(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==p&&O(this._$AH)?this._$AA.nextSibling.data=t:this.T(S.createTextNode(t)),this._$AH=t}$(t){let{values:e,_$litType$:s}=t,o=typeof s=="number"?this._$AC(t):(s.el===void 0&&(s.el=M.createElement(wt(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===o)this._$AH.p(e);else{let n=new q(o,this),r=n.u(this.options);n.p(e),this.T(r),this._$AH=n}}_$AC(t){let e=yt.get(t.strings);return e===void 0&&yt.set(t.strings,e=new M(t)),e}k(t){it(this._$AH)||(this._$AH=[],this._$AR());let e=this._$AH,s,o=0;for(let n of t)o===e.length?e.push(s=new i(this.O(B()),this.O(B()),this,this.options)):s=e[o],s._$AI(n),o++;o<e.length&&(this._$AR(s&&s._$AB.nextSibling,o),e.length=o)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t&&t!==this._$AB;){let s=t.nextSibling;t.remove(),t=s}}setConnected(t){this._$AM===void 0&&(this._$Cv=t,this._$AP?.(t))}},T=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,s,o,n){this.type=1,this._$AH=p,this._$AN=void 0,this.element=t,this.name=e,this._$AM=o,this.options=n,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=p}_$AI(t,e=this,s,o){let n=this.strings,r=!1;if(n===void 0)t=N(this,t,e,0),r=!O(t)||t!==this._$AH&&t!==E,r&&(this._$AH=t);else{let l=t,a,h;for(t=n[0],a=0;a<n.length-1;a++)h=N(this,l[s+a],e,a),h===E&&(h=this._$AH[a]),r||=!O(h)||h!==this._$AH[a],h===p?t=p:t!==p&&(t+=(h??"")+n[a+1]),this._$AH[a]=h}r&&!o&&this.j(t)}j(t){t===p?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}},Y=class extends T{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===p?void 0:t}},J=class extends T{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==p)}},X=class extends T{constructor(t,e,s,o,n){super(t,e,s,o,n),this.type=5}_$AI(t,e=this){if((t=N(this,t,e,0)??p)===E)return;let s=this._$AH,o=t===p&&s!==p||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,n=t!==p&&(s===p||o);o&&this.element.removeEventListener(this.name,this,s),n&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}},tt=class{constructor(t,e,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){N(this,t)}};var Jt=et.litHtmlPolyfillSupport;Jt?.(M,W),(et.litHtmlVersions??=[]).push("3.3.0");var It=Symbol.for(""),Xt=i=>{if(i?.r===It)return i?._$litStatic$},ot=i=>({_$litStatic$:i,r:It});var Ht=new Map,nt=i=>(t,...e)=>{let s=e.length,o,n,r=[],l=[],a,h=0,d=!1;for(;h<s;){for(a=t[h];h<s&&(n=e[h],(o=Xt(n))!==void 0);)a+=o+t[++h],d=!0;h!==s&&l.push(n),r.push(a),h++}if(h===s&&r.push(t[s]),d){let c=r.join("$$lit$$");(t=Ht.get(c))===void 0&&(r.raw=r,Ht.set(c,t=r)),e=l}return i(t,...e)},F=nt(St),pe=nt(Nt),ue=nt(Tt);var Dt=u(k());var Lt=u(v());var Mt=u(H()),Rt=u(v());var Ot=u(H()),g=u(v()),m={display:g.FtCssVariableFactory.create("--ft-skeleton--display","","DISPLAY","block"),width:g.FtCssVariableFactory.create("--ft-skeleton--width","","SIZE","100%"),height:g.FtCssVariableFactory.create("--ft-skeleton--height","","SIZE","20px"),backgroundColor:g.FtCssVariableFactory.create("--ft-skeleton--background-color","","COLOR","#f1f1f1"),glareWidth:g.FtCssVariableFactory.create("--ft-skeleton--glare-width","","SIZE","200px"),glareColor:g.FtCssVariableFactory.create("--ft-skeleton--glare-color","","COLOR","rgba(255, 255, 255, .6)"),animationDuration:g.FtCssVariableFactory.create("--ft-skeleton--animation-duration","","UNKNOWN","2s"),borderRadiusM:g.FtCssVariableFactory.external(g.designSystemVariables.borderRadiusM,"Design system")},Et=Ot.css`
|
|
12
|
+
:host {
|
|
13
|
+
width: ${m.width};
|
|
14
|
+
height: ${m.height};
|
|
15
|
+
display: ${m.display};
|
|
16
|
+
overflow: hidden;
|
|
17
|
+
border-radius: ${m.borderRadiusM};
|
|
18
|
+
background: linear-gradient(
|
|
19
|
+
90deg,
|
|
20
|
+
transparent,
|
|
21
|
+
${m.glareColor} calc(0.45 * ${m.glareWidth}),
|
|
22
|
+
${m.glareColor} calc(0.55 * ${m.glareWidth}),
|
|
23
|
+
transparent ${m.glareWidth}
|
|
24
|
+
), ${m.backgroundColor};
|
|
25
|
+
background-repeat: repeat-y;
|
|
26
|
+
background-size: 100vw 100vh;
|
|
27
|
+
background-attachment: fixed;
|
|
28
|
+
background-position: calc(${m.glareWidth} * -1) 0;
|
|
29
|
+
animation: shine ${m.animationDuration} infinite;
|
|
30
|
+
animation-timing-function: linear;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
@keyframes shine {
|
|
34
|
+
to {
|
|
35
|
+
background-position: calc(100vw + ${m.glareWidth}) 0, calc(${m.glareWidth} * -1) 0;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
`;var x=class extends Rt.FtLitElement{render(){return Mt.html`
|
|
39
|
+
`}};x.elementDefinitions={};x.styles=Et;(0,Lt.customElement)("ft-skeleton")(x);var w=function(i,t,e,s){var o=arguments.length,n=o<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,e):s,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,t,e,s);else for(var l=i.length-1;l>=0;l--)(r=i[l])&&(n=(o<3?r(n):o>3?r(t,e,n):r(t,e))||n);return o>3&&n&&Object.defineProperty(t,e,n),n},f=class extends P{render(){var t,e,s,o,n;if((!this.map||!this.tocNode)&&!this.translationLoading)return kt.nothing;let r=`h${Math.min(((t=this.tocNode)===null||t===void 0?void 0:t.depth)||1,6)}`,l=(s=(e=this.map)===null||e===void 0?void 0:e.contentStyles.customCssClasses.join(" "))!==null&&s!==void 0?s:"";return F`
|
|
8
40
|
<style>
|
|
9
|
-
@import "${(
|
|
41
|
+
@import "${(o=this.map)===null||o===void 0?void 0:o.contentStyles.titleStylesheetUrl}";
|
|
10
42
|
</style>
|
|
11
|
-
<section class="title" lang="${
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
43
|
+
<section class="title" lang="${this.getTopicLanguage()}">
|
|
44
|
+
${this.translationLoading?F`
|
|
45
|
+
<ft-skeleton></ft-skeleton>`:F`
|
|
46
|
+
<div class="depth-${(n=this.tocNode)===null||n===void 0?void 0:n.depth} content-locale-${this.getTopicLanguage()} ${l}">
|
|
47
|
+
<${ot(r)}>${this.tocNode.title}</${ot(r)}>
|
|
48
|
+
</div>`}
|
|
15
49
|
</section>
|
|
16
|
-
`}updated(t){super.updated(t),this.updateComplete.then(()=>(0
|
|
50
|
+
`}updated(t){super.updated(t),this.updateComplete.then(()=>(0,$.waitFor)(()=>this.titleContainer)).then(e=>(0,$.highlightHtml)(e,this.disableContextInteractions?"":this.searchInDocumentQuery,{attributes:{part:"kwicmatch"}}))}getTopicLanguage(){var t;return this.translationDestinationLanguage&&!this.translationError?this.translationDestinationLanguage.code:(t=this.map)===null||t===void 0?void 0:t.lang}};f.elementDefinitions={"ft-skeleton":x};f.styles=[ct,$.highlightHtmlStyles];w([(0,$.redux)()],f.prototype,"map",void 0);w([(0,$.redux)({selector:(i,t)=>t.disableContextInteractions?"":i.searchInDocumentQuery})],f.prototype,"searchInDocumentQuery",void 0);w([(0,$.redux)({selector:i=>i.translation.destinationLanguage})],f.prototype,"translationDestinationLanguage",void 0);w([(0,$.redux)({selector:i=>i.translation.isLoading})],f.prototype,"translationLoading",void 0);w([(0,$.redux)({selector:i=>i.translation.isError})],f.prototype,"translationError",void 0);w([(0,Dt.query)("section.title")],f.prototype,"titleContainer",void 0);(0,Pt.customElement)("ft-reader-topic-title")(f);})();
|
|
17
51
|
/*! Bundled license information:
|
|
18
52
|
|
|
19
53
|
lit-html/lit-html.js:
|