@fluid-topics/ft-reader-content 0.3.7 → 0.3.8
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.
|
@@ -32,13 +32,13 @@ var $;b.elementDefinitions={},b.styles=e.css`
|
|
|
32
32
|
background-position: calc(100vw + ${y}) 0, calc(${y} * -1) 0;
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
|
-
`,i.customElement("ft-skeleton")(b);const m=globalThis.trustedTypes,x=m?m.createPolicy("lit-html",{createHTML:t=>t}):void 0,w=`lit$${(Math.random()+"").slice(9)}$`,k="?"+w,I=`<${k}>`,z=document,
|
|
35
|
+
`,i.customElement("ft-skeleton")(b);const m=globalThis.trustedTypes,x=m?m.createPolicy("lit-html",{createHTML:t=>t}):void 0,w=`lit$${(Math.random()+"").slice(9)}$`,k="?"+w,I=`<${k}>`,z=document,T=(t="")=>z.createComment(t),S=t=>null===t||"object"!=typeof t&&"function"!=typeof t,O=Array.isArray,N=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,A=/-->/g,C=/>/g,j=RegExp(">|[ \t\n\f\r](?:([^\\s\"'>=/]+)([ \t\n\f\r]*=[ \t\n\f\r]*(?:[^ \t\n\f\r\"'`<>=]|(\"|')|))|$)","g"),E=/'/g,_=/"/g,M=/^(?:script|style|textarea|title)$/i,P=(t=>(i,...e)=>({_$litType$:t,strings:i,values:e}))(1),U=Symbol.for("lit-noChange"),R=Symbol.for("lit-nothing"),Z=new WeakMap,W=z.createTreeWalker(z,129,null,!1),G=(t,i)=>{const e=t.length-1,o=[];let s,n=2===i?"<svg>":"",r=N;for(let i=0;i<e;i++){const e=t[i];let l,h,a=-1,f=0;for(;f<e.length&&(r.lastIndex=f,h=r.exec(e),null!==h);)f=r.lastIndex,r===N?"!--"===h[1]?r=A:void 0!==h[1]?r=C:void 0!==h[2]?(M.test(h[2])&&(s=RegExp("</"+h[2],"g")),r=j):void 0!==h[3]&&(r=j):r===j?">"===h[0]?(r=null!=s?s:N,a=-1):void 0===h[1]?a=-2:(a=r.lastIndex-h[2].length,l=h[1],r=void 0===h[3]?j:'"'===h[3]?_:E):r===_||r===E?r=j:r===A||r===C?r=N:(r=j,s=void 0);const p=r===j&&t[i+1].startsWith("/>")?" ":"";n+=r===N?e+I:a>=0?(o.push(l),e.slice(0,a)+"$lit$"+e.slice(a)+w+p):e+w+(-2===a?(o.push(void 0),i):p)}const l=n+(t[e]||"<?>")+(2===i?"</svg>":"");if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return[void 0!==x?x.createHTML(l):l,o]};class L{constructor({strings:t,_$litType$:i},e){let o;this.parts=[];let s=0,n=0;const r=t.length-1,l=this.parts,[h,a]=G(t,i);if(this.el=L.createElement(h,e),W.currentNode=this.el.content,2===i){const t=this.el.content,i=t.firstChild;i.remove(),t.append(...i.childNodes)}for(;null!==(o=W.nextNode())&&l.length<r;){if(1===o.nodeType){if(o.hasAttributes()){const t=[];for(const i of o.getAttributeNames())if(i.endsWith("$lit$")||i.startsWith(w)){const e=a[n++];if(t.push(i),void 0!==e){const t=o.getAttribute(e.toLowerCase()+"$lit$").split(w),i=/([.?@])?(.*)/.exec(e);l.push({type:1,index:s,name:i[2],strings:t,ctor:"."===i[1]?H:"?"===i[1]?q:"@"===i[1]?J:F})}else l.push({type:6,index:s})}for(const i of t)o.removeAttribute(i)}if(M.test(o.tagName)){const t=o.textContent.split(w),i=t.length-1;if(i>0){o.textContent=m?m.emptyScript:"";for(let e=0;e<i;e++)o.append(t[e],T()),W.nextNode(),l.push({type:2,index:++s});o.append(t[i],T())}}}else if(8===o.nodeType)if(o.data===k)l.push({type:2,index:s});else{let t=-1;for(;-1!==(t=o.data.indexOf(w,t+1));)l.push({type:7,index:s}),t+=w.length-1}s++}}static createElement(t,i){const e=z.createElement("template");return e.innerHTML=t,e}}function B(t,i,e=t,o){var s,n,r,l;if(i===U)return i;let h=void 0!==o?null===(s=e._$Cl)||void 0===s?void 0:s[o]:e._$Cu;const a=S(i)?void 0:i._$litDirective$;return(null==h?void 0:h.constructor)!==a&&(null===(n=null==h?void 0:h._$AO)||void 0===n||n.call(h,!1),void 0===a?h=void 0:(h=new a(t),h._$AT(t,e,o)),void 0!==o?(null!==(r=(l=e)._$Cl)&&void 0!==r?r:l._$Cl=[])[o]=h:e._$Cu=h),void 0!==h&&(i=B(t,h._$AS(t,i.values),h,o)),i}class D{constructor(t,i){this.v=[],this._$AN=void 0,this._$AD=t,this._$AM=i}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}p(t){var i;const{el:{content:e},parts:o}=this._$AD,s=(null!==(i=null==t?void 0:t.creationScope)&&void 0!==i?i:z).importNode(e,!0);W.currentNode=s;let n=W.nextNode(),r=0,l=0,h=o[0];for(;void 0!==h;){if(r===h.index){let i;2===h.type?i=new K(n,n.nextSibling,this,t):1===h.type?i=new h.ctor(n,h.name,h.strings,this,t):6===h.type&&(i=new Q(n,this,t)),this.v.push(i),h=o[++l]}r!==(null==h?void 0:h.index)&&(n=W.nextNode(),r++)}return s}m(t){let i=0;for(const e of this.v)void 0!==e&&(void 0!==e.strings?(e._$AI(t,e,i),i+=e.strings.length-2):e._$AI(t[i])),i++}}class K{constructor(t,i,e,o){var s;this.type=2,this._$AH=R,this._$AN=void 0,this._$AA=t,this._$AB=i,this._$AM=e,this.options=o,this._$C_=null===(s=null==o?void 0:o.isConnected)||void 0===s||s}get _$AU(){var t,i;return null!==(i=null===(t=this._$AM)||void 0===t?void 0:t._$AU)&&void 0!==i?i:this._$C_}get parentNode(){let t=this._$AA.parentNode;const i=this._$AM;return void 0!==i&&11===t.nodeType&&(t=i.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,i=this){t=B(this,t,i),S(t)?t===R||null==t||""===t?(this._$AH!==R&&this._$AR(),this._$AH=R):t!==this._$AH&&t!==U&&this.T(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.k(t):(t=>O(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]))(t)?this.S(t):this.T(t)}j(t,i=this._$AB){return this._$AA.parentNode.insertBefore(t,i)}k(t){this._$AH!==t&&(this._$AR(),this._$AH=this.j(t))}T(t){this._$AH!==R&&S(this._$AH)?this._$AA.nextSibling.data=t:this.k(z.createTextNode(t)),this._$AH=t}$(t){var i;const{values:e,_$litType$:o}=t,s="number"==typeof o?this._$AC(t):(void 0===o.el&&(o.el=L.createElement(o.h,this.options)),o);if((null===(i=this._$AH)||void 0===i?void 0:i._$AD)===s)this._$AH.m(e);else{const t=new D(s,this),i=t.p(this.options);t.m(e),this.k(i),this._$AH=t}}_$AC(t){let i=Z.get(t.strings);return void 0===i&&Z.set(t.strings,i=new L(t)),i}S(t){O(this._$AH)||(this._$AH=[],this._$AR());const i=this._$AH;let e,o=0;for(const s of t)o===i.length?i.push(e=new K(this.j(T()),this.j(T()),this,this.options)):e=i[o],e._$AI(s),o++;o<i.length&&(this._$AR(e&&e._$AB.nextSibling,o),i.length=o)}_$AR(t=this._$AA.nextSibling,i){var e;for(null===(e=this._$AP)||void 0===e||e.call(this,!1,!0,i);t&&t!==this._$AB;){const i=t.nextSibling;t.remove(),t=i}}setConnected(t){var i;void 0===this._$AM&&(this._$C_=t,null===(i=this._$AP)||void 0===i||i.call(this,t))}}class F{constructor(t,i,e,o,s){this.type=1,this._$AH=R,this._$AN=void 0,this.element=t,this.name=i,this._$AM=o,this.options=s,e.length>2||""!==e[0]||""!==e[1]?(this._$AH=Array(e.length-1).fill(new String),this.strings=e):this._$AH=R}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,i=this,e,o){const s=this.strings;let n=!1;if(void 0===s)t=B(this,t,i,0),n=!S(t)||t!==this._$AH&&t!==U,n&&(this._$AH=t);else{const o=t;let r,l;for(t=s[0],r=0;r<s.length-1;r++)l=B(this,o[e+r],i,r),l===U&&(l=this._$AH[r]),n||(n=!S(l)||l!==this._$AH[r]),l===R?t=R:t!==R&&(t+=(null!=l?l:"")+s[r+1]),this._$AH[r]=l}n&&!o&&this.P(t)}P(t){t===R?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}class H extends F{constructor(){super(...arguments),this.type=3}P(t){this.element[this.name]=t===R?void 0:t}}const Y=m?m.emptyScript:"";class q extends F{constructor(){super(...arguments),this.type=4}P(t){t&&t!==R?this.element.setAttribute(this.name,Y):this.element.removeAttribute(this.name)}}class J extends F{constructor(t,i,e,o,s){super(t,i,e,o,s),this.type=5}_$AI(t,i=this){var e;if((t=null!==(e=B(this,t,i,0))&&void 0!==e?e:R)===U)return;const o=this._$AH,s=t===R&&o!==R||t.capture!==o.capture||t.once!==o.once||t.passive!==o.passive,n=t!==R&&(o===R||s);s&&this.element.removeEventListener(this.name,this,o),n&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var i,e;"function"==typeof this._$AH?this._$AH.call(null!==(e=null===(i=this.options)||void 0===i?void 0:i.host)&&void 0!==e?e:this.element,t):this._$AH.handleEvent(t)}}class Q{constructor(t,i,e){this.element=t,this.type=6,this._$AN=void 0,this._$AM=i,this.options=e}get _$AU(){return this._$AM._$AU}_$AI(t){B(this,t)}}const V=window.litHtmlPolyfillSupport;null==V||V(L,K),(null!==($=globalThis.litHtmlVersions)&&void 0!==$?$:globalThis.litHtmlVersions=[]).push("2.2.7");
|
|
36
36
|
/**
|
|
37
37
|
* @license
|
|
38
38
|
* Copyright 2020 Google LLC
|
|
39
39
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
40
40
|
*/
|
|
41
|
-
const X=Symbol.for(""),tt=t=>{if((null==t?void 0:t.r)===X)return null==t?void 0:t._$litStatic$},it=t=>({_$litStatic$:t,r:X}),et=new Map,ot=(t=>(i,...e)=>{const o=e.length;let s,n;const r=[],l=[];let h,a=0,f=!1;for(;a<o;){for(h=i[a];a<o&&void 0!==(n=e[a],s=tt(n));)h+=s+i[++a],f=!0;l.push(n),r.push(h),a++}if(a===o&&r.push(i[o]),f){const t=r.join("$$lit$$");void 0===(i=et.get(t))&&(r.raw=r,et.set(t,i=r)),e=l}return t(i,...e)})(P);var st,nt=function(t,i,e,o){for(var s,n=arguments.length,r=n<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(i,e,r):s(i,e))||r);return n>3&&r&&Object.defineProperty(i,e,r),r};!function(t){t.title="title",t.title_dense="title-dense",t.subtitle1="subtitle1",t.subtitle2="subtitle2",t.body1="body1",t.body2="body2",t.caption="caption",t.breadcrumb="breadcrumb",t.overline="overline",t.button="button"}(st||(st={}));const rt=i.FtCssVariableFactory.extend("--ft-typography-font-family",i.designSystemVariables.titleFont),lt=i.FtCssVariableFactory.extend("--ft-typography-font-family",i.designSystemVariables.contentFont),ht={fontFamily:lt,fontSize:i.FtCssVariableFactory.create("--ft-typography-font-size","SIZE","16px"),fontWeight:i.FtCssVariableFactory.create("--ft-typography-font-weight","UNKNOWN","normal"),letterSpacing:i.FtCssVariableFactory.create("--ft-typography-letter-spacing","SIZE","0.496px"),lineHeight:i.FtCssVariableFactory.create("--ft-typography-line-height","NUMBER","1.5"),textTransform:i.FtCssVariableFactory.create("--ft-typography-text-transform","UNKNOWN","inherit")},at=i.FtCssVariableFactory.extend("--ft-typography-title-font-family",rt),ft=i.FtCssVariableFactory.extend("--ft-typography-title-font-size",ht.fontSize,"20px"),pt=i.FtCssVariableFactory.extend("--ft-typography-title-font-weight",ht.fontWeight,"normal"),dt=i.FtCssVariableFactory.extend("--ft-typography-title-letter-spacing",ht.letterSpacing,"0.15px"),ct=i.FtCssVariableFactory.extend("--ft-typography-title-line-height",ht.lineHeight,"1.2"),yt=i.FtCssVariableFactory.extend("--ft-typography-title-text-transform",ht.textTransform,"inherit"),gt=i.FtCssVariableFactory.extend("--ft-typography-title-dense-font-family",rt),vt=i.FtCssVariableFactory.extend("--ft-typography-title-dense-font-size",ht.fontSize,"14px"),ut=i.FtCssVariableFactory.extend("--ft-typography-title-dense-font-weight",ht.fontWeight,"normal"),bt=i.FtCssVariableFactory.extend("--ft-typography-title-dense-letter-spacing",ht.letterSpacing,"0.105px"),$t=i.FtCssVariableFactory.extend("--ft-typography-title-dense-line-height",ht.lineHeight,"1.7"),mt=i.FtCssVariableFactory.extend("--ft-typography-title-dense-text-transform",ht.textTransform,"inherit"),xt=i.FtCssVariableFactory.extend("--ft-typography-subtitle1-font-family",lt),wt=i.FtCssVariableFactory.extend("--ft-typography-subtitle1-font-size",ht.fontSize,"16px"),kt=i.FtCssVariableFactory.extend("--ft-typography-subtitle1-font-weight",ht.fontWeight,"600"),It=i.FtCssVariableFactory.extend("--ft-typography-subtitle1-letter-spacing",ht.letterSpacing,"0.144px"),zt=i.FtCssVariableFactory.extend("--ft-typography-subtitle1-line-height",ht.lineHeight,"1.5"),
|
|
41
|
+
const X=Symbol.for(""),tt=t=>{if((null==t?void 0:t.r)===X)return null==t?void 0:t._$litStatic$},it=t=>({_$litStatic$:t,r:X}),et=new Map,ot=(t=>(i,...e)=>{const o=e.length;let s,n;const r=[],l=[];let h,a=0,f=!1;for(;a<o;){for(h=i[a];a<o&&void 0!==(n=e[a],s=tt(n));)h+=s+i[++a],f=!0;l.push(n),r.push(h),a++}if(a===o&&r.push(i[o]),f){const t=r.join("$$lit$$");void 0===(i=et.get(t))&&(r.raw=r,et.set(t,i=r)),e=l}return t(i,...e)})(P);var st,nt=function(t,i,e,o){for(var s,n=arguments.length,r=n<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(i,e,r):s(i,e))||r);return n>3&&r&&Object.defineProperty(i,e,r),r};!function(t){t.title="title",t.title_dense="title-dense",t.subtitle1="subtitle1",t.subtitle2="subtitle2",t.body1="body1",t.body2="body2",t.caption="caption",t.breadcrumb="breadcrumb",t.overline="overline",t.button="button"}(st||(st={}));const rt=i.FtCssVariableFactory.extend("--ft-typography-font-family",i.designSystemVariables.titleFont),lt=i.FtCssVariableFactory.extend("--ft-typography-font-family",i.designSystemVariables.contentFont),ht={fontFamily:lt,fontSize:i.FtCssVariableFactory.create("--ft-typography-font-size","SIZE","16px"),fontWeight:i.FtCssVariableFactory.create("--ft-typography-font-weight","UNKNOWN","normal"),letterSpacing:i.FtCssVariableFactory.create("--ft-typography-letter-spacing","SIZE","0.496px"),lineHeight:i.FtCssVariableFactory.create("--ft-typography-line-height","NUMBER","1.5"),textTransform:i.FtCssVariableFactory.create("--ft-typography-text-transform","UNKNOWN","inherit")},at=i.FtCssVariableFactory.extend("--ft-typography-title-font-family",rt),ft=i.FtCssVariableFactory.extend("--ft-typography-title-font-size",ht.fontSize,"20px"),pt=i.FtCssVariableFactory.extend("--ft-typography-title-font-weight",ht.fontWeight,"normal"),dt=i.FtCssVariableFactory.extend("--ft-typography-title-letter-spacing",ht.letterSpacing,"0.15px"),ct=i.FtCssVariableFactory.extend("--ft-typography-title-line-height",ht.lineHeight,"1.2"),yt=i.FtCssVariableFactory.extend("--ft-typography-title-text-transform",ht.textTransform,"inherit"),gt=i.FtCssVariableFactory.extend("--ft-typography-title-dense-font-family",rt),vt=i.FtCssVariableFactory.extend("--ft-typography-title-dense-font-size",ht.fontSize,"14px"),ut=i.FtCssVariableFactory.extend("--ft-typography-title-dense-font-weight",ht.fontWeight,"normal"),bt=i.FtCssVariableFactory.extend("--ft-typography-title-dense-letter-spacing",ht.letterSpacing,"0.105px"),$t=i.FtCssVariableFactory.extend("--ft-typography-title-dense-line-height",ht.lineHeight,"1.7"),mt=i.FtCssVariableFactory.extend("--ft-typography-title-dense-text-transform",ht.textTransform,"inherit"),xt=i.FtCssVariableFactory.extend("--ft-typography-subtitle1-font-family",lt),wt=i.FtCssVariableFactory.extend("--ft-typography-subtitle1-font-size",ht.fontSize,"16px"),kt=i.FtCssVariableFactory.extend("--ft-typography-subtitle1-font-weight",ht.fontWeight,"600"),It=i.FtCssVariableFactory.extend("--ft-typography-subtitle1-letter-spacing",ht.letterSpacing,"0.144px"),zt=i.FtCssVariableFactory.extend("--ft-typography-subtitle1-line-height",ht.lineHeight,"1.5"),Tt=i.FtCssVariableFactory.extend("--ft-typography-subtitle1-text-transform",ht.textTransform,"inherit"),St=i.FtCssVariableFactory.extend("--ft-typography-subtitle2-font-family",lt),Ot=i.FtCssVariableFactory.extend("--ft-typography-subtitle2-font-size",ht.fontSize,"14px"),Nt=i.FtCssVariableFactory.extend("--ft-typography-subtitle2-font-weight",ht.fontWeight,"normal"),At=i.FtCssVariableFactory.extend("--ft-typography-subtitle2-letter-spacing",ht.letterSpacing,"0.098px"),Ct=i.FtCssVariableFactory.extend("--ft-typography-subtitle2-line-height",ht.lineHeight,"1.7"),jt=i.FtCssVariableFactory.extend("--ft-typography-subtitle2-text-transform",ht.textTransform,"inherit"),Et=i.FtCssVariableFactory.extend("--ft-typography-body1-font-family",lt),_t=i.FtCssVariableFactory.extend("--ft-typography-body1-font-size",ht.fontSize,"16px"),Mt=i.FtCssVariableFactory.extend("--ft-typography-body1-font-weight",ht.fontWeight,"normal"),Pt=i.FtCssVariableFactory.extend("--ft-typography-body1-letter-spacing",ht.letterSpacing,"0.496px"),Ut=i.FtCssVariableFactory.extend("--ft-typography-body1-line-height",ht.lineHeight,"1.5"),Rt=i.FtCssVariableFactory.extend("--ft-typography-body1-text-transform",ht.textTransform,"inherit"),Zt=i.FtCssVariableFactory.extend("--ft-typography-body2-font-family",lt),Wt=i.FtCssVariableFactory.extend("--ft-typography-body2-font-size",ht.fontSize,"14px"),Gt=i.FtCssVariableFactory.extend("--ft-typography-body2-font-weight",ht.fontWeight,"normal"),Lt=i.FtCssVariableFactory.extend("--ft-typography-body2-letter-spacing",ht.letterSpacing,"0.252px"),Bt=i.FtCssVariableFactory.extend("--ft-typography-body2-line-height",ht.lineHeight,"1.4"),Dt=i.FtCssVariableFactory.extend("--ft-typography-body2-text-transform",ht.textTransform,"inherit"),Kt=i.FtCssVariableFactory.extend("--ft-typography-caption-font-family",lt),Ft=i.FtCssVariableFactory.extend("--ft-typography-caption-font-size",ht.fontSize,"12px"),Ht=i.FtCssVariableFactory.extend("--ft-typography-caption-font-weight",ht.fontWeight,"normal"),Yt=i.FtCssVariableFactory.extend("--ft-typography-caption-letter-spacing",ht.letterSpacing,"0.396px"),qt=i.FtCssVariableFactory.extend("--ft-typography-caption-line-height",ht.lineHeight,"1.33"),Jt=i.FtCssVariableFactory.extend("--ft-typography-caption-text-transform",ht.textTransform,"inherit"),Qt=i.FtCssVariableFactory.extend("--ft-typography-breadcrumb-font-family",lt),Vt=i.FtCssVariableFactory.extend("--ft-typography-breadcrumb-font-size",ht.fontSize,"10px"),Xt=i.FtCssVariableFactory.extend("--ft-typography-breadcrumb-font-weight",ht.fontWeight,"normal"),ti=i.FtCssVariableFactory.extend("--ft-typography-breadcrumb-letter-spacing",ht.letterSpacing,"0.33px"),ii=i.FtCssVariableFactory.extend("--ft-typography-breadcrumb-line-height",ht.lineHeight,"1.6"),ei=i.FtCssVariableFactory.extend("--ft-typography-breadcrumb-text-transform",ht.textTransform,"inherit"),oi=i.FtCssVariableFactory.extend("--ft-typography-overline-font-family",lt),si=i.FtCssVariableFactory.extend("--ft-typography-overline-font-size",ht.fontSize,"10px"),ni=i.FtCssVariableFactory.extend("--ft-typography-overline-font-weight",ht.fontWeight,"normal"),ri=i.FtCssVariableFactory.extend("--ft-typography-overline-letter-spacing",ht.letterSpacing,"1.5px"),li=i.FtCssVariableFactory.extend("--ft-typography-overline-line-height",ht.lineHeight,"1.6"),hi=i.FtCssVariableFactory.extend("--ft-typography-overline-text-transform",ht.textTransform,"uppercase"),ai=i.FtCssVariableFactory.extend("--ft-typography-button-font-family",lt),fi=i.FtCssVariableFactory.extend("--ft-typography-button-font-size",ht.fontSize,"14px"),pi=i.FtCssVariableFactory.extend("--ft-typography-button-font-weight",ht.fontWeight,"600"),di=i.FtCssVariableFactory.extend("--ft-typography-button-letter-spacing",ht.letterSpacing,"1.246px"),ci=i.FtCssVariableFactory.extend("--ft-typography-button-line-height",ht.lineHeight,"1.15"),yi=i.FtCssVariableFactory.extend("--ft-typography-button-text-transform",ht.textTransform,"uppercase"),gi=e.css`
|
|
42
42
|
.ft-typography--title {
|
|
43
43
|
font-family: ${at};
|
|
44
44
|
font-size: ${ft};
|
|
@@ -63,11 +63,11 @@ const X=Symbol.for(""),tt=t=>{if((null==t?void 0:t.r)===X)return null==t?void 0:
|
|
|
63
63
|
font-weight: ${kt};
|
|
64
64
|
letter-spacing: ${It};
|
|
65
65
|
line-height: ${zt};
|
|
66
|
-
text-transform: ${
|
|
66
|
+
text-transform: ${Tt};
|
|
67
67
|
}
|
|
68
68
|
`,bi=e.css`
|
|
69
69
|
.ft-typography--subtitle2 {
|
|
70
|
-
font-family: ${
|
|
70
|
+
font-family: ${St};
|
|
71
71
|
font-size: ${Ot};
|
|
72
72
|
font-weight: ${Nt};
|
|
73
73
|
letter-spacing: ${At};
|
|
@@ -140,18 +140,18 @@ const X=Symbol.for(""),tt=t=>{if((null==t?void 0:t.r)===X)return null==t?void 0:
|
|
|
140
140
|
.ft-typography {
|
|
141
141
|
vertical-align: inherit;
|
|
142
142
|
}
|
|
143
|
-
`],nt([o.property()],zi.prototype,"element",void 0),nt([o.property()],zi.prototype,"variant",void 0),i.customElement("ft-typography")(zi);var
|
|
143
|
+
`],nt([o.property()],zi.prototype,"element",void 0),nt([o.property()],zi.prototype,"variant",void 0),i.customElement("ft-typography")(zi);var Ti=function(t,i,e,o){for(var s,n=arguments.length,r=n<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(i,e,r):s(i,e))||r);return n>3&&r&&Object.defineProperty(i,e,r),r};class Si extends a{constructor(){super(...arguments),this.removeStyle=!1}render(){var t;let i=n.classMap({"ft-reader-link":!0,"ft-reader-link--remove-style":this.removeStyle});return e.html`
|
|
144
144
|
<a class=${i}
|
|
145
145
|
href="${null===(t=this.service)||void 0===t?void 0:t.getLink(this.tocId,this.pageNumber,this.section)}"
|
|
146
146
|
@click=${t=>this.onClick(t)}>
|
|
147
147
|
<slot></slot>
|
|
148
148
|
</a>
|
|
149
|
-
`}onClick(t){var i;t.ctrlKey||t.metaKey||(t.stopPropagation(),t.preventDefault(),this.tocId&&(null===(i=this.stateManager)||void 0===i||i.navigateToTopic(this.tocId,this.section)))}}
|
|
149
|
+
`}onClick(t){var i;t.ctrlKey||t.metaKey||(t.stopPropagation(),t.preventDefault(),this.tocId&&(null===(i=this.stateManager)||void 0===i||i.navigateToTopic(this.tocId,this.section)))}}Si.styles=e.css`
|
|
150
150
|
.ft-reader-link--remove-style {
|
|
151
151
|
text-decoration: none;
|
|
152
152
|
color: inherit;
|
|
153
153
|
}
|
|
154
|
-
`,
|
|
154
|
+
`,Ti([o.property()],Si.prototype,"tocId",void 0),Ti([o.property()],Si.prototype,"section",void 0),Ti([o.property()],Si.prototype,"pageNumber",void 0),Ti([o.property({type:Boolean})],Si.prototype,"removeStyle",void 0),i.customElement("ft-reader-internal-link")(Si);var Oi=function(t,i,e,o){for(var s,n=arguments.length,r=n<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(i,e,r):s(i,e))||r);return n>3&&r&&Object.defineProperty(i,e,r),r};class Ni extends a{constructor(){super(...arguments),this.tocId=""}render(){var t,i,o,n;const r=null!==(i=null===(t=this.tocNode)||void 0===t?void 0:t.depth)&&void 0!==i?i:1;return this.tocNode&&this.content?e.html`
|
|
155
155
|
<section class="ft-reader-topic readercontent-topic-depth-${r} depth-${r}" id="${this.tocId}"
|
|
156
156
|
part="container">
|
|
157
157
|
<ft-typography variant="title" element="h${Math.min(r+1,6)}" part="title">
|
|
@@ -198,7 +198,7 @@ const X=Symbol.for(""),tt=t=>{if((null==t?void 0:t.r)===X)return null==t?void 0:
|
|
|
198
198
|
img {
|
|
199
199
|
max-width: 100%;
|
|
200
200
|
}
|
|
201
|
-
`,Oi([o.property()],Ni.prototype,"tocId",void 0),Oi([o.state()],Ni.prototype,"tocNode",void 0),Oi([o.state()],Ni.prototype,"content",void 0),Oi([o.query(".ft-reader-topic")],Ni.prototype,"container",void 0),Oi([i.redux()],Ni.prototype,"scrollTarget",void 0),i.customElement("ft-reader-topic")(Ni);var Ai=function(t,i,e,o){for(var s,n=arguments.length,r=n<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(i,e,r):s(i,e))||r);return n>3&&r&&Object.defineProperty(i,e,r),r};const Ci=i.FtCssVariableFactory.create("--ft-infinite-scroll-padding","SIZE","0");class ji extends CustomEvent{constructor(t,i){super("visible-items-change",{detail:{visibleIndexes:t,visibleItems:i}})}}class Ei extends Event{constructor(){super("scrolled-to-target")}}class _i extends i.FtLitElement{constructor(){super(...arguments),this.items=[],this.renderItem=()=>e.html``,this.internalScroll=!1,this.visibleItems=[],this.scrolledToTarget=!1,this.alreadyRenderedIndexes=new Set,this.scrollDebouncer=new i.Debouncer(5),this.onVisibilityChange=t=>{const i=t.filter((t=>t.intersectionRect.height>1)).map((t=>+t.target.attributes.getNamedItem("data-item-index").value)).filter((t=>!this.visibleItems.includes(t))),e=t.filter((t=>t.intersectionRect.height<=1)).map((t=>+t.target.attributes.getNamedItem("data-item-index").value)).filter((t=>this.visibleItems.includes(t))),o=[...this.visibleItems].filter((t=>!e.includes(t)));this.visibleItems=[...i,...o].sort(((t,i)=>t-i))},this.intersectionObserver=new IntersectionObserver(this.onVisibilityChange),this.onResize=t=>{this.triggerFindScrollableParent();let e=0;for(const i of t){const t=+i.target.parentElement.getAttribute("data-item-index")
|
|
201
|
+
`,Oi([o.property()],Ni.prototype,"tocId",void 0),Oi([o.state()],Ni.prototype,"tocNode",void 0),Oi([o.state()],Ni.prototype,"content",void 0),Oi([o.query(".ft-reader-topic")],Ni.prototype,"container",void 0),Oi([i.redux()],Ni.prototype,"scrollTarget",void 0),i.customElement("ft-reader-topic")(Ni);var Ai=function(t,i,e,o){for(var s,n=arguments.length,r=n<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(i,e,r):s(i,e))||r);return n>3&&r&&Object.defineProperty(i,e,r),r};const Ci=i.FtCssVariableFactory.create("--ft-infinite-scroll-padding","SIZE","0");class ji extends CustomEvent{constructor(t,i){super("visible-items-change",{detail:{visibleIndexes:t,visibleItems:i}})}}class Ei extends Event{constructor(){super("scrolled-to-target")}}class _i extends i.FtLitElement{constructor(){super(...arguments),this.items=[],this.renderItem=()=>e.html``,this.internalScroll=!1,this.visibleItems=[],this.scrolledToTarget=!1,this.alreadyRenderedIndexes=new Set,this.scrollDebouncer=new i.Debouncer(5),this.onVisibilityChange=t=>{const i=t.filter((t=>t.intersectionRect.height>1)).map((t=>+t.target.attributes.getNamedItem("data-item-index").value)).filter((t=>!this.visibleItems.includes(t))),e=t.filter((t=>t.intersectionRect.height<=1)).map((t=>+t.target.attributes.getNamedItem("data-item-index").value)).filter((t=>this.visibleItems.includes(t))),o=[...this.visibleItems].filter((t=>!e.includes(t)));this.visibleItems=[...i,...o].sort(((t,i)=>t-i))},this.intersectionObserver=new IntersectionObserver(this.onVisibilityChange),this.onResize=t=>{this.triggerFindScrollableParent();let e=0;t=t.sort(((t,i)=>t.contentRect.top-i.contentRect.top));for(const i of t){const t=+i.target.parentElement.getAttribute("data-item-index"),o=i.target.parentElement.clientHeight,s=i.contentRect.height;this.alreadyRenderedIndexes.has(t)&&(i.target.parentElement.style.height=s+"px",e+=this.scrollable&&this.getOffset(i.target.parentElement)<this.scrollable.scrollTop+e?s-o:0)}this.scrollable&&i.isSafari&&(this.scrollable.scrollTop+=e)},this.resizeObserver=new ResizeObserver(this.onResize),this.onMutation=()=>{[...this.itemsContainer.children].forEach((t=>{this.intersectionObserver.observe(t),this.resizeObserver.observe(t.children.item(0))}))},this.mutationObserver=new MutationObserver(this.onMutation)}get scrollable(){return this.internalScroll?this.internalScrollable:this.firstScrollableParent}render(){return e.html`
|
|
202
202
|
<div class="items-container ${this.internalScroll?"scrollable":""}"
|
|
203
203
|
tabindex="-1"
|
|
204
204
|
@find-scrollable-parent=${this.findScrollableParent}>
|
|
@@ -212,7 +212,7 @@ const X=Symbol.for(""),tt=t=>{if((null==t?void 0:t.r)===X)return null==t?void 0:
|
|
|
212
212
|
${n?(()=>{const o=this.renderItem(t,i);return"string"==typeof o?e.html`${s.unsafeHTML(o)}`:o})():null}
|
|
213
213
|
</div>
|
|
214
214
|
</div>
|
|
215
|
-
`}resetScroll(){this.intersectionObserver.disconnect(),this.resizeObserver.disconnect(),this.visibleItems=[],this.scrolledToTarget=!1,this.scrollDebouncer.run((()=>{var t,i;let e=null!==(t=this.scrollToIndex)&&void 0!==t?t:this.scrollToItem?this.items.indexOf(this.scrollToItem):-1;e>=this.items.length&&(e=-1);let o=null===(i=this.shadowRoot)||void 0===i?void 0:i.querySelector(`#item-${e}`);
|
|
215
|
+
`}resetScroll(){this.intersectionObserver.disconnect(),this.resizeObserver.disconnect(),this.visibleItems=[],this.scrolledToTarget=!1,this.scrollDebouncer.run((()=>{var t,i;let e=null!==(t=this.scrollToIndex)&&void 0!==t?t:this.scrollToItem?this.items.indexOf(this.scrollToItem):-1;e>=this.items.length&&(e=-1);let o=null===(i=this.shadowRoot)||void 0===i?void 0:i.querySelector(`#item-${e}`);this.scrollToTarget(o),this.onMutation(),setTimeout((()=>{this.scrolledToTarget=!0}),10)}))}scrollToTarget(t){var i;if(t){let e=+(null!==(i=t.getAttribute("data-item-index"))&&void 0!==i?i:"0");this.scrollable?this.scrollable.scrollTop=e>0?this.getOffset(t)+1:0:t.scrollIntoView({block:"start"})}}getOffset(t){var i;let e=0,o=t;for(;o&&o.offsetParent!==this.scrollable.offsetParent;)e+=o.offsetTop,o=o.offsetParent;return e+(null!==(i=null==o?void 0:o.offsetTop)&&void 0!==i?i:0)-this.scrollable.offsetTop}appendItems(...t){this.items=[...this.items,...t]}prependItems(...t){this.items=[...t,...this.items]}connectedCallback(){super.connectedCallback(),setTimeout((()=>{this.triggerFindScrollableParent(),this.intersectionObserver.disconnect(),this.intersectionObserver=new IntersectionObserver(this.onVisibilityChange,{rootMargin:"-2px",threshold:[0,.01,.1]}),this.mutationObserver.disconnect(),this.mutationObserver.observe(this.itemsContainer,{childList:!0})}),0)}triggerFindScrollableParent(){this.itemsContainer.dispatchEvent(new Event("find-scrollable-parent",{composed:!0}))}findScrollableParent(t){t.stopPropagation();for(let i of t.composedPath()){const t=i;if(t.clientHeight&&t.clientHeight<t.scrollHeight&&["auto","scroll"].includes(getComputedStyle(t).overflowY)){this.firstScrollableParent=t;break}}}disconnectedCallback(){super.disconnectedCallback(),this.intersectionObserver.disconnect(),this.resizeObserver.disconnect(),this.mutationObserver.disconnect()}firstUpdated(t){super.firstUpdated(t),this.resetScroll()}update(t){super.update(t),t.has("items")&&(this.alreadyRenderedIndexes=new Set),(t.has("scrollToItem")||t.has("scrollToIndex"))&&this.resetScroll()}updated(t){super.updated(t),(t.has("visibleItems")||t.has("items"))&&this.dispatchEvent(new ji(this.visibleItems,this.visibleItems.map((t=>this.items[t])))),t.has("scrolledToTarget")&&this.scrolledToTarget&&this.dispatchEvent(new Ei)}}_i.styles=e.css`
|
|
216
216
|
.items-container {
|
|
217
217
|
position: relative;
|
|
218
218
|
padding: ${Ci};
|
|
@@ -303,7 +303,7 @@ const{H:gi}=nt,bi=()=>document.createComment(""),mi=(t,e,i)=>{var o;const s=t._$
|
|
|
303
303
|
* @license
|
|
304
304
|
* Copyright 2017 Google LLC
|
|
305
305
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
306
|
-
*/var ki=function(t,e,i,o){for(var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};const Ni=dt.create("--ft-infinite-scroll-padding","SIZE","0");class Ci extends CustomEvent{constructor(t,e){super("visible-items-change",{detail:{visibleIndexes:t,visibleItems:e}})}}class Ei extends Event{constructor(){super("scrolled-to-target")}}class Ri extends ft{constructor(){super(...arguments),this.items=[],this.renderItem=()=>D``,this.internalScroll=!1,this.visibleItems=[],this.scrolledToTarget=!1,this.alreadyRenderedIndexes=new Set,this.scrollDebouncer=new e(5),this.onVisibilityChange=t=>{const e=t.filter((t=>t.intersectionRect.height>1)).map((t=>+t.target.attributes.getNamedItem("data-item-index").value)).filter((t=>!this.visibleItems.includes(t))),i=t.filter((t=>t.intersectionRect.height<=1)).map((t=>+t.target.attributes.getNamedItem("data-item-index").value)).filter((t=>this.visibleItems.includes(t))),o=[...this.visibleItems].filter((t=>!i.includes(t)));this.visibleItems=[...e,...o].sort(((t,e)=>t-e))},this.intersectionObserver=new IntersectionObserver(this.onVisibilityChange),this.onResize=t=>{this.triggerFindScrollableParent();let e=0;for(const i of t){const t=+i.target.parentElement.getAttribute("data-item-index")
|
|
306
|
+
*/var ki=function(t,e,i,o){for(var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};const Ni=dt.create("--ft-infinite-scroll-padding","SIZE","0");class Ci extends CustomEvent{constructor(t,e){super("visible-items-change",{detail:{visibleIndexes:t,visibleItems:e}})}}class Ei extends Event{constructor(){super("scrolled-to-target")}}class Ri extends ft{constructor(){super(...arguments),this.items=[],this.renderItem=()=>D``,this.internalScroll=!1,this.visibleItems=[],this.scrolledToTarget=!1,this.alreadyRenderedIndexes=new Set,this.scrollDebouncer=new e(5),this.onVisibilityChange=t=>{const e=t.filter((t=>t.intersectionRect.height>1)).map((t=>+t.target.attributes.getNamedItem("data-item-index").value)).filter((t=>!this.visibleItems.includes(t))),i=t.filter((t=>t.intersectionRect.height<=1)).map((t=>+t.target.attributes.getNamedItem("data-item-index").value)).filter((t=>this.visibleItems.includes(t))),o=[...this.visibleItems].filter((t=>!i.includes(t)));this.visibleItems=[...e,...o].sort(((t,e)=>t-e))},this.intersectionObserver=new IntersectionObserver(this.onVisibilityChange),this.onResize=t=>{this.triggerFindScrollableParent();let e=0;t=t.sort(((t,e)=>t.contentRect.top-e.contentRect.top));for(const i of t){const t=+i.target.parentElement.getAttribute("data-item-index"),o=i.target.parentElement.clientHeight,s=i.contentRect.height;this.alreadyRenderedIndexes.has(t)&&(i.target.parentElement.style.height=s+"px",e+=this.scrollable&&this.getOffset(i.target.parentElement)<this.scrollable.scrollTop+e?s-o:0)}this.scrollable&&xt&&(this.scrollable.scrollTop+=e)},this.resizeObserver=new ResizeObserver(this.onResize),this.onMutation=()=>{[...this.itemsContainer.children].forEach((t=>{this.intersectionObserver.observe(t),this.resizeObserver.observe(t.children.item(0))}))},this.mutationObserver=new MutationObserver(this.onMutation)}get scrollable(){return this.internalScroll?this.internalScrollable:this.firstScrollableParent}render(){return D`
|
|
307
307
|
<div class="items-container ${this.internalScroll?"scrollable":""}"
|
|
308
308
|
tabindex="-1"
|
|
309
309
|
@find-scrollable-parent=${this.findScrollableParent}>
|
|
@@ -317,7 +317,7 @@ const{H:gi}=nt,bi=()=>document.createComment(""),mi=(t,e,i)=>{var o;const s=t._$
|
|
|
317
317
|
${o?(()=>{const i=this.renderItem(t,e);return"string"==typeof i?D`${Rt(i)}`:i})():null}
|
|
318
318
|
</div>
|
|
319
319
|
</div>
|
|
320
|
-
`}resetScroll(){this.intersectionObserver.disconnect(),this.resizeObserver.disconnect(),this.visibleItems=[],this.scrolledToTarget=!1,this.scrollDebouncer.run((()=>{var t,e;let i=null!==(t=this.scrollToIndex)&&void 0!==t?t:this.scrollToItem?this.items.indexOf(this.scrollToItem):-1;i>=this.items.length&&(i=-1);let o=null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector(`#item-${i}`);
|
|
320
|
+
`}resetScroll(){this.intersectionObserver.disconnect(),this.resizeObserver.disconnect(),this.visibleItems=[],this.scrolledToTarget=!1,this.scrollDebouncer.run((()=>{var t,e;let i=null!==(t=this.scrollToIndex)&&void 0!==t?t:this.scrollToItem?this.items.indexOf(this.scrollToItem):-1;i>=this.items.length&&(i=-1);let o=null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector(`#item-${i}`);this.scrollToTarget(o),this.onMutation(),setTimeout((()=>{this.scrolledToTarget=!0}),10)}))}scrollToTarget(t){var e;if(t){let i=+(null!==(e=t.getAttribute("data-item-index"))&&void 0!==e?e:"0");this.scrollable?this.scrollable.scrollTop=i>0?this.getOffset(t)+1:0:t.scrollIntoView({block:"start"})}}getOffset(t){var e;let i=0,o=t;for(;o&&o.offsetParent!==this.scrollable.offsetParent;)i+=o.offsetTop,o=o.offsetParent;return i+(null!==(e=null==o?void 0:o.offsetTop)&&void 0!==e?e:0)-this.scrollable.offsetTop}appendItems(...t){this.items=[...this.items,...t]}prependItems(...t){this.items=[...t,...this.items]}connectedCallback(){super.connectedCallback(),setTimeout((()=>{this.triggerFindScrollableParent(),this.intersectionObserver.disconnect(),this.intersectionObserver=new IntersectionObserver(this.onVisibilityChange,{rootMargin:"-2px",threshold:[0,.01,.1]}),this.mutationObserver.disconnect(),this.mutationObserver.observe(this.itemsContainer,{childList:!0})}),0)}triggerFindScrollableParent(){this.itemsContainer.dispatchEvent(new Event("find-scrollable-parent",{composed:!0}))}findScrollableParent(t){t.stopPropagation();for(let e of t.composedPath()){const t=e;if(t.clientHeight&&t.clientHeight<t.scrollHeight&&["auto","scroll"].includes(getComputedStyle(t).overflowY)){this.firstScrollableParent=t;break}}}disconnectedCallback(){super.disconnectedCallback(),this.intersectionObserver.disconnect(),this.resizeObserver.disconnect(),this.mutationObserver.disconnect()}firstUpdated(t){super.firstUpdated(t),this.resetScroll()}update(t){super.update(t),t.has("items")&&(this.alreadyRenderedIndexes=new Set),(t.has("scrollToItem")||t.has("scrollToIndex"))&&this.resetScroll()}updated(t){super.updated(t),(t.has("visibleItems")||t.has("items"))&&this.dispatchEvent(new Ci(this.visibleItems,this.visibleItems.map((t=>this.items[t])))),t.has("scrolledToTarget")&&this.scrolledToTarget&&this.dispatchEvent(new Ei)}}Ri.styles=f`
|
|
321
321
|
.items-container {
|
|
322
322
|
position: relative;
|
|
323
323
|
padding: ${Ni};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluid-topics/ft-reader-content",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.8",
|
|
4
4
|
"description": "Main content for integrated reader",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Lit"
|
|
@@ -19,11 +19,11 @@
|
|
|
19
19
|
"url": "ssh://git@scm.mrs.antidot.net:2222/fluidtopics/ft-web-components.git"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@fluid-topics/ft-infinite-scroll": "0.3.
|
|
23
|
-
"@fluid-topics/ft-reader-context": "0.3.
|
|
24
|
-
"@fluid-topics/ft-reader-topic": "0.3.
|
|
25
|
-
"@fluid-topics/ft-wc-utils": "0.3.
|
|
22
|
+
"@fluid-topics/ft-infinite-scroll": "0.3.8",
|
|
23
|
+
"@fluid-topics/ft-reader-context": "0.3.8",
|
|
24
|
+
"@fluid-topics/ft-reader-topic": "0.3.8",
|
|
25
|
+
"@fluid-topics/ft-wc-utils": "0.3.8",
|
|
26
26
|
"lit": "2.2.8"
|
|
27
27
|
},
|
|
28
|
-
"gitHead": "
|
|
28
|
+
"gitHead": "1f42b53be98492f7b9c614f005535bdacc0229a1"
|
|
29
29
|
}
|