epub-codec 1.2.12 → 1.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 +24 -10
- package/dist/base64--HuymRl_.d.cts +5 -0
- package/dist/base64--HuymRl_.d.ts +5 -0
- package/dist/build-B1UxbO20.d.cts +5 -0
- package/dist/build-BCUsHLYw.d.ts +5 -0
- package/dist/codec-CX2Pa6Jq.d.ts +2876 -0
- package/dist/codec-qyKMOMt6.d.cts +2876 -0
- package/dist/codec.cjs +16 -0
- package/dist/codec.d.cts +2 -2702
- package/dist/codec.d.ts +2 -2702
- package/dist/codec.js +14 -1
- package/dist/container-B6cHHiY9.d.cts +4 -0
- package/dist/container-B6cHHiY9.d.ts +4 -0
- package/dist/context-CTgx7PwU.d.ts +28 -0
- package/dist/context-CXs2Yc9w.d.cts +28 -0
- package/dist/dimensions-B7ogpvKQ.d.cts +11 -0
- package/dist/dimensions-B7ogpvKQ.d.ts +11 -0
- package/dist/entities-CfQKtI34.d.ts +7 -0
- package/dist/entities-wt9zCx5q.d.cts +7 -0
- package/dist/footnote-CxsO5tCV.d.cts +7 -0
- package/dist/footnote-iZAPC_NT.d.ts +7 -0
- package/dist/format-DxUddUPj.d.cts +6 -0
- package/dist/format-DxUddUPj.d.ts +6 -0
- package/dist/format.d.cts +1 -5
- package/dist/format.d.ts +1 -5
- package/dist/image/dimensions.d.cts +1 -10
- package/dist/image/dimensions.d.ts +1 -10
- package/dist/index.cjs +24 -8
- package/dist/index.d.cts +31 -31
- package/dist/index.d.ts +31 -31
- package/dist/index.js +13 -10
- package/dist/inline-DDj6Sl3e.d.ts +12 -0
- package/dist/inline-YZOQY2wR.d.cts +12 -0
- package/dist/list-id-BB_yxm1H.d.cts +13 -0
- package/dist/list-id-BB_yxm1H.d.ts +13 -0
- package/dist/metadata-DXto7sM6.d.cts +7 -0
- package/dist/metadata-T5V2ovtS.d.ts +7 -0
- package/dist/model/package.cjs +19 -0
- package/dist/model/package.d.cts +2 -0
- package/dist/model/package.d.ts +2 -0
- package/dist/model/package.js +15 -0
- package/dist/nav/nav3.cjs +1 -1
- package/dist/nav/nav3.d.cts +1 -3
- package/dist/nav/nav3.d.ts +1 -3
- package/dist/nav/nav3.js +1 -1
- package/dist/nav/ncx.cjs +1 -1
- package/dist/nav/ncx.d.cts +1 -3
- package/dist/nav/ncx.d.ts +1 -3
- package/dist/nav/ncx.js +1 -1
- package/dist/nav/reconcile.d.cts +1 -3
- package/dist/nav/reconcile.d.ts +1 -3
- package/dist/nav/write.cjs +1 -1
- package/dist/nav/write.d.cts +1 -9
- package/dist/nav/write.d.ts +1 -9
- package/dist/nav/write.js +1 -1
- package/dist/nav3-SbAp8zlu.d.cts +4 -0
- package/dist/nav3-SbAp8zlu.d.ts +4 -0
- package/dist/ncx-kYhlXucj.d.cts +4 -0
- package/dist/ncx-kYhlXucj.d.ts +4 -0
- package/dist/node-CJLSSs1k.d.cts +84 -0
- package/dist/node-CJLSSs1k.d.ts +84 -0
- package/dist/ocf/container.cjs +1 -1
- package/dist/ocf/container.d.cts +1 -3
- package/dist/ocf/container.d.ts +1 -3
- package/dist/ocf/container.js +1 -1
- package/dist/ocf/write.d.cts +1 -3
- package/dist/ocf/write.d.ts +1 -3
- package/dist/opf/metadata.d.cts +1 -6
- package/dist/opf/metadata.d.ts +1 -6
- package/dist/opf/parse.cjs +1 -1
- package/dist/opf/parse.d.cts +1 -5
- package/dist/opf/parse.d.ts +1 -5
- package/dist/opf/parse.js +1 -1
- package/dist/opf/types.d.cts +1 -19
- package/dist/opf/types.d.ts +1 -19
- package/dist/opf/write.cjs +1 -1
- package/dist/opf/write.d.cts +1 -11
- package/dist/opf/write.d.ts +1 -11
- package/dist/opf/write.js +1 -1
- package/dist/package-io/read.cjs +39 -0
- package/dist/package-io/read.d.cts +2 -0
- package/dist/package-io/read.d.ts +2 -0
- package/dist/package-io/read.js +37 -0
- package/dist/package-io/write.cjs +34 -0
- package/dist/package-io/write.d.cts +2 -0
- package/dist/package-io/write.d.ts +2 -0
- package/dist/package-io/write.js +32 -0
- package/dist/parse-Bkkb7qXz.d.cts +6 -0
- package/dist/parse-C5GxodcX.d.ts +6 -0
- package/dist/parse-CmCjyz8i.d.cts +5 -0
- package/dist/parse-Dc76LQIj.d.ts +5 -0
- package/dist/path-Cx8-QMD6.d.cts +5 -0
- package/dist/path-Cx8-QMD6.d.ts +5 -0
- package/dist/path.d.cts +1 -4
- package/dist/path.d.ts +1 -4
- package/dist/query-B79eElol.d.ts +12 -0
- package/dist/query-C6ftPqNQ.d.cts +12 -0
- package/dist/read-B7kc_MeO.d.cts +10 -0
- package/dist/read-BMGq_D9y.d.cts +30 -0
- package/dist/read-Czqr3aop.d.ts +30 -0
- package/dist/read-DPkpZsYG.d.ts +10 -0
- package/dist/read.cjs +51 -6
- package/dist/read.d.cts +1 -9
- package/dist/read.d.ts +1 -9
- package/dist/read.js +52 -7
- package/dist/reconcile-BHky0kta.d.cts +4 -0
- package/dist/reconcile-BHky0kta.d.ts +4 -0
- package/dist/style-constants-RVoHdmju.d.cts +8 -0
- package/dist/style-constants-RVoHdmju.d.ts +8 -0
- package/dist/types-BxmkPT_F.d.cts +20 -0
- package/dist/types-BxmkPT_F.d.ts +20 -0
- package/dist/util/base64.d.cts +1 -4
- package/dist/util/base64.d.ts +1 -4
- package/dist/write-B89sagtw.d.cts +12 -0
- package/dist/write-BQcrPQvx.d.ts +10 -0
- package/dist/write-Boxi3aK0.d.cts +10 -0
- package/dist/write-COdkb8lG.d.cts +10 -0
- package/dist/write-COdkb8lG.d.ts +10 -0
- package/dist/write-DwaEwwgZ.d.ts +12 -0
- package/dist/write-DxiR-9eH.d.cts +4 -0
- package/dist/write-DxiR-9eH.d.ts +4 -0
- package/dist/write-Klo0WDhT.d.ts +13 -0
- package/dist/write-WSIgARHT.d.cts +13 -0
- package/dist/write.cjs +28 -6
- package/dist/write.d.cts +1 -9
- package/dist/write.d.ts +1 -9
- package/dist/write.js +28 -6
- package/dist/xhtml/context.d.cts +2 -22
- package/dist/xhtml/context.d.ts +2 -22
- package/dist/xhtml/footnote.cjs +4 -8
- package/dist/xhtml/footnote.d.cts +2 -7
- package/dist/xhtml/footnote.d.ts +2 -7
- package/dist/xhtml/footnote.js +4 -8
- package/dist/xhtml/inline.cjs +13 -7
- package/dist/xhtml/inline.d.cts +1 -11
- package/dist/xhtml/inline.d.ts +1 -11
- package/dist/xhtml/inline.js +13 -7
- package/dist/xhtml/link-target.cjs +18 -0
- package/dist/xhtml/link-target.d.cts +8 -0
- package/dist/xhtml/link-target.d.ts +8 -0
- package/dist/xhtml/link-target.js +17 -0
- package/dist/xhtml/list-id.d.cts +1 -12
- package/dist/xhtml/list-id.d.ts +1 -12
- package/dist/xhtml/read.cjs +50 -18
- package/dist/xhtml/read.d.cts +2 -20
- package/dist/xhtml/read.d.ts +2 -20
- package/dist/xhtml/read.js +49 -19
- package/dist/xhtml/style-constants.d.cts +1 -7
- package/dist/xhtml/style-constants.d.ts +1 -7
- package/dist/xhtml/write.cjs +44 -19
- package/dist/xhtml/write.d.cts +1 -11
- package/dist/xhtml/write.d.ts +1 -11
- package/dist/xhtml/write.js +44 -19
- package/dist/xml/build.d.cts +1 -4
- package/dist/xml/build.d.ts +1 -4
- package/dist/xml/entities.d.cts +1 -6
- package/dist/xml/entities.d.ts +1 -6
- package/dist/xml/node.d.cts +1 -83
- package/dist/xml/node.d.ts +1 -83
- package/dist/xml/parse.d.cts +1 -4
- package/dist/xml/parse.d.ts +1 -4
- package/dist/xml/query.cjs +1 -1
- package/dist/xml/query.d.cts +1 -11
- package/dist/xml/query.d.ts +1 -11
- package/dist/xml/query.js +1 -1
- package/dist/zip-ie17sOo5.d.cts +9 -0
- package/dist/zip-ie17sOo5.d.ts +9 -0
- package/dist/zip.d.cts +1 -8
- package/dist/zip.d.ts +1 -8
- package/package.json +1 -1
package/dist/codec.js
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { EpubPackageSchema } from "./model/package.js";
|
|
2
|
+
import { parsePackage } from "./package-io/read.js";
|
|
3
|
+
import { serializePackage } from "./package-io/write.js";
|
|
1
4
|
import { readEpub, readEpubContent } from "./read.js";
|
|
2
5
|
import { writeEpub, writeEpubContent } from "./write.js";
|
|
3
6
|
import { z } from "zod";
|
|
@@ -21,5 +24,15 @@ const epubContentCodec = z.codec(EpubBytesSchema, ContentDocumentSchema, {
|
|
|
21
24
|
decode: (bytes) => readEpubContent(bytes),
|
|
22
25
|
encode: (document) => writeEpubContent(document)
|
|
23
26
|
});
|
|
27
|
+
const packageCodec = z.codec(EpubBytesSchema, EpubPackageSchema, {
|
|
28
|
+
decode: (bytes) => parsePackage(bytes),
|
|
29
|
+
encode: (pkg) => serializePackage(pkg)
|
|
30
|
+
});
|
|
31
|
+
function decodePackage(bytes) {
|
|
32
|
+
return z.decode(packageCodec, bytes);
|
|
33
|
+
}
|
|
34
|
+
function encodePackage(pkg) {
|
|
35
|
+
return z.encode(packageCodec, pkg);
|
|
36
|
+
}
|
|
24
37
|
//#endregion
|
|
25
|
-
export { EpubBytesSchema, epubCodec, epubContentCodec };
|
|
38
|
+
export { EpubBytesSchema, decodePackage, encodePackage, epubCodec, epubContentCodec, packageCodec };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { i as EpubDiagnosticSink } from "./diagnostics-C0CRdoda.js";
|
|
2
|
+
import { l as XmlElement } from "./node-CJLSSs1k.js";
|
|
3
|
+
import { AnchorType } from "document-schema.js";
|
|
4
|
+
//#region src/xhtml/context.d.ts
|
|
5
|
+
interface ResolvedAnchorTarget {
|
|
6
|
+
readonly anchorType: AnchorType;
|
|
7
|
+
readonly name: string;
|
|
8
|
+
}
|
|
9
|
+
interface XhtmlReadContext {
|
|
10
|
+
readonly resolveImage: (href: string) => Uint8Array<ArrayBuffer> | undefined;
|
|
11
|
+
readonly sink: EpubDiagnosticSink;
|
|
12
|
+
readonly sourceHref: string;
|
|
13
|
+
readonly idElements: ReadonlyMap<string, XmlElement>;
|
|
14
|
+
readonly anchorTargets: ReadonlyMap<string, ResolvedAnchorTarget>;
|
|
15
|
+
readonly resolveAnchorHref: (href: string) => ResolvedAnchorTarget | undefined;
|
|
16
|
+
readonly quoteDepth: number;
|
|
17
|
+
}
|
|
18
|
+
interface InlineStyle {
|
|
19
|
+
readonly bold?: boolean;
|
|
20
|
+
readonly italic?: boolean;
|
|
21
|
+
readonly underline?: boolean;
|
|
22
|
+
readonly strike?: boolean;
|
|
23
|
+
readonly fontFamily?: string;
|
|
24
|
+
}
|
|
25
|
+
declare function isInertElement(tag: string): boolean;
|
|
26
|
+
declare function reportInertElementSkip(tag: string, context: XhtmlReadContext): void;
|
|
27
|
+
//#endregion
|
|
28
|
+
export { reportInertElementSkip as a, isInertElement as i, ResolvedAnchorTarget as n, XhtmlReadContext as r, InlineStyle as t };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { i as EpubDiagnosticSink } from "./diagnostics-C0CRdoda.cjs";
|
|
2
|
+
import { l as XmlElement } from "./node-CJLSSs1k.cjs";
|
|
3
|
+
import { AnchorType } from "document-schema.js";
|
|
4
|
+
//#region src/xhtml/context.d.ts
|
|
5
|
+
interface ResolvedAnchorTarget {
|
|
6
|
+
readonly anchorType: AnchorType;
|
|
7
|
+
readonly name: string;
|
|
8
|
+
}
|
|
9
|
+
interface XhtmlReadContext {
|
|
10
|
+
readonly resolveImage: (href: string) => Uint8Array<ArrayBuffer> | undefined;
|
|
11
|
+
readonly sink: EpubDiagnosticSink;
|
|
12
|
+
readonly sourceHref: string;
|
|
13
|
+
readonly idElements: ReadonlyMap<string, XmlElement>;
|
|
14
|
+
readonly anchorTargets: ReadonlyMap<string, ResolvedAnchorTarget>;
|
|
15
|
+
readonly resolveAnchorHref: (href: string) => ResolvedAnchorTarget | undefined;
|
|
16
|
+
readonly quoteDepth: number;
|
|
17
|
+
}
|
|
18
|
+
interface InlineStyle {
|
|
19
|
+
readonly bold?: boolean;
|
|
20
|
+
readonly italic?: boolean;
|
|
21
|
+
readonly underline?: boolean;
|
|
22
|
+
readonly strike?: boolean;
|
|
23
|
+
readonly fontFamily?: string;
|
|
24
|
+
}
|
|
25
|
+
declare function isInertElement(tag: string): boolean;
|
|
26
|
+
declare function reportInertElementSkip(tag: string, context: XhtmlReadContext): void;
|
|
27
|
+
//#endregion
|
|
28
|
+
export { reportInertElementSkip as a, isInertElement as i, ResolvedAnchorTarget as n, XhtmlReadContext as r, InlineStyle as t };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
//#region src/image/dimensions.d.ts
|
|
2
|
+
interface ImageDimensions {
|
|
3
|
+
readonly widthPx: number;
|
|
4
|
+
readonly heightPx: number;
|
|
5
|
+
}
|
|
6
|
+
type EpubImageFormat = "png" | "jpeg";
|
|
7
|
+
declare function detectImageFormat(bytes: Uint8Array): EpubImageFormat | undefined;
|
|
8
|
+
declare function readImageDimensions(bytes: Uint8Array): ImageDimensions | undefined;
|
|
9
|
+
declare const POINTS_PER_PIXEL: number;
|
|
10
|
+
//#endregion
|
|
11
|
+
export { readImageDimensions as a, detectImageFormat as i, ImageDimensions as n, POINTS_PER_PIXEL as r, EpubImageFormat as t };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
//#region src/image/dimensions.d.ts
|
|
2
|
+
interface ImageDimensions {
|
|
3
|
+
readonly widthPx: number;
|
|
4
|
+
readonly heightPx: number;
|
|
5
|
+
}
|
|
6
|
+
type EpubImageFormat = "png" | "jpeg";
|
|
7
|
+
declare function detectImageFormat(bytes: Uint8Array): EpubImageFormat | undefined;
|
|
8
|
+
declare function readImageDimensions(bytes: Uint8Array): ImageDimensions | undefined;
|
|
9
|
+
declare const POINTS_PER_PIXEL: number;
|
|
10
|
+
//#endregion
|
|
11
|
+
export { readImageDimensions as a, detectImageFormat as i, ImageDimensions as n, POINTS_PER_PIXEL as r, EpubImageFormat as t };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { h as XmlText, r as XmlCdata } from "./node-CJLSSs1k.js";
|
|
2
|
+
//#region src/xml/entities.d.ts
|
|
3
|
+
declare function decodeEntities(value: string): string;
|
|
4
|
+
declare function decodeTextLikeNode(node: XmlText | XmlCdata): string;
|
|
5
|
+
declare function encodeEntities(value: string): string;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { decodeTextLikeNode as n, encodeEntities as r, decodeEntities as t };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { h as XmlText, r as XmlCdata } from "./node-CJLSSs1k.cjs";
|
|
2
|
+
//#region src/xml/entities.d.ts
|
|
3
|
+
declare function decodeEntities(value: string): string;
|
|
4
|
+
declare function decodeTextLikeNode(node: XmlText | XmlCdata): string;
|
|
5
|
+
declare function encodeEntities(value: string): string;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { decodeTextLikeNode as n, encodeEntities as r, decodeEntities as t };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { l as XmlElement } from "./node-CJLSSs1k.cjs";
|
|
2
|
+
//#region src/xhtml/footnote.d.ts
|
|
3
|
+
declare function sameDocumentFragment(href: string | undefined): string | undefined;
|
|
4
|
+
declare function isFootnoteReference(anchor: XmlElement, target: XmlElement): boolean;
|
|
5
|
+
declare function isFootnoteAside(element: XmlElement): boolean;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { isFootnoteReference as n, sameDocumentFragment as r, isFootnoteAside as t };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { l as XmlElement } from "./node-CJLSSs1k.js";
|
|
2
|
+
//#region src/xhtml/footnote.d.ts
|
|
3
|
+
declare function sameDocumentFragment(href: string | undefined): string | undefined;
|
|
4
|
+
declare function isFootnoteReference(anchor: XmlElement, target: XmlElement): boolean;
|
|
5
|
+
declare function isFootnoteAside(element: XmlElement): boolean;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { isFootnoteReference as n, sameDocumentFragment as r, isFootnoteAside as t };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
//#region src/format.d.ts
|
|
2
|
+
declare const EPUB_MIME_TYPE = "application/epub+zip";
|
|
3
|
+
declare const OCF_CONTAINER_PATH = "META-INF/container.xml";
|
|
4
|
+
declare const OCF_MIMETYPE_PATH = "mimetype";
|
|
5
|
+
//#endregion
|
|
6
|
+
export { OCF_CONTAINER_PATH as n, OCF_MIMETYPE_PATH as r, EPUB_MIME_TYPE as t };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
//#region src/format.d.ts
|
|
2
|
+
declare const EPUB_MIME_TYPE = "application/epub+zip";
|
|
3
|
+
declare const OCF_CONTAINER_PATH = "META-INF/container.xml";
|
|
4
|
+
declare const OCF_MIMETYPE_PATH = "mimetype";
|
|
5
|
+
//#endregion
|
|
6
|
+
export { OCF_CONTAINER_PATH as n, OCF_MIMETYPE_PATH as r, EPUB_MIME_TYPE as t };
|
package/dist/format.d.cts
CHANGED
|
@@ -1,6 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
declare const EPUB_MIME_TYPE = "application/epub+zip";
|
|
3
|
-
declare const OCF_CONTAINER_PATH = "META-INF/container.xml";
|
|
4
|
-
declare const OCF_MIMETYPE_PATH = "mimetype";
|
|
5
|
-
//#endregion
|
|
1
|
+
import { n as OCF_CONTAINER_PATH, r as OCF_MIMETYPE_PATH, t as EPUB_MIME_TYPE } from "./format-DxUddUPj.cjs";
|
|
6
2
|
export { EPUB_MIME_TYPE, OCF_CONTAINER_PATH, OCF_MIMETYPE_PATH };
|
package/dist/format.d.ts
CHANGED
|
@@ -1,6 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
declare const EPUB_MIME_TYPE = "application/epub+zip";
|
|
3
|
-
declare const OCF_CONTAINER_PATH = "META-INF/container.xml";
|
|
4
|
-
declare const OCF_MIMETYPE_PATH = "mimetype";
|
|
5
|
-
//#endregion
|
|
1
|
+
import { n as OCF_CONTAINER_PATH, r as OCF_MIMETYPE_PATH, t as EPUB_MIME_TYPE } from "./format-DxUddUPj.js";
|
|
6
2
|
export { EPUB_MIME_TYPE, OCF_CONTAINER_PATH, OCF_MIMETYPE_PATH };
|
|
@@ -1,11 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
interface ImageDimensions {
|
|
3
|
-
readonly widthPx: number;
|
|
4
|
-
readonly heightPx: number;
|
|
5
|
-
}
|
|
6
|
-
type EpubImageFormat = "png" | "jpeg";
|
|
7
|
-
declare function detectImageFormat(bytes: Uint8Array): EpubImageFormat | undefined;
|
|
8
|
-
declare function readImageDimensions(bytes: Uint8Array): ImageDimensions | undefined;
|
|
9
|
-
declare const POINTS_PER_PIXEL: number;
|
|
10
|
-
//#endregion
|
|
1
|
+
import { a as readImageDimensions, i as detectImageFormat, n as ImageDimensions, r as POINTS_PER_PIXEL, t as EpubImageFormat } from "../dimensions-B7ogpvKQ.cjs";
|
|
11
2
|
export { EpubImageFormat, ImageDimensions, POINTS_PER_PIXEL, detectImageFormat, readImageDimensions };
|
|
@@ -1,11 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
interface ImageDimensions {
|
|
3
|
-
readonly widthPx: number;
|
|
4
|
-
readonly heightPx: number;
|
|
5
|
-
}
|
|
6
|
-
type EpubImageFormat = "png" | "jpeg";
|
|
7
|
-
declare function detectImageFormat(bytes: Uint8Array): EpubImageFormat | undefined;
|
|
8
|
-
declare function readImageDimensions(bytes: Uint8Array): ImageDimensions | undefined;
|
|
9
|
-
declare const POINTS_PER_PIXEL: number;
|
|
10
|
-
//#endregion
|
|
1
|
+
import { a as readImageDimensions, i as detectImageFormat, n as ImageDimensions, r as POINTS_PER_PIXEL, t as EpubImageFormat } from "../dimensions-B7ogpvKQ.js";
|
|
11
2
|
export { EpubImageFormat, ImageDimensions, POINTS_PER_PIXEL, detectImageFormat, readImageDimensions };
|
package/dist/index.cjs
CHANGED
|
@@ -1,27 +1,30 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_xml_node = require("./xml/node.cjs");
|
|
3
|
+
const require_model_package = require("./model/package.cjs");
|
|
4
|
+
const require_util_base64 = require("./util/base64.cjs");
|
|
5
|
+
const require_xml_parse = require("./xml/parse.cjs");
|
|
6
|
+
const require_zip = require("./zip.cjs");
|
|
7
|
+
const require_package_io_read = require("./package-io/read.cjs");
|
|
8
|
+
const require_format = require("./format.cjs");
|
|
9
|
+
const require_xml_build = require("./xml/build.cjs");
|
|
10
|
+
const require_package_io_write = require("./package-io/write.cjs");
|
|
2
11
|
const require_diagnostics = require("./diagnostics.cjs");
|
|
3
12
|
const require_xml_entities = require("./xml/entities.cjs");
|
|
4
|
-
const require_xml_node = require("./xml/node.cjs");
|
|
5
13
|
const require_xml_query = require("./xml/query.cjs");
|
|
6
|
-
const require_xml_parse = require("./xml/parse.cjs");
|
|
7
14
|
const require_ocf_container = require("./ocf/container.cjs");
|
|
8
|
-
const require_format = require("./format.cjs");
|
|
9
15
|
const require_nav_nav3 = require("./nav/nav3.cjs");
|
|
10
16
|
const require_nav_ncx = require("./nav/ncx.cjs");
|
|
11
17
|
const require_nav_reconcile = require("./nav/reconcile.cjs");
|
|
12
18
|
const require_opf_metadata = require("./opf/metadata.cjs");
|
|
13
19
|
const require_opf_parse = require("./opf/parse.cjs");
|
|
20
|
+
const require_xhtml_footnote = require("./xhtml/footnote.cjs");
|
|
14
21
|
const require_image_dimensions = require("./image/dimensions.cjs");
|
|
15
|
-
const require_util_base64 = require("./util/base64.cjs");
|
|
16
|
-
const require_xml_build = require("./xml/build.cjs");
|
|
17
22
|
const require_xhtml_context = require("./xhtml/context.cjs");
|
|
18
|
-
const require_xhtml_footnote = require("./xhtml/footnote.cjs");
|
|
19
23
|
const require_xhtml_style_constants = require("./xhtml/style-constants.cjs");
|
|
20
24
|
const require_xhtml_inline = require("./xhtml/inline.cjs");
|
|
21
25
|
const require_xhtml_list_id = require("./xhtml/list-id.cjs");
|
|
22
26
|
const require_xhtml_read = require("./xhtml/read.cjs");
|
|
23
27
|
const require_path = require("./path.cjs");
|
|
24
|
-
const require_zip = require("./zip.cjs");
|
|
25
28
|
const require_read = require("./read.cjs");
|
|
26
29
|
const require_ocf_write = require("./ocf/write.cjs");
|
|
27
30
|
const require_nav_write = require("./nav/write.cjs");
|
|
@@ -31,6 +34,8 @@ const require_write = require("./write.cjs");
|
|
|
31
34
|
const require_codec = require("./codec.cjs");
|
|
32
35
|
require("./opf/types.cjs");
|
|
33
36
|
exports.AttributeSchema = require_xml_node.AttributeSchema;
|
|
37
|
+
exports.BLOCK_LEVEL_TAGS = require_xhtml_read.BLOCK_LEVEL_TAGS;
|
|
38
|
+
exports.BinaryPartSchema = require_model_package.BinaryPartSchema;
|
|
34
39
|
exports.DEFINITION_BODY_INDENT_PT = require_xhtml_style_constants.DEFINITION_BODY_INDENT_PT;
|
|
35
40
|
exports.EPUB_MIME_TYPE = require_format.EPUB_MIME_TYPE;
|
|
36
41
|
exports.EpubBytesSchema = require_codec.EpubBytesSchema;
|
|
@@ -40,6 +45,7 @@ exports.EpubInvalidContainerError = require_diagnostics.EpubInvalidContainerErro
|
|
|
40
45
|
exports.EpubInvalidMimetypeError = require_diagnostics.EpubInvalidMimetypeError;
|
|
41
46
|
exports.EpubInvalidOpfError = require_diagnostics.EpubInvalidOpfError;
|
|
42
47
|
exports.EpubPackageFlattenError = require_diagnostics.EpubPackageFlattenError;
|
|
48
|
+
exports.EpubPackageSchema = require_model_package.EpubPackageSchema;
|
|
43
49
|
exports.EpubParseError = require_diagnostics.EpubParseError;
|
|
44
50
|
exports.EpubUnbalancedConstructMarkersError = require_diagnostics.EpubUnbalancedConstructMarkersError;
|
|
45
51
|
exports.EpubUnsupportedDocumentKindError = require_diagnostics.EpubUnsupportedDocumentKindError;
|
|
@@ -50,6 +56,7 @@ exports.NOOP_EPUB_DIAGNOSTIC_SINK = require_diagnostics.NOOP_EPUB_DIAGNOSTIC_SIN
|
|
|
50
56
|
exports.OCF_CONTAINER_PATH = require_format.OCF_CONTAINER_PATH;
|
|
51
57
|
exports.OCF_MIMETYPE_PATH = require_format.OCF_MIMETYPE_PATH;
|
|
52
58
|
exports.POINTS_PER_PIXEL = require_image_dimensions.POINTS_PER_PIXEL;
|
|
59
|
+
exports.PartSchema = require_model_package.PartSchema;
|
|
53
60
|
exports.QUOTE_INDENT_PT = require_xhtml_style_constants.QUOTE_INDENT_PT;
|
|
54
61
|
exports.QUOTE_STYLE_ID = require_xhtml_style_constants.QUOTE_STYLE_ID;
|
|
55
62
|
exports.XmlCdataSchema = require_xml_node.XmlCdataSchema;
|
|
@@ -57,6 +64,7 @@ exports.XmlCommentSchema = require_xml_node.XmlCommentSchema;
|
|
|
57
64
|
exports.XmlDeclarationSchema = require_xml_node.XmlDeclarationSchema;
|
|
58
65
|
exports.XmlElementSchema = require_xml_node.XmlElementSchema;
|
|
59
66
|
exports.XmlNodeSchema = require_xml_node.XmlNodeSchema;
|
|
67
|
+
exports.XmlPartSchema = require_model_package.XmlPartSchema;
|
|
60
68
|
exports.XmlPiSchema = require_xml_node.XmlPiSchema;
|
|
61
69
|
exports.XmlTextSchema = require_xml_node.XmlTextSchema;
|
|
62
70
|
exports.attrValue = require_xml_query.attrValue;
|
|
@@ -66,25 +74,31 @@ exports.buildXml = require_xml_build.buildXml;
|
|
|
66
74
|
exports.bytesToBase64 = require_util_base64.bytesToBase64;
|
|
67
75
|
exports.childrenWithTag = require_xml_query.childrenWithTag;
|
|
68
76
|
exports.decodeEntities = require_xml_entities.decodeEntities;
|
|
77
|
+
exports.decodePackage = require_codec.decodePackage;
|
|
69
78
|
exports.decodeTextLikeNode = require_xml_entities.decodeTextLikeNode;
|
|
70
79
|
exports.decodedTextContent = require_xml_query.decodedTextContent;
|
|
71
80
|
exports.detectImageFormat = require_image_dimensions.detectImageFormat;
|
|
72
81
|
exports.dirname = require_path.dirname;
|
|
73
82
|
exports.elementsWithTag = require_xml_query.elementsWithTag;
|
|
74
83
|
exports.encodeEntities = require_xml_entities.encodeEntities;
|
|
84
|
+
exports.encodePackage = require_codec.encodePackage;
|
|
75
85
|
exports.epubCodec = require_codec.epubCodec;
|
|
76
86
|
exports.epubContentCodec = require_codec.epubContentCodec;
|
|
77
87
|
exports.findChildElement = require_xml_query.findChildElement;
|
|
78
88
|
exports.findElement = require_xml_query.findElement;
|
|
79
89
|
exports.isFootnoteAside = require_xhtml_footnote.isFootnoteAside;
|
|
80
|
-
exports.
|
|
90
|
+
exports.isFootnoteReference = require_xhtml_footnote.isFootnoteReference;
|
|
81
91
|
exports.isInertElement = require_xhtml_context.isInertElement;
|
|
82
92
|
exports.isTextLikeNode = require_xml_node.isTextLikeNode;
|
|
83
93
|
exports.isXmlNode = require_xml_node.isXmlNode;
|
|
84
94
|
exports.mintListNumId = require_xhtml_list_id.mintListNumId;
|
|
85
95
|
exports.navMatchesSpine = require_nav_reconcile.navMatchesSpine;
|
|
96
|
+
exports.packageCodec = require_codec.packageCodec;
|
|
97
|
+
exports.packageFromEntries = require_package_io_read.packageFromEntries;
|
|
98
|
+
exports.packageToEntries = require_package_io_write.packageToEntries;
|
|
86
99
|
exports.parseListNumId = require_xhtml_list_id.parseListNumId;
|
|
87
100
|
exports.parseOpf = require_opf_parse.parseOpf;
|
|
101
|
+
exports.parsePackage = require_package_io_read.parsePackage;
|
|
88
102
|
exports.parseXml = require_xml_parse.parseXml;
|
|
89
103
|
exports.readEpub = require_read.readEpub;
|
|
90
104
|
exports.readEpubContent = require_read.readEpubContent;
|
|
@@ -99,7 +113,9 @@ exports.resolveOpfPath = require_ocf_container.resolveOpfPath;
|
|
|
99
113
|
exports.resolvePackagePath = require_path.resolvePackagePath;
|
|
100
114
|
exports.rootElement = require_xml_query.rootElement;
|
|
101
115
|
exports.sameDocumentFragment = require_xhtml_footnote.sameDocumentFragment;
|
|
116
|
+
exports.scanXhtmlAnchors = require_xhtml_read.scanXhtmlAnchors;
|
|
102
117
|
exports.sectionTitle = require_nav_write.sectionTitle;
|
|
118
|
+
exports.serializePackage = require_package_io_write.serializePackage;
|
|
103
119
|
exports.textContent = require_xml_query.textContent;
|
|
104
120
|
exports.unzipPackage = require_zip.unzipPackage;
|
|
105
121
|
exports.writeContainerXml = require_ocf_write.writeContainerXml;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as OCF_CONTAINER_PATH, r as OCF_MIMETYPE_PATH, t as EPUB_MIME_TYPE } from "./format-DxUddUPj.cjs";
|
|
2
|
+
import { n as unzipPackage, r as zipPackage, t as ZipEntry } from "./zip-ie17sOo5.cjs";
|
|
3
|
+
import { _ as XmlPart, a as epubContentCodec, c as serializePackage, d as BinaryPart, f as BinaryPartSchema, g as PartSchema, h as Part, i as epubCodec, l as packageFromEntries, m as EpubPackageSchema, n as decodePackage, o as packageCodec, p as EpubPackage, r as encodePackage, s as packageToEntries, t as EpubBytesSchema, u as parsePackage, v as XmlPartSchema } from "./codec-qyKMOMt6.cjs";
|
|
2
4
|
import { a as EpubEmptySpineError, c as EpubInvalidOpfError, d as EpubUnbalancedConstructMarkersError, f as EpubUnsupportedDocumentKindError, i as EpubDiagnosticSink, l as EpubPackageFlattenError, m as NOOP_EPUB_DIAGNOSTIC_SINK, n as EpubDiagnosticCodes, o as EpubInvalidContainerError, p as EpubWriteError, r as EpubDiagnosticSeverity, s as EpubInvalidMimetypeError, t as EpubDiagnostic, u as EpubParseError } from "./diagnostics-C0CRdoda.cjs";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
|
|
31
|
-
import { decodeEntities, decodeTextLikeNode, encodeEntities } from "./xml/entities.cjs";
|
|
32
|
-
export { Attribute, AttributeSchema, DEFINITION_BODY_INDENT_PT, EPUB_MIME_TYPE, EpubBytesSchema, EpubDiagnostic, EpubDiagnosticCodes, EpubDiagnosticSeverity, EpubDiagnosticSink, EpubEmptySpineError, EpubImageFormat, EpubInvalidContainerError, EpubInvalidMimetypeError, EpubInvalidOpfError, EpubPackageFlattenError, EpubParseError, EpubUnbalancedConstructMarkersError, EpubUnsupportedDocumentKindError, EpubWriteError, HORIZONTAL_RULE_STYLE_ID, ImageDimensions, InlineResult, InlineStyle, ListNumIdInfo, MONOSPACE_FONT_FAMILY, MintListNumIdOptions, NOOP_EPUB_DIAGNOSTIC_SINK, NavSectionEntry, OCF_CONTAINER_PATH, OCF_MIMETYPE_PATH, OpfManifestItem, OpfPackage, OpfSpineItemRef, POINTS_PER_PIXEL, QUOTE_INDENT_PT, QUOTE_STYLE_ID, ReadEpubOptions, ReadXhtmlBodyOptions, ReadXhtmlBodyResult, WriteEpubOptions, WriteOpfInput, XhtmlReadContext, XhtmlWriteContext, XmlCdata, XmlCdataSchema, XmlComment, XmlCommentSchema, XmlDeclaration, XmlDeclarationSchema, XmlElement, XmlElementSchema, XmlNode, XmlNodeSchema, XmlPi, XmlPiSchema, XmlText, XmlTextSchema, ZipEntry, attrValue, base64ToBytes, buildInlineRuns, buildXml, bytesToBase64, childrenWithTag, decodeEntities, decodeTextLikeNode, decodedTextContent, detectImageFormat, dirname, elementsWithTag, encodeEntities, epubCodec, epubContentCodec, findChildElement, findElement, isFootnoteAside, isFootnoteReferenceAnchor, isInertElement, isTextLikeNode, isXmlNode, mintListNumId, navMatchesSpine, parseListNumId, parseOpf, parseXml, readEpub, readEpubContent, readImageDimensions, readNav3TocHrefs, readNcxHrefs, readOpfMetadata, readXhtmlBody, rebaseConstructs, reportInertElementSkip, resolveOpfPath, resolvePackagePath, rootElement, sameDocumentFragment, sectionTitle, textContent, unzipPackage, writeContainerXml, writeEpub, writeEpubContent, writeNav3Document, writeOpf, writeXhtmlBody, zipPackage };
|
|
5
|
+
import { t as resolveOpfPath } from "./container-B6cHHiY9.cjs";
|
|
6
|
+
import { n as OpfPackage, r as OpfSpineItemRef, t as OpfManifestItem } from "./types-BxmkPT_F.cjs";
|
|
7
|
+
import { _ as isTextLikeNode, a as XmlComment, c as XmlDeclarationSchema, d as XmlNode, f as XmlNodeSchema, g as XmlTextSchema, h as XmlText, i as XmlCdataSchema, l as XmlElement, m as XmlPiSchema, n as AttributeSchema, o as XmlCommentSchema, p as XmlPi, r as XmlCdata, s as XmlDeclaration, t as Attribute, u as XmlElementSchema, v as isXmlNode } from "./node-CJLSSs1k.cjs";
|
|
8
|
+
import { t as readOpfMetadata } from "./metadata-DXto7sM6.cjs";
|
|
9
|
+
import { t as parseOpf } from "./parse-Bkkb7qXz.cjs";
|
|
10
|
+
import { n as writeOpf, t as WriteOpfInput } from "./write-B89sagtw.cjs";
|
|
11
|
+
import { n as bytesToBase64, t as base64ToBytes } from "./base64--HuymRl_.cjs";
|
|
12
|
+
import { a as readImageDimensions, i as detectImageFormat, n as ImageDimensions, r as POINTS_PER_PIXEL, t as EpubImageFormat } from "./dimensions-B7ogpvKQ.cjs";
|
|
13
|
+
import { a as reportInertElementSkip, i as isInertElement, n as ResolvedAnchorTarget, r as XhtmlReadContext, t as InlineStyle } from "./context-CXs2Yc9w.cjs";
|
|
14
|
+
import { n as isFootnoteReference, r as sameDocumentFragment, t as isFootnoteAside } from "./footnote-CxsO5tCV.cjs";
|
|
15
|
+
import { n as buildInlineRuns, r as rebaseConstructs, t as InlineResult } from "./inline-YZOQY2wR.cjs";
|
|
16
|
+
import { i as parseListNumId, n as MintListNumIdOptions, r as mintListNumId, t as ListNumIdInfo } from "./list-id-BB_yxm1H.cjs";
|
|
17
|
+
import { a as readXhtmlBody, i as XhtmlAnchorScan, n as ReadXhtmlBodyOptions, o as scanXhtmlAnchors, r as ReadXhtmlBodyResult, t as BLOCK_LEVEL_TAGS } from "./read-BMGq_D9y.cjs";
|
|
18
|
+
import { a as QUOTE_STYLE_ID, i as QUOTE_INDENT_PT, n as HORIZONTAL_RULE_STYLE_ID, r as MONOSPACE_FONT_FAMILY, t as DEFINITION_BODY_INDENT_PT } from "./style-constants-RVoHdmju.cjs";
|
|
19
|
+
import { n as writeXhtmlBody, t as XhtmlWriteContext } from "./write-WSIgARHT.cjs";
|
|
20
|
+
import { t as readNav3TocHrefs } from "./nav3-SbAp8zlu.cjs";
|
|
21
|
+
import { t as readNcxHrefs } from "./ncx-kYhlXucj.cjs";
|
|
22
|
+
import { t as navMatchesSpine } from "./reconcile-BHky0kta.cjs";
|
|
23
|
+
import { n as sectionTitle, r as writeNav3Document, t as NavSectionEntry } from "./write-COdkb8lG.cjs";
|
|
24
|
+
import { t as writeContainerXml } from "./write-DxiR-9eH.cjs";
|
|
25
|
+
import { n as resolvePackagePath, t as dirname } from "./path-Cx8-QMD6.cjs";
|
|
26
|
+
import { n as readEpub, r as readEpubContent, t as ReadEpubOptions } from "./read-B7kc_MeO.cjs";
|
|
27
|
+
import { n as writeEpub, r as writeEpubContent, t as WriteEpubOptions } from "./write-Boxi3aK0.cjs";
|
|
28
|
+
import { t as parseXml } from "./parse-CmCjyz8i.cjs";
|
|
29
|
+
import { t as buildXml } from "./build-B1UxbO20.cjs";
|
|
30
|
+
import { a as findChildElement, c as textContent, i as elementsWithTag, n as childrenWithTag, o as findElement, r as decodedTextContent, s as rootElement, t as attrValue } from "./query-C6ftPqNQ.cjs";
|
|
31
|
+
import { n as decodeTextLikeNode, r as encodeEntities, t as decodeEntities } from "./entities-wt9zCx5q.cjs";
|
|
32
|
+
export { Attribute, AttributeSchema, BLOCK_LEVEL_TAGS, BinaryPart, BinaryPartSchema, DEFINITION_BODY_INDENT_PT, EPUB_MIME_TYPE, EpubBytesSchema, EpubDiagnostic, EpubDiagnosticCodes, EpubDiagnosticSeverity, EpubDiagnosticSink, EpubEmptySpineError, EpubImageFormat, EpubInvalidContainerError, EpubInvalidMimetypeError, EpubInvalidOpfError, EpubPackage, EpubPackageFlattenError, EpubPackageSchema, EpubParseError, EpubUnbalancedConstructMarkersError, EpubUnsupportedDocumentKindError, EpubWriteError, HORIZONTAL_RULE_STYLE_ID, ImageDimensions, InlineResult, InlineStyle, ListNumIdInfo, MONOSPACE_FONT_FAMILY, MintListNumIdOptions, NOOP_EPUB_DIAGNOSTIC_SINK, NavSectionEntry, OCF_CONTAINER_PATH, OCF_MIMETYPE_PATH, OpfManifestItem, OpfPackage, OpfSpineItemRef, POINTS_PER_PIXEL, Part, PartSchema, QUOTE_INDENT_PT, QUOTE_STYLE_ID, ReadEpubOptions, ReadXhtmlBodyOptions, ReadXhtmlBodyResult, ResolvedAnchorTarget, WriteEpubOptions, WriteOpfInput, XhtmlAnchorScan, XhtmlReadContext, XhtmlWriteContext, XmlCdata, XmlCdataSchema, XmlComment, XmlCommentSchema, XmlDeclaration, XmlDeclarationSchema, XmlElement, XmlElementSchema, XmlNode, XmlNodeSchema, XmlPart, XmlPartSchema, XmlPi, XmlPiSchema, XmlText, XmlTextSchema, ZipEntry, attrValue, base64ToBytes, buildInlineRuns, buildXml, bytesToBase64, childrenWithTag, decodeEntities, decodePackage, decodeTextLikeNode, decodedTextContent, detectImageFormat, dirname, elementsWithTag, encodeEntities, encodePackage, epubCodec, epubContentCodec, findChildElement, findElement, isFootnoteAside, isFootnoteReference, isInertElement, isTextLikeNode, isXmlNode, mintListNumId, navMatchesSpine, packageCodec, packageFromEntries, packageToEntries, parseListNumId, parseOpf, parsePackage, parseXml, readEpub, readEpubContent, readImageDimensions, readNav3TocHrefs, readNcxHrefs, readOpfMetadata, readXhtmlBody, rebaseConstructs, reportInertElementSkip, resolveOpfPath, resolvePackagePath, rootElement, sameDocumentFragment, scanXhtmlAnchors, sectionTitle, serializePackage, textContent, unzipPackage, writeContainerXml, writeEpub, writeEpubContent, writeNav3Document, writeOpf, writeXhtmlBody, zipPackage };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as OCF_CONTAINER_PATH, r as OCF_MIMETYPE_PATH, t as EPUB_MIME_TYPE } from "./format-DxUddUPj.js";
|
|
2
|
+
import { n as unzipPackage, r as zipPackage, t as ZipEntry } from "./zip-ie17sOo5.js";
|
|
3
|
+
import { _ as XmlPart, a as epubContentCodec, c as serializePackage, d as BinaryPart, f as BinaryPartSchema, g as PartSchema, h as Part, i as epubCodec, l as packageFromEntries, m as EpubPackageSchema, n as decodePackage, o as packageCodec, p as EpubPackage, r as encodePackage, s as packageToEntries, t as EpubBytesSchema, u as parsePackage, v as XmlPartSchema } from "./codec-CX2Pa6Jq.js";
|
|
2
4
|
import { a as EpubEmptySpineError, c as EpubInvalidOpfError, d as EpubUnbalancedConstructMarkersError, f as EpubUnsupportedDocumentKindError, i as EpubDiagnosticSink, l as EpubPackageFlattenError, m as NOOP_EPUB_DIAGNOSTIC_SINK, n as EpubDiagnosticCodes, o as EpubInvalidContainerError, p as EpubWriteError, r as EpubDiagnosticSeverity, s as EpubInvalidMimetypeError, t as EpubDiagnostic, u as EpubParseError } from "./diagnostics-C0CRdoda.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
|
|
31
|
-
import { decodeEntities, decodeTextLikeNode, encodeEntities } from "./xml/entities.js";
|
|
32
|
-
export { Attribute, AttributeSchema, DEFINITION_BODY_INDENT_PT, EPUB_MIME_TYPE, EpubBytesSchema, EpubDiagnostic, EpubDiagnosticCodes, EpubDiagnosticSeverity, EpubDiagnosticSink, EpubEmptySpineError, EpubImageFormat, EpubInvalidContainerError, EpubInvalidMimetypeError, EpubInvalidOpfError, EpubPackageFlattenError, EpubParseError, EpubUnbalancedConstructMarkersError, EpubUnsupportedDocumentKindError, EpubWriteError, HORIZONTAL_RULE_STYLE_ID, ImageDimensions, InlineResult, InlineStyle, ListNumIdInfo, MONOSPACE_FONT_FAMILY, MintListNumIdOptions, NOOP_EPUB_DIAGNOSTIC_SINK, NavSectionEntry, OCF_CONTAINER_PATH, OCF_MIMETYPE_PATH, OpfManifestItem, OpfPackage, OpfSpineItemRef, POINTS_PER_PIXEL, QUOTE_INDENT_PT, QUOTE_STYLE_ID, ReadEpubOptions, ReadXhtmlBodyOptions, ReadXhtmlBodyResult, WriteEpubOptions, WriteOpfInput, XhtmlReadContext, XhtmlWriteContext, XmlCdata, XmlCdataSchema, XmlComment, XmlCommentSchema, XmlDeclaration, XmlDeclarationSchema, XmlElement, XmlElementSchema, XmlNode, XmlNodeSchema, XmlPi, XmlPiSchema, XmlText, XmlTextSchema, ZipEntry, attrValue, base64ToBytes, buildInlineRuns, buildXml, bytesToBase64, childrenWithTag, decodeEntities, decodeTextLikeNode, decodedTextContent, detectImageFormat, dirname, elementsWithTag, encodeEntities, epubCodec, epubContentCodec, findChildElement, findElement, isFootnoteAside, isFootnoteReferenceAnchor, isInertElement, isTextLikeNode, isXmlNode, mintListNumId, navMatchesSpine, parseListNumId, parseOpf, parseXml, readEpub, readEpubContent, readImageDimensions, readNav3TocHrefs, readNcxHrefs, readOpfMetadata, readXhtmlBody, rebaseConstructs, reportInertElementSkip, resolveOpfPath, resolvePackagePath, rootElement, sameDocumentFragment, sectionTitle, textContent, unzipPackage, writeContainerXml, writeEpub, writeEpubContent, writeNav3Document, writeOpf, writeXhtmlBody, zipPackage };
|
|
5
|
+
import { t as resolveOpfPath } from "./container-B6cHHiY9.js";
|
|
6
|
+
import { n as OpfPackage, r as OpfSpineItemRef, t as OpfManifestItem } from "./types-BxmkPT_F.js";
|
|
7
|
+
import { _ as isTextLikeNode, a as XmlComment, c as XmlDeclarationSchema, d as XmlNode, f as XmlNodeSchema, g as XmlTextSchema, h as XmlText, i as XmlCdataSchema, l as XmlElement, m as XmlPiSchema, n as AttributeSchema, o as XmlCommentSchema, p as XmlPi, r as XmlCdata, s as XmlDeclaration, t as Attribute, u as XmlElementSchema, v as isXmlNode } from "./node-CJLSSs1k.js";
|
|
8
|
+
import { t as readOpfMetadata } from "./metadata-T5V2ovtS.js";
|
|
9
|
+
import { t as parseOpf } from "./parse-C5GxodcX.js";
|
|
10
|
+
import { n as writeOpf, t as WriteOpfInput } from "./write-DwaEwwgZ.js";
|
|
11
|
+
import { n as bytesToBase64, t as base64ToBytes } from "./base64--HuymRl_.js";
|
|
12
|
+
import { a as readImageDimensions, i as detectImageFormat, n as ImageDimensions, r as POINTS_PER_PIXEL, t as EpubImageFormat } from "./dimensions-B7ogpvKQ.js";
|
|
13
|
+
import { a as reportInertElementSkip, i as isInertElement, n as ResolvedAnchorTarget, r as XhtmlReadContext, t as InlineStyle } from "./context-CTgx7PwU.js";
|
|
14
|
+
import { n as isFootnoteReference, r as sameDocumentFragment, t as isFootnoteAside } from "./footnote-iZAPC_NT.js";
|
|
15
|
+
import { n as buildInlineRuns, r as rebaseConstructs, t as InlineResult } from "./inline-DDj6Sl3e.js";
|
|
16
|
+
import { i as parseListNumId, n as MintListNumIdOptions, r as mintListNumId, t as ListNumIdInfo } from "./list-id-BB_yxm1H.js";
|
|
17
|
+
import { a as readXhtmlBody, i as XhtmlAnchorScan, n as ReadXhtmlBodyOptions, o as scanXhtmlAnchors, r as ReadXhtmlBodyResult, t as BLOCK_LEVEL_TAGS } from "./read-Czqr3aop.js";
|
|
18
|
+
import { a as QUOTE_STYLE_ID, i as QUOTE_INDENT_PT, n as HORIZONTAL_RULE_STYLE_ID, r as MONOSPACE_FONT_FAMILY, t as DEFINITION_BODY_INDENT_PT } from "./style-constants-RVoHdmju.js";
|
|
19
|
+
import { n as writeXhtmlBody, t as XhtmlWriteContext } from "./write-Klo0WDhT.js";
|
|
20
|
+
import { t as readNav3TocHrefs } from "./nav3-SbAp8zlu.js";
|
|
21
|
+
import { t as readNcxHrefs } from "./ncx-kYhlXucj.js";
|
|
22
|
+
import { t as navMatchesSpine } from "./reconcile-BHky0kta.js";
|
|
23
|
+
import { n as sectionTitle, r as writeNav3Document, t as NavSectionEntry } from "./write-COdkb8lG.js";
|
|
24
|
+
import { t as writeContainerXml } from "./write-DxiR-9eH.js";
|
|
25
|
+
import { n as resolvePackagePath, t as dirname } from "./path-Cx8-QMD6.js";
|
|
26
|
+
import { n as readEpub, r as readEpubContent, t as ReadEpubOptions } from "./read-DPkpZsYG.js";
|
|
27
|
+
import { n as writeEpub, r as writeEpubContent, t as WriteEpubOptions } from "./write-BQcrPQvx.js";
|
|
28
|
+
import { t as parseXml } from "./parse-Dc76LQIj.js";
|
|
29
|
+
import { t as buildXml } from "./build-BCUsHLYw.js";
|
|
30
|
+
import { a as findChildElement, c as textContent, i as elementsWithTag, n as childrenWithTag, o as findElement, r as decodedTextContent, s as rootElement, t as attrValue } from "./query-B79eElol.js";
|
|
31
|
+
import { n as decodeTextLikeNode, r as encodeEntities, t as decodeEntities } from "./entities-CfQKtI34.js";
|
|
32
|
+
export { Attribute, AttributeSchema, BLOCK_LEVEL_TAGS, BinaryPart, BinaryPartSchema, DEFINITION_BODY_INDENT_PT, EPUB_MIME_TYPE, EpubBytesSchema, EpubDiagnostic, EpubDiagnosticCodes, EpubDiagnosticSeverity, EpubDiagnosticSink, EpubEmptySpineError, EpubImageFormat, EpubInvalidContainerError, EpubInvalidMimetypeError, EpubInvalidOpfError, EpubPackage, EpubPackageFlattenError, EpubPackageSchema, EpubParseError, EpubUnbalancedConstructMarkersError, EpubUnsupportedDocumentKindError, EpubWriteError, HORIZONTAL_RULE_STYLE_ID, ImageDimensions, InlineResult, InlineStyle, ListNumIdInfo, MONOSPACE_FONT_FAMILY, MintListNumIdOptions, NOOP_EPUB_DIAGNOSTIC_SINK, NavSectionEntry, OCF_CONTAINER_PATH, OCF_MIMETYPE_PATH, OpfManifestItem, OpfPackage, OpfSpineItemRef, POINTS_PER_PIXEL, Part, PartSchema, QUOTE_INDENT_PT, QUOTE_STYLE_ID, ReadEpubOptions, ReadXhtmlBodyOptions, ReadXhtmlBodyResult, ResolvedAnchorTarget, WriteEpubOptions, WriteOpfInput, XhtmlAnchorScan, XhtmlReadContext, XhtmlWriteContext, XmlCdata, XmlCdataSchema, XmlComment, XmlCommentSchema, XmlDeclaration, XmlDeclarationSchema, XmlElement, XmlElementSchema, XmlNode, XmlNodeSchema, XmlPart, XmlPartSchema, XmlPi, XmlPiSchema, XmlText, XmlTextSchema, ZipEntry, attrValue, base64ToBytes, buildInlineRuns, buildXml, bytesToBase64, childrenWithTag, decodeEntities, decodePackage, decodeTextLikeNode, decodedTextContent, detectImageFormat, dirname, elementsWithTag, encodeEntities, encodePackage, epubCodec, epubContentCodec, findChildElement, findElement, isFootnoteAside, isFootnoteReference, isInertElement, isTextLikeNode, isXmlNode, mintListNumId, navMatchesSpine, packageCodec, packageFromEntries, packageToEntries, parseListNumId, parseOpf, parsePackage, parseXml, readEpub, readEpubContent, readImageDimensions, readNav3TocHrefs, readNcxHrefs, readOpfMetadata, readXhtmlBody, rebaseConstructs, reportInertElementSkip, resolveOpfPath, resolvePackagePath, rootElement, sameDocumentFragment, scanXhtmlAnchors, sectionTitle, serializePackage, textContent, unzipPackage, writeContainerXml, writeEpub, writeEpubContent, writeNav3Document, writeOpf, writeXhtmlBody, zipPackage };
|
package/dist/index.js
CHANGED
|
@@ -1,32 +1,35 @@
|
|
|
1
|
+
import { AttributeSchema, XmlCdataSchema, XmlCommentSchema, XmlDeclarationSchema, XmlElementSchema, XmlNodeSchema, XmlPiSchema, XmlTextSchema, isTextLikeNode, isXmlNode } from "./xml/node.js";
|
|
2
|
+
import { BinaryPartSchema, EpubPackageSchema, PartSchema, XmlPartSchema } from "./model/package.js";
|
|
3
|
+
import { base64ToBytes, bytesToBase64 } from "./util/base64.js";
|
|
4
|
+
import { parseXml } from "./xml/parse.js";
|
|
5
|
+
import { unzipPackage, zipPackage } from "./zip.js";
|
|
6
|
+
import { packageFromEntries, parsePackage } from "./package-io/read.js";
|
|
7
|
+
import { EPUB_MIME_TYPE, OCF_CONTAINER_PATH, OCF_MIMETYPE_PATH } from "./format.js";
|
|
8
|
+
import { buildXml } from "./xml/build.js";
|
|
9
|
+
import { packageToEntries, serializePackage } from "./package-io/write.js";
|
|
1
10
|
import { EpubDiagnosticCodes, EpubEmptySpineError, EpubInvalidContainerError, EpubInvalidMimetypeError, EpubInvalidOpfError, EpubPackageFlattenError, EpubParseError, EpubUnbalancedConstructMarkersError, EpubUnsupportedDocumentKindError, EpubWriteError, NOOP_EPUB_DIAGNOSTIC_SINK } from "./diagnostics.js";
|
|
2
11
|
import { decodeEntities, decodeTextLikeNode, encodeEntities } from "./xml/entities.js";
|
|
3
|
-
import { AttributeSchema, XmlCdataSchema, XmlCommentSchema, XmlDeclarationSchema, XmlElementSchema, XmlNodeSchema, XmlPiSchema, XmlTextSchema, isTextLikeNode, isXmlNode } from "./xml/node.js";
|
|
4
12
|
import { attrValue, childrenWithTag, decodedTextContent, elementsWithTag, findChildElement, findElement, rootElement, textContent } from "./xml/query.js";
|
|
5
|
-
import { parseXml } from "./xml/parse.js";
|
|
6
13
|
import { resolveOpfPath } from "./ocf/container.js";
|
|
7
|
-
import { EPUB_MIME_TYPE, OCF_CONTAINER_PATH, OCF_MIMETYPE_PATH } from "./format.js";
|
|
8
14
|
import { readNav3TocHrefs } from "./nav/nav3.js";
|
|
9
15
|
import { readNcxHrefs } from "./nav/ncx.js";
|
|
10
16
|
import { navMatchesSpine } from "./nav/reconcile.js";
|
|
11
17
|
import { readOpfMetadata } from "./opf/metadata.js";
|
|
12
18
|
import { parseOpf } from "./opf/parse.js";
|
|
19
|
+
import { isFootnoteAside, isFootnoteReference, sameDocumentFragment } from "./xhtml/footnote.js";
|
|
13
20
|
import { POINTS_PER_PIXEL, detectImageFormat, readImageDimensions } from "./image/dimensions.js";
|
|
14
|
-
import { base64ToBytes, bytesToBase64 } from "./util/base64.js";
|
|
15
|
-
import { buildXml } from "./xml/build.js";
|
|
16
21
|
import { isInertElement, reportInertElementSkip } from "./xhtml/context.js";
|
|
17
|
-
import { isFootnoteAside, isFootnoteReferenceAnchor, sameDocumentFragment } from "./xhtml/footnote.js";
|
|
18
22
|
import { DEFINITION_BODY_INDENT_PT, HORIZONTAL_RULE_STYLE_ID, MONOSPACE_FONT_FAMILY, QUOTE_INDENT_PT, QUOTE_STYLE_ID } from "./xhtml/style-constants.js";
|
|
19
23
|
import { buildInlineRuns, rebaseConstructs } from "./xhtml/inline.js";
|
|
20
24
|
import { mintListNumId, parseListNumId } from "./xhtml/list-id.js";
|
|
21
|
-
import { readXhtmlBody } from "./xhtml/read.js";
|
|
25
|
+
import { BLOCK_LEVEL_TAGS, readXhtmlBody, scanXhtmlAnchors } from "./xhtml/read.js";
|
|
22
26
|
import { dirname, resolvePackagePath } from "./path.js";
|
|
23
|
-
import { unzipPackage, zipPackage } from "./zip.js";
|
|
24
27
|
import { readEpub, readEpubContent } from "./read.js";
|
|
25
28
|
import { writeContainerXml } from "./ocf/write.js";
|
|
26
29
|
import { sectionTitle, writeNav3Document } from "./nav/write.js";
|
|
27
30
|
import { writeOpf } from "./opf/write.js";
|
|
28
31
|
import { writeXhtmlBody } from "./xhtml/write.js";
|
|
29
32
|
import { writeEpub, writeEpubContent } from "./write.js";
|
|
30
|
-
import { EpubBytesSchema, epubCodec, epubContentCodec } from "./codec.js";
|
|
33
|
+
import { EpubBytesSchema, decodePackage, encodePackage, epubCodec, epubContentCodec, packageCodec } from "./codec.js";
|
|
31
34
|
import "./opf/types.js";
|
|
32
|
-
export { AttributeSchema, DEFINITION_BODY_INDENT_PT, EPUB_MIME_TYPE, EpubBytesSchema, EpubDiagnosticCodes, EpubEmptySpineError, EpubInvalidContainerError, EpubInvalidMimetypeError, EpubInvalidOpfError, EpubPackageFlattenError, EpubParseError, EpubUnbalancedConstructMarkersError, EpubUnsupportedDocumentKindError, EpubWriteError, HORIZONTAL_RULE_STYLE_ID, MONOSPACE_FONT_FAMILY, NOOP_EPUB_DIAGNOSTIC_SINK, OCF_CONTAINER_PATH, OCF_MIMETYPE_PATH, POINTS_PER_PIXEL, QUOTE_INDENT_PT, QUOTE_STYLE_ID, XmlCdataSchema, XmlCommentSchema, XmlDeclarationSchema, XmlElementSchema, XmlNodeSchema, XmlPiSchema, XmlTextSchema, attrValue, base64ToBytes, buildInlineRuns, buildXml, bytesToBase64, childrenWithTag, decodeEntities, decodeTextLikeNode, decodedTextContent, detectImageFormat, dirname, elementsWithTag, encodeEntities, epubCodec, epubContentCodec, findChildElement, findElement, isFootnoteAside,
|
|
35
|
+
export { AttributeSchema, BLOCK_LEVEL_TAGS, BinaryPartSchema, DEFINITION_BODY_INDENT_PT, EPUB_MIME_TYPE, EpubBytesSchema, EpubDiagnosticCodes, EpubEmptySpineError, EpubInvalidContainerError, EpubInvalidMimetypeError, EpubInvalidOpfError, EpubPackageFlattenError, EpubPackageSchema, EpubParseError, EpubUnbalancedConstructMarkersError, EpubUnsupportedDocumentKindError, EpubWriteError, HORIZONTAL_RULE_STYLE_ID, MONOSPACE_FONT_FAMILY, NOOP_EPUB_DIAGNOSTIC_SINK, OCF_CONTAINER_PATH, OCF_MIMETYPE_PATH, POINTS_PER_PIXEL, PartSchema, QUOTE_INDENT_PT, QUOTE_STYLE_ID, XmlCdataSchema, XmlCommentSchema, XmlDeclarationSchema, XmlElementSchema, XmlNodeSchema, XmlPartSchema, XmlPiSchema, XmlTextSchema, attrValue, base64ToBytes, buildInlineRuns, buildXml, bytesToBase64, childrenWithTag, decodeEntities, decodePackage, decodeTextLikeNode, decodedTextContent, detectImageFormat, dirname, elementsWithTag, encodeEntities, encodePackage, epubCodec, epubContentCodec, findChildElement, findElement, isFootnoteAside, isFootnoteReference, isInertElement, isTextLikeNode, isXmlNode, mintListNumId, navMatchesSpine, packageCodec, packageFromEntries, packageToEntries, parseListNumId, parseOpf, parsePackage, parseXml, readEpub, readEpubContent, readImageDimensions, readNav3TocHrefs, readNcxHrefs, readOpfMetadata, readXhtmlBody, rebaseConstructs, reportInertElementSkip, resolveOpfPath, resolvePackagePath, rootElement, sameDocumentFragment, scanXhtmlAnchors, sectionTitle, serializePackage, textContent, unzipPackage, writeContainerXml, writeEpub, writeEpubContent, writeNav3Document, writeOpf, writeXhtmlBody, zipPackage };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { d as XmlNode } from "./node-CJLSSs1k.js";
|
|
2
|
+
import { r as XhtmlReadContext, t as InlineStyle } from "./context-CTgx7PwU.js";
|
|
3
|
+
import { ContentRun, RunConstructExtent } from "document-schema.js";
|
|
4
|
+
//#region src/xhtml/inline.d.ts
|
|
5
|
+
interface InlineResult {
|
|
6
|
+
readonly runs: ContentRun[];
|
|
7
|
+
readonly constructs: RunConstructExtent[];
|
|
8
|
+
}
|
|
9
|
+
declare function buildInlineRuns(nodes: readonly XmlNode[], style: InlineStyle, context: XhtmlReadContext): InlineResult;
|
|
10
|
+
declare function rebaseConstructs(constructs: readonly RunConstructExtent[], offset: number): RunConstructExtent[];
|
|
11
|
+
//#endregion
|
|
12
|
+
export { buildInlineRuns as n, rebaseConstructs as r, InlineResult as t };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { d as XmlNode } from "./node-CJLSSs1k.cjs";
|
|
2
|
+
import { r as XhtmlReadContext, t as InlineStyle } from "./context-CXs2Yc9w.cjs";
|
|
3
|
+
import { ContentRun, RunConstructExtent } from "document-schema.js";
|
|
4
|
+
//#region src/xhtml/inline.d.ts
|
|
5
|
+
interface InlineResult {
|
|
6
|
+
readonly runs: ContentRun[];
|
|
7
|
+
readonly constructs: RunConstructExtent[];
|
|
8
|
+
}
|
|
9
|
+
declare function buildInlineRuns(nodes: readonly XmlNode[], style: InlineStyle, context: XhtmlReadContext): InlineResult;
|
|
10
|
+
declare function rebaseConstructs(constructs: readonly RunConstructExtent[], offset: number): RunConstructExtent[];
|
|
11
|
+
//#endregion
|
|
12
|
+
export { buildInlineRuns as n, rebaseConstructs as r, InlineResult as t };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
//#region src/xhtml/list-id.d.ts
|
|
2
|
+
interface ListNumIdInfo {
|
|
3
|
+
readonly type: "bullet" | "ordered";
|
|
4
|
+
readonly start?: number;
|
|
5
|
+
}
|
|
6
|
+
interface MintListNumIdOptions {
|
|
7
|
+
readonly type: "bullet" | "ordered";
|
|
8
|
+
readonly start?: number;
|
|
9
|
+
}
|
|
10
|
+
declare function mintListNumId(nextId: number, options: MintListNumIdOptions): string;
|
|
11
|
+
declare function parseListNumId(numId: string): ListNumIdInfo | undefined;
|
|
12
|
+
//#endregion
|
|
13
|
+
export { parseListNumId as i, MintListNumIdOptions as n, mintListNumId as r, ListNumIdInfo as t };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
//#region src/xhtml/list-id.d.ts
|
|
2
|
+
interface ListNumIdInfo {
|
|
3
|
+
readonly type: "bullet" | "ordered";
|
|
4
|
+
readonly start?: number;
|
|
5
|
+
}
|
|
6
|
+
interface MintListNumIdOptions {
|
|
7
|
+
readonly type: "bullet" | "ordered";
|
|
8
|
+
readonly start?: number;
|
|
9
|
+
}
|
|
10
|
+
declare function mintListNumId(nextId: number, options: MintListNumIdOptions): string;
|
|
11
|
+
declare function parseListNumId(numId: string): ListNumIdInfo | undefined;
|
|
12
|
+
//#endregion
|
|
13
|
+
export { parseListNumId as i, MintListNumIdOptions as n, mintListNumId as r, ListNumIdInfo as t };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { i as EpubDiagnosticSink } from "./diagnostics-C0CRdoda.cjs";
|
|
2
|
+
import { l as XmlElement } from "./node-CJLSSs1k.cjs";
|
|
3
|
+
import { LayoutMetadata } from "document-schema.js";
|
|
4
|
+
//#region src/opf/metadata.d.ts
|
|
5
|
+
declare function readOpfMetadata(metadataElement: XmlElement, sink: EpubDiagnosticSink): LayoutMetadata;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { readOpfMetadata as t };
|