@fluid-topics/ft-reader-topic-title 1.2.14 → 1.2.15
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,10 @@
|
|
|
1
|
-
"use strict";(()=>{var
|
|
1
|
+
"use strict";(()=>{var It=Object.create;var Y=Object.defineProperty;var Ot=Object.getOwnPropertyDescriptor;var Mt=Object.getOwnPropertyNames;var Rt=Object.getPrototypeOf,Et=Object.prototype.hasOwnProperty;var D=(o,t)=>()=>(t||o((t={exports:{}}).exports,t),t.exports);var Pt=(o,t,e,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Mt(t))!Et.call(o,i)&&i!==e&&Y(o,i,{get:()=>t[i],enumerable:!(s=Ot(t,i))||s.enumerable});return o};var $=(o,t,e)=>(e=o!=null?It(Rt(o)):{},Pt(t||!o||!o.__esModule?Y(e,"default",{value:o,enumerable:!0}):e,o));var C=D((kt,tt)=>{tt.exports=ftGlobals.wcUtils});var j=D((zt,et)=>{et.exports=ftGlobals.lit});var O=D((Zt,ot)=>{ot.exports=ftGlobals.litDecorators});var wt=$(C());var Tt=$(j());var st=$(j()),I=$(C()),Bt={fontFamily:I.FtCssVariableFactory.external(I.designSystemVariables.titleFont,"Design system")},it=st.css`
|
|
2
2
|
.title {
|
|
3
|
-
font-family: ${
|
|
4
|
-
color: ${st.titleColor};
|
|
3
|
+
font-family: ${Bt.fontFamily};
|
|
5
4
|
}
|
|
6
|
-
`;var V=$(O());var
|
|
7
|
-
\f\r]`,
|
|
8
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),
|
|
5
|
+
`;var V=$(O());var rt=$(C()),lt=$(O());var nt;(function(o){o.FEEDBACK="FEEDBACK",o.RATING="RATING",o.PRINT="PRINT",o.BOOKMARK="BOOKMARK",o.COLLECTIONS="COLLECTIONS",o.PERSONAL_BOOKS="PERSONAL_BOOKS"})(nt||(nt={}));var Dt=function(o,t,e,s){var i=arguments.length,n=i<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,e):s,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(o,t,e,s);else for(var h=o.length-1;h>=0;h--)(r=o[h])&&(n=(i<3?r(n):i>3?r(t,e,n):r(t,e))||n);return i>3&&n&&Object.defineProperty(t,e,n),n},U=class extends Event{constructor(){super("register-ft-reader-component",{bubbles:!0,composed:!0})}},L=Symbol("registerInterval");function jt(o){var t;class e extends o{constructor(){super(...arguments),this[t]=0}setReaderStateManager(i){this.clearStateManager(),this.stateManager=i,this.addStore(i.store,"reader")}clearStateManager(){this.stateManager&&(this.removeStore("reader"),this.stateManager=void 0)}get service(){var i;return(i=this.stateManager)===null||i===void 0?void 0:i.service}connectedCallback(){super.connectedCallback(),this[L]=window.setInterval(()=>this.tryToRegisterToContext(),50)}tryToRegisterToContext(){this.stateManager!=null?window.clearInterval(this[L]):this.dispatchEvent(new U)}disconnectedCallback(){super.disconnectedCallback(),this.clearStateManager()}}return t=L,Dt([(0,lt.state)()],e.prototype,"stateManager",void 0),e}var M=class extends jt(rt.FtLitElementRedux){};var at=function(o,t,e,s){var i=arguments.length,n=i<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,e):s,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(o,t,e,s);else for(var h=o.length-1;h>=0;h--)(r=o[h])&&(n=(i<3?r(n):i>3?r(t,e,n):r(t,e))||n);return i>3&&n&&Object.defineProperty(t,e,n),n},F=class extends Event{constructor(){super("register-ft-reader-topic-component",{bubbles:!0,composed:!0})}},K=Symbol("registerInterval");function Lt(o){var t;class e extends o{constructor(){super(...arguments),this.disableContextInteractions=!1,this[t]=0}connectedCallback(){super.connectedCallback(),this[K]=window.setInterval(()=>this.tryToRegisterToTopicContext(),50)}tryToRegisterToTopicContext(){this.tocNode!=null?window.clearInterval(this[K]):this.dispatchEvent(new F)}disconnectedCallback(){super.disconnectedCallback(),this.tocNode=void 0}}return t=K,at([(0,V.state)()],e.prototype,"tocNode",void 0),at([(0,V.state)()],e.prototype,"disableContextInteractions",void 0),e}var R=class extends Lt(M){};var f=$(C());var q=globalThis,E=q.trustedTypes,ht=E?E.createPolicy("lit-html",{createHTML:o=>o}):void 0,ft="$lit$",m=`lit$${(Math.random()+"").slice(9)}$`,_t="?"+m,Ut=`<${_t}>`,y=document,P=()=>y.createComment(""),S=o=>o===null||typeof o!="object"&&typeof o!="function",mt=Array.isArray,Kt=o=>mt(o)||typeof o?.[Symbol.iterator]=="function",W=`[
|
|
6
|
+
\f\r]`,N=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,ct=/-->/g,pt=/>/g,v=RegExp(`>|${W}(?:([^\\s"'>=/]+)(${W}*=${W}*(?:[^
|
|
7
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),dt=/'/g,ut=/"/g,At=/^(?:script|style|textarea|title)$/i,vt=o=>(t,...e)=>({_$litType$:o,strings:t,values:e}),gt=vt(1),yt=vt(2),T=Symbol.for("lit-noChange"),d=Symbol.for("lit-nothing"),$t=new WeakMap,g=y.createTreeWalker(y,129);function xt(o,t){if(!Array.isArray(o)||!o.hasOwnProperty("raw"))throw Error("invalid template strings array");return ht!==void 0?ht.createHTML(t):t}var Vt=(o,t)=>{let e=o.length-1,s=[],i,n=t===2?"<svg>":"",r=N;for(let h=0;h<e;h++){let l=o[h],a,p,c=-1,u=0;for(;u<l.length&&(r.lastIndex=u,p=r.exec(l),p!==null);)u=r.lastIndex,r===N?p[1]==="!--"?r=ct:p[1]!==void 0?r=pt:p[2]!==void 0?(At.test(p[2])&&(i=RegExp("</"+p[2],"g")),r=v):p[3]!==void 0&&(r=v):r===v?p[0]===">"?(r=i??N,c=-1):p[1]===void 0?c=-2:(c=r.lastIndex-p[2].length,a=p[1],r=p[3]===void 0?v:p[3]==='"'?ut:dt):r===ut||r===dt?r=v:r===ct||r===pt?r=N:(r=v,i=void 0);let _=r===v&&o[h+1].startsWith("/>")?" ":"";n+=r===N?l+Ut:c>=0?(s.push(a),l.slice(0,c)+ft+l.slice(c)+m+_):l+m+(c===-2?h:_)}return[xt(o,n+(o[e]||"<?>")+(t===2?"</svg>":"")),s]},H=class o{constructor({strings:t,_$litType$:e},s){let i;this.parts=[];let n=0,r=0,h=t.length-1,l=this.parts,[a,p]=Vt(t,e);if(this.el=o.createElement(a,s),g.currentNode=this.el.content,e===2){let c=this.el.content.firstChild;c.replaceWith(...c.childNodes)}for(;(i=g.nextNode())!==null&&l.length<h;){if(i.nodeType===1){if(i.hasAttributes())for(let c of i.getAttributeNames())if(c.endsWith(ft)){let u=p[r++],_=i.getAttribute(c).split(m),w=/([.?@])?(.*)/.exec(u);l.push({type:1,index:n,name:w[2],strings:_,ctor:w[1]==="."?k:w[1]==="?"?z:w[1]==="@"?Q:b}),i.removeAttribute(c)}else c.startsWith(m)&&(l.push({type:6,index:n}),i.removeAttribute(c));if(At.test(i.tagName)){let c=i.textContent.split(m),u=c.length-1;if(u>0){i.textContent=E?E.emptyScript:"";for(let _=0;_<u;_++)i.append(c[_],P()),g.nextNode(),l.push({type:2,index:++n});i.append(c[u],P())}}}else if(i.nodeType===8)if(i.data===_t)l.push({type:2,index:n});else{let c=-1;for(;(c=i.data.indexOf(m,c+1))!==-1;)l.push({type:7,index:n}),c+=m.length-1}n++}}static createElement(t,e){let s=y.createElement("template");return s.innerHTML=t,s}};function x(o,t,e=o,s){if(t===T)return t;let i=s!==void 0?e._$Co?.[s]:e._$Cl,n=S(t)?void 0:t._$litDirective$;return i?.constructor!==n&&(i?._$AO?.(!1),n===void 0?i=void 0:(i=new n(o),i._$AT(o,e,s)),s!==void 0?(e._$Co??=[])[s]=i:e._$Cl=i),i!==void 0&&(t=x(o,i._$AS(o,t.values),i,s)),t}var G=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,i=(t?.creationScope??y).importNode(e,!0);g.currentNode=i;let n=g.nextNode(),r=0,h=0,l=s[0];for(;l!==void 0;){if(r===l.index){let a;l.type===2?a=new B(n,n.nextSibling,this,t):l.type===1?a=new l.ctor(n,l.name,l.strings,this,t):l.type===6&&(a=new Z(n,this,t)),this._$AV.push(a),l=s[++h]}r!==l?.index&&(n=g.nextNode(),r++)}return g.currentNode=y,i}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++}},B=class o{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,s,i){this.type=2,this._$AH=d,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=s,this.options=i,this._$Cv=i?.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=x(this,t,e),S(t)?t===d||t==null||t===""?(this._$AH!==d&&this._$AR(),this._$AH=d):t!==this._$AH&&t!==T&&this._(t):t._$litType$!==void 0?this.g(t):t.nodeType!==void 0?this.$(t):Kt(t)?this.T(t):this._(t)}k(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}$(t){this._$AH!==t&&(this._$AR(),this._$AH=this.k(t))}_(t){this._$AH!==d&&S(this._$AH)?this._$AA.nextSibling.data=t:this.$(y.createTextNode(t)),this._$AH=t}g(t){let{values:e,_$litType$:s}=t,i=typeof s=="number"?this._$AC(t):(s.el===void 0&&(s.el=H.createElement(xt(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===i)this._$AH.p(e);else{let n=new G(i,this),r=n.u(this.options);n.p(e),this.$(r),this._$AH=n}}_$AC(t){let e=$t.get(t.strings);return e===void 0&&$t.set(t.strings,e=new H(t)),e}T(t){mt(this._$AH)||(this._$AH=[],this._$AR());let e=this._$AH,s,i=0;for(let n of t)i===e.length?e.push(s=new o(this.k(P()),this.k(P()),this,this.options)):s=e[i],s._$AI(n),i++;i<e.length&&(this._$AR(s&&s._$AB.nextSibling,i),e.length=i)}_$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))}},b=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,s,i,n){this.type=1,this._$AH=d,this._$AN=void 0,this.element=t,this.name=e,this._$AM=i,this.options=n,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=d}_$AI(t,e=this,s,i){let n=this.strings,r=!1;if(n===void 0)t=x(this,t,e,0),r=!S(t)||t!==this._$AH&&t!==T,r&&(this._$AH=t);else{let h=t,l,a;for(t=n[0],l=0;l<n.length-1;l++)a=x(this,h[s+l],e,l),a===T&&(a=this._$AH[l]),r||=!S(a)||a!==this._$AH[l],a===d?t=d:t!==d&&(t+=(a??"")+n[l+1]),this._$AH[l]=a}r&&!i&&this.O(t)}O(t){t===d?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}},k=class extends b{constructor(){super(...arguments),this.type=3}O(t){this.element[this.name]=t===d?void 0:t}},z=class extends b{constructor(){super(...arguments),this.type=4}O(t){this.element.toggleAttribute(this.name,!!t&&t!==d)}},Q=class extends b{constructor(t,e,s,i,n){super(t,e,s,i,n),this.type=5}_$AI(t,e=this){if((t=x(this,t,e,0)??d)===T)return;let s=this._$AH,i=t===d&&s!==d||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,n=t!==d&&(s===d||i);i&&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)}},Z=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){x(this,t)}};var Ft=q.litHtmlPolyfillSupport;Ft?.(H,B),(q.litHtmlVersions??=[]).push("3.1.0");var Ct=Symbol.for(""),Wt=o=>{if(o?.r===Ct)return o?._$litStatic$},J=o=>({_$litStatic$:o,r:Ct});var bt=new Map,Nt=o=>(t,...e)=>{let s=e.length,i,n,r=[],h=[],l,a=0,p=!1;for(;a<s;){for(l=t[a];a<s&&(n=e[a],(i=Wt(n))!==void 0);)l+=i+t[++a],p=!0;a!==s&&h.push(n),r.push(l),a++}if(a===s&&r.push(t[s]),p){let c=r.join("$$lit$$");(t=bt.get(c))===void 0&&(r.raw=r,bt.set(c,t=r)),e=h}return o(t,...e)},St=Nt(gt),ie=Nt(yt);var Ht=$(O()),X=function(o,t,e,s){var i=arguments.length,n=i<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,e):s,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(o,t,e,s);else for(var h=o.length-1;h>=0;h--)(r=o[h])&&(n=(i<3?r(n):i>3?r(t,e,n):r(t,e))||n);return i>3&&n&&Object.defineProperty(t,e,n),n},A=class extends R{render(){var t,e,s,i,n,r;if(!this.map||!this.tocNode)return Tt.nothing;let h=`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:"",a=(i=this.map)===null||i===void 0?void 0:i.lang;return St`
|
|
9
8
|
<style>
|
|
10
9
|
@import "${(n=this.map)===null||n===void 0?void 0:n.contentStyles.titleStylesheetUrl}";
|
|
11
10
|
</style>
|
|
@@ -14,7 +13,7 @@
|
|
|
14
13
|
<${J(h)}>${this.tocNode.title}</${J(h)}>
|
|
15
14
|
</div>
|
|
16
15
|
</section>
|
|
17
|
-
`}updated(t){super.updated(t),this.updateComplete.then(()=>(0,f.waitFor)(()=>this.titleContainer)).then(e=>(0,f.highlightHtml)(e,this.disableContextInteractions?"":this.searchInDocumentQuery,{attributes:{part:"kwicmatch"}}))}};A.styles=[
|
|
16
|
+
`}updated(t){super.updated(t),this.updateComplete.then(()=>(0,f.waitFor)(()=>this.titleContainer)).then(e=>(0,f.highlightHtml)(e,this.disableContextInteractions?"":this.searchInDocumentQuery,{attributes:{part:"kwicmatch"}}))}};A.styles=[it,f.highlightHtmlStyles];X([(0,f.redux)()],A.prototype,"map",void 0);X([(0,f.redux)({selector:(o,t)=>t.disableContextInteractions?"":o.searchInDocumentQuery})],A.prototype,"searchInDocumentQuery",void 0);X([(0,Ht.query)("section.title")],A.prototype,"titleContainer",void 0);(0,wt.customElement)("ft-reader-topic-title")(A);})();
|
|
18
17
|
/*! Bundled license information:
|
|
19
18
|
|
|
20
19
|
lit-html/lit-html.js:
|