@prose-reader/core 1.275.0 → 1.276.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/dist/enhancers/layout/createPlaceholderPages.d.ts +2 -4
- package/dist/enhancers/pagination/chapters/index.d.ts +4 -0
- package/dist/enhancers/pagination/chapters/node.d.ts +10 -0
- package/dist/enhancers/pagination/chapters/shared.d.ts +14 -0
- package/dist/enhancers/pagination/chapters/static.d.ts +6 -0
- package/dist/enhancers/pagination/chapters/types.d.ts +29 -0
- package/dist/enhancers/pagination/progression.d.ts +2 -1
- package/dist/enhancers/pagination/trackPaginationInfo.d.ts +25 -0
- package/dist/enhancers/pagination/trackPaginationInfo.test.d.ts +1 -0
- package/dist/index.js +2552 -2327
- package/dist/index.js.map +1 -1
- package/dist/index.umd.cjs +23 -23
- package/dist/index.umd.cjs.map +1 -1
- package/dist/settings/SettingsInterface.d.ts +1 -1
- package/dist/spine/Pages.d.ts +8 -5
- package/dist/spine/Spine.d.ts +2 -4
- package/package.json +4 -4
- package/dist/enhancers/pagination/chapters.d.ts +0 -26
- package/dist/enhancers/pagination/pagination.d.ts +0 -11
- package/dist/enhancers/pagination/spine.d.ts +0 -6
- /package/dist/enhancers/pagination/{chapters.test.d.ts → chapters/chapters.test.d.ts} +0 -0
- /package/dist/enhancers/pagination/{pagination.test.d.ts → chapters/node.test.d.ts} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Observable } from 'rxjs';
|
|
2
2
|
import { Reader } from '../../reader';
|
|
3
3
|
import { Theme } from '../theme';
|
|
4
|
-
import { SpineItemState,
|
|
4
|
+
import { SpineItemState, PagesState } from '../..';
|
|
5
5
|
export declare const HTML_PREFIX = "prose-reader-enhancer-loading";
|
|
6
6
|
export declare const CONTAINER_HTML_PREFIX = "prose-reader-enhancer-loading-container";
|
|
7
7
|
export declare const createPlaceholderPages: (reader: Reader & {
|
|
@@ -10,6 +10,4 @@ export declare const createPlaceholderPages: (reader: Reader & {
|
|
|
10
10
|
theme$: Observable<Theme>;
|
|
11
11
|
};
|
|
12
12
|
};
|
|
13
|
-
}) => Observable< SpineItemState | [
|
|
14
|
-
pages: PageEntry[];
|
|
15
|
-
}, Theme]>;
|
|
13
|
+
}) => Observable< SpineItemState | [ PagesState, Theme]>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { resolveChapterInfoFromVisibleNode } from './node';
|
|
2
|
+
export { buildTocCandidatesBySpineHref, buildTocIndex } from './shared';
|
|
3
|
+
export { buildChaptersInfo, buildStaticChaptersInfo } from './static';
|
|
4
|
+
export type { ChapterInfo, TocCandidatesBySpineHref, TocIndex } from './types';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { PageEntry } from '../../../spine/Pages';
|
|
2
|
+
import { SpineItem } from '../../../spineItem/SpineItem';
|
|
3
|
+
import { ChapterInfo, FlatTocEntry } from './types';
|
|
4
|
+
export declare const resolveChapterInfoFromVisibleNode: ({ node, offset, candidates, spineItem, nextPageEntry, }: {
|
|
5
|
+
candidates: FlatTocEntry[];
|
|
6
|
+
node: Node | undefined;
|
|
7
|
+
offset: number | undefined;
|
|
8
|
+
spineItem: SpineItem;
|
|
9
|
+
nextPageEntry: PageEntry | undefined;
|
|
10
|
+
}) => ChapterInfo | undefined;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Manifest } from '@prose-reader/shared';
|
|
2
|
+
import { ChapterInfo, FlatTocEntry, TocCandidatesBySpineHref, TocPathEntry } from './types';
|
|
3
|
+
type Toc = NonNullable<Manifest["nav"]>["toc"];
|
|
4
|
+
export declare const stripAnchor: (value: string) => string;
|
|
5
|
+
export declare const safeDecode: (value: string) => string;
|
|
6
|
+
export declare const buildTocIndex: (toc: Toc, manifest: Manifest) => FlatTocEntry[];
|
|
7
|
+
export declare const buildTocCandidatesBySpineHref: ({ manifest, tocIndex, }: {
|
|
8
|
+
manifest: Manifest;
|
|
9
|
+
tocIndex: FlatTocEntry[];
|
|
10
|
+
}) => TocCandidatesBySpineHref;
|
|
11
|
+
export declare const hrefMatches: (a: string, b: string) => boolean;
|
|
12
|
+
export declare const isPossibleTocItemCandidateForHref: (hrefWithoutAnchor: string, tocItemHrefWithoutAnchor: string) => boolean;
|
|
13
|
+
export declare const buildChapterInfoFromChain: (chain: TocPathEntry[]) => ChapterInfo | undefined;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Manifest } from '@prose-reader/shared';
|
|
2
|
+
import { ChapterInfo, TocIndex } from './types';
|
|
3
|
+
export declare const buildChaptersInfo: (href: string, tocItem: NonNullable<Manifest["nav"]>["toc"], manifest: Manifest) => ChapterInfo | undefined;
|
|
4
|
+
export declare const buildStaticChaptersInfo: (manifest: Manifest, tocIndex: TocIndex) => {
|
|
5
|
+
[key: string]: ChapterInfo | undefined;
|
|
6
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export type ChapterInfo = {
|
|
2
|
+
title: string;
|
|
3
|
+
subChapter?: {
|
|
4
|
+
title: string;
|
|
5
|
+
subChapter?: {
|
|
6
|
+
title: string;
|
|
7
|
+
subChapter?: {
|
|
8
|
+
title: string;
|
|
9
|
+
path: string;
|
|
10
|
+
};
|
|
11
|
+
path: string;
|
|
12
|
+
};
|
|
13
|
+
path: string;
|
|
14
|
+
};
|
|
15
|
+
path: string;
|
|
16
|
+
};
|
|
17
|
+
export type TocPathEntry = {
|
|
18
|
+
title: string;
|
|
19
|
+
path: string;
|
|
20
|
+
};
|
|
21
|
+
export type FlatTocEntry = {
|
|
22
|
+
chain: TocPathEntry[];
|
|
23
|
+
href: string;
|
|
24
|
+
hrefWithoutAnchor: string;
|
|
25
|
+
anchorId: string | undefined;
|
|
26
|
+
spineItemIndex: number;
|
|
27
|
+
};
|
|
28
|
+
export type TocIndex = FlatTocEntry[];
|
|
29
|
+
export type TocCandidatesBySpineHref = Map<string, FlatTocEntry[]>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Manifest } from '@prose-reader/shared';
|
|
1
2
|
import { Reader } from '../../reader';
|
|
2
3
|
import { SpineItem } from '../../spineItem/SpineItem';
|
|
3
4
|
import { LayoutEnhancerOutput } from '../layout/layoutEnhancer';
|
|
@@ -5,4 +6,4 @@ import { Observable } from 'rxjs';
|
|
|
5
6
|
export declare const getPercentageEstimate: (reader: Reader & LayoutEnhancerOutput, currentSpineIndex: number, pageIndex: number, currentPosition: {
|
|
6
7
|
x: number;
|
|
7
8
|
y: number;
|
|
8
|
-
}, currentItem: SpineItem) => Observable<number>;
|
|
9
|
+
}, currentItem: SpineItem, manifest: Manifest) => Observable<number>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Reader } from '../../reader';
|
|
2
|
+
import { LayoutEnhancerOutput } from '../layout/layoutEnhancer';
|
|
3
|
+
import { Observable } from 'rxjs';
|
|
4
|
+
import { ChapterInfo } from './chapters';
|
|
5
|
+
export declare const trackPaginationInfo: (reader: Reader & LayoutEnhancerOutput) => Observable<{
|
|
6
|
+
percentageEstimateOfBook: number;
|
|
7
|
+
numberOfPagesPerItems: number[];
|
|
8
|
+
numberOfTotalPages: number;
|
|
9
|
+
isUsingSpread: boolean;
|
|
10
|
+
beginChapterInfo: ChapterInfo | undefined;
|
|
11
|
+
beginSpineItemReadingDirection: "ltr" | "rtl" | undefined;
|
|
12
|
+
beginAbsolutePageIndex: number | undefined;
|
|
13
|
+
endChapterInfo: ChapterInfo | undefined;
|
|
14
|
+
endSpineItemReadingDirection: "ltr" | "rtl" | undefined;
|
|
15
|
+
endAbsolutePageIndex: number | undefined;
|
|
16
|
+
beginPageIndexInSpineItem: number | undefined;
|
|
17
|
+
beginNumberOfPagesInSpineItem: number;
|
|
18
|
+
beginCfi: string | undefined;
|
|
19
|
+
beginSpineItemIndex: number | undefined;
|
|
20
|
+
endPageIndexInSpineItem: number | undefined;
|
|
21
|
+
endNumberOfPagesInSpineItem: number;
|
|
22
|
+
endCfi: string | undefined;
|
|
23
|
+
endSpineItemIndex: number | undefined;
|
|
24
|
+
navigationId?: symbol;
|
|
25
|
+
}>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|