@nypl/web-reader 4.3.0 → 4.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (120) hide show
  1. package/README.md +0 -15
  2. package/dist/{esm/index.css → index.css} +3 -1
  3. package/dist/index.css.map +1 -0
  4. package/dist/index.d.ts +532 -0
  5. package/dist/index.js +9381 -0
  6. package/dist/index.js.map +1 -0
  7. package/dist/index.mjs +9378 -0
  8. package/dist/index.mjs.map +1 -0
  9. package/dist/injectable-html-styles/ReadiumCSS-after.css +488 -2
  10. package/dist/injectable-html-styles/ReadiumCSS-after.css.map +1 -7
  11. package/dist/injectable-html-styles/ReadiumCSS-after.d.ts +2 -0
  12. package/dist/injectable-html-styles/ReadiumCSS-before.css +648 -2
  13. package/dist/injectable-html-styles/ReadiumCSS-before.css.map +1 -7
  14. package/dist/injectable-html-styles/ReadiumCSS-before.d.ts +2 -0
  15. package/dist/injectable-html-styles/ReadiumCSS-default.css +141 -2
  16. package/dist/injectable-html-styles/ReadiumCSS-default.css.map +1 -7
  17. package/dist/injectable-html-styles/ReadiumCSS-default.d.ts +2 -0
  18. package/package.json +9 -24
  19. package/dist/cjs/index.css +0 -2
  20. package/dist/cjs/index.css.map +0 -7
  21. package/dist/cjs/index.js +0 -340
  22. package/dist/cjs/index.js.map +0 -7
  23. package/dist/esm/index.css.map +0 -7
  24. package/dist/esm/index.js +0 -42173
  25. package/dist/esm/index.js.map +0 -7
  26. package/dist/types/HtmlReader/effects.d.ts +0 -22
  27. package/dist/types/HtmlReader/index.d.ts +0 -3
  28. package/dist/types/HtmlReader/lib.d.ts +0 -107
  29. package/dist/types/HtmlReader/reducer.d.ts +0 -8
  30. package/dist/types/HtmlReader/types.d.ts +0 -116
  31. package/dist/types/HtmlReader/useIframeLinkClick.d.ts +0 -4
  32. package/dist/types/HtmlReader/useLocationQuery.d.ts +0 -8
  33. package/dist/types/HtmlReader/useResource.d.ts +0 -14
  34. package/dist/types/HtmlReader/useUpdateCSS.d.ts +0 -6
  35. package/dist/types/HtmlReader/useUpdateScroll.d.ts +0 -6
  36. package/dist/types/HtmlReader/useWindowResize.d.ts +0 -7
  37. package/dist/types/PdfReader/ChakraPage.d.ts +0 -3
  38. package/dist/types/PdfReader/ScrollPage.d.ts +0 -12
  39. package/dist/types/PdfReader/addTocToManifest.d.ts +0 -10
  40. package/dist/types/PdfReader/index.d.ts +0 -12
  41. package/dist/types/PdfReader/lib.d.ts +0 -26
  42. package/dist/types/PdfReader/reducer.d.ts +0 -3
  43. package/dist/types/PdfReader/types.d.ts +0 -61
  44. package/dist/types/PdfReader/useMeasure.d.ts +0 -7
  45. package/dist/types/Readium/Injectable.d.ts +0 -11
  46. package/dist/types/Readium/Locator.d.ts +0 -20
  47. package/dist/types/WebpubManifestTypes/ConformsTo.d.ts +0 -3
  48. package/dist/types/WebpubManifestTypes/Contributor.d.ts +0 -17
  49. package/dist/types/WebpubManifestTypes/EpubExtension.d.ts +0 -47
  50. package/dist/types/WebpubManifestTypes/LanguageMap.d.ts +0 -3
  51. package/dist/types/WebpubManifestTypes/Metadata.d.ts +0 -47
  52. package/dist/types/WebpubManifestTypes/OPDSLink.d.ts +0 -63
  53. package/dist/types/WebpubManifestTypes/PresentationHints.d.ts +0 -53
  54. package/dist/types/WebpubManifestTypes/ReadiumLink.d.ts +0 -58
  55. package/dist/types/WebpubManifestTypes/Subject.d.ts +0 -16
  56. package/dist/types/WebpubManifestTypes/WebpubManifest.d.ts +0 -14
  57. package/dist/types/constants.d.ts +0 -37
  58. package/dist/types/index.d.ts +0 -17
  59. package/dist/types/types.d.ts +0 -123
  60. package/dist/types/ui/Button.d.ts +0 -9
  61. package/dist/types/ui/ErrorBoundary.d.ts +0 -16
  62. package/dist/types/ui/Footer.d.ts +0 -9
  63. package/dist/types/ui/Header.d.ts +0 -9
  64. package/dist/types/ui/HtmlSettings.d.ts +0 -9
  65. package/dist/types/ui/LoadingSkeleton.d.ts +0 -9
  66. package/dist/types/ui/PageButton.d.ts +0 -7
  67. package/dist/types/ui/PdfSettings.d.ts +0 -8
  68. package/dist/types/ui/SettingsButton.d.ts +0 -5
  69. package/dist/types/ui/TableOfContent.d.ts +0 -7
  70. package/dist/types/ui/ToggleButton.d.ts +0 -14
  71. package/dist/types/ui/ToggleGroup.d.ts +0 -8
  72. package/dist/types/ui/hooks/useColorModeValue.d.ts +0 -7
  73. package/dist/types/ui/hooks/useContainerWidth.d.ts +0 -6
  74. package/dist/types/ui/hooks/useEventListener.d.ts +0 -8
  75. package/dist/types/ui/hooks/useFullScreen.d.ts +0 -7
  76. package/dist/types/ui/icons/Continuous.d.ts +0 -4
  77. package/dist/types/ui/icons/Day.d.ts +0 -4
  78. package/dist/types/ui/icons/EnlargeFont.d.ts +0 -4
  79. package/dist/types/ui/icons/Night.d.ts +0 -4
  80. package/dist/types/ui/icons/Paginated.d.ts +0 -4
  81. package/dist/types/ui/icons/Previous.d.ts +0 -4
  82. package/dist/types/ui/icons/ReaderSettings.d.ts +0 -4
  83. package/dist/types/ui/icons/ReduceFont.d.ts +0 -4
  84. package/dist/types/ui/icons/Reset.d.ts +0 -4
  85. package/dist/types/ui/icons/Sepia.d.ts +0 -4
  86. package/dist/types/ui/icons/TableOfContents.d.ts +0 -4
  87. package/dist/types/ui/icons/ToggleFullScreen.d.ts +0 -4
  88. package/dist/types/ui/icons/ToggleFullScreenExit.d.ts +0 -4
  89. package/dist/types/ui/icons/index.d.ts +0 -14
  90. package/dist/types/ui/manager.d.ts +0 -9
  91. package/dist/types/ui/menu/index.d.ts +0 -10
  92. package/dist/types/ui/menu/menu.d.ts +0 -76
  93. package/dist/types/ui/menu/use-menu.d.ts +0 -2510
  94. package/dist/types/ui/nypl-base-theme/components/button.d.ts +0 -94
  95. package/dist/types/ui/nypl-base-theme/components/checkbox.d.ts +0 -41
  96. package/dist/types/ui/nypl-base-theme/components/form-error.d.ts +0 -14
  97. package/dist/types/ui/nypl-base-theme/components/form-label.d.ts +0 -14
  98. package/dist/types/ui/nypl-base-theme/components/form.d.ts +0 -15
  99. package/dist/types/ui/nypl-base-theme/components/input.d.ts +0 -107
  100. package/dist/types/ui/nypl-base-theme/components/text-area.d.ts +0 -34
  101. package/dist/types/ui/nypl-base-theme/foundations/breakpoints.d.ts +0 -8
  102. package/dist/types/ui/nypl-base-theme/foundations/colors.d.ts +0 -3
  103. package/dist/types/ui/nypl-base-theme/foundations/global.d.ts +0 -13
  104. package/dist/types/ui/nypl-base-theme/foundations/radii.d.ts +0 -12
  105. package/dist/types/ui/nypl-base-theme/foundations/spacing.d.ts +0 -49
  106. package/dist/types/ui/nypl-base-theme/foundations/typography.d.ts +0 -10
  107. package/dist/types/ui/nypl-base-theme/index.d.ts +0 -7
  108. package/dist/types/ui/nypl-base-theme/types.d.ts +0 -1
  109. package/dist/types/ui/theme/components/alert.d.ts +0 -24
  110. package/dist/types/ui/theme/components/button.d.ts +0 -93
  111. package/dist/types/ui/theme/components/text.d.ts +0 -20
  112. package/dist/types/ui/theme/foundations/colors.d.ts +0 -3
  113. package/dist/types/ui/theme/foundations/fonts.d.ts +0 -3
  114. package/dist/types/ui/theme/foundations/typography.d.ts +0 -6
  115. package/dist/types/ui/theme/index.d.ts +0 -12
  116. package/dist/types/ui/theme/types.d.ts +0 -1
  117. package/dist/types/useWebReader.d.ts +0 -7
  118. package/dist/types/utils/fetch.d.ts +0 -4
  119. package/dist/types/utils/getColor.d.ts +0 -2
  120. package/dist/types/utils/localstorage.d.ts +0 -17
@@ -1,63 +0,0 @@
1
- export interface OPDSLinkProperties {
2
- /**
3
- * Provide a hint about the expected number of items returned
4
- */
5
- numberOfItems?: number;
6
- /**
7
- * The price of a publication is tied to its acquisition link
8
- */
9
- price?: {
10
- value: number;
11
- currency: 'AED' | 'AFN' | 'ALL' | 'AMD' | 'ANG' | 'AOA' | 'ARS' | 'AUD' | 'AWG' | 'AZN' | 'BAM' | 'BBD' | 'BDT' | 'BGN' | 'BHD' | 'BIF' | 'BMD' | 'BND' | 'BOB' | 'BOV' | 'BRL' | 'BSD' | 'BTN' | 'BWP' | 'BYN' | 'BZD' | 'CAD' | 'CDF' | 'CHE' | 'CHF' | 'CHW' | 'CLF' | 'CLP' | 'CNY' | 'COP' | 'COU' | 'CRC' | 'CUC' | 'CUP' | 'CVE' | 'CZK' | 'DJF' | 'DKK' | 'DOP' | 'DZD' | 'EGP' | 'ERN' | 'ETB' | 'EUR' | 'FJD' | 'FKP' | 'GBP' | 'GEL' | 'GHS' | 'GIP' | 'GMD' | 'GNF' | 'GTQ' | 'GYD' | 'HKD' | 'HNL' | 'HRK' | 'HTG' | 'HUF' | 'IDR' | 'ILS' | 'INR' | 'IQD' | 'IRR' | 'ISK' | 'JMD' | 'JOD' | 'JPY' | 'KES' | 'KGS' | 'KHR' | 'KMF' | 'KPW' | 'KRW' | 'KWD' | 'KYD' | 'KZT' | 'LAK' | 'LBP' | 'LKR' | 'LRD' | 'LSL' | 'LYD' | 'MAD' | 'MDL' | 'MGA' | 'MKD' | 'MMK' | 'MNT' | 'MOP' | 'MRU' | 'MUR' | 'MVR' | 'MWK' | 'MXN' | 'MXV' | 'MYR' | 'MZN' | 'NAD' | 'NGN' | 'NIO' | 'NOK' | 'NPR' | 'NZD' | 'OMR' | 'PAB' | 'PEN' | 'PGK' | 'PHP' | 'PKR' | 'PLN' | 'PYG' | 'QAR' | 'RON' | 'RSD' | 'RUB' | 'RWF' | 'SAR' | 'SBD' | 'SCR' | 'SDG' | 'SEK' | 'SGD' | 'SHP' | 'SLL' | 'SOS' | 'SRD' | 'SSP' | 'STN' | 'SVC' | 'SYP' | 'SZL' | 'THB' | 'TJS' | 'TMT' | 'TND' | 'TOP' | 'TRY' | 'TTD' | 'TWD' | 'TZS' | 'UAH' | 'UGX' | 'USD' | 'USN' | 'UYI' | 'UYU' | 'UZS' | 'VEF' | 'VES' | 'VND' | 'VUV' | 'WST' | 'XAF' | 'XAG' | 'XAU' | 'XBA' | 'XBB' | 'XBC' | 'XBD' | 'XCD' | 'XDR' | 'XOF' | 'XPD' | 'XPF' | 'XPT' | 'XSU' | 'XTS' | 'XUA' | 'XXX' | 'YER' | 'ZAR' | 'ZMW' | 'ZWL';
12
- [k: string]: unknown;
13
- };
14
- /**
15
- * Indirect acquisition provides a hint for the expected media type that will be acquired after additional steps
16
- */
17
- indirectAcquisition?: OPDSAcquisitionObject[];
18
- /**
19
- * Library-specific feature for unavailable books that support a hold list
20
- */
21
- holds?: {
22
- total?: number;
23
- position?: number;
24
- [k: string]: unknown;
25
- };
26
- /**
27
- * Library-specific feature that contains information about the copies that a library has acquired
28
- */
29
- copies?: {
30
- total?: number;
31
- available?: number;
32
- [k: string]: unknown;
33
- };
34
- /**
35
- * Indicates the availability of a given resource
36
- */
37
- availability?: {
38
- state: 'available' | 'unavailable' | 'reserved' | 'ready';
39
- /**
40
- * Timestamp for the previous state change
41
- */
42
- since?: ({
43
- [k: string]: unknown;
44
- } | {
45
- [k: string]: unknown;
46
- }) & string;
47
- /**
48
- * Timestamp for the next state change
49
- */
50
- until?: ({
51
- [k: string]: unknown;
52
- } | {
53
- [k: string]: unknown;
54
- }) & string;
55
- [k: string]: unknown;
56
- };
57
- [k: string]: unknown;
58
- }
59
- export interface OPDSAcquisitionObject {
60
- type: string;
61
- child?: OPDSAcquisitionObject[];
62
- [k: string]: unknown;
63
- }
@@ -1,53 +0,0 @@
1
- export interface PresentationHintsMetadata {
2
- presentation?: {
3
- /**
4
- * Specifies whether or not the parts of a linked resource that flow out of the viewport are clipped.
5
- */
6
- clipped?: boolean;
7
- /**
8
- * Indicates if consecutive linked resources from the `reading order` should be handled in a continuous or discontinuous way.
9
- */
10
- continuous?: boolean;
11
- /**
12
- * Specifies constraints for the presentation of a linked resource within the viewport.
13
- */
14
- fit?: 'width' | 'height' | 'contain' | 'cover';
15
- /**
16
- * Suggested orientation for the device when displaying the linked resource.
17
- */
18
- orientation?: 'auto' | 'landscape' | 'portrait';
19
- /**
20
- * Indicates if the overflow of linked resources from the `readingOrder` or `resources` should be handled using dynamic pagination or scrolling.
21
- */
22
- overflow?: 'auto' | 'paginated' | 'scrolled' | 'scrolled-continuous';
23
- /**
24
- * Indicates the condition to be met for the linked resource to be rendered within a synthetic spread.
25
- */
26
- spread?: 'auto' | 'both' | 'none' | 'landscape';
27
- [k: string]: unknown;
28
- };
29
- [k: string]: unknown;
30
- }
31
- export interface PresentationHintsLinkProperties {
32
- /**
33
- * Specifies whether or not the parts of a linked resource that flow out of the viewport are clipped.
34
- */
35
- clipped?: boolean;
36
- /**
37
- * Specifies constraints for the presentation of a linked resource within the viewport.
38
- */
39
- fit?: 'contain' | 'cover' | 'width' | 'height';
40
- /**
41
- * Suggested orientation for the device when displaying the linked resource.
42
- */
43
- orientation?: 'auto' | 'landscape' | 'portrait';
44
- /**
45
- * Indicates how the linked resource should be displayed in a reading environment that displays synthetic spreads.
46
- */
47
- page?: 'left' | 'right' | 'center';
48
- /**
49
- * Indicates the condition to be met for the linked resource to be rendered within a synthetic spread.
50
- */
51
- spread?: 'auto' | 'both' | 'none' | 'landscape';
52
- [k: string]: unknown;
53
- }
@@ -1,58 +0,0 @@
1
- import { EPUBExtensionLinkProperties } from './EpubExtension';
2
- import { OPDSLinkProperties } from './OPDSLink';
3
- import { PresentationHintsLinkProperties } from './PresentationHints';
4
- export interface ReadiumLink {
5
- /**
6
- * URI or URI template of the linked resource
7
- */
8
- href: string;
9
- /**
10
- * MIME type of the linked resource
11
- */
12
- type?: string;
13
- /**
14
- * Indicates that a URI template is used in href
15
- */
16
- templated?: boolean;
17
- /**
18
- * Title of the linked resource
19
- */
20
- title?: string;
21
- /**
22
- * Relation between the linked resource and its containing collection
23
- */
24
- rel?: string | string[];
25
- /**
26
- * Properties associated to the linked resource
27
- */
28
- properties?: OPDSLinkProperties & EPUBExtensionLinkProperties & PresentationHintsLinkProperties;
29
- /**
30
- * Height of the linked resource in pixels
31
- */
32
- height?: number;
33
- /**
34
- * Width of the linked resource in pixels
35
- */
36
- width?: number;
37
- /**
38
- * Bitrate of the linked resource in kbps
39
- */
40
- bitrate?: number;
41
- /**
42
- * Length of the linked resource in seconds
43
- */
44
- duration?: number;
45
- /**
46
- * Expected language of the linked resource
47
- */
48
- language?: string | string[];
49
- /**
50
- * Alternate resources for the linked resource
51
- */
52
- alternate?: ReadiumLink[];
53
- /**
54
- * Resources that are children of the linked resource, in the context of a given collection role
55
- */
56
- children?: ReadiumLink[];
57
- [k: string]: unknown;
58
- }
@@ -1,16 +0,0 @@
1
- import { ReadiumLink } from './ReadiumLink';
2
- export interface SubjectObject {
3
- name: string | {
4
- /**
5
- * This interface was referenced by `undefined`'s JSON-Schema definition
6
- * via the `patternProperty` "^((?<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})+))$".
7
- */
8
- [k: string]: string;
9
- };
10
- sortAs?: string;
11
- code?: string;
12
- scheme?: string;
13
- links?: ReadiumLink[];
14
- [k: string]: unknown;
15
- }
16
- export declare type Subject = string | (string | SubjectObject)[] | SubjectObject;
@@ -1,14 +0,0 @@
1
- /**
2
- * Type definitions for a manifest
3
- */
4
- import { ReadiumWebpubContext } from '../constants';
5
- import { Metadata } from './Metadata';
6
- import { ReadiumLink } from './ReadiumLink';
7
- export interface WebpubManifest {
8
- '@context'?: typeof ReadiumWebpubContext;
9
- metadata: Metadata;
10
- links: ReadiumLink[];
11
- readingOrder: ReadiumLink[];
12
- resources?: ReadiumLink[];
13
- toc?: ReadiumLink[];
14
- }
@@ -1,37 +0,0 @@
1
- import { ReaderSettings } from './types';
2
- export declare const ReadiumWebpubContext = "http://readium.org/webpub/default.jsonld";
3
- export declare const IS_DEV: boolean;
4
- export declare const HEADER_HEIGHT = 48;
5
- export declare const FOOTER_HEIGHT = 48;
6
- export declare const CHROME_HEIGHT: number;
7
- export declare const DEFAULT_HEIGHT: string;
8
- export declare const DEFAULT_SHOULD_GROW_WHEN_SCROLLING = true;
9
- export declare const DEFAULT_SETTINGS: ReaderSettings;
10
- export declare const FONT_DETAILS: {
11
- publisher: {
12
- heading: string;
13
- body: string;
14
- token: string;
15
- fontWeight: string;
16
- };
17
- serif: {
18
- heading: string;
19
- body: string;
20
- token: string;
21
- fontWeight: string;
22
- };
23
- 'sans-serif': {
24
- heading: string;
25
- body: string;
26
- token: string;
27
- fontWeight: string;
28
- };
29
- 'open-dyslexic': {
30
- heading: string;
31
- body: string;
32
- token: string;
33
- fontWeight: string;
34
- };
35
- };
36
- export declare const LOCAL_STORAGE_SETTINGS_KEY = "web-reader-settings";
37
- export declare const LOCAL_STORAGE_LOCATIONS_KEY = "web-reader-locations";
@@ -1,17 +0,0 @@
1
- import { FC } from 'react';
2
- import { ReaderManagerArguments, UseWebReaderArguments } from './types';
3
- /**
4
- * The main React component export.
5
- */
6
- export declare type WebReaderProps = UseWebReaderArguments & ReaderManagerArguments;
7
- export declare const WebReaderWithoutBoundary: FC<WebReaderProps>;
8
- declare const WebReader: FC<WebReaderProps>;
9
- export default WebReader;
10
- export { default as useWebReader } from './useWebReader';
11
- export { default as useHtmlReader } from './HtmlReader';
12
- export { default as usePdfReader } from './PdfReader';
13
- export { getTheme } from './ui/theme';
14
- export { default as useColorModeValue } from './ui/hooks/useColorModeValue';
15
- export * from './constants';
16
- export { clearWebReaderLocalStorage } from './utils/localstorage';
17
- export { default as addTocToManifest } from './PdfReader/addTocToManifest';
@@ -1,123 +0,0 @@
1
- /// <reference types="react" />
2
- import { Injectable } from './Readium/Injectable';
3
- import { Locator } from './Readium/Locator';
4
- import { WebpubManifest } from './WebpubManifestTypes/WebpubManifest';
5
- export { WebpubManifest };
6
- export declare const EpubMimeType = "application/epub";
7
- export declare const WebpubMimeType = "application/webpub";
8
- export declare type ColorMode = 'night' | 'sepia' | 'day';
9
- export declare type FontFamily = 'publisher' | 'serif' | 'sans-serif' | 'open-dyslexic';
10
- export declare type Navigator = {
11
- goForward: () => void;
12
- goBackward: () => void;
13
- setScroll: (val: 'scrolling' | 'paginated') => Promise<void>;
14
- goToPage: (href: string) => void;
15
- };
16
- export declare type PdfNavigator = Navigator & {
17
- zoomIn: () => Promise<void>;
18
- zoomOut: () => Promise<void>;
19
- };
20
- export declare type HtmlNavigator = Navigator & {
21
- increaseFontSize: () => Promise<void>;
22
- decreaseFontSize: () => Promise<void>;
23
- resetSettings: () => Promise<void>;
24
- setFontFamily: (family: FontFamily) => Promise<void>;
25
- setColorMode: (mode: ColorMode) => Promise<void>;
26
- };
27
- export declare type ReaderSettings = {
28
- colorMode: ColorMode;
29
- isScrolling: boolean;
30
- fontSize: number;
31
- fontFamily: FontFamily;
32
- };
33
- /**
34
- * This is the "public" state of the reader that
35
- * is returned to consumers of useWebReader. Each
36
- * reader (pdf/html) has its own internal state with
37
- * more details necessary for rendering
38
- */
39
- export declare type ReaderState = {
40
- atStart: boolean;
41
- atEnd: boolean;
42
- location?: Locator;
43
- settings: ReaderSettings | undefined;
44
- };
45
- export declare type InactiveReader = null;
46
- export declare type LoadingReader = {
47
- isLoading: true;
48
- content: JSX.Element;
49
- navigator: null;
50
- state: null;
51
- manifest: null;
52
- type: null;
53
- };
54
- declare type CommonReader = {
55
- isLoading: false;
56
- content: JSX.Element;
57
- manifest: WebpubManifest;
58
- };
59
- export declare type PDFActiveReader = CommonReader & {
60
- state: ReaderState;
61
- navigator: PdfNavigator;
62
- type: 'PDF';
63
- };
64
- export declare type HTMLActiveReader = CommonReader & {
65
- state: ReaderState;
66
- navigator: HtmlNavigator;
67
- type: 'HTML';
68
- };
69
- export declare type ActiveReader = PDFActiveReader | HTMLActiveReader;
70
- export declare type ReaderReturn = InactiveReader | LoadingReader | ActiveReader;
71
- export declare type GetContent = (href: string) => Promise<string>;
72
- export declare type ReaderManagerArguments = {
73
- headerLeft?: JSX.Element;
74
- };
75
- export declare type UseWebReaderArguments = {
76
- webpubManifestUrl: string;
77
- proxyUrl?: string;
78
- getContent?: GetContent;
79
- pdfWorkerSrc?: string;
80
- injectablesReflowable?: Injectable[];
81
- injectablesFixed?: Injectable[];
82
- /**
83
- * CSS string to set the height of the reader in paginated mode, and also
84
- * in scrolling mode if `growWhenScrolling` is `false`.
85
- *
86
- * eg: "800px" or `calc(100vh-${CHROME_HEIGHT})`
87
- *
88
- * Default: `calc(100vh-${CHROME_HEIGHT})`
89
- */
90
- height?: string;
91
- /**
92
- * Tells the renderer if it should grow to fit content in scrolling mode, or if should
93
- * remain the same height and instead show an internal scroll bar. Set to `true` by
94
- * default, as this should be used in a full-page reader, the most common use case.
95
- *
96
- * Default: `true`
97
- */
98
- growWhenScrolling?: boolean;
99
- /**
100
- * Initial user settings for the reader
101
- */
102
- readerSettings?: Partial<ReaderSettings>;
103
- /**
104
- * If enabled, reading location will be persisted to local storage and recalled from
105
- * there upon initial load.
106
- *
107
- * Default: `true`
108
- */
109
- persistLastLocation?: boolean;
110
- /**
111
- * If enabled, reader settings will be persisted to local storage and recalled
112
- * from there upon initial load.
113
- *
114
- * Default: `true`
115
- */
116
- persistSettings?: boolean;
117
- };
118
- export declare type ActiveReaderArguments = UseWebReaderArguments & {
119
- manifest: WebpubManifest;
120
- };
121
- export declare type InactiveReaderArguments = undefined;
122
- export declare type ReaderArguments = ActiveReaderArguments | InactiveReaderArguments;
123
- export declare type GetColor = (light: string, dark: string, sepia: string) => string;
@@ -1,9 +0,0 @@
1
- import React from 'react';
2
- import { Button as ChakraButton } from '@chakra-ui/react';
3
- export declare type ButtonProps = React.ComponentPropsWithRef<typeof ChakraButton>;
4
- declare const Button: React.ForwardRefExoticComponent<Pick<Pick<import("@chakra-ui/react").OmitCommonProps<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, keyof import("@chakra-ui/react").ButtonProps> & import("@chakra-ui/react").ButtonProps & import("@chakra-ui/react").OmitCommonProps<any, keyof import("@chakra-ui/react").ButtonProps> & {
5
- as?: import("@chakra-ui/react").As<any> | undefined;
6
- }, string | number | symbol> & {
7
- ref?: ((instance: HTMLButtonElement | null) => void) | React.RefObject<HTMLButtonElement> | null | undefined;
8
- }, string | number | symbol> & React.RefAttributes<HTMLButtonElement>>;
9
- export default Button;
@@ -1,16 +0,0 @@
1
- import * as React from 'react';
2
- import { WebReaderProps } from '..';
3
- declare type ErrorState = {
4
- error?: Error;
5
- info?: React.ErrorInfo;
6
- };
7
- declare class ErrorBoundary extends React.Component<WebReaderProps, ErrorState> {
8
- static getDerivedStateFromError(error: Error): {
9
- error: Error;
10
- };
11
- state: ErrorState;
12
- handleClearError(): void;
13
- componentDidCatch(error: Error, errorInfo: React.ErrorInfo): void;
14
- render(): React.ReactNode;
15
- }
16
- export default ErrorBoundary;
@@ -1,9 +0,0 @@
1
- import * as React from 'react';
2
- import { Flex } from '@chakra-ui/react';
3
- import { Navigator, ReaderState } from '../types';
4
- declare type FooterProps = {
5
- state: ReaderState | null;
6
- navigator: Navigator | null;
7
- } & React.ComponentProps<typeof Flex>;
8
- declare const Footer: React.FC<FooterProps>;
9
- export default Footer;
@@ -1,9 +0,0 @@
1
- import React from 'react';
2
- import { ActiveReader, ReaderManagerArguments } from '../types';
3
- export declare const DefaultHeaderLeft: () => React.ReactElement;
4
- export default function Header(props: ActiveReader & ReaderManagerArguments & {
5
- containerRef: React.MutableRefObject<null | HTMLDivElement>;
6
- }): React.ReactElement;
7
- export declare const HeaderWrapper: React.ForwardRefExoticComponent<Pick<import("@chakra-ui/react").OmitCommonProps<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import("@chakra-ui/react").FlexProps> & import("@chakra-ui/react").FlexProps & import("@chakra-ui/react").OmitCommonProps<any, keyof import("@chakra-ui/react").FlexProps> & {
8
- as?: import("@chakra-ui/react").As<any> | undefined;
9
- }, string | number | symbol> & React.RefAttributes<HTMLDivElement>>;
@@ -1,9 +0,0 @@
1
- import * as React from 'react';
2
- import { HtmlNavigator, ReaderState } from '../types';
3
- export declare type HtmlSettingsProps = {
4
- navigator: HtmlNavigator;
5
- iconFill: string;
6
- readerState: ReaderState;
7
- paginationValue: string;
8
- };
9
- export default function HtmlSettings(props: HtmlSettingsProps): React.ReactElement | null;
@@ -1,9 +0,0 @@
1
- /// <reference types="react" />
2
- import { HtmlState } from '../HtmlReader/types';
3
- import { ReaderState } from '../types';
4
- declare type AnyState = HtmlState | ReaderState | undefined | null;
5
- export default function LoadingSkeleton({ height, state, }: {
6
- height: string;
7
- state: AnyState;
8
- }): JSX.Element;
9
- export {};
@@ -1,7 +0,0 @@
1
- import React from 'react';
2
- import { Button } from '@chakra-ui/react';
3
- export declare type PageButtonProps = React.ComponentPropsWithoutRef<typeof Button> & {
4
- children: React.ReactNode;
5
- };
6
- declare function PageButton(props: React.PropsWithoutRef<PageButtonProps>): React.ReactElement;
7
- export default PageButton;
@@ -1,8 +0,0 @@
1
- import * as React from 'react';
2
- import { PdfNavigator, ReaderState } from '../types';
3
- export declare type PdfSettingsProps = {
4
- navigator: PdfNavigator;
5
- readerState: ReaderState;
6
- paginationValue: string;
7
- };
8
- export default function PdfSettings(props: PdfSettingsProps): React.ReactElement;
@@ -1,5 +0,0 @@
1
- import * as React from 'react';
2
- import { PDFActiveReader, HTMLActiveReader } from '../types';
3
- declare type SettingsCardProps = Pick<PDFActiveReader, 'navigator' | 'state' | 'type'> | Pick<HTMLActiveReader, 'navigator' | 'state' | 'type'>;
4
- export default function SettingsCard(props: SettingsCardProps): React.ReactElement;
5
- export {};
@@ -1,7 +0,0 @@
1
- import React from 'react';
2
- import { Navigator, WebpubManifest } from '../types';
3
- export default function TableOfContent({ navigator, manifest, containerRef, }: {
4
- navigator: Navigator;
5
- manifest: WebpubManifest;
6
- containerRef: React.MutableRefObject<HTMLDivElement | null>;
7
- }): React.ReactElement;
@@ -1,14 +0,0 @@
1
- import React, { ReactElement } from 'react';
2
- import { Box as ChakraBox } from '@chakra-ui/react';
3
- import { ColorMode } from '../types';
4
- export interface ToggleButtonProps extends React.ComponentPropsWithoutRef<typeof ChakraBox> {
5
- colorMode?: ColorMode;
6
- icon?: ReactElement;
7
- iconFill?: string;
8
- label?: string;
9
- value: string;
10
- }
11
- declare function ToggleButton(props: React.PropsWithoutRef<ToggleButtonProps>): React.ReactElement;
12
- export declare const FontToggleButton: typeof ToggleButton;
13
- export declare const ColorModeToggleButton: typeof ToggleButton;
14
- export default ToggleButton;
@@ -1,8 +0,0 @@
1
- import React from 'react';
2
- import { UseRadioGroupProps } from '@chakra-ui/react';
3
- declare type ToggleGroupProps = Omit<UseRadioGroupProps, 'value' | 'defaultValue'> & {
4
- value: string;
5
- label: string;
6
- };
7
- declare const ToggleGroup: React.FC<ToggleGroupProps>;
8
- export default ToggleGroup;
@@ -1,7 +0,0 @@
1
- import { Theme } from '@emotion/react';
2
- import { ColorMode } from '../../types';
3
- export interface ColorModeTheme extends Theme {
4
- currentColorMode: ColorMode;
5
- }
6
- declare const useColorModeValue: (light: string, dark: string, sepia: string) => string;
7
- export default useColorModeValue;
@@ -1,6 +0,0 @@
1
- /**
2
- * Returns the interior width of the container in pixels.
3
- *
4
- * @returns {number} Width of the container in pixels
5
- */
6
- export default function useContainerWidth(containerId: string): number;
@@ -1,8 +0,0 @@
1
- /**
2
- * Adds event listener to a given element.
3
- *
4
- * @param {HTMLElement} element Element to attach the listener to
5
- * @param {string} type Event type
6
- * @param {Function} listener Event listener
7
- */
8
- export default function useEventListener(element: HTMLElement | Window, type: string, listener: () => void): void;
@@ -1,7 +0,0 @@
1
- export default function useFullscreen(): [boolean, () => void];
2
- export declare const fullScreenEnabled: boolean;
3
- export declare const isOnFullscreen: () => Element | null;
4
- /**
5
- * Toggles fullscreen mode on the <html> element.
6
- */
7
- export declare function toggleFullScreen(): void;
@@ -1,4 +0,0 @@
1
- import React, { ReactElement } from 'react';
2
- import { Icon } from '@chakra-ui/react';
3
- declare const Continuous: (props: React.ComponentProps<typeof Icon>) => ReactElement;
4
- export default Continuous;
@@ -1,4 +0,0 @@
1
- import React, { ReactElement } from 'react';
2
- import { Icon } from '@chakra-ui/react';
3
- declare const Day: (props: React.ComponentProps<typeof Icon>) => ReactElement;
4
- export default Day;
@@ -1,4 +0,0 @@
1
- import React, { ReactElement } from 'react';
2
- import { Icon } from '@chakra-ui/react';
3
- declare const EnlargeFont: (props: React.ComponentProps<typeof Icon>) => ReactElement;
4
- export default EnlargeFont;
@@ -1,4 +0,0 @@
1
- import React, { ReactElement } from 'react';
2
- import { Icon } from '@chakra-ui/react';
3
- declare const Night: (props: React.ComponentProps<typeof Icon>) => ReactElement;
4
- export default Night;
@@ -1,4 +0,0 @@
1
- import React, { ReactElement } from 'react';
2
- import { Icon } from '@chakra-ui/react';
3
- declare const Paginated: (props: React.ComponentProps<typeof Icon>) => ReactElement;
4
- export default Paginated;
@@ -1,4 +0,0 @@
1
- import React, { ReactElement } from 'react';
2
- import { Icon } from '@chakra-ui/react';
3
- declare const Previous: (props: React.ComponentProps<typeof Icon>) => ReactElement;
4
- export default Previous;
@@ -1,4 +0,0 @@
1
- import React, { ReactElement } from 'react';
2
- import { Icon } from '@chakra-ui/react';
3
- declare const ReaderSettings: (props: React.ComponentProps<typeof Icon>) => ReactElement;
4
- export default ReaderSettings;
@@ -1,4 +0,0 @@
1
- import React, { ReactElement } from 'react';
2
- import { Icon } from '@chakra-ui/react';
3
- declare const ReduceFont: (props: React.ComponentProps<typeof Icon>) => ReactElement;
4
- export default ReduceFont;
@@ -1,4 +0,0 @@
1
- import React, { ReactElement } from 'react';
2
- import { Icon } from '@chakra-ui/react';
3
- declare const Reset: (props: React.ComponentProps<typeof Icon>) => ReactElement;
4
- export default Reset;
@@ -1,4 +0,0 @@
1
- import React, { ReactElement } from 'react';
2
- import { Icon } from '@chakra-ui/react';
3
- declare const Sepia: (props: React.ComponentProps<typeof Icon>) => ReactElement;
4
- export default Sepia;
@@ -1,4 +0,0 @@
1
- import React, { ReactElement } from 'react';
2
- import { Icon } from '@chakra-ui/react';
3
- declare const TableOfContents: (props: React.ComponentProps<typeof Icon>) => ReactElement;
4
- export default TableOfContents;
@@ -1,4 +0,0 @@
1
- import React, { ReactElement } from 'react';
2
- import { Icon } from '@chakra-ui/react';
3
- declare const ToggleFullScreen: (props: React.ComponentProps<typeof Icon>) => ReactElement;
4
- export default ToggleFullScreen;
@@ -1,4 +0,0 @@
1
- import React, { ReactElement } from 'react';
2
- import { Icon } from '@chakra-ui/react';
3
- declare const ToggleFullScreenExit: (props: React.ComponentProps<typeof Icon>) => ReactElement;
4
- export default ToggleFullScreenExit;