@canopycanopycanopy/b-ber-reader-react 1.2.13-react-reader.35 → 1.2.13-react-reader.45
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +11 -9
- package/index.d.ts +30 -26
- package/package.json +3 -2
package/index.d.ts
CHANGED
|
@@ -41,7 +41,7 @@ export enum Layout {
|
|
|
41
41
|
COLUMNS = 'columns',
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
type RequireOneOf<T, Keys extends keyof T = keyof T> = Pick<
|
|
44
|
+
export type RequireOneOf<T, Keys extends keyof T = keyof T> = Pick<
|
|
45
45
|
T,
|
|
46
46
|
Exclude<keyof T, Keys>
|
|
47
47
|
> &
|
|
@@ -57,54 +57,49 @@ export interface BberReaderQueryParameterKeys {
|
|
|
57
57
|
spreadIndex?: number
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
-
interface Download {
|
|
60
|
+
export interface Download {
|
|
61
61
|
label: string
|
|
62
62
|
title: string
|
|
63
63
|
url: string
|
|
64
64
|
description?: string
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
-
interface UiOptionsNavigationHeaderIcons {
|
|
67
|
+
export interface UiOptionsNavigationHeaderIcons {
|
|
68
68
|
home?: boolean
|
|
69
69
|
toc?: boolean
|
|
70
70
|
downloads?: boolean
|
|
71
71
|
info?: boolean
|
|
72
72
|
}
|
|
73
73
|
|
|
74
|
-
interface UiOptionsNavigationFooterIcons {
|
|
74
|
+
export interface UiOptionsNavigationFooterIcons {
|
|
75
75
|
chapter?: boolean
|
|
76
76
|
page?: boolean
|
|
77
77
|
}
|
|
78
78
|
|
|
79
|
-
interface UiOptionsNavigation {
|
|
79
|
+
export interface UiOptionsNavigation {
|
|
80
80
|
header_icons?: UiOptionsNavigationHeaderIcons
|
|
81
81
|
footer_icons?: UiOptionsNavigationFooterIcons
|
|
82
82
|
}
|
|
83
83
|
|
|
84
|
-
interface UiOptions {
|
|
84
|
+
export interface UiOptions {
|
|
85
85
|
navigation?: UiOptionsNavigation
|
|
86
86
|
}
|
|
87
87
|
|
|
88
|
-
enum SidebarName {
|
|
88
|
+
export enum SidebarName {
|
|
89
89
|
CHAPTERS = 'chapters',
|
|
90
90
|
DOWNLOADS = 'downloads',
|
|
91
91
|
METADATA = 'metadata',
|
|
92
92
|
// SETTINGS = 'settings',
|
|
93
93
|
}
|
|
94
94
|
|
|
95
|
-
interface NavigationHeaderProps {
|
|
95
|
+
export interface NavigationHeaderProps {
|
|
96
96
|
destroyReaderComponent: () => void
|
|
97
|
-
handleSidebarButtonClick: (name: SidebarName | null) => void
|
|
97
|
+
handleSidebarButtonClick: (name: `${SidebarName}` | null) => void
|
|
98
98
|
downloads: Download[]
|
|
99
99
|
uiOptions: UiOptions
|
|
100
100
|
}
|
|
101
101
|
|
|
102
|
-
|
|
103
|
-
SCROLL = 'scroll',
|
|
104
|
-
COLUMNS = 'columns',
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
interface SpineItem {
|
|
102
|
+
export interface SpineItem {
|
|
108
103
|
absoluteURL: string
|
|
109
104
|
children: SpineItem[]
|
|
110
105
|
depth: number
|
|
@@ -119,9 +114,9 @@ interface SpineItem {
|
|
|
119
114
|
title: string
|
|
120
115
|
}
|
|
121
116
|
|
|
122
|
-
type Spine = SpineItem[]
|
|
117
|
+
export type Spine = SpineItem[]
|
|
123
118
|
|
|
124
|
-
interface Metadata {
|
|
119
|
+
export interface Metadata {
|
|
125
120
|
title: string
|
|
126
121
|
creator: string
|
|
127
122
|
date: string
|
|
@@ -132,11 +127,11 @@ interface Metadata {
|
|
|
132
127
|
identifier: string
|
|
133
128
|
}
|
|
134
129
|
|
|
135
|
-
interface NavigationFooterProps {
|
|
130
|
+
export interface NavigationFooterProps {
|
|
136
131
|
uiOptions: UiOptions
|
|
137
132
|
currentSpineItemIndex: number
|
|
138
133
|
spine: Spine
|
|
139
|
-
layout: Layout
|
|
134
|
+
layout: `${Layout}`
|
|
140
135
|
spreadIndex: number
|
|
141
136
|
lastSpreadIndex: number
|
|
142
137
|
handleEvents: boolean
|
|
@@ -149,28 +144,34 @@ interface NavigationFooterProps {
|
|
|
149
144
|
goToNextPage: () => void
|
|
150
145
|
}
|
|
151
146
|
|
|
152
|
-
interface SidebarChaptersProps {
|
|
147
|
+
export interface SidebarChaptersProps {
|
|
153
148
|
showSidebar: SidebarName | null
|
|
154
149
|
spine: Spine
|
|
155
150
|
currentSpineItemIndex: number
|
|
156
151
|
navigateToChapterByURL: (url: string) => void
|
|
157
152
|
}
|
|
158
153
|
|
|
159
|
-
interface SidebarDownloadsProps {
|
|
154
|
+
export interface SidebarDownloadsProps {
|
|
160
155
|
showSidebar: SidebarName | null
|
|
161
156
|
downloads: Download[]
|
|
162
157
|
}
|
|
163
158
|
|
|
164
|
-
interface SidebarMetadataProps {
|
|
159
|
+
export interface SidebarMetadataProps {
|
|
165
160
|
showSidebar: SidebarName | null
|
|
166
161
|
metadata: Metadata
|
|
167
162
|
}
|
|
168
163
|
|
|
169
164
|
// interface SidebarSettingsProps {}
|
|
170
165
|
|
|
171
|
-
type UiReaderProp<T> = React.Component<T> | ((props: T) => JSX.Element)
|
|
166
|
+
export type UiReaderProp<T> = React.Component<T> | ((props: T) => JSX.Element)
|
|
172
167
|
|
|
173
|
-
|
|
168
|
+
export type LocationState = 'memory' | 'localStorage' | 'queryParams'
|
|
169
|
+
|
|
170
|
+
export type KeysValues<T> = { [P in keyof T]: T[P] }
|
|
171
|
+
|
|
172
|
+
export type SearchParams = string | KeysValues<BberReaderQueryParameterKeys>
|
|
173
|
+
|
|
174
|
+
export interface OptionalBberReaderProps {
|
|
174
175
|
bookURL?: string
|
|
175
176
|
manifestURL?: string
|
|
176
177
|
projectURL?: string
|
|
@@ -180,8 +181,8 @@ interface OptionalBberReaderProps {
|
|
|
180
181
|
loadRemoteLibrary?: boolean
|
|
181
182
|
uiOptions?: UI
|
|
182
183
|
cache?: boolean
|
|
183
|
-
layout?: Layout
|
|
184
|
-
|
|
184
|
+
layout?: `${Layout}`
|
|
185
|
+
searchParamKeys?: BberReaderQueryParameterKeys
|
|
185
186
|
disableBodyStyles?: boolean
|
|
186
187
|
|
|
187
188
|
NavigationHeader?: UiReaderProp<NavigationHeaderProps>
|
|
@@ -190,6 +191,9 @@ interface OptionalBberReaderProps {
|
|
|
190
191
|
SidebarDownloads?: UiReaderProp<SidebarDownloadsProps>
|
|
191
192
|
SidebarMetadata?: UiReaderProp<SidebarMetadataProps>
|
|
192
193
|
// SidebarSettings?: UiReaderProp<SidebarSettingsProps>
|
|
194
|
+
|
|
195
|
+
locationState?: LocationState
|
|
196
|
+
searchParams?: SearchParams
|
|
193
197
|
}
|
|
194
198
|
|
|
195
199
|
export type BberReaderProps = RequireOneOf<
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@canopycanopycanopy/b-ber-reader-react",
|
|
3
|
-
"version": "1.2.13-react-reader.
|
|
3
|
+
"version": "1.2.13-react-reader.45+ff99b231",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -61,6 +61,7 @@
|
|
|
61
61
|
"postcss-loader": "^2.1.1",
|
|
62
62
|
"prop-types": "^15.6.1",
|
|
63
63
|
"react-test-renderer": "^16.4.0",
|
|
64
|
+
"redux-mock-store": "^1.5.4",
|
|
64
65
|
"resize-observer-polyfill": "^1.5.0",
|
|
65
66
|
"rimraf": "^2.7.1",
|
|
66
67
|
"sass": "^1.49.8",
|
|
@@ -121,5 +122,5 @@
|
|
|
121
122
|
"url": "https://maxwellsimmer.com"
|
|
122
123
|
}
|
|
123
124
|
],
|
|
124
|
-
"gitHead": "
|
|
125
|
+
"gitHead": "ff99b23185b94316fc96251b2d580a00a2649ed5"
|
|
125
126
|
}
|