@fluid-topics/ft-reader-metadata 1.1.7 → 1.1.8

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.
@@ -123,7 +123,7 @@ class bo extends zt{constructor(){super(...arguments),this.renderOptions={host:t
123
123
  display: inline-block;
124
124
  width: 0;
125
125
  }
126
- `;function Ao(t){var o;return null!==(o=null==t?void 0:t.isFtReduxStore)&&void 0!==o&&o}var Mo,Do,Po;const Ho=Symbol("internalReduxEventsUnsubscribers"),jo=Symbol("internalStoresUnsubscribers"),To=Symbol("internalStores");class _o extends Ko{constructor(){super(...arguments),this[Mo]=new Map,this[Do]=new Map,this[Po]=[]}update(t){var o;super.update(t),(null===(o=this.reduxReactiveProperties)||void 0===o?void 0:o.some((o=>t.has(o))))&&this.updateFromStores()}getUnnamedStore(){if(this[To].size>1)throw new Error("Cannot resolve unnamed store when multiple stores are configured.");return[...this[To].values()][0]}getStore(t){return null==t?this.getUnnamedStore():this[To].get(t)}addStore(t,o){var e;o=null!==(e=null!=o?o:Ao(t)?t.name:void 0)&&void 0!==e?e:"default-store",this.unsubscribeFromStore(o),this.setupStore(o,t)}removeStore(t){const o="string"==typeof t?t:t.name;this.unsubscribeFromStore(o),this[To].delete(o)}setupStore(t,o){this[To].set(t,o),this.subscribeToStore(t,o),this.updateFromStores()}setupStores(){this.unsubscribeFromStores(),this[To].forEach(((t,o)=>this.subscribeToStore(o,t))),this.updateFromStores()}updateFromStores(){this.reduxProperties&&this.reduxProperties.forEach(((t,o)=>{const e=this.constructor.getPropertyOptions(o);if(!(null==e?void 0:e.attribute)||!this.hasAttribute("string"==typeof(null==e?void 0:e.attribute)?e.attribute:o)){const e=this.getStore(t.store);e&&(t.store?this[jo].has(t.store):this[jo].size>0)&&(this[o]=t.selector(e.getState(),this))}}))}subscribeToStore(t,o){var e;this[jo].set(t,o.subscribe((()=>this.updateFromStores()))),Ao(o)&&o.eventBus&&(null===(e=this.reduxEventListeners)||void 0===e||e.forEach(((t,e)=>{if("function"==typeof this[e]&&(!t.store||o.name===t.store)){const i=t=>this[e](t);o.eventBus.addEventListener(t.eventName,i),this[Ho].push((()=>o.eventBus.removeEventListener(t.eventName,i)))}}))),this.onStoreAvailable(t)}unsubscribeFromStores(){this[jo].forEach(((t,o)=>this.unsubscribeFromStore(o))),this[Ho].forEach((t=>t())),this[Ho]=[]}unsubscribeFromStore(t){this[jo].has(t)&&this[jo].get(t)(),this[jo].delete(t)}onStoreAvailable(t){}connectedCallback(){super.connectedCallback(),this.setupStores()}disconnectedCallback(){super.disconnectedCallback(),this.unsubscribeFromStores()}}Mo=jo,Do=To,Po=Ho,window.ftReduxStores||(window.ftReduxStores={});const Go=Symbol("elementInternals");var Yo,Vo,Jo;const qo=navigator.vendor&&!!navigator.vendor.match(/apple/i)||"[object SafariRemoteNotification]"===(null!==(Jo=null===(Vo=null===(Yo=window.safari)||void 0===Yo?void 0:Yo.pushNotification)||void 0===Vo?void 0:Vo.toString())&&void 0!==Jo?Jo:""),Xo=mt`
126
+ `;function Ao(t){var o;return null!==(o=null==t?void 0:t.isFtReduxStore)&&void 0!==o&&o}var Mo,Do,Po;const Ho=Symbol("internalReduxEventsUnsubscribers"),jo=Symbol("internalStoresUnsubscribers"),To=Symbol("internalStores");class _o extends Ko{constructor(){super(...arguments),this[Mo]=new Map,this[Do]=new Map,this[Po]=[]}get reduxConstructor(){return this.constructor}update(t){super.update(t),[...this.reduxConstructor.reduxReactiveProperties].some((o=>t.has(o)))&&this.updateFromStores()}getUnnamedStore(){if(this[To].size>1)throw new Error("Cannot resolve unnamed store when multiple stores are configured.");return[...this[To].values()][0]}getStore(t){return null==t?this.getUnnamedStore():this[To].get(t)}addStore(t,o){var e;o=null!==(e=null!=o?o:Ao(t)?t.name:void 0)&&void 0!==e?e:"default-store",this.unsubscribeFromStore(o),this.setupStore(o,t)}removeStore(t){const o="string"==typeof t?t:t.name;this.unsubscribeFromStore(o),this[To].delete(o)}setupStore(t,o){this[To].set(t,o),this.subscribeToStore(t,o),this.updateFromStores()}setupStores(){this.unsubscribeFromStores(),this[To].forEach(((t,o)=>this.subscribeToStore(o,t))),this.updateFromStores()}updateFromStores(){this.reduxConstructor.reduxProperties.forEach(((t,o)=>{const e=this.constructor.getPropertyOptions(o);if(!(null==e?void 0:e.attribute)||!this.hasAttribute("string"==typeof(null==e?void 0:e.attribute)?e.attribute:o)){const e=this.getStore(t.store);e&&(t.store?this[jo].has(t.store):this[jo].size>0)&&(this[o]=t.selector(e.getState(),this))}}))}subscribeToStore(t,o){var e;this[jo].set(t,o.subscribe((()=>this.updateFromStores()))),Ao(o)&&o.eventBus&&(null===(e=this.reduxConstructor.reduxEventListeners)||void 0===e||e.forEach(((t,e)=>{if("function"==typeof this[e]&&(!t.store||o.name===t.store)){const i=t=>this[e](t);o.eventBus.addEventListener(t.eventName,i),this[Ho].push((()=>o.eventBus.removeEventListener(t.eventName,i)))}}))),this.onStoreAvailable(t)}unsubscribeFromStores(){this[jo].forEach(((t,o)=>this.unsubscribeFromStore(o))),this[Ho].forEach((t=>t())),this[Ho]=[]}unsubscribeFromStore(t){this[jo].has(t)&&this[jo].get(t)(),this[jo].delete(t)}onStoreAvailable(t){}connectedCallback(){super.connectedCallback(),this.setupStores()}disconnectedCallback(){super.disconnectedCallback(),this.unsubscribeFromStores()}}Mo=jo,Do=To,Po=Ho,_o.reduxProperties=new Map,_o.reduxReactiveProperties=new Set,_o.reduxEventListeners=new Map,window.ftReduxStores||(window.ftReduxStores={});const Go=Symbol("elementInternals");var Yo,Vo,Jo;const qo=navigator.vendor&&!!navigator.vendor.match(/apple/i)||"[object SafariRemoteNotification]"===(null!==(Jo=null===(Vo=null===(Yo=window.safari)||void 0===Yo?void 0:Yo.pushNotification)||void 0===Vo?void 0:Vo.toString())&&void 0!==Jo?Jo:""),Xo=mt`
127
127
  :host {
128
128
  display: inline-block;
129
129
  }
@@ -1110,4 +1110,4 @@ class Gr extends zr{constructor(t){if(super(t),this.et=Q,t.type!==Lr)throw Error
1110
1110
  display: none !important;
1111
1111
  }
1112
1112
  </style>
1113
- `}get valueText(){var t,o;return null!==(o=null===(t=this.metadata)||void 0===t?void 0:t.values.join(", "))&&void 0!==o?o:""}get tooltipText(){var t,o;return this.metadata?`${null!==(o=null===(t=this.metadata)||void 0===t?void 0:t.label)&&void 0!==o?o:this.metadata.key}: ${this.valueText}`:""}}Wn.elementDefinitions={"ft-tooltip":Ur,"ft-chip":In},Wn.styles=Xo,Ln([w(),(t,o)=>{const e=t;e.reduxReactiveProperties=e.reduxReactiveProperties||[],e.reduxReactiveProperties.push(o)}],Wn.prototype,"key",void 0),Ln([w({attribute:!1})],Wn.prototype,"editorMode",void 0),Ln([(t=>{const o=null!=t?t:{};return(t,e)=>{var i;const r={hasChanged:(t,o)=>!U(t,o),attribute:!1,...o};w(r)(t,e);const n=t;n.reduxProperties=n.reduxProperties||new Map,n.reduxProperties.set(e,{selector:null!==(i=o.selector)&&void 0!==i?i:t=>t[e],store:o.store})}})({selector:(t,o)=>{var e,i;return null===(i=null===(e=t.map)||void 0===e?void 0:e.metadata)||void 0===i?void 0:i.find((t=>t.key===o.key))}})],Wn.prototype,"metadata",void 0),I("ft-reader-metadata")(Wn),t.FtReaderMetadata=Wn,t.FtReaderMetadataCssVariables={},t.styles=Xo}({});
1113
+ `}get valueText(){var t,o;return null!==(o=null===(t=this.metadata)||void 0===t?void 0:t.values.join(", "))&&void 0!==o?o:""}get tooltipText(){var t,o;return this.metadata?`${null!==(o=null===(t=this.metadata)||void 0===t?void 0:t.label)&&void 0!==o?o:this.metadata.key}: ${this.valueText}`:""}}Wn.elementDefinitions={"ft-tooltip":Ur,"ft-chip":In},Wn.styles=Xo,Ln([w(),(t,o)=>{var e;const i=t.constructor;i.reduxReactiveProperties=new Set(i.reduxReactiveProperties),null===(e=i.reduxReactiveProperties)||void 0===e||e.add(o)}],Wn.prototype,"key",void 0),Ln([w({attribute:!1})],Wn.prototype,"editorMode",void 0),Ln([(t=>{const o=null!=t?t:{};return(t,e)=>{var i;const r={hasChanged:(t,o)=>!U(t,o),attribute:!1,...o};w(r)(t,e);const n=t.constructor;n.reduxProperties=new Map(n.reduxProperties),n.reduxProperties.set(e,{selector:null!==(i=o.selector)&&void 0!==i?i:t=>t[e],store:o.store})}})({selector:(t,o)=>{var e,i;return null===(i=null===(e=t.map)||void 0===e?void 0:e.metadata)||void 0===i?void 0:i.find((t=>t.key===o.key))}})],Wn.prototype,"metadata",void 0),I("ft-reader-metadata")(Wn),t.FtReaderMetadata=Wn,t.FtReaderMetadataCssVariables={},t.styles=Xo}({});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluid-topics/ft-reader-metadata",
3
- "version": "1.1.7",
3
+ "version": "1.1.8",
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.1.7",
23
- "@fluid-topics/ft-reader-context": "1.1.7",
24
- "@fluid-topics/ft-tooltip": "1.1.7",
25
- "@fluid-topics/ft-wc-utils": "1.1.7",
22
+ "@fluid-topics/ft-chip": "1.1.8",
23
+ "@fluid-topics/ft-reader-context": "1.1.8",
24
+ "@fluid-topics/ft-tooltip": "1.1.8",
25
+ "@fluid-topics/ft-wc-utils": "1.1.8",
26
26
  "lit": "3.1.0"
27
27
  },
28
- "gitHead": "732f43d1a665d4917e01d0e34665779782fdd3c9"
28
+ "gitHead": "95fb2d06899d700513970ac830958922b98539df"
29
29
  }