@fluid-topics/ft-reader-context 1.4.4 → 2.0.0
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.
- package/build/define.d.ts +1 -0
- package/build/define.js +3 -0
- package/build/ft-reader-context.js +3 -4
- package/build/ft-reader-context.light.js +6 -6
- package/build/ft-reader-context.min.js +17 -17
- package/build/index.js +0 -3
- package/build/store/FtReaderStateManager.js +1 -1
- package/build/store/redux.d.ts +0 -2
- package/build/store/redux.js +0 -3
- package/build/store/utils/FtReaderConverter.js +15 -15
- package/package.json +29 -29
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/build/define.js
ADDED
|
@@ -6,13 +6,12 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
6
6
|
};
|
|
7
7
|
import { html, nothing } from "lit";
|
|
8
8
|
import { property } from "lit/decorators.js";
|
|
9
|
-
import { Debouncer, FtLitElementRedux, redux } from "@fluid-topics/ft-wc-utils";
|
|
9
|
+
import { Debouncer, FtLitElementRedux, numberProperty, randomId, redux } from "@fluid-topics/ft-wc-utils";
|
|
10
10
|
import { FtReaderStateManager } from "./store/FtReaderStateManager";
|
|
11
11
|
import { styles } from "./ft-reader-context.styles";
|
|
12
12
|
import { AuthenticationChangeEvent, ftAppInfoStore, userAssetsActions } from "@fluid-topics/ft-app-context";
|
|
13
13
|
import { ForbiddenErrorEvent, LoadErrorEvent, MapLoadedEvent, NavigationDoneEvent, NotFoundErrorEvent, TopicRelativeNotFoundEvent, UnauthorizedErrorEvent, VisibleTopicsChangeEvent } from "./models";
|
|
14
14
|
import { ReaderService } from "./services/ReaderService";
|
|
15
|
-
const fromNumberAttribute = (defaultValue) => (value) => +(value !== null && value !== void 0 ? value : "NaN") > 0 ? +value : defaultValue;
|
|
16
15
|
class FtReaderContext extends FtLitElementRedux {
|
|
17
16
|
constructor() {
|
|
18
17
|
super();
|
|
@@ -45,7 +44,7 @@ class FtReaderContext extends FtLitElementRedux {
|
|
|
45
44
|
}
|
|
46
45
|
get stateManager() {
|
|
47
46
|
if (this._stateManager == null) {
|
|
48
|
-
this._stateManager = FtReaderStateManager.build(this.id || (
|
|
47
|
+
this._stateManager = FtReaderStateManager.build(this.id || randomId(6), this.readerServiceProvider);
|
|
49
48
|
this._stateManager.errorHandler = (e) => this.handleLoadError(e);
|
|
50
49
|
this.addStore(this.stateManager.store, "reader");
|
|
51
50
|
}
|
|
@@ -216,7 +215,7 @@ __decorate([
|
|
|
216
215
|
property()
|
|
217
216
|
], FtReaderContext.prototype, "searchInDocumentQuery", void 0);
|
|
218
217
|
__decorate([
|
|
219
|
-
|
|
218
|
+
numberProperty({ min: 1 })
|
|
220
219
|
], FtReaderContext.prototype, "page", void 0);
|
|
221
220
|
__decorate([
|
|
222
221
|
redux({ store: "reader" })
|