@fluid-topics/ft-reader-content 0.3.68 → 0.3.70

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.
@@ -29,8 +29,8 @@
29
29
  width: 0;
30
30
  }
31
31
 
32
- .resizable > * {
33
- min-height: .1px;
32
+ .item-container, .resizable, .resizable > * {
33
+ min-height: 1px;
34
34
  }
35
35
 
36
36
  .rendered {
@@ -57,7 +57,7 @@ const h=window,c=h.ShadowRoot&&(void 0===h.ShadyCSS||h.ShadyCSS.nativeShadow)&&"
57
57
  * Copyright 2017 Google LLC
58
58
  * SPDX-License-Identifier: BSD-3-Clause
59
59
  */
60
- var E;N.finalized=!0,N.elementProperties=new Map,N.elementStyles=[],N.shadowRootOptions={mode:"open"},null==O||O({ReactiveElement:N}),(null!==(x=g.reactiveElementVersions)&&void 0!==x?x:g.reactiveElementVersions=[]).push("1.4.1");const R=window,M=R.trustedTypes,k=M?M.createPolicy("lit-html",{createHTML:t=>t}):void 0,U=`lit$${(Math.random()+"").slice(9)}$`,T="?"+U,j=`<${T}>`,A=document,F=(t="")=>A.createComment(t),I=t=>null===t||"object"!=typeof t&&"function"!=typeof t,L=Array.isArray,B=t=>L(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]),_=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,W=/-->/g,K=/>/g,P=RegExp(">|[ \t\n\f\r](?:([^\\s\"'>=/]+)([ \t\n\f\r]*=[ \t\n\f\r]*(?:[^ \t\n\f\r\"'`<>=]|(\"|')|))|$)","g"),D=/'/g,z=/"/g,H=/^(?:script|style|textarea|title)$/i,Z=(t=>(e,...i)=>({_$litType$:t,strings:e,values:i}))(1),J=Symbol.for("lit-noChange"),V=Symbol.for("lit-nothing"),q=new WeakMap,X=A.createTreeWalker(A,129,null,!1),G=(t,e)=>{const i=t.length-1,s=[];let n,r=2===e?"<svg>":"",o=_;for(let e=0;e<i;e++){const i=t[e];let l,a,h=-1,c=0;for(;c<i.length&&(o.lastIndex=c,a=o.exec(i),null!==a);)c=o.lastIndex,o===_?"!--"===a[1]?o=W:void 0!==a[1]?o=K:void 0!==a[2]?(H.test(a[2])&&(n=RegExp("</"+a[2],"g")),o=P):void 0!==a[3]&&(o=P):o===P?">"===a[0]?(o=null!=n?n:_,h=-1):void 0===a[1]?h=-2:(h=o.lastIndex-a[2].length,l=a[1],o=void 0===a[3]?P:'"'===a[3]?z:D):o===z||o===D?o=P:o===W||o===K?o=_:(o=P,n=void 0);const u=o===P&&t[e+1].startsWith("/>")?" ":"";r+=o===_?i+j:h>=0?(s.push(l),i.slice(0,h)+"$lit$"+i.slice(h)+U+u):i+U+(-2===h?(s.push(void 0),e):u)}const l=r+(t[i]||"<?>")+(2===e?"</svg>":"");if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return[void 0!==k?k.createHTML(l):l,s]};class Q{constructor({strings:t,_$litType$:e},i){let s;this.parts=[];let n=0,r=0;const o=t.length-1,l=this.parts,[a,h]=G(t,e);if(this.el=Q.createElement(a,i),X.currentNode=this.el.content,2===e){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(s=X.nextNode())&&l.length<o;){if(1===s.nodeType){if(s.hasAttributes()){const t=[];for(const e of s.getAttributeNames())if(e.endsWith("$lit$")||e.startsWith(U)){const i=h[r++];if(t.push(e),void 0!==i){const t=s.getAttribute(i.toLowerCase()+"$lit$").split(U),e=/([.?@])?(.*)/.exec(i);l.push({type:1,index:n,name:e[2],strings:t,ctor:"."===e[1]?st:"?"===e[1]?rt:"@"===e[1]?ot:it})}else l.push({type:6,index:n})}for(const e of t)s.removeAttribute(e)}if(H.test(s.tagName)){const t=s.textContent.split(U),e=t.length-1;if(e>0){s.textContent=M?M.emptyScript:"";for(let i=0;i<e;i++)s.append(t[i],F()),X.nextNode(),l.push({type:2,index:++n});s.append(t[e],F())}}}else if(8===s.nodeType)if(s.data===T)l.push({type:2,index:n});else{let t=-1;for(;-1!==(t=s.data.indexOf(U,t+1));)l.push({type:7,index:n}),t+=U.length-1}n++}}static createElement(t,e){const i=A.createElement("template");return i.innerHTML=t,i}}function Y(t,e,i=t,s){var n,r,o,l;if(e===J)return e;let a=void 0!==s?null===(n=i._$Co)||void 0===n?void 0:n[s]:i._$Cl;const h=I(e)?void 0:e._$litDirective$;return(null==a?void 0:a.constructor)!==h&&(null===(r=null==a?void 0:a._$AO)||void 0===r||r.call(a,!1),void 0===h?a=void 0:(a=new h(t),a._$AT(t,i,s)),void 0!==s?(null!==(o=(l=i)._$Co)&&void 0!==o?o:l._$Co=[])[s]=a:i._$Cl=a),void 0!==a&&(e=Y(t,a._$AS(t,e.values),a,s)),e}class tt{constructor(t,e){this.u=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}v(t){var e;const{el:{content:i},parts:s}=this._$AD,n=(null!==(e=null==t?void 0:t.creationScope)&&void 0!==e?e:A).importNode(i,!0);X.currentNode=n;let r=X.nextNode(),o=0,l=0,a=s[0];for(;void 0!==a;){if(o===a.index){let e;2===a.type?e=new et(r,r.nextSibling,this,t):1===a.type?e=new a.ctor(r,a.name,a.strings,this,t):6===a.type&&(e=new lt(r,this,t)),this.u.push(e),a=s[++l]}o!==(null==a?void 0:a.index)&&(r=X.nextNode(),o++)}return n}p(t){let e=0;for(const i of this.u)void 0!==i&&(void 0!==i.strings?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}}class et{constructor(t,e,i,s){var n;this.type=2,this._$AH=V,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=s,this._$Cm=null===(n=null==s?void 0:s.isConnected)||void 0===n||n}get _$AU(){var t,e;return null!==(e=null===(t=this._$AM)||void 0===t?void 0:t._$AU)&&void 0!==e?e:this._$Cm}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===t.nodeType&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=Y(this,t,e),I(t)?t===V||null==t||""===t?(this._$AH!==V&&this._$AR(),this._$AH=V):t!==this._$AH&&t!==J&&this.g(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):B(t)?this.k(t):this.g(t)}O(t,e=this._$AB){return this._$AA.parentNode.insertBefore(t,e)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}g(t){this._$AH!==V&&I(this._$AH)?this._$AA.nextSibling.data=t:this.T(A.createTextNode(t)),this._$AH=t}$(t){var e;const{values:i,_$litType$:s}=t,n="number"==typeof s?this._$AC(t):(void 0===s.el&&(s.el=Q.createElement(s.h,this.options)),s);if((null===(e=this._$AH)||void 0===e?void 0:e._$AD)===n)this._$AH.p(i);else{const t=new tt(n,this),e=t.v(this.options);t.p(i),this.T(e),this._$AH=t}}_$AC(t){let e=q.get(t.strings);return void 0===e&&q.set(t.strings,e=new Q(t)),e}k(t){L(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let i,s=0;for(const n of t)s===e.length?e.push(i=new et(this.O(F()),this.O(F()),this,this.options)):i=e[s],i._$AI(n),s++;s<e.length&&(this._$AR(i&&i._$AB.nextSibling,s),e.length=s)}_$AR(t=this._$AA.nextSibling,e){var i;for(null===(i=this._$AP)||void 0===i||i.call(this,!1,!0,e);t&&t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){var e;void 0===this._$AM&&(this._$Cm=t,null===(e=this._$AP)||void 0===e||e.call(this,t))}}class it{constructor(t,e,i,s,n){this.type=1,this._$AH=V,this._$AN=void 0,this.element=t,this.name=e,this._$AM=s,this.options=n,i.length>2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=V}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,i,s){const n=this.strings;let r=!1;if(void 0===n)t=Y(this,t,e,0),r=!I(t)||t!==this._$AH&&t!==J,r&&(this._$AH=t);else{const s=t;let o,l;for(t=n[0],o=0;o<n.length-1;o++)l=Y(this,s[i+o],e,o),l===J&&(l=this._$AH[o]),r||(r=!I(l)||l!==this._$AH[o]),l===V?t=V:t!==V&&(t+=(null!=l?l:"")+n[o+1]),this._$AH[o]=l}r&&!s&&this.j(t)}j(t){t===V?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}class st extends it{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===V?void 0:t}}const nt=M?M.emptyScript:"";class rt extends it{constructor(){super(...arguments),this.type=4}j(t){t&&t!==V?this.element.setAttribute(this.name,nt):this.element.removeAttribute(this.name)}}class ot extends it{constructor(t,e,i,s,n){super(t,e,i,s,n),this.type=5}_$AI(t,e=this){var i;if((t=null!==(i=Y(this,t,e,0))&&void 0!==i?i:V)===J)return;const s=this._$AH,n=t===V&&s!==V||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,r=t!==V&&(s===V||n);n&&this.element.removeEventListener(this.name,this,s),r&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e,i;"function"==typeof this._$AH?this._$AH.call(null!==(i=null===(e=this.options)||void 0===e?void 0:e.host)&&void 0!==i?i:this.element,t):this._$AH.handleEvent(t)}}class lt{constructor(t,e,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){Y(this,t)}}const at={P:"$lit$",A:U,M:T,C:1,L:G,R:tt,D:B,V:Y,I:et,H:it,N:rt,U:ot,B:st,F:lt},ht=R.litHtmlPolyfillSupport;null==ht||ht(Q,et),(null!==(E=R.litHtmlVersions)&&void 0!==E?E:R.litHtmlVersions=[]).push("2.4.0");
60
+ var E;N.finalized=!0,N.elementProperties=new Map,N.elementStyles=[],N.shadowRootOptions={mode:"open"},null==O||O({ReactiveElement:N}),(null!==(x=g.reactiveElementVersions)&&void 0!==x?x:g.reactiveElementVersions=[]).push("1.4.1");const R=window,M=R.trustedTypes,k=M?M.createPolicy("lit-html",{createHTML:t=>t}):void 0,U=`lit$${(Math.random()+"").slice(9)}$`,T="?"+U,j=`<${T}>`,A=document,F=(t="")=>A.createComment(t),I=t=>null===t||"object"!=typeof t&&"function"!=typeof t,L=Array.isArray,B=t=>L(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]),_=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,W=/-->/g,K=/>/g,P=RegExp(">|[ \t\n\f\r](?:([^\\s\"'>=/]+)([ \t\n\f\r]*=[ \t\n\f\r]*(?:[^ \t\n\f\r\"'`<>=]|(\"|')|))|$)","g"),z=/'/g,D=/"/g,H=/^(?:script|style|textarea|title)$/i,Z=(t=>(e,...i)=>({_$litType$:t,strings:e,values:i}))(1),J=Symbol.for("lit-noChange"),V=Symbol.for("lit-nothing"),q=new WeakMap,X=A.createTreeWalker(A,129,null,!1),G=(t,e)=>{const i=t.length-1,s=[];let n,r=2===e?"<svg>":"",o=_;for(let e=0;e<i;e++){const i=t[e];let l,a,h=-1,c=0;for(;c<i.length&&(o.lastIndex=c,a=o.exec(i),null!==a);)c=o.lastIndex,o===_?"!--"===a[1]?o=W:void 0!==a[1]?o=K:void 0!==a[2]?(H.test(a[2])&&(n=RegExp("</"+a[2],"g")),o=P):void 0!==a[3]&&(o=P):o===P?">"===a[0]?(o=null!=n?n:_,h=-1):void 0===a[1]?h=-2:(h=o.lastIndex-a[2].length,l=a[1],o=void 0===a[3]?P:'"'===a[3]?D:z):o===D||o===z?o=P:o===W||o===K?o=_:(o=P,n=void 0);const u=o===P&&t[e+1].startsWith("/>")?" ":"";r+=o===_?i+j:h>=0?(s.push(l),i.slice(0,h)+"$lit$"+i.slice(h)+U+u):i+U+(-2===h?(s.push(void 0),e):u)}const l=r+(t[i]||"<?>")+(2===e?"</svg>":"");if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return[void 0!==k?k.createHTML(l):l,s]};class Q{constructor({strings:t,_$litType$:e},i){let s;this.parts=[];let n=0,r=0;const o=t.length-1,l=this.parts,[a,h]=G(t,e);if(this.el=Q.createElement(a,i),X.currentNode=this.el.content,2===e){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(s=X.nextNode())&&l.length<o;){if(1===s.nodeType){if(s.hasAttributes()){const t=[];for(const e of s.getAttributeNames())if(e.endsWith("$lit$")||e.startsWith(U)){const i=h[r++];if(t.push(e),void 0!==i){const t=s.getAttribute(i.toLowerCase()+"$lit$").split(U),e=/([.?@])?(.*)/.exec(i);l.push({type:1,index:n,name:e[2],strings:t,ctor:"."===e[1]?st:"?"===e[1]?rt:"@"===e[1]?ot:it})}else l.push({type:6,index:n})}for(const e of t)s.removeAttribute(e)}if(H.test(s.tagName)){const t=s.textContent.split(U),e=t.length-1;if(e>0){s.textContent=M?M.emptyScript:"";for(let i=0;i<e;i++)s.append(t[i],F()),X.nextNode(),l.push({type:2,index:++n});s.append(t[e],F())}}}else if(8===s.nodeType)if(s.data===T)l.push({type:2,index:n});else{let t=-1;for(;-1!==(t=s.data.indexOf(U,t+1));)l.push({type:7,index:n}),t+=U.length-1}n++}}static createElement(t,e){const i=A.createElement("template");return i.innerHTML=t,i}}function Y(t,e,i=t,s){var n,r,o,l;if(e===J)return e;let a=void 0!==s?null===(n=i._$Co)||void 0===n?void 0:n[s]:i._$Cl;const h=I(e)?void 0:e._$litDirective$;return(null==a?void 0:a.constructor)!==h&&(null===(r=null==a?void 0:a._$AO)||void 0===r||r.call(a,!1),void 0===h?a=void 0:(a=new h(t),a._$AT(t,i,s)),void 0!==s?(null!==(o=(l=i)._$Co)&&void 0!==o?o:l._$Co=[])[s]=a:i._$Cl=a),void 0!==a&&(e=Y(t,a._$AS(t,e.values),a,s)),e}class tt{constructor(t,e){this.u=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}v(t){var e;const{el:{content:i},parts:s}=this._$AD,n=(null!==(e=null==t?void 0:t.creationScope)&&void 0!==e?e:A).importNode(i,!0);X.currentNode=n;let r=X.nextNode(),o=0,l=0,a=s[0];for(;void 0!==a;){if(o===a.index){let e;2===a.type?e=new et(r,r.nextSibling,this,t):1===a.type?e=new a.ctor(r,a.name,a.strings,this,t):6===a.type&&(e=new lt(r,this,t)),this.u.push(e),a=s[++l]}o!==(null==a?void 0:a.index)&&(r=X.nextNode(),o++)}return n}p(t){let e=0;for(const i of this.u)void 0!==i&&(void 0!==i.strings?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}}class et{constructor(t,e,i,s){var n;this.type=2,this._$AH=V,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=s,this._$Cm=null===(n=null==s?void 0:s.isConnected)||void 0===n||n}get _$AU(){var t,e;return null!==(e=null===(t=this._$AM)||void 0===t?void 0:t._$AU)&&void 0!==e?e:this._$Cm}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===t.nodeType&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=Y(this,t,e),I(t)?t===V||null==t||""===t?(this._$AH!==V&&this._$AR(),this._$AH=V):t!==this._$AH&&t!==J&&this.g(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):B(t)?this.k(t):this.g(t)}O(t,e=this._$AB){return this._$AA.parentNode.insertBefore(t,e)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}g(t){this._$AH!==V&&I(this._$AH)?this._$AA.nextSibling.data=t:this.T(A.createTextNode(t)),this._$AH=t}$(t){var e;const{values:i,_$litType$:s}=t,n="number"==typeof s?this._$AC(t):(void 0===s.el&&(s.el=Q.createElement(s.h,this.options)),s);if((null===(e=this._$AH)||void 0===e?void 0:e._$AD)===n)this._$AH.p(i);else{const t=new tt(n,this),e=t.v(this.options);t.p(i),this.T(e),this._$AH=t}}_$AC(t){let e=q.get(t.strings);return void 0===e&&q.set(t.strings,e=new Q(t)),e}k(t){L(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let i,s=0;for(const n of t)s===e.length?e.push(i=new et(this.O(F()),this.O(F()),this,this.options)):i=e[s],i._$AI(n),s++;s<e.length&&(this._$AR(i&&i._$AB.nextSibling,s),e.length=s)}_$AR(t=this._$AA.nextSibling,e){var i;for(null===(i=this._$AP)||void 0===i||i.call(this,!1,!0,e);t&&t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){var e;void 0===this._$AM&&(this._$Cm=t,null===(e=this._$AP)||void 0===e||e.call(this,t))}}class it{constructor(t,e,i,s,n){this.type=1,this._$AH=V,this._$AN=void 0,this.element=t,this.name=e,this._$AM=s,this.options=n,i.length>2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=V}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,i,s){const n=this.strings;let r=!1;if(void 0===n)t=Y(this,t,e,0),r=!I(t)||t!==this._$AH&&t!==J,r&&(this._$AH=t);else{const s=t;let o,l;for(t=n[0],o=0;o<n.length-1;o++)l=Y(this,s[i+o],e,o),l===J&&(l=this._$AH[o]),r||(r=!I(l)||l!==this._$AH[o]),l===V?t=V:t!==V&&(t+=(null!=l?l:"")+n[o+1]),this._$AH[o]=l}r&&!s&&this.j(t)}j(t){t===V?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}class st extends it{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===V?void 0:t}}const nt=M?M.emptyScript:"";class rt extends it{constructor(){super(...arguments),this.type=4}j(t){t&&t!==V?this.element.setAttribute(this.name,nt):this.element.removeAttribute(this.name)}}class ot extends it{constructor(t,e,i,s,n){super(t,e,i,s,n),this.type=5}_$AI(t,e=this){var i;if((t=null!==(i=Y(this,t,e,0))&&void 0!==i?i:V)===J)return;const s=this._$AH,n=t===V&&s!==V||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,r=t!==V&&(s===V||n);n&&this.element.removeEventListener(this.name,this,s),r&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e,i;"function"==typeof this._$AH?this._$AH.call(null!==(i=null===(e=this.options)||void 0===e?void 0:e.host)&&void 0!==i?i:this.element,t):this._$AH.handleEvent(t)}}class lt{constructor(t,e,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){Y(this,t)}}const at={P:"$lit$",A:U,M:T,C:1,L:G,R:tt,D:B,V:Y,I:et,H:it,N:rt,U:ot,B:st,F:lt},ht=R.litHtmlPolyfillSupport;null==ht||ht(Q,et),(null!==(E=R.litHtmlVersions)&&void 0!==E?E:R.litHtmlVersions=[]).push("2.4.0");
61
61
  /**
62
62
  * @license
63
63
  * Copyright 2017 Google LLC
@@ -158,14 +158,14 @@ class Lt extends Rt{constructor(t){if(super(t),this.it=V,t.type!==Nt)throw Error
158
158
  width: 0;
159
159
  }
160
160
 
161
- .resizable > * {
162
- min-height: .1px;
161
+ .item-container, .resizable, .resizable > * {
162
+ min-height: 1px;
163
163
  }
164
164
 
165
165
  .rendered {
166
166
  display: flow-root;
167
167
  }
168
- `;var Pt=function(t,e,i,s){for(var n,r=arguments.length,o=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s,l=t.length-1;l>=0;l--)(n=t[l])&&(o=(r<3?n(o):r>3?n(e,i,o):n(e,i))||o);return r>3&&o&&Object.defineProperty(e,i,o),o};class Dt extends CustomEvent{constructor(t,e){super("visible-items-change",{detail:{visibleIndexes:t,visibleItems:e}})}}class zt extends Event{constructor(){super("scrolled-to-target")}}class Ht extends bt{constructor(){super(...arguments),this.items=[],this.renderItem=()=>Z``,this.internalScroll=!1,this.renderBeforeFirst=1,this.renderAfterLast=1,this.visibleItems=[],this.scrolledToTarget=!1,this.alreadyRenderedIndexes=new Set,this.scrollDebouncer=new e(5),this.scrollDoneDebouncer=new e(10),this.onVisibilityChange=t=>{let e=new Set(this.visibleItems),i=new Set;for(let s of t){let t=+s.target.attributes.getNamedItem("data-item-index").value;s.intersectionRect.height>0?(e.add(t),i.add(t)):i.has(t)||e.delete(t)}this.visibleItems=[...e].sort(((t,e)=>t-e))},this.intersectionObserver=new IntersectionObserver(this.onVisibilityChange),this.onResize=t=>{var e;this.triggerFindScrollableParent(),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"),s=i.target.parentElement.clientHeight,n=i.contentRect.height;if(this.alreadyRenderedIndexes.has(t)){if(this.scrollable){"none"===(null!==(e=getComputedStyle(this.scrollable).overflowAnchor)&&void 0!==e?e:"none")&&this.getOffset(i.target.parentElement)+s<this.scrollable.scrollTop&&(this.scrollable.scrollTop+=Math.ceil(n-s))}i.target.parentElement.style.height=n+"px"}}},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 Z`
168
+ `;var Pt=function(t,e,i,s){for(var n,r=arguments.length,o=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s,l=t.length-1;l>=0;l--)(n=t[l])&&(o=(r<3?n(o):r>3?n(e,i,o):n(e,i))||o);return r>3&&o&&Object.defineProperty(e,i,o),o};class zt extends CustomEvent{constructor(t,e){super("visible-items-change",{detail:{visibleIndexes:t,visibleItems:e}})}}class Dt extends Event{constructor(){super("scrolled-to-target")}}class Ht extends bt{constructor(){super(...arguments),this.items=[],this.renderItem=()=>Z``,this.internalScroll=!1,this.renderBeforeFirst=1,this.renderAfterLast=1,this.visibleItems=[],this.scrolledToTarget=!1,this.alreadyRenderedIndexes=new Set,this.scrollDebouncer=new e(5),this.scrollDoneDebouncer=new e(10),this.onVisibilityChange=t=>{let e=new Set(this.visibleItems),i=new Set;for(let s of t){let t=+s.target.attributes.getNamedItem("data-item-index").value;s.intersectionRect.height>0?(e.add(t),i.add(t)):i.has(t)||e.delete(t)}this.visibleItems=[...e].sort(((t,e)=>t-e))},this.intersectionObserver=new IntersectionObserver(this.onVisibilityChange),this.onResize=t=>{var e;this.triggerFindScrollableParent(),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"),s=i.target.parentElement.clientHeight,n=i.contentRect.height;if(this.alreadyRenderedIndexes.has(t)){if(this.scrollable){"none"===(null!==(e=getComputedStyle(this.scrollable).overflowAnchor)&&void 0!==e?e:"none")&&this.getOffset(i.target.parentElement)+s<this.scrollable.scrollTop&&(this.scrollable.scrollTop+=Math.ceil(n-s))}i.target.parentElement.style.height=n+"px"}}},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 Z`
169
169
  <div class="items-container ${this.internalScroll?"scrollable":""}"
170
170
  tabindex="-1"
171
171
  @find-scrollable-parent=${this.findScrollableParent}>
@@ -179,7 +179,7 @@ class Lt extends Rt{constructor(t){if(super(t),this.it=V,t.type!==Nt)throw Error
179
179
  ${s?(()=>{const i=this.renderItem(t,e);return"string"==typeof i?Z`${Bt(i)}`:i})():null}
180
180
  </div>
181
181
  </div>
182
- `}resetScroll(){this.triggerFindScrollableParent(),this.intersectionObserver.disconnect(),this.resizeObserver.disconnect(),this.visibleItems=[],this.scrolledToTarget=!1,this.scrollDebouncer.run((()=>{var t;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 i=this.getItem(e);this.scrollToTarget(i),this.onMutation(),this.scrollDoneDebouncer.run((()=>{this.scrolledToTarget=!0}))}))}getItem(t){var e;return null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector(`#item-${t}`)}scrollToTarget(t){var e;if(t){let i=+(null!==(e=t.getAttribute("data-item-index"))&&void 0!==e?e:"0");this.scrollable&&0===i?this.scrollable.scrollTop=0:t.scrollIntoView({block:"start"})}}getOffset(t){var e;let i=0,s=t;for(;s&&s.offsetParent!==this.scrollable.offsetParent;)i+=s.offsetTop,s=s.offsetParent;return i+(null!==(e=null==s?void 0:s.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.initIntersectionObserver(),this.mutationObserver.disconnect(),this.mutationObserver.observe(this.itemsContainer,{childList:!0})}),0)}initIntersectionObserver(){this.intersectionObserver.disconnect(),this.intersectionObserver=new IntersectionObserver(this.onVisibilityChange,{root:this.scrollable,rootMargin:"-8px",threshold:[0,.01,.1,1]})}triggerFindScrollableParent(){var t;null===(t=this.itemsContainer)||void 0===t||t.dispatchEvent(new Event("find-scrollable-parent",{composed:!0}))}findScrollableParent(t){let e,i;t.stopPropagation();for(let s of t.composedPath()){const t=s,n=this.elementCanScroll(t);if(t.clientHeight&&t.clientHeight<t.scrollHeight&&n){e=t;break}n&&(i=t)}let s=e||i;s!==this.firstScrollableParent&&(this.firstScrollableParent=s,this.initIntersectionObserver(),this.resetScroll())}elementCanScroll(t){try{return["auto","scroll"].includes(getComputedStyle(t).overflowY)}catch(t){return!1}}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")&&(null!=this.scrollToItem||null!=this.scrollToIndex))&&this.resetScroll()}updated(t){super.updated(t),(t.has("visibleItems")||t.has("items"))&&this.dispatchEvent(new Dt(this.visibleItems,this.visibleItems.map((t=>this.items[t])))),t.has("scrolledToTarget")&&this.scrolledToTarget&&(null!=this.scrollToItem||null!=this.scrollToIndex)&&this.dispatchEvent(new zt)}}Ht.styles=Kt,Pt([s({type:Array})],Ht.prototype,"items",void 0),Pt([s({attribute:!1})],Ht.prototype,"renderItem",void 0),Pt([s({type:Object})],Ht.prototype,"scrollToItem",void 0),Pt([s({type:Number})],Ht.prototype,"scrollToIndex",void 0),Pt([s({type:Boolean})],Ht.prototype,"internalScroll",void 0),Pt([s({type:Number})],Ht.prototype,"renderBeforeFirst",void 0),Pt([s({type:Number})],Ht.prototype,"renderAfterLast",void 0),Pt([n({hasChanged:(t,e)=>null!=t&&null==e||t.length!==e.length||t[0]!==e[0]})],Ht.prototype,"visibleItems",void 0),Pt([r(".scrollable")],Ht.prototype,"internalScrollable",void 0),Pt([r(".items-container")],Ht.prototype,"itemsContainer",void 0),Pt([n()],Ht.prototype,"scrolledToTarget",void 0),a("ft-infinite-scroll")(Ht);const Zt=v`
182
+ `}resetScroll(){this.triggerFindScrollableParent(),this.intersectionObserver.disconnect(),this.resizeObserver.disconnect(),this.visibleItems=[],this.scrolledToTarget=!1,this.scrollDebouncer.run((()=>{var t;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 i=this.getItem(e);this.scrollToTarget(i),this.onMutation(),this.scrollDoneDebouncer.run((()=>{this.scrolledToTarget=!0}))}))}getItem(t){var e;return null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector(`#item-${t}`)}scrollToTarget(t){var e;if(t){let i=+(null!==(e=t.getAttribute("data-item-index"))&&void 0!==e?e:"0");this.scrollable&&0===i?this.scrollable.scrollTop=0:t.scrollIntoView({block:"start"})}}getOffset(t){var e;let i=0,s=t;for(;s&&s.offsetParent!==this.scrollable.offsetParent;)i+=s.offsetTop,s=s.offsetParent;return i+(null!==(e=null==s?void 0:s.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.initIntersectionObserver(),this.mutationObserver.disconnect(),this.mutationObserver.observe(this.itemsContainer,{childList:!0})}),0)}initIntersectionObserver(){this.intersectionObserver.disconnect(),this.intersectionObserver=new IntersectionObserver(this.onVisibilityChange,{root:this.scrollable,rootMargin:"-8px",threshold:[0,.01,.1,1]})}triggerFindScrollableParent(){var t;null===(t=this.itemsContainer)||void 0===t||t.dispatchEvent(new Event("find-scrollable-parent",{composed:!0}))}findScrollableParent(t){let e,i;t.stopPropagation();for(let s of t.composedPath()){const t=s,n=this.elementCanScroll(t);if(t.clientHeight&&t.clientHeight<t.scrollHeight&&n){e=t;break}n&&(i=t)}let s=e||i;s!==this.firstScrollableParent&&(this.firstScrollableParent=s,this.initIntersectionObserver(),this.resetScroll())}elementCanScroll(t){try{return["auto","scroll"].includes(getComputedStyle(t).overflowY)}catch(t){return!1}}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")&&(null!=this.scrollToItem||null!=this.scrollToIndex))&&this.resetScroll()}updated(t){super.updated(t),(t.has("visibleItems")||t.has("items"))&&this.dispatchEvent(new zt(this.visibleItems,this.visibleItems.map((t=>this.items[t])))),t.has("scrolledToTarget")&&this.scrolledToTarget&&(null!=this.scrollToItem||null!=this.scrollToIndex)&&this.dispatchEvent(new Dt)}}Ht.styles=Kt,Pt([s({type:Array})],Ht.prototype,"items",void 0),Pt([s({attribute:!1})],Ht.prototype,"renderItem",void 0),Pt([s({type:Object})],Ht.prototype,"scrollToItem",void 0),Pt([s({type:Number})],Ht.prototype,"scrollToIndex",void 0),Pt([s({type:Boolean})],Ht.prototype,"internalScroll",void 0),Pt([s({type:Number})],Ht.prototype,"renderBeforeFirst",void 0),Pt([s({type:Number})],Ht.prototype,"renderAfterLast",void 0),Pt([n({hasChanged:(t,e)=>null!=t&&null==e||t.length!==e.length||t[0]!==e[0]})],Ht.prototype,"visibleItems",void 0),Pt([r(".scrollable")],Ht.prototype,"internalScrollable",void 0),Pt([r(".items-container")],Ht.prototype,"itemsContainer",void 0),Pt([n()],Ht.prototype,"scrolledToTarget",void 0),a("ft-infinite-scroll")(Ht);const Zt=v`
183
183
  `,Jt=v`
184
184
  `;var Vt=function(t,e,i,s){for(var n,r=arguments.length,o=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s,l=t.length-1;l>=0;l--)(n=t[l])&&(o=(r<3?n(o):r>3?n(e,i,o):n(e,i))||o);return r>3&&o&&Object.defineProperty(e,i,o),o};class qt extends $t{constructor(){super(...arguments),this.disableContextInteractions=!1,this.registeredComponents=[]}render(){return Z`
185
185
  <article id=${this.tocId}>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluid-topics/ft-reader-content",
3
- "version": "0.3.68",
3
+ "version": "0.3.70",
4
4
  "description": "Main content for integrated reader",
5
5
  "keywords": [
6
6
  "Lit"
@@ -19,12 +19,12 @@
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.68",
23
- "@fluid-topics/ft-reader-topic-content": "0.3.68",
24
- "@fluid-topics/ft-reader-topic-context": "0.3.68",
25
- "@fluid-topics/ft-reader-topic-title": "0.3.68",
26
- "@fluid-topics/ft-wc-utils": "0.3.68",
22
+ "@fluid-topics/ft-infinite-scroll": "0.3.70",
23
+ "@fluid-topics/ft-reader-topic-content": "0.3.70",
24
+ "@fluid-topics/ft-reader-topic-context": "0.3.70",
25
+ "@fluid-topics/ft-reader-topic-title": "0.3.70",
26
+ "@fluid-topics/ft-wc-utils": "0.3.70",
27
27
  "lit": "2.2.8"
28
28
  },
29
- "gitHead": "58305116f36902ddf19fada77dfcba24243c5ac5"
29
+ "gitHead": "f196cbccc700d904e13deb5c40e2f4f5121d9bb9"
30
30
  }