@fluid-topics/ft-reader-navigation-button 1.0.47 → 1.0.49

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,7 +94,7 @@ var dt,ft;let ut=class extends E{constructor(){super(...arguments),this.renderOp
94
94
  display: inline-block;
95
95
  width: 0;
96
96
  }
97
- `;var Et,Rt,Mt;const Ut=Symbol("internalReduxEventsUnsubscribers"),jt=Symbol("internalStoresUnsubscribers"),Ft=Symbol("internalStores");class zt extends kt{constructor(){super(...arguments),this[Et]=new Map,this[Rt]=new Map,this[Mt]=[]}updated(t){var e;super.updated(t),(null===(e=this.reduxReactiveProperties)||void 0===e?void 0:e.some((e=>t.has(e))))&&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,e){var i;e=null!==(i=null!=e?e:Bt(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[Ft].delete(e)}setupStore(t,e){this[Ft].set(t,e),this.subscribeToStore(t,e),this.updateFromStores()}setupStores(){this.unsubscribeFromStores(),this[Ft].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&&(t.store?this[jt].has(t.store):this[jt].size>0)&&(this[e]=t.selector(i.getState(),this))}}))}subscribeToStore(t,e){var i;this[jt].set(t,e.subscribe((()=>this.updateFromStores()))),Bt(e)&&e.eventBus&&(null===(i=this.reduxEventListeners)||void 0===i||i.forEach(((t,i)=>{if("function"==typeof this[i]&&(!t.store||e.name===t.store)){const o=t=>this[i](t);e.eventBus.addEventListener(t.eventName,o),this[Ut].push((()=>e.eventBus.removeEventListener(t.eventName,o)))}}))),this.onStoreAvailable(t)}unsubscribeFromStores(){this[jt].forEach(((t,e)=>this.unsubscribeFromStore(e))),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()}}function Bt(t){var e;return null!==(e=null==t?void 0:t.isFtReduxStore)&&void 0!==e&&e}var Tt,Pt,At;Et=jt,Rt=Ft,Mt=Ut;const Lt=navigator.vendor&&!!navigator.vendor.match(/apple/i)||"[object SafariRemoteNotification]"===(null!==(At=null===(Pt=null===(Tt=window.safari)||void 0===Tt?void 0:Tt.pushNotification)||void 0===Pt?void 0:Pt.toString())&&void 0!==At?At:""),It={outlineColor:bt.extend("--ft-reader-internal-link-outline-color",xt.colorPrimary)},_t=y`
97
+ `;function Et(t){var e;return null!==(e=null==t?void 0:t.isFtReduxStore)&&void 0!==e&&e}var Rt,Mt,Ut;const jt=Symbol("internalReduxEventsUnsubscribers"),Ft=Symbol("internalStoresUnsubscribers"),zt=Symbol("internalStores");class Bt extends kt{constructor(){super(...arguments),this[Rt]=new Map,this[Mt]=new Map,this[Ut]=[]}updated(t){var e;super.updated(t),(null===(e=this.reduxReactiveProperties)||void 0===e?void 0:e.some((e=>t.has(e))))&&this.updateFromStores()}getUnnamedStore(){if(this[zt].size>1)throw new Error("Cannot resolve unnamed store when multiple stores are configured.");return[...this[zt].values()][0]}getStore(t){return null==t?this.getUnnamedStore():this[zt].get(t)}addStore(t,e){var i;e=null!==(i=null!=e?e:Et(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[zt].delete(e)}setupStore(t,e){this[zt].set(t,e),this.subscribeToStore(t,e),this.updateFromStores()}setupStores(){this.unsubscribeFromStores(),this[zt].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&&(t.store?this[Ft].has(t.store):this[Ft].size>0)&&(this[e]=t.selector(i.getState(),this))}}))}subscribeToStore(t,e){var i;this[Ft].set(t,e.subscribe((()=>this.updateFromStores()))),Et(e)&&e.eventBus&&(null===(i=this.reduxEventListeners)||void 0===i||i.forEach(((t,i)=>{if("function"==typeof this[i]&&(!t.store||e.name===t.store)){const o=t=>this[i](t);e.eventBus.addEventListener(t.eventName,o),this[jt].push((()=>e.eventBus.removeEventListener(t.eventName,o)))}}))),this.onStoreAvailable(t)}unsubscribeFromStores(){this[Ft].forEach(((t,e)=>this.unsubscribeFromStore(e))),this[jt].forEach((t=>t())),this[jt]=[]}unsubscribeFromStore(t){this[Ft].has(t)&&this[Ft].get(t)(),this[Ft].delete(t)}onStoreAvailable(t){}connectedCallback(){super.connectedCallback(),this.setupStores()}disconnectedCallback(){super.disconnectedCallback(),this.unsubscribeFromStores()}}Rt=Ft,Mt=zt,Ut=jt,window.ftReduxStores||(window.ftReduxStores={});var Tt,Pt,At;const Lt=navigator.vendor&&!!navigator.vendor.match(/apple/i)||"[object SafariRemoteNotification]"===(null!==(At=null===(Pt=null===(Tt=window.safari)||void 0===Tt?void 0:Tt.pushNotification)||void 0===Pt?void 0:Pt.toString())&&void 0!==At?At:""),It={outlineColor:bt.extend("--ft-reader-internal-link-outline-color",xt.colorPrimary)},_t=y`
98
98
  :host {
99
99
  display: contents;
100
100
  }
@@ -687,7 +687,7 @@ class Ii extends Zt{constructor(t){if(super(t),this.et=Y,t.type!==Ht)throw Error
687
687
  </ft-tooltip>
688
688
  `:t}resolveIcon(){return this.loading?q`
689
689
  <ft-loader part="loader icon"></ft-loader> `:this.icon?q`
690
- <ft-icon part="icon" .variant="${this.iconVariant}" .value="${this.icon}"></ft-icon> `:Y}focus(){var t;null===(t=this.button)||void 0===t||t.focus()}getLabel(){return this.label||this.textContent}get textContent(){return this.unslotText(this.slottedContent).trim()}unslotText(t){return t instanceof HTMLSlotElement?t.assignedNodes().map((t=>this.unslotText(t))).join(""):(null==t?void 0:t.textContent)||""}hasTextContent(){return this.textContent.length>0}onSlotchange(){this.requestUpdate()}isDisabled(){return this.disabled||this.loading}}so.elementDefinitions={"ft-ripple":ne,"ft-tooltip":Ti,"ft-typography":Ni,"ft-icon":Ji,"ft-loader":Li},so.styles=[Nt,oo],no([o({type:String,reflect:!0})],so.prototype,"role",void 0),no([o({type:Boolean})],so.prototype,"primary",void 0),no([o({type:Boolean})],so.prototype,"outlined",void 0),no([o({type:Boolean})],so.prototype,"disabled",void 0),no([o({type:Boolean})],so.prototype,"dense",void 0),no([o({type:Boolean})],so.prototype,"round",void 0),no([o()],so.prototype,"label",void 0),no([o()],so.prototype,"icon",void 0),no([o()],so.prototype,"iconVariant",void 0),no([o({type:Boolean})],so.prototype,"trailingIcon",void 0),no([o({type:Boolean})],so.prototype,"loading",void 0),no([o()],so.prototype,"tooltipPosition",void 0),no([o({type:Boolean})],so.prototype,"hideTooltip",void 0),no([o({type:Boolean})],so.prototype,"forceTooltip",void 0),no([r(".ft-button")],so.prototype,"button",void 0),no([r(".ft-button--label slot")],so.prototype,"slottedContent",void 0),c("ft-button")(so);var ro=function(t,e,i,o){for(var n,s=arguments.length,r=s<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,a=t.length-1;a>=0;a--)(n=t[a])&&(r=(s<3?n(r):s>3?n(e,i,r):n(e,i))||r);return s>3&&r&&Object.defineProperty(e,i,r),r};class ao extends Event{constructor(){super("register-ft-reader-component",{bubbles:!0,composed:!0})}}const lo=Symbol("registerInterval");class ho 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[lo]=window.setInterval((()=>this.tryToRegisterToContext()),50)}tryToRegisterToContext(){null!=this.stateManager?window.clearInterval(this[lo]):this.dispatchEvent(new ao)}disconnectedCallback(){super.disconnectedCallback(),this.clearStateManager()}}return e=lo,ro([n()],i.prototype,"stateManager",void 0),i}(zt)){}var co=function(t,e,i,o){for(var n,s=arguments.length,r=s<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,a=t.length-1;a>=0;a--)(n=t[a])&&(r=(s<3?n(r):s>3?n(e,i,r):n(e,i))||r);return s>3&&r&&Object.defineProperty(e,i,r),r};class po extends ho{constructor(){super(...arguments),this.removeStyle=!1}render(){var t;let e=Vt({"ft-reader-link":!0,"ft-reader-link--remove-style":this.removeStyle});return q`
690
+ <ft-icon part="icon" .variant="${this.iconVariant}" .value="${this.icon}"></ft-icon> `:Y}focus(){var t;null===(t=this.button)||void 0===t||t.focus()}getLabel(){return this.label||this.textContent}get textContent(){return this.unslotText(this.slottedContent).trim()}unslotText(t){return t instanceof HTMLSlotElement?t.assignedNodes().map((t=>this.unslotText(t))).join(""):(null==t?void 0:t.textContent)||""}hasTextContent(){return this.textContent.length>0}onSlotchange(){this.requestUpdate()}isDisabled(){return this.disabled||this.loading}}so.elementDefinitions={"ft-ripple":ne,"ft-tooltip":Ti,"ft-typography":Ni,"ft-icon":Ji,"ft-loader":Li},so.styles=[Nt,oo],no([o({type:String,reflect:!0})],so.prototype,"role",void 0),no([o({type:Boolean})],so.prototype,"primary",void 0),no([o({type:Boolean})],so.prototype,"outlined",void 0),no([o({type:Boolean})],so.prototype,"disabled",void 0),no([o({type:Boolean})],so.prototype,"dense",void 0),no([o({type:Boolean})],so.prototype,"round",void 0),no([o()],so.prototype,"label",void 0),no([o()],so.prototype,"icon",void 0),no([o()],so.prototype,"iconVariant",void 0),no([o({type:Boolean})],so.prototype,"trailingIcon",void 0),no([o({type:Boolean})],so.prototype,"loading",void 0),no([o()],so.prototype,"tooltipPosition",void 0),no([o({type:Boolean})],so.prototype,"hideTooltip",void 0),no([o({type:Boolean})],so.prototype,"forceTooltip",void 0),no([r(".ft-button")],so.prototype,"button",void 0),no([r(".ft-button--label slot")],so.prototype,"slottedContent",void 0),c("ft-button")(so);var ro=function(t,e,i,o){for(var n,s=arguments.length,r=s<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,a=t.length-1;a>=0;a--)(n=t[a])&&(r=(s<3?n(r):s>3?n(e,i,r):n(e,i))||r);return s>3&&r&&Object.defineProperty(e,i,r),r};class ao extends Event{constructor(){super("register-ft-reader-component",{bubbles:!0,composed:!0})}}const lo=Symbol("registerInterval");class ho 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[lo]=window.setInterval((()=>this.tryToRegisterToContext()),50)}tryToRegisterToContext(){null!=this.stateManager?window.clearInterval(this[lo]):this.dispatchEvent(new ao)}disconnectedCallback(){super.disconnectedCallback(),this.clearStateManager()}}return e=lo,ro([n()],i.prototype,"stateManager",void 0),i}(Bt)){}var co=function(t,e,i,o){for(var n,s=arguments.length,r=s<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,a=t.length-1;a>=0;a--)(n=t[a])&&(r=(s<3?n(r):s>3?n(e,i,r):n(e,i))||r);return s>3&&r&&Object.defineProperty(e,i,r),r};class po extends ho{constructor(){super(...arguments),this.removeStyle=!1}render(){var t;let e=Vt({"ft-reader-link":!0,"ft-reader-link--remove-style":this.removeStyle});return q`
691
691
  <a class=${e}
692
692
  href="${null===(t=this.service)||void 0===t?void 0:t.getLink(this.tocId,this.pageNumber,this.section)}"
693
693
  @click=${t=>this.onLinkClick(t)}>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluid-topics/ft-reader-navigation-button",
3
- "version": "1.0.47",
3
+ "version": "1.0.49",
4
4
  "description": "Button used to navigate between pages in an integrated reader context.",
5
5
  "keywords": [
6
6
  "Lit"
@@ -19,12 +19,12 @@
19
19
  "url": "ssh://git@scm.mrs.antidot.net:2222/fluidtopics/ft-web-components.git"
20
20
  },
21
21
  "dependencies": {
22
- "@fluid-topics/ft-button": "1.0.47",
23
- "@fluid-topics/ft-reader-context": "1.0.47",
24
- "@fluid-topics/ft-reader-internal-link": "1.0.47",
25
- "@fluid-topics/ft-tooltip": "1.0.47",
26
- "@fluid-topics/ft-wc-utils": "1.0.47",
22
+ "@fluid-topics/ft-button": "1.0.49",
23
+ "@fluid-topics/ft-reader-context": "1.0.49",
24
+ "@fluid-topics/ft-reader-internal-link": "1.0.49",
25
+ "@fluid-topics/ft-tooltip": "1.0.49",
26
+ "@fluid-topics/ft-wc-utils": "1.0.49",
27
27
  "lit": "2.7.2"
28
28
  },
29
- "gitHead": "6313471d9f5ceea14a13311e9a6cc24b6fa6f044"
29
+ "gitHead": "77eac237aeec17a50f5bcc09890746d9a9f097f0"
30
30
  }