@fluid-topics/ft-reader-page-title 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.
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { nothing } from "lit";
|
|
2
2
|
import { ElementDefinitionsMap } from "@fluid-topics/ft-wc-utils";
|
|
3
3
|
import { FtReaderPageTitleProperties, FtReaderPageTitleTarget } from "./ft-reader-page-title.properties";
|
|
4
|
-
import { PropertyValues } from "lit
|
|
4
|
+
import { PropertyValues } from "lit";
|
|
5
5
|
import { FtReaderComponent } from "@fluid-topics/ft-reader-context/build/registration";
|
|
6
6
|
declare const FtReaderPageTitle_base: typeof FtReaderComponent & import("@fluid-topics/ft-wc-utils").Constructor<import("@fluid-topics/ft-i18n").FtLitElementWithI18nInterface>;
|
|
7
7
|
export declare class FtReaderPageTitle extends FtReaderPageTitle_base implements FtReaderPageTitleProperties {
|
|
@@ -33,7 +33,7 @@ class FtReaderPageTitle extends withI18n(FtReaderComponent) {
|
|
|
33
33
|
const offset = this.computeOffset(this.target);
|
|
34
34
|
if (this.currentPage && offset != 0) {
|
|
35
35
|
const targetPageNumber = this.currentPage.number + offset;
|
|
36
|
-
(_a = this.
|
|
36
|
+
(_a = this.stateManager) === null || _a === void 0 ? void 0 : _a.getPage(targetPageNumber).then(page => {
|
|
37
37
|
if (page.number == targetPageNumber) {
|
|
38
38
|
this.targetPage = page;
|
|
39
39
|
}
|
|
@@ -121,7 +121,7 @@ Also for action icons.`,a.colorGray200),contentGlobalSubtle:e.extend("--ft-conte
|
|
|
121
121
|
<span class="ft-i18n">
|
|
122
122
|
${this.i18n(this.context,this.key,...Array.isArray(this.args)?this.args:[])}
|
|
123
123
|
</span>
|
|
124
|
-
`}update(t){var o;super.update(t),["context","key","defaultMessage"].some(n=>t.has(n))&&this.context&&this.key&&this.addI18nMessages(this.context,{[this.key]:(o=this.defaultMessage)!==null&&o!==void 0?o:""})}};G.elementDefinitions={};G.styles=Vn;Ye([(0,Rt.redux)()],G.prototype,"editorMode",void 0);Ye([(0,At.property)()],G.prototype,"context",void 0);Ye([(0,At.property)()],G.prototype,"key",void 0);Ye([(0,Rt.jsonProperty)([])],G.prototype,"args",void 0);Ye([(0,At.property)()],G.prototype,"defaultMessage",void 0);var kt=class r{static build(t){return new r(t)}static fromGwt(t){return new r(t)}constructor(t){this.name=t,this.properties=new Proxy({},{get:(o,n)=>{let i=n;return c=>({context:this.name,key:i,args:typeof c=="function"?void 0:c,argsProvider:typeof c=="function"?c:void 0})}}),this.messages=new Proxy({},{get:(o,n)=>(...i)=>ue.resolveMessage(this.name,n,...i)}),this.rawMessages=new Proxy({},{get:(o,n)=>ue.resolveRawMessage(this.name,n)})}};(0,Xn.customElement)("ft-i18n")(G);var Ar=kt.build("readerPageTitle"),Jn={pageTitle:"Page title"};var Pt=function(r,t,o,n){var i=arguments.length,c=i<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,o):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")c=Reflect.decorate(r,t,o,n);else for(var d=r.length-1;d>=0;d--)(s=r[d])&&(c=(i<3?s(c):i>3?s(t,o,c):s(t,o))||c);return i>3&&c&&Object.defineProperty(t,o,c),c},j=class extends It(Xe){constructor(){super(),this.target="current",this.editorMode=!1,this.addStore(S),this.addI18nContext(Ar,Jn)}render(){var t,o;let n=(o=(t=this.targetPage)===null||t===void 0?void 0:t.title)!==null&&o!==void 0?o:this.editorMode?Ar.messages.pageTitle():void 0;return n?Lt.html`<ft-typography variant="title" part="text">${n}</ft-typography>`:Lt.nothing}update(t){var o;if(super.update(t),t.has("currentPage")||t.has("target")){let n=this.computeOffset(this.target);if(this.currentPage&&n!=0){let i=this.currentPage.number+n;(o=this.
|
|
124
|
+
`}update(t){var o;super.update(t),["context","key","defaultMessage"].some(n=>t.has(n))&&this.context&&this.key&&this.addI18nMessages(this.context,{[this.key]:(o=this.defaultMessage)!==null&&o!==void 0?o:""})}};G.elementDefinitions={};G.styles=Vn;Ye([(0,Rt.redux)()],G.prototype,"editorMode",void 0);Ye([(0,At.property)()],G.prototype,"context",void 0);Ye([(0,At.property)()],G.prototype,"key",void 0);Ye([(0,Rt.jsonProperty)([])],G.prototype,"args",void 0);Ye([(0,At.property)()],G.prototype,"defaultMessage",void 0);var kt=class r{static build(t){return new r(t)}static fromGwt(t){return new r(t)}constructor(t){this.name=t,this.properties=new Proxy({},{get:(o,n)=>{let i=n;return c=>({context:this.name,key:i,args:typeof c=="function"?void 0:c,argsProvider:typeof c=="function"?c:void 0})}}),this.messages=new Proxy({},{get:(o,n)=>(...i)=>ue.resolveMessage(this.name,n,...i)}),this.rawMessages=new Proxy({},{get:(o,n)=>ue.resolveRawMessage(this.name,n)})}};(0,Xn.customElement)("ft-i18n")(G);var Ar=kt.build("readerPageTitle"),Jn={pageTitle:"Page title"};var Pt=function(r,t,o,n){var i=arguments.length,c=i<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,o):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")c=Reflect.decorate(r,t,o,n);else for(var d=r.length-1;d>=0;d--)(s=r[d])&&(c=(i<3?s(c):i>3?s(t,o,c):s(t,o))||c);return i>3&&c&&Object.defineProperty(t,o,c),c},j=class extends It(Xe){constructor(){super(),this.target="current",this.editorMode=!1,this.addStore(S),this.addI18nContext(Ar,Jn)}render(){var t,o;let n=(o=(t=this.targetPage)===null||t===void 0?void 0:t.title)!==null&&o!==void 0?o:this.editorMode?Ar.messages.pageTitle():void 0;return n?Lt.html`<ft-typography variant="title" part="text">${n}</ft-typography>`:Lt.nothing}update(t){var o;if(super.update(t),t.has("currentPage")||t.has("target")){let n=this.computeOffset(this.target);if(this.currentPage&&n!=0){let i=this.currentPage.number+n;(o=this.stateManager)===null||o===void 0||o.getPage(i).then(c=>{c.number==i?this.targetPage=c:this.targetPage=void 0})}else this.targetPage=this.currentPage}}computeOffset(t){switch(t){case"next":return 1;case"previous":return-1;default:return 0}}};j.styles=_r;j.elementDefinitions={"ft-typography":q};Pt([(0,Wt.property)()],j.prototype,"target",void 0);Pt([(0,Rr.redux)({store:"reader"})],j.prototype,"currentPage",void 0);Pt([(0,Wt.state)()],j.prototype,"targetPage",void 0);Pt([(0,Rr.redux)({store:S.name})],j.prototype,"editorMode",void 0);(0,Qn.customElement)("ft-reader-page-title")(j);})();
|
|
125
125
|
/*! Bundled license information:
|
|
126
126
|
|
|
127
127
|
lit-html/lit-html.js:
|