@fluid-topics/ft-reader-topic-context 2.2.33 → 2.2.34

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.
@@ -28,8 +28,10 @@ export class FtReaderTopicContext extends FtReaderComponent {
28
28
  `;
29
29
  }
30
30
  registerComponent(e) {
31
+ var _a;
32
+ var _b;
31
33
  e.stopPropagation();
32
- const component = e.composedPath()[0];
34
+ const component = (_b = (_a = e.detail) === null || _a === void 0 ? void 0 : _a.target) !== null && _b !== void 0 ? _b : e.composedPath()[0];
33
35
  this.register(component);
34
36
  }
35
37
  register(component) {
@@ -1,6 +1,6 @@
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`
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 v=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(o){throw t=0,o}};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=E(t,r))||i.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 u=v(($,y)=>{y.exports=ftGlobals.wcUtils});var g=v((H,N)=>{N.exports=ftGlobals.lit});var C=v((V,O)=>{O.exports=ftGlobals.litDecorators});var w=d(u());var R=d(g()),h=d(C());var S=d(g());var L=S.css`
2
+ `;var p=d(u()),M=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 _;(function(e){e.FEEDBACK="FEEDBACK",e.RATING="RATING",e.PRINT="PRINT",e.BOOKMARK="BOOKMARK",e.COLLECTIONS="COLLECTIONS",e.PERSONAL_BOOKS="PERSONAL_BOOKS"})(_||(_={}));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},b=class extends p.FtContextRegistrationEvent{constructor(t){super("register-ft-reader-component",t)}},x=Symbol("registerInterval"),q=(0,p.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[x]=window.setInterval(()=>this.tryToRegisterToContext(),50)}tryToRegisterToContext(){this.stateManager!=null?window.clearInterval(this[x]):this.dispatchEvent(new b({target:this}))}disconnectedCallback(){super.disconnectedCallback(),this.clearStateManager()}}return t=x,G([(0,M.state)()],o.prototype,"stateManager",void 0),o}),m=class extends q(p.FtLitElementRedux){};var f=d(u()),l=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 m{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,w.customElements)(P);})();
6
+ `}registerComponent(t){var o,i;t.stopPropagation();let r=(i=(o=t.detail)===null||o===void 0?void 0:o.target)!==null&&i!==void 0?i:t.composedPath()[0];this.register(r)}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;l([(0,f.redux)({selector:e=>{var t;return(t=e.map)===null||t===void 0?void 0:t.id}})],n.prototype,"mapId",void 0);l([(0,f.redux)({selector:e=>e.translation.profileId})],n.prototype,"translationProfileId",void 0);l([(0,f.redux)({selector:e=>e.translation.destinationLanguage})],n.prototype,"translationDestinationLanguage",void 0);l([(0,h.property)()],n.prototype,"tocId",void 0);l([(0,h.property)({type:Boolean})],n.prototype,"disableContextInteractions",void 0);l([(0,h.property)({type:Number})],n.prototype,"headingLevelsShift",void 0);l([(0,f.numberProperty)()],n.prototype,"headingStartLevel",void 0);l([(0,h.state)()],n.prototype,"tocNode",void 0);var P={"ft-reader-topic-context":n};(0,w.customElements)(P);})();