@readium/shared 2.2.0-beta.3 → 2.2.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/dist/index.js +218 -213
- package/dist/index.umd.cjs +3 -3
- package/package.json +1 -1
- package/src/fetcher/Fetcher.ts +2 -2
- package/src/fetcher/HttpFetcher.ts +3 -3
- package/src/fetcher/Resource.ts +1 -1
- package/src/fetcher/index.ts +3 -3
- package/src/index.ts +4 -4
- package/src/opds/Availability.ts +1 -1
- package/src/opds/Copies.ts +1 -1
- package/src/opds/Holds.ts +1 -1
- package/src/opds/Price.ts +1 -1
- package/src/opds/index.ts +5 -5
- package/src/publication/BelongsTo.ts +1 -1
- package/src/publication/Contributor.ts +4 -4
- package/src/publication/GuidedNavigation.ts +19 -19
- package/src/publication/Link.ts +6 -6
- package/src/publication/Locator.ts +1 -1
- package/src/publication/LocatorCollection.ts +4 -4
- package/src/publication/Manifest.ts +6 -6
- package/src/publication/Metadata.ts +13 -13
- package/src/publication/Publication.ts +12 -14
- package/src/publication/PublicationCollection.ts +1 -1
- package/src/publication/ReadingProgression.ts +1 -1
- package/src/publication/Subject.ts +2 -2
- package/src/publication/accessibility/AccessibilityMetadataDisplayGuide.ts +20 -20
- package/src/publication/accessibility/Localization.ts +15 -15
- package/src/publication/accessibility/index.ts +3 -3
- package/src/publication/encryption/Properties.ts +2 -2
- package/src/publication/encryption/index.ts +2 -2
- package/src/publication/epub/Metadata.ts +3 -3
- package/src/publication/epub/Properties.ts +1 -1
- package/src/publication/epub/Publication.ts +2 -2
- package/src/publication/epub/index.ts +4 -4
- package/src/publication/html/DomRange.ts +1 -1
- package/src/publication/html/DomRangePoint.ts +1 -1
- package/src/publication/html/Locations.ts +3 -3
- package/src/publication/html/index.ts +3 -3
- package/src/publication/index.ts +24 -24
- package/src/publication/opds/Properties.ts +4 -4
- package/src/publication/opds/Publication.ts +2 -2
- package/src/publication/opds/index.ts +2 -2
- package/src/publication/services/content/Content.ts +3 -3
- package/src/publication/services/content/ContentTokenizer.ts +6 -6
- package/src/publication/services/content/Iterator.ts +2 -2
- package/src/publication/services/content/element/attributes.ts +2 -2
- package/src/publication/services/content/element/element.ts +5 -5
- package/src/publication/services/content/element/index.ts +3 -3
- package/src/publication/services/content/index.ts +5 -5
- package/src/publication/services/content/iterators/HTMLResourceContentIterator.ts +8 -8
- package/src/publication/services/content/iterators/PDFTextContentIterator.ts +21 -21
- package/src/publication/services/content/iterators/PublicationContentIterator.ts +6 -6
- package/src/publication/services/content/iterators/helpers.ts +1 -1
- package/src/publication/services/content/iterators/index.ts +3 -3
- package/src/publication/services/index.ts +2 -2
- package/src/publication/services/timeline/Timeline.ts +52 -29
- package/src/publication/services/timeline/index.ts +2 -2
- package/src/util/index.ts +5 -5
- package/src/util/mediatype/index.ts +1 -1
- package/src/util/tokenizer/TextTokenizer.ts +5 -5
- package/src/util/tokenizer/index.ts +2 -2
- package/types/src/fetcher/Fetcher.d.ts +2 -2
- package/types/src/fetcher/HttpFetcher.d.ts +3 -3
- package/types/src/fetcher/Resource.d.ts +1 -1
- package/types/src/fetcher/index.d.ts +3 -3
- package/types/src/index.d.ts +4 -4
- package/types/src/opds/index.d.ts +5 -5
- package/types/src/publication/BelongsTo.d.ts +1 -1
- package/types/src/publication/Contributor.d.ts +3 -3
- package/types/src/publication/GuidedNavigation.d.ts +1 -1
- package/types/src/publication/Link.d.ts +3 -3
- package/types/src/publication/LocatorCollection.d.ts +3 -3
- package/types/src/publication/Manifest.d.ts +4 -4
- package/types/src/publication/Metadata.d.ts +10 -10
- package/types/src/publication/Publication.d.ts +11 -12
- package/types/src/publication/PublicationCollection.d.ts +1 -1
- package/types/src/publication/ReadingProgression.d.ts +1 -1
- package/types/src/publication/Subject.d.ts +2 -2
- package/types/src/publication/accessibility/AccessibilityMetadataDisplayGuide.d.ts +2 -2
- package/types/src/publication/accessibility/index.d.ts +3 -3
- package/types/src/publication/encryption/Properties.d.ts +1 -1
- package/types/src/publication/encryption/index.d.ts +2 -2
- package/types/src/publication/epub/Metadata.d.ts +1 -1
- package/types/src/publication/epub/Publication.d.ts +1 -1
- package/types/src/publication/epub/index.d.ts +4 -4
- package/types/src/publication/html/DomRange.d.ts +1 -1
- package/types/src/publication/html/Locations.d.ts +1 -1
- package/types/src/publication/html/index.d.ts +3 -3
- package/types/src/publication/index.d.ts +24 -24
- package/types/src/publication/opds/Properties.d.ts +2 -2
- package/types/src/publication/opds/Publication.d.ts +1 -1
- package/types/src/publication/opds/index.d.ts +2 -2
- package/types/src/publication/services/content/Content.d.ts +2 -2
- package/types/src/publication/services/content/ContentTokenizer.d.ts +2 -2
- package/types/src/publication/services/content/Iterator.d.ts +1 -1
- package/types/src/publication/services/content/element/attributes.d.ts +1 -1
- package/types/src/publication/services/content/element/element.d.ts +4 -4
- package/types/src/publication/services/content/element/index.d.ts +3 -3
- package/types/src/publication/services/content/index.d.ts +5 -5
- package/types/src/publication/services/content/iterators/HTMLResourceContentIterator.d.ts +4 -4
- package/types/src/publication/services/content/iterators/PDFTextContentIterator.d.ts +3 -3
- package/types/src/publication/services/content/iterators/PublicationContentIterator.d.ts +5 -5
- package/types/src/publication/services/content/iterators/helpers.d.ts +1 -1
- package/types/src/publication/services/content/iterators/index.d.ts +3 -3
- package/types/src/publication/services/index.d.ts +2 -2
- package/types/src/publication/services/timeline/Timeline.d.ts +9 -6
- package/types/src/publication/services/timeline/index.d.ts +2 -2
- package/types/src/util/index.d.ts +5 -5
- package/types/src/util/mediatype/index.d.ts +1 -1
- package/types/src/util/tokenizer/TextTokenizer.d.ts +2 -2
- package/types/src/util/tokenizer/index.d.ts +2 -2
- package/types/test/AltIdentifier.test.d.ts +0 -1
- package/types/test/Contributor.test.d.ts +0 -1
- package/types/test/GuidedNavigation.test.d.ts +0 -1
- package/types/test/Link.test.d.ts +0 -1
- package/types/test/LocalizedString.test.d.ts +0 -1
- package/types/test/Locator.test.d.ts +0 -1
- package/types/test/LocatorCollection.test.d.ts +0 -1
- package/types/test/Manifest.test.d.ts +0 -1
- package/types/test/Metadata.test.d.ts +0 -1
- package/types/test/Properties.test.d.ts +0 -1
- package/types/test/Publication.test.d.ts +0 -1
- package/types/test/PublicationCollection.test.d.ts +0 -1
- package/types/test/Subject.test.d.ts +0 -1
- package/types/test/TDM.test.d.ts +0 -1
- package/types/test/Timeline.test.d.ts +0 -1
- package/types/test/accessibility/Accessibility.test.d.ts +0 -1
- package/types/test/accessibility/AccessibilityMetadataDisplayGuide.test.d.ts +0 -1
- package/types/test/accessibility/Localization.test.d.ts +0 -1
- package/types/test/encryption/Encryption.test.d.ts +0 -1
- package/types/test/encryption/Properties.test.d.ts +0 -1
- package/types/test/epub/MediaOverlay.test.d.ts +0 -1
- package/types/test/epub/Metadata.test.d.ts +0 -1
- package/types/test/epub/PropertiesTest.test.d.ts +0 -1
- package/types/test/epub/PublicationTest.test.d.ts +0 -1
- package/types/test/html/DomRange.test.d.ts +0 -1
- package/types/test/html/Locator.test.d.ts +0 -1
- package/types/test/opds/PropertiesTest.test.d.ts +0 -1
- package/types/test/opds/PublicationTest.test.d.ts +0 -1
- package/types/test/util/URITemplate.test.d.ts +0 -1
- package/types/test/util/mediatype/MediaType.test.d.ts +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Resource } from "../../../../fetcher/Resource";
|
|
2
|
-
import { Locator } from "../../../Locator";
|
|
3
|
-
import { Iterator } from "../Iterator";
|
|
4
|
-
import { ContentElement } from "../element";
|
|
1
|
+
import { Resource } from "../../../../fetcher/Resource.ts";
|
|
2
|
+
import { Locator } from "../../../Locator.ts";
|
|
3
|
+
import { Iterator } from "../Iterator.ts";
|
|
4
|
+
import { ContentElement } from "../element/index.ts";
|
|
5
5
|
/**
|
|
6
6
|
* Iterates an HTML [resource], starting from the given [locator].
|
|
7
7
|
*
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Locator } from "../../../Locator";
|
|
2
|
-
import { Attribute, ContentElement } from "../element";
|
|
3
|
-
import { Iterator } from "../Iterator";
|
|
1
|
+
import { Locator } from "../../../Locator.ts";
|
|
2
|
+
import { Attribute, ContentElement } from "../element/index.ts";
|
|
3
|
+
import { Iterator } from "../Iterator.ts";
|
|
4
4
|
type TextItem = {
|
|
5
5
|
str: string;
|
|
6
6
|
dir: string;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Resource } from "../../../../fetcher/Resource";
|
|
2
|
-
import { Locator } from "../../../Locator";
|
|
3
|
-
import { Publication } from "../../../Publication";
|
|
4
|
-
import { Iterator } from "../Iterator";
|
|
5
|
-
import { ContentElement } from "../element";
|
|
1
|
+
import { Resource } from "../../../../fetcher/Resource.ts";
|
|
2
|
+
import { Locator } from "../../../Locator.ts";
|
|
3
|
+
import { Publication } from "../../../Publication.ts";
|
|
4
|
+
import { Iterator } from "../Iterator.ts";
|
|
5
|
+
import { ContentElement } from "../element/index.ts";
|
|
6
6
|
export type ResourceContentIteratorFactory = (resource: Resource, locator: Locator) => Iterator | null;
|
|
7
7
|
export declare class PublicationContentIterator extends Iterator {
|
|
8
8
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { LocatorText } from "../../../Locator";
|
|
1
|
+
import { LocatorText } from "../../../Locator.ts";
|
|
2
2
|
export declare function isInlineTag(n: Node): boolean;
|
|
3
3
|
export declare function srcRelativeToHref(e: Element, base?: string | URL): string | null;
|
|
4
4
|
export declare const isBlank: (s: string | null) => boolean;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './PublicationContentIterator';
|
|
2
|
-
export * from './PDFTextContentIterator';
|
|
3
|
-
export * from './HTMLResourceContentIterator';
|
|
1
|
+
export * from './PublicationContentIterator.ts';
|
|
2
|
+
export * from './PDFTextContentIterator.ts';
|
|
3
|
+
export * from './HTMLResourceContentIterator.ts';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './
|
|
2
|
-
export * from './
|
|
1
|
+
export * from './timeline/index.ts';
|
|
2
|
+
export * from './content/index.ts';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Link, Links } from "../../Link";
|
|
2
|
-
import { Locator } from "../../Locator";
|
|
3
|
-
import { TimelineItem } from "./TimelineItem";
|
|
1
|
+
import { Link, Links } from "../../Link.ts";
|
|
2
|
+
import { Locator } from "../../Locator.ts";
|
|
3
|
+
import { TimelineItem } from "./TimelineItem.ts";
|
|
4
4
|
interface PublicationLike {
|
|
5
5
|
toc?: Links;
|
|
6
6
|
readingOrder: Links;
|
|
@@ -28,6 +28,8 @@ export declare class Timeline {
|
|
|
28
28
|
private _depth;
|
|
29
29
|
private _items;
|
|
30
30
|
private _flat;
|
|
31
|
+
/** Populated when depth is set; maps cloned items from trimToDepth back to their Links. */
|
|
32
|
+
private _trimmedLinkMap;
|
|
31
33
|
constructor(items: TimelineItem[], linkMap: Map<TimelineItem, Link>);
|
|
32
34
|
static build(publication: PublicationLike, options?: {
|
|
33
35
|
depth?: number;
|
|
@@ -74,13 +76,14 @@ export declare class Timeline {
|
|
|
74
76
|
private static collectTocCandidates;
|
|
75
77
|
/**
|
|
76
78
|
* A TOC href points to the start of its resource when it has no fragment,
|
|
77
|
-
* or when the fragment
|
|
79
|
+
* or when the fragment contains a parsable `t=` value of 0 (audio: explicit
|
|
80
|
+
* beginning of the file). Accepts decimals and extra params, e.g. `t=0.0`
|
|
81
|
+
* or `foo=bar&t=0`.
|
|
78
82
|
*/
|
|
79
83
|
private static isStartOfResource;
|
|
80
84
|
private static trimToDepth;
|
|
81
85
|
private flattenItems;
|
|
82
|
-
private
|
|
83
|
-
private static parseTimeFragment;
|
|
86
|
+
private itemStartTime;
|
|
84
87
|
private bareHrefFromItem;
|
|
85
88
|
private timeFromItem;
|
|
86
89
|
private ancestorPath;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './Timeline';
|
|
2
|
-
export * from './TimelineItem';
|
|
1
|
+
export * from './Timeline.ts';
|
|
2
|
+
export * from './TimelineItem.ts';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export * from './mediatype';
|
|
2
|
-
export * from './JSONParse';
|
|
3
|
-
export * from './URITemplate';
|
|
4
|
-
export * from './Language';
|
|
5
|
-
export * from './tokenizer';
|
|
1
|
+
export * from './mediatype/index.ts';
|
|
2
|
+
export * from './JSONParse.ts';
|
|
3
|
+
export * from './URITemplate.ts';
|
|
4
|
+
export * from './Language.ts';
|
|
5
|
+
export * from './tokenizer/index.ts';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './MediaType';
|
|
1
|
+
export * from './MediaType.ts';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Language } from "../Language";
|
|
2
|
-
import { Tokenizer } from "./Tokenizer";
|
|
1
|
+
import { Language } from "../Language.ts";
|
|
2
|
+
import { Tokenizer } from "./Tokenizer.ts";
|
|
3
3
|
export type Range = [number, number];
|
|
4
4
|
/**
|
|
5
5
|
* A tokenizer splitting a String into range tokens (e.g. words, sentences, etc.).
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './Tokenizer';
|
|
2
|
-
export * from './TextTokenizer';
|
|
1
|
+
export * from './Tokenizer.ts';
|
|
2
|
+
export * from './TextTokenizer.ts';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/types/test/TDM.test.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|