@nypl/web-reader 4.2.0 → 4.3.1
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 +178 -188
- package/dist/{esm/index.css → index.css} +3 -1
- package/dist/index.css.map +1 -0
- package/dist/index.d.ts +532 -0
- package/dist/index.js +9381 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +9378 -0
- package/dist/index.mjs.map +1 -0
- package/dist/injectable-html-styles/ReadiumCSS-after.css +488 -2
- package/dist/injectable-html-styles/ReadiumCSS-after.css.map +1 -7
- package/dist/injectable-html-styles/ReadiumCSS-after.d.ts +2 -0
- package/dist/injectable-html-styles/ReadiumCSS-before.css +648 -2
- package/dist/injectable-html-styles/ReadiumCSS-before.css.map +1 -7
- package/dist/injectable-html-styles/ReadiumCSS-before.d.ts +2 -0
- package/dist/injectable-html-styles/ReadiumCSS-default.css +141 -2
- package/dist/injectable-html-styles/ReadiumCSS-default.css.map +1 -7
- package/dist/injectable-html-styles/ReadiumCSS-default.d.ts +2 -0
- package/package.json +10 -33
- package/dist/cjs/index.css +0 -2
- package/dist/cjs/index.css.map +0 -7
- package/dist/cjs/index.js +0 -340
- package/dist/cjs/index.js.map +0 -7
- package/dist/esm/index.css.map +0 -7
- package/dist/esm/index.js +0 -42090
- package/dist/esm/index.js.map +0 -7
- package/dist/types/HtmlReader/effects.d.ts +0 -22
- package/dist/types/HtmlReader/index.d.ts +0 -15
- package/dist/types/HtmlReader/lib.d.ts +0 -112
- package/dist/types/HtmlReader/reducer.d.ts +0 -8
- package/dist/types/HtmlReader/types.d.ts +0 -116
- package/dist/types/HtmlReader/useIframeLinkClick.d.ts +0 -4
- package/dist/types/HtmlReader/useLocationQuery.d.ts +0 -8
- package/dist/types/HtmlReader/useResource.d.ts +0 -14
- package/dist/types/HtmlReader/useUpdateCSS.d.ts +0 -7
- package/dist/types/HtmlReader/useUpdateScroll.d.ts +0 -6
- package/dist/types/HtmlReader/useWindowResize.d.ts +0 -7
- package/dist/types/PdfReader/ChakraPage.d.ts +0 -3
- package/dist/types/PdfReader/ScrollPage.d.ts +0 -12
- package/dist/types/PdfReader/index.d.ts +0 -13
- package/dist/types/PdfReader/useMeasure.d.ts +0 -7
- package/dist/types/Readium/Injectable.d.ts +0 -11
- package/dist/types/Readium/Locator.d.ts +0 -20
- package/dist/types/WebpubManifestTypes/ConformsTo.d.ts +0 -3
- package/dist/types/WebpubManifestTypes/Contributor.d.ts +0 -17
- package/dist/types/WebpubManifestTypes/EpubExtension.d.ts +0 -47
- package/dist/types/WebpubManifestTypes/LanguageMap.d.ts +0 -3
- package/dist/types/WebpubManifestTypes/Metadata.d.ts +0 -47
- package/dist/types/WebpubManifestTypes/OPDSLink.d.ts +0 -63
- package/dist/types/WebpubManifestTypes/PresentationHints.d.ts +0 -53
- package/dist/types/WebpubManifestTypes/ReadiumLink.d.ts +0 -58
- package/dist/types/WebpubManifestTypes/Subject.d.ts +0 -16
- package/dist/types/WebpubManifestTypes/WebpubManifest.d.ts +0 -14
- package/dist/types/constants.d.ts +0 -37
- package/dist/types/index.d.ts +0 -16
- package/dist/types/types.d.ts +0 -123
- package/dist/types/ui/Button.d.ts +0 -9
- package/dist/types/ui/ErrorBoundary.d.ts +0 -16
- package/dist/types/ui/Footer.d.ts +0 -9
- package/dist/types/ui/Header.d.ts +0 -9
- package/dist/types/ui/HtmlSettings.d.ts +0 -9
- package/dist/types/ui/LoadingSkeleton.d.ts +0 -9
- package/dist/types/ui/PageButton.d.ts +0 -7
- package/dist/types/ui/PdfSettings.d.ts +0 -8
- package/dist/types/ui/SettingsButton.d.ts +0 -5
- package/dist/types/ui/TableOfContent.d.ts +0 -7
- package/dist/types/ui/ToggleButton.d.ts +0 -14
- package/dist/types/ui/ToggleGroup.d.ts +0 -8
- package/dist/types/ui/hooks/useColorModeValue.d.ts +0 -7
- package/dist/types/ui/hooks/useContainerWidth.d.ts +0 -6
- package/dist/types/ui/hooks/useEventListener.d.ts +0 -8
- package/dist/types/ui/hooks/useFullScreen.d.ts +0 -7
- package/dist/types/ui/icons/Continuous.d.ts +0 -4
- package/dist/types/ui/icons/Day.d.ts +0 -4
- package/dist/types/ui/icons/EnlargeFont.d.ts +0 -4
- package/dist/types/ui/icons/Night.d.ts +0 -4
- package/dist/types/ui/icons/Paginated.d.ts +0 -4
- package/dist/types/ui/icons/Previous.d.ts +0 -4
- package/dist/types/ui/icons/ReaderSettings.d.ts +0 -4
- package/dist/types/ui/icons/ReduceFont.d.ts +0 -4
- package/dist/types/ui/icons/Reset.d.ts +0 -4
- package/dist/types/ui/icons/Sepia.d.ts +0 -4
- package/dist/types/ui/icons/TableOfContents.d.ts +0 -4
- package/dist/types/ui/icons/ToggleFullScreen.d.ts +0 -4
- package/dist/types/ui/icons/ToggleFullScreenExit.d.ts +0 -4
- package/dist/types/ui/icons/index.d.ts +0 -14
- package/dist/types/ui/manager.d.ts +0 -9
- package/dist/types/ui/menu/index.d.ts +0 -10
- package/dist/types/ui/menu/menu.d.ts +0 -76
- package/dist/types/ui/menu/use-menu.d.ts +0 -2510
- package/dist/types/ui/nypl-base-theme/components/button.d.ts +0 -94
- package/dist/types/ui/nypl-base-theme/components/checkbox.d.ts +0 -41
- package/dist/types/ui/nypl-base-theme/components/form-error.d.ts +0 -14
- package/dist/types/ui/nypl-base-theme/components/form-label.d.ts +0 -14
- package/dist/types/ui/nypl-base-theme/components/form.d.ts +0 -15
- package/dist/types/ui/nypl-base-theme/components/input.d.ts +0 -107
- package/dist/types/ui/nypl-base-theme/components/text-area.d.ts +0 -34
- package/dist/types/ui/nypl-base-theme/foundations/breakpoints.d.ts +0 -8
- package/dist/types/ui/nypl-base-theme/foundations/colors.d.ts +0 -3
- package/dist/types/ui/nypl-base-theme/foundations/global.d.ts +0 -13
- package/dist/types/ui/nypl-base-theme/foundations/radii.d.ts +0 -12
- package/dist/types/ui/nypl-base-theme/foundations/spacing.d.ts +0 -49
- package/dist/types/ui/nypl-base-theme/foundations/typography.d.ts +0 -10
- package/dist/types/ui/nypl-base-theme/index.d.ts +0 -7
- package/dist/types/ui/nypl-base-theme/types.d.ts +0 -1
- package/dist/types/ui/theme/components/alert.d.ts +0 -24
- package/dist/types/ui/theme/components/button.d.ts +0 -93
- package/dist/types/ui/theme/components/text.d.ts +0 -20
- package/dist/types/ui/theme/foundations/colors.d.ts +0 -3
- package/dist/types/ui/theme/foundations/fonts.d.ts +0 -3
- package/dist/types/ui/theme/foundations/typography.d.ts +0 -6
- package/dist/types/ui/theme/index.d.ts +0 -12
- package/dist/types/ui/theme/types.d.ts +0 -1
- package/dist/types/useWebReader.d.ts +0 -7
- package/dist/types/utils/decryptAxisNow.d.ts +0 -0
- package/dist/types/utils/fetch.d.ts +0 -4
- package/dist/types/utils/getColor.d.ts +0 -2
- package/dist/types/utils/localstorage.d.ts +0 -21
|
@@ -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";
|
package/dist/types/index.d.ts
DELETED
|
@@ -1,16 +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';
|
package/dist/types/types.d.ts
DELETED
|
@@ -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,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,14 +0,0 @@
|
|
|
1
|
-
import Continuous from './Continuous';
|
|
2
|
-
import Day from './Day';
|
|
3
|
-
import EnlargeFont from './EnlargeFont';
|
|
4
|
-
import Night from './Night';
|
|
5
|
-
import Paginated from './Paginated';
|
|
6
|
-
import Previous from './Previous';
|
|
7
|
-
import ReaderSettings from './ReaderSettings';
|
|
8
|
-
import ReduceFont from './ReduceFont';
|
|
9
|
-
import Reset from './Reset';
|
|
10
|
-
import Sepia from './Sepia';
|
|
11
|
-
import TableOfContents from './TableOfContents';
|
|
12
|
-
import ToggleFullScreen from './ToggleFullScreen';
|
|
13
|
-
import ToggleFullScreenExit from './ToggleFullScreenExit';
|
|
14
|
-
export { Continuous, Day, EnlargeFont, Night, Paginated, Previous, ReaderSettings, ReduceFont, Reset, Sepia, TableOfContents, ToggleFullScreen, ToggleFullScreenExit, };
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { ReaderManagerArguments, ReaderReturn } from '../types';
|
|
3
|
-
/**
|
|
4
|
-
* The default Manager UI. This will be broken into individual components
|
|
5
|
-
* that can be imported and used separately or in a customized setup.
|
|
6
|
-
* It takes the return value of useWebReader as props
|
|
7
|
-
*/
|
|
8
|
-
declare const ManagerUI: React.FC<ReaderReturn & ReaderManagerArguments>;
|
|
9
|
-
export default ManagerUI;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This is copied out of Chakra's source and then
|
|
3
|
-
* edited to remove the absolute positioning aspect,
|
|
4
|
-
* but preserve the accessibility aspect.
|
|
5
|
-
*
|
|
6
|
-
* There is a ticket to support this internally to Chakra here:
|
|
7
|
-
* https://github.com/chakra-ui/chakra-ui/issues/5039
|
|
8
|
-
*/
|
|
9
|
-
export * from './menu';
|
|
10
|
-
export * from './use-menu';
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import { MaybeRenderProp } from '@chakra-ui/react-utils';
|
|
2
|
-
import { HTMLChakraProps, SystemProps, ThemingProps } from '@chakra-ui/system';
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import { UseMenuItemProps, UseMenuOptionGroupProps, UseMenuOptionOptions, UseMenuProps } from './use-menu';
|
|
5
|
-
export interface MenuProps extends UseMenuProps, ThemingProps<'Menu'> {
|
|
6
|
-
children: MaybeRenderProp<{
|
|
7
|
-
isOpen: boolean;
|
|
8
|
-
onClose: () => void;
|
|
9
|
-
}>;
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* Menu provides context, state, and focus management
|
|
13
|
-
* to its sub-components. It doesn't render any DOM node.
|
|
14
|
-
*/
|
|
15
|
-
export declare const Menu: React.FC<MenuProps>;
|
|
16
|
-
export interface MenuButtonProps extends HTMLChakraProps<'button'> {
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* The trigger for the menu list. Must be a direct child of `Menu`.
|
|
20
|
-
*/
|
|
21
|
-
export declare const MenuButton: import("@chakra-ui/system").ComponentWithAs<"button", MenuButtonProps>;
|
|
22
|
-
export interface MenuListProps extends HTMLChakraProps<'div'> {
|
|
23
|
-
rootProps?: HTMLChakraProps<'div'>;
|
|
24
|
-
}
|
|
25
|
-
export declare const MenuList: import("@chakra-ui/system").ComponentWithAs<"div", MenuListProps>;
|
|
26
|
-
export interface StyledMenuItemProps extends HTMLChakraProps<'button'> {
|
|
27
|
-
}
|
|
28
|
-
interface MenuItemOptions extends Pick<UseMenuItemProps, 'isDisabled' | 'isFocusable' | 'closeOnSelect'> {
|
|
29
|
-
/**
|
|
30
|
-
* The icon to render before the menu item's label.
|
|
31
|
-
* @type React.ReactElement
|
|
32
|
-
*/
|
|
33
|
-
icon?: React.ReactElement;
|
|
34
|
-
/**
|
|
35
|
-
* The spacing between the icon and menu item's label.
|
|
36
|
-
* @type SystemProps["mr"]
|
|
37
|
-
*/
|
|
38
|
-
iconSpacing?: SystemProps['mr'];
|
|
39
|
-
/**
|
|
40
|
-
* Right-aligned label text content, useful for displaying hotkeys.
|
|
41
|
-
*/
|
|
42
|
-
command?: string;
|
|
43
|
-
/**
|
|
44
|
-
* The spacing between the command and menu item's label.
|
|
45
|
-
* @type SystemProps["ml"]
|
|
46
|
-
*/
|
|
47
|
-
commandSpacing?: SystemProps['ml'];
|
|
48
|
-
}
|
|
49
|
-
export interface MenuItemProps extends HTMLChakraProps<'button'>, MenuItemOptions {
|
|
50
|
-
}
|
|
51
|
-
export declare const MenuItem: import("@chakra-ui/system").ComponentWithAs<"button", MenuItemProps>;
|
|
52
|
-
export interface MenuItemOptionProps extends UseMenuOptionOptions, Omit<MenuItemProps, keyof UseMenuOptionOptions> {
|
|
53
|
-
/**
|
|
54
|
-
* @type React.ReactElement
|
|
55
|
-
*/
|
|
56
|
-
icon?: React.ReactElement;
|
|
57
|
-
/**
|
|
58
|
-
* @type SystemProps["mr"]
|
|
59
|
-
*/
|
|
60
|
-
iconSpacing?: SystemProps['mr'];
|
|
61
|
-
}
|
|
62
|
-
export declare const MenuItemOption: import("@chakra-ui/system").ComponentWithAs<"button", MenuItemOptionProps>;
|
|
63
|
-
export interface MenuOptionGroupProps extends UseMenuOptionGroupProps, Omit<MenuGroupProps, 'value' | 'defaultValue' | 'onChange'> {
|
|
64
|
-
}
|
|
65
|
-
export declare const MenuOptionGroup: React.FC<MenuOptionGroupProps>;
|
|
66
|
-
export interface MenuGroupProps extends HTMLChakraProps<'div'> {
|
|
67
|
-
}
|
|
68
|
-
export declare const MenuGroup: import("@chakra-ui/system").ComponentWithAs<"div", MenuGroupProps>;
|
|
69
|
-
export interface MenuCommandProps extends HTMLChakraProps<'span'> {
|
|
70
|
-
}
|
|
71
|
-
export declare const MenuCommand: import("@chakra-ui/system").ComponentWithAs<"span", MenuCommandProps>;
|
|
72
|
-
export declare const MenuIcon: React.FC<HTMLChakraProps<'span'>>;
|
|
73
|
-
export interface MenuDividerProps extends HTMLChakraProps<'hr'> {
|
|
74
|
-
}
|
|
75
|
-
export declare const MenuDivider: React.FC<MenuDividerProps>;
|
|
76
|
-
export {};
|