@fluid-topics/ft-reader-navigation-button 1.2.35 → 1.2.37

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.
@@ -30,7 +30,7 @@ class FtReaderNavigationButton extends FtReaderComponent {
30
30
  return this.target === "next" ? FtIcons.THIN_ARROW_RIGHT : FtIcons.THIN_ARROW_LEFT;
31
31
  }
32
32
  render() {
33
- var _a, _b, _c, _d, _e;
33
+ var _a, _b, _c, _d, _e, _f;
34
34
  if (this.targetPage == null && !this.editorMode) {
35
35
  return nothing;
36
36
  }
@@ -46,7 +46,9 @@ class FtReaderNavigationButton extends FtReaderComponent {
46
46
  </ft-button>
47
47
  `;
48
48
  return this.editorMode ? button : html `
49
- <ft-reader-internal-link .tocId=${(_e = this.targetPage) === null || _e === void 0 ? void 0 : _e.rootTocId} removestyle>
49
+ <ft-reader-internal-link removestyle
50
+ .tocId=${(_e = this.targetPage) === null || _e === void 0 ? void 0 : _e.rootTocId}
51
+ .pageNumber=${(_f = this.targetPage) === null || _f === void 0 ? void 0 : _f.number} >
50
52
  ${button}
51
53
  </ft-reader-internal-link>
52
54
  `;
@@ -79,7 +81,6 @@ FtReaderNavigationButton.elementDefinitions = {
79
81
  "ft-button": FtButton,
80
82
  "ft-reader-internal-link": FtReaderInternalLink
81
83
  };
82
- // language=CSS
83
84
  FtReaderNavigationButton.styles = styles;
84
85
  __decorate([
85
86
  property()
@@ -1075,7 +1075,7 @@ Also for action icons.`,r.colorGray200),contentGlobalSubtle:t.extend("--ft-conte
1075
1075
  @click=${i=>this.onLinkClick(i)}>
1076
1076
  <slot></slot>
1077
1077
  </a>
1078
- `}onLinkClick(o){var a;!o.ctrlKey&&!o.metaKey&&(o.stopPropagation(),o.preventDefault(),performance.mark(`fluid_topics__reader_link_click__${this.tocId}`),(a=this.stateManager)===null||a===void 0||a.navigateToTopic(this.tocId,this.section,this.pageNumber),this.click())}};rt.styles=Oo;We([(0,ue.property)()],rt.prototype,"tocId",void 0);We([(0,ue.property)()],rt.prototype,"section",void 0);We([(0,ue.property)({type:Number})],rt.prototype,"pageNumber",void 0);We([(0,ue.property)({type:Boolean})],rt.prototype,"removeStyle",void 0);(0,Ha.customElement)("ft-reader-internal-link")(rt);var dt=function(e,o,a,i){var c=arguments.length,l=c<3?o:i===null?i=Object.getOwnPropertyDescriptor(o,a):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(e,o,a,i);else for(var p=e.length-1;p>=0;p--)(s=e[p])&&(l=(c<3?s(l):c>3?s(o,a,l):s(o,a))||l);return c>3&&l&&Object.defineProperty(o,a,l),l},Z=class extends qt{constructor(){super(...arguments),this.target="next",this.tooltipPosition="bottom",this.hideTooltip=!1,this.trailingIcon=!1,this.editorMode=!1,this.isReady=!1,this.debouncer=new ke.Debouncer(10)}get defaultContent(){return this.target.substring(0,1).toUpperCase()+this.target.substring(1)}get defaultIcon(){return this.target==="next"?Bt.THIN_ARROW_RIGHT:Bt.THIN_ARROW_LEFT}render(){var o,a,i,c,l;if(this.targetPage==null&&!this.editorMode)return ge.nothing;let s=ge.html`
1078
+ `}onLinkClick(o){var a;!o.ctrlKey&&!o.metaKey&&(o.stopPropagation(),o.preventDefault(),performance.mark(`fluid_topics__reader_link_click__${this.tocId}`),(a=this.stateManager)===null||a===void 0||a.navigateToTopic(this.tocId,this.section,this.pageNumber),this.click())}};rt.styles=Oo;We([(0,ue.property)()],rt.prototype,"tocId",void 0);We([(0,ue.property)()],rt.prototype,"section",void 0);We([(0,ue.property)({type:Number})],rt.prototype,"pageNumber",void 0);We([(0,ue.property)({type:Boolean})],rt.prototype,"removeStyle",void 0);(0,Ha.customElement)("ft-reader-internal-link")(rt);var dt=function(e,o,a,i){var c=arguments.length,l=c<3?o:i===null?i=Object.getOwnPropertyDescriptor(o,a):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(e,o,a,i);else for(var p=e.length-1;p>=0;p--)(s=e[p])&&(l=(c<3?s(l):c>3?s(o,a,l):s(o,a))||l);return c>3&&l&&Object.defineProperty(o,a,l),l},Z=class extends qt{constructor(){super(...arguments),this.target="next",this.tooltipPosition="bottom",this.hideTooltip=!1,this.trailingIcon=!1,this.editorMode=!1,this.isReady=!1,this.debouncer=new ke.Debouncer(10)}get defaultContent(){return this.target.substring(0,1).toUpperCase()+this.target.substring(1)}get defaultIcon(){return this.target==="next"?Bt.THIN_ARROW_RIGHT:Bt.THIN_ARROW_LEFT}render(){var o,a,i,c,l,s;if(this.targetPage==null&&!this.editorMode)return ge.nothing;let p=ge.html`
1079
1079
  <ft-button ?forceTooltip=${!this.hideTooltip}
1080
1080
  ?hideTooltip=${this.hideTooltip}
1081
1081
  ?trailingIcon=${this.trailingIcon}
@@ -1085,9 +1085,11 @@ Also for action icons.`,r.colorGray200),contentGlobalSubtle:t.extend("--ft-conte
1085
1085
  .icon=${(i=this.icon)!==null&&i!==void 0?i:this.defaultIcon}>
1086
1086
  ${(c=this.content)!==null&&c!==void 0?c:this.defaultContent}
1087
1087
  </ft-button>
1088
- `;return this.editorMode?s:ge.html`
1089
- <ft-reader-internal-link .tocId=${(l=this.targetPage)===null||l===void 0?void 0:l.rootTocId} removestyle>
1090
- ${s}
1088
+ `;return this.editorMode?p:ge.html`
1089
+ <ft-reader-internal-link removestyle
1090
+ .tocId=${(l=this.targetPage)===null||l===void 0?void 0:l.rootTocId}
1091
+ .pageNumber=${(s=this.targetPage)===null||s===void 0?void 0:s.number} >
1092
+ ${p}
1091
1093
  </ft-reader-internal-link>
1092
1094
  `}update(o){super.update(o),o.has("currentPage")&&(this.targetPage=void 0,this.isReady=!1,this.debouncer.run(()=>this.updateTarget()))}async updateTarget(){var o,a;if(this.currentPage){let i=this.currentPage.number+(this.target==="next"?1:-1);this.targetPage=await((o=this.service)===null||o===void 0?void 0:o.getPage(i)),((a=this.targetPage)===null||a===void 0?void 0:a.number)!==i&&(this.targetPage=void 0)}else this.targetPage=void 0;this.isReady=!0}};Z.elementDefinitions={"ft-button":ot,"ft-reader-internal-link":rt};Z.styles=No;dt([(0,at.property)()],Z.prototype,"target",void 0);dt([(0,at.property)()],Z.prototype,"content",void 0);dt([(0,at.property)()],Z.prototype,"tooltipPosition",void 0);dt([(0,at.property)({type:Boolean})],Z.prototype,"hideTooltip",void 0);dt([(0,at.property)()],Z.prototype,"iconVariant",void 0);dt([(0,at.property)()],Z.prototype,"icon",void 0);dt([(0,at.property)({type:Boolean})],Z.prototype,"trailingIcon",void 0);dt([(0,at.property)({type:Boolean,attribute:!1})],Z.prototype,"editorMode",void 0);dt([(0,ke.redux)()],Z.prototype,"currentPage",void 0);dt([(0,at.state)()],Z.prototype,"targetPage",void 0);(0,_a.customElement)("ft-reader-navigation-button")(Z);})();
1093
1095
  /*! Bundled license information: