next-flipbook 2.2.1 → 2.3.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/README.md +8 -2
- package/dist/core/appearance/AppearanceStore.d.ts +18 -4
- package/dist/core/appearance/AppearanceStore.d.ts.map +1 -1
- package/dist/core/appearance/AppearanceStore.js +23 -5
- package/dist/core/appearance/AppearanceStore.js.map +1 -1
- package/dist/core/layout/scroll.d.ts +84 -0
- package/dist/core/layout/scroll.d.ts.map +1 -0
- package/dist/core/layout/scroll.js +104 -0
- package/dist/core/layout/scroll.js.map +1 -0
- package/dist/core/types.d.ts +9 -2
- package/dist/core/types.d.ts.map +1 -1
- package/dist/core/zoom/ZoomController.d.ts +2 -0
- package/dist/core/zoom/ZoomController.d.ts.map +1 -1
- package/dist/core/zoom/ZoomController.js +6 -0
- package/dist/core/zoom/ZoomController.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/react/components/FlipBook.d.ts.map +1 -1
- package/dist/react/components/FlipBook.js +25 -5
- package/dist/react/components/FlipBook.js.map +1 -1
- package/dist/react/components/FlipBookHeader.d.ts.map +1 -1
- package/dist/react/components/FlipBookHeader.js +1 -1
- package/dist/react/components/FlipBookHeader.js.map +1 -1
- package/dist/react/components/FlipBookMoreMenu.d.ts +1 -1
- package/dist/react/components/FlipBookMoreMenu.d.ts.map +1 -1
- package/dist/react/components/FlipBookMoreMenu.js +15 -4
- package/dist/react/components/FlipBookMoreMenu.js.map +1 -1
- package/dist/react/components/FlipBookProvider.d.ts.map +1 -1
- package/dist/react/components/FlipBookProvider.js +46 -10
- package/dist/react/components/FlipBookProvider.js.map +1 -1
- package/dist/react/components/FlipBookScrollStage.d.ts +14 -0
- package/dist/react/components/FlipBookScrollStage.d.ts.map +1 -0
- package/dist/react/components/FlipBookScrollStage.js +449 -0
- package/dist/react/components/FlipBookScrollStage.js.map +1 -0
- package/dist/react/components/FlipBookStage.d.ts +3 -3
- package/dist/react/components/FlipBookStage.d.ts.map +1 -1
- package/dist/react/components/FlipBookStage.js +14 -61
- package/dist/react/components/FlipBookStage.js.map +1 -1
- package/dist/react/components/FlipBookToolbar.d.ts.map +1 -1
- package/dist/react/components/FlipBookToolbar.js +2 -1
- package/dist/react/components/FlipBookToolbar.js.map +1 -1
- package/dist/react/components/FlipBookTour.d.ts.map +1 -1
- package/dist/react/components/FlipBookTour.js +5 -3
- package/dist/react/components/FlipBookTour.js.map +1 -1
- package/dist/react/components/StageMessages.d.ts +16 -0
- package/dist/react/components/StageMessages.d.ts.map +1 -0
- package/dist/react/components/StageMessages.js +28 -0
- package/dist/react/components/StageMessages.js.map +1 -0
- package/dist/react/context.d.ts +7 -0
- package/dist/react/context.d.ts.map +1 -1
- package/dist/react/context.js.map +1 -1
- package/dist/react/controller.d.ts.map +1 -1
- package/dist/react/controller.js +2 -0
- package/dist/react/controller.js.map +1 -1
- package/dist/react/hooks/useActiveHotspot.d.ts +14 -0
- package/dist/react/hooks/useActiveHotspot.d.ts.map +1 -0
- package/dist/react/hooks/useActiveHotspot.js +49 -0
- package/dist/react/hooks/useActiveHotspot.js.map +1 -0
- package/dist/react/hooks/useAppearance.d.ts +4 -2
- package/dist/react/hooks/useAppearance.d.ts.map +1 -1
- package/dist/react/hooks/useAppearance.js +7 -5
- package/dist/react/hooks/useAppearance.js.map +1 -1
- package/dist/react/hooks/useBookExtras.d.ts +1 -0
- package/dist/react/hooks/useBookExtras.d.ts.map +1 -1
- package/dist/react/hooks/useBookExtras.js +3 -0
- package/dist/react/hooks/useBookExtras.js.map +1 -1
- package/dist/react/hooks/useElementSize.d.ts +9 -1
- package/dist/react/hooks/useElementSize.d.ts.map +1 -1
- package/dist/react/hooks/useElementSize.js +11 -3
- package/dist/react/hooks/useElementSize.js.map +1 -1
- package/dist/react/hooks/useFlipBook.d.ts +3 -1
- package/dist/react/hooks/useFlipBook.d.ts.map +1 -1
- package/dist/react/hooks/useFlipBook.js +1 -0
- package/dist/react/hooks/useFlipBook.js.map +1 -1
- package/dist/react/hooks/useScrollGestures.d.ts +27 -0
- package/dist/react/hooks/useScrollGestures.d.ts.map +1 -0
- package/dist/react/hooks/useScrollGestures.js +144 -0
- package/dist/react/hooks/useScrollGestures.js.map +1 -0
- package/dist/react/icons.d.ts +1 -1
- package/dist/react/icons.d.ts.map +1 -1
- package/dist/react/icons.js +2 -0
- package/dist/react/icons.js.map +1 -1
- package/dist/react/locale.d.ts.map +1 -1
- package/dist/react/locale.js +4 -0
- package/dist/react/locale.js.map +1 -1
- package/dist/styles.css +7 -1
- package/dist/types/index.d.ts +44 -3
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
A realistic, responsive flipbook engine for React and Next.js.
|
|
4
4
|
|
|
5
|
-
Give it a PDF, images or React components and it gives you a book: a physical page-turn animation you can grab and drag, pinch and double-tap zoom, thumbnails, bookmarks, text search and a table of contents, single or two-page layout that follows the container size, keyboard navigation, accessible controls and right-to-left support. The engine has no React or Next.js dependency, and the React layer is a thin, SSR-safe shell around it.
|
|
5
|
+
Give it a PDF, images or React components and it gives you a book: a physical page-turn animation you can grab and drag, pinch and double-tap zoom, thumbnails, bookmarks, text search and a table of contents, single or two-page layout that follows the container size, a plain scrolling view for reading a PDF like a document, keyboard navigation, accessible controls and right-to-left support. The engine has no React or Next.js dependency, and the React layer is a thin, SSR-safe shell around it.
|
|
6
6
|
|
|
7
7
|
> **Status: Phase 7 (0.10.0).** PDFs (PDF.js), images and custom React pages; drag, swipe and zoom; a toolbar with thumbnails (their size can be set), bookmarks, a changeable background, fullscreen, download, print and share; text search, the PDF's table of contents, clickable PDF links, hotspots, overlays, deep links and a saved reading place; bounded memory on very long PDFs, with benchmarks; linted, with end-to-end, accessibility and visual tests and CI. A license key per website. Not built yet: autoplay, hard pages, page curl, sound, plugins. The API only exposes what is implemented.
|
|
8
8
|
|
|
@@ -99,7 +99,7 @@ The viewer draws nothing on the server. It measures its container in the browser
|
|
|
99
99
|
/>
|
|
100
100
|
```
|
|
101
101
|
|
|
102
|
-
Each has its own page: [making it look like yours](docs/customisation.md), [how a page turns](docs/flipping.md), [image pages and their size](docs/images.md). The demo has a page for each (`/design`, `/flips`, `/image-sizes`).
|
|
102
|
+
Each has its own page: [making it look like yours](docs/customisation.md), [how a page turns](docs/flipping.md), [image pages and their size](docs/images.md). The demo has a page for each (`/design`, `/flips`, `/image-sizes`). To read a PDF as a scrolling document instead of turning its pages, see [the scroll view](docs/scroll.md) (`/scroll` in the demo).
|
|
103
103
|
|
|
104
104
|
## Examples
|
|
105
105
|
|
|
@@ -139,6 +139,10 @@ Each has its own page: [making it look like yours](docs/customisation.md), [how
|
|
|
139
139
|
download print share
|
|
140
140
|
/>
|
|
141
141
|
|
|
142
|
+
// A PDF read the normal way: pages one under another, moved through by scrolling
|
|
143
|
+
// (the flipbook stays the default; displayControl adds a button that swaps between the two)
|
|
144
|
+
<FlipBook source="/guide.pdf" display="scroll" displayControl />
|
|
145
|
+
|
|
142
146
|
// Search the text, show the PDF's own table of contents, keep the page in the address bar
|
|
143
147
|
// and remember where the reader stopped
|
|
144
148
|
<FlipBook source="/guide.pdf" search outline urlState persistState />
|
|
@@ -159,6 +163,7 @@ const ref = useRef<FlipBookController>(null);
|
|
|
159
163
|
<FlipBook ref={ref} pages={pages} />;
|
|
160
164
|
ref.current?.goToPage(10); // animated; jumpToPage(10) moves with no animation
|
|
161
165
|
ref.current?.startTutorial(); // the studio layout's tour; also endTutorial, isTutorialOpen
|
|
166
|
+
ref.current?.setDisplay("scroll"); // or "flip"; null goes back to the prop. getDisplay() reads it
|
|
162
167
|
ref.current?.zoomIn(); // also: zoomOut, setZoom(2), fit, fitWidth, fitHeight, getZoom
|
|
163
168
|
ref.current?.search("train"); // also: nextSearchResult, previousSearchResult, clearSearch, getOutline
|
|
164
169
|
ref.current?.getCacheStats(); // what the viewer holds: cached pages, thumbnails, search index
|
|
@@ -197,6 +202,7 @@ ref.current?.getCacheStats(); // what the viewer holds: cached pages, thumbnails
|
|
|
197
202
|
| `flipStyle` | `"flat"` | `"flat"` swings the page on its spine; `"curl"` folds it from a corner, with the back of the paper and shadows, and follows a dragged corner. Our own implementation, no extra dependency. See [docs/flipping.md](docs/flipping.md). |
|
|
198
203
|
| `orientation` | `"horizontal"` | `"vertical"` is a notebook bound along the top: pages flip **upwards**, a double view stacks two pages, dragging up (or `ArrowDown`) goes forward. Works with both flip styles. |
|
|
199
204
|
| `layout`, `title`, `tutorial` | `"classic"`, viewer name, `false` | `layout="studio"` swaps the toolbar for a header, a rail of panel buttons, a dock with a page slider and edge arrows (made for `theme="midnight-glass"`); `title` is the name in its header; `tutorial` adds a step-by-step tour popup, `true` or `{ autoStart, storage, storageKey }`. See [docs/studio.md](docs/studio.md). |
|
|
205
|
+
| `display`, `displayControl`, `onDisplayChange`, `scrollOptions` | `"flip"`, `false`, none, `{ maxPageWidth: 960, gap: 16 }` | `display="scroll"` shows the pages one under another and moves through them by scrolling, as a PDF is normally read, instead of turning them. Search, thumbnails, bookmarks, zoom, hotspots and the page counter all work in it; `displayControl` adds a toolbar button so the reader can swap; `onDisplayChange` reports their pick; `scrollOptions` sets the widest a page is drawn and the gap between pages. Only the pages near the screen are in the document, so a 500-page PDF costs no more than a short one. See [docs/scroll.md](docs/scroll.md). |
|
|
200
206
|
| `toolbarPosition` | `"bottom"` | `"top"` puts the toolbar above the book. |
|
|
201
207
|
| `toolbarLabels` | `"hidden"` (`"auto"` for the anime themes) | Print the name of each action under its icon: `"auto"` (when the viewer is 560 px wide or more), `"always"` or `"hidden"`. |
|
|
202
208
|
| `background`, `backgroundControl`, `backgroundColors`, `onBackgroundChange` | theme | Any CSS background, including `"transparent"`; a toolbar button with a color picker; the colors it offers; a callback. Also `setBackground()` on the ref. |
|
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
export type ThumbnailSizeName = "small" | "medium" | "large";
|
|
3
3
|
/** A preview width in CSS pixels, or one of the names. */
|
|
4
4
|
export type ThumbnailSize = number | ThumbnailSizeName;
|
|
5
|
+
/**
|
|
6
|
+
* How the pages are shown. `"flip"` is the book, with pages that turn. `"scroll"` is a normal
|
|
7
|
+
* document view: the pages one under another, moved through by scrolling.
|
|
8
|
+
*/
|
|
9
|
+
export type FlipBookDisplay = "flip" | "scroll";
|
|
10
|
+
/** `"flip"` or `"scroll"`, and null for anything else, which callers read as "use the default". */
|
|
11
|
+
export declare function resolveDisplay(display: FlipBookDisplay | null | undefined): FlipBookDisplay | null;
|
|
5
12
|
/** Width in pixels of each named size. */
|
|
6
13
|
export declare const THUMBNAIL_SIZE_NAMES: Readonly<Record<ThumbnailSizeName, number>>;
|
|
7
14
|
export declare const DEFAULT_THUMBNAIL_WIDTH: number;
|
|
@@ -20,20 +27,24 @@ export interface AppearanceSnapshot {
|
|
|
20
27
|
readonly thumbnailSize: number;
|
|
21
28
|
/** The CSS background in use, or null for the theme's own. */
|
|
22
29
|
readonly background: string | null;
|
|
30
|
+
/** How the pages are shown: as a book, or one under another. */
|
|
31
|
+
readonly display: FlipBookDisplay;
|
|
23
32
|
}
|
|
24
33
|
/** What the props say. The reader's own choices, made with the controls, are layered on top. */
|
|
25
34
|
export interface AppearanceDefaults {
|
|
26
35
|
thumbnailSize?: ThumbnailSize | null;
|
|
27
36
|
background?: string | null;
|
|
37
|
+
display?: FlipBookDisplay | null;
|
|
28
38
|
}
|
|
29
39
|
/** The part of the snapshot that a reader or the controller changed. */
|
|
30
40
|
export interface AppearanceChange {
|
|
31
41
|
thumbnailSize?: number;
|
|
32
42
|
background?: string | null;
|
|
43
|
+
display?: FlipBookDisplay;
|
|
33
44
|
}
|
|
34
45
|
/**
|
|
35
|
-
* How the viewer looks, where that can be changed while it runs: the size of the page previews
|
|
36
|
-
* and the
|
|
46
|
+
* How the viewer looks, where that can be changed while it runs: the size of the page previews,
|
|
47
|
+
* the background and how the pages are shown. Each has a default from the props, and a choice made later (by the reader,
|
|
37
48
|
* or from code through the controller) replaces it until the prop itself changes. Framework-free,
|
|
38
49
|
* like the other stores, so `ref.current.setBackground("transparent")` works from anywhere.
|
|
39
50
|
*/
|
|
@@ -41,6 +52,7 @@ export declare class AppearanceStore {
|
|
|
41
52
|
private defaults;
|
|
42
53
|
private pickedSize;
|
|
43
54
|
private pickedBackground;
|
|
55
|
+
private pickedDisplay;
|
|
44
56
|
private snapshot;
|
|
45
57
|
private readonly listeners;
|
|
46
58
|
private readonly pickListeners;
|
|
@@ -48,8 +60,8 @@ export declare class AppearanceStore {
|
|
|
48
60
|
readonly getSnapshot: () => AppearanceSnapshot;
|
|
49
61
|
readonly subscribe: (listener: () => void) => (() => void);
|
|
50
62
|
/**
|
|
51
|
-
* Called for every change made through `setThumbnailSize()` or `
|
|
52
|
-
* values that changed. Not called when the defaults change: that is the app's own doing.
|
|
63
|
+
* Called for every change made through `setThumbnailSize()`, `setBackground()` or `setDisplay()`,
|
|
64
|
+
* with only the values that changed. Not called when the defaults change: that is the app's own doing.
|
|
53
65
|
*/
|
|
54
66
|
onPick(listener: (change: AppearanceChange) => void): () => void;
|
|
55
67
|
/** The values the props ask for. */
|
|
@@ -64,6 +76,8 @@ export declare class AppearanceStore {
|
|
|
64
76
|
setThumbnailSize(size: ThumbnailSize | null): void;
|
|
65
77
|
/** Sets any CSS background, `"transparent"` included, or goes back to the default with `null`. */
|
|
66
78
|
setBackground(background: string | null): void;
|
|
79
|
+
/** Shows the pages as a book (`"flip"`) or one under another (`"scroll"`), or goes back to the default with `null`. */
|
|
80
|
+
setDisplay(display: FlipBookDisplay | null): void;
|
|
67
81
|
private static resolveDefaults;
|
|
68
82
|
private compute;
|
|
69
83
|
private update;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppearanceStore.d.ts","sourceRoot":"","sources":["../../../src/core/appearance/AppearanceStore.ts"],"names":[],"mappings":"AAAA,2DAA2D;AAC3D,MAAM,MAAM,i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AAyB;IACnD,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAiD;gBAEnE,OAAO,GAAE,kBAAuB;IAK5C,QAAQ,CAAC,WAAW,QAAO,kBAAkB,CAAkB;IAE/D,QAAQ,CAAC,SAAS,GAAI,UAAU,MAAM,IAAI,KAAG,CAAC,MAAM,IAAI,CAAC,CAKvD;IAEF;;;OAGG;IACH,MAAM,CAAC,QAAQ,EAAE,CAAC,MAAM,EAAE,gBAAgB,KAAK,IAAI,GAAG,MAAM,IAAI;IAOhE,oCAAoC;IACpC,WAAW,IAAI,kBAAkB;IAIjC;;;;OAIG;IACH,WAAW,CAAC,IAAI,EAAE,kBAAkB,GAAG,IAAI;IAU3C,uEAAuE;IACvE,gBAAgB,CAAC,IAAI,EAAE,aAAa,GAAG,IAAI,GAAG,IAAI;IAMlD,kGAAkG;IAClG,aAAa,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IAM9C,uHAAuH;IACvH,UAAU,CAAC,OAAO,EAAE,eAAe,GAAG,IAAI,GAAG,IAAI;IAMjD,OAAO,CAAC,MAAM,CAAC,eAAe;IAQ9B,OAAO,CAAC,OAAO;IAQf,OAAO,CAAC,MAAM;CAiBf"}
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
/** `"flip"` or `"scroll"`, and null for anything else, which callers read as "use the default". */
|
|
2
|
+
export function resolveDisplay(display) {
|
|
3
|
+
return display === "flip" || display === "scroll" ? display : null;
|
|
4
|
+
}
|
|
1
5
|
/** Width in pixels of each named size. */
|
|
2
6
|
export const THUMBNAIL_SIZE_NAMES = {
|
|
3
7
|
small: 64,
|
|
@@ -31,8 +35,8 @@ export function normalizeBackground(value) {
|
|
|
31
35
|
return trimmed === "" ? null : trimmed;
|
|
32
36
|
}
|
|
33
37
|
/**
|
|
34
|
-
* How the viewer looks, where that can be changed while it runs: the size of the page previews
|
|
35
|
-
* and the
|
|
38
|
+
* How the viewer looks, where that can be changed while it runs: the size of the page previews,
|
|
39
|
+
* the background and how the pages are shown. Each has a default from the props, and a choice made later (by the reader,
|
|
36
40
|
* or from code through the controller) replaces it until the prop itself changes. Framework-free,
|
|
37
41
|
* like the other stores, so `ref.current.setBackground("transparent")` works from anywhere.
|
|
38
42
|
*/
|
|
@@ -40,6 +44,7 @@ export class AppearanceStore {
|
|
|
40
44
|
constructor(initial = {}) {
|
|
41
45
|
this.pickedSize = null;
|
|
42
46
|
this.pickedBackground = null;
|
|
47
|
+
this.pickedDisplay = null;
|
|
43
48
|
this.listeners = new Set();
|
|
44
49
|
this.pickListeners = new Set();
|
|
45
50
|
this.getSnapshot = () => this.snapshot;
|
|
@@ -53,8 +58,8 @@ export class AppearanceStore {
|
|
|
53
58
|
this.snapshot = this.compute();
|
|
54
59
|
}
|
|
55
60
|
/**
|
|
56
|
-
* Called for every change made through `setThumbnailSize()` or `
|
|
57
|
-
* values that changed. Not called when the defaults change: that is the app's own doing.
|
|
61
|
+
* Called for every change made through `setThumbnailSize()`, `setBackground()` or `setDisplay()`,
|
|
62
|
+
* with only the values that changed. Not called when the defaults change: that is the app's own doing.
|
|
58
63
|
*/
|
|
59
64
|
onPick(listener) {
|
|
60
65
|
this.pickListeners.add(listener);
|
|
@@ -78,6 +83,8 @@ export class AppearanceStore {
|
|
|
78
83
|
this.pickedSize = null;
|
|
79
84
|
if (defaults.background !== this.defaults.background)
|
|
80
85
|
this.pickedBackground = null;
|
|
86
|
+
if (defaults.display !== this.defaults.display)
|
|
87
|
+
this.pickedDisplay = null;
|
|
81
88
|
this.defaults = defaults;
|
|
82
89
|
}, false);
|
|
83
90
|
}
|
|
@@ -93,16 +100,24 @@ export class AppearanceStore {
|
|
|
93
100
|
this.pickedBackground = normalizeBackground(background);
|
|
94
101
|
}, true);
|
|
95
102
|
}
|
|
103
|
+
/** Shows the pages as a book (`"flip"`) or one under another (`"scroll"`), or goes back to the default with `null`. */
|
|
104
|
+
setDisplay(display) {
|
|
105
|
+
this.update(() => {
|
|
106
|
+
this.pickedDisplay = resolveDisplay(display);
|
|
107
|
+
}, true);
|
|
108
|
+
}
|
|
96
109
|
static resolveDefaults(input) {
|
|
97
110
|
return {
|
|
98
111
|
thumbnailSize: resolveThumbnailSize(input.thumbnailSize) ?? DEFAULT_THUMBNAIL_WIDTH,
|
|
99
112
|
background: normalizeBackground(input.background),
|
|
113
|
+
display: resolveDisplay(input.display) ?? "flip",
|
|
100
114
|
};
|
|
101
115
|
}
|
|
102
116
|
compute() {
|
|
103
117
|
return {
|
|
104
118
|
thumbnailSize: this.pickedSize ?? this.defaults.thumbnailSize,
|
|
105
119
|
background: this.pickedBackground ?? this.defaults.background,
|
|
120
|
+
display: this.pickedDisplay ?? this.defaults.display,
|
|
106
121
|
};
|
|
107
122
|
}
|
|
108
123
|
update(change, announce) {
|
|
@@ -111,7 +126,8 @@ export class AppearanceStore {
|
|
|
111
126
|
const after = this.compute();
|
|
112
127
|
const sizeChanged = after.thumbnailSize !== before.thumbnailSize;
|
|
113
128
|
const backgroundChanged = after.background !== before.background;
|
|
114
|
-
|
|
129
|
+
const displayChanged = after.display !== before.display;
|
|
130
|
+
if (!sizeChanged && !backgroundChanged && !displayChanged)
|
|
115
131
|
return;
|
|
116
132
|
this.snapshot = after;
|
|
117
133
|
for (const listener of [...this.listeners])
|
|
@@ -123,6 +139,8 @@ export class AppearanceStore {
|
|
|
123
139
|
patch.thumbnailSize = after.thumbnailSize;
|
|
124
140
|
if (backgroundChanged)
|
|
125
141
|
patch.background = after.background;
|
|
142
|
+
if (displayChanged)
|
|
143
|
+
patch.display = after.display;
|
|
126
144
|
for (const listener of [...this.pickListeners])
|
|
127
145
|
listener(patch);
|
|
128
146
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppearanceStore.js","sourceRoot":"","sources":["../../../src/core/appearance/AppearanceStore.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AppearanceStore.js","sourceRoot":"","sources":["../../../src/core/appearance/AppearanceStore.ts"],"names":[],"mappings":"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CAAC,GAAG,IAAI,CAAC,aAAa,CAAC;YAAE,QAAQ,CAAC,KAAK,CAAC,CAAC;IAClE,CAAC;CACF"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The geometry of the scrolling display: a column of equally tall pages with a gap between them.
|
|
3
|
+
* Everything here is arithmetic on numbers, with no DOM, so that a 5,000-page book costs no more to
|
|
4
|
+
* lay out than a 5-page one and the rules can be tested without a browser.
|
|
5
|
+
*
|
|
6
|
+
* Pages are numbered from 1, as everywhere else in the library. Offsets are in CSS pixels, measured
|
|
7
|
+
* from the top of the scrollable content.
|
|
8
|
+
*/
|
|
9
|
+
/** The widest a page is drawn at zoom 1, in pixels, when the viewer is wider than that. */
|
|
10
|
+
export declare const DEFAULT_MAX_PAGE_WIDTH = 960;
|
|
11
|
+
/** The space between two pages, in pixels. */
|
|
12
|
+
export declare const DEFAULT_PAGE_GAP = 16;
|
|
13
|
+
export interface ScrollGeometry {
|
|
14
|
+
/** The width of a page at zoom 1: the viewer's width less the padding, up to `maxPageWidth`. */
|
|
15
|
+
readonly baseWidth: number;
|
|
16
|
+
/** The width of a page at the current zoom. */
|
|
17
|
+
readonly pageWidth: number;
|
|
18
|
+
readonly pageHeight: number;
|
|
19
|
+
/** Space round the column. */
|
|
20
|
+
readonly padding: number;
|
|
21
|
+
/** Space between two pages. */
|
|
22
|
+
readonly gap: number;
|
|
23
|
+
/** The distance from the top of one page to the top of the next. */
|
|
24
|
+
readonly slot: number;
|
|
25
|
+
}
|
|
26
|
+
export interface ScrollGeometryInput {
|
|
27
|
+
/** Width of the scrolling area without its scroll bar. */
|
|
28
|
+
viewWidth: number;
|
|
29
|
+
/** Width over height of a page. */
|
|
30
|
+
aspect: number;
|
|
31
|
+
/** 1 is the page at the width of the viewer. */
|
|
32
|
+
zoom: number;
|
|
33
|
+
padding: number;
|
|
34
|
+
gap: number;
|
|
35
|
+
maxPageWidth: number;
|
|
36
|
+
}
|
|
37
|
+
/** Sizes the pages for a viewer `viewWidth` wide at `zoom`. Never smaller than one pixel. */
|
|
38
|
+
export declare function scrollGeometry(input: ScrollGeometryInput): ScrollGeometry;
|
|
39
|
+
/** Distance from the top of the content to the top of `page`. */
|
|
40
|
+
export declare function pageTop(page: number, geometry: ScrollGeometry): number;
|
|
41
|
+
/** The scroll position that puts `page` at the top of the viewer, with the padding above it. */
|
|
42
|
+
export declare function scrollTopForPage(page: number, geometry: ScrollGeometry): number;
|
|
43
|
+
export interface PageRange {
|
|
44
|
+
/** First page (1-based) that is at least partly in view. */
|
|
45
|
+
readonly first: number;
|
|
46
|
+
/** Last page that is at least partly in view. */
|
|
47
|
+
readonly last: number;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* The pages that show in a viewer `viewHeight` tall scrolled to `scrollTop`, or `null` when the book
|
|
51
|
+
* has none. A page touching the edge of the viewer without showing any of itself is not counted.
|
|
52
|
+
*/
|
|
53
|
+
export declare function visibleRange(scrollTop: number, viewHeight: number, pageCount: number, geometry: ScrollGeometry): PageRange | null;
|
|
54
|
+
/**
|
|
55
|
+
* The page the reader is on: the one with the most of itself in view. Pages that show equally
|
|
56
|
+
* (several small ones, all whole) go to the one nearest the top.
|
|
57
|
+
*/
|
|
58
|
+
export declare function dominantPage(scrollTop: number, viewHeight: number, pageCount: number, geometry: ScrollGeometry): number;
|
|
59
|
+
export interface ScrollPosition {
|
|
60
|
+
top: number;
|
|
61
|
+
left: number;
|
|
62
|
+
}
|
|
63
|
+
export interface AnchorInput {
|
|
64
|
+
/** The scroll position before the pages changed size. */
|
|
65
|
+
scrollTop: number;
|
|
66
|
+
scrollLeft: number;
|
|
67
|
+
/** The point that stays where it is on the screen, in pixels from the top left of the viewer. */
|
|
68
|
+
focalX: number;
|
|
69
|
+
focalY: number;
|
|
70
|
+
viewWidth: number;
|
|
71
|
+
before: ScrollGeometry;
|
|
72
|
+
after: ScrollGeometry;
|
|
73
|
+
}
|
|
74
|
+
/** The width of the scrolled content: the viewer, or the page and its padding when that is wider. */
|
|
75
|
+
export declare const contentWidth: (viewWidth: number, geometry: ScrollGeometry) => number;
|
|
76
|
+
/**
|
|
77
|
+
* The scroll position that keeps the point under `focal` over the same spot of the page when the
|
|
78
|
+
* pages change size: after a zoom, or when the viewer is resized. The point is found by how far down
|
|
79
|
+
* the column it is in page slots, and how far from the middle of the page across.
|
|
80
|
+
*/
|
|
81
|
+
export declare function anchoredScroll(input: AnchorInput): ScrollPosition;
|
|
82
|
+
/** Whether two geometries put the pages in the same places. */
|
|
83
|
+
export declare function sameGeometry(a: ScrollGeometry | null, b: ScrollGeometry): boolean;
|
|
84
|
+
//# sourceMappingURL=scroll.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scroll.d.ts","sourceRoot":"","sources":["../../../src/core/layout/scroll.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,2FAA2F;AAC3F,eAAO,MAAM,sBAAsB,MAAM,CAAC;AAC1C,8CAA8C;AAC9C,eAAO,MAAM,gBAAgB,KAAK,CAAC;AAEnC,MAAM,WAAW,cAAc;IAC7B,gGAAgG;IAChG,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,+CAA+C;IAC/C,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,8BAA8B;IAC9B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,+BAA+B;IAC/B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,oEAAoE;IACpE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,mBAAmB;IAClC,0DAA0D;IAC1D,SAAS,EAAE,MAAM,CAAC;IAClB,mCAAmC;IACnC,MAAM,EAAE,MAAM,CAAC;IACf,gDAAgD;IAChD,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE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X,CAAC;AAEjE;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,WAAW,GAAG,cAAc,CAWjE;AAED,+DAA+D;AAC/D,wBAAgB,YAAY,CAAC,CAAC,EAAE,cAAc,GAAG,IAAI,EAAE,CAAC,EAAE,cAAc,GAAG,OAAO,CAQjF"}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The geometry of the scrolling display: a column of equally tall pages with a gap between them.
|
|
3
|
+
* Everything here is arithmetic on numbers, with no DOM, so that a 5,000-page book costs no more to
|
|
4
|
+
* lay out than a 5-page one and the rules can be tested without a browser.
|
|
5
|
+
*
|
|
6
|
+
* Pages are numbered from 1, as everywhere else in the library. Offsets are in CSS pixels, measured
|
|
7
|
+
* from the top of the scrollable content.
|
|
8
|
+
*/
|
|
9
|
+
/** The widest a page is drawn at zoom 1, in pixels, when the viewer is wider than that. */
|
|
10
|
+
export const DEFAULT_MAX_PAGE_WIDTH = 960;
|
|
11
|
+
/** The space between two pages, in pixels. */
|
|
12
|
+
export const DEFAULT_PAGE_GAP = 16;
|
|
13
|
+
const finite = (value, fallback) => (Number.isFinite(value) ? value : fallback);
|
|
14
|
+
/** Sizes the pages for a viewer `viewWidth` wide at `zoom`. Never smaller than one pixel. */
|
|
15
|
+
export function scrollGeometry(input) {
|
|
16
|
+
const padding = Math.max(0, finite(input.padding, 0));
|
|
17
|
+
const gap = Math.max(0, finite(input.gap, DEFAULT_PAGE_GAP));
|
|
18
|
+
const aspect = input.aspect > 0 && Number.isFinite(input.aspect) ? input.aspect : 3 / 4;
|
|
19
|
+
const room = Math.max(1, finite(input.viewWidth, 1) - padding * 2);
|
|
20
|
+
const baseWidth = Math.max(1, Math.min(room, input.maxPageWidth > 0 ? input.maxPageWidth : room));
|
|
21
|
+
const zoom = input.zoom > 0 && Number.isFinite(input.zoom) ? input.zoom : 1;
|
|
22
|
+
const pageWidth = Math.max(1, baseWidth * zoom);
|
|
23
|
+
const pageHeight = pageWidth / aspect;
|
|
24
|
+
return { baseWidth, pageWidth, pageHeight, padding, gap, slot: pageHeight + gap };
|
|
25
|
+
}
|
|
26
|
+
/** Distance from the top of the content to the top of `page`. */
|
|
27
|
+
export function pageTop(page, geometry) {
|
|
28
|
+
return geometry.padding + (page - 1) * geometry.slot;
|
|
29
|
+
}
|
|
30
|
+
/** The scroll position that puts `page` at the top of the viewer, with the padding above it. */
|
|
31
|
+
export function scrollTopForPage(page, geometry) {
|
|
32
|
+
return Math.max(0, (page - 1) * geometry.slot);
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* The pages that show in a viewer `viewHeight` tall scrolled to `scrollTop`, or `null` when the book
|
|
36
|
+
* has none. A page touching the edge of the viewer without showing any of itself is not counted.
|
|
37
|
+
*/
|
|
38
|
+
export function visibleRange(scrollTop, viewHeight, pageCount, geometry) {
|
|
39
|
+
if (pageCount <= 0 || viewHeight <= 0)
|
|
40
|
+
return null;
|
|
41
|
+
const { padding, slot, pageHeight } = geometry;
|
|
42
|
+
const top = Math.max(0, scrollTop);
|
|
43
|
+
const bottom = top + viewHeight;
|
|
44
|
+
// The page whose slot holds the top edge, and the one that holds the bottom edge.
|
|
45
|
+
let first = Math.floor((top - padding) / slot) + 1;
|
|
46
|
+
let last = Math.floor((bottom - padding) / slot) + 1;
|
|
47
|
+
first = Math.min(pageCount, Math.max(1, first));
|
|
48
|
+
last = Math.min(pageCount, Math.max(1, last));
|
|
49
|
+
// The gap below a page is not the page: step past a first page that ended above the viewer.
|
|
50
|
+
if (first < pageCount && pageTop(first, geometry) + pageHeight <= top)
|
|
51
|
+
first += 1;
|
|
52
|
+
if (last > first && pageTop(last, geometry) >= bottom)
|
|
53
|
+
last -= 1;
|
|
54
|
+
return { first, last: Math.max(first, last) };
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* The page the reader is on: the one with the most of itself in view. Pages that show equally
|
|
58
|
+
* (several small ones, all whole) go to the one nearest the top.
|
|
59
|
+
*/
|
|
60
|
+
export function dominantPage(scrollTop, viewHeight, pageCount, geometry) {
|
|
61
|
+
const range = visibleRange(scrollTop, viewHeight, pageCount, geometry);
|
|
62
|
+
if (range === null)
|
|
63
|
+
return pageCount > 0 ? 1 : 0;
|
|
64
|
+
const top = Math.max(0, scrollTop);
|
|
65
|
+
const bottom = top + viewHeight;
|
|
66
|
+
let best = range.first;
|
|
67
|
+
let bestShown = -1;
|
|
68
|
+
for (let page = range.first; page <= range.last; page += 1) {
|
|
69
|
+
const start = pageTop(page, geometry);
|
|
70
|
+
const shown = Math.min(bottom, start + geometry.pageHeight) - Math.max(top, start);
|
|
71
|
+
// A tolerance, so that a rounding error does not pick the lower page of two that show equally.
|
|
72
|
+
if (shown > bestShown + 0.5) {
|
|
73
|
+
best = page;
|
|
74
|
+
bestShown = shown;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
return best;
|
|
78
|
+
}
|
|
79
|
+
/** The width of the scrolled content: the viewer, or the page and its padding when that is wider. */
|
|
80
|
+
export const contentWidth = (viewWidth, geometry) => Math.max(viewWidth, geometry.pageWidth + geometry.padding * 2);
|
|
81
|
+
/**
|
|
82
|
+
* The scroll position that keeps the point under `focal` over the same spot of the page when the
|
|
83
|
+
* pages change size: after a zoom, or when the viewer is resized. The point is found by how far down
|
|
84
|
+
* the column it is in page slots, and how far from the middle of the page across.
|
|
85
|
+
*/
|
|
86
|
+
export function anchoredScroll(input) {
|
|
87
|
+
const { before, after, focalX, focalY, viewWidth } = input;
|
|
88
|
+
const slotsDown = (input.scrollTop + focalY - before.padding) / before.slot;
|
|
89
|
+
const top = after.padding + slotsDown * after.slot - focalY;
|
|
90
|
+
const wasWide = contentWidth(viewWidth, before);
|
|
91
|
+
const nowWide = contentWidth(viewWidth, after);
|
|
92
|
+
const acrossPage = input.scrollLeft + focalX - wasWide / 2;
|
|
93
|
+
const left = nowWide / 2 + acrossPage * (after.pageWidth / before.pageWidth) - focalX;
|
|
94
|
+
return { top: Math.max(0, top), left: Math.max(0, left) };
|
|
95
|
+
}
|
|
96
|
+
/** Whether two geometries put the pages in the same places. */
|
|
97
|
+
export function sameGeometry(a, b) {
|
|
98
|
+
return (a !== null &&
|
|
99
|
+
a.pageWidth === b.pageWidth &&
|
|
100
|
+
a.pageHeight === b.pageHeight &&
|
|
101
|
+
a.padding === b.padding &&
|
|
102
|
+
a.gap === b.gap);
|
|
103
|
+
}
|
|
104
|
+
//# sourceMappingURL=scroll.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scroll.js","sourceRoot":"","sources":["../../../src/core/layout/scroll.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,2FAA2F;AAC3F,MAAM,CAAC,MAAM,sBAAsB,GAAG,GAAG,CAAC;AAC1C,8CAA8C;AAC9C,MAAM,CAAC,MAAM,gBAAgB,GAAG,EAAE,CAAC;AA4BnC,MAAM,MAAM,GAAG,CAAC,KAAa,EAAE,QAAgB,EAAU,EAAE,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;AAExG,6FAA6F;AAC7F,MAAM,UAAU,cAAc,CAAC,KAA0B;IACvD,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC;IACtD,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,GAAG,EAAE,gBAAgB,CAAC,CAAC,CAAC;IAC7D,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,IAAI,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IACxF,MAAM,IAAI,GAAG,IAAI,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M,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,KAAK,CAAC;IAC3D,MAAM,SAAS,GAAG,CAAC,KAAK,CAAC,SAAS,GAAG,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC;IAC5E,MAAM,GAAG,GAAG,KAAK,CAAC,OAAO,GAAG,SAAS,GAAG,KAAK,CAAC,IAAI,GAAG,MAAM,CAAC;IAE5D,MAAM,OAAO,GAAG,YAAY,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;IAChD,MAAM,OAAO,GAAG,YAAY,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;IAC/C,MAAM,UAAU,GAAG,KAAK,CAAC,UAAU,GAAG,MAAM,GAAG,OAAO,GAAG,CAAC,CAAC;IAC3D,MAAM,IAAI,GAAG,OAAO,GAAG,CAAC,GAAG,UAAU,GAAG,CAAC,KAAK,CAAC,SAAS,GAAG,MAAM,CAAC,SAAS,CAAC,GAAG,MAAM,CAAC;IAEtF,OAAO,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,EAAE,CAAC;AAC5D,CAAC;AAED,+DAA+D;AAC/D,MAAM,UAAU,YAAY,CAAC,CAAwB,EAAE,CAAiB;IACtE,OAAO,CACL,CAAC,KAAK,IAAI;QACV,CAAC,CAAC,SAAS,KAAK,CAAC,CAAC,SAAS;QAC3B,CAAC,CAAC,UAAU,KAAK,CAAC,CAAC,UAAU;QAC7B,CAAC,CAAC,OAAO,KAAK,CAAC,CAAC,OAAO;QACvB,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,GAAG,CAChB,CAAC;AACJ,CAAC"}
|
package/dist/core/types.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import type { PageCacheStats } from "./cache/PageCache.js";
|
|
|
3
3
|
import type { SearchResult } from "./search/SearchController.js";
|
|
4
4
|
import type { PanelId } from "./ui/UiStore.js";
|
|
5
5
|
import type { Spread } from "./layout/spreads.js";
|
|
6
|
-
import type { ThumbnailSize } from "./appearance/AppearanceStore.js";
|
|
6
|
+
import type { FlipBookDisplay, ThumbnailSize } from "./appearance/AppearanceStore.js";
|
|
7
7
|
/** How many pages are visible at once. */
|
|
8
8
|
export type FlipBookView = "single" | "double";
|
|
9
9
|
/** `auto` picks `single` or `double` from the container width. */
|
|
@@ -135,7 +135,7 @@ export interface FlipBookPanelControls {
|
|
|
135
135
|
}
|
|
136
136
|
/**
|
|
137
137
|
* How the viewer looks. These work whether or not the matching toolbar control is shown, and a
|
|
138
|
-
* value set here replaces the `thumbnailSize` and `
|
|
138
|
+
* value set here replaces the `thumbnailSize`, `background` and `display` props until a prop changes.
|
|
139
139
|
*/
|
|
140
140
|
export interface FlipBookAppearanceControls {
|
|
141
141
|
/**
|
|
@@ -152,6 +152,13 @@ export interface FlipBookAppearanceControls {
|
|
|
152
152
|
setBackground: (background: string | null) => void;
|
|
153
153
|
/** The background in use, or `null` for the theme's own. */
|
|
154
154
|
getBackground: () => string | null;
|
|
155
|
+
/**
|
|
156
|
+
* `"flip"` shows the pages as a book that turns; `"scroll"` shows them one under another, in a
|
|
157
|
+
* view that scrolls. The page you are on stays the same. `null` goes back to the `display` prop.
|
|
158
|
+
*/
|
|
159
|
+
setDisplay: (display: FlipBookDisplay | null) => void;
|
|
160
|
+
/** How the pages are shown now. */
|
|
161
|
+
getDisplay: () => FlipBookDisplay;
|
|
155
162
|
}
|
|
156
163
|
/** Toolbar actions, for use from your own UI. Each resolves when it is done and never rejects. */
|
|
157
164
|
export interface FlipBookActionControls {
|
package/dist/core/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/core/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO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;IACvC,4CAA4C;IAC5C,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B,+BAA+B;IAC/B,WAAW,EAAE,MAAM,IAAI,CAAC;IACxB,cAAc,EAAE,MAAM,OAAO,CAAC;CAC/B;AAED,iFAAiF;AACjF,MAAM,MAAM,kBAAkB,GAAG,kBAAkB,GACjD,oBAAoB,GACpB,0BAA0B,GAC1B,wBAAwB,GACxB,qBAAqB,GACrB,wBAAwB,GACxB,0BAA0B,GAC1B,sBAAsB,GACtB,sBAAsB,GACtB,uBAAuB,GACvB,qBAAqB,CAAC"}
|
|
@@ -110,6 +110,8 @@ export declare class ZoomController {
|
|
|
110
110
|
}): void;
|
|
111
111
|
zoomIn(focal?: Point): void;
|
|
112
112
|
zoomOut(focal?: Point): void;
|
|
113
|
+
/** Back to the fitted size at once, with no animation. For when the pages are laid out afresh. */
|
|
114
|
+
reset(): void;
|
|
113
115
|
/** Fitted size, centred. */
|
|
114
116
|
fit(): void;
|
|
115
117
|
fitWidth(): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ZoomController.d.ts","sourceRoot":"","sources":["../../../src/core/zoom/ZoomController.ts"],"names":[],"mappings":"AACA,OAAO,EAA0B,KAAK,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAEnF,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,qCAAqC,CAAC;AAEjE,MAAM,WAAW,UAAU;IACzB,wDAAwD;IACxD,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,2CAA2C;IAC3C,QAAQ,EAAE,MAAM,CAAC;IACjB,kCAAkC;IAClC,aAAa,EAAE,MAAM,CAAC;IACtB,2CAA2C;IAC3C,aAAa,EAAE,OAAO,CAAC;CACxB;AAED,sFAAsF;AACtF,MAAM,WAAW,YAAY;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,YAA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), focal ? { focal } : {});
|
|
163
163
|
}
|
|
164
|
+
/** Back to the fitted size at once, with no animation. For when the pages are laid out afresh. */
|
|
165
|
+
reset() {
|
|
166
|
+
if (!this.config.enabled)
|
|
167
|
+
return;
|
|
168
|
+
this.goTo({ zoom: 1, panX: 0, panY: 0 }, false);
|
|
169
|
+
}
|
|
164
170
|
/** Fitted size, centred. */
|
|
165
171
|
fit() {
|
|
166
172
|
if (!this.config.enabled)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ZoomController.js","sourceRoot":"","sources":["../../../src/core/zoom/ZoomController.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,sBAAsB,EAAkB,MAAM,2BAA2B,CAAC;AACnF,OAAO,EAAE,KAAK,EAAoB,MAAM,uBAAuB,CAAC;AA0DhE,oEAAoE;AACpE,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,CAAC;AAEjC,MAAM,YAAY,GAAG,GAAG,CAAC;AACzB,MAAM,KAAK,GAAG,CAAC,KAAa,EAAE,GAAW,EAAE,GAAW,EAAU,EAAE,CAChE,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC,CAAC;AACtC,MAAM,KAAK,GAAG,CAAC,KAAa,EAAE,MAAM,GAAG,CAAC,EAAU,EAAE;IAClD,MAAM,CAAC,GAAG,EAAE,IAAI,MAAM,CAAC;IACvB,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;AACnC,CAAC,CAAC;AAEF,MAAM,QAAQ,GAAe;IAC3B,OAAO,EAAE,IAAI;IACb,OAAO,EAAE,CAAC;IACV,OAAO,EAAE,CAAC;IACV,QAAQ,EAAE,IAAI;IACd,aAAa,EAAE,CAAC;IAChB,aAAa,EAAE,KAAK;CACrB,CAAC;AAEF;;;;;;;GA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AC,GAAG,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC;IACtD,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export * from "./react/index.js";
|
|
2
2
|
export { DEFAULT_IMAGE_WIDTHS } from "./image/select.js";
|
|
3
3
|
export { NEXT_IMAGE_WIDTHS, createNextImageLoader, nextImageLoader, nextImages } from "./image/nextLoader.js";
|
|
4
|
-
export type { AppearanceSnapshot, AspectRatioProp, BackgroundChoice, BookmarkOptions, BookmarkStorage, CustomPage, DownloadOptions, EngineState, FlipBookAppearanceControls, FlipBookBookProps, FlipBookController, FlipBookDirection, FlipBookError, FlipBookErrorCode, FlipBookFeatures, FlipBookFlipStyle, FlipBookHotspot, FlipBookLayout, FlipBookLink, FlipBookLocale, FlipBookMode, FlipBookOrientation, FlipBookPage, FlipBookPart, FlipBookPageInput, FlipBookProps, FlipBookStageProps, FlipBookTheme, FlipBookThemeDefinition, FlipBookThemeInput, FlipBookThemeName, FlipBookToolbarLabels, FlipBookThemeTokens, FlipBookTutorialControls, FlipBookTutorialOptions, FlipBookTutorialStorage, FlipBookTurnEvent, FlipBookView, ImageCandidate, ImageLoaderArgs, ImageOptions, ImagePage, ImageTextBox, PasswordReason, PersistStateOptions, PdfOptions, PdfPage, PdfSource, PrintOptions, SearchOptions, ShareOptions, ThumbnailSize, ThumbnailSizeName, PanelId, UiSnapshot, UrlStateOptions, WhileTurning, ZoomSnapshot, } from "./types/index.js";
|
|
4
|
+
export type { AppearanceSnapshot, AspectRatioProp, BackgroundChoice, BookmarkOptions, BookmarkStorage, CustomPage, DownloadOptions, EngineState, FlipBookAppearanceControls, FlipBookBookProps, FlipBookController, FlipBookDirection, FlipBookDisplay, FlipBookError, FlipBookErrorCode, FlipBookFeatures, FlipBookFlipStyle, FlipBookHotspot, FlipBookLayout, FlipBookLink, FlipBookLocale, FlipBookMode, FlipBookOrientation, FlipBookPage, FlipBookPart, FlipBookPageInput, FlipBookProps, FlipBookScrollOptions, FlipBookStageProps, FlipBookTheme, FlipBookThemeDefinition, FlipBookThemeInput, FlipBookThemeName, FlipBookToolbarLabels, FlipBookThemeTokens, FlipBookTutorialControls, FlipBookTutorialOptions, FlipBookTutorialStorage, FlipBookTurnEvent, FlipBookView, ImageCandidate, ImageLoaderArgs, ImageOptions, ImagePage, ImageTextBox, PasswordReason, PersistStateOptions, PdfOptions, PdfPage, PdfSource, PrintOptions, SearchOptions, ShareOptions, ThumbnailSize, ThumbnailSizeName, PanelId, UiSnapshot, UrlStateOptions, WhileTurning, ZoomSnapshot, } from "./types/index.js";
|
|
5
5
|
export type { FlipBookCacheControls, FlipBookCacheStats, FlipBookOutlineControls, FlipBookOutlineItem, FlipBookSearchControls, SearchResult, SearchSnapshot, StorageLike, } from "./core/index.js";
|
|
6
6
|
export { LICENSE_INFO_URL, hostMatchesDomain, isDevelopmentHost, parseLicenseKey, verifyLicense } from "./license/index.js";
|
|
7
7
|
export type { LicenseProblem, LicensePayload, LicensePublicKey, LicenseStatus, VerifyLicenseOptions } from "./license/index.js";
|