@fluid-topics/ft-reader-topic-context 1.0.8 → 1.0.10

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.
@@ -84,7 +84,7 @@ var lt,ct;class ht extends S{constructor(){super(...arguments),this.renderOption
84
84
  display: inline-block;
85
85
  width: 0;
86
86
  }
87
- `;const Ot=Symbol("internalStoresUnsubscribers"),Nt=Symbol("internalStores");class St extends wt{constructor(){super(...arguments),this[yt]=new Map,this[gt]=new Map}getUnnamedStore(){if(this[Nt].size>1)throw new Error("Cannot resolve unnamed store when multiple stores are configured.");return[...this[Nt].values()][0]}getStore(t){return null==t?this.getUnnamedStore():this[Nt].get(t)}addStore(t,e){e=null!=e?e:function(t){var e;return null!==(e=null==t?void 0:t.isFtReduxStore)&&void 0!==e&&e}(t)?t.name:void 0,this.unsubscribeFromStore(e),this.setupStore(e,t)}removeStore(t){const e="string"==typeof t?t:t.name;this.unsubscribeFromStore(e),this[Nt].delete(e)}setupStore(t,e){this[Nt].set(t,e),this.subscribeToStore(t,e),this.updateFromStores()}setupStores(){this.unsubscribeFromStores(),this[Nt].forEach(((t,e)=>this.subscribeToStore(e,t))),this.updateFromStores()}updateFromStores(){this.reduxProperties&&this.reduxProperties.forEach(((t,e)=>{const i=this.constructor.getPropertyOptions(e);if(!(null==i?void 0:i.attribute)||!this.hasAttribute("string"==typeof(null==i?void 0:i.attribute)?i.attribute:e)){const i=this.getStore(t.store);i&&(this[e]=t.selector(i.getState(),this))}}))}subscribeToStore(t,e){this[Ot].set(t,e.subscribe((()=>this.updateFromStores()))),this.onStoreAvailable(t)}unsubscribeFromStores(){Object.keys(this[Ot]).forEach((t=>this.unsubscribeFromStore(t)))}unsubscribeFromStore(t){this[Ot].has(t)&&this[Ot].get(t)(),this[Ot].delete(t)}onStoreAvailable(t){}connectedCallback(){super.connectedCallback(),this.setupStores()}disconnectedCallback(){this.unsubscribeFromStores(),super.disconnectedCallback()}}var Ct,Et;yt=Ot,gt=Nt,navigator.vendor&&navigator.vendor.match(/apple/i)||(null===(Et=null===(Ct=window.safari)||void 0===Ct?void 0:Ct.pushNotification)||void 0===Et||Et.toString());const Rt=p`
87
+ `;const Ot=Symbol("internalStoresUnsubscribers"),Nt=Symbol("internalStores");class St extends wt{constructor(){super(...arguments),this[yt]=new Map,this[gt]=new Map}getUnnamedStore(){if(this[Nt].size>1)throw new Error("Cannot resolve unnamed store when multiple stores are configured.");return[...this[Nt].values()][0]}getStore(t){return null==t?this.getUnnamedStore():this[Nt].get(t)}addStore(t,e){var i;e=null!==(i=null!=e?e:function(t){var e;return null!==(e=null==t?void 0:t.isFtReduxStore)&&void 0!==e&&e}(t)?t.name:void 0)&&void 0!==i?i:"default-store",this.unsubscribeFromStore(e),this.setupStore(e,t)}removeStore(t){const e="string"==typeof t?t:t.name;this.unsubscribeFromStore(e),this[Nt].delete(e)}setupStore(t,e){this[Nt].set(t,e),this.subscribeToStore(t,e),this.updateFromStores()}setupStores(){this.unsubscribeFromStores(),this[Nt].forEach(((t,e)=>this.subscribeToStore(e,t))),this.updateFromStores()}updateFromStores(){this.reduxProperties&&this.reduxProperties.forEach(((t,e)=>{const i=this.constructor.getPropertyOptions(e);if(!(null==i?void 0:i.attribute)||!this.hasAttribute("string"==typeof(null==i?void 0:i.attribute)?i.attribute:e)){const i=this.getStore(t.store);i&&(this[e]=t.selector(i.getState(),this))}}))}subscribeToStore(t,e){this[Ot].set(t,e.subscribe((()=>this.updateFromStores()))),this.onStoreAvailable(t)}unsubscribeFromStores(){Object.keys(this[Ot]).forEach((t=>this.unsubscribeFromStore(t)))}unsubscribeFromStore(t){this[Ot].has(t)&&this[Ot].get(t)(),this[Ot].delete(t)}onStoreAvailable(t){}connectedCallback(){super.connectedCallback(),this.setupStores()}disconnectedCallback(){this.unsubscribeFromStores(),super.disconnectedCallback()}}var Ct,Et;yt=Ot,gt=Nt,navigator.vendor&&navigator.vendor.match(/apple/i)||(null===(Et=null===(Ct=window.safari)||void 0===Ct?void 0:Ct.pushNotification)||void 0===Et||Et.toString());const Rt=p`
88
88
  `;var Mt=function(t,e,i,s){for(var o,n=arguments.length,r=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s,a=t.length-1;a>=0;a--)(o=t[a])&&(r=(n<3?o(r):n>3?o(e,i,r):o(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class kt extends Event{constructor(){super("register-ft-reader-component",{bubbles:!0,composed:!0})}}const Ut=Symbol("registerInterval");class $t extends(function(t){var e;class i extends t{constructor(){super(...arguments),this[e]=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[Ut]=window.setInterval((()=>this.tryToRegisterToContext()),50)}tryToRegisterToContext(){null!=this.stateManager?window.clearInterval(this[Ut]):this.dispatchEvent(new kt)}disconnectedCallback(){super.disconnectedCallback(),this.clearStateManager()}}return e=Ut,Mt([o()],i.prototype,"stateManager",void 0),i}(St)){}var Ft,jt=function(t,e,i,s){for(var o,n=arguments.length,r=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s,a=t.length-1;a>=0;a--)(o=t[a])&&(r=(n<3?o(r):n>3?o(e,i,r):o(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class At extends $t{constructor(){super(...arguments),this.disableContextInteractions=!1,this.registeredComponents=[]}render(){return z`
89
89
  <article id=${this.tocId}>
90
90
  <slot @register-ft-reader-topic-component=${this.registerComponent}></slot>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluid-topics/ft-reader-topic-context",
3
- "version": "1.0.8",
3
+ "version": "1.0.10",
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.0.8",
22
+ "@fluid-topics/ft-wc-utils": "1.0.10",
23
23
  "lit": "2.7.2"
24
24
  },
25
- "gitHead": "b55ea6fbe362f72c42f5c26f705fde8e39261001"
25
+ "gitHead": "218bb9e681375f8f1a5ff5f4a5d9b6084ce83ab3"
26
26
  }