@fluid-topics/ft-reader-topic-context 2.2.17 → 2.2.19
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 A=Object.create;var I=Object.defineProperty;var E=Object.getOwnPropertyDescriptor;var K=Object.getOwnPropertyNames;var B=Object.getPrototypeOf,D=Object.prototype.hasOwnProperty;var g=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(o){throw t=0,o}};var j=(e,t,o,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of K(t))!D.call(e,r)&&r!==o&&I(e,r,{get:()=>t[r],enumerable:!(s=E(t,r))||s.enumerable});return e};var d=(e,t,o)=>(o=e!=null?A(B(e)):{},j(t||!e||!e.__esModule?I(o,"default",{value:e,enumerable:!0}):o,e));var f=g(($,y)=>{y.exports=ftGlobals.wcUtils});var v=g((H,N)=>{N.exports=ftGlobals.lit});var C=g((V,O)=>{O.exports=ftGlobals.litDecorators});var w=d(f());var R=d(v()),p=d(C());var S=d(v());var L=S.css`
|
|
2
|
+
`;var m=d(f()),_=d(C());var T;(function(e){e.clusteringHelperCreated="clustering-helper-created",e.mapAttachmentsUpdate="map-attachments-update",e.visibleTopicChange="visible-topic-change",e.requestedTopicNotFound="requested-topic-not-found",e.requestedTopicFiltered="requested-topic-filtered"})(T||(T={}));var M;(function(e){e.FEEDBACK="FEEDBACK",e.RATING="RATING",e.PRINT="PRINT",e.BOOKMARK="BOOKMARK",e.COLLECTIONS="COLLECTIONS",e.PERSONAL_BOOKS="PERSONAL_BOOKS"})(M||(M={}));var G=function(e,t,o,s){var r=arguments.length,i=r<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,o):s,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,o,s);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(i=(r<3?a(i):r>3?a(t,o,i):a(t,o))||i);return r>3&&i&&Object.defineProperty(t,o,i),i},x=class extends Event{constructor(){super("register-ft-reader-component",{bubbles:!0,composed:!0})}},b=Symbol("registerInterval"),q=(0,m.applyMixinOnce)(Symbol("toFtReaderComponent"),function(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[b]=window.setInterval(()=>this.tryToRegisterToContext(),50)}tryToRegisterToContext(){this.stateManager!=null?window.clearInterval(this[b]):this.dispatchEvent(new x)}disconnectedCallback(){super.disconnectedCallback(),this.clearStateManager()}}return t=b,G([(0,_.state)()],o.prototype,"stateManager",void 0),o}),u=class extends q(m.FtLitElementRedux){};var h=d(f()),c=function(e,t,o,s){var r=arguments.length,i=r<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,o):s,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,o,s);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(i=(r<3?a(i):r>3?a(t,o,i):a(t,o))||i);return r>3&&i&&Object.defineProperty(t,o,i),i},n=class extends u{constructor(){super(...arguments),this.disableContextInteractions=!1,this.headingLevelsShift=0,this.registeredComponents=[]}render(){return R.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,t.headingLevelsShift=this.headingLevelsShift,t.headingStartLevel=this.headingStartLevel}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=[]}};n.styles=L;c([(0,h.redux)({selector:e=>{var t;return(t=e.map)===null||t===void 0?void 0:t.id}})],n.prototype,"mapId",void 0);c([(0,h.redux)({selector:e=>e.translation.profileId})],n.prototype,"translationProfileId",void 0);c([(0,h.redux)({selector:e=>e.translation.destinationLanguage})],n.prototype,"translationDestinationLanguage",void 0);c([(0,p.property)()],n.prototype,"tocId",void 0);c([(0,p.property)({type:Boolean})],n.prototype,"disableContextInteractions",void 0);c([(0,p.property)({type:Number})],n.prototype,"headingLevelsShift",void 0);c([(0,h.numberProperty)()],n.prototype,"headingStartLevel",void 0);c([(0,p.state)()],n.prototype,"tocNode",void 0);var P={"ft-reader-topic-context":n};(0,
|
|
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,t.headingLevelsShift=this.headingLevelsShift,t.headingStartLevel=this.headingStartLevel}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=[]}};n.styles=L;c([(0,h.redux)({selector:e=>{var t;return(t=e.map)===null||t===void 0?void 0:t.id}})],n.prototype,"mapId",void 0);c([(0,h.redux)({selector:e=>e.translation.profileId})],n.prototype,"translationProfileId",void 0);c([(0,h.redux)({selector:e=>e.translation.destinationLanguage})],n.prototype,"translationDestinationLanguage",void 0);c([(0,p.property)()],n.prototype,"tocId",void 0);c([(0,p.property)({type:Boolean})],n.prototype,"disableContextInteractions",void 0);c([(0,p.property)({type:Number})],n.prototype,"headingLevelsShift",void 0);c([(0,h.numberProperty)()],n.prototype,"headingStartLevel",void 0);c([(0,p.state)()],n.prototype,"tocNode",void 0);var P={"ft-reader-topic-context":n};(0,w.customElements)(P);})();
|