@canopycanopycanopy/b-ber-reader-react 1.2.13-react-reader.34 → 1.2.13-react-reader.44

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 (3) hide show
  1. package/dist/index.js +12 -10
  2. package/index.d.ts +26 -17
  3. 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,31 +57,31 @@ 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
 
@@ -92,7 +92,7 @@ enum SidebarName {
92
92
  // SETTINGS = 'settings',
93
93
  }
94
94
 
95
- interface NavigationHeaderProps {
95
+ export interface NavigationHeaderProps {
96
96
  destroyReaderComponent: () => void
97
97
  handleSidebarButtonClick: (name: SidebarName | null) => void
98
98
  downloads: Download[]
@@ -104,7 +104,7 @@ enum Layout {
104
104
  COLUMNS = 'columns',
105
105
  }
106
106
 
107
- interface SpineItem {
107
+ export interface SpineItem {
108
108
  absoluteURL: string
109
109
  children: SpineItem[]
110
110
  depth: number
@@ -119,9 +119,9 @@ interface SpineItem {
119
119
  title: string
120
120
  }
121
121
 
122
- type Spine = SpineItem[]
122
+ export type Spine = SpineItem[]
123
123
 
124
- interface Metadata {
124
+ export interface Metadata {
125
125
  title: string
126
126
  creator: string
127
127
  date: string
@@ -132,7 +132,7 @@ interface Metadata {
132
132
  identifier: string
133
133
  }
134
134
 
135
- interface NavigationFooterProps {
135
+ export interface NavigationFooterProps {
136
136
  uiOptions: UiOptions
137
137
  currentSpineItemIndex: number
138
138
  spine: Spine
@@ -149,28 +149,34 @@ interface NavigationFooterProps {
149
149
  goToNextPage: () => void
150
150
  }
151
151
 
152
- interface SidebarChaptersProps {
152
+ export interface SidebarChaptersProps {
153
153
  showSidebar: SidebarName | null
154
154
  spine: Spine
155
155
  currentSpineItemIndex: number
156
156
  navigateToChapterByURL: (url: string) => void
157
157
  }
158
158
 
159
- interface SidebarDownloadsProps {
159
+ export interface SidebarDownloadsProps {
160
160
  showSidebar: SidebarName | null
161
161
  downloads: Download[]
162
162
  }
163
163
 
164
- interface SidebarMetadataProps {
164
+ export interface SidebarMetadataProps {
165
165
  showSidebar: SidebarName | null
166
166
  metadata: Metadata
167
167
  }
168
168
 
169
169
  // interface SidebarSettingsProps {}
170
170
 
171
- type UiReaderProp<T> = React.Component<T> | ((props: T) => JSX.Element)
171
+ export type UiReaderProp<T> = React.Component<T> | ((props: T) => JSX.Element)
172
+
173
+ export type LocationState = 'memory' | 'localStorage' | 'queryParams'
174
+
175
+ export type KeysValues<T> = { [P in keyof T]: T[P] }
172
176
 
173
- interface OptionalBberReaderProps {
177
+ export type SearchParams = string | KeysValues<BberReaderQueryParameterKeys>
178
+
179
+ export interface OptionalBberReaderProps {
174
180
  bookURL?: string
175
181
  manifestURL?: string
176
182
  projectURL?: string
@@ -181,7 +187,7 @@ interface OptionalBberReaderProps {
181
187
  uiOptions?: UI
182
188
  cache?: boolean
183
189
  layout?: Layout
184
- paramKeys?: BberReaderQueryParameterKeys
190
+ searchParamKeys?: BberReaderQueryParameterKeys
185
191
  disableBodyStyles?: boolean
186
192
 
187
193
  NavigationHeader?: UiReaderProp<NavigationHeaderProps>
@@ -190,6 +196,9 @@ interface OptionalBberReaderProps {
190
196
  SidebarDownloads?: UiReaderProp<SidebarDownloadsProps>
191
197
  SidebarMetadata?: UiReaderProp<SidebarMetadataProps>
192
198
  // SidebarSettings?: UiReaderProp<SidebarSettingsProps>
199
+
200
+ locationState?: LocationState
201
+ searchParams?: SearchParams
193
202
  }
194
203
 
195
204
  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.34+6c3b29b6",
3
+ "version": "1.2.13-react-reader.44+d9708544",
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": "6c3b29b6127c7aaecad7ff038b6d67d2cba7898f"
125
+ "gitHead": "d970854461f12ab332ea8541ed99c5c3a56e3275"
125
126
  }