@likecoin/epub-ts 0.3.97 → 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/README.md +6 -4
- package/dist/contents.d.ts +5 -1
- package/dist/epub.cjs +3 -9
- package/dist/epub.cjs.map +1 -1
- package/dist/epub.js +1029 -4187
- package/dist/epub.js.map +1 -1
- package/dist/epub.umd.js +3 -9
- package/dist/epub.umd.js.map +1 -1
- package/dist/section.d.ts +1 -1
- package/dist/store.d.ts +6 -3
- package/dist/themes.d.ts +1 -1
- package/dist/utils/core.d.ts +11 -9
- package/dist/utils/hook.d.ts +2 -2
- package/dist/utils/path-utils.d.ts +1 -1
- package/package.json +2 -5
package/README.md
CHANGED
|
@@ -13,7 +13,7 @@ A TypeScript fork of [epubjs](https://github.com/futurepress/epub.js) v0.3.93 by
|
|
|
13
13
|
- **Drop-in replacement** for epubjs v0.3.93 — same API, just change the import
|
|
14
14
|
- **TypeScript first** — full strict mode, typed emitter, generated `.d.ts` declarations
|
|
15
15
|
- **Modern build** — Vite library build, ESM + CJS output
|
|
16
|
-
- **Fewer dependencies** — removed `core-js`, `lodash`, `path-webpack`, `event-emitter`
|
|
16
|
+
- **Fewer dependencies** — only 1 runtime dependency (`jszip`); removed `core-js`, `lodash`, `path-webpack`, `event-emitter`, `localforage`, `@xmldom/xmldom`
|
|
17
17
|
- **Named exports** — import individual classes like `Book`, `EpubCFI`, `Rendition`, etc.
|
|
18
18
|
|
|
19
19
|
## Installation
|
|
@@ -95,7 +95,7 @@ Key classes:
|
|
|
95
95
|
| Build | Vite | webpack + Babel |
|
|
96
96
|
| Tests | Vitest | Karma + Mocha |
|
|
97
97
|
| Type definitions | Generated from source | Hand-written `.d.ts` |
|
|
98
|
-
| Dependencies |
|
|
98
|
+
| Dependencies | 1 (`jszip`) | 7+ (`core-js`, `lodash`, `event-emitter`, etc.) |
|
|
99
99
|
| API compatibility | 100% (drop-in replacement) | — |
|
|
100
100
|
| Bundle format | ESM + CJS | UMD |
|
|
101
101
|
| Maintenance | Active | Inactive since 2022 |
|
|
@@ -114,8 +114,11 @@ Key classes:
|
|
|
114
114
|
- Build: webpack + Babel → Vite
|
|
115
115
|
- Tests: Karma + Mocha → Vitest
|
|
116
116
|
- Source: JavaScript → TypeScript (full strict mode)
|
|
117
|
-
- Removed dependencies: `core-js`, `lodash`, `path-webpack`
|
|
117
|
+
- Removed dependencies: `core-js`, `lodash`, `path-webpack`, `localforage`, `@xmldom/xmldom`
|
|
118
118
|
- Replaced `event-emitter` with inline typed emitter
|
|
119
|
+
- Replaced `localforage` with native IndexedDB wrapper
|
|
120
|
+
- Replaced `@xmldom/xmldom` with native DOMParser/XMLSerializer
|
|
121
|
+
- Dropped IE8–IE11 support
|
|
119
122
|
|
|
120
123
|
## Development
|
|
121
124
|
|
|
@@ -158,7 +161,6 @@ For AI agents contributing to this project, see [AGENTS.md](./AGENTS.md).
|
|
|
158
161
|
|
|
159
162
|
- [epubjs](https://github.com/futurepress/epub.js) by [Fred Chasen](https://github.com/fchasen) / [FuturePress](https://github.com/futurepress) — the original library this is forked from
|
|
160
163
|
- [jszip](https://github.com/Stuk/jszip) — ZIP file handling
|
|
161
|
-
- [@xmldom/xmldom](https://github.com/xmldom/xmldom) — XML parsing
|
|
162
164
|
|
|
163
165
|
## Built by 3ook.com
|
|
164
166
|
|
package/dist/contents.d.ts
CHANGED
|
@@ -37,6 +37,11 @@ declare class Contents implements IEventEmitter {
|
|
|
37
37
|
_resizeCheck: (() => void) | undefined;
|
|
38
38
|
_triggerEvent: ((e: Event) => void) | undefined;
|
|
39
39
|
_onSelectionChange: ((e: Event) => void) | undefined;
|
|
40
|
+
_onVisibilityChange: (() => void) | undefined;
|
|
41
|
+
_mediaQueryHandlers: {
|
|
42
|
+
mql: MediaQueryList;
|
|
43
|
+
handler: (e: MediaQueryListEvent) => void;
|
|
44
|
+
}[];
|
|
40
45
|
selectionEndTimeout: ReturnType<typeof setTimeout> | undefined;
|
|
41
46
|
_layoutStyle: string;
|
|
42
47
|
constructor(doc: Document, content?: HTMLElement, cfiBase?: string, sectionIndex?: number);
|
|
@@ -290,7 +295,6 @@ declare class Contents implements IEventEmitter {
|
|
|
290
295
|
* @returns {EpubCFI} cfi
|
|
291
296
|
*/
|
|
292
297
|
cfiFromNode(node: Node, ignoreClass?: string): string;
|
|
293
|
-
map(layout: LayoutProps): EpubCFIPair[];
|
|
294
298
|
/**
|
|
295
299
|
* Size the contents to a given width and height
|
|
296
300
|
* @param {number} [width]
|