@fluid-topics/ft-reader-topic-context 1.2.50 → 1.2.51
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
"use strict";(()=>{var
|
|
2
|
-
`;var
|
|
1
|
+
"use strict";(()=>{var P=Object.create;var b=Object.defineProperty;var w=Object.getOwnPropertyDescriptor;var A=Object.getOwnPropertyNames;var K=Object.getPrototypeOf,B=Object.prototype.hasOwnProperty;var u=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var D=(e,t,o,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of A(t))!B.call(e,r)&&r!==o&&b(e,r,{get:()=>t[r],enumerable:!(n=w(t,r))||n.enumerable});return e};var l=(e,t,o)=>(o=e!=null?P(K(e)):{},D(t||!e||!e.__esModule?b(o,"default",{value:e,enumerable:!0}):o,e));var f=u(($,I)=>{I.exports=ftGlobals.wcUtils});var g=u((H,O)=>{O.exports=ftGlobals.lit});var v=u((V,N)=>{N.exports=ftGlobals.litDecorators});var L=l(f());var E=l(g()),d=l(v());var y=l(g()),q={},R=y.css`
|
|
2
|
+
`;var M=l(f()),S=l(v());var T;(function(e){e.clusteringHelperCreated="clustering-helper-created",e.mapAttachmentsUpdate="map-attachments-update"})(T||(T={}));var _;(function(e){e.FEEDBACK="FEEDBACK",e.RATING="RATING",e.PRINT="PRINT",e.BOOKMARK="BOOKMARK",e.COLLECTIONS="COLLECTIONS",e.PERSONAL_BOOKS="PERSONAL_BOOKS"})(_||(_={}));var j=function(e,t,o,n){var r=arguments.length,s=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,o):n,i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,o,n);else for(var c=e.length-1;c>=0;c--)(i=e[c])&&(s=(r<3?i(s):r>3?i(t,o,s):i(t,o))||s);return r>3&&s&&Object.defineProperty(t,o,s),s},C=class extends Event{constructor(){super("register-ft-reader-component",{bubbles:!0,composed:!0})}},x=Symbol("registerInterval");function G(e){var t;class o extends e{constructor(){super(...arguments),this[t]=0}setReaderStateManager(r){this.clearStateManager(),this.stateManager=r,this.addStore(r.store,"reader")}clearStateManager(){this.stateManager&&(this.removeStore("reader"),this.stateManager=void 0)}get service(){var r;return(r=this.stateManager)===null||r===void 0?void 0:r.service}connectedCallback(){super.connectedCallback(),this[x]=window.setInterval(()=>this.tryToRegisterToContext(),50)}tryToRegisterToContext(){this.stateManager!=null?window.clearInterval(this[x]):this.dispatchEvent(new C)}disconnectedCallback(){super.disconnectedCallback(),this.clearStateManager()}}return t=x,j([(0,S.state)()],o.prototype,"stateManager",void 0),o}var m=class extends G(M.FtLitElementRedux){};var h=l(f()),p=function(e,t,o,n){var r=arguments.length,s=r<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,o):n,i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,o,n);else for(var c=e.length-1;c>=0;c--)(i=e[c])&&(s=(r<3?i(s):r>3?i(t,o,s):i(t,o))||s);return r>3&&s&&Object.defineProperty(t,o,s),s},a=class extends m{constructor(){super(...arguments),this.disableContextInteractions=!1,this.registeredComponents=[]}render(){return E.html`
|
|
3
3
|
<article id=${this.tocId}>
|
|
4
4
|
<slot @register-ft-reader-topic-component=${this.registerComponent}></slot>
|
|
5
5
|
</article>
|
|
6
|
-
`}registerComponent(t){t.stopPropagation();let 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","translationDestinationLanguage","translationProfileId"].some(o=>t.has(o))&&this.setTocNode(),t.has("tocNode")&&this.registeredComponents.forEach(o=>o.tocNode=this.tocNode)}async setTocNode(){var t;this.tocNode=void 0,this.tocNode=this.mapId&&this.tocId?await((t=this.stateManager)===null||t===void 0?void 0:t.getTocNode(this.tocId)):void 0}disconnectedCallback(){super.disconnectedCallback(),this.registeredComponents=[]}};
|
|
6
|
+
`}registerComponent(t){t.stopPropagation();let 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","translationDestinationLanguage","translationProfileId"].some(o=>t.has(o))&&this.setTocNode(),t.has("tocNode")&&this.registeredComponents.forEach(o=>o.tocNode=this.tocNode)}async setTocNode(){var t;this.tocNode=void 0,this.tocNode=this.mapId&&this.tocId?await((t=this.stateManager)===null||t===void 0?void 0:t.getTocNode(this.tocId)):void 0}disconnectedCallback(){super.disconnectedCallback(),this.registeredComponents=[]}};a.styles=R;p([(0,h.redux)({selector:e=>{var t;return(t=e.map)===null||t===void 0?void 0:t.id}})],a.prototype,"mapId",void 0);p([(0,h.redux)({selector:e=>e.translation.profileId})],a.prototype,"translationProfileId",void 0);p([(0,h.redux)({selector:e=>e.translation.destinationLanguage})],a.prototype,"translationDestinationLanguage",void 0);p([(0,d.property)()],a.prototype,"tocId",void 0);p([(0,d.property)({type:Boolean})],a.prototype,"disableContextInteractions",void 0);p([(0,d.state)()],a.prototype,"tocNode",void 0);(0,L.customElement)("ft-reader-topic-context")(a);})();
|