flipbookengine 0.2.4 → 0.4.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/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.4.0
4
+
5
+ - externalized PDF.js as an npm dependency with consumer-provided worker configuration
6
+ - fixed PDF-only initialization when `pages` is omitted
7
+ - isolated engine state and lifecycle cancellation per instance
8
+ - aligned framework wrappers, events, options, fullscreen, audio, and download controls
9
+ - added progressive image quality loading and bounded PDF rendering with cancellation
10
+ - added accessibility semantics, structured PDF progress/error events, and expanded regression tests
11
+ - added CI dependency audit, reproducible package verification, and provenance-enabled release workflow
12
+
3
13
  ## 0.1.0
4
14
 
5
15
  - renamed public product identity to FlipbookEngine
package/README.md CHANGED
@@ -1,194 +1,279 @@
1
- # FlipbookEngine
2
-
3
- FlipbookEngine is a modern, lightweight, and embeddable HTML flipbook viewer for PDF-backed catalogs, brochures, and digital publications. Written in TypeScript, it features single-page and spread modes, a thumbnail rail, smooth zoom/pan, full internationalization (i18n), and robust theme customization.
4
-
5
- ## Highlights
6
-
7
- - **Dual-Mode Layout**: Seamlessly switches between single-page (mobile-optimized) and spread (book/catalog layout) modes.
8
- - **Rich Interaction**: Built-in thumbnail navigation rail, smooth zoom & pan, and HTML5 fullscreen support.
9
- - **Theme Engine**: Styled with compiled CSS and CSS Custom Properties, featuring full support for light/dark modes (auto-responsive to Bootstrap 5 or tailorable per instance).
10
- - **Multi-Language (i18n)**: Out-of-the-box support for English (`en`) and Turkish (`tr`) with customizable overrides.
11
- - **Framework Wrappers**: Direct React and Vue wrapper exports for seamless modern integration.
12
-
13
- ## Installation
14
-
15
- Install via npm:
1
+ # FlipbookEngine
2
+
3
+ [![NPM Version](https://img.shields.io/npm/v/flipbookengine?style=flat-square&color=blue)](https://www.npmjs.com/package/flipbookengine)
4
+ [![License](https://img.shields.io/npm/l/flipbookengine?style=flat-square)](https://github.com/Bizeka/flipbook-engine/blob/main/LICENSE)
5
+ [![NPM Unpacked Size](https://img.shields.io/npm/unpacked-size/flipbookengine?style=flat-square)](https://www.npmjs.com/package/flipbookengine)
6
+ [![NPM Downloads](https://img.shields.io/npm/dt/flipbookengine?style=flat-square)](https://www.npmjs.com/package/flipbookengine)
7
+
8
+ **[Live Demo & Playground ↗](https://flipbookengine.com)**
9
+
10
+ FlipbookEngine is a modern, lightweight, and embeddable HTML flipbook viewer for PDF-backed catalogs, brochures, and digital publications. Written in TypeScript, it features single-page and spread modes, a thumbnail rail, smooth zoom/pan, full internationalization (i18n), and robust theme customization.
11
+
12
+ ## Highlights
13
+
14
+ - **Dual-Mode Layout**: Seamlessly switches between single-page (mobile-optimized) and spread (book/catalog layout) modes.
15
+ - **Rich Interaction**: Built-in thumbnail navigation rail, smooth zoom & pan, and HTML5 fullscreen support.
16
+ - **Media & Autoplay**: Configurable page-flip sound effects and automated slideshow presentation with `Autoplay`.
17
+ - **Theme Engine**: Styled with compiled CSS and CSS Custom Properties, featuring full support for light/dark modes (auto-responsive to Bootstrap 5 or tailorable per instance).
18
+ - **Multi-Language (i18n)**: Out-of-the-box support for English (`en`) and Turkish (`tr`) with customizable overrides.
19
+ - **Framework Wrappers**: Direct React and Vue wrapper exports for seamless modern integration.
20
+
21
+ ## Installation
22
+
23
+ Install via npm:
24
+
25
+ ```bash
26
+ npm install flipbookengine
27
+ ```
28
+
29
+ `pdfjs-dist` is a production dependency of FlipbookEngine. It is installed by npm, but is deliberately excluded from the FlipbookEngine bundle so applications can deduplicate, cache, and upgrade PDF.js independently.
30
+
31
+ ## Quick Start
32
+
33
+ ### npm and Bundlers
34
+
35
+ Configure the PDF.js worker in the consuming application. The `?url` suffix is supported by Vite and other modern bundlers that emit imported assets.
36
+
37
+ ```ts
38
+ import { FlipbookEngine } from 'flipbookengine';
39
+ import 'flipbookengine/styles.css';
40
+ import pdfWorkerSrc from 'pdfjs-dist/build/pdf.worker.mjs?url';
41
+
42
+ const engine = new FlipbookEngine('#viewer', {
43
+ allowDownload: true,
44
+ showThumbs: true,
45
+ primaryColor: '#7367f0',
46
+ theme: 'auto',
47
+ locale: 'en',
48
+ pdfWorkerSrc
49
+ });
50
+
51
+ await engine.init('/files/catalog.pdf');
52
+ ```
53
+
54
+ Passing `pages` remains optional. When omitted, FlipbookEngine renders the pages from `pdfUrl`.
55
+
56
+ ### Browser CDN
57
+
58
+ Use the ESM build with an import map for PDF.js. The worker must be served from a URL your site permits in its Content Security Policy.
59
+
60
+ ```html
61
+ <link rel="stylesheet" href="https://unpkg.com/flipbookengine@0.4.0/dist/flipbook-engine.css" />
62
+ <div id="viewer" style="width: 100%; height: 600px;"></div>
63
+
64
+ <script type="importmap">
65
+ {
66
+ "imports": {
67
+ "pdfjs-dist": "https://unpkg.com/pdfjs-dist@5.4.530/build/pdf.min.mjs"
68
+ }
69
+ }
70
+ </script>
71
+ <script type="module">
72
+ import { FlipbookEngine } from 'https://unpkg.com/flipbookengine@0.4.0/dist/flipbook-engine.js';
73
+
74
+ const engine = new FlipbookEngine('#viewer', {
75
+ pdfWorkerSrc: 'https://unpkg.com/pdfjs-dist@5.4.530/build/pdf.worker.min.mjs'
76
+ });
77
+
78
+ await engine.init('/files/catalog.pdf');
79
+ </script>
80
+ ```
81
+
82
+ ### React
83
+
84
+ ```tsx
85
+ import React, { useRef } from 'react';
86
+ import { Flipbook, FlipbookRef } from 'flipbookengine/react';
87
+ import 'flipbookengine/styles.css';
88
+
89
+ function CatalogViewer() {
90
+ const flipbookRef = useRef<FlipbookRef>(null);
91
+
92
+ const handleNextPage = () => {
93
+ flipbookRef.current?.goToPage(flipbookRef.current.getCurrentPage() + 1);
94
+ };
95
+
96
+ return (
97
+ <Flipbook
98
+ ref={flipbookRef}
99
+ pdfUrl="/files/catalog.pdf"
100
+ pages={[
101
+ { kind: 'cover', pageNumber: 1, normal: '/img/1.jpg', low: '/img/1-low.jpg', thumb: '/img/1-thumb.jpg' },
102
+ { kind: 'spread', pageNumbers: [2, 3], normal: '/img/2-3.jpg', low: '/img/2-3-low.jpg', thumb: '/img/2-3-thumb.jpg' }
103
+ ]}
104
+ allowDownload={true}
105
+ showThumbs={true}
106
+ primaryColor="#7367f0"
107
+ />
108
+ );
109
+ }
110
+ ```
111
+
112
+ ### Vue 3
113
+
114
+ ```vue
115
+ <template>
116
+ <Flipbook
117
+ pdfUrl="/files/catalog.pdf"
118
+ :pages="pages"
119
+ :allowDownload="true"
120
+ :showThumbs="true"
121
+ primaryColor="#7367f0"
122
+ />
123
+ </template>
124
+
125
+ <script setup>
126
+ import { Flipbook } from 'flipbookengine/vue';
127
+ import 'flipbookengine/styles.css';
128
+
129
+ const pages = [
130
+ { kind: 'cover', pageNumber: 1, normal: '/img/1.jpg', low: '/img/1-low.jpg', thumb: '/img/1-thumb.jpg' },
131
+ { kind: 'spread', pageNumbers: [2, 3], normal: '/img/2-3.jpg', low: '/img/2-3-low.jpg', thumb: '/img/2-3-thumb.jpg' }
132
+ ];
133
+ </script>
134
+ ```
135
+
136
+ ## Migration Notes
137
+
138
+ Upgrading from 0.3.x to 0.4.0 keeps the public engine methods intact. The release isolates state per engine instance, makes wrapper updates lifecycle-safe, and scopes viewer markup to its container. If host CSS or automation selected the former fixed viewer IDs, migrate those selectors to the instance classes documented in the theming guide. PDF-backed consumers should configure `pdfWorkerSrc`; image-only viewers do not expose a download control.
139
+
140
+
141
+ ## Local npm Release
142
+
143
+ Run the complete release verification locally before publishing:
16
144
 
17
145
  ```bash
18
- npm install flipbookengine
19
- ```
20
-
21
- For direct CDN usage in the browser (Vanilla HTML/JS):
22
-
23
- ```html
24
- <link rel="stylesheet" href="https://unpkg.com/flipbookengine/dist/flipbook-engine.css" />
25
- <script src="https://unpkg.com/flipbookengine/dist/flipbook-engine.iife.js"></script>
26
- ```
27
-
28
- ## Quick Start
29
-
30
- ### Vanilla HTML / JS
31
-
32
- Include the styles and script, then initialize the engine:
33
-
34
- ```html
35
- <div id="viewer" style="width: 100%; height: 600px;"></div>
36
-
37
- <script>
38
- const engine = new FlipbookEngine('#viewer', {
39
- allowDownload: true,
40
- showThumbs: true,
41
- primaryColor: '#7367f0',
42
- theme: 'auto',
43
- locale: 'en'
44
- });
45
-
46
- engine.init('/files/catalog.pdf', [
47
- { kind: 'cover', pageNumber: 1, normal: '/img/1.jpg', low: '/img/1-low.jpg', thumb: '/img/1-thumb.jpg' },
48
- { kind: 'spread', pageNumbers: [2, 3], normal: '/img/2-3.jpg', low: '/img/2-3-low.jpg', thumb: '/img/2-3-thumb.jpg' }
49
- ]);
50
- </script>
51
- ```
52
-
53
- ### React
54
-
55
- ```tsx
56
- import React, { useRef } from 'react';
57
- import { Flipbook, FlipbookRef } from 'flipbookengine/react';
58
- import 'flipbookengine/dist/flipbook-engine.css';
59
-
60
- function CatalogViewer() {
61
- const flipbookRef = useRef<FlipbookRef>(null);
62
-
63
- const handleNextPage = () => {
64
- flipbookRef.current?.goToPage(flipbookRef.current.getCurrentPage() + 1);
65
- };
66
-
67
- return (
68
- <Flipbook
69
- ref={flipbookRef}
70
- pdfUrl="/files/catalog.pdf"
71
- pages={[
72
- { kind: 'cover', pageNumber: 1, normal: '/img/1.jpg', low: '/img/1-low.jpg', thumb: '/img/1-thumb.jpg' },
73
- { kind: 'spread', pageNumbers: [2, 3], normal: '/img/2-3.jpg', low: '/img/2-3-low.jpg', thumb: '/img/2-3-thumb.jpg' }
74
- ]}
75
- allowDownload={true}
76
- showThumbs={true}
77
- primaryColor="#7367f0"
78
- />
79
- );
80
- }
81
- ```
82
-
83
- ### Vue 3
84
-
85
- ```vue
86
- <template>
87
- <Flipbook
88
- pdfUrl="/files/catalog.pdf"
89
- :pages="pages"
90
- :allowDownload="true"
91
- :showThumbs="true"
92
- primaryColor="#7367f0"
93
- />
94
- </template>
95
-
96
- <script setup>
97
- import { Flipbook } from 'flipbookengine/vue';
98
- import 'flipbookengine/dist/flipbook-engine.css';
99
-
100
- const pages = [
101
- { kind: 'cover', pageNumber: 1, normal: '/img/1.jpg', low: '/img/1-low.jpg', thumb: '/img/1-thumb.jpg' },
102
- { kind: 'spread', pageNumbers: [2, 3], normal: '/img/2-3.jpg', low: '/img/2-3-low.jpg', thumb: '/img/2-3-thumb.jpg' }
103
- ];
104
- </script>
146
+ npm ci
147
+ npm run release:verify
148
+ npm login
149
+ npm publish --provenance --access public
105
150
  ```
106
151
 
107
- ## Public API Reference
108
-
109
- The `FlipbookEngine` class exposes the following public methods:
110
-
111
- - **`init(pdfUrl: string, imageList?: FlipbookPageAsset[])`**: Initializes the viewer and loads the flipbook with pages.
112
- - **`goToPage(pageIndex: number)`**: Navigates programmatically to a 0-based page index.
113
- - **`getCurrentPage()`**: Returns the 0-based index of the currently active page.
114
- - **`getTotalPages()`**: Returns the total number of pages.
115
- - **`getZoom()`**: Returns the current zoom level (default is `1`).
116
- - **`setZoom(zoomLevel: number)`**: Programmatically sets the zoom level (accepts values between `0.5` and `5`).
117
- - **`setSingleMode(isSingle: boolean)`**: Programmatically toggles between single-page mode (`true`) and double-page spread mode (`false`).
118
- - **`toggleFullscreen()`**: Programmatically toggles fullscreen mode.
119
- - **`updateOptions(options: Partial<FlipbookEngineOptions>)`**: Updates instance options at runtime.
120
- - **`setLocale(locale: string, messages?: PartialFlipbookMessages)`**: Updates the locale programmatically.
121
- - **`destroy(clearMarkup = true)`**: Tears down the instance and clean up DOM listeners.
122
-
123
- ### Subscribing to Events
152
+ Confirm the package version with `npm pkg get version` before publishing. The publish command is intentionally separate from `release:verify` so credentials and the final npm upload remain under the maintainer's direct control.
153
+ ### Windows PowerShell
124
154
 
125
- You can subscribe to events using `.on()`:
155
+ If PowerShell blocks `npm.ps1` because script execution is disabled, use the Windows command shim explicitly:
126
156
 
127
- ```ts
128
- const unsubscribe = engine.on('pageChange', ({ currentPage, totalPages, isSingle }) => {
129
- console.log('Page Changed:', currentPage, 'Total:', totalPages);
130
- });
131
-
132
- // To unsubscribe:
133
- unsubscribe();
157
+ ```powershell
158
+ npm.cmd ci
159
+ npm.cmd run release:verify
160
+ npm.cmd login
161
+ npm.cmd whoami
162
+ npm.cmd publish --access public
134
163
  ```
135
-
136
- Supported events: `pageChange`, `zoomChange`, `singlePageModeChange`, `thumbsToggle`, `destroy`.
137
-
138
- | Option | Type | Default | Description |
139
- | :--- | :--- | :--- | :--- |
140
- | `soundEnabled` | `boolean` | `false` | Enables page turning sound effect. |
141
- | `flippingTime` | `number` | `1000` | Duration of the page turn animation in milliseconds. |
142
- | `maxShadowOpacity` | `number` | `0.5` | Maximum opacity of the shadow during page turn (0 to 1). |
143
- | `whiteLabel` | `boolean` | `false` | Hides the "Powered by FlipbookEngine" watermark. |
144
-
145
- ## Styling and Theming
146
-
147
- FlipbookEngine features fully custom-property-based styling compatible with modern styling systems.
148
-
149
- ### Global CSS Variables
150
-
151
- ```css
152
- :root {
153
- --mainbgcolor: #f3f6fb;
154
- --panelbgcolor: #172033;
155
- --accentcolor: #7367f0;
156
- --thumbrailbgcolor: #0f172a;
157
- }
158
- ```
159
-
160
- ## 🚀 Performance & Bundle Metrics
161
-
162
- FlipbookEngine is engineered for high performance, utilizing hardware-accelerated CSS 3D transforms instead of heavy WebGL, ensuring a smooth **60 FPS** experience even on low-end mobile devices.
163
-
164
- ### 📦 Bundle Size (Zero-Config PDF Engine)
165
- Unlike other libraries that require complex external PDF.js worker configurations, FlipbookEngine ships as an **"All-in-One"** package. It includes the Core Engine, UI layout, StPageFlip, and the full PDF.js rendering engine out of the box.
166
-
167
- * **Core + PDF Engine (Gzipped):** `~788 KB` *(A single drop-in script, no external workers needed)*
168
- * **Styles (CSS Gzipped):** `~2.9 KB`
169
- * **React / Vue Wrappers (Gzipped):** `< 1 KB`
170
-
171
- ### ⚡ Performance Highlights
172
- * **Hardware Accelerated:** Uses purely CSS-based 3D transformations (`transform: rotateY`, `translateZ`) which offloads rendering to the GPU. No heavy WebGL overhead.
173
- * **Smart Memory Management (Lazy Loading):** Automatically unloads hidden pages from the DOM and destroys unused PDF blobs to prevent memory leaks on large catalogs.
174
- * **Zero-CLS Layouts:** Prevents Cumulative Layout Shift (CLS) by utilizing highly optimized `AbortController` bound resize event listeners and native CSS `aspect-ratio` calculations.
175
- * **Eco-Friendly Standby:** Stops running layout calculations when the catalog is not actively being dragged or flipped.
176
-
177
- ## 🥊 FlipbookEngine vs. The Industry
178
-
179
- When choosing a flipbook library, here is how we compare to other solutions:
180
-
181
- * **Legacy Libraries (e.g., Turn.js):** Turn.js is over a decade old, relies on jQuery, and lacks native PDF support. **FlipbookEngine** uses a modern framework-agnostic stack (Vanilla/React/Vue), TypeScript, and has built-in PDF.js integration.
182
- * **Heavy 3D Plugins (e.g., DearFlip, Real3D):** Many 3D plugins use WebGL, which drains CPU/RAM and can be sluggish on mobile. **FlipbookEngine** is powered by StPageFlip, delivering buttery-smooth 60FPS CSS 2D/3D performance while remaining lightweight.
183
- * **Closed SaaS Platforms (e.g., Issuu, Heyzine):** These charge high monthly fees and lock your data on their servers. **FlipbookEngine** gives you 100% control to host and embed directly in your own code (AGPL-3.0).
184
-
185
- ---
186
-
187
- ## 📄 Licensing
188
-
189
- FlipbookEngine is distributed under a dual-license model:
190
-
191
- - **Open Source**: GNU Affero General Public License v3.0 or later (see [LICENSE](./LICENSE)).
192
- - **Commercial**: For use in closed-source projects, proprietary SaaS platforms, or agency client deliveries (see [COMMERCIAL_LICENSE.md](./COMMERCIAL_LICENSE.md)).
193
-
194
- For commercial licenses and inquiries, contact: **murat.dogan@hotmail.com.tr**
164
+ ## Public API Reference
165
+
166
+ The `FlipbookEngine` class exposes the following public methods:
167
+
168
+ - **`init(pdfUrl: string, imageList?: FlipbookPageAsset[])`**: Initializes the viewer and loads the flipbook with pages.
169
+ - **`goToPage(pageIndex: number)`**: Navigates programmatically to a 0-based page index.
170
+ - **`getCurrentPage()`**: Returns the 0-based index of the currently active page.
171
+ - **`getTotalPages()`**: Returns the total number of pages.
172
+ - **`getZoom()`**: Returns the current zoom level (default is `1`).
173
+ - **`setZoom(zoomLevel: number)`**: Programmatically sets the zoom level (accepts values between `0.5` and `5`).
174
+ - **`setSingleMode(isSingle: boolean)`**: Programmatically toggles between single-page mode (`true`) and double-page spread mode (`false`).
175
+ - **`toggleFullscreen()`**: Programmatically toggles fullscreen mode.
176
+ - **`updateOptions(options: Partial<FlipbookEngineOptions>)`**: Updates instance options at runtime.
177
+ - **`setLocale(locale: string, messages?: PartialFlipbookMessages)`**: Updates the locale programmatically.
178
+ - **`destroy(clearMarkup = true)`**: Tears down the instance and clean up DOM listeners.
179
+
180
+ ### Subscribing to Events
181
+
182
+ You can subscribe to events using `.on()`. PDF-backed initialization reports loading/rendering progress and emits a structured `error` event when loading or rendering fails:
183
+
184
+ ```ts
185
+ const unsubscribe = engine.on('pageChange', ({ currentPage, totalPages, isSingle }) => {
186
+ console.log('Page Changed:', currentPage, 'Total:', totalPages);
187
+ });
188
+
189
+ // To unsubscribe:
190
+ unsubscribe();
191
+ ```
192
+
193
+ Supported events: `init`, `progress`, `pageChange`, `zoomChange`, `singlePageModeChange`, `thumbsToggle`, `orientationChange`, `error`, `destroy`.
194
+
195
+ | Option | Type | Default | Description |
196
+ | :--- | :--- | :--- | :--- |
197
+ | `showArrows` | `boolean` | `true` | Shows the previous/next navigation arrows. |
198
+ | `soundEnabled` | `boolean` | `true` | Enables page turning sound effect. |
199
+ | `soundUrl` | `string` | `'https://.../page-flip.mp3'` | URL of the audio file. |
200
+ | `autoPlayInterval`| `number` | `3000` | Autoplay page duration in milliseconds. |
201
+ | `flippingTime` | `number` | `1000` | Duration of the page turn animation in milliseconds. |
202
+ | `maxShadowOpacity` | `number` | `0.5` | Maximum opacity of the shadow during page turn (0 to 1). |
203
+ | `whiteLabel` | `boolean` | `false` | Hides the "Powered by FlipbookEngine" watermark. |
204
+ | `pdfWorkerSrc` | `string` | - | URL of the PDF.js worker emitted or hosted by the consuming application. |
205
+ | `pdfRenderConcurrency` | `number` | `3` | Maximum number of PDF pages rendered concurrently during initialization. |
206
+
207
+ ## Styling and Theming
208
+
209
+ FlipbookEngine features fully custom-property-based styling compatible with modern styling systems.
210
+
211
+ ### Global CSS Variables
212
+
213
+ ```css
214
+ :root {
215
+ --mainbgcolor: #f3f6fb;
216
+ --panelbgcolor: #172033;
217
+ --flipbook-accent: #7367f0;
218
+ --thumbrailbgcolor: #0f172a;
219
+ }
220
+ ```
221
+
222
+ ## Performance & Bundle Metrics
223
+
224
+ FlipbookEngine is designed for responsive rendering with hardware-accelerated CSS 3D transforms and a lightweight DOM update path.
225
+
226
+ ### Package Size and PDF.js
227
+
228
+ FlipbookEngine does not bundle PDF.js or its worker. `pdfjs-dist` remains a normal npm dependency, while the host application supplies `pdfWorkerSrc`. This keeps the FlipbookEngine package smaller and lets the application control PDF.js versioning, caching, CSP, and worker hosting.
229
+
230
+ * **Core engine:** excludes PDF.js and the PDF worker.
231
+ * **Styles:** distributed as `flipbookengine/styles.css`.
232
+ * **PDF rendering:** enabled by configuring `pdfWorkerSrc` as shown above.
233
+
234
+ ### Performance Highlights
235
+ * **Hardware Accelerated:** Uses CSS-based 3D transformations (`transform: rotateY`, `translateZ`) without a WebGL runtime.
236
+ * **Progressive Image Quality:** Loads low-quality page assets first and upgrades visible pages to their normal-quality source through `IntersectionObserver`.
237
+ * **Bounded PDF Rendering:** PDF pages are rendered with configurable concurrency (`pdfRenderConcurrency`, default `3`) and can be cancelled when an initialization is superseded or destroyed.
238
+
239
+ ## FlipbookEngine vs. The Industry
240
+
241
+ When choosing a flipbook library, here is how we compare to other solutions:
242
+
243
+ * **Legacy Libraries (e.g., Turn.js):** Turn.js is over a decade old, relies on jQuery, and lacks native PDF support. **FlipbookEngine** uses a modern framework-agnostic stack (Vanilla/React/Vue), TypeScript, and has built-in PDF.js integration.
244
+ * **Heavy 3D Plugins (e.g., DearFlip, Real3D):** Many 3D plugins use WebGL, which can increase runtime overhead on mobile. **FlipbookEngine** uses StPageFlip with CSS 2D/3D transforms and no WebGL runtime.
245
+ * **Closed SaaS Platforms (e.g., Issuu, Heyzine):** These charge high monthly fees and lock your data on their servers. **FlipbookEngine** gives you 100% control to host and embed directly in your own code (AGPL-3.0).
246
+
247
+ ---
248
+
249
+ ## Acknowledgments
250
+
251
+ A special thanks to the incredible team behind **[Serenity](https://github.com/serenity-is/serenity)**. FlipbookEngine's reactive UI layer is powered by **[domwise](https://github.com/serenity-is/serenity/tree/master/packages/domwise)**. Coupled with `@preact/signals-core`, this keeps the UI update path small without requiring a traditional Virtual DOM runtime.
252
+
253
+ ---
254
+
255
+ ## Roadmap (Upcoming in v1.0.0)
256
+
257
+ We are constantly working to make FlipbookEngine the definitive choice for enterprise digital catalogs. The upcoming **v1.0.0 Major Release** will introduce several advanced features designed for commercial scale:
258
+
259
+ - **Table of Contents (Index):** A dedicated, interactive side-menu allowing readers to instantly jump to specific chapters or product categories.
260
+ - **Page Notes & Annotations:** Allow readers to drop personal notes or bookmarks directly onto pages.
261
+ - **Full-Text PDF Search:** Client-side search capabilities via extracted JSON indices, enabling instant text highlighting across hundreds of pages without locking the UI.
262
+ - **Interactive Hotspots & Pop-ups:** Draw custom coordinates over the canvas to embed YouTube videos, image galleries, or direct "Buy Now" e-commerce links right on top of the catalog pages.
263
+ - **Partial PDF Downloads:** Allow readers to select and download specific pages. Features a hybrid architecture: standalone client-side generation using `pdf-lib`, or an event-driven `onDownloadRequest` hook to offload generation to your own secure backend.
264
+ - **AI Chatbot (Chat with Docs):** A built-in AI assistant interface to help users query catalog contents, find products, and get page recommendations instantly.
265
+ - **Deep Linking & Social Share:** Generate and share URLs that point to specific pages or spreads directly via social media.
266
+
267
+ ---
268
+
269
+ ## Licensing
270
+
271
+ FlipbookEngine is distributed under a dual-license model:
272
+
273
+ - **Open Source**: GNU Affero General Public License v3.0 or later (see [LICENSE](./LICENSE)).
274
+ - **Commercial**: For use in closed-source projects, proprietary SaaS platforms, or agency client deliveries (see [COMMERCIAL_LICENSE.md](./COMMERCIAL_LICENSE.md)).
275
+
276
+ For commercial licenses and inquiries, contact: **murat.dogan@hotmail.com.tr**
277
+
278
+
279
+
@@ -56,6 +56,62 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
56
56
 
57
57
  ---
58
58
 
59
+ ### 3. @preact/signals-core
60
+ - **Repository:** https://github.com/preactjs/signals
61
+ - **License:** MIT License
62
+
63
+ ```text
64
+ The MIT License (MIT)
65
+ Copyright (c) 2022-present Preact Team
66
+
67
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
68
+ this software and associated documentation files (the "Software"), to deal in
69
+ the Software without restriction, including without limitation the rights to
70
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
71
+ the Software, and to permit persons to whom the Software is furnished to do so,
72
+ subject to the following conditions:
73
+
74
+ The above copyright notice and this permission notice shall be included in all
75
+ copies or substantial portions of the Software.
76
+
77
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
78
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
79
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
80
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
81
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
82
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
83
+ ```
84
+
85
+ ---
86
+
87
+ ### 4. @serenity-is/domwise
88
+ - **Repository:** https://github.com/serenity-is/serenity
89
+ - **License:** MIT License
90
+
91
+ ```text
92
+ The MIT License (MIT)
93
+ Copyright (c) Serenity.is
94
+
95
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
96
+ this software and associated documentation files (the "Software"), to deal in
97
+ the Software without restriction, including without limitation the rights to
98
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
99
+ the Software, and to permit persons to whom the Software is furnished to do so,
100
+ subject to the following conditions:
101
+
102
+ The above copyright notice and this permission notice shall be included in all
103
+ copies or substantial portions of the Software.
104
+
105
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
106
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
107
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
108
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
109
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
110
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
111
+ ```
112
+
113
+ ---
114
+
59
115
  ## Development Dependencies
60
116
 
61
117
  Development dependencies such as `vite`, `typescript`, and their respective plugins are licensed under the MIT License. These tools are used during the build process and are not distributed as part of the compiled FlipbookEngine bundle.
@@ -1,14 +1,18 @@
1
+ import { FlipbookStore } from '../state/store';
1
2
  import { FlipbookEngineOptions } from '../engine';
2
3
 
3
4
  export declare class PageFlipAdapter {
4
5
  private pageFlip;
5
6
  private bookContainer;
6
7
  private options;
8
+ private store;
7
9
  private unsubs;
8
10
  private audioEl;
11
+ private audioUnlockHandler;
9
12
  private isLibraryFlipping;
10
13
  private autoPlayTimer;
11
- constructor(bookContainer: HTMLElement, options: FlipbookEngineOptions);
14
+ constructor(bookContainer: HTMLElement, options: FlipbookEngineOptions, store: FlipbookStore);
15
+ private unlockAudio;
12
16
  init(viewportWidth: number, viewportHeight: number): void;
13
17
  private bindEvents;
14
18
  private setupSignalSync;
@@ -1,3 +1,4 @@
1
+ import { FlipbookStore } from '../state/store';
1
2
  import { PageFlipAdapter } from '../adapters/PageFlipAdapter';
2
3
  import { InteractionManager } from '../core/InteractionManager';
3
4
 
@@ -13,6 +14,8 @@ interface AppProps {
13
14
  bookContainerRef: (el: HTMLElement) => void;
14
15
  className?: string;
15
16
  onDownload: () => void;
17
+ onToggleFullscreen: () => void;
18
+ store: FlipbookStore;
16
19
  }
17
20
  export declare function App(props: AppProps): import('@serenity-is/domwise').JSXElement;
18
21
  export {};
@@ -0,0 +1,9 @@
1
+ import { FlipbookStore } from '../state/store';
2
+
3
+ interface NavigationArrowsProps {
4
+ store: FlipbookStore;
5
+ onPrevPage: () => void;
6
+ onNextPage: () => void;
7
+ }
8
+ export declare function NavigationArrows(props: NavigationArrowsProps): import('@serenity-is/domwise').JSXElement;
9
+ export {};
@@ -1,4 +1,7 @@
1
+ import { FlipbookStore } from '../state/store';
2
+
1
3
  interface ThumbnailsProps {
4
+ store: FlipbookStore;
2
5
  onThumbClick: (pageIndex: number) => void;
3
6
  }
4
7
  export declare function Thumbnails(props: ThumbnailsProps): import('@serenity-is/domwise').JSXElement;
@@ -1,4 +1,7 @@
1
+ import { FlipbookStore } from '../state/store';
2
+
1
3
  interface ToolbarProps {
4
+ store: FlipbookStore;
2
5
  onToggleThumbs: () => void;
3
6
  onToggleSingleMode: () => void;
4
7
  onZoomIn: () => void;
@@ -1,4 +1,7 @@
1
+ import { FlipbookStore } from '../state/store';
2
+
1
3
  interface ViewerProps {
4
+ store: FlipbookStore;
2
5
  bookWrapperRef: (el: HTMLElement) => void;
3
6
  bookSizerRef: (el: HTMLElement) => void;
4
7
  bookContainerRef: (el: HTMLElement) => void;
@@ -1,11 +1,14 @@
1
+ import { FlipbookStore } from '../state/store';
1
2
  import { PageFlipAdapter } from '../adapters/PageFlipAdapter';
2
3
 
3
4
  export declare class InteractionManager {
4
5
  private container;
5
6
  private pageFlipAdapter;
7
+ private store;
6
8
  private touchStartX;
7
9
  private unsubs;
8
- constructor(container: HTMLElement, pageFlipAdapter: PageFlipAdapter);
10
+ private listenerAbortController;
11
+ constructor(container: HTMLElement, pageFlipAdapter: PageFlipAdapter, store: FlipbookStore);
9
12
  init(): void;
10
13
  private setupStateSync;
11
14
  private bindWheel;