@prose-reader/core 1.324.0 → 1.326.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/context/Context.d.ts +5 -7
- package/dist/createReaderWithEnhancer.d.ts +9 -7
- package/dist/enhancers/html/renderer/HtmlRenderer.d.ts +1 -1
- package/dist/enhancers/html/renderer/reflowable/renderReflowable.d.ts +1 -1
- package/dist/enhancers/layout/spreadMode.d.ts +2 -2
- package/dist/enhancers/layout/updateSpreadMode.d.ts +1 -1
- package/dist/enhancers/navigation/index.d.ts +1 -1
- package/dist/enhancers/navigation/resolvers/getSpineItemPositionForLeftPage.d.ts +1 -1
- package/dist/enhancers/navigation/types.d.ts +0 -4
- package/dist/hooks/types.d.ts +2 -2
- package/dist/index.cjs +16 -20
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +942 -1038
- package/dist/index.js.map +1 -1
- package/dist/manifest/isFullyPrePaginated.d.ts +1 -1
- package/dist/navigation/controllers/ControlledNavigationController.d.ts +1 -0
- package/dist/navigation/controllers/ScrollNavigationController.d.ts +1 -0
- package/dist/navigation/tests/utils.d.ts +2 -5
- package/dist/pagination/index.d.ts +1 -1
- package/dist/reader.d.ts +9 -7
- package/dist/reader.test.d.ts +1 -0
- package/dist/settings/computeSpreadMode.d.ts +1 -1
- package/dist/spine/Spine.d.ts +1 -3
- package/dist/spine/SpineItemsManager.d.ts +7 -7
- package/dist/spine/SpineItemsObserver.d.ts +1 -1
- package/dist/spine/SpineItemsObserver.test.d.ts +1 -0
- package/dist/spineItem/SpineItem.d.ts +2 -2
- package/dist/spineItem/renderer/DefaultRenderer.d.ts +1 -1
- package/dist/spineItem/renderer/DocumentRenderer.d.ts +1 -1
- package/dist/tests/utils.d.ts +3 -0
- package/dist/utils/ReactiveEntity.d.ts +1 -0
- package/package.json +4 -4
- package/dist/enhancers/resources/index.d.ts +0 -2
- package/dist/enhancers/resources/indexedDB.d.ts +0 -6
- package/dist/enhancers/resources/resourcesManager.d.ts +0 -6
|
@@ -1,20 +1,18 @@
|
|
|
1
1
|
import { Manifest } from '@prose-reader/shared';
|
|
2
2
|
import { ReactiveEntity } from '../utils/ReactiveEntity';
|
|
3
3
|
import { BridgeEvent } from './BridgeEvent';
|
|
4
|
-
import { Observable } from 'rxjs';
|
|
5
4
|
export type ContextState = {
|
|
5
|
+
manifest: Manifest;
|
|
6
6
|
rootElement?: HTMLElement;
|
|
7
|
-
manifest?: Manifest;
|
|
8
7
|
hasVerticalWriting?: boolean;
|
|
9
8
|
assumedRenditionLayout: "reflowable" | "pre-paginated";
|
|
10
|
-
isFullyPrePaginated
|
|
9
|
+
isFullyPrePaginated: boolean;
|
|
11
10
|
};
|
|
12
11
|
export declare class Context extends ReactiveEntity<ContextState> {
|
|
13
12
|
bridgeEvent: BridgeEvent;
|
|
14
|
-
manifest
|
|
15
|
-
|
|
16
|
-
update(newState: Partial<ContextState>): void;
|
|
13
|
+
constructor(manifest: Manifest);
|
|
14
|
+
update(newState: Partial<Omit<ContextState, "manifest">>): void;
|
|
17
15
|
isRTL: () => boolean;
|
|
18
|
-
get manifest(): Manifest
|
|
16
|
+
get manifest(): Manifest;
|
|
19
17
|
get readingDirection(): "ltr" | "rtl" | undefined;
|
|
20
18
|
}
|
|
@@ -1,12 +1,16 @@
|
|
|
1
|
-
import { CoreInputSettings, Theme, EnhancerLayoutInputSettings, EnhancerFontsInputSettings, Context, Spine, InternalNavigationEntry, InternalNavigator, ScrollNavigationController, ControlledNavigationController, UserNavigationEntry, SpinePosition, SpineItemPosition, SpineItem, UnboundSpinePosition, NavigationVisibleArea, SpineBoundary, SpineItemsObserver, SpineItemsManager,
|
|
1
|
+
import { CoreInputSettings, Theme, EnhancerLayoutInputSettings, EnhancerFontsInputSettings, Context, Spine, InternalNavigationEntry, InternalNavigator, ScrollNavigationController, ControlledNavigationController, UserNavigationEntry, SpinePosition, SpineItemPosition, SpineItem, UnboundSpinePosition, NavigationVisibleArea, SpineBoundary, SpineItemsObserver, SpineItemsManager, SettingsInterface, CoreOutputSettings, SpineItemReference, Viewport, Features, ThemeEnhancerOutput, LayoutEnhancerOutput, ComputedCoreSettings, ExtraPaginationInfo, ResourcesLocator, NavigationEnhancerOutput, ZoomEnhancerOutput } from '.';
|
|
2
|
+
import { Manifest } from '@prose-reader/shared';
|
|
2
3
|
import { HookManager, CoreHook } from './hooks';
|
|
3
4
|
import { CfiManager } from './cfi';
|
|
4
5
|
import { Observable, ObservedValueOf, Subject } from 'rxjs';
|
|
5
6
|
import { getNavigationForSpineItemPage } from './navigation/resolvers/getNavigationForSpineItemPage';
|
|
6
7
|
import { PaginationInfo, Pagination } from './pagination';
|
|
7
8
|
export declare const createReaderWithEnhancers: (options: Partial< CoreInputSettings> & {
|
|
9
|
+
manifest: Manifest;
|
|
10
|
+
cfi?: string;
|
|
11
|
+
} & {
|
|
8
12
|
theme?: Theme;
|
|
9
|
-
} & Partial< EnhancerLayoutInputSettings> & Partial< EnhancerFontsInputSettings>) => Omit<Omit<Omit<
|
|
13
|
+
} & Partial< EnhancerLayoutInputSettings> & Partial< EnhancerFontsInputSettings>) => Omit<Omit<Omit<{
|
|
10
14
|
id: `${string}-${string}-${string}-${string}-${string}`;
|
|
11
15
|
context: Context;
|
|
12
16
|
spine: Spine;
|
|
@@ -64,9 +68,7 @@ export declare const createReaderWithEnhancers: (options: Partial< CoreInputSett
|
|
|
64
68
|
layout: (options?: {
|
|
65
69
|
immediate?: boolean;
|
|
66
70
|
}) => void;
|
|
67
|
-
|
|
68
|
-
containerElement: HTMLElement;
|
|
69
|
-
}>) => void;
|
|
71
|
+
mount: (containerElement: HTMLElement) => void;
|
|
70
72
|
destroy: () => void;
|
|
71
73
|
pagination: {
|
|
72
74
|
readonly state: PaginationInfo;
|
|
@@ -80,7 +82,7 @@ export declare const createReaderWithEnhancers: (options: Partial< CoreInputSett
|
|
|
80
82
|
viewport: Viewport;
|
|
81
83
|
viewportState$: Observable<"free" | "busy">;
|
|
82
84
|
viewportFree$: Observable<"free">;
|
|
83
|
-
|
|
85
|
+
mounted$: Observable<boolean>;
|
|
84
86
|
features: Features;
|
|
85
87
|
$: {
|
|
86
88
|
destroy$: Subject<void>;
|
|
@@ -100,7 +102,7 @@ export declare const createReaderWithEnhancers: (options: Partial< CoreInputSett
|
|
|
100
102
|
locateResource: ResourcesLocator["locateResource"];
|
|
101
103
|
} & {
|
|
102
104
|
links$: Observable<MouseEvent>;
|
|
103
|
-
}
|
|
105
|
+
} & NavigationEnhancerOutput & ZoomEnhancerOutput & {
|
|
104
106
|
utils: {
|
|
105
107
|
isOrIsWithinValidLink: (target: Event[`target`]) => boolean;
|
|
106
108
|
injectScopedCSS: (doc: Document, scope: string, styleTemplate: string) => () => void;
|
|
@@ -3,7 +3,7 @@ import { Observable } from 'rxjs';
|
|
|
3
3
|
export declare class HtmlRenderer extends DocumentRenderer {
|
|
4
4
|
onCreateDocument(): Observable<HTMLIFrameElement>;
|
|
5
5
|
onLoadDocument(): Observable<HTMLIFrameElement>;
|
|
6
|
-
onUnload():
|
|
6
|
+
onUnload(): void;
|
|
7
7
|
onLayout({ minPageSpread, blankPagePosition, spreadPosition, }: {
|
|
8
8
|
minPageSpread: number;
|
|
9
9
|
blankPagePosition: `before` | `after` | `none`;
|
|
@@ -4,7 +4,7 @@ export declare const renderReflowable: ({ pageHeight: pageSizeHeight, pageWidth,
|
|
|
4
4
|
pageWidth: number;
|
|
5
5
|
pageHeight: number;
|
|
6
6
|
frameElement: HTMLIFrameElement;
|
|
7
|
-
manifest
|
|
7
|
+
manifest: Manifest;
|
|
8
8
|
renditionFlow?: Manifest["renditionFlow"];
|
|
9
9
|
minPageSpread: number;
|
|
10
10
|
isRTL: boolean;
|
|
@@ -4,11 +4,11 @@ type ViewportDimensions = {
|
|
|
4
4
|
width: number;
|
|
5
5
|
};
|
|
6
6
|
export declare const shouldEnableSpreadModeForViewport: ({ manifest, viewport, }: {
|
|
7
|
-
manifest: Manifest
|
|
7
|
+
manifest: Manifest;
|
|
8
8
|
viewport: ViewportDimensions;
|
|
9
9
|
}) => boolean;
|
|
10
10
|
export declare const shouldUseComputedSpreadModeForViewport: ({ manifest, viewport, }: {
|
|
11
|
-
manifest: Manifest
|
|
11
|
+
manifest: Manifest;
|
|
12
12
|
viewport: ViewportDimensions;
|
|
13
13
|
}) => boolean;
|
|
14
14
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { HtmlEnhancerOutput } from '../html/enhancer';
|
|
2
2
|
import { EnhancerOptions, EnhancerOutput, RootEnhancer } from '../types/enhancer';
|
|
3
3
|
import { NavigationEnhancerOutput } from './types';
|
|
4
|
-
export declare const navigationEnhancer: <InheritOptions extends EnhancerOptions<RootEnhancer>, InheritOutput extends EnhancerOutput<RootEnhancer> & HtmlEnhancerOutput>(next: (options: InheritOptions) => InheritOutput) => (options: InheritOptions) =>
|
|
4
|
+
export declare const navigationEnhancer: <InheritOptions extends EnhancerOptions<RootEnhancer>, InheritOutput extends EnhancerOutput<RootEnhancer> & HtmlEnhancerOutput>(next: (options: InheritOptions) => InheritOutput) => (options: InheritOptions) => InheritOutput & NavigationEnhancerOutput;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { SpineItem } from '../../../spineItem/SpineItem';
|
|
2
1
|
import { SpineItemLocator } from '../../../spineItem/locationResolver';
|
|
2
|
+
import { SpineItem } from '../../../spineItem/SpineItem';
|
|
3
3
|
import { SpineItemPosition } from '../../../spineItem/types';
|
|
4
4
|
export declare const getSpineItemPositionForLeftPage: ({ position, spineItem, pageHeight, pageWidth, spineItemLocator, }: {
|
|
5
5
|
position: SpineItemPosition;
|
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
import { Observable } from 'rxjs';
|
|
2
|
-
import { Reader } from '../../reader';
|
|
3
2
|
import { outOfSpineBoundary } from './boundary';
|
|
4
3
|
import { ManualNavigator } from './navigators/manualNavigator';
|
|
5
4
|
import { PanNavigator } from './navigators/panNavigator';
|
|
6
5
|
import { observeState } from './state';
|
|
7
6
|
export type NavigationEnhancerOutput = {
|
|
8
|
-
load: (options: Parameters<Reader["load"]>[0] & {
|
|
9
|
-
cfi?: string;
|
|
10
|
-
}) => void;
|
|
11
7
|
navigation: {
|
|
12
8
|
state$: ReturnType<typeof observeState>;
|
|
13
9
|
outOfSpineBoundary$: ReturnType<typeof outOfSpineBoundary>;
|
package/dist/hooks/types.d.ts
CHANGED
|
@@ -37,10 +37,10 @@ export type CoreHook = {
|
|
|
37
37
|
}) => Promise<void>;
|
|
38
38
|
} | {
|
|
39
39
|
name: `item.onDocumentUnload`;
|
|
40
|
-
runFn: (params:
|
|
40
|
+
runFn: (params: {
|
|
41
41
|
itemId: string;
|
|
42
42
|
documentContainer: HTMLElement;
|
|
43
|
-
}) =>
|
|
43
|
+
}) => void;
|
|
44
44
|
} | {
|
|
45
45
|
name: "item.onBeforeLayout";
|
|
46
46
|
runFn: (params: {
|