@fluid-topics/ft-reader-content 0.3.54 → 0.3.56
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,6 +1,7 @@
|
|
|
1
1
|
import { nothing, TemplateResult } from "lit";
|
|
2
2
|
import { ElementDefinitionsMap } from "@fluid-topics/ft-wc-utils";
|
|
3
3
|
import { FtReaderComponent } from "@fluid-topics/ft-reader-context/build/registration";
|
|
4
|
+
import { FtReaderPage, FtReaderScrollTarget } from "@fluid-topics/ft-reader-context/build/store/model";
|
|
4
5
|
import { FtReaderContentProperties } from "./ft-reader-content.properties";
|
|
5
6
|
import "@fluid-topics/ft-reader-topic-context";
|
|
6
7
|
export declare class FtReaderContent extends FtReaderComponent implements FtReaderContentProperties {
|
|
@@ -8,12 +9,12 @@ export declare class FtReaderContent extends FtReaderComponent implements FtRead
|
|
|
8
9
|
static styles: import("lit").CSSResult;
|
|
9
10
|
renderTopic: (tocId: any, index: number) => TemplateResult | string;
|
|
10
11
|
disableContextInteractions: boolean;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
currentPage?: FtReaderPage;
|
|
13
|
+
scrollTarget?: FtReaderScrollTarget;
|
|
14
|
+
visibleTopics?: string[];
|
|
15
|
+
renderBeforeFirst: number;
|
|
16
|
+
renderAfterLast: number;
|
|
17
|
+
container: HTMLDivElement;
|
|
17
18
|
protected render(): typeof nothing | TemplateResult<1>;
|
|
18
19
|
private renderTopicInContext;
|
|
19
20
|
private getScrollTarget;
|
|
@@ -94,10 +94,10 @@ __decorate([
|
|
|
94
94
|
redux()
|
|
95
95
|
], FtReaderContent.prototype, "visibleTopics", void 0);
|
|
96
96
|
__decorate([
|
|
97
|
-
redux()
|
|
97
|
+
redux((state) => { var _a, _b; return (_b = (_a = state.configuration) === null || _a === void 0 ? void 0 : _a.loadBeforeFirstVisibleTopic) !== null && _b !== void 0 ? _b : 5; })
|
|
98
98
|
], FtReaderContent.prototype, "renderBeforeFirst", void 0);
|
|
99
99
|
__decorate([
|
|
100
|
-
redux()
|
|
100
|
+
redux((state) => { var _a, _b; return (_b = (_a = state.configuration) === null || _a === void 0 ? void 0 : _a.loadAfterLastVisibleTopic) !== null && _b !== void 0 ? _b : 5; })
|
|
101
101
|
], FtReaderContent.prototype, "renderAfterLast", void 0);
|
|
102
102
|
__decorate([
|
|
103
103
|
query(".ft-reader-content")
|
|
@@ -75,4 +75,4 @@
|
|
|
75
75
|
<ft-reader-topic-context tocId="${t}" ?disableContextInteractions=${this.disableContextInteractions}>
|
|
76
76
|
${this.renderTopic(t,e)}
|
|
77
77
|
</ft-reader-topic-context>
|
|
78
|
-
`}getScrollTarget(){var t,e,i,s,r;if(this.disableContextInteractions)return null;const n=null!==(s=null===(t=this.visibleTopics)||void 0===t?void 0:t.includes(null!==(i=null===(e=this.scrollTarget)||void 0===e?void 0:e.tocId)&&void 0!==i?i:""))&&void 0!==s&&s;return!(null===(r=this.scrollTarget)||void 0===r?void 0:r.tocId)||n&&null!=this.scrollTarget.section?null:this.scrollTarget.tocId}visibleTopicChange(t){this.disableContextInteractions||this.visibleTopicsDebouncer.run((()=>{var e;return null===(e=this.stateManager)||void 0===e?void 0:e.setVisibleTopics(t.detail.visibleItems)}))}onScrollDone(){var t,e;this.disableContextInteractions||null!=(null===(t=this.scrollTarget)||void 0===t?void 0:t.section)||null===(e=this.stateManager)||void 0===e||e.scrollDone()}}$.elementDefinitions={"ft-infinite-scroll":p},$.styles=f,w([s.property()],$.prototype,"renderTopic",void 0),w([s.property({type:Boolean})],$.prototype,"disableContextInteractions",void 0),w([e.redux()],$.prototype,"currentPage",void 0),w([e.redux()],$.prototype,"scrollTarget",void 0),w([e.redux()],$.prototype,"visibleTopics",void 0),w([e.redux()],$.prototype,"renderBeforeFirst",void 0),w([e.redux()],$.prototype,"renderAfterLast",void 0),w([s.query(".ft-reader-content")],$.prototype,"container",void 0),e.customElement("ft-reader-content")($),t.FtReaderContent=$,t.FtReaderContentCssVariables={},t.styles=f,Object.defineProperty(t,"t",{value:!0})}({},ftGlobals.wcUtils,ftGlobals.lit,ftGlobals.litDecorators,ftGlobals.litRepeat,ftGlobals.litUnsafeHTML);
|
|
78
|
+
`}getScrollTarget(){var t,e,i,s,r;if(this.disableContextInteractions)return null;const n=null!==(s=null===(t=this.visibleTopics)||void 0===t?void 0:t.includes(null!==(i=null===(e=this.scrollTarget)||void 0===e?void 0:e.tocId)&&void 0!==i?i:""))&&void 0!==s&&s;return!(null===(r=this.scrollTarget)||void 0===r?void 0:r.tocId)||n&&null!=this.scrollTarget.section?null:this.scrollTarget.tocId}visibleTopicChange(t){this.disableContextInteractions||this.visibleTopicsDebouncer.run((()=>{var e;return null===(e=this.stateManager)||void 0===e?void 0:e.setVisibleTopics(t.detail.visibleItems)}))}onScrollDone(){var t,e;this.disableContextInteractions||null!=(null===(t=this.scrollTarget)||void 0===t?void 0:t.section)||null===(e=this.stateManager)||void 0===e||e.scrollDone()}}$.elementDefinitions={"ft-infinite-scroll":p},$.styles=f,w([s.property()],$.prototype,"renderTopic",void 0),w([s.property({type:Boolean})],$.prototype,"disableContextInteractions",void 0),w([e.redux()],$.prototype,"currentPage",void 0),w([e.redux()],$.prototype,"scrollTarget",void 0),w([e.redux()],$.prototype,"visibleTopics",void 0),w([e.redux((t=>{var e,i;return null!==(i=null===(e=t.configuration)||void 0===e?void 0:e.loadBeforeFirstVisibleTopic)&&void 0!==i?i:5}))],$.prototype,"renderBeforeFirst",void 0),w([e.redux((t=>{var e,i;return null!==(i=null===(e=t.configuration)||void 0===e?void 0:e.loadAfterLastVisibleTopic)&&void 0!==i?i:5}))],$.prototype,"renderAfterLast",void 0),w([s.query(".ft-reader-content")],$.prototype,"container",void 0),e.customElement("ft-reader-content")($),t.FtReaderContent=$,t.FtReaderContentCssVariables={},t.styles=f,Object.defineProperty(t,"t",{value:!0})}({},ftGlobals.wcUtils,ftGlobals.lit,ftGlobals.litDecorators,ftGlobals.litRepeat,ftGlobals.litUnsafeHTML);
|
|
@@ -93,6 +93,17 @@ var ht,ut;class dt extends N{constructor(){super(...arguments),this.renderOption
|
|
|
93
93
|
-webkit-hyphens: auto;
|
|
94
94
|
hyphens: auto
|
|
95
95
|
}
|
|
96
|
+
`,v`
|
|
97
|
+
.ft-safari-ellipsis-fix {
|
|
98
|
+
margin-right: 0;
|
|
99
|
+
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.ft-safari-ellipsis-fix:after {
|
|
103
|
+
content: "\\0000a0";
|
|
104
|
+
display: inline-block;
|
|
105
|
+
width: 0;
|
|
106
|
+
}
|
|
96
107
|
`;const yt=t=>"object"==typeof t&&(0===Object.keys(t).length||"string"==typeof t.store||null!=t.selector||"function"==typeof t.hasChanged),xt=(t,e)=>{var i;const s=yt(t)?t:{};return e=null!==(i=null!=e?e:s.hasChanged)&&void 0!==i?i:(t,e)=>!a(t,e),(i,r)=>{var o;i.constructor.createProperty(r,{attribute:!1,hasChanged:e});const n=i;n.reduxProperties=n.reduxProperties||new Map;const l=null!==(o=yt(t)?s.selector:t)&&void 0!==o?o:t=>t[r];n.reduxProperties.set(r,{selector:l,store:s.store})}};class gt extends mt{constructor(){super(...arguments),this.internalStoresUnsubscribers=new Map,this.internalStores=new Map}getUnnamedStore(){if(this.internalStores.size>1)throw new Error("Cannot resolve unnamed store when multiple stores are configured.");return[...this.internalStores.values()][0]}get store(){return this.getUnnamedStore()}set store(t){this.unsubscribeFromStores(),this.internalStores.clear(),t&&this.addStore(t)}getStore(t){var e;return null==t?null!==(e=this.getUnnamedStore())&&void 0!==e?e:this.store:this.internalStores.get(t)}addStore(t,e){e=null!=e?e:wt(t)?t.name:"ft-lit-element-redux-default-store",this.unsubscribeFromStore(e),this.setupStore(e,t)}removeStore(t){const e="string"==typeof t?t:wt(t)?t.name:"ft-lit-element-redux-default-store";this.unsubscribeFromStore(e),this.internalStores.delete(e)}setupStore(t,e){this.internalStores.set(t,e),this.updateFromStores(),this.subscribeToStore(t,e)}setupStores(){this.unsubscribeFromStores(),0===this.internalStores.size&&null!=this.store?this.addStore(this.store):(this.updateFromStores(),this.internalStores.forEach(((t,e)=>this.subscribeToStore(e,t))))}updateFromStores(){this.reduxProperties&&this.reduxProperties.forEach(((t,e)=>{const i=this.getStore(t.store);i&&(this[e]=t.selector(i.getState(),this))}))}subscribeToStore(t,e){this.internalStoresUnsubscribers.set(t,e.subscribe((()=>this.updateFromStores()))),this.onStoreAvailable(t)}unsubscribeFromStores(){Object.keys(this.internalStoresUnsubscribers).forEach((t=>this.unsubscribeFromStore(t)))}unsubscribeFromStore(t){this.internalStoresUnsubscribers.has(t)&&this.internalStoresUnsubscribers.get(t)(),this.internalStoresUnsubscribers.delete(t)}onStoreAvailable(t){}connectedCallback(){super.connectedCallback(),this.setupStores()}disconnectedCallback(){this.unsubscribeFromStores(),super.disconnectedCallback()}}function wt(t){var e;return null===(e=t)||void 0===e?void 0:e.isFtReduxStore}var Ot,St;navigator.vendor&&navigator.vendor.match(/apple/i)||(null===(St=null===(Ot=window.safari)||void 0===Ot?void 0:Ot.pushNotification)||void 0===St||St.toString());var Ct=function(t,e,i,s){for(var r,o=arguments.length,n=o<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s,l=t.length-1;l>=0;l--)(r=t[l])&&(n=(o<3?r(n):o>3?r(e,i,n):r(e,i))||n);return o>3&&n&&Object.defineProperty(e,i,n),n};class $t extends Event{constructor(){super("register-ft-reader-component",{bubbles:!0,composed:!0})}}class Nt extends(function(t){class e extends t{constructor(){super(...arguments),this.registerIntervalReader=0}setReaderStateManager(t){this.clearStateManager(),this.stateManager=t,this.addStore(t.store)}clearStateManager(){this.stateManager&&(this.removeStore(this.stateManager.store),this.stateManager=void 0)}get service(){var t;return null===(t=this.stateManager)||void 0===t?void 0:t.service}connectedCallback(){super.connectedCallback(),this.registerIntervalReader=window.setInterval((()=>this.tryToRegisterToContext()),50)}tryToRegisterToContext(){null!=this.stateManager?window.clearInterval(this.registerIntervalReader):this.dispatchEvent(new $t)}disconnectedCallback(){super.disconnectedCallback(),this.clearStateManager()}}return Ct([r()],e.prototype,"stateManager",void 0),e}(gt)){}
|
|
97
108
|
/**
|
|
98
109
|
* @license
|
|
@@ -191,4 +202,4 @@ class Pt extends Mt{constructor(t){if(super(t),this.it=J,t.type!==Et)throw Error
|
|
|
191
202
|
<ft-reader-topic-context tocId="${t}" ?disableContextInteractions=${this.disableContextInteractions}>
|
|
192
203
|
${this.renderTopic(t,e)}
|
|
193
204
|
</ft-reader-topic-context>
|
|
194
|
-
`}getScrollTarget(){var t,e,i,s,r;if(this.disableContextInteractions)return null;const o=null!==(s=null===(t=this.visibleTopics)||void 0===t?void 0:t.includes(null!==(i=null===(e=this.scrollTarget)||void 0===e?void 0:e.tocId)&&void 0!==i?i:""))&&void 0!==s&&s;return!(null===(r=this.scrollTarget)||void 0===r?void 0:r.tocId)||o&&null!=this.scrollTarget.section?null:this.scrollTarget.tocId}visibleTopicChange(t){this.disableContextInteractions||this.visibleTopicsDebouncer.run((()=>{var e;return null===(e=this.stateManager)||void 0===e?void 0:e.setVisibleTopics(t.detail.visibleItems)}))}onScrollDone(){var t,e;this.disableContextInteractions||null!=(null===(t=this.scrollTarget)||void 0===t?void 0:t.section)||null===(e=this.stateManager)||void 0===e||e.scrollDone()}}Yt.elementDefinitions={"ft-infinite-scroll":zt},Yt.styles=Vt,Qt([s()],Yt.prototype,"renderTopic",void 0),Qt([s({type:Boolean})],Yt.prototype,"disableContextInteractions",void 0),Qt([xt()],Yt.prototype,"currentPage",void 0),Qt([xt()],Yt.prototype,"scrollTarget",void 0),Qt([xt()],Yt.prototype,"visibleTopics",void 0),Qt([xt()],Yt.prototype,"renderBeforeFirst",void 0),Qt([xt()],Yt.prototype,"renderAfterLast",void 0),Qt([o(".ft-reader-content")],Yt.prototype,"container",void 0),l("ft-reader-content")(Yt),t.FtReaderContent=Yt,t.FtReaderContentCssVariables={},t.styles=Vt,Object.defineProperty(t,"i",{value:!0})}({});
|
|
205
|
+
`}getScrollTarget(){var t,e,i,s,r;if(this.disableContextInteractions)return null;const o=null!==(s=null===(t=this.visibleTopics)||void 0===t?void 0:t.includes(null!==(i=null===(e=this.scrollTarget)||void 0===e?void 0:e.tocId)&&void 0!==i?i:""))&&void 0!==s&&s;return!(null===(r=this.scrollTarget)||void 0===r?void 0:r.tocId)||o&&null!=this.scrollTarget.section?null:this.scrollTarget.tocId}visibleTopicChange(t){this.disableContextInteractions||this.visibleTopicsDebouncer.run((()=>{var e;return null===(e=this.stateManager)||void 0===e?void 0:e.setVisibleTopics(t.detail.visibleItems)}))}onScrollDone(){var t,e;this.disableContextInteractions||null!=(null===(t=this.scrollTarget)||void 0===t?void 0:t.section)||null===(e=this.stateManager)||void 0===e||e.scrollDone()}}Yt.elementDefinitions={"ft-infinite-scroll":zt},Yt.styles=Vt,Qt([s()],Yt.prototype,"renderTopic",void 0),Qt([s({type:Boolean})],Yt.prototype,"disableContextInteractions",void 0),Qt([xt()],Yt.prototype,"currentPage",void 0),Qt([xt()],Yt.prototype,"scrollTarget",void 0),Qt([xt()],Yt.prototype,"visibleTopics",void 0),Qt([xt((t=>{var e,i;return null!==(i=null===(e=t.configuration)||void 0===e?void 0:e.loadBeforeFirstVisibleTopic)&&void 0!==i?i:5}))],Yt.prototype,"renderBeforeFirst",void 0),Qt([xt((t=>{var e,i;return null!==(i=null===(e=t.configuration)||void 0===e?void 0:e.loadAfterLastVisibleTopic)&&void 0!==i?i:5}))],Yt.prototype,"renderAfterLast",void 0),Qt([o(".ft-reader-content")],Yt.prototype,"container",void 0),l("ft-reader-content")(Yt),t.FtReaderContent=Yt,t.FtReaderContentCssVariables={},t.styles=Vt,Object.defineProperty(t,"i",{value:!0})}({});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluid-topics/ft-reader-content",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.56",
|
|
4
4
|
"description": "Main content for integrated reader",
|
|
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-infinite-scroll": "0.3.
|
|
23
|
-
"@fluid-topics/ft-reader-topic-content": "0.3.
|
|
24
|
-
"@fluid-topics/ft-reader-topic-context": "0.3.
|
|
25
|
-
"@fluid-topics/ft-reader-topic-title": "0.3.
|
|
26
|
-
"@fluid-topics/ft-wc-utils": "0.3.
|
|
22
|
+
"@fluid-topics/ft-infinite-scroll": "0.3.56",
|
|
23
|
+
"@fluid-topics/ft-reader-topic-content": "0.3.56",
|
|
24
|
+
"@fluid-topics/ft-reader-topic-context": "0.3.56",
|
|
25
|
+
"@fluid-topics/ft-reader-topic-title": "0.3.56",
|
|
26
|
+
"@fluid-topics/ft-wc-utils": "0.3.56",
|
|
27
27
|
"lit": "2.2.8"
|
|
28
28
|
},
|
|
29
|
-
"gitHead": "
|
|
29
|
+
"gitHead": "e86edee2b2660d806320bacca5c5156bb94ca2d6"
|
|
30
30
|
}
|