@prose-reader/core 1.216.0 → 1.218.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/createReaderWithEnhancer.d.ts +30 -30
- package/dist/enhancers/fonts/SettingsManager.d.ts +6 -6
- package/dist/enhancers/fonts/fonts.d.ts +4 -4
- package/dist/enhancers/fonts/index.d.ts +2 -0
- package/dist/enhancers/fonts/types.d.ts +1 -1
- package/dist/enhancers/layout/SettingsManager.d.ts +6 -6
- package/dist/enhancers/layout/layoutEnhancer.d.ts +3 -3
- package/dist/enhancers/layout/types.d.ts +2 -2
- package/dist/index.d.ts +19 -0
- package/dist/index.js +86 -69
- package/dist/index.js.map +1 -1
- package/dist/index.umd.cjs +25 -25
- package/dist/index.umd.cjs.map +1 -1
- package/dist/navigation/Navigator.d.ts +6 -6
- package/dist/navigation/consolidation/consolidateWithPagination.d.ts +1 -1
- package/dist/navigation/resolvers/getNavigationFromSpineItemPosition.d.ts +1 -1
- package/dist/reader.d.ts +20 -20
- package/package.json +4 -4
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export declare const createReaderWithEnhancers: (options: Partial<import('
|
|
1
|
+
export declare const createReaderWithEnhancers: (options: Partial<import('.').CoreInputSettings> & Partial<import('.').EnhancerLayoutInputSettings> & {
|
|
2
2
|
theme?: import('.').Theme;
|
|
3
|
-
} & Partial<import('
|
|
3
|
+
} & Partial<import('.').EnhancerFontsInputSettings> & {
|
|
4
4
|
loadingElementCreate?: (options: {
|
|
5
5
|
container: HTMLElement;
|
|
6
6
|
item: {
|
|
@@ -15,9 +15,9 @@ export declare const createReaderWithEnhancers: (options: Partial<import('./sett
|
|
|
15
15
|
};
|
|
16
16
|
}) => HTMLElement;
|
|
17
17
|
}) => Omit<Omit<Omit<Omit<{
|
|
18
|
-
context: import('
|
|
19
|
-
spine: import('
|
|
20
|
-
hookManager: import('.').HookManager<import('
|
|
18
|
+
context: import('.').Context;
|
|
19
|
+
spine: import('.').Spine;
|
|
20
|
+
hookManager: import('.').HookManager<import('.').CoreHook>;
|
|
21
21
|
cfi: {
|
|
22
22
|
generateCfiFromRange: (range: Range, item: import('@prose-reader/shared').Manifest[`spineItems`][number]) => {
|
|
23
23
|
start: string;
|
|
@@ -51,31 +51,31 @@ export declare const createReaderWithEnhancers: (options: Partial<import('./sett
|
|
|
51
51
|
};
|
|
52
52
|
navigation: {
|
|
53
53
|
destroy: () => void;
|
|
54
|
-
getNavigation: () => import('
|
|
55
|
-
internalNavigator: import('
|
|
56
|
-
scrollNavigationController: import('
|
|
57
|
-
controlledNavigationController: import('
|
|
58
|
-
locker: import('
|
|
54
|
+
getNavigation: () => import('.').InternalNavigationEntry;
|
|
55
|
+
internalNavigator: import('.').InternalNavigator;
|
|
56
|
+
scrollNavigationController: import('.').ScrollNavigationController;
|
|
57
|
+
controlledNavigationController: import('.').ControlledNavigationController;
|
|
58
|
+
locker: import('.').Locker;
|
|
59
59
|
viewportState$: import('rxjs').Observable<"free" | "busy">;
|
|
60
|
-
navigate: (to: import('
|
|
60
|
+
navigate: (to: import('.').UserNavigationEntry) => void;
|
|
61
61
|
lock(): () => void;
|
|
62
62
|
navigationResolver: {
|
|
63
63
|
getNavigationForUrl: (url: string | URL) => {
|
|
64
|
-
position: import('
|
|
64
|
+
position: import('.').DeprecatedViewportPosition;
|
|
65
65
|
spineItemId: string;
|
|
66
66
|
} | undefined;
|
|
67
|
-
getNavigationForSpineItemPage: (params: Omit<Parameters<typeof import('./navigation/resolvers/getNavigationForSpineItemPage').getNavigationForSpineItemPage>[0], "context" | "spineItemsManager" | "spineItemNavigationResolver" | "spineLocator">) => import('
|
|
67
|
+
getNavigationForSpineItemPage: (params: Omit<Parameters<typeof import('./navigation/resolvers/getNavigationForSpineItemPage').getNavigationForSpineItemPage>[0], "context" | "spineItemsManager" | "spineItemNavigationResolver" | "spineLocator">) => import('.').SpinePosition;
|
|
68
68
|
getNavigationFromSpineItemPosition: (params: {
|
|
69
69
|
spineItemPosition: import('./spineItem/types').SpineItemPosition;
|
|
70
70
|
spineItem: import('.').SpineItem;
|
|
71
|
-
}) => import('
|
|
72
|
-
getNavigationForCfi: (cfi: string) => import('
|
|
73
|
-
getNavigationForLastPage: (spineItem: import('.').SpineItem) => import('
|
|
74
|
-
getNavigationForSpineIndexOrId: (indexOrId: number | string | import('.').SpineItem) => import('
|
|
75
|
-
getNavigationForPosition: (viewportPosition: import('
|
|
76
|
-
getMostPredominantNavigationForPosition: (viewportPosition: import('
|
|
77
|
-
getAdjustedPositionWithSafeEdge: (position: import('
|
|
78
|
-
isNavigationGoingForwardFrom: (to: import('
|
|
71
|
+
}) => import('.').SpinePosition;
|
|
72
|
+
getNavigationForCfi: (cfi: string) => import('.').DeprecatedViewportPosition | undefined;
|
|
73
|
+
getNavigationForLastPage: (spineItem: import('.').SpineItem) => import('.').DeprecatedViewportPosition;
|
|
74
|
+
getNavigationForSpineIndexOrId: (indexOrId: number | string | import('.').SpineItem) => import('.').DeprecatedViewportPosition;
|
|
75
|
+
getNavigationForPosition: (viewportPosition: import('.').DeprecatedViewportPosition | import('.').SpinePosition) => import('.').SpinePosition;
|
|
76
|
+
getMostPredominantNavigationForPosition: (viewportPosition: import('.').DeprecatedViewportPosition) => import('.').DeprecatedViewportPosition;
|
|
77
|
+
getAdjustedPositionWithSafeEdge: (position: import('.').DeprecatedViewportPosition | import('.').SpinePosition) => import('.').SpinePosition;
|
|
78
|
+
isNavigationGoingForwardFrom: (to: import('.').DeprecatedViewportPosition, from: import('.').DeprecatedViewportPosition) => boolean;
|
|
79
79
|
arePositionsDifferent: (a: {
|
|
80
80
|
x: number;
|
|
81
81
|
y: number;
|
|
@@ -83,7 +83,7 @@ export declare const createReaderWithEnhancers: (options: Partial<import('./sett
|
|
|
83
83
|
x: number;
|
|
84
84
|
y: number;
|
|
85
85
|
}) => boolean;
|
|
86
|
-
getAdjustedPositionForSpread: (position: import('
|
|
86
|
+
getAdjustedPositionForSpread: (position: import('.').DeprecatedViewportPosition | import('.').SpinePosition) => import('.').SpinePosition;
|
|
87
87
|
spineItemNavigator: {
|
|
88
88
|
getNavigationForLastPage: (spineItem: import('.').SpineItem) => import('./spineItem/types').SpineItemPosition;
|
|
89
89
|
getNavigationForPosition: (spineItem: import('.').SpineItem, position: import('./spineItem/types').SpineItemPosition) => import('./spineItem/types').SpineItemPosition;
|
|
@@ -91,20 +91,20 @@ export declare const createReaderWithEnhancers: (options: Partial<import('./sett
|
|
|
91
91
|
};
|
|
92
92
|
};
|
|
93
93
|
navigation$: import('rxjs').Observable<{
|
|
94
|
-
position: import('
|
|
94
|
+
position: import('.').SpinePosition;
|
|
95
95
|
id: symbol;
|
|
96
96
|
}>;
|
|
97
97
|
};
|
|
98
98
|
spineItemsObserver: import('./spine/SpineItemsObserver').SpineItemsObserver;
|
|
99
|
-
spineItemsManager: import('
|
|
99
|
+
spineItemsManager: import('.').SpineItemsManager;
|
|
100
100
|
layout: () => void;
|
|
101
|
-
load: (options: Required<Pick<import('
|
|
101
|
+
load: (options: Required<Pick<import('.').ContextState, "manifest" | "containerElement">>) => void;
|
|
102
102
|
destroy: () => void;
|
|
103
103
|
pagination: {
|
|
104
104
|
readonly state: import('./pagination').PaginationInfo;
|
|
105
105
|
readonly state$: import('rxjs').Observable<import('rxjs').ObservedValueOf<import('./pagination').Pagination>>;
|
|
106
106
|
};
|
|
107
|
-
settings: import('./settings/SettingsInterface').SettingsInterface<NonNullable<import('
|
|
107
|
+
settings: import('./settings/SettingsInterface').SettingsInterface<NonNullable<import('.').CoreInputSettings>, NonNullable<import('.').CoreOutputSettings | undefined>>;
|
|
108
108
|
viewport: import('./viewport/Viewport').Viewport;
|
|
109
109
|
element$: import('rxjs').Observable<HTMLElement>;
|
|
110
110
|
viewportState$: import('rxjs').Observable<"free" | "busy">;
|
|
@@ -114,8 +114,8 @@ export declare const createReaderWithEnhancers: (options: Partial<import('./sett
|
|
|
114
114
|
$: {
|
|
115
115
|
destroy$: import('rxjs').Subject<void>;
|
|
116
116
|
};
|
|
117
|
-
}, "settings"> & import('
|
|
118
|
-
settings: import('./settings/SettingsInterface').SettingsInterface<import('
|
|
117
|
+
}, "settings"> & import('.').LayoutEnhancerOutput & {
|
|
118
|
+
settings: import('./settings/SettingsInterface').SettingsInterface<import('.').CoreInputSettings & import('.').EnhancerLayoutInputSettings, import('.').EnhancerLayoutInputSettings & import('.').CoreInputSettings & import('.').ComputedCoreSettings>;
|
|
119
119
|
}, "pagination"> & {
|
|
120
120
|
pagination: Omit<{
|
|
121
121
|
readonly state: import('./pagination').PaginationInfo;
|
|
@@ -135,12 +135,12 @@ export declare const createReaderWithEnhancers: (options: Partial<import('./sett
|
|
|
135
135
|
};
|
|
136
136
|
} & {
|
|
137
137
|
links$: ReturnType<typeof import('./enhancers/html/links').handleLinks>;
|
|
138
|
-
}, "load"> & import('
|
|
138
|
+
}, "load"> & import('.').NavigationEnhancerOutput & import('.').ZoomEnhancerOutput & {
|
|
139
139
|
utils: {
|
|
140
140
|
isOrIsWithinValidLink: (target: Event[`target`]) => boolean;
|
|
141
141
|
};
|
|
142
142
|
}, "settings"> & {
|
|
143
|
-
settings: import('./settings/SettingsInterface').SettingsInterface<import('
|
|
143
|
+
settings: import('./settings/SettingsInterface').SettingsInterface<import('.').CoreInputSettings & import('.').EnhancerLayoutInputSettings & import('.').EnhancerFontsInputSettings, import('.').EnhancerFontsInputSettings & import('.').EnhancerLayoutInputSettings & import('.').CoreInputSettings & import('.').ComputedCoreSettings>;
|
|
144
144
|
} & {
|
|
145
145
|
loading: {
|
|
146
146
|
$: {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { InputSettings } from './types';
|
|
2
1
|
import { SettingsManagerOverload } from '../../settings/SettingsManagerOverload';
|
|
3
2
|
import { CoreInputSettings, CoreOutputSettings } from '../../settings/types';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
import { EnhancerFontsInputSettings } from './types';
|
|
4
|
+
export declare class SettingsManager<ParentInputSettings extends CoreInputSettings, ParentOutputSettings extends CoreOutputSettings> extends SettingsManagerOverload<EnhancerFontsInputSettings, EnhancerFontsInputSettings, ParentInputSettings, ParentOutputSettings> {
|
|
5
|
+
computeOutputSettings(settings: EnhancerFontsInputSettings): EnhancerFontsInputSettings;
|
|
6
|
+
hasSettingsChanged(newOutputSettings: EnhancerFontsInputSettings): boolean;
|
|
7
|
+
getCleanedParentInputSettings(settings: Partial<EnhancerFontsInputSettings & ParentInputSettings>): ParentInputSettings;
|
|
8
|
+
getDefaultSettings(): EnhancerFontsInputSettings;
|
|
9
9
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { EnhancerOptions, EnhancerOutput, RootEnhancer } from '../types/enhancer';
|
|
2
|
-
import { InputSettings } from './types';
|
|
3
1
|
import { SettingsInterface } from '../../settings/SettingsInterface';
|
|
2
|
+
import { EnhancerOptions, EnhancerOutput, RootEnhancer } from '../types/enhancer';
|
|
3
|
+
import { EnhancerFontsInputSettings } from './types';
|
|
4
4
|
export declare const fontsEnhancer: <InheritOptions extends EnhancerOptions<RootEnhancer>, InheritOutput extends EnhancerOutput<RootEnhancer>, InheritSettings extends NonNullable<InheritOutput["settings"]["_inputSettings"]>, InheritComputedSettings extends NonNullable<InheritOutput["settings"]["_outputSettings"]>, Output extends Omit<InheritOutput, "settings"> & {
|
|
5
|
-
settings: SettingsInterface<InheritSettings &
|
|
6
|
-
}>(next: (options: InheritOptions) => InheritOutput) => (options: InheritOptions & Partial<
|
|
5
|
+
settings: SettingsInterface<InheritSettings & EnhancerFontsInputSettings, EnhancerFontsInputSettings & InheritComputedSettings>;
|
|
6
|
+
}>(next: (options: InheritOptions) => InheritOutput) => (options: InheritOptions & Partial<EnhancerFontsInputSettings>) => Output;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
declare const FONT_WEIGHT: readonly [100, 200, 300, 400, 500, 600, 700, 800, 900];
|
|
2
2
|
declare const FONT_JUSTIFICATION: readonly ["center", "left", "right", "justify"];
|
|
3
|
-
export type
|
|
3
|
+
export type EnhancerFontsInputSettings = {
|
|
4
4
|
fontScale: number;
|
|
5
5
|
lineHeight: number | `publisher`;
|
|
6
6
|
fontWeight: (typeof FONT_WEIGHT)[number] | `publisher`;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { SettingsManagerOverload } from '../../settings/SettingsManagerOverload';
|
|
2
2
|
import { CoreInputSettings, CoreOutputSettings } from '../../settings/types';
|
|
3
|
-
import {
|
|
4
|
-
export declare class SettingsManager<ParentInputSettings extends CoreInputSettings, ParentOutputSettings extends CoreOutputSettings> extends SettingsManagerOverload<
|
|
5
|
-
computeOutputSettings(inputSettings:
|
|
6
|
-
hasSettingsChanged(newOutputSettings:
|
|
7
|
-
getCleanedParentInputSettings(settings: Partial<
|
|
8
|
-
getDefaultSettings():
|
|
3
|
+
import { EnhancerLayoutInputSettings, OutputSettings } from './types';
|
|
4
|
+
export declare class SettingsManager<ParentInputSettings extends CoreInputSettings, ParentOutputSettings extends CoreOutputSettings> extends SettingsManagerOverload<EnhancerLayoutInputSettings, OutputSettings, ParentInputSettings, ParentOutputSettings> {
|
|
5
|
+
computeOutputSettings(inputSettings: EnhancerLayoutInputSettings): EnhancerLayoutInputSettings;
|
|
6
|
+
hasSettingsChanged(newOutputSettings: EnhancerLayoutInputSettings): boolean;
|
|
7
|
+
getCleanedParentInputSettings(settings: Partial<EnhancerLayoutInputSettings & ParentInputSettings>): ParentInputSettings;
|
|
8
|
+
getDefaultSettings(): EnhancerLayoutInputSettings;
|
|
9
9
|
}
|
|
@@ -2,11 +2,11 @@ import { Observable } from 'rxjs';
|
|
|
2
2
|
import { SettingsInterface } from '../../settings/SettingsInterface';
|
|
3
3
|
import { EnhancerOptions, EnhancerOutput, RootEnhancer } from '../types/enhancer';
|
|
4
4
|
import { LayoutInfo } from './layoutInfo';
|
|
5
|
-
import {
|
|
5
|
+
import { EnhancerLayoutInputSettings, OutputSettings } from './types';
|
|
6
6
|
export type LayoutEnhancerOutput = {
|
|
7
7
|
layout$: Observable<LayoutInfo>;
|
|
8
8
|
layoutInfo$: Observable<LayoutInfo>;
|
|
9
9
|
};
|
|
10
10
|
export declare const layoutEnhancer: <InheritOptions extends EnhancerOptions<RootEnhancer>, InheritOutput extends EnhancerOutput<RootEnhancer>, InheritSettings extends NonNullable<InheritOutput["settings"]["_inputSettings"]>, InheritComputedSettings extends NonNullable<InheritOutput["settings"]["_outputSettings"]>, Output extends Omit<InheritOutput, "settings"> & LayoutEnhancerOutput & {
|
|
11
|
-
settings: SettingsInterface<InheritSettings &
|
|
12
|
-
}>(next: (options: InheritOptions) => InheritOutput) => (options: InheritOptions & Partial<
|
|
11
|
+
settings: SettingsInterface<InheritSettings & EnhancerLayoutInputSettings, OutputSettings & InheritComputedSettings>;
|
|
12
|
+
}>(next: (options: InheritOptions) => InheritOutput) => (options: InheritOptions & Partial<EnhancerLayoutInputSettings>) => Output;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export type
|
|
1
|
+
export type EnhancerLayoutInputSettings = {
|
|
2
2
|
pageHorizontalMargin: number;
|
|
3
3
|
pageVerticalMargin: number;
|
|
4
4
|
layoutAutoResize: `container` | false;
|
|
5
5
|
layoutLayerTransition: boolean;
|
|
6
6
|
viewportMode: `normal` | `thumbnails`;
|
|
7
7
|
};
|
|
8
|
-
export type OutputSettings =
|
|
8
|
+
export type OutputSettings = EnhancerLayoutInputSettings;
|
package/dist/index.d.ts
CHANGED
|
@@ -6,11 +6,30 @@ export type { Theme } from './enhancers/theme';
|
|
|
6
6
|
export { HookManager } from './hooks/HookManager';
|
|
7
7
|
export { SettingsManager } from './settings/SettingsManager';
|
|
8
8
|
export type Reader = ReturnType<typeof createReader>;
|
|
9
|
+
export type CreateReaderOptions = Parameters<typeof createReader>[0];
|
|
9
10
|
export { createReader };
|
|
10
11
|
export { isHtmlElement, isHtmlTagElement } from './utils/dom';
|
|
11
12
|
export { isShallowEqual } from './utils/objects';
|
|
12
13
|
export { waitForSwitch } from './utils/rxjs';
|
|
13
14
|
export { SpineItem } from './spineItem/SpineItem';
|
|
15
|
+
export type { PaginationInfo } from './pagination/types';
|
|
14
16
|
export * from './utils/DestroyableClass';
|
|
15
17
|
export * from './utils/frames';
|
|
16
18
|
export * from './utils/rxjs';
|
|
19
|
+
export type PaginationState = ReturnType<typeof createReader>["pagination"]["state"];
|
|
20
|
+
export type { EnhancerFontsInputSettings } from './enhancers/fonts';
|
|
21
|
+
export type { EnhancerLayoutInputSettings } from './enhancers/layout/types';
|
|
22
|
+
export * from './settings/types';
|
|
23
|
+
export * from './context/Context';
|
|
24
|
+
export * from './enhancers/layout/layoutEnhancer';
|
|
25
|
+
export * from './enhancers/navigation/types';
|
|
26
|
+
export * from './enhancers/zoom/types';
|
|
27
|
+
export * from './hooks/types';
|
|
28
|
+
export * from './navigation/InternalNavigator';
|
|
29
|
+
export * from './navigation/Locker';
|
|
30
|
+
export * from './navigation/controllers/ControlledNavigationController';
|
|
31
|
+
export * from './navigation/controllers/ScrollNavigationController';
|
|
32
|
+
export * from './navigation/types';
|
|
33
|
+
export * from './spine/types';
|
|
34
|
+
export * from './spine/SpineItemsManager';
|
|
35
|
+
export * from './spine/Spine';
|