@readium/shared 2.2.0-beta.2 → 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.
Files changed (141) hide show
  1. package/dist/index.js +249 -252
  2. package/dist/index.umd.cjs +3 -3
  3. package/package.json +1 -1
  4. package/src/fetcher/Fetcher.ts +2 -2
  5. package/src/fetcher/HttpFetcher.ts +3 -3
  6. package/src/fetcher/Resource.ts +1 -1
  7. package/src/fetcher/index.ts +3 -3
  8. package/src/index.ts +4 -4
  9. package/src/opds/Availability.ts +1 -1
  10. package/src/opds/Copies.ts +1 -1
  11. package/src/opds/Holds.ts +1 -1
  12. package/src/opds/Price.ts +1 -1
  13. package/src/opds/index.ts +5 -5
  14. package/src/publication/BelongsTo.ts +1 -1
  15. package/src/publication/Contributor.ts +4 -4
  16. package/src/publication/GuidedNavigation.ts +19 -19
  17. package/src/publication/Link.ts +6 -6
  18. package/src/publication/Locator.ts +1 -1
  19. package/src/publication/LocatorCollection.ts +4 -4
  20. package/src/publication/Manifest.ts +6 -6
  21. package/src/publication/Metadata.ts +13 -13
  22. package/src/publication/Publication.ts +12 -14
  23. package/src/publication/PublicationCollection.ts +1 -1
  24. package/src/publication/ReadingProgression.ts +1 -1
  25. package/src/publication/Subject.ts +2 -2
  26. package/src/publication/accessibility/AccessibilityMetadataDisplayGuide.ts +20 -20
  27. package/src/publication/accessibility/Localization.ts +15 -15
  28. package/src/publication/accessibility/index.ts +3 -3
  29. package/src/publication/encryption/Properties.ts +2 -2
  30. package/src/publication/encryption/index.ts +2 -2
  31. package/src/publication/epub/Metadata.ts +3 -3
  32. package/src/publication/epub/Properties.ts +1 -1
  33. package/src/publication/epub/Publication.ts +2 -2
  34. package/src/publication/epub/index.ts +4 -4
  35. package/src/publication/html/DomRange.ts +1 -1
  36. package/src/publication/html/DomRangePoint.ts +1 -1
  37. package/src/publication/html/Locations.ts +3 -3
  38. package/src/publication/html/index.ts +3 -3
  39. package/src/publication/index.ts +24 -24
  40. package/src/publication/opds/Properties.ts +4 -4
  41. package/src/publication/opds/Publication.ts +2 -2
  42. package/src/publication/opds/index.ts +2 -2
  43. package/src/publication/services/content/Content.ts +3 -3
  44. package/src/publication/services/content/ContentTokenizer.ts +6 -6
  45. package/src/publication/services/content/Iterator.ts +2 -2
  46. package/src/publication/services/content/element/attributes.ts +2 -2
  47. package/src/publication/services/content/element/element.ts +5 -5
  48. package/src/publication/services/content/element/index.ts +3 -3
  49. package/src/publication/services/content/index.ts +5 -5
  50. package/src/publication/services/content/iterators/HTMLResourceContentIterator.ts +8 -8
  51. package/src/publication/services/content/iterators/PDFTextContentIterator.ts +21 -21
  52. package/src/publication/services/content/iterators/PublicationContentIterator.ts +6 -6
  53. package/src/publication/services/content/iterators/helpers.ts +1 -1
  54. package/src/publication/services/content/iterators/index.ts +3 -3
  55. package/src/publication/services/index.ts +2 -2
  56. package/src/publication/services/timeline/Timeline.ts +53 -44
  57. package/src/publication/services/timeline/index.ts +2 -2
  58. package/src/util/index.ts +5 -5
  59. package/src/util/mediatype/index.ts +1 -1
  60. package/src/util/tokenizer/TextTokenizer.ts +5 -5
  61. package/src/util/tokenizer/index.ts +2 -2
  62. package/types/src/fetcher/Fetcher.d.ts +2 -2
  63. package/types/src/fetcher/HttpFetcher.d.ts +3 -3
  64. package/types/src/fetcher/Resource.d.ts +1 -1
  65. package/types/src/fetcher/index.d.ts +3 -3
  66. package/types/src/index.d.ts +4 -4
  67. package/types/src/opds/index.d.ts +5 -5
  68. package/types/src/publication/BelongsTo.d.ts +1 -1
  69. package/types/src/publication/Contributor.d.ts +3 -3
  70. package/types/src/publication/GuidedNavigation.d.ts +1 -1
  71. package/types/src/publication/Link.d.ts +3 -3
  72. package/types/src/publication/LocatorCollection.d.ts +3 -3
  73. package/types/src/publication/Manifest.d.ts +4 -4
  74. package/types/src/publication/Metadata.d.ts +10 -10
  75. package/types/src/publication/Publication.d.ts +11 -12
  76. package/types/src/publication/PublicationCollection.d.ts +1 -1
  77. package/types/src/publication/ReadingProgression.d.ts +1 -1
  78. package/types/src/publication/Subject.d.ts +2 -2
  79. package/types/src/publication/accessibility/AccessibilityMetadataDisplayGuide.d.ts +2 -2
  80. package/types/src/publication/accessibility/index.d.ts +3 -3
  81. package/types/src/publication/encryption/Properties.d.ts +1 -1
  82. package/types/src/publication/encryption/index.d.ts +2 -2
  83. package/types/src/publication/epub/Metadata.d.ts +1 -1
  84. package/types/src/publication/epub/Publication.d.ts +1 -1
  85. package/types/src/publication/epub/index.d.ts +4 -4
  86. package/types/src/publication/html/DomRange.d.ts +1 -1
  87. package/types/src/publication/html/Locations.d.ts +1 -1
  88. package/types/src/publication/html/index.d.ts +3 -3
  89. package/types/src/publication/index.d.ts +24 -24
  90. package/types/src/publication/opds/Properties.d.ts +2 -2
  91. package/types/src/publication/opds/Publication.d.ts +1 -1
  92. package/types/src/publication/opds/index.d.ts +2 -2
  93. package/types/src/publication/services/content/Content.d.ts +2 -2
  94. package/types/src/publication/services/content/ContentTokenizer.d.ts +2 -2
  95. package/types/src/publication/services/content/Iterator.d.ts +1 -1
  96. package/types/src/publication/services/content/element/attributes.d.ts +1 -1
  97. package/types/src/publication/services/content/element/element.d.ts +4 -4
  98. package/types/src/publication/services/content/element/index.d.ts +3 -3
  99. package/types/src/publication/services/content/index.d.ts +5 -5
  100. package/types/src/publication/services/content/iterators/HTMLResourceContentIterator.d.ts +4 -4
  101. package/types/src/publication/services/content/iterators/PDFTextContentIterator.d.ts +3 -3
  102. package/types/src/publication/services/content/iterators/PublicationContentIterator.d.ts +5 -5
  103. package/types/src/publication/services/content/iterators/helpers.d.ts +1 -1
  104. package/types/src/publication/services/content/iterators/index.d.ts +3 -3
  105. package/types/src/publication/services/index.d.ts +2 -2
  106. package/types/src/publication/services/timeline/Timeline.d.ts +9 -11
  107. package/types/src/publication/services/timeline/index.d.ts +2 -2
  108. package/types/src/util/index.d.ts +5 -5
  109. package/types/src/util/mediatype/index.d.ts +1 -1
  110. package/types/src/util/tokenizer/TextTokenizer.d.ts +2 -2
  111. package/types/src/util/tokenizer/index.d.ts +2 -2
  112. package/types/test/AltIdentifier.test.d.ts +0 -1
  113. package/types/test/Contributor.test.d.ts +0 -1
  114. package/types/test/GuidedNavigation.test.d.ts +0 -1
  115. package/types/test/Link.test.d.ts +0 -1
  116. package/types/test/LocalizedString.test.d.ts +0 -1
  117. package/types/test/Locator.test.d.ts +0 -1
  118. package/types/test/LocatorCollection.test.d.ts +0 -1
  119. package/types/test/Manifest.test.d.ts +0 -1
  120. package/types/test/Metadata.test.d.ts +0 -1
  121. package/types/test/Properties.test.d.ts +0 -1
  122. package/types/test/Publication.test.d.ts +0 -1
  123. package/types/test/PublicationCollection.test.d.ts +0 -1
  124. package/types/test/Subject.test.d.ts +0 -1
  125. package/types/test/TDM.test.d.ts +0 -1
  126. package/types/test/Timeline.test.d.ts +0 -1
  127. package/types/test/accessibility/Accessibility.test.d.ts +0 -1
  128. package/types/test/accessibility/AccessibilityMetadataDisplayGuide.test.d.ts +0 -1
  129. package/types/test/accessibility/Localization.test.d.ts +0 -1
  130. package/types/test/encryption/Encryption.test.d.ts +0 -1
  131. package/types/test/encryption/Properties.test.d.ts +0 -1
  132. package/types/test/epub/MediaOverlay.test.d.ts +0 -1
  133. package/types/test/epub/Metadata.test.d.ts +0 -1
  134. package/types/test/epub/PropertiesTest.test.d.ts +0 -1
  135. package/types/test/epub/PublicationTest.test.d.ts +0 -1
  136. package/types/test/html/DomRange.test.d.ts +0 -1
  137. package/types/test/html/Locator.test.d.ts +0 -1
  138. package/types/test/opds/PropertiesTest.test.d.ts +0 -1
  139. package/types/test/opds/PublicationTest.test.d.ts +0 -1
  140. package/types/test/util/URITemplate.test.d.ts +0 -1
  141. package/types/test/util/mediatype/MediaType.test.d.ts +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@readium/shared",
3
- "version": "2.2.0-beta.2",
3
+ "version": "2.2.0",
4
4
  "type": "module",
5
5
  "description": "Shared models to be used across other Readium projects and implementations in Typescript",
6
6
  "author": "readium",
@@ -1,5 +1,5 @@
1
- import { Link } from '../publication/Link';
2
- import { Resource } from './Resource';
1
+ import { Link } from '../publication/Link.ts';
2
+ import { Resource } from './Resource.ts';
3
3
 
4
4
  /** Provides access to a [Resource] from a [Link]. */
5
5
  export interface Fetcher {
@@ -1,6 +1,6 @@
1
- import { Link } from '../publication/Link';
2
- import { Fetcher } from './Fetcher';
3
- import { NumberRange, Resource } from './Resource';
1
+ import { Link } from '../publication/Link.ts';
2
+ import { Fetcher } from './Fetcher.ts';
3
+ import { NumberRange, Resource } from './Resource.ts';
4
4
 
5
5
  export type FetchImplementation = (
6
6
  input: RequestInfo | URL,
@@ -1,4 +1,4 @@
1
- import { Link } from '../publication/Link';
1
+ import { Link } from '../publication/Link.ts';
2
2
 
3
3
  export class NumberRange {
4
4
  // TODO move to utils
@@ -1,3 +1,3 @@
1
- export * from './Fetcher';
2
- export * from './HttpFetcher';
3
- export * from './Resource';
1
+ export * from './Fetcher.ts';
2
+ export * from './HttpFetcher.ts';
3
+ export * from './Resource.ts';
package/src/index.ts CHANGED
@@ -1,4 +1,4 @@
1
- export * from './fetcher';
2
- export * from './publication';
3
- export * from './opds';
4
- export * from './util';
1
+ export * from './fetcher/index.ts';
2
+ export * from './publication/index.ts';
3
+ export * from './opds/index.ts';
4
+ export * from './util/index.ts';
@@ -3,7 +3,7 @@
3
3
  * available in the LICENSE file present in the Github repository of the project.
4
4
  */
5
5
 
6
- import { datefromJSON } from '../util/JSONParse';
6
+ import { datefromJSON } from '../util/JSONParse.ts';
7
7
 
8
8
  export enum AvailabilityStatus {
9
9
  available = 'available',
@@ -3,7 +3,7 @@
3
3
  * available in the LICENSE file present in the Github repository of the project.
4
4
  */
5
5
 
6
- import { positiveNumberfromJSON } from '../util/JSONParse';
6
+ import { positiveNumberfromJSON } from '../util/JSONParse.ts';
7
7
 
8
8
  /**
9
9
  * Library-specific feature that contains information about the copies that a library has acquired.
package/src/opds/Holds.ts CHANGED
@@ -3,7 +3,7 @@
3
3
  * available in the LICENSE file present in the Github repository of the project.
4
4
  */
5
5
 
6
- import { positiveNumberfromJSON } from '../util/JSONParse';
6
+ import { positiveNumberfromJSON } from '../util/JSONParse.ts';
7
7
 
8
8
  /**
9
9
  * Library-specific features when a specific book is unavailable but provides a hold list.
package/src/opds/Price.ts CHANGED
@@ -3,7 +3,7 @@
3
3
  * available in the LICENSE file present in the Github repository of the project.
4
4
  */
5
5
 
6
- import { positiveNumberfromJSON } from '../util/JSONParse';
6
+ import { positiveNumberfromJSON } from '../util/JSONParse.ts';
7
7
 
8
8
  /**
9
9
  * The price of a publication in an OPDS link.
package/src/opds/index.ts CHANGED
@@ -1,5 +1,5 @@
1
- export * from './Price';
2
- export * from './Acquisition';
3
- export * from './Holds';
4
- export * from './Copies';
5
- export * from './Availability';
1
+ export * from './Price.ts';
2
+ export * from './Acquisition.ts';
3
+ export * from './Holds.ts';
4
+ export * from './Copies.ts';
5
+ export * from './Availability.ts';
@@ -3,7 +3,7 @@
3
3
  * available in the LICENSE file present in the Github repository of the project.
4
4
  */
5
5
 
6
- import { Contributors as Collection } from './Contributor';
6
+ import { Contributors as Collection } from './Contributor.ts';
7
7
 
8
8
  /**
9
9
  * BelongsTo Object for the Readium Web Publication Manifest.
@@ -3,14 +3,14 @@
3
3
  * available in the LICENSE file present in the Github repository of the project.
4
4
  */
5
5
 
6
- import { Links } from './Link';
6
+ import { Links } from './Link.ts';
7
7
  import {
8
8
  arrayfromJSONorString,
9
9
  numberfromJSON,
10
10
  setToArray,
11
- } from '../util/JSONParse';
12
- import { LocalizedString } from './LocalizedString';
13
- import { AltIdentifier } from './AltIdentifier';
11
+ } from '../util/JSONParse.ts';
12
+ import { LocalizedString } from './LocalizedString.ts';
13
+ import { AltIdentifier } from './AltIdentifier.ts';
14
14
 
15
15
  /**
16
16
  * Contributor Object for the Readium Web Publication Manifest.
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  arrayfromJSONorString,
3
3
  setToArray,
4
- } from '../util/JSONParse';
5
- import { Links } from "./Link";
4
+ } from '../util/JSONParse.ts';
5
+ import { Links } from "./Link.ts";
6
6
 
7
7
  export interface Clip {
8
8
  audioResource: string;
@@ -49,11 +49,11 @@ export class GuidedNavigationDocument {
49
49
  export class GuidedNavigationText {
50
50
  /** Plain text content */
51
51
  public readonly plain?: string;
52
-
52
+
53
53
  /** SSML (Speech Synthesis Markup Language) content */
54
54
  public readonly ssml?: string;
55
-
56
- /**
55
+
56
+ /**
57
57
  * BCP 47 language tag
58
58
  * @pattern ^((?<grandfathered>(en-GB-oed|i-ami|i-bnn|i-default|i-enochian|i-hak|i-klingon|i-lux|i-mingo|i-navajo|i-pwn|i-tao|i-tay|i-tsu|sgn-BE-FR|sgn-BE-NL|sgn-CH-DE)|(art-lojban|cel-gaulish|no-bok|no-nyn|zh-guoyu|zh-hakka|zh-min|zh-min-nan|zh-xiang))|((?<language>([A-Za-z]{2,3}(-(?<extlang>[A-Za-z]{3}(-[A-Za-z]{3}){0,2}))?)|[A-Za-z]{4}|[A-Za-z]{5,8})(-(?<script>[A-Za-z]{4}))?(-(?<region>[A-Za-z]{2}|[0-9]{3}))?(-(?<variant>[A-Za-z0-9]{5,8}|[0-9][A-Za-z0-9]{3}))*(-(?<extension>[0-9A-WY-Za-wy-z](-[A-Za-z0-9]{2,8})+))*(-(?<privateUse>x(-[A-Za-z0-9]{1,8})+))?)|(?<privateUse2>x(-[A-Za-z0-9]{1,8})+))$
59
59
  */
@@ -74,11 +74,11 @@ export class GuidedNavigationText {
74
74
  */
75
75
  public static deserialize(json: any): GuidedNavigationText | undefined {
76
76
  if (json === undefined || json === null) return undefined;
77
-
77
+
78
78
  if (typeof json === 'string') {
79
79
  return new GuidedNavigationText({ plain: json });
80
80
  }
81
-
81
+
82
82
  // Only create if there are actual values
83
83
  if (json.plain || json.ssml || json.language) {
84
84
  return new GuidedNavigationText({
@@ -87,7 +87,7 @@ export class GuidedNavigationText {
87
87
  language: json.language
88
88
  });
89
89
  }
90
-
90
+
91
91
  return undefined;
92
92
  }
93
93
 
@@ -111,32 +111,32 @@ export class GuidedNavigationText {
111
111
  export class GuidedNavigationObject {
112
112
  /** References an audio resource or a fragment of it. */
113
113
  public readonly audioref?: string;
114
-
114
+
115
115
  /** Items that are children of the containing Guided Navigation Object. */
116
116
  public readonly children?: GuidedNavigationObject[];
117
-
117
+
118
118
  /** References an image or a fragment of it. */
119
119
  public readonly imgref?: string;
120
-
120
+
121
121
  /** Convey the structural semantics of a publication. */
122
122
  public readonly role?: Set<string>;
123
-
124
- /**
123
+
124
+ /**
125
125
  * Indicates the heading level (1-6) for the navigation object.
126
126
  * @minimum 1
127
127
  * @maximum 6
128
128
  */
129
129
  public readonly level?: number;
130
-
131
- /**
130
+
131
+ /**
132
132
  * Textual equivalent of the resources or fragment of the resources referenced by the current Guided Navigation Object.
133
133
  */
134
134
  public readonly text?: GuidedNavigationText;
135
-
135
+
136
136
  /** References a textual resource or a fragment of it. */
137
137
  public readonly textref?: string;
138
138
 
139
- /**
139
+ /**
140
140
  * Describes the image referenced by the current Guided Navigation Object.
141
141
  * This is a GuidedNavigationObject that should not contain 'level' or 'children' properties.
142
142
  */
@@ -192,7 +192,7 @@ export class GuidedNavigationObject {
192
192
  */
193
193
  public static deserialize(json: any): GuidedNavigationObject | undefined {
194
194
  if (!json) return undefined;
195
-
195
+
196
196
  return new GuidedNavigationObject({
197
197
  audioref: json.audioref,
198
198
  children: GuidedNavigationObject.deserializeArray(json.children),
@@ -207,7 +207,7 @@ export class GuidedNavigationObject {
207
207
  });
208
208
  }
209
209
 
210
- /**
210
+ /**
211
211
  * Parses a [GuidedNavigationObject] array from its RWPM JSON representation.
212
212
  */
213
213
  public static deserializeArray(json: any): GuidedNavigationObject[] | undefined {
@@ -3,15 +3,15 @@
3
3
  * available in the LICENSE file present in the Github repository of the project.
4
4
  */
5
5
 
6
- import { MediaType } from '../util/mediatype/MediaType';
7
- import { Properties } from './Properties';
8
- import { URITemplate } from '../util/URITemplate';
6
+ import { MediaType } from '../util/mediatype/MediaType.ts';
7
+ import { Properties } from './Properties.ts';
8
+ import { URITemplate } from '../util/URITemplate.ts';
9
9
  import {
10
10
  arrayfromJSONorString,
11
11
  positiveNumberfromJSON,
12
12
  setToArray,
13
- } from '../util/JSONParse';
14
- import { LocatorLocations, Locator } from './Locator';
13
+ } from '../util/JSONParse.ts';
14
+ import { LocatorLocations, Locator } from './Locator.ts';
15
15
 
16
16
  /**
17
17
  * Link Object for the Readium Web Publication Manifest.
@@ -100,7 +100,7 @@ export class Link {
100
100
  */
101
101
  public static deserialize(json: any): Link | undefined {
102
102
  if (!json || typeof json.href !== 'string') return;
103
-
103
+
104
104
  return new Link({
105
105
  href: json.href,
106
106
  templated: json.templated,
@@ -3,7 +3,7 @@
3
3
  * available in the LICENSE file present in the Github repository of the project.
4
4
  */
5
5
 
6
- import { arrayfromJSONorString, numberfromJSON } from '../util/JSONParse';
6
+ import { arrayfromJSONorString, numberfromJSON } from '../util/JSONParse.ts';
7
7
 
8
8
  /**
9
9
  * One or more alternative expressions of the location.
@@ -3,10 +3,10 @@
3
3
  * available in the LICENSE file present in the Github repository of the project.
4
4
  */
5
5
 
6
- import { numberfromJSON } from '../util/JSONParse';
7
- import { Links } from './Link';
8
- import { LocalizedString } from './LocalizedString';
9
- import { Locator } from './Locator';
6
+ import { numberfromJSON } from '../util/JSONParse.ts';
7
+ import { Links } from './Link.ts';
8
+ import { LocalizedString } from './LocalizedString.ts';
9
+ import { Locator } from './Locator.ts';
10
10
 
11
11
  /**
12
12
  * Holds the metadata of a `LocatorCollection`.
@@ -3,12 +3,12 @@
3
3
  * available in the LICENSE file present in the Github repository of the project.
4
4
  */
5
5
 
6
- import { Metadata } from './Metadata';
7
- import { Link, Links } from './Link';
8
- import { arrayfromJSONorString } from '../util/JSONParse';
9
- import { PublicationCollection } from './PublicationCollection';
10
- import { MediaType } from '../util/mediatype/MediaType';
11
- import { Locator, LocatorLocations } from "./Locator";
6
+ import { Metadata } from './Metadata.ts';
7
+ import { Link, Links } from './Link.ts';
8
+ import { arrayfromJSONorString } from '../util/JSONParse.ts';
9
+ import { PublicationCollection } from './PublicationCollection.ts';
10
+ import { MediaType } from '../util/mediatype/MediaType.ts';
11
+ import { Locator, LocatorLocations } from "./Locator.ts";
12
12
 
13
13
  /** Holds the metadata of a Readium publication, as described in
14
14
  * the Readium Web Publication Manifest.
@@ -7,17 +7,17 @@ import {
7
7
  arrayfromJSONorString,
8
8
  datefromJSON,
9
9
  positiveNumberfromJSON,
10
- } from '../util/JSONParse';
11
- import { AltIdentifier } from './AltIdentifier';
12
- import { BelongsTo } from './BelongsTo';
13
- import { Contributors } from './Contributor';
14
- import { Layout } from './Layout';
15
- import { LocalizedString } from './LocalizedString';
16
- import { Profile } from './Profiles';
17
- import { ReadingProgression } from './ReadingProgression';
18
- import { Subjects } from './Subject';
19
- import { Accessibility } from './accessibility/Accessibility';
20
- import { TDM } from './TDM';
10
+ } from '../util/JSONParse.ts';
11
+ import { AltIdentifier } from './AltIdentifier.ts';
12
+ import { BelongsTo } from './BelongsTo.ts';
13
+ import { Contributors } from './Contributor.ts';
14
+ import { Layout } from './Layout.ts';
15
+ import { LocalizedString } from './LocalizedString.ts';
16
+ import { Profile } from './Profiles.ts';
17
+ import { ReadingProgression } from './ReadingProgression.ts';
18
+ import { Subjects } from './Subject.ts';
19
+ import { Accessibility } from './accessibility/Accessibility.ts';
20
+ import { TDM } from './TDM.ts';
21
21
 
22
22
  /**
23
23
  * https://readium.org/webpub-manifest/schema/metadata.schema.json
@@ -328,13 +328,13 @@ export class Metadata {
328
328
 
329
329
  /**
330
330
  * Computes a [Layout] using the [conformsTo] profile and layout property.
331
- *
331
+ *
332
332
  * Special cases:
333
333
  * - EPUB profile defaults to reflowable if layout is not present
334
334
  * - Divina profile defaults to fixed if layout is not present
335
335
  * - Layout is ignored for audiobook and PDF profiles
336
336
  * - Layout is ignored if set to reflowable on a Divina profile
337
- *
337
+ *
338
338
  * Note: Stops at the first matching profile.
339
339
  */
340
340
  public get effectiveLayout(): Layout | null {
@@ -3,17 +3,16 @@
3
3
  * available in the LICENSE file present in the Github repository of the project.
4
4
  */
5
5
 
6
- import { Link, Links } from './Link';
7
- import { Locator } from './Locator';
8
- import { Manifest } from './Manifest';
9
- import { Metadata } from './Metadata';
10
- import { EmptyFetcher, Fetcher } from '../fetcher/Fetcher';
11
- import { PublicationCollection } from './PublicationCollection';
12
- import { Resource } from '../fetcher/Resource';
13
- import { GuidedNavigationDocument } from "./GuidedNavigation";
14
- import { URITemplate } from "../util";
15
- import { MediaType } from "../util/mediatype/MediaType";
16
- import { Timeline } from './services/timeline/Timeline';
6
+ import { Link, Links } from './Link.ts';
7
+ import { Locator } from './Locator.ts';
8
+ import { Manifest } from './Manifest.ts';
9
+ import { Metadata } from './Metadata.ts';
10
+ import { EmptyFetcher, Fetcher } from '../fetcher/Fetcher.ts';
11
+ import { PublicationCollection } from './PublicationCollection.ts';
12
+ import { Resource } from '../fetcher/Resource.ts';
13
+ import { GuidedNavigationDocument } from "./GuidedNavigation.ts";
14
+ import { MediaType, URITemplate } from "../util/index.ts";
15
+ import { Timeline } from './services/timeline/Timeline.ts';
17
16
 
18
17
  export type ServiceFactory = () => null;
19
18
 
@@ -51,8 +50,7 @@ export class Publication {
51
50
 
52
51
  /**
53
52
  * Returns the publication's timeline, built from its reading order and table of contents.
54
- * Called with no arguments, the result is cached. Pass options to build a fresh timeline
55
- * with a specific configuration (e.g. a depth limit).
53
+ * The result is cached after the first call.
56
54
  */
57
55
  public get timeline(): Timeline {
58
56
  if (!this._timeline) this._timeline = Timeline.build(this);
@@ -95,7 +93,7 @@ export class Publication {
95
93
  /**
96
94
  * Gets the cover image for the publication.
97
95
  * First looks for rel='cover' in links/resources/readingOrder,
98
- * then falls back to any image (JPEG, PNG, GIF, AVIF, SVG) as bitmap fallback.
96
+ * then falls back to any image (JPEG, PNG, GIF, AVIF, SVG).
99
97
  */
100
98
  public getCover(): Link | undefined {
101
99
  const locations = [
@@ -3,7 +3,7 @@
3
3
  * available in the LICENSE file present in the Github repository of the project.
4
4
  */
5
5
 
6
- import { Links } from './Link';
6
+ import { Links } from './Link.ts';
7
7
 
8
8
  /**
9
9
  * Core Collection Model
@@ -3,7 +3,7 @@
3
3
  * available in the LICENSE file present in the Github repository of the project.
4
4
  */
5
5
 
6
- import { Page } from "./Properties";
6
+ import { Page } from "./Properties.ts";
7
7
 
8
8
  export enum ReadingProgression {
9
9
  ltr = 'ltr',
@@ -3,8 +3,8 @@
3
3
  * available in the LICENSE file present in the Github repository of the project.
4
4
  */
5
5
 
6
- import { Links } from './Link';
7
- import { LocalizedString } from './LocalizedString';
6
+ import { Links } from './Link.ts';
7
+ import { LocalizedString } from './LocalizedString.ts';
8
8
 
9
9
  /**
10
10
  * https://github.com/readium/webpub-manifest/tree/master/contexts/default#subjects
@@ -1,9 +1,9 @@
1
- import { Accessibility, Feature, AccessMode, PrimaryAccessMode, Hazard } from './Accessibility';
2
- import { Publication } from '../Publication';
3
- import { AccessibilityProfile } from './Accessibility';
1
+ import { Accessibility, Feature, AccessMode, PrimaryAccessMode, Hazard } from './Accessibility.ts';
2
+ import { Publication } from '../Publication.ts';
3
+ import { AccessibilityProfile } from './Accessibility.ts';
4
4
 
5
- import { Localization } from './Localization';
6
- import { Layout } from '../Layout';
5
+ import { Localization } from './Localization.ts';
6
+ import { Layout } from '../Layout.ts';
7
7
 
8
8
  /**
9
9
  * Represents a single accessibility claim
@@ -90,19 +90,19 @@ export class WaysOfReading implements AccessibilityDisplayField {
90
90
 
91
91
  // This should be displayed even if there is no metadata
92
92
  this.shouldDisplay = true;
93
-
93
+
94
94
  const titleLocale = Localization.getString(this.id);
95
95
  this.title = titleLocale.compact;
96
96
 
97
97
  this.statements = [];
98
-
98
+
99
99
  // Visual Adjustments
100
100
  const visualAdjustmentsKey = visualAdjustments === VisualAdjustments.Modifiable
101
101
  ? "ways-of-reading.visual-adjustments.modifiable"
102
102
  : visualAdjustments === VisualAdjustments.Unmodifiable
103
103
  ? "ways-of-reading.visual-adjustments.unmodifiable"
104
104
  : "ways-of-reading.visual-adjustments.unknown";
105
-
105
+
106
106
  const visualAdjustmentsLocale = Localization.getString(visualAdjustmentsKey);
107
107
  this.statements.push({
108
108
  id: visualAdjustmentsKey,
@@ -121,7 +121,7 @@ export class WaysOfReading implements AccessibilityDisplayField {
121
121
  } else if (nonvisualReading === NonvisualReading.NoMetadata) {
122
122
  nonvisualReadingKey = "ways-of-reading.nonvisual-reading.no-metadata";
123
123
  }
124
-
124
+
125
125
  const nonvisualReadingLocale = Localization.getString(nonvisualReadingKey);
126
126
  this.statements.push({
127
127
  id: nonvisualReadingKey,
@@ -150,7 +150,7 @@ export class WaysOfReading implements AccessibilityDisplayField {
150
150
  } else if (prerecordedAudio === PrerecordedAudio.NoMetadata) {
151
151
  prerecordedAudioKey = "ways-of-reading.prerecorded-audio.no-metadata";
152
152
  }
153
-
153
+
154
154
  const prerecordedAudioLocale = Localization.getString(prerecordedAudioKey);
155
155
  this.statements.push({
156
156
  id: prerecordedAudioKey,
@@ -389,7 +389,7 @@ export class RichContent implements AccessibilityDisplayField {
389
389
  !closedCaptions && !openCaptions && !transcript;
390
390
 
391
391
  this.shouldDisplay = !this.noMetadata;
392
-
392
+
393
393
  const titleLocale = Localization.getString(this.id);
394
394
  this.title = titleLocale.compact;
395
395
 
@@ -553,7 +553,7 @@ export class AdditionalInformation implements AccessibilityDisplayField {
553
553
  !signLanguage && !tactileGraphics && !tactileObjects && !textToSpeechHinting;
554
554
 
555
555
  this.shouldDisplay = !this.noMetadata;
556
-
556
+
557
557
  const titleLocale = Localization.getString(this.id);
558
558
  this.title = titleLocale.compact;
559
559
 
@@ -716,7 +716,7 @@ export class Hazards implements AccessibilityDisplayField {
716
716
  this.flashing = flashing;
717
717
  this.motion = motion;
718
718
  this.sound = sound;
719
-
719
+
720
720
  const titleLocale = Localization.getString(this.id);
721
721
  this.title = titleLocale.compact;
722
722
 
@@ -879,10 +879,10 @@ export class Conformance implements AccessibilityDisplayField {
879
879
 
880
880
  private constructor(profiles: AccessibilityProfile[] = []) {
881
881
  this.profiles = profiles;
882
-
882
+
883
883
  // This should be displayed even if there is no metadata
884
884
  this.shouldDisplay = true;
885
-
885
+
886
886
  const titleLocale = Localization.getString(this.id);
887
887
  this.title = titleLocale.compact;
888
888
 
@@ -948,7 +948,7 @@ export class Legal implements AccessibilityDisplayField {
948
948
  ) {
949
949
  this.exemption = exemption;
950
950
  this.shouldDisplay = this.exemption;
951
-
951
+
952
952
  const titleLocale = Localization.getString(this.id);
953
953
  this.title = titleLocale.compact;
954
954
 
@@ -989,13 +989,13 @@ export class AccessibilitySummary implements AccessibilityDisplayField {
989
989
 
990
990
  private constructor(publication: Publication) {
991
991
  this.shouldDisplay = true;
992
-
992
+
993
993
  const titleLocale = Localization.getString(this.id);
994
994
  this.title = titleLocale.compact;
995
-
995
+
996
996
  const summary = publication.metadata.accessibility?.summary;
997
997
  this.statements = [];
998
-
998
+
999
999
  if (this.shouldDisplay && summary) {
1000
1000
  this.statements.push({
1001
1001
  id: "accessibility-summary.summary",
@@ -1052,4 +1052,4 @@ export class AccessibilityMetadataDisplayGuide {
1052
1052
  this.accessibilitySummary
1053
1053
  ];
1054
1054
  }
1055
- }
1055
+ }