@fluid-topics/ft-reader-topic-context 2.0.26 → 2.0.28
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.
package/build/define.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
|
|
1
|
+
import { customElements } from "@fluid-topics/ft-wc-utils";
|
|
2
|
+
import definitions from "./definitions";
|
|
3
|
+
customElements(definitions);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
"use strict";(()=>{var
|
|
2
|
-
`;var m=l(
|
|
1
|
+
"use strict";(()=>{var w=Object.create;var I=Object.defineProperty;var A=Object.getOwnPropertyDescriptor;var K=Object.getOwnPropertyNames;var B=Object.getPrototypeOf,D=Object.prototype.hasOwnProperty;var g=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var j=(e,t,o,i)=>{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:!(i=A(t,r))||i.enumerable});return e};var l=(e,t,o)=>(o=e!=null?w(B(e)):{},j(t||!e||!e.__esModule?I(o,"default",{value:e,enumerable:!0}):o,e));var f=g((H,O)=>{O.exports=ftGlobals.wcUtils});var v=g((V,y)=>{y.exports=ftGlobals.lit});var C=g((q,N)=>{N.exports=ftGlobals.litDecorators});var P=l(f());var _=l(v()),p=l(C());var S=l(v());var R=S.css`
|
|
2
|
+
`;var m=l(f()),M=l(C());var T;(function(e){e.clusteringHelperCreated="clustering-helper-created",e.mapAttachmentsUpdate="map-attachments-update",e.visibleTopicChange="visible-topic-change"})(T||(T={}));var L;(function(e){e.FEEDBACK="FEEDBACK",e.RATING="RATING",e.PRINT="PRINT",e.BOOKMARK="BOOKMARK",e.COLLECTIONS="COLLECTIONS",e.PERSONAL_BOOKS="PERSONAL_BOOKS"})(L||(L={}));var G=function(e,t,o,i){var r=arguments.length,s=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,o):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,o,i);else for(var c=e.length-1;c>=0;c--)(a=e[c])&&(s=(r<3?a(s):r>3?a(t,o,s):a(t,o))||s);return r>3&&s&&Object.defineProperty(t,o,s),s},x=class extends Event{constructor(){super("register-ft-reader-component",{bubbles:!0,composed:!0})}},b=Symbol("registerInterval"),U=(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,M.state)()],o.prototype,"stateManager",void 0),o}),h=class extends U(m.FtLitElementRedux){};var u=l(f()),d=function(e,t,o,i){var r=arguments.length,s=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,o):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,o,i);else for(var c=e.length-1;c>=0;c--)(a=e[c])&&(s=(r<3?a(s):r>3?a(t,o,s):a(t,o))||s);return r>3&&s&&Object.defineProperty(t,o,s),s},n=class extends h{constructor(){super(...arguments),this.disableContextInteractions=!1,this.headingLevelsShift=0,this.registeredComponents=[]}render(){return _.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}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=R;d([(0,u.redux)({selector:e=>{var t;return(t=e.map)===null||t===void 0?void 0:t.id}})],n.prototype,"mapId",void 0);d([(0,u.redux)({selector:e=>e.translation.profileId})],n.prototype,"translationProfileId",void 0);d([(0,u.redux)({selector:e=>e.translation.destinationLanguage})],n.prototype,"translationDestinationLanguage",void 0);d([(0,p.property)()],n.prototype,"tocId",void 0);d([(0,p.property)({type:Boolean})],n.prototype,"disableContextInteractions",void 0);d([(0,p.property)({type:Number})],n.prototype,"headingLevelsShift",void 0);d([(0,p.state)()],n.prototype,"tocNode",void 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}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=R;d([(0,u.redux)({selector:e=>{var t;return(t=e.map)===null||t===void 0?void 0:t.id}})],n.prototype,"mapId",void 0);d([(0,u.redux)({selector:e=>e.translation.profileId})],n.prototype,"translationProfileId",void 0);d([(0,u.redux)({selector:e=>e.translation.destinationLanguage})],n.prototype,"translationDestinationLanguage",void 0);d([(0,p.property)()],n.prototype,"tocId",void 0);d([(0,p.property)({type:Boolean})],n.prototype,"disableContextInteractions",void 0);d([(0,p.property)({type:Number})],n.prototype,"headingLevelsShift",void 0);d([(0,p.state)()],n.prototype,"tocNode",void 0);var E={"ft-reader-topic-context":n};(0,P.customElements)(E);})();
|