@readium/navigator 2.4.0 → 2.5.0-beta.2
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/ReadiumCSS-after-B_e3a-PY.js +592 -0
- package/dist/ReadiumCSS-after-C-T_0paD.js +530 -0
- package/dist/ReadiumCSS-after-lr-n3fz2.js +475 -0
- package/dist/ReadiumCSS-after-mXeKKPap.js +490 -0
- package/dist/ReadiumCSS-before-Bjd3POej.js +426 -0
- package/dist/ReadiumCSS-before-CfXPAGaQ.js +425 -0
- package/dist/ReadiumCSS-before-CrNWvuyE.js +425 -0
- package/dist/ReadiumCSS-before-KVen5ceo.js +425 -0
- package/dist/ReadiumCSS-default-BKAG5pGU.js +162 -0
- package/dist/ReadiumCSS-default-C63bYOYF.js +183 -0
- package/dist/ReadiumCSS-default-CclvbeNC.js +162 -0
- package/dist/ReadiumCSS-default-DnlgDaBu.js +180 -0
- package/dist/ReadiumCSS-ebpaj_fonts_patch-Dt2XliTg.js +82 -0
- package/dist/index.js +2246 -3159
- package/dist/index.umd.cjs +4432 -1083
- package/package.json +1 -1
- package/src/audio/index.ts +1 -1
- package/src/epub/EpubNavigator.ts +72 -32
- package/src/epub/css/ReadiumCSS.ts +11 -0
- package/src/epub/frame/FrameBlobBuilder.ts +23 -22
- package/src/epub/frame/FrameManager.ts +4 -0
- package/src/epub/fxl/FXLFramePoolManager.ts +5 -1
- package/src/epub/helpers/scriptMode.ts +52 -0
- package/src/epub/index.ts +1 -0
- package/src/injection/epubInjectables.ts +82 -9
- package/src/injection/webpubInjectables.ts +1 -1
- package/src/webpub/WebPubNavigator.ts +9 -4
- package/types/src/epub/EpubNavigator.d.ts +4 -3
- package/types/src/epub/css/ReadiumCSS.d.ts +2 -0
- package/types/src/epub/frame/FrameManager.d.ts +1 -0
- package/types/src/epub/helpers/scriptMode.d.ts +19 -0
- package/types/src/epub/index.d.ts +1 -0
- package/types/src/injection/epubInjectables.d.ts +4 -2
- package/types/src/injection/webpubInjectables.d.ts +1 -1
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Metadata } from "@readium/shared";
|
|
2
|
+
export type ScriptMode = 'ltr' | 'rtl' | 'cjk-horizontal' | 'cjk-vertical' | 'mongolian-vertical';
|
|
3
|
+
/**
|
|
4
|
+
* Derives the script mode from publication metadata.
|
|
5
|
+
*
|
|
6
|
+
* Rules:
|
|
7
|
+
* - Only the first language in the array is used. A Latin book containing
|
|
8
|
+
* some Japanese is still Latin.
|
|
9
|
+
* - For CJK (zh/ja/ko): both language AND explicit reading progression are
|
|
10
|
+
* required. CJK vertical = explicit rtl + CJK language. CJK horizontal =
|
|
11
|
+
* CJK language with ltr or unset progression.
|
|
12
|
+
* - For RTL (ar/fa/he): language wins. If the primary language is a RTL
|
|
13
|
+
* script, RTL mode is applied regardless of the explicit progression
|
|
14
|
+
* direction declared in the OPF.
|
|
15
|
+
* - For Mongolian (mn): Traditional Mongolian script (mn-Mong) uses
|
|
16
|
+
* writing-mode: vertical-lr. Cyrillic Mongolian (mn-Cyrl) is standard LTR.
|
|
17
|
+
* An explicit script subtag is required; bare `mn` defaults to LTR.
|
|
18
|
+
*/
|
|
19
|
+
export declare function getScriptMode(metadata: Metadata): ScriptMode;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { IInjectableRule } from "../injection/Injectable.ts";
|
|
2
2
|
import { Metadata, Link } from "@readium/shared";
|
|
3
3
|
/**
|
|
4
|
-
* Creates injectable rules for EPUB content documents
|
|
4
|
+
* Creates injectable rules for EPUB content documents.
|
|
5
|
+
* Async so that script-specific Readium CSS stylesheets can be imported
|
|
6
|
+
* dynamically — only the variant that is actually needed is bundled.
|
|
5
7
|
*/
|
|
6
|
-
export declare function createReadiumEpubRules(metadata: Metadata, readingOrderItems: Link[]): IInjectableRule[]
|
|
8
|
+
export declare function createReadiumEpubRules(metadata: Metadata, readingOrderItems: Link[]): Promise<IInjectableRule[]>;
|