@fluid-topics/ft-reader-saved-bookmarks 1.3.24 → 1.3.25
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.
|
@@ -2,6 +2,7 @@ import { ElementDefinitionsMap } from "@fluid-topics/ft-wc-utils";
|
|
|
2
2
|
import { FtReaderSavedBookmarksProperties } from "./ft-reader-saved-bookmarks.properties";
|
|
3
3
|
import { FtReaderComponent, FtReaderState, FtReaderTocNode } from "@fluid-topics/ft-reader-context/build/registration";
|
|
4
4
|
import { FtBookmark } from "@fluid-topics/public-api";
|
|
5
|
+
import { FtUserAssetsState } from "@fluid-topics/ft-app-context";
|
|
5
6
|
declare const FtReaderSavedBookmarks_base: typeof FtReaderComponent & import("@fluid-topics/ft-wc-utils").Constructor<import("@fluid-topics/ft-i18n").FtLitElementWithI18nInterface>;
|
|
6
7
|
export declare class FtReaderSavedBookmarks extends FtReaderSavedBookmarks_base implements FtReaderSavedBookmarksProperties {
|
|
7
8
|
static elementDefinitions: ElementDefinitionsMap;
|
|
@@ -13,6 +14,7 @@ export declare class FtReaderSavedBookmarks extends FtReaderSavedBookmarks_base
|
|
|
13
14
|
constructor();
|
|
14
15
|
get bookmarksTocIds(): string[];
|
|
15
16
|
static flattenTocNode(node: FtReaderTocNode): string[];
|
|
17
|
+
static bookmarksFromMap(state: FtUserAssetsState, self: FtReaderSavedBookmarks): Array<FtBookmark>;
|
|
16
18
|
static filterRemainingTocIdsInBookmarks(s: FtReaderState, self: FtReaderSavedBookmarks): string[] | undefined;
|
|
17
19
|
render(): import("lit-html").TemplateResult<1>;
|
|
18
20
|
private isAbsentFromToc;
|
|
@@ -38,6 +38,10 @@ class FtReaderSavedBookmarks extends withI18n(FtReaderComponent) {
|
|
|
38
38
|
}
|
|
39
39
|
return ids;
|
|
40
40
|
}
|
|
41
|
+
static bookmarksFromMap(state, self) {
|
|
42
|
+
var _a, _b;
|
|
43
|
+
return (_b = (_a = state.bookmarks) === null || _a === void 0 ? void 0 : _a.filter((b) => b.mapId === self.mapId).sort((b1, b2) => b1.title.localeCompare(b2.title))) !== null && _b !== void 0 ? _b : [];
|
|
44
|
+
}
|
|
41
45
|
static filterRemainingTocIdsInBookmarks(s, self) {
|
|
42
46
|
var _a;
|
|
43
47
|
return (_a = s.toc) === null || _a === void 0 ? void 0 : _a.map((n) => FtReaderSavedBookmarks.flattenTocNode(n)).flat().filter((tocId) => self.bookmarksTocIds.indexOf(tocId) >= 0);
|
|
@@ -63,7 +67,8 @@ class FtReaderSavedBookmarks extends withI18n(FtReaderComponent) {
|
|
|
63
67
|
${bookmark.title}
|
|
64
68
|
</ft-typography>
|
|
65
69
|
${when(isAbsent, () => html `
|
|
66
|
-
<ft-tooltip text="${readerSavedBookmarksMessagesI18nMessageContext.messages.bookmarkMissingFromToc()}" delay="500"
|
|
70
|
+
<ft-tooltip text="${readerSavedBookmarksMessagesI18nMessageContext.messages.bookmarkMissingFromToc()}" delay="500"
|
|
71
|
+
position="bottom" aria-hidden>
|
|
67
72
|
<ft-icon value="${FtIcons.INFO}"></ft-icon>
|
|
68
73
|
</ft-tooltip>
|
|
69
74
|
`)}
|
|
@@ -91,7 +96,7 @@ __decorate([
|
|
|
91
96
|
__decorate([
|
|
92
97
|
redux({
|
|
93
98
|
store: ftUserAssetsStore.name,
|
|
94
|
-
selector:
|
|
99
|
+
selector: FtReaderSavedBookmarks.bookmarksFromMap,
|
|
95
100
|
})
|
|
96
101
|
], FtReaderSavedBookmarks.prototype, "bookmarks", void 0);
|
|
97
102
|
__decorate([
|