@fluid-topics/ft-reader-metadata 1.0.47 → 1.0.48

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.
@@ -94,11 +94,11 @@ var dt,ft;let ut=class extends N{constructor(){super(...arguments),this.renderOp
94
94
  display: inline-block;
95
95
  width: 0;
96
96
  }
97
- `;var Nt,Rt,Mt;const zt=Symbol("internalReduxEventsUnsubscribers"),Ut=Symbol("internalStoresUnsubscribers"),jt=Symbol("internalStores");class Ft extends kt{constructor(){super(...arguments),this[Nt]=new Map,this[Rt]=new Map,this[Mt]=[]}updated(t){var i;super.updated(t),(null===(i=this.reduxReactiveProperties)||void 0===i?void 0:i.some((i=>t.has(i))))&&this.updateFromStores()}getUnnamedStore(){if(this[jt].size>1)throw new Error("Cannot resolve unnamed store when multiple stores are configured.");return[...this[jt].values()][0]}getStore(t){return null==t?this.getUnnamedStore():this[jt].get(t)}addStore(t,i){var e;i=null!==(e=null!=i?i:Bt(t)?t.name:void 0)&&void 0!==e?e:"default-store",this.unsubscribeFromStore(i),this.setupStore(i,t)}removeStore(t){const i="string"==typeof t?t:t.name;this.unsubscribeFromStore(i),this[jt].delete(i)}setupStore(t,i){this[jt].set(t,i),this.subscribeToStore(t,i),this.updateFromStores()}setupStores(){this.unsubscribeFromStores(),this[jt].forEach(((t,i)=>this.subscribeToStore(i,t))),this.updateFromStores()}updateFromStores(){this.reduxProperties&&this.reduxProperties.forEach(((t,i)=>{const e=this.constructor.getPropertyOptions(i);if(!(null==e?void 0:e.attribute)||!this.hasAttribute("string"==typeof(null==e?void 0:e.attribute)?e.attribute:i)){const e=this.getStore(t.store);e&&(t.store?this[Ut].has(t.store):this[Ut].size>0)&&(this[i]=t.selector(e.getState(),this))}}))}subscribeToStore(t,i){var e;this[Ut].set(t,i.subscribe((()=>this.updateFromStores()))),Bt(i)&&i.eventBus&&(null===(e=this.reduxEventListeners)||void 0===e||e.forEach(((t,e)=>{if("function"==typeof this[e]&&(!t.store||i.name===t.store)){const o=t=>this[e](t);i.eventBus.addEventListener(t.eventName,o),this[zt].push((()=>i.eventBus.removeEventListener(t.eventName,o)))}}))),this.onStoreAvailable(t)}unsubscribeFromStores(){this[Ut].forEach(((t,i)=>this.unsubscribeFromStore(i))),this[zt].forEach((t=>t())),this[zt]=[]}unsubscribeFromStore(t){this[Ut].has(t)&&this[Ut].get(t)(),this[Ut].delete(t)}onStoreAvailable(t){}connectedCallback(){super.connectedCallback(),this.setupStores()}disconnectedCallback(){super.disconnectedCallback(),this.unsubscribeFromStores()}}function Bt(t){var i;return null!==(i=null==t?void 0:t.isFtReduxStore)&&void 0!==i&&i}var Tt,It,Lt;Nt=Ut,Rt=jt,Mt=zt;const At=navigator.vendor&&!!navigator.vendor.match(/apple/i)||"[object SafariRemoteNotification]"===(null!==(Lt=null===(It=null===(Tt=window.safari)||void 0===Tt?void 0:Tt.pushNotification)||void 0===It?void 0:It.toString())&&void 0!==Lt?Lt:""),Pt=x`
97
+ `;function Nt(t){var i;return null!==(i=null==t?void 0:t.isFtReduxStore)&&void 0!==i&&i}var Rt,Mt,zt;const Ut=Symbol("internalReduxEventsUnsubscribers"),jt=Symbol("internalStoresUnsubscribers"),Ft=Symbol("internalStores");class Bt extends kt{constructor(){super(...arguments),this[Rt]=new Map,this[Mt]=new Map,this[zt]=[]}updated(t){var i;super.updated(t),(null===(i=this.reduxReactiveProperties)||void 0===i?void 0:i.some((i=>t.has(i))))&&this.updateFromStores()}getUnnamedStore(){if(this[Ft].size>1)throw new Error("Cannot resolve unnamed store when multiple stores are configured.");return[...this[Ft].values()][0]}getStore(t){return null==t?this.getUnnamedStore():this[Ft].get(t)}addStore(t,i){var e;i=null!==(e=null!=i?i:Nt(t)?t.name:void 0)&&void 0!==e?e:"default-store",this.unsubscribeFromStore(i),this.setupStore(i,t)}removeStore(t){const i="string"==typeof t?t:t.name;this.unsubscribeFromStore(i),this[Ft].delete(i)}setupStore(t,i){this[Ft].set(t,i),this.subscribeToStore(t,i),this.updateFromStores()}setupStores(){this.unsubscribeFromStores(),this[Ft].forEach(((t,i)=>this.subscribeToStore(i,t))),this.updateFromStores()}updateFromStores(){this.reduxProperties&&this.reduxProperties.forEach(((t,i)=>{const e=this.constructor.getPropertyOptions(i);if(!(null==e?void 0:e.attribute)||!this.hasAttribute("string"==typeof(null==e?void 0:e.attribute)?e.attribute:i)){const e=this.getStore(t.store);e&&(t.store?this[jt].has(t.store):this[jt].size>0)&&(this[i]=t.selector(e.getState(),this))}}))}subscribeToStore(t,i){var e;this[jt].set(t,i.subscribe((()=>this.updateFromStores()))),Nt(i)&&i.eventBus&&(null===(e=this.reduxEventListeners)||void 0===e||e.forEach(((t,e)=>{if("function"==typeof this[e]&&(!t.store||i.name===t.store)){const o=t=>this[e](t);i.eventBus.addEventListener(t.eventName,o),this[Ut].push((()=>i.eventBus.removeEventListener(t.eventName,o)))}}))),this.onStoreAvailable(t)}unsubscribeFromStores(){this[jt].forEach(((t,i)=>this.unsubscribeFromStore(i))),this[Ut].forEach((t=>t())),this[Ut]=[]}unsubscribeFromStore(t){this[jt].has(t)&&this[jt].get(t)(),this[jt].delete(t)}onStoreAvailable(t){}connectedCallback(){super.connectedCallback(),this.setupStores()}disconnectedCallback(){super.disconnectedCallback(),this.unsubscribeFromStores()}}Rt=jt,Mt=Ft,zt=Ut;var Tt,It,Lt;const At=navigator.vendor&&!!navigator.vendor.match(/apple/i)||"[object SafariRemoteNotification]"===(null!==(Lt=null===(It=null===(Tt=window.safari)||void 0===Tt?void 0:Tt.pushNotification)||void 0===It?void 0:It.toString())&&void 0!==Lt?Lt:""),Pt=x`
98
98
  :host {
99
99
  display: inline-block;
100
100
  }
101
- `;var Dt=function(t,i,e,o){for(var n,r=arguments.length,s=r<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,a=t.length-1;a>=0;a--)(n=t[a])&&(s=(r<3?n(s):r>3?n(i,e,s):n(i,e))||s);return r>3&&s&&Object.defineProperty(i,e,s),s};class _t extends Event{constructor(){super("register-ft-reader-component",{bubbles:!0,composed:!0})}}const Wt=Symbol("registerInterval");class Ht extends(function(t){var i;class e extends t{constructor(){super(...arguments),this[i]=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[Wt]=window.setInterval((()=>this.tryToRegisterToContext()),50)}tryToRegisterToContext(){null!=this.stateManager?window.clearInterval(this[Wt]):this.dispatchEvent(new _t)}disconnectedCallback(){super.disconnectedCallback(),this.clearStateManager()}}return i=Wt,Dt([n()],e.prototype,"stateManager",void 0),e}(Ft)){}
101
+ `;var Dt=function(t,i,e,o){for(var n,r=arguments.length,s=r<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,a=t.length-1;a>=0;a--)(n=t[a])&&(s=(r<3?n(s):r>3?n(i,e,s):n(i,e))||s);return r>3&&s&&Object.defineProperty(i,e,s),s};class _t extends Event{constructor(){super("register-ft-reader-component",{bubbles:!0,composed:!0})}}const Wt=Symbol("registerInterval");class Ht extends(function(t){var i;class e extends t{constructor(){super(...arguments),this[i]=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[Wt]=window.setInterval((()=>this.tryToRegisterToContext()),50)}tryToRegisterToContext(){null!=this.stateManager?window.clearInterval(this[Wt]):this.dispatchEvent(new _t)}disconnectedCallback(){super.disconnectedCallback(),this.clearStateManager()}}return i=Wt,Dt([n()],e.prototype,"stateManager",void 0),e}(Bt)){}
102
102
  /**
103
103
  * @license
104
104
  * Copyright 2020 Google LLC
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluid-topics/ft-reader-metadata",
3
- "version": "1.0.47",
3
+ "version": "1.0.48",
4
4
  "description": "Metadata for integrated reader",
5
5
  "keywords": [
6
6
  "Lit"
@@ -19,11 +19,11 @@
19
19
  "url": "ssh://git@scm.mrs.antidot.net:2222/fluidtopics/ft-web-components.git"
20
20
  },
21
21
  "dependencies": {
22
- "@fluid-topics/ft-chip": "1.0.47",
23
- "@fluid-topics/ft-reader-context": "1.0.47",
24
- "@fluid-topics/ft-tooltip": "1.0.47",
25
- "@fluid-topics/ft-wc-utils": "1.0.47",
22
+ "@fluid-topics/ft-chip": "1.0.48",
23
+ "@fluid-topics/ft-reader-context": "1.0.48",
24
+ "@fluid-topics/ft-tooltip": "1.0.48",
25
+ "@fluid-topics/ft-wc-utils": "1.0.48",
26
26
  "lit": "2.7.2"
27
27
  },
28
- "gitHead": "6313471d9f5ceea14a13311e9a6cc24b6fa6f044"
28
+ "gitHead": "a07dca06ede4358afbfe00c06b1ea1da90e3ff51"
29
29
  }