@fluid-topics/ft-reader-topic-context 1.1.6 → 1.1.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.
|
@@ -39,7 +39,7 @@ const v={attribute:!0,type:String,converter:m,reflect:!1,hasChanged:O},C=(t=v,o,
|
|
|
39
39
|
* Copyright 2017 Google LLC
|
|
40
40
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
41
41
|
*/
|
|
42
|
-
const E=globalThis,I=E.trustedTypes,L=I?I.createPolicy("lit-html",{createHTML:t=>t}):void 0,W="$lit$",k=`lit$${(Math.random()+"").slice(9)}$`,K="?"+k,Z=`<${K}>`,A=document
|
|
42
|
+
const E=globalThis,I=E.trustedTypes,L=I?I.createPolicy("lit-html",{createHTML:t=>t}):void 0,W="$lit$",k=`lit$${(Math.random()+"").slice(9)}$`,K="?"+k,Z=`<${K}>`,A=document,M=()=>A.createComment(""),$=t=>null===t||"object"!=typeof t&&"function"!=typeof t,F=Array.isArray,B="[ \t\n\f\r]",z=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,D=/-->/g,P=/>/g,_=RegExp(`>|${B}(?:([^\\s"'>=/]+)(${B}*=${B}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),T=/'/g,G=/"/g,j=/^(?:script|style|textarea|title)$/i,H=Symbol.for("lit-noChange"),Y=Symbol.for("lit-nothing"),J=new WeakMap,V=A.createTreeWalker(A,129);function q(t,o){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==L?L.createHTML(o):o}let X=class t{constructor({strings:o,_$litType$:e},r){let i;this.parts=[];let a=0,n=0;const s=o.length-1,c=this.parts,[l,h]=((t,o)=>{const e=t.length-1,r=[];let i,a=2===o?"<svg>":"",n=z;for(let o=0;o<e;o++){const e=t[o];let s,c,l=-1,h=0;for(;h<e.length&&(n.lastIndex=h,c=n.exec(e),null!==c);)h=n.lastIndex,n===z?"!--"===c[1]?n=D:void 0!==c[1]?n=P:void 0!==c[2]?(j.test(c[2])&&(i=RegExp("</"+c[2],"g")),n=_):void 0!==c[3]&&(n=_):n===_?">"===c[0]?(n=i??z,l=-1):void 0===c[1]?l=-2:(l=n.lastIndex-c[2].length,s=c[1],n=void 0===c[3]?_:'"'===c[3]?G:T):n===G||n===T?n=_:n===D||n===P?n=z:(n=_,i=void 0);const f=n===_&&t[o+1].startsWith("/>")?" ":"";a+=n===z?e+Z:l>=0?(r.push(s),e.slice(0,l)+W+e.slice(l)+k+f):e+k+(-2===l?o:f)}return[q(t,a+(t[e]||"<?>")+(2===o?"</svg>":"")),r]})(o,e);if(this.el=t.createElement(l,r),V.currentNode=this.el.content,2===e){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(i=V.nextNode())&&c.length<s;){if(1===i.nodeType){if(i.hasAttributes())for(const t of i.getAttributeNames())if(t.endsWith(W)){const o=h[n++],e=i.getAttribute(t).split(k),r=/([.?@])?(.*)/.exec(o);c.push({type:1,index:a,name:r[2],strings:e,ctor:"."===r[1]?et:"?"===r[1]?rt:"@"===r[1]?it:ot}),i.removeAttribute(t)}else t.startsWith(k)&&(c.push({type:6,index:a}),i.removeAttribute(t));if(j.test(i.tagName)){const t=i.textContent.split(k),o=t.length-1;if(o>0){i.textContent=I?I.emptyScript:"";for(let e=0;e<o;e++)i.append(t[e],M()),V.nextNode(),c.push({type:2,index:++a});i.append(t[o],M())}}}else if(8===i.nodeType)if(i.data===K)c.push({type:2,index:a});else{let t=-1;for(;-1!==(t=i.data.indexOf(k,t+1));)c.push({type:7,index:a}),t+=k.length-1}a++}}static createElement(t,o){const e=A.createElement("template");return e.innerHTML=t,e}};function Q(t,o,e=t,r){if(o===H)return o;let i=void 0!==r?e._$Co?.[r]:e._$Cl;const a=$(o)?void 0:o._$litDirective$;return i?.constructor!==a&&(i?._$AO?.(!1),void 0===a?i=void 0:(i=new a(t),i._$AT(t,e,r)),void 0!==r?(e._$Co??=[])[r]=i:e._$Cl=i),void 0!==i&&(o=Q(t,i._$AS(t,o.values),i,r)),o}let tt=class t{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,o,e,r){this.type=2,this._$AH=Y,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=Q(this,t,o),$(t)?t===Y||null==t||""===t?(this._$AH!==Y&&this._$AR(),this._$AH=Y):t!==this._$AH&&t!==H&&this._(t):void 0!==t._$litType$?this.g(t):void 0!==t.nodeType?this.$(t):(t=>F(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!==Y&&$(this._$AH)?this._$AA.nextSibling.data=t:this.$(A.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=X.createElement(q(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??A).importNode(o,!0);V.currentNode=r;let i=V.nextNode(),a=0,n=0,s=e[0];for(;void 0!==s;){if(a===s.index){let o;2===s.type?o=new tt(i,i.nextSibling,this,t):1===s.type?o=new s.ctor(i,s.name,s.strings,this,t):6===s.type&&(o=new at(i,this,t)),this._$AV.push(o),s=e[++n]}a!==s?.index&&(i=V.nextNode(),a++)}return V.currentNode=A,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=J.get(t.strings);return void 0===o&&J.set(t.strings,o=new X(t)),o}T(o){F(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let r,i=0;for(const a of o)i===e.length?e.push(r=new t(this.k(M()),this.k(M()),this,this.options)):r=e[i],r._$AI(a),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))}},ot=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,o,e,r,i){this.type=1,this._$AH=Y,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=Y}_$AI(t,o=this,e,r){const i=this.strings;let a=!1;if(void 0===i)t=Q(this,t,o,0),a=!$(t)||t!==this._$AH&&t!==H,a&&(this._$AH=t);else{const r=t;let n,s;for(t=i[0],n=0;n<i.length-1;n++)s=Q(this,r[e+n],o,n),s===H&&(s=this._$AH[n]),a||=!$(s)||s!==this._$AH[n],s===Y?t=Y:t!==Y&&(t+=(s??"")+i[n+1]),this._$AH[n]=s}a&&!r&&this.O(t)}O(t){t===Y?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}},et=class extends ot{constructor(){super(...arguments),this.type=3}O(t){this.element[this.name]=t===Y?void 0:t}},rt=class extends ot{constructor(){super(...arguments),this.type=4}O(t){this.element.toggleAttribute(this.name,!!t&&t!==Y)}},it=class extends ot{constructor(t,o,e,r,i){super(t,o,e,r,i),this.type=5}_$AI(t,o=this){if((t=Q(this,t,o,0)??Y)===H)return;const e=this._$AH,r=t===Y&&e!==Y||t.capture!==e.capture||t.once!==e.once||t.passive!==e.passive,i=t!==Y&&(e===Y||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)}},at=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){Q(this,t)}};const nt=E.litHtmlPolyfillSupport;nt?.(X,tt),(E.litHtmlVersions??=[]).push("3.1.0");
|
|
43
43
|
/**
|
|
44
44
|
* @license
|
|
45
45
|
* Copyright 2019 Google LLC
|
|
@@ -56,7 +56,7 @@ const st=globalThis,ct=st.ShadowRoot&&(void 0===st.ShadyCSS||st.ShadyCSS.nativeS
|
|
|
56
56
|
* Copyright 2017 Google LLC
|
|
57
57
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
58
58
|
*/
|
|
59
|
-
const Lt=globalThis,Wt=Lt.trustedTypes,kt=Wt?Wt.createPolicy("lit-html",{createHTML:t=>t}):void 0,Kt="$lit$",Zt=`lit$${(Math.random()+"").slice(9)}$`,At="?"+Zt
|
|
59
|
+
const Lt=globalThis,Wt=Lt.trustedTypes,kt=Wt?Wt.createPolicy("lit-html",{createHTML:t=>t}):void 0,Kt="$lit$",Zt=`lit$${(Math.random()+"").slice(9)}$`,At="?"+Zt,Mt=`<${At}>`,$t=document,Ft=()=>$t.createComment(""),Bt=t=>null===t||"object"!=typeof t&&"function"!=typeof t,zt=Array.isArray,Dt="[ \t\n\f\r]",Pt=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,_t=/-->/g,Tt=/>/g,Gt=RegExp(`>|${Dt}(?:([^\\s"'>=/]+)(${Dt}*=${Dt}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),jt=/'/g,Ht=/"/g,Yt=/^(?:script|style|textarea|title)$/i,Jt=(t=>(o,...e)=>({_$litType$:t,strings:o,values:e}))(1),Vt=Symbol.for("lit-noChange"),qt=Symbol.for("lit-nothing"),Xt=new WeakMap,Qt=$t.createTreeWalker($t,129);function to(t,o){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==kt?kt.createHTML(o):o}const oo=(t,o)=>{const e=t.length-1,r=[];let i,a=2===o?"<svg>":"",n=Pt;for(let o=0;o<e;o++){const e=t[o];let s,c,l=-1,h=0;for(;h<e.length&&(n.lastIndex=h,c=n.exec(e),null!==c);)h=n.lastIndex,n===Pt?"!--"===c[1]?n=_t:void 0!==c[1]?n=Tt:void 0!==c[2]?(Yt.test(c[2])&&(i=RegExp("</"+c[2],"g")),n=Gt):void 0!==c[3]&&(n=Gt):n===Gt?">"===c[0]?(n=i??Pt,l=-1):void 0===c[1]?l=-2:(l=n.lastIndex-c[2].length,s=c[1],n=void 0===c[3]?Gt:'"'===c[3]?Ht:jt):n===Ht||n===jt?n=Gt:n===_t||n===Tt?n=Pt:(n=Gt,i=void 0);const f=n===Gt&&t[o+1].startsWith("/>")?" ":"";a+=n===Pt?e+Mt:l>=0?(r.push(s),e.slice(0,l)+Kt+e.slice(l)+Zt+f):e+Zt+(-2===l?o:f)}return[to(t,a+(t[e]||"<?>")+(2===o?"</svg>":"")),r]};class eo{constructor({strings:t,_$litType$:o},e){let r;this.parts=[];let i=0,a=0;const n=t.length-1,s=this.parts,[c,l]=oo(t,o);if(this.el=eo.createElement(c,e),Qt.currentNode=this.el.content,2===o){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(r=Qt.nextNode())&&s.length<n;){if(1===r.nodeType){if(r.hasAttributes())for(const t of r.getAttributeNames())if(t.endsWith(Kt)){const o=l[a++],e=r.getAttribute(t).split(Zt),n=/([.?@])?(.*)/.exec(o);s.push({type:1,index:i,name:n[2],strings:e,ctor:"."===n[1]?no:"?"===n[1]?so:"@"===n[1]?co:ao}),r.removeAttribute(t)}else t.startsWith(Zt)&&(s.push({type:6,index:i}),r.removeAttribute(t));if(Yt.test(r.tagName)){const t=r.textContent.split(Zt),o=t.length-1;if(o>0){r.textContent=Wt?Wt.emptyScript:"";for(let e=0;e<o;e++)r.append(t[e],Ft()),Qt.nextNode(),s.push({type:2,index:++i});r.append(t[o],Ft())}}}else if(8===r.nodeType)if(r.data===At)s.push({type:2,index:i});else{let t=-1;for(;-1!==(t=r.data.indexOf(Zt,t+1));)s.push({type:7,index:i}),t+=Zt.length-1}i++}}static createElement(t,o){const e=$t.createElement("template");return e.innerHTML=t,e}}function ro(t,o,e=t,r){if(o===Vt)return o;let i=void 0!==r?e._$Co?.[r]:e._$Cl;const a=Bt(o)?void 0:o._$litDirective$;return i?.constructor!==a&&(i?._$AO?.(!1),void 0===a?i=void 0:(i=new a(t),i._$AT(t,e,r)),void 0!==r?(e._$Co??=[])[r]=i:e._$Cl=i),void 0!==i&&(o=ro(t,i._$AS(t,o.values),i,r)),o}class io{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,o,e,r){this.type=2,this._$AH=qt,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=ro(this,t,o),Bt(t)?t===qt||null==t||""===t?(this._$AH!==qt&&this._$AR(),this._$AH=qt):t!==this._$AH&&t!==Vt&&this._(t):void 0!==t._$litType$?this.g(t):void 0!==t.nodeType?this.$(t):(t=>zt(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!==qt&&Bt(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=eo.createElement(to(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??$t).importNode(o,!0);Qt.currentNode=r;let i=Qt.nextNode(),a=0,n=0,s=e[0];for(;void 0!==s;){if(a===s.index){let o;2===s.type?o=new io(i,i.nextSibling,this,t):1===s.type?o=new s.ctor(i,s.name,s.strings,this,t):6===s.type&&(o=new lo(i,this,t)),this._$AV.push(o),s=e[++n]}a!==s?.index&&(i=Qt.nextNode(),a++)}return Qt.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++}}(r,this),e=t.u(this.options);t.p(o),this.$(e),this._$AH=t}}_$AC(t){let o=Xt.get(t.strings);return void 0===o&&Xt.set(t.strings,o=new eo(t)),o}T(t){zt(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 io(this.k(Ft()),this.k(Ft()),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 ao{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,o,e,r,i){this.type=1,this._$AH=qt,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=qt}_$AI(t,o=this,e,r){const i=this.strings;let a=!1;if(void 0===i)t=ro(this,t,o,0),a=!Bt(t)||t!==this._$AH&&t!==Vt,a&&(this._$AH=t);else{const r=t;let n,s;for(t=i[0],n=0;n<i.length-1;n++)s=ro(this,r[e+n],o,n),s===Vt&&(s=this._$AH[n]),a||=!Bt(s)||s!==this._$AH[n],s===qt?t=qt:t!==qt&&(t+=(s??"")+i[n+1]),this._$AH[n]=s}a&&!r&&this.O(t)}O(t){t===qt?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class no extends ao{constructor(){super(...arguments),this.type=3}O(t){this.element[this.name]=t===qt?void 0:t}}class so extends ao{constructor(){super(...arguments),this.type=4}O(t){this.element.toggleAttribute(this.name,!!t&&t!==qt)}}class co extends ao{constructor(t,o,e,r,i){super(t,o,e,r,i),this.type=5}_$AI(t,o=this){if((t=ro(this,t,o,0)??qt)===Vt)return;const e=this._$AH,r=t===qt&&e!==qt||t.capture!==e.capture||t.once!==e.once||t.passive!==e.passive,i=t!==qt&&(e===qt||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 lo{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){ro(this,t)}}const ho=Lt.litHtmlPolyfillSupport;ho?.(eo,io),(Lt.litHtmlVersions??=[]).push("3.1.0");
|
|
60
60
|
/**
|
|
61
61
|
* @license
|
|
62
62
|
* Copyright 2017 Google LLC
|
|
@@ -104,9 +104,9 @@ const mo=window,Oo=mo.ShadowRoot&&(void 0===mo.ShadyCSS||mo.ShadyCSS.nativeShado
|
|
|
104
104
|
display: inline-block;
|
|
105
105
|
width: 0;
|
|
106
106
|
}
|
|
107
|
-
`;function Eo(t){var o;return null!==(o=null==t?void 0:t.isFtReduxStore)&&void 0!==o&&o}var Io,Lo,Wo;const ko=Symbol("internalReduxEventsUnsubscribers"),Ko=Symbol("internalStoresUnsubscribers"),Zo=Symbol("internalStores");class Ao extends Ro{constructor(){super(...arguments),this[Io]=new Map,this[Lo]=new Map,this[Wo]=[]}update(t){
|
|
107
|
+
`;function Eo(t){var o;return null!==(o=null==t?void 0:t.isFtReduxStore)&&void 0!==o&&o}var Io,Lo,Wo;const ko=Symbol("internalReduxEventsUnsubscribers"),Ko=Symbol("internalStoresUnsubscribers"),Zo=Symbol("internalStores");class Ao extends Ro{constructor(){super(...arguments),this[Io]=new Map,this[Lo]=new Map,this[Wo]=[]}get reduxConstructor(){return this.constructor}update(t){super.update(t),[...this.reduxConstructor.reduxReactiveProperties].some((o=>t.has(o)))&&this.updateFromStores()}getUnnamedStore(){if(this[Zo].size>1)throw new Error("Cannot resolve unnamed store when multiple stores are configured.");return[...this[Zo].values()][0]}getStore(t){return null==t?this.getUnnamedStore():this[Zo].get(t)}addStore(t,o){var e;o=null!==(e=null!=o?o:Eo(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[Zo].delete(o)}setupStore(t,o){this[Zo].set(t,o),this.subscribeToStore(t,o),this.updateFromStores()}setupStores(){this.unsubscribeFromStores(),this[Zo].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[Ko].has(t.store):this[Ko].size>0)&&(this[o]=t.selector(e.getState(),this))}}))}subscribeToStore(t,o){var e;this[Ko].set(t,o.subscribe((()=>this.updateFromStores()))),Eo(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[ko].push((()=>o.eventBus.removeEventListener(t.eventName,r)))}}))),this.onStoreAvailable(t)}unsubscribeFromStores(){this[Ko].forEach(((t,o)=>this.unsubscribeFromStore(o))),this[ko].forEach((t=>t())),this[ko]=[]}unsubscribeFromStore(t){this[Ko].has(t)&&this[Ko].get(t)(),this[Ko].delete(t)}onStoreAvailable(t){}connectedCallback(){super.connectedCallback(),this.setupStores()}disconnectedCallback(){super.disconnectedCallback(),this.unsubscribeFromStores()}}var Mo,$o;Io=Ko,Lo=Zo,Wo=ko,Ao.reduxProperties=new Map,Ao.reduxReactiveProperties=new Set,Ao.reduxEventListeners=new Map,window.ftReduxStores||(window.ftReduxStores={}),navigator.vendor&&navigator.vendor.match(/apple/i)||(null===($o=null===(Mo=window.safari)||void 0===Mo?void 0:Mo.pushNotification)||void 0===$o||$o.toString());const Fo=dt`
|
|
108
108
|
`;var Bo;!function(t){t.FEEDBACK="FEEDBACK",t.RATING="RATING",t.PRINT="PRINT",t.BOOKMARK="BOOKMARK",t.COLLECTIONS="COLLECTIONS",t.PERSONAL_BOOKS="PERSONAL_BOOKS"}(Bo||(Bo={}));var zo=function(t,o,e,r){for(var i,a=arguments.length,n=a<3?o:null===r?r=Object.getOwnPropertyDescriptor(o,e):r,s=t.length-1;s>=0;s--)(i=t[s])&&(n=(a<3?i(n):a>3?i(o,e,n):i(o,e))||n);return a>3&&n&&Object.defineProperty(o,e,n),n};class Do extends Event{constructor(){super("register-ft-reader-component",{bubbles:!0,composed:!0})}}const Po=Symbol("registerInterval");class _o 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[Po]=window.setInterval((()=>this.tryToRegisterToContext()),50)}tryToRegisterToContext(){null!=this.stateManager?window.clearInterval(this[Po]):this.dispatchEvent(new Do)}disconnectedCallback(){super.disconnectedCallback(),this.clearStateManager()}}return o=Po,zo([x()],e.prototype,"stateManager",void 0),e}(Ao)){}var To,Go=function(t,o,e,r){for(var i,a=arguments.length,n=a<3?o:null===r?r=Object.getOwnPropertyDescriptor(o,e):r,s=t.length-1;s>=0;s--)(i=t[s])&&(n=(a<3?i(n):a>3?i(o,e,n):i(o,e))||n);return a>3&&n&&Object.defineProperty(o,e,n),n};class jo extends _o{constructor(){super(...arguments),this.disableContextInteractions=!1,this.registeredComponents=[]}render(){return Jt`
|
|
109
109
|
<article id=${this.tocId}>
|
|
110
110
|
<slot @register-ft-reader-topic-component=${this.registerComponent}></slot>
|
|
111
111
|
</article>
|
|
112
|
-
`}registerComponent(t){t.stopPropagation();const o=t.composedPath()[0];this.register(o)}register(t){this.registeredComponents.push(t),t.tocNode=this.tocNode,t.disableContextInteractions=this.disableContextInteractions}update(t){super.update(t),["mapId","tocId","stateManager"].some((o=>t.has(o)))&&this.setTocNode(),t.has("tocNode")&&this.registeredComponents.forEach((t=>t.tocNode=this.tocNode))}async setTocNode(){var t;this.tocNode=void 0,this.tocNode=this.mapId&&this.tocId?await(null===(t=this.service)||void 0===t?void 0:t.getTocNode(this.tocId)):void 0}disconnectedCallback(){super.disconnectedCallback(),this.registeredComponents=[]}}jo.styles=Fo,Go([(t=>{const o=null!=t?t:{};return(t,e)=>{var r;const i={hasChanged:(t,o)=>!U(t,o),attribute:!1,...o};w(i)(t,e);const a=t;a.reduxProperties=a.reduxProperties
|
|
112
|
+
`}registerComponent(t){t.stopPropagation();const o=t.composedPath()[0];this.register(o)}register(t){this.registeredComponents.push(t),t.tocNode=this.tocNode,t.disableContextInteractions=this.disableContextInteractions}update(t){super.update(t),["mapId","tocId","stateManager"].some((o=>t.has(o)))&&this.setTocNode(),t.has("tocNode")&&this.registeredComponents.forEach((t=>t.tocNode=this.tocNode))}async setTocNode(){var t;this.tocNode=void 0,this.tocNode=this.mapId&&this.tocId?await(null===(t=this.service)||void 0===t?void 0:t.getTocNode(this.tocId)):void 0}disconnectedCallback(){super.disconnectedCallback(),this.registeredComponents=[]}}jo.styles=Fo,Go([(t=>{const o=null!=t?t:{};return(t,e)=>{var r;const i={hasChanged:(t,o)=>!U(t,o),attribute:!1,...o};w(i)(t,e);const a=t.constructor;a.reduxProperties=new Map(a.reduxProperties),a.reduxProperties.set(e,{selector:null!==(r=o.selector)&&void 0!==r?r:t=>t[e],store:o.store})}})({selector:t=>{var o;return null===(o=t.map)||void 0===o?void 0:o.id}})],jo.prototype,"mapId",void 0),Go([w()],jo.prototype,"tocId",void 0),Go([w({type:Boolean})],jo.prototype,"disableContextInteractions",void 0),Go([x()],jo.prototype,"tocNode",void 0),(To="ft-reader-topic-context",t=>{window.customElements.get(To)||window.customElements.define(To,t)})(jo),t.FtReaderTopicContext=jo,t.FtReaderTopicContextCssVariables={},t.styles=Fo}({});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluid-topics/ft-reader-topic-context",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.8",
|
|
4
4
|
"description": "Context block for integrated reader topic components.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Lit"
|
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
"url": "ssh://git@scm.mrs.antidot.net:2222/fluidtopics/ft-web-components.git"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@fluid-topics/ft-wc-utils": "1.1.
|
|
22
|
+
"@fluid-topics/ft-wc-utils": "1.1.8",
|
|
23
23
|
"lit": "3.1.0"
|
|
24
24
|
},
|
|
25
|
-
"gitHead": "
|
|
25
|
+
"gitHead": "95fb2d06899d700513970ac830958922b98539df"
|
|
26
26
|
}
|