@fluid-topics/ft-reader-content 1.1.12 → 1.1.14
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.
|
@@ -49,7 +49,7 @@ const x={attribute:!0,type:String,converter:v,reflect:!1,hasChanged:S},R=(t=x,o,
|
|
|
49
49
|
* Copyright 2017 Google LLC
|
|
50
50
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
51
51
|
*/
|
|
52
|
-
const Z=globalThis,$=Z.trustedTypes,A=$?$.createPolicy("lit-html",{createHTML:t=>t}):void 0,M="$lit$",F=`lit$${(Math.random()+"").slice(9)}$`,B="?"+F,z=`<${B}>`,
|
|
52
|
+
const Z=globalThis,$=Z.trustedTypes,A=$?$.createPolicy("lit-html",{createHTML:t=>t}):void 0,M="$lit$",F=`lit$${(Math.random()+"").slice(9)}$`,B="?"+F,z=`<${B}>`,T=document,P=()=>T.createComment(""),D=t=>null===t||"object"!=typeof t&&"function"!=typeof t,_=Array.isArray,j=t=>_(t)||"function"==typeof t?.[Symbol.iterator],G="[ \t\n\f\r]",H=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Y=/-->/g,J=/>/g,V=RegExp(`>|${G}(?:([^\\s"'>=/]+)(${G}*=${G}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),q=/'/g,X=/"/g,Q=/^(?:script|style|textarea|title)$/i,tt=Symbol.for("lit-noChange"),ot=Symbol.for("lit-nothing"),et=new WeakMap,rt=T.createTreeWalker(T,129);function it(t,o){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==A?A.createHTML(o):o}const nt=(t,o)=>{const e=t.length-1,r=[];let i,n=2===o?"<svg>":"",s=H;for(let o=0;o<e;o++){const e=t[o];let a,c,l=-1,h=0;for(;h<e.length&&(s.lastIndex=h,c=s.exec(e),null!==c);)h=s.lastIndex,s===H?"!--"===c[1]?s=Y:void 0!==c[1]?s=J:void 0!==c[2]?(Q.test(c[2])&&(i=RegExp("</"+c[2],"g")),s=V):void 0!==c[3]&&(s=V):s===V?">"===c[0]?(s=i??H,l=-1):void 0===c[1]?l=-2:(l=s.lastIndex-c[2].length,a=c[1],s=void 0===c[3]?V:'"'===c[3]?X:q):s===X||s===q?s=V:s===Y||s===J?s=H:(s=V,i=void 0);const f=s===V&&t[o+1].startsWith("/>")?" ":"";n+=s===H?e+z:l>=0?(r.push(a),e.slice(0,l)+M+e.slice(l)+F+f):e+F+(-2===l?o:f)}return[it(t,n+(t[e]||"<?>")+(2===o?"</svg>":"")),r]};let st=class t{constructor({strings:o,_$litType$:e},r){let i;this.parts=[];let n=0,s=0;const a=o.length-1,c=this.parts,[l,h]=nt(o,e);if(this.el=t.createElement(l,r),rt.currentNode=this.el.content,2===e){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(i=rt.nextNode())&&c.length<a;){if(1===i.nodeType){if(i.hasAttributes())for(const t of i.getAttributeNames())if(t.endsWith(M)){const o=h[s++],e=i.getAttribute(t).split(F),r=/([.?@])?(.*)/.exec(o);c.push({type:1,index:n,name:r[2],strings:e,ctor:"."===r[1]?ft:"?"===r[1]?pt:"@"===r[1]?dt:ht}),i.removeAttribute(t)}else t.startsWith(F)&&(c.push({type:6,index:n}),i.removeAttribute(t));if(Q.test(i.tagName)){const t=i.textContent.split(F),o=t.length-1;if(o>0){i.textContent=$?$.emptyScript:"";for(let e=0;e<o;e++)i.append(t[e],P()),rt.nextNode(),c.push({type:2,index:++n});i.append(t[o],P())}}}else if(8===i.nodeType)if(i.data===B)c.push({type:2,index:n});else{let t=-1;for(;-1!==(t=i.data.indexOf(F,t+1));)c.push({type:7,index:n}),t+=F.length-1}n++}}static createElement(t,o){const e=T.createElement("template");return e.innerHTML=t,e}};function at(t,o,e=t,r){if(o===tt)return o;let i=void 0!==r?e._$Co?.[r]:e._$Cl;const n=D(o)?void 0:o._$litDirective$;return i?.constructor!==n&&(i?._$AO?.(!1),void 0===n?i=void 0:(i=new n(t),i._$AT(t,e,r)),void 0!==r?(e._$Co??=[])[r]=i:e._$Cl=i),void 0!==i&&(o=at(t,i._$AS(t,o.values),i,r)),o}let ct=class{constructor(t,o){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=o}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:o},parts:e}=this._$AD,r=(t?.creationScope??T).importNode(o,!0);rt.currentNode=r;let i=rt.nextNode(),n=0,s=0,a=e[0];for(;void 0!==a;){if(n===a.index){let o;2===a.type?o=new lt(i,i.nextSibling,this,t):1===a.type?o=new a.ctor(i,a.name,a.strings,this,t):6===a.type&&(o=new ut(i,this,t)),this._$AV.push(o),a=e[++s]}n!==a?.index&&(i=rt.nextNode(),n++)}return rt.currentNode=T,r}p(t){let o=0;for(const e of this._$AV)void 0!==e&&(void 0!==e.strings?(e._$AI(t,e,o),o+=e.strings.length-2):e._$AI(t[o])),o++}},lt=class t{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,o,e,r){this.type=2,this._$AH=ot,this._$AN=void 0,this._$AA=t,this._$AB=o,this._$AM=e,this.options=r,this._$Cv=r?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode;const o=this._$AM;return void 0!==o&&11===t?.nodeType&&(t=o.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,o=this){t=at(this,t,o),D(t)?t===ot||null==t||""===t?(this._$AH!==ot&&this._$AR(),this._$AH=ot):t!==this._$AH&&t!==tt&&this._(t):void 0!==t._$litType$?this.g(t):void 0!==t.nodeType?this.$(t):j(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!==ot&&D(this._$AH)?this._$AA.nextSibling.data=t:this.$(T.createTextNode(t)),this._$AH=t}g(t){const{values:o,_$litType$:e}=t,r="number"==typeof e?this._$AC(t):(void 0===e.el&&(e.el=st.createElement(it(e.h,e.h[0]),this.options)),e);if(this._$AH?._$AD===r)this._$AH.p(o);else{const t=new ct(r,this),e=t.u(this.options);t.p(o),this.$(e),this._$AH=t}}_$AC(t){let o=et.get(t.strings);return void 0===o&&et.set(t.strings,o=new st(t)),o}T(o){_(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let r,i=0;for(const n of o)i===e.length?e.push(r=new t(this.k(P()),this.k(P()),this,this.options)):r=e[i],r._$AI(n),i++;i<e.length&&(this._$AR(r&&r._$AB.nextSibling,i),e.length=i)}_$AR(t=this._$AA.nextSibling,o){for(this._$AP?.(!1,!0,o);t&&t!==this._$AB;){const o=t.nextSibling;t.remove(),t=o}}setConnected(t){void 0===this._$AM&&(this._$Cv=t,this._$AP?.(t))}},ht=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,o,e,r,i){this.type=1,this._$AH=ot,this._$AN=void 0,this.element=t,this.name=o,this._$AM=r,this.options=i,e.length>2||""!==e[0]||""!==e[1]?(this._$AH=Array(e.length-1).fill(new String),this.strings=e):this._$AH=ot}_$AI(t,o=this,e,r){const i=this.strings;let n=!1;if(void 0===i)t=at(this,t,o,0),n=!D(t)||t!==this._$AH&&t!==tt,n&&(this._$AH=t);else{const r=t;let s,a;for(t=i[0],s=0;s<i.length-1;s++)a=at(this,r[e+s],o,s),a===tt&&(a=this._$AH[s]),n||=!D(a)||a!==this._$AH[s],a===ot?t=ot:t!==ot&&(t+=(a??"")+i[s+1]),this._$AH[s]=a}n&&!r&&this.O(t)}O(t){t===ot?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}},ft=class extends ht{constructor(){super(...arguments),this.type=3}O(t){this.element[this.name]=t===ot?void 0:t}},pt=class extends ht{constructor(){super(...arguments),this.type=4}O(t){this.element.toggleAttribute(this.name,!!t&&t!==ot)}},dt=class extends ht{constructor(t,o,e,r,i){super(t,o,e,r,i),this.type=5}_$AI(t,o=this){if((t=at(this,t,o,0)??ot)===tt)return;const e=this._$AH,r=t===ot&&e!==ot||t.capture!==e.capture||t.once!==e.once||t.passive!==e.passive,i=t!==ot&&(e===ot||r);r&&this.element.removeEventListener(this.name,this,e),i&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}},ut=class{constructor(t,o,e){this.element=t,this.type=6,this._$AN=void 0,this._$AM=o,this.options=e}get _$AU(){return this._$AM._$AU}_$AI(t){at(this,t)}};const yt={j:M,P:F,A:B,C:1,M:nt,L:ct,R:j,V:at,D:lt,I:ht,H:pt,N:dt,U:ft,B:ut},gt=Z.litHtmlPolyfillSupport;gt?.(st,lt),(Z.litHtmlVersions??=[]).push("3.1.0");
|
|
53
53
|
/**
|
|
54
54
|
* @license
|
|
55
55
|
* Copyright 2019 Google LLC
|
|
@@ -66,7 +66,7 @@ const bt=globalThis,mt=bt.ShadowRoot&&(void 0===bt.ShadyCSS||bt.ShadyCSS.nativeS
|
|
|
66
66
|
* Copyright 2017 Google LLC
|
|
67
67
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
68
68
|
*/
|
|
69
|
-
const zt=globalThis,
|
|
69
|
+
const zt=globalThis,Tt=zt.trustedTypes,Pt=Tt?Tt.createPolicy("lit-html",{createHTML:t=>t}):void 0,Dt="$lit$",_t=`lit$${(Math.random()+"").slice(9)}$`,jt="?"+_t,Gt=`<${jt}>`,Ht=document,Yt=()=>Ht.createComment(""),Jt=t=>null===t||"object"!=typeof t&&"function"!=typeof t,Vt=Array.isArray,qt="[ \t\n\f\r]",Xt=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Qt=/-->/g,to=/>/g,oo=RegExp(`>|${qt}(?:([^\\s"'>=/]+)(${qt}*=${qt}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),eo=/'/g,ro=/"/g,io=/^(?:script|style|textarea|title)$/i,no=(t=>(o,...e)=>({_$litType$:t,strings:o,values:e}))(1),so=Symbol.for("lit-noChange"),ao=Symbol.for("lit-nothing"),co=new WeakMap,lo=Ht.createTreeWalker(Ht,129);function ho(t,o){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==Pt?Pt.createHTML(o):o}const fo=(t,o)=>{const e=t.length-1,r=[];let i,n=2===o?"<svg>":"",s=Xt;for(let o=0;o<e;o++){const e=t[o];let a,c,l=-1,h=0;for(;h<e.length&&(s.lastIndex=h,c=s.exec(e),null!==c);)h=s.lastIndex,s===Xt?"!--"===c[1]?s=Qt:void 0!==c[1]?s=to:void 0!==c[2]?(io.test(c[2])&&(i=RegExp("</"+c[2],"g")),s=oo):void 0!==c[3]&&(s=oo):s===oo?">"===c[0]?(s=i??Xt,l=-1):void 0===c[1]?l=-2:(l=s.lastIndex-c[2].length,a=c[1],s=void 0===c[3]?oo:'"'===c[3]?ro:eo):s===ro||s===eo?s=oo:s===Qt||s===to?s=Xt:(s=oo,i=void 0);const f=s===oo&&t[o+1].startsWith("/>")?" ":"";n+=s===Xt?e+Gt:l>=0?(r.push(a),e.slice(0,l)+Dt+e.slice(l)+_t+f):e+_t+(-2===l?o:f)}return[ho(t,n+(t[e]||"<?>")+(2===o?"</svg>":"")),r]};class po{constructor({strings:t,_$litType$:o},e){let r;this.parts=[];let i=0,n=0;const s=t.length-1,a=this.parts,[c,l]=fo(t,o);if(this.el=po.createElement(c,e),lo.currentNode=this.el.content,2===o){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(r=lo.nextNode())&&a.length<s;){if(1===r.nodeType){if(r.hasAttributes())for(const t of r.getAttributeNames())if(t.endsWith(Dt)){const o=l[n++],e=r.getAttribute(t).split(_t),s=/([.?@])?(.*)/.exec(o);a.push({type:1,index:i,name:s[2],strings:e,ctor:"."===s[1]?bo:"?"===s[1]?mo:"@"===s[1]?Oo:go}),r.removeAttribute(t)}else t.startsWith(_t)&&(a.push({type:6,index:i}),r.removeAttribute(t));if(io.test(r.tagName)){const t=r.textContent.split(_t),o=t.length-1;if(o>0){r.textContent=Tt?Tt.emptyScript:"";for(let e=0;e<o;e++)r.append(t[e],Yt()),lo.nextNode(),a.push({type:2,index:++i});r.append(t[o],Yt())}}}else if(8===r.nodeType)if(r.data===jt)a.push({type:2,index:i});else{let t=-1;for(;-1!==(t=r.data.indexOf(_t,t+1));)a.push({type:7,index:i}),t+=_t.length-1}i++}}static createElement(t,o){const e=Ht.createElement("template");return e.innerHTML=t,e}}function uo(t,o,e=t,r){if(o===so)return o;let i=void 0!==r?e._$Co?.[r]:e._$Cl;const n=Jt(o)?void 0:o._$litDirective$;return i?.constructor!==n&&(i?._$AO?.(!1),void 0===n?i=void 0:(i=new n(t),i._$AT(t,e,r)),void 0!==r?(e._$Co??=[])[r]=i:e._$Cl=i),void 0!==i&&(o=uo(t,i._$AS(t,o.values),i,r)),o}class yo{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,o,e,r){this.type=2,this._$AH=ao,this._$AN=void 0,this._$AA=t,this._$AB=o,this._$AM=e,this.options=r,this._$Cv=r?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode;const o=this._$AM;return void 0!==o&&11===t?.nodeType&&(t=o.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,o=this){t=uo(this,t,o),Jt(t)?t===ao||null==t||""===t?(this._$AH!==ao&&this._$AR(),this._$AH=ao):t!==this._$AH&&t!==so&&this._(t):void 0!==t._$litType$?this.g(t):void 0!==t.nodeType?this.$(t):(t=>Vt(t)||"function"==typeof t?.[Symbol.iterator])(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!==ao&&Jt(this._$AH)?this._$AA.nextSibling.data=t:this.$(Ht.createTextNode(t)),this._$AH=t}g(t){const{values:o,_$litType$:e}=t,r="number"==typeof e?this._$AC(t):(void 0===e.el&&(e.el=po.createElement(ho(e.h,e.h[0]),this.options)),e);if(this._$AH?._$AD===r)this._$AH.p(o);else{const t=new class{constructor(t,o){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=o}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:o},parts:e}=this._$AD,r=(t?.creationScope??Ht).importNode(o,!0);lo.currentNode=r;let i=lo.nextNode(),n=0,s=0,a=e[0];for(;void 0!==a;){if(n===a.index){let o;2===a.type?o=new yo(i,i.nextSibling,this,t):1===a.type?o=new a.ctor(i,a.name,a.strings,this,t):6===a.type&&(o=new No(i,this,t)),this._$AV.push(o),a=e[++s]}n!==a?.index&&(i=lo.nextNode(),n++)}return lo.currentNode=Ht,r}p(t){let o=0;for(const e of this._$AV)void 0!==e&&(void 0!==e.strings?(e._$AI(t,e,o),o+=e.strings.length-2):e._$AI(t[o])),o++}}(r,this),e=t.u(this.options);t.p(o),this.$(e),this._$AH=t}}_$AC(t){let o=co.get(t.strings);return void 0===o&&co.set(t.strings,o=new po(t)),o}T(t){Vt(this._$AH)||(this._$AH=[],this._$AR());const o=this._$AH;let e,r=0;for(const i of t)r===o.length?o.push(e=new yo(this.k(Yt()),this.k(Yt()),this,this.options)):e=o[r],e._$AI(i),r++;r<o.length&&(this._$AR(e&&e._$AB.nextSibling,r),o.length=r)}_$AR(t=this._$AA.nextSibling,o){for(this._$AP?.(!1,!0,o);t&&t!==this._$AB;){const o=t.nextSibling;t.remove(),t=o}}setConnected(t){void 0===this._$AM&&(this._$Cv=t,this._$AP?.(t))}}class go{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,o,e,r,i){this.type=1,this._$AH=ao,this._$AN=void 0,this.element=t,this.name=o,this._$AM=r,this.options=i,e.length>2||""!==e[0]||""!==e[1]?(this._$AH=Array(e.length-1).fill(new String),this.strings=e):this._$AH=ao}_$AI(t,o=this,e,r){const i=this.strings;let n=!1;if(void 0===i)t=uo(this,t,o,0),n=!Jt(t)||t!==this._$AH&&t!==so,n&&(this._$AH=t);else{const r=t;let s,a;for(t=i[0],s=0;s<i.length-1;s++)a=uo(this,r[e+s],o,s),a===so&&(a=this._$AH[s]),n||=!Jt(a)||a!==this._$AH[s],a===ao?t=ao:t!==ao&&(t+=(a??"")+i[s+1]),this._$AH[s]=a}n&&!r&&this.O(t)}O(t){t===ao?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class bo extends go{constructor(){super(...arguments),this.type=3}O(t){this.element[this.name]=t===ao?void 0:t}}class mo extends go{constructor(){super(...arguments),this.type=4}O(t){this.element.toggleAttribute(this.name,!!t&&t!==ao)}}class Oo extends go{constructor(t,o,e,r,i){super(t,o,e,r,i),this.type=5}_$AI(t,o=this){if((t=uo(this,t,o,0)??ao)===so)return;const e=this._$AH,r=t===ao&&e!==ao||t.capture!==e.capture||t.once!==e.once||t.passive!==e.passive,i=t!==ao&&(e===ao||r);r&&this.element.removeEventListener(this.name,this,e),i&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}}class No{constructor(t,o,e){this.element=t,this.type=6,this._$AN=void 0,this._$AM=o,this.options=e}get _$AU(){return this._$AM._$AU}_$AI(t){uo(this,t)}}const vo=zt.litHtmlPolyfillSupport;vo?.(po,yo),(zt.litHtmlVersions??=[]).push("3.1.0");
|
|
70
70
|
/**
|
|
71
71
|
* @license
|
|
72
72
|
* Copyright 2017 Google LLC
|
|
@@ -114,7 +114,7 @@ const Uo=window,Io=Uo.ShadowRoot&&(void 0===Uo.ShadyCSS||Uo.ShadyCSS.nativeShado
|
|
|
114
114
|
display: inline-block;
|
|
115
115
|
width: 0;
|
|
116
116
|
}
|
|
117
|
-
`;const Fo=t=>{const o=null!=t?t:{};return(t,e)=>{var r;const i={hasChanged:(t,o)=>!k(t,o),attribute:!1,...o};E(i)(t,e);const n=t.constructor;n.reduxProperties=new Map(n.reduxProperties),n.reduxProperties.set(e,{selector:null!==(r=o.selector)&&void 0!==r?r:t=>t[e],store:o.store})}};function Bo(t){var o;return null!==(o=null==t?void 0:t.isFtReduxStore)&&void 0!==o&&o}var zo,Po
|
|
117
|
+
`;const Fo=t=>{const o=null!=t?t:{};return(t,e)=>{var r;const i={hasChanged:(t,o)=>!k(t,o),attribute:!1,...o};E(i)(t,e);const n=t.constructor;n.reduxProperties=new Map(n.reduxProperties),n.reduxProperties.set(e,{selector:null!==(r=o.selector)&&void 0!==r?r:t=>t[e],store:o.store})}};function Bo(t){var o;return null!==(o=null==t?void 0:t.isFtReduxStore)&&void 0!==o&&o}var zo,To,Po;const Do=Symbol("internalReduxEventsUnsubscribers"),_o=Symbol("internalStoresUnsubscribers"),jo=Symbol("internalStores");class Go extends Ao{constructor(){super(...arguments),this[zo]=new Map,this[To]=new Map,this[Po]=[]}get reduxConstructor(){return this.constructor}update(t){super.update(t),[...this.reduxConstructor.reduxReactiveProperties].some((o=>t.has(o)))&&this.updateFromStores()}getUnnamedStore(){if(this[jo].size>1)throw new Error("Cannot resolve unnamed store when multiple stores are configured.");return[...this[jo].values()][0]}getStore(t){return null==t?this.getUnnamedStore():this[jo].get(t)}addStore(t,o){var e;o=null!==(e=null!=o?o:Bo(t)?t.name:void 0)&&void 0!==e?e:"default-store",this.unsubscribeFromStore(o),this.setupStore(o,t)}removeStore(t){const o="string"==typeof t?t:t.name;this.unsubscribeFromStore(o),this[jo].delete(o)}setupStore(t,o){this[jo].set(t,o),this.subscribeToStore(t,o),this.updateFromStores()}setupStores(){this.unsubscribeFromStores(),this[jo].forEach(((t,o)=>this.subscribeToStore(o,t))),this.updateFromStores()}updateFromStores(){this.reduxConstructor.reduxProperties.forEach(((t,o)=>{const e=this.constructor.getPropertyOptions(o);if(!(null==e?void 0:e.attribute)||!this.hasAttribute("string"==typeof(null==e?void 0:e.attribute)?e.attribute:o)){const e=this.getStore(t.store);e&&(t.store?this[_o].has(t.store):this[_o].size>0)&&(this[o]=t.selector(e.getState(),this))}}))}subscribeToStore(t,o){var e;this[_o].set(t,o.subscribe((()=>this.updateFromStores()))),Bo(o)&&o.eventBus&&(null===(e=this.reduxConstructor.reduxEventListeners)||void 0===e||e.forEach(((t,e)=>{if("function"==typeof this[e]&&(!t.store||o.name===t.store)){const r=t=>this[e](t);o.eventBus.addEventListener(t.eventName,r),this[Do].push((()=>o.eventBus.removeEventListener(t.eventName,r)))}}))),this.onStoreAvailable(t)}unsubscribeFromStores(){this[_o].forEach(((t,o)=>this.unsubscribeFromStore(o))),this[Do].forEach((t=>t())),this[Do]=[]}unsubscribeFromStore(t){this[_o].has(t)&&this[_o].get(t)(),this[_o].delete(t)}onStoreAvailable(t){}connectedCallback(){super.connectedCallback(),this.setupStores()}disconnectedCallback(){super.disconnectedCallback(),this.unsubscribeFromStores()}}var Ho,Yo,Jo;zo=_o,To=jo,Po=Do,Go.reduxProperties=new Map,Go.reduxReactiveProperties=new Set,Go.reduxEventListeners=new Map,window.ftReduxStores||(window.ftReduxStores={}),navigator.vendor&&navigator.vendor.match(/apple/i)||(null===(Yo=null===(Ho=window.safari)||void 0===Ho?void 0:Ho.pushNotification)||void 0===Yo||Yo.toString()),function(t){t.FEEDBACK="FEEDBACK",t.RATING="RATING",t.PRINT="PRINT",t.BOOKMARK="BOOKMARK",t.COLLECTIONS="COLLECTIONS",t.PERSONAL_BOOKS="PERSONAL_BOOKS"}(Jo||(Jo={}));var Vo=function(t,o,e,r){for(var i,n=arguments.length,s=n<3?o:null===r?r=Object.getOwnPropertyDescriptor(o,e):r,a=t.length-1;a>=0;a--)(i=t[a])&&(s=(n<3?i(s):n>3?i(o,e,s):i(o,e))||s);return n>3&&s&&Object.defineProperty(o,e,s),s};class qo extends Event{constructor(){super("register-ft-reader-component",{bubbles:!0,composed:!0})}}const Xo=Symbol("registerInterval");class Qo extends(function(t){var o;class e extends t{constructor(){super(...arguments),this[o]=0}setReaderStateManager(t){this.clearStateManager(),this.stateManager=t,this.addStore(t.store,"reader")}clearStateManager(){this.stateManager&&(this.removeStore("reader"),this.stateManager=void 0)}get service(){var t;return null===(t=this.stateManager)||void 0===t?void 0:t.service}connectedCallback(){super.connectedCallback(),this[Xo]=window.setInterval((()=>this.tryToRegisterToContext()),50)}tryToRegisterToContext(){null!=this.stateManager?window.clearInterval(this[Xo]):this.dispatchEvent(new qo)}disconnectedCallback(){super.disconnectedCallback(),this.clearStateManager()}}return o=Xo,Vo([U()],e.prototype,"stateManager",void 0),e}(Go)){}
|
|
118
118
|
/**
|
|
119
119
|
* @license
|
|
120
120
|
* Copyright 2017 Google LLC
|
|
@@ -177,7 +177,7 @@ class fe extends ee{constructor(t){if(super(t),this.et=ot,t.type!==te)throw Erro
|
|
|
177
177
|
data-item-index="${o}">
|
|
178
178
|
${n?(()=>{const e=this.renderItem(t,o);return"string"==typeof e?pe(e):e})():ao}
|
|
179
179
|
</div>
|
|
180
|
-
`}resetScroll(){this.triggerFindScrollableParent(),this.intersectionObserver.disconnect(),this.resizeObserver.disconnect(),this.visibleItems=[],this.scrolledToTarget=!1,this.scrollDebouncer.run((()=>{var t;let o=null!==(t=this.scrollToIndex)&&void 0!==t?t:this.scrollToItem?this.items.indexOf(this.scrollToItem):-1;o>=this.items.length&&(o=-1);const e=this.getItem(o);this.scrollToTarget(e),this.scrollDoneDebouncer.run((()=>{this.scrollRestorationItem=o>=0?o:void 0,this.scrollRestorationOffset=0===o?-this.getOffset(e):0,this.onMutation(),this.scrolledToTarget=!0}))}))}getItem(t){var o;return null===(o=this.shadowRoot)||void 0===o?void 0:o.querySelector(`#item-${t}`)}scrollToTarget(t){var o;if(t){let e=+(null!==(o=t.getAttribute("data-item-index"))&&void 0!==o?o:"0");this.scrollable&&0===e?this.scrollable.scrollTop=0:this.scrollable.scrollTop=this.getOffset(t)}}getOffset(t){var o;let e=0,r=t;for(;r&&r.offsetParent!==this.scrollable.offsetParent;)e+=r.offsetTop,r=r.offsetParent;return e+(null!==(o=null==r?void 0:r.offsetTop)&&void 0!==o?o:0)-this.scrollable.offsetTop}getLastKnownHeight(t){var o;return+(null!==(o=null==t?void 0:t.getAttribute("data-last-known-height"))&&void 0!==o?o:1e3)}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){var o;let e,r;t.stopPropagation();for(let o of t.composedPath()){const t=o,i=this.elementCanScroll(t);if(t.clientHeight&&t.clientHeight<t.scrollHeight&&i){e=t;break}i&&(r=t)}let i=e||r;i!==this.firstScrollableParent&&(null===(o=this.firstScrollableParent)||void 0===o||o.removeEventListener("scroll",this.scrollListener),null==i||i.addEventListener("scroll",this.scrollListener),this.firstScrollableParent=i,this.initIntersectionObserver(),this.resetScroll())}elementCanScroll(t){try{return["auto","scroll"].includes(getComputedStyle(t).overflowY)}catch(t){return!1}}searchFirstVisibleItem(t,o,e){if(o=null!=o?o:0,(e=null!=e?e:t.length-1)<=o)return t[o];const r=Math.floor((e-o)/2)+o,i=t[r];return this.getOffset(i)>this.scrollable.scrollTop?this.searchFirstVisibleItem(t,o,r-1):this.getOffset(i)+this.getLastKnownHeight(i)<this.scrollable.scrollTop?this.searchFirstVisibleItem(t,r+1,e):i}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.onVisibleItemsChange(),t.has("scrolledToTarget")&&this.scrolledToTarget&&(null!=this.scrollToItem||null!=this.scrollToIndex)&&this.dispatchEvent(new Oe)}onVisibleItemsChange(){const t=this.visibleItems.every(((t,o)=>null==this.visibleItems[o+1]||t+1===this.visibleItems[o+1]));t||k(this.visibleItems,this.lastNotOkVisibleItems)?(this.resetVisibleItemsDebouncer.cancel(),this.dispatchVisibleItemsEvent()):this.resetVisibleItemsDebouncer.run((()=>{this.lastNotOkVisibleItems=[...this.visibleItems],this.visibleItems=[],this.initIntersectionObserver(),this.onMutation()}))}dispatchVisibleItemsEvent(){var t,o;null===(t=this.cancelableDispatchEvent)||void 0===t||t.cancel(),this.cancelableDispatchEvent=(o=async function(t,o=5){let
|
|
180
|
+
`}resetScroll(){this.triggerFindScrollableParent(),this.intersectionObserver.disconnect(),this.resizeObserver.disconnect(),this.visibleItems=[],this.scrolledToTarget=!1,this.scrollDebouncer.run((()=>{var t;let o=null!==(t=this.scrollToIndex)&&void 0!==t?t:this.scrollToItem?this.items.indexOf(this.scrollToItem):-1;o>=this.items.length&&(o=-1);const e=this.getItem(o);this.scrollToTarget(e),this.scrollDoneDebouncer.run((()=>{this.scrollRestorationItem=o>=0?o:void 0,this.scrollRestorationOffset=0===o?-this.getOffset(e):0,this.onMutation(),this.scrolledToTarget=!0}))}))}getItem(t){var o;return null===(o=this.shadowRoot)||void 0===o?void 0:o.querySelector(`#item-${t}`)}scrollToTarget(t){var o;if(t){let e=+(null!==(o=t.getAttribute("data-item-index"))&&void 0!==o?o:"0");this.scrollable&&0===e?this.scrollable.scrollTop=0:this.scrollable.scrollTop=this.getOffset(t)}}getOffset(t){var o;let e=0,r=t;for(;r&&r.offsetParent!==this.scrollable.offsetParent;)e+=r.offsetTop,r=r.offsetParent;return e+(null!==(o=null==r?void 0:r.offsetTop)&&void 0!==o?o:0)-this.scrollable.offsetTop}getLastKnownHeight(t){var o;return+(null!==(o=null==t?void 0:t.getAttribute("data-last-known-height"))&&void 0!==o?o:1e3)}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){var o;let e,r;t.stopPropagation();for(let o of t.composedPath()){const t=o,i=this.elementCanScroll(t);if(t.clientHeight&&t.clientHeight<t.scrollHeight&&i){e=t;break}i&&(r=t)}let i=e||r;i!==this.firstScrollableParent&&(null===(o=this.firstScrollableParent)||void 0===o||o.removeEventListener("scroll",this.scrollListener),null==i||i.addEventListener("scroll",this.scrollListener),this.firstScrollableParent=i,this.initIntersectionObserver(),this.resetScroll())}elementCanScroll(t){try{return["auto","scroll"].includes(getComputedStyle(t).overflowY)}catch(t){return!1}}searchFirstVisibleItem(t,o,e){if(o=null!=o?o:0,(e=null!=e?e:t.length-1)<=o)return t[o];const r=Math.floor((e-o)/2)+o,i=t[r];return this.getOffset(i)>this.scrollable.scrollTop?this.searchFirstVisibleItem(t,o,r-1):this.getOffset(i)+this.getLastKnownHeight(i)<this.scrollable.scrollTop?this.searchFirstVisibleItem(t,r+1,e):i}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.onVisibleItemsChange(),t.has("scrolledToTarget")&&this.scrolledToTarget&&(null!=this.scrollToItem||null!=this.scrollToIndex)&&this.dispatchEvent(new Oe)}onVisibleItemsChange(){const t=this.visibleItems.every(((t,o)=>null==this.visibleItems[o+1]||t+1===this.visibleItems[o+1]));t||k(this.visibleItems,this.lastNotOkVisibleItems)?(this.resetVisibleItemsDebouncer.cancel(),this.dispatchVisibleItemsEvent()):this.resetVisibleItemsDebouncer.run((()=>{this.lastNotOkVisibleItems=[...this.visibleItems],this.visibleItems=[],this.initIntersectionObserver(),this.onMutation()}))}dispatchVisibleItemsEvent(){var t,o;null===(t=this.cancelableDispatchEvent)||void 0===t||t.cancel(),this.cancelableDispatchEvent=(o=async function(t,o=5,e){let r,i,n=await t();for(r=i=performance.now();!n&&(!e||i-r<e);)await W(o),n=await t(),i=performance.now();if(null==n)throw new Error("Timeout exceeded")}((()=>!this.scrolling)),new e(((t,e)=>o.then(t).catch(e)))),this.cancelableDispatchEvent.then((()=>this.dispatchEvent(new me(this.visibleItems,this.visibleItems.map((t=>this.items[t])))))).catch((()=>null))}}Ne.styles=ge,be([E({type:Array})],Ne.prototype,"items",void 0),be([E({attribute:!1})],Ne.prototype,"renderItem",void 0),be([E({attribute:!1})],Ne.prototype,"getItemKey",void 0),be([E({type:Object})],Ne.prototype,"scrollToItem",void 0),be([E({type:Number})],Ne.prototype,"scrollToIndex",void 0),be([E({type:Boolean})],Ne.prototype,"internalScroll",void 0),be([E({type:Number})],Ne.prototype,"renderBeforeFirst",void 0),be([E({type:Number})],Ne.prototype,"renderAfterLast",void 0),be([U({hasChanged:(t,o)=>null!=t&&null==o||t.length!==o.length||t[0]!==o[0]})],Ne.prototype,"visibleItems",void 0),be([L(".scrollable")],Ne.prototype,"internalScrollable",void 0),be([L(".items-container")],Ne.prototype,"itemsContainer",void 0),be([U()],Ne.prototype,"scrolledToTarget",void 0),be([U()],Ne.prototype,"scrolling",void 0),K("ft-infinite-scroll")(Ne);const ve=wt`
|
|
181
181
|
`,Se=wt`
|
|
182
182
|
`;var we=function(t,o,e,r){for(var i,n=arguments.length,s=n<3?o:null===r?r=Object.getOwnPropertyDescriptor(o,e):r,a=t.length-1;a>=0;a--)(i=t[a])&&(s=(n<3?i(s):n>3?i(o,e,s):i(o,e))||s);return n>3&&s&&Object.defineProperty(o,e,s),s};class Ce extends Qo{constructor(){super(...arguments),this.disableContextInteractions=!1,this.registeredComponents=[]}render(){return no`
|
|
183
183
|
<article id=${this.tocId}>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluid-topics/ft-reader-content",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.14",
|
|
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": "1.1.
|
|
23
|
-
"@fluid-topics/ft-reader-topic-content": "1.1.
|
|
24
|
-
"@fluid-topics/ft-reader-topic-context": "1.1.
|
|
25
|
-
"@fluid-topics/ft-reader-topic-title": "1.1.
|
|
26
|
-
"@fluid-topics/ft-wc-utils": "1.1.
|
|
22
|
+
"@fluid-topics/ft-infinite-scroll": "1.1.14",
|
|
23
|
+
"@fluid-topics/ft-reader-topic-content": "1.1.14",
|
|
24
|
+
"@fluid-topics/ft-reader-topic-context": "1.1.14",
|
|
25
|
+
"@fluid-topics/ft-reader-topic-title": "1.1.14",
|
|
26
|
+
"@fluid-topics/ft-wc-utils": "1.1.14",
|
|
27
27
|
"lit": "3.1.0"
|
|
28
28
|
},
|
|
29
|
-
"gitHead": "
|
|
29
|
+
"gitHead": "f58494852acf5409f0881678c76cd0af9a203482"
|
|
30
30
|
}
|