@prose-reader/core 1.59.0 → 1.60.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 +4 -45
- package/dist/enhancers/fonts/SettingsManager.d.ts +10 -0
- package/dist/enhancers/fonts/fonts.d.ts +7 -0
- package/dist/enhancers/fonts/types.d.ts +9 -0
- package/dist/enhancers/layoutEnhancer/SettingsManager.d.ts +10 -0
- package/dist/enhancers/layoutEnhancer/layoutEnhancer.d.ts +5 -8
- package/dist/enhancers/layoutEnhancer/types.d.ts +5 -7
- package/dist/index.js +289 -210
- package/dist/index.js.map +1 -1
- package/dist/index.umd.cjs +222 -143
- package/dist/index.umd.cjs.map +1 -1
- package/dist/reader.d.ts +2 -2
- package/dist/settings/ReaderSettingsManager.d.ts +32 -0
- package/dist/settings/SettingsInterface.d.ts +13 -0
- package/dist/settings/SettingsManagerOverload.d.ts +23 -0
- package/dist/settings/types.d.ts +6 -5
- package/dist/spine/createSpine.d.ts +2 -2
- package/dist/spine/locationResolver.d.ts +2 -2
- package/dist/spine/navigationResolver.d.ts +2 -2
- package/dist/spineItem/commonSpineItem.d.ts +2 -2
- package/dist/spineItem/createSpineItem.d.ts +2 -2
- package/dist/spineItem/frameItem/frameItem.d.ts +2 -2
- package/dist/spineItem/frameItem/loader.d.ts +2 -2
- package/dist/spineItem/navigationResolver.d.ts +2 -2
- package/dist/spineItem/prePaginatedSpineItem.d.ts +2 -2
- package/dist/spineItem/reflowableSpineItem.d.ts +2 -2
- package/dist/spineItemManager.d.ts +2 -2
- package/dist/types/reader.d.ts +4 -4
- package/dist/utils/objects.d.ts +1 -0
- package/dist/viewportNavigator/panViewportNavigator.d.ts +2 -2
- package/dist/viewportNavigator/scrollViewportNavigator.d.ts +2 -2
- package/dist/viewportNavigator/viewportNavigator.d.ts +2 -2
- package/package.json +3 -3
- package/dist/enhancers/fonts.d.ts +0 -19
- package/dist/settings/SettingsManager.d.ts +0 -14
- package/dist/settings/defaultSettings.d.ts +0 -3
- package/dist/settings/getComputedSettings.d.ts +0 -4
- package/dist/utils/compose.d.ts +0 -8
|
@@ -1,13 +1,6 @@
|
|
|
1
|
-
export declare const createReaderWithEnhancers: (options: Partial<import('./settings/types').
|
|
1
|
+
export declare const createReaderWithEnhancers: (options: Partial<import('./settings/types').CoreInputSettings> & {
|
|
2
2
|
theme?: import('./enhancers/theme').Theme;
|
|
3
|
-
} & import('./enhancers/layoutEnhancer/types').
|
|
4
|
-
layoutAutoResize?: `container` | false;
|
|
5
|
-
} & {
|
|
6
|
-
fontScale?: number;
|
|
7
|
-
lineHeight?: number | `publisher`;
|
|
8
|
-
fontWeight?: (200 | 300 | 100 | 400 | 500 | 600 | 700 | 800 | 900) | `publisher`;
|
|
9
|
-
fontJustification?: ("center" | "right" | "left" | "justify") | `publisher`;
|
|
10
|
-
} & {
|
|
3
|
+
} & Partial<import('./enhancers/layoutEnhancer/types').InputSettings> & Partial<import('./enhancers/fonts/types').InputSettings> & {
|
|
11
4
|
loadingElementCreate?: (options: {
|
|
12
5
|
container: HTMLElement;
|
|
13
6
|
item: {
|
|
@@ -128,15 +121,7 @@ export declare const createReaderWithEnhancers: (options: Partial<import('./sett
|
|
|
128
121
|
state$: ReturnType<typeof import('./enhancers/navigation/state').createState>;
|
|
129
122
|
};
|
|
130
123
|
} & import('./enhancers/zoom/types').Api, "settings"> & {
|
|
131
|
-
settings:
|
|
132
|
-
settings$: import('rxjs').Observable<import('./settings/types').Settings & {
|
|
133
|
-
computedPageTurnMode: import('./settings/types').Settings[`pageTurnMode`];
|
|
134
|
-
computedPageTurnDirection: import('./settings/types').Settings[`pageTurnDirection`];
|
|
135
|
-
computedPageTurnAnimation: import('./settings/types').Settings[`pageTurnAnimation`];
|
|
136
|
-
computedPageTurnAnimationDuration: number;
|
|
137
|
-
} & Required<import('./enhancers/layoutEnhancer/types').SettingsInput>>;
|
|
138
|
-
setSettings: (settings: Partial<import('./settings/types').Settings> & import('./enhancers/layoutEnhancer/types').SettingsInput) => void;
|
|
139
|
-
};
|
|
124
|
+
settings: import('./settings/SettingsInterface').SettingsInterface<import('./settings/types').CoreInputSettings & import('./enhancers/layoutEnhancer/types').InputSettings, import('./enhancers/layoutEnhancer/types').InputSettings & import('./settings/types').CoreInputSettings & import('./settings/types').ComputedCoreSettings>;
|
|
140
125
|
} & {
|
|
141
126
|
utils: {
|
|
142
127
|
isOrIsWithinValidLink: (target: Event[`target`]) => boolean;
|
|
@@ -150,33 +135,7 @@ export declare const createReaderWithEnhancers: (options: Partial<import('./sett
|
|
|
150
135
|
}>;
|
|
151
136
|
};
|
|
152
137
|
}, "settings"> & {
|
|
153
|
-
settings:
|
|
154
|
-
settings$: import('rxjs').Observable<import('./settings/types').Settings & {
|
|
155
|
-
computedPageTurnMode: import('./settings/types').Settings[`pageTurnMode`];
|
|
156
|
-
computedPageTurnDirection: import('./settings/types').Settings[`pageTurnDirection`];
|
|
157
|
-
computedPageTurnAnimation: import('./settings/types').Settings[`pageTurnAnimation`];
|
|
158
|
-
computedPageTurnAnimationDuration: number;
|
|
159
|
-
} & Required<import('./enhancers/layoutEnhancer/types').SettingsInput>>;
|
|
160
|
-
setSettings: (settings: Partial<import('./settings/types').Settings> & import('./enhancers/layoutEnhancer/types').SettingsInput) => void;
|
|
161
|
-
}, "setSettings" | "settings$"> & {
|
|
162
|
-
settings$: import('rxjs').Observable<import('./settings/types').Settings & {
|
|
163
|
-
computedPageTurnMode: import('./settings/types').Settings[`pageTurnMode`];
|
|
164
|
-
computedPageTurnDirection: import('./settings/types').Settings[`pageTurnDirection`];
|
|
165
|
-
computedPageTurnAnimation: import('./settings/types').Settings[`pageTurnAnimation`];
|
|
166
|
-
computedPageTurnAnimationDuration: number;
|
|
167
|
-
} & Required<import('./enhancers/layoutEnhancer/types').SettingsInput> & Required<{
|
|
168
|
-
fontScale?: number;
|
|
169
|
-
lineHeight?: number | `publisher`;
|
|
170
|
-
fontWeight?: (200 | 300 | 100 | 400 | 500 | 600 | 700 | 800 | 900) | `publisher`;
|
|
171
|
-
fontJustification?: ("center" | "right" | "left" | "justify") | `publisher`;
|
|
172
|
-
}>>;
|
|
173
|
-
setSettings: (settings: Partial<import('./settings/types').Settings> & import('./enhancers/layoutEnhancer/types').SettingsInput & {
|
|
174
|
-
fontScale?: number;
|
|
175
|
-
lineHeight?: number | `publisher`;
|
|
176
|
-
fontWeight?: (200 | 300 | 100 | 400 | 500 | 600 | 700 | 800 | 900) | `publisher`;
|
|
177
|
-
fontJustification?: ("center" | "right" | "left" | "justify") | `publisher`;
|
|
178
|
-
}) => void;
|
|
179
|
-
};
|
|
138
|
+
settings: import('./settings/SettingsInterface').SettingsInterface<import('./settings/types').CoreInputSettings & import('./enhancers/layoutEnhancer/types').InputSettings & import('./enhancers/fonts/types').InputSettings, import('./enhancers/fonts/types').InputSettings & import('./enhancers/layoutEnhancer/types').InputSettings & import('./settings/types').CoreInputSettings & import('./settings/types').ComputedCoreSettings>;
|
|
180
139
|
} & {
|
|
181
140
|
loading: {
|
|
182
141
|
$: {
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { InputSettings } from './types';
|
|
2
|
+
import { SettingsManagerOverload } from '../../settings/SettingsManagerOverload';
|
|
3
|
+
import { CoreInputSettings, CoreOutputSettings } from '../../settings/types';
|
|
4
|
+
|
|
5
|
+
export declare class SettingsManager<ParentInputSettings extends CoreInputSettings, ParentOutputSettings extends CoreOutputSettings> extends SettingsManagerOverload<InputSettings, InputSettings, ParentInputSettings, ParentOutputSettings> {
|
|
6
|
+
computeOutputSettings(): InputSettings;
|
|
7
|
+
hasSettingsChanged(newOutputSettings: InputSettings): boolean;
|
|
8
|
+
getCleanedParentInputSettings(settings: Partial<InputSettings & ParentInputSettings>): ParentInputSettings;
|
|
9
|
+
getDefaultSettings(): InputSettings;
|
|
10
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { EnhancerOptions, EnhancerOutput, RootEnhancer } from '../types/enhancer';
|
|
2
|
+
import { InputSettings } from './types';
|
|
3
|
+
import { SettingsInterface } from '../../settings/SettingsInterface';
|
|
4
|
+
|
|
5
|
+
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"> & {
|
|
6
|
+
settings: SettingsInterface<InheritSettings & InputSettings, InputSettings & InheritComputedSettings>;
|
|
7
|
+
}>(next: (options: InheritOptions) => InheritOutput) => (options: InheritOptions & Partial<InputSettings>) => Output;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
declare const FONT_WEIGHT: readonly [100, 200, 300, 400, 500, 600, 700, 800, 900];
|
|
2
|
+
declare const FONT_JUSTIFICATION: readonly ["center", "left", "right", "justify"];
|
|
3
|
+
export type InputSettings = {
|
|
4
|
+
fontScale: number;
|
|
5
|
+
lineHeight: number | `publisher`;
|
|
6
|
+
fontWeight: (typeof FONT_WEIGHT)[number] | `publisher`;
|
|
7
|
+
fontJustification: (typeof FONT_JUSTIFICATION)[number] | `publisher`;
|
|
8
|
+
};
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { InputSettings, OutputSettings } from './types';
|
|
2
|
+
import { SettingsManagerOverload } from '../../settings/SettingsManagerOverload';
|
|
3
|
+
import { CoreInputSettings, CoreOutputSettings } from '../../settings/types';
|
|
4
|
+
|
|
5
|
+
export declare class SettingsManager<ParentInputSettings extends CoreInputSettings, ParentOutputSettings extends CoreOutputSettings> extends SettingsManagerOverload<InputSettings, OutputSettings, ParentInputSettings, ParentOutputSettings> {
|
|
6
|
+
computeOutputSettings(): InputSettings;
|
|
7
|
+
hasSettingsChanged(newOutputSettings: InputSettings): boolean;
|
|
8
|
+
getCleanedParentInputSettings(settings: Partial<InputSettings & ParentInputSettings>): ParentInputSettings;
|
|
9
|
+
getDefaultSettings(): InputSettings;
|
|
10
|
+
}
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
import { Observable, ObservedValueOf } from 'rxjs';
|
|
2
|
-
import { Options, SettingsInput, SettingsOutput } from './types';
|
|
3
1
|
import { EnhancerOptions, EnhancerOutput, RootEnhancer } from '../types/enhancer';
|
|
2
|
+
import { SettingsInterface } from '../../settings/SettingsInterface';
|
|
3
|
+
import { InputSettings, OutputSettings } from './types';
|
|
4
4
|
|
|
5
|
-
export declare const layoutEnhancer: <InheritOptions extends EnhancerOptions<RootEnhancer>, InheritOutput extends EnhancerOutput<RootEnhancer>,
|
|
6
|
-
settings:
|
|
7
|
-
|
|
8
|
-
setSettings: SetSettings;
|
|
9
|
-
};
|
|
10
|
-
}>(next: (options: InheritOptions) => InheritOutput) => (options: InheritOptions & Options) => Output;
|
|
5
|
+
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"> & {
|
|
6
|
+
settings: SettingsInterface<InheritSettings & InputSettings, OutputSettings & InheritComputedSettings>;
|
|
7
|
+
}>(next: (options: InheritOptions) => InheritOutput) => (options: InheritOptions & Partial<InputSettings>) => Output;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
export type
|
|
2
|
-
pageHorizontalMargin
|
|
3
|
-
pageVerticalMargin
|
|
4
|
-
|
|
5
|
-
export type SettingsOutput = Required<SettingsInput>;
|
|
6
|
-
export type Options = SettingsInput & {
|
|
7
|
-
layoutAutoResize?: `container` | false;
|
|
1
|
+
export type InputSettings = {
|
|
2
|
+
pageHorizontalMargin: number;
|
|
3
|
+
pageVerticalMargin: number;
|
|
4
|
+
layoutAutoResize: `container` | false;
|
|
8
5
|
};
|
|
6
|
+
export type OutputSettings = InputSettings;
|