react-native-readium 1.0.0-alpha.9 → 1.0.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 +21 -4
- package/android/build.gradle +1 -9
- package/android/src/main/java/com/reactnativereadium/epub/UserSettings.kt +16 -0
- package/android/src/main/java/com/reactnativereadium/reader/ReaderViewModel.kt +1 -1
- package/ios/ReadiumView.swift +7 -0
- package/lib/commonjs/components/BaseReadiumView.js.map +1 -1
- package/lib/commonjs/components/ReadiumView.js +1 -1
- package/lib/commonjs/components/ReadiumView.js.map +1 -1
- package/lib/commonjs/enums/Appearance.js.map +1 -1
- package/lib/commonjs/enums/ColumnCount.js.map +1 -1
- package/lib/commonjs/enums/FontFamily.js.map +1 -1
- package/lib/commonjs/enums/TextAlignment.js.map +1 -1
- package/lib/commonjs/enums/index.js.map +1 -1
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/interfaces/Dimensions.js.map +1 -1
- package/lib/commonjs/interfaces/File.js.map +1 -1
- package/lib/commonjs/interfaces/Link.js.map +1 -1
- package/lib/commonjs/interfaces/Locator.js.map +1 -1
- package/lib/commonjs/interfaces/Settings.js.map +1 -1
- package/lib/commonjs/interfaces/index.js.map +1 -1
- package/lib/commonjs/utils/COMPONENT_NAME.js.map +1 -1
- package/lib/commonjs/utils/LINKING_ERROR.js.map +1 -1
- package/lib/commonjs/utils/RANGES.js.map +1 -1
- package/lib/commonjs/utils/clamp.js.map +1 -1
- package/lib/commonjs/utils/createFragment.js.map +1 -1
- package/lib/commonjs/utils/getWidthOrHeightValue.js.map +1 -1
- package/lib/commonjs/utils/index.js.map +1 -1
- package/lib/commonjs/utils/indexOfObjectValue.js.map +1 -1
- package/lib/module/components/BaseReadiumView.js.map +1 -1
- package/lib/module/components/ReadiumView.js +1 -1
- package/lib/module/components/ReadiumView.js.map +1 -1
- package/lib/module/enums/Appearance.js.map +1 -1
- package/lib/module/enums/ColumnCount.js.map +1 -1
- package/lib/module/enums/FontFamily.js.map +1 -1
- package/lib/module/enums/TextAlignment.js.map +1 -1
- package/lib/module/enums/index.js.map +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/interfaces/Dimensions.js.map +1 -1
- package/lib/module/interfaces/File.js.map +1 -1
- package/lib/module/interfaces/Link.js.map +1 -1
- package/lib/module/interfaces/Locator.js.map +1 -1
- package/lib/module/interfaces/Settings.js.map +1 -1
- package/lib/module/interfaces/index.js.map +1 -1
- package/lib/module/utils/COMPONENT_NAME.js.map +1 -1
- package/lib/module/utils/LINKING_ERROR.js.map +1 -1
- package/lib/module/utils/RANGES.js.map +1 -1
- package/lib/module/utils/clamp.js.map +1 -1
- package/lib/module/utils/createFragment.js.map +1 -1
- package/lib/module/utils/getWidthOrHeightValue.js.map +1 -1
- package/lib/module/utils/index.js.map +1 -1
- package/lib/module/utils/indexOfObjectValue.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -63,10 +63,10 @@ platform :ios, '13.0'
|
|
|
63
63
|
target 'ExampleApp' do
|
|
64
64
|
config = use_native_modules!
|
|
65
65
|
...
|
|
66
|
-
pod 'GCDWebServer', podspec: 'https://raw.githubusercontent.com/readium/GCDWebServer/
|
|
67
|
-
pod 'R2Shared', podspec: 'https://raw.githubusercontent.com/readium/swift-toolkit/2.
|
|
68
|
-
pod 'R2Streamer', podspec: 'https://raw.githubusercontent.com/readium/swift-toolkit/2.
|
|
69
|
-
pod 'R2Navigator', podspec: 'https://raw.githubusercontent.com/readium/swift-toolkit/2.
|
|
66
|
+
pod 'GCDWebServer', podspec: 'https://raw.githubusercontent.com/readium/GCDWebServer/3ec154d358f26858071feaa6429e0f1c16bb11bd/GCDWebServer.podspec', modular_headers: true
|
|
67
|
+
pod 'R2Shared', podspec: 'https://raw.githubusercontent.com/readium/swift-toolkit/2.4.0/Support/CocoaPods/ReadiumShared.podspec'
|
|
68
|
+
pod 'R2Streamer', podspec: 'https://raw.githubusercontent.com/readium/swift-toolkit/2.4.0/Support/CocoaPods/ReadiumStreamer.podspec'
|
|
69
|
+
pod 'R2Navigator', podspec: 'https://raw.githubusercontent.com/readium/swift-toolkit/2.4.0/Support/CocoaPods/ReadiumNavigator.podspec'
|
|
70
70
|
pod 'Minizip', modular_headers: true
|
|
71
71
|
...
|
|
72
72
|
end
|
|
@@ -78,6 +78,23 @@ Finally, install the pods:
|
|
|
78
78
|
|
|
79
79
|
#### Android
|
|
80
80
|
|
|
81
|
+
You might need to [add `jcenter` if you're getting a build failure on android](https://github.com/readium/kotlin-toolkit/issues/31):
|
|
82
|
+
|
|
83
|
+
```groovy
|
|
84
|
+
// android/build.gradle
|
|
85
|
+
...
|
|
86
|
+
|
|
87
|
+
allprojects {
|
|
88
|
+
repositories {
|
|
89
|
+
...
|
|
90
|
+
// required by react-native-readium https://github.com/readium/kotlin-toolkit/issues/31
|
|
91
|
+
jcenter()
|
|
92
|
+
}
|
|
93
|
+
...
|
|
94
|
+
}
|
|
95
|
+
...
|
|
96
|
+
```
|
|
97
|
+
|
|
81
98
|
If you're not using `compileSdkVersion` >= 31 you'll need to update that:
|
|
82
99
|
|
|
83
100
|
```groovy
|
package/android/build.gradle
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
buildscript {
|
|
2
2
|
// Buildscript is evaluated before everything else so we can't use getExtOrDefault
|
|
3
3
|
def kotlin_version = rootProject.ext.has('kotlinVersion') ? rootProject.ext.get('kotlinVersion') : project.properties['Readium_kotlinVersion']
|
|
4
|
-
ext.readium_version = '2.
|
|
4
|
+
ext.readium_version = '2.2.1'
|
|
5
5
|
|
|
6
6
|
repositories {
|
|
7
7
|
google()
|
|
@@ -165,14 +165,6 @@ dependencies {
|
|
|
165
165
|
implementation "androidx.recyclerview:recyclerview:1.2.1"
|
|
166
166
|
implementation "androidx.viewpager2:viewpager2:1.0.0"
|
|
167
167
|
implementation "androidx.webkit:webkit:1.4.0"
|
|
168
|
-
//noinspection GradleDependency
|
|
169
|
-
implementation ("com.github.edrlab.nanohttpd:nanohttpd:master-SNAPSHOT") {
|
|
170
|
-
exclude group: 'org.parboiled'
|
|
171
|
-
}
|
|
172
|
-
//noinspection GradleDependency
|
|
173
|
-
implementation ("com.github.edrlab.nanohttpd:nanohttpd-nanolets:master-SNAPSHOT") {
|
|
174
|
-
exclude group: 'org.parboiled'
|
|
175
|
-
}
|
|
176
168
|
implementation "com.google.android.material:material:1.4.0"
|
|
177
169
|
implementation "com.jakewharton.timber:timber:4.7.1"
|
|
178
170
|
// AM NOTE: needs to stay this version for now (June 24,2020)
|
|
@@ -2,6 +2,7 @@ package com.reactnativereadium.epub
|
|
|
2
2
|
|
|
3
3
|
import android.content.Context
|
|
4
4
|
import android.content.SharedPreferences
|
|
5
|
+
import android.graphics.Color
|
|
5
6
|
import androidx.appcompat.app.AppCompatActivity
|
|
6
7
|
import org.json.JSONArray
|
|
7
8
|
import org.readium.r2.navigator.R2BasicWebView
|
|
@@ -79,6 +80,21 @@ class UserSettings(
|
|
|
79
80
|
is Switchable -> updateSwitchableFromKeyValue(property, key, value)
|
|
80
81
|
}
|
|
81
82
|
|
|
83
|
+
// update the resourcePager background to match the newly selected theme
|
|
84
|
+
if (isPropertyModified && property is Enumerable && property.ref == APPEARANCE_REF) {
|
|
85
|
+
when (property.index) {
|
|
86
|
+
0 -> {
|
|
87
|
+
resourcePager.setBackgroundColor(Color.parseColor("#ffffff"))
|
|
88
|
+
}
|
|
89
|
+
1 -> {
|
|
90
|
+
resourcePager.setBackgroundColor(Color.parseColor("#faf4e8"))
|
|
91
|
+
}
|
|
92
|
+
2 -> {
|
|
93
|
+
resourcePager.setBackgroundColor(Color.parseColor("#000000"))
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
82
98
|
// apply the changes to the view
|
|
83
99
|
if (isPropertyModified) {
|
|
84
100
|
updateViewCSS(key)
|
|
@@ -94,7 +94,7 @@ class ReaderViewModel(
|
|
|
94
94
|
private val publication: Publication,
|
|
95
95
|
private val initialLocation: Locator?
|
|
96
96
|
) : ViewModelProvider.NewInstanceFactory() {
|
|
97
|
-
override fun <T : ViewModel
|
|
97
|
+
override fun <T : ViewModel> create(modelClass: Class<T>): T =
|
|
98
98
|
modelClass
|
|
99
99
|
.getDeclaredConstructor(
|
|
100
100
|
Publication::class.java,
|
package/ios/ReadiumView.swift
CHANGED
|
@@ -100,6 +100,13 @@ class ReadiumView : UIView, Loggable {
|
|
|
100
100
|
|
|
101
101
|
if let e = property as? Enumerable {
|
|
102
102
|
e.index = value as! Int
|
|
103
|
+
|
|
104
|
+
// synchronize background color
|
|
105
|
+
if property.reference == ReadiumCSSReference.appearance.rawValue {
|
|
106
|
+
if let vc = readerViewController as? EPUBViewController {
|
|
107
|
+
vc.setUIColor(for: property)
|
|
108
|
+
}
|
|
109
|
+
}
|
|
103
110
|
} else if let i = property as? Incrementable {
|
|
104
111
|
i.value = value as! Float
|
|
105
112
|
} else if let s = property as? Switchable {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["BaseReadiumView","UIManager","getViewManagerConfig","COMPONENT_NAME","requireNativeComponent","Error","LINKING_ERROR"],"sources":["BaseReadiumView.tsx"],"sourcesContent":["import {\n requireNativeComponent,\n UIManager,\n ViewStyle,\n} from 'react-native';\n\nimport type { Settings, Link, Locator, File, } from '../interfaces';\nimport { COMPONENT_NAME, LINKING_ERROR } from '../utils';\n\nexport type BaseReadiumViewProps = {\n file: File;\n location?: Locator;\n settings?: Partial<Settings>;\n style?: ViewStyle;\n onLocationChange?: (locator: Locator) => void;\n onTableOfContents?: (toc: Link[] | null) => void;\n ref?: any;\n height?: number;\n width?: number;\n};\n\nexport const BaseReadiumView =\n UIManager.getViewManagerConfig(COMPONENT_NAME) != null\n ? requireNativeComponent<BaseReadiumViewProps>(COMPONENT_NAME)\n : () => {\n throw new Error(LINKING_ERROR);\n };\n"],"mappings":";;;;;;;AAAA;;AAOA;;AAcO,MAAMA,eAAe,GAC1BC,sBAAA,CAAUC,oBAAV,CAA+BC,qBAA/B,KAAkD,IAAlD,GACI,IAAAC,mCAAA,EAA6CD,qBAA7C,CADJ,GAEI,MAAM;EACJ,MAAM,IAAIE,KAAJ,CAAUC,oBAAV,CAAN;AACD,CALA"}
|
|
@@ -19,7 +19,7 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
19
19
|
|
|
20
20
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
21
21
|
|
|
22
|
-
function _extends() { _extends = Object.assign
|
|
22
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
23
23
|
|
|
24
24
|
const ReadiumView = _ref => {
|
|
25
25
|
let {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["ReadiumView","onLocationChange","wrappedOnLocationChange","onTableOfContents","wrappedOnTableOfContents","settings","unmappedSettings","props","ref","useRef","height","width","setDimensions","useState","onLayout","useCallback","nativeEvent","layout","dimension","event","toc","useEffect","Platform","OS","viewId","findNodeHandle","current","createFragment","styles","container","Settings","map","undefined","StyleSheet","create"],"sources":["ReadiumView.tsx"],"sourcesContent":["import React, { useCallback, useState, useRef, useEffect } from 'react';\nimport { View, Platform, findNodeHandle, StyleSheet } from 'react-native';\n\nimport type { Dimensions } from '../interfaces';\nimport { Settings } from '../interfaces';\nimport { createFragment, getWidthOrHeightValue as dimension } from '../utils';\nimport type { BaseReadiumViewProps } from './BaseReadiumView';\nimport { BaseReadiumView } from './BaseReadiumView';\n\ntype ReadiumProps = BaseReadiumViewProps;\n\nexport const ReadiumView: React.FC<ReadiumProps> = ({\n onLocationChange: wrappedOnLocationChange,\n onTableOfContents: wrappedOnTableOfContents,\n settings: unmappedSettings,\n ...props\n}) => {\n const ref = useRef(null);\n const [{ height, width }, setDimensions] = useState<Dimensions>({\n width: 0,\n height: 0,\n });\n // set the view dimensions on layout\n const onLayout = useCallback(({ nativeEvent: { layout: { width, height } }}) => {\n setDimensions({\n width: dimension(width),\n height: dimension(height),\n });\n }, []);\n // wrap the native onLocationChange and extract the raw event value\n const onLocationChange = useCallback((event: any) => {\n if (wrappedOnLocationChange) {\n wrappedOnLocationChange(event.nativeEvent);\n }\n }, [wrappedOnLocationChange]);\n\n const onTableOfContents = useCallback((event: any) => {\n if (wrappedOnTableOfContents) {\n const toc = event.nativeEvent.toc || null;\n wrappedOnTableOfContents(toc);\n }\n }, [wrappedOnTableOfContents]);\n\n useEffect(() => {\n if (Platform.OS === 'android') {\n const viewId = findNodeHandle(ref.current);\n createFragment(viewId);\n }\n }, [])\n\n return (\n <View\n style={styles.container}\n onLayout={onLayout}\n >\n <BaseReadiumView\n height={height}\n width={width}\n {...props}\n onLocationChange={onLocationChange}\n onTableOfContents={onTableOfContents}\n settings={unmappedSettings ? Settings.map(unmappedSettings) : undefined}\n ref={ref}\n />\n </View>\n );\n};\n\nconst styles = StyleSheet.create({\n container: { width: '100%', height: '100%' },\n});\n"],"mappings":";;;;;;;AAAA;;AACA;;AAGA;;AACA;;AAEA;;;;;;;;AAIO,MAAMA,WAAmC,GAAG,QAK7C;EAAA,IAL8C;IAClDC,gBAAgB,EAAEC,uBADgC;IAElDC,iBAAiB,EAAEC,wBAF+B;IAGlDC,QAAQ,EAAEC,gBAHwC;IAIlD,GAAGC;EAJ+C,CAK9C;EACJ,MAAMC,GAAG,GAAG,IAAAC,aAAA,EAAO,IAAP,CAAZ;EACA,MAAM,CAAC;IAAEC,MAAF;IAAUC;EAAV,CAAD,EAAoBC,aAApB,IAAqC,IAAAC,eAAA,EAAqB;IAC9DF,KAAK,EAAE,CADuD;IAE9DD,MAAM,EAAE;EAFsD,CAArB,CAA3C,CAFI,CAMJ;;EACA,MAAMI,QAAQ,GAAG,IAAAC,kBAAA,EAAY,SAAmD;IAAA,IAAlD;MAAEC,WAAW,EAAE;QAAEC,MAAM,EAAE;UAAEN,KAAF;UAASD;QAAT;MAAV;IAAf,CAAkD;IAC9EE,aAAa,CAAC;MACZD,KAAK,EAAE,IAAAO,4BAAA,EAAUP,KAAV,CADK;MAEZD,MAAM,EAAE,IAAAQ,4BAAA,EAAUR,MAAV;IAFI,CAAD,CAAb;EAID,CALgB,EAKd,EALc,CAAjB,CAPI,CAaJ;;EACA,MAAMT,gBAAgB,GAAG,IAAAc,kBAAA,EAAaI,KAAD,IAAgB;IACnD,IAAIjB,uBAAJ,EAA6B;MAC3BA,uBAAuB,CAACiB,KAAK,CAACH,WAAP,CAAvB;IACD;EACF,CAJwB,EAItB,CAACd,uBAAD,CAJsB,CAAzB;EAMA,MAAMC,iBAAiB,GAAG,IAAAY,kBAAA,EAAaI,KAAD,IAAgB;IACpD,IAAIf,wBAAJ,EAA8B;MAC5B,MAAMgB,GAAG,GAAGD,KAAK,CAACH,WAAN,CAAkBI,GAAlB,IAAyB,IAArC;MACAhB,wBAAwB,CAACgB,GAAD,CAAxB;IACD;EACF,CALyB,EAKvB,CAAChB,wBAAD,CALuB,CAA1B;EAOA,IAAAiB,gBAAA,EAAU,MAAM;IACd,IAAIC,qBAAA,CAASC,EAAT,KAAgB,SAApB,EAA+B;MAC7B,MAAMC,MAAM,GAAG,IAAAC,2BAAA,EAAejB,GAAG,CAACkB,OAAnB,CAAf;MACA,IAAAC,qBAAA,EAAeH,MAAf;IACD;EACF,CALD,EAKG,EALH;EAOA,oBACE,6BAAC,iBAAD;IACE,KAAK,EAAEI,MAAM,CAACC,SADhB;IAEE,QAAQ,EAAEf;EAFZ,gBAIE,6BAAC,gCAAD;IACE,MAAM,EAAEJ,MADV;IAEE,KAAK,EAAEC;EAFT,GAGMJ,KAHN;IAIE,gBAAgB,EAAEN,gBAJpB;IAKE,iBAAiB,EAAEE,iBALrB;IAME,QAAQ,EAAEG,gBAAgB,GAAGwB,oBAAA,CAASC,GAAT,CAAazB,gBAAb,CAAH,GAAoC0B,SANhE;IAOE,GAAG,EAAExB;EAPP,GAJF,CADF;AAgBD,CAvDM;;;;AAyDP,MAAMoB,MAAM,GAAGK,uBAAA,CAAWC,MAAX,CAAkB;EAC/BL,SAAS,EAAE;IAAElB,KAAK,EAAE,MAAT;IAAiBD,MAAM,EAAE;EAAzB;AADoB,CAAlB,CAAf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["Appearance"],"sources":["Appearance.ts"],"sourcesContent":["// NOTE: readium uses an index so the order is very important here\nexport enum Appearance {\n /**\n * A traditional \"light\" mode\n */\n DEFAULT = 'readium-default-on',\n\n SEPIA = 'readium-sepia-on',\n\n /**\n * A traditional \"dark\" mode\n */\n NIGHT = 'readium-night-on',\n}\n"],"mappings":";;;;;;AAAA;IACYA,U;;;WAAAA,U;EAAAA,U;EAAAA,U;EAAAA,U;GAAAA,U,0BAAAA,U"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["ColumnCount"],"sources":["ColumnCount.ts"],"sourcesContent":["// NOTE: readium uses an index so the order is very important here\nexport enum ColumnCount {\n AUTO = 'auto',\n ONE = '1',\n TWO = '2',\n}\n"],"mappings":";;;;;;AAAA;IACYA,W;;;WAAAA,W;EAAAA,W;EAAAA,W;EAAAA,W;GAAAA,W,2BAAAA,W"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["FontFamily"],"sources":["FontFamily.ts"],"sourcesContent":["// NOTE: readium uses an index so the order is very important here\nexport enum FontFamily {\n ORIGINAL = 'Original',\n HELVETICA_NEUE = 'Helvetica Neue',\n IOWAN_OLD_STYLE = 'Iowan Old Style',\n ATHELAS = 'Athelas',\n SERAVEK = 'Seravek',\n OPEN_DYSLEXIC = 'OpenDyslexic',\n ACCESSIBLE_DFA = 'AccessibleDfA',\n IA_WRITER_DUOSPACE = 'IA Writer Duospace',\n}\n"],"mappings":";;;;;;AAAA;IACYA,U;;;WAAAA,U;EAAAA,U;EAAAA,U;EAAAA,U;EAAAA,U;EAAAA,U;EAAAA,U;EAAAA,U;EAAAA,U;GAAAA,U,0BAAAA,U"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["TextAlignment"],"sources":["TextAlignment.ts"],"sourcesContent":["// NOTE: readium uses an index so the order is very important here\nexport enum TextAlignment {\n JUSTIFY = 'justify',\n START = 'start',\n}\n"],"mappings":";;;;;;AAAA;IACYA,a;;;WAAAA,a;EAAAA,a;EAAAA,a;GAAAA,a,6BAAAA,a"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["index.ts"],"
|
|
1
|
+
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from './Appearance';\nexport * from './ColumnCount';\nexport * from './FontFamily';\nexport * from './TextAlignment';\n"],"mappings":";;;;;;AAAA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":[],"sources":["index.tsx"],"sourcesContent":["export * from './enums';\nexport * from './interfaces';\nexport { RANGES } from './utils';\nexport * from './components/ReadiumView';\n"],"mappings":";;;;;;;;;;;;;;;AAAA;;AAAA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AACA;;AAAA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":[],"sources":["Dimensions.ts"],"sourcesContent":["export interface Dimensions {\n width: number;\n height: number;\n}\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":[],"sources":["File.ts"],"sourcesContent":["import type { Locator } from './Locator';\n\n\nexport interface File {\n /**\n * A string path to an eBook on disk.\n */\n url: string;\n\n /**\n * An optional location that the eBook will be opened at.\n */\n initialLocation?: Locator;\n}\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":[],"sources":["Link.ts"],"sourcesContent":["/**\n * An interface representing the Readium Link object.\n */\nexport interface Link {\n href: string;\n templated: boolean;\n type?: string | null;\n title?: string | null;\n rels?: Set<string>;\n properties?: any;\n height?: number | null;\n width?: number | null;\n bitrate?: number | null;\n duration?: number | null;\n languages?: string[];\n alternates?: Link[];\n children?: Link[];\n}\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":[],"sources":["Locator.ts"],"sourcesContent":["/**\n * An interface representing the Readium Locator object.\n */\nexport interface Locator {\n href: string;\n type: string;\n target?: number;\n title?: string;\n locations?: {\n progression: number;\n position?: number;\n totalProgression?: number;\n };\n}\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["Settings","Appearance","DEFAULT","FontFamily","ORIGINAL","TextAlignment","JUSTIFY","ColumnCount","AUTO","map","settings","defaultValues","mapped","Object","keys","forEach","key","undefined","appearance","indexOfObjectValue","fontFamily","textAlign","colCount","RANGES","clamp"],"sources":["Settings.ts"],"sourcesContent":["import {\n Appearance,\n FontFamily,\n TextAlignment,\n ColumnCount,\n} from '../enums';\n\nimport {\n RANGES,\n indexOfObjectValue,\n clamp,\n} from '../utils';\n\n/**\n * A reader settings object with sensible defaults.\n */\nexport class Settings {\n // TODO:\n // - ligatures\n // - paraIndent\n appearance: Appearance = Appearance.DEFAULT;\n fontFamily: FontFamily = FontFamily.ORIGINAL;\n textAlign: TextAlignment = TextAlignment.JUSTIFY;\n colCount: ColumnCount = ColumnCount.AUTO;\n\n scroll: boolean = false;\n fontOverride: boolean = false;\n verticalScroll: boolean = false;\n bodyHyphens: boolean = false;\n advancedSettings: boolean = true;\n\n /**\n * Range: 100.0 - 300.0\n */\n fontSize: number = 100;\n\n /**\n * Range: 0.0 - 0.5\n */\n wordSpacing: number = 0;\n\n /**\n * Range: 0.0 - 0.5\n */\n letterSpacing: number = 0;\n\n /**\n * Range: 0.5 - 4.0\n */\n pageMargins: number = 0;\n\n /**\n * Range: 1.0 - 2.0\n */\n lineHeight: number = 1;\n\n /**\n * Range: 0.0 - 2.0\n */\n paragraphMargins?: number = 0;\n\n static map(settings: Partial<Settings>): any {\n const defaultValues = new Settings();\n const mapped: Record<string, any> = {};\n\n Object.keys(defaultValues)\n .forEach((key: string) => {\n // @ts-ignore\n mapped[key] = settings[key] !== undefined ? settings[key] : defaultValues[key];\n })\n ;\n\n mapped.appearance = indexOfObjectValue(Appearance, mapped.appearance);\n mapped.fontFamily = indexOfObjectValue(FontFamily, mapped.fontFamily);\n mapped.textAlign = indexOfObjectValue(TextAlignment, mapped.textAlign);\n mapped.colCount = indexOfObjectValue(ColumnCount, mapped.colCount);\n\n Object.keys(RANGES).forEach((key: string) => {\n // @ts-ignore\n mapped[key] = clamp(mapped[key], RANGES[key][0], RANGES[key][1]);\n });\n\n return mapped;\n }\n}\n"],"mappings":";;;;;;;AAAA;;AAOA;;;;AAMA;AACA;AACA;AACO,MAAMA,QAAN,CAAe;EAAA;IAAA,oCAIKC,iBAAA,CAAWC,OAJhB;;IAAA,oCAKKC,iBAAA,CAAWC,QALhB;;IAAA,mCAMOC,oBAAA,CAAcC,OANrB;;IAAA,kCAOIC,kBAAA,CAAYC,IAPhB;;IAAA,gCASF,KATE;;IAAA,sCAUI,KAVJ;;IAAA,wCAWM,KAXN;;IAAA,qCAYG,KAZH;;IAAA,0CAaQ,IAbR;;IAAA,kCAkBD,GAlBC;;IAAA,qCAuBE,CAvBF;;IAAA,uCA4BI,CA5BJ;;IAAA,qCAiCE,CAjCF;;IAAA,oCAsCC,CAtCD;;IAAA,0CA2CQ,CA3CR;EAAA;;EA6CV,OAAHC,GAAG,CAACC,QAAD,EAAmC;IAC3C,MAAMC,aAAa,GAAG,IAAIX,QAAJ,EAAtB;IACA,MAAMY,MAA2B,GAAG,EAApC;IAEAC,MAAM,CAACC,IAAP,CAAYH,aAAZ,EACGI,OADH,CACYC,GAAD,IAAiB;MACxB;MACAJ,MAAM,CAACI,GAAD,CAAN,GAAcN,QAAQ,CAACM,GAAD,CAAR,KAAkBC,SAAlB,GAA8BP,QAAQ,CAACM,GAAD,CAAtC,GAA8CL,aAAa,CAACK,GAAD,CAAzE;IACD,CAJH;IAOAJ,MAAM,CAACM,UAAP,GAAoB,IAAAC,yBAAA,EAAmBlB,iBAAnB,EAA+BW,MAAM,CAACM,UAAtC,CAApB;IACAN,MAAM,CAACQ,UAAP,GAAoB,IAAAD,yBAAA,EAAmBhB,iBAAnB,EAA+BS,MAAM,CAACQ,UAAtC,CAApB;IACAR,MAAM,CAACS,SAAP,GAAmB,IAAAF,yBAAA,EAAmBd,oBAAnB,EAAkCO,MAAM,CAACS,SAAzC,CAAnB;IACAT,MAAM,CAACU,QAAP,GAAkB,IAAAH,yBAAA,EAAmBZ,kBAAnB,EAAgCK,MAAM,CAACU,QAAvC,CAAlB;IAEAT,MAAM,CAACC,IAAP,CAAYS,aAAZ,EAAoBR,OAApB,CAA6BC,GAAD,IAAiB;MAC3C;MACAJ,MAAM,CAACI,GAAD,CAAN,GAAc,IAAAQ,YAAA,EAAMZ,MAAM,CAACI,GAAD,CAAZ,EAAmBO,aAAA,CAAOP,GAAP,EAAY,CAAZ,CAAnB,EAAmCO,aAAA,CAAOP,GAAP,EAAY,CAAZ,CAAnC,CAAd;IACD,CAHD;IAKA,OAAOJ,MAAP;EACD;;AAnEmB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["index.ts"],"
|
|
1
|
+
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from './Dimensions';\nexport * from './File';\nexport * from './Link';\nexport * from './Locator';\nexport * from './Settings';\n"],"mappings":";;;;;;AAAA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["COMPONENT_NAME"],"sources":["COMPONENT_NAME.ts"],"sourcesContent":["export const COMPONENT_NAME = 'ReadiumView';\n"],"mappings":";;;;;;AAAO,MAAMA,cAAc,GAAG,aAAvB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["LINKING_ERROR","Platform","select","ios","default"],"sources":["LINKING_ERROR.ts"],"sourcesContent":["import { Platform } from 'react-native';\n\nexport const LINKING_ERROR =\n `The package 'react-native-readium' doesn't seem to be linked. Make sure: \\n\\n` +\n Platform.select({ ios: \"- You have run 'pod install'\\n\", default: '' }) +\n '- You rebuilt the app after installing the package\\n' +\n '- You are not using Expo managed workflow\\n';\n"],"mappings":";;;;;;;AAAA;;AAEO,MAAMA,aAAa,GACvB,+EAAD,GACAC,qBAAA,CAASC,MAAT,CAAgB;EAAEC,GAAG,EAAE,gCAAP;EAAyCC,OAAO,EAAE;AAAlD,CAAhB,CADA,GAEA,sDAFA,GAGA,6CAJK"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["RANGES","fontSize","wordSpacing","letterSpacing","pageMargins","lineHeight","paragraphMargins"],"sources":["RANGES.ts"],"sourcesContent":["export const RANGES = {\n fontSize: [100.0, 300.0],\n wordSpacing: [0.0, 0.5],\n letterSpacing: [0.0, 0.5],\n pageMargins: [0.5, 4.0],\n lineHeight: [1.0, 2.0],\n paragraphMargins: [0.0, 2.0],\n};\n"],"mappings":";;;;;;AAAO,MAAMA,MAAM,GAAG;EACpBC,QAAQ,EAAU,CAAC,KAAD,EAAQ,KAAR,CADE;EAEpBC,WAAW,EAAO,CAAC,GAAD,EAAM,GAAN,CAFE;EAGpBC,aAAa,EAAK,CAAC,GAAD,EAAM,GAAN,CAHE;EAIpBC,WAAW,EAAO,CAAC,GAAD,EAAM,GAAN,CAJE;EAKpBC,UAAU,EAAQ,CAAC,GAAD,EAAM,GAAN,CALE;EAMpBC,gBAAgB,EAAE,CAAC,GAAD,EAAM,GAAN;AANE,CAAf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["clamp","val","lower","upper"],"sources":["clamp.ts"],"sourcesContent":["export const clamp = (val: number, lower: number, upper: number): number => {\n if (val < lower) return lower;\n if (val > upper) return upper;\n return val;\n}\n"],"mappings":";;;;;;;AAAO,MAAMA,KAAK,GAAG,CAACC,GAAD,EAAcC,KAAd,EAA6BC,KAA7B,KAAuD;EAC1E,IAAIF,GAAG,GAAGC,KAAV,EAAiB,OAAOA,KAAP;EACjB,IAAID,GAAG,GAAGE,KAAV,EAAiB,OAAOA,KAAP;EACjB,OAAOF,GAAP;AACD,CAJM"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["createFragment","viewId","UIManager","dispatchViewManagerCommand","getViewManagerConfig","COMPONENT_NAME","Commands","create","toString"],"sources":["createFragment.ts"],"sourcesContent":["import { UIManager } from 'react-native';\n\nimport { COMPONENT_NAME } from './COMPONENT_NAME';\n\nexport const createFragment = (viewId: number | null) => {\n if (viewId !== null) {\n UIManager.dispatchViewManagerCommand(\n viewId,\n // we are calling the 'create' command\n // @ts-ignore\n UIManager.getViewManagerConfig(COMPONENT_NAME).Commands.create.toString(),\n [viewId],\n );\n }\n}\n"],"mappings":";;;;;;;AAAA;;AAEA;;AAEO,MAAMA,cAAc,GAAIC,MAAD,IAA2B;EACvD,IAAIA,MAAM,KAAK,IAAf,EAAqB;IACnBC,sBAAA,CAAUC,0BAAV,CACEF,MADF,EAEE;IACA;IACAC,sBAAA,CAAUE,oBAAV,CAA+BC,8BAA/B,EAA+CC,QAA/C,CAAwDC,MAAxD,CAA+DC,QAA/D,EAJF,EAKE,CAACP,MAAD,CALF;EAOD;AACF,CAVM"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["getWidthOrHeightValue","val","Platform","OS","PixelRatio","getPixelSizeForLayoutSize"],"sources":["getWidthOrHeightValue.ts"],"sourcesContent":["import { Platform, PixelRatio } from 'react-native';\n\nexport const getWidthOrHeightValue = (val: number) => {\n return Platform.OS === 'android' ? PixelRatio.getPixelSizeForLayoutSize(val) : val;\n}\n"],"mappings":";;;;;;;AAAA;;AAEO,MAAMA,qBAAqB,GAAIC,GAAD,IAAiB;EACpD,OAAOC,qBAAA,CAASC,EAAT,KAAgB,SAAhB,GAA4BC,uBAAA,CAAWC,yBAAX,CAAqCJ,GAArC,CAA5B,GAAwEA,GAA/E;AACD,CAFM"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["index.ts"],"
|
|
1
|
+
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from './clamp';\nexport * from './COMPONENT_NAME';\nexport * from './createFragment';\nexport * from './getWidthOrHeightValue';\nexport * from './indexOfObjectValue';\nexport * from './LINKING_ERROR';\nexport * from './RANGES';\n"],"mappings":";;;;;;AAAA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["indexOfObjectValue","obj","val","Object","values","indexOf"],"sources":["indexOfObjectValue.ts"],"sourcesContent":["export const indexOfObjectValue = (obj: any, val: any): number => {\n return Object.values(obj).indexOf(val);\n}\n"],"mappings":";;;;;;;AAAO,MAAMA,kBAAkB,GAAG,CAACC,GAAD,EAAWC,GAAX,KAAgC;EAChE,OAAOC,MAAM,CAACC,MAAP,CAAcH,GAAd,EAAmBI,OAAnB,CAA2BH,GAA3B,CAAP;AACD,CAFM"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["requireNativeComponent","UIManager","COMPONENT_NAME","LINKING_ERROR","BaseReadiumView","getViewManagerConfig","Error"],"sources":["BaseReadiumView.tsx"],"sourcesContent":["import {\n requireNativeComponent,\n UIManager,\n ViewStyle,\n} from 'react-native';\n\nimport type { Settings, Link, Locator, File, } from '../interfaces';\nimport { COMPONENT_NAME, LINKING_ERROR } from '../utils';\n\nexport type BaseReadiumViewProps = {\n file: File;\n location?: Locator;\n settings?: Partial<Settings>;\n style?: ViewStyle;\n onLocationChange?: (locator: Locator) => void;\n onTableOfContents?: (toc: Link[] | null) => void;\n ref?: any;\n height?: number;\n width?: number;\n};\n\nexport const BaseReadiumView =\n UIManager.getViewManagerConfig(COMPONENT_NAME) != null\n ? requireNativeComponent<BaseReadiumViewProps>(COMPONENT_NAME)\n : () => {\n throw new Error(LINKING_ERROR);\n };\n"],"mappings":"AAAA,SACEA,sBADF,EAEEC,SAFF,QAIO,cAJP;AAOA,SAASC,cAAT,EAAyBC,aAAzB,QAA8C,UAA9C;AAcA,OAAO,MAAMC,eAAe,GAC1BH,SAAS,CAACI,oBAAV,CAA+BH,cAA/B,KAAkD,IAAlD,GACIF,sBAAsB,CAAuBE,cAAvB,CAD1B,GAEI,MAAM;EACJ,MAAM,IAAII,KAAJ,CAAUH,aAAV,CAAN;AACD,CALA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
2
|
|
|
3
3
|
import React, { useCallback, useState, useRef, useEffect } from 'react';
|
|
4
4
|
import { View, Platform, findNodeHandle, StyleSheet } from 'react-native';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["React","useCallback","useState","useRef","useEffect","View","Platform","findNodeHandle","StyleSheet","Settings","createFragment","getWidthOrHeightValue","dimension","BaseReadiumView","ReadiumView","onLocationChange","wrappedOnLocationChange","onTableOfContents","wrappedOnTableOfContents","settings","unmappedSettings","props","ref","height","width","setDimensions","onLayout","nativeEvent","layout","event","toc","OS","viewId","current","styles","container","map","undefined","create"],"sources":["ReadiumView.tsx"],"sourcesContent":["import React, { useCallback, useState, useRef, useEffect } from 'react';\nimport { View, Platform, findNodeHandle, StyleSheet } from 'react-native';\n\nimport type { Dimensions } from '../interfaces';\nimport { Settings } from '../interfaces';\nimport { createFragment, getWidthOrHeightValue as dimension } from '../utils';\nimport type { BaseReadiumViewProps } from './BaseReadiumView';\nimport { BaseReadiumView } from './BaseReadiumView';\n\ntype ReadiumProps = BaseReadiumViewProps;\n\nexport const ReadiumView: React.FC<ReadiumProps> = ({\n onLocationChange: wrappedOnLocationChange,\n onTableOfContents: wrappedOnTableOfContents,\n settings: unmappedSettings,\n ...props\n}) => {\n const ref = useRef(null);\n const [{ height, width }, setDimensions] = useState<Dimensions>({\n width: 0,\n height: 0,\n });\n // set the view dimensions on layout\n const onLayout = useCallback(({ nativeEvent: { layout: { width, height } }}) => {\n setDimensions({\n width: dimension(width),\n height: dimension(height),\n });\n }, []);\n // wrap the native onLocationChange and extract the raw event value\n const onLocationChange = useCallback((event: any) => {\n if (wrappedOnLocationChange) {\n wrappedOnLocationChange(event.nativeEvent);\n }\n }, [wrappedOnLocationChange]);\n\n const onTableOfContents = useCallback((event: any) => {\n if (wrappedOnTableOfContents) {\n const toc = event.nativeEvent.toc || null;\n wrappedOnTableOfContents(toc);\n }\n }, [wrappedOnTableOfContents]);\n\n useEffect(() => {\n if (Platform.OS === 'android') {\n const viewId = findNodeHandle(ref.current);\n createFragment(viewId);\n }\n }, [])\n\n return (\n <View\n style={styles.container}\n onLayout={onLayout}\n >\n <BaseReadiumView\n height={height}\n width={width}\n {...props}\n onLocationChange={onLocationChange}\n onTableOfContents={onTableOfContents}\n settings={unmappedSettings ? Settings.map(unmappedSettings) : undefined}\n ref={ref}\n />\n </View>\n );\n};\n\nconst styles = StyleSheet.create({\n container: { width: '100%', height: '100%' },\n});\n"],"mappings":";;AAAA,OAAOA,KAAP,IAAgBC,WAAhB,EAA6BC,QAA7B,EAAuCC,MAAvC,EAA+CC,SAA/C,QAAgE,OAAhE;AACA,SAASC,IAAT,EAAeC,QAAf,EAAyBC,cAAzB,EAAyCC,UAAzC,QAA2D,cAA3D;AAGA,SAASC,QAAT,QAAyB,eAAzB;AACA,SAASC,cAAT,EAAyBC,qBAAqB,IAAIC,SAAlD,QAAmE,UAAnE;AAEA,SAASC,eAAT,QAAgC,mBAAhC;AAIA,OAAO,MAAMC,WAAmC,GAAG,QAK7C;EAAA,IAL8C;IAClDC,gBAAgB,EAAEC,uBADgC;IAElDC,iBAAiB,EAAEC,wBAF+B;IAGlDC,QAAQ,EAAEC,gBAHwC;IAIlD,GAAGC;EAJ+C,CAK9C;EACJ,MAAMC,GAAG,GAAGnB,MAAM,CAAC,IAAD,CAAlB;EACA,MAAM,CAAC;IAAEoB,MAAF;IAAUC;EAAV,CAAD,EAAoBC,aAApB,IAAqCvB,QAAQ,CAAa;IAC9DsB,KAAK,EAAE,CADuD;IAE9DD,MAAM,EAAE;EAFsD,CAAb,CAAnD,CAFI,CAMJ;;EACA,MAAMG,QAAQ,GAAGzB,WAAW,CAAC,SAAmD;IAAA,IAAlD;MAAE0B,WAAW,EAAE;QAAEC,MAAM,EAAE;UAAEJ,KAAF;UAASD;QAAT;MAAV;IAAf,CAAkD;IAC9EE,aAAa,CAAC;MACZD,KAAK,EAAEZ,SAAS,CAACY,KAAD,CADJ;MAEZD,MAAM,EAAEX,SAAS,CAACW,MAAD;IAFL,CAAD,CAAb;EAID,CAL2B,EAKzB,EALyB,CAA5B,CAPI,CAaJ;;EACA,MAAMR,gBAAgB,GAAGd,WAAW,CAAE4B,KAAD,IAAgB;IACnD,IAAIb,uBAAJ,EAA6B;MAC3BA,uBAAuB,CAACa,KAAK,CAACF,WAAP,CAAvB;IACD;EACF,CAJmC,EAIjC,CAACX,uBAAD,CAJiC,CAApC;EAMA,MAAMC,iBAAiB,GAAGhB,WAAW,CAAE4B,KAAD,IAAgB;IACpD,IAAIX,wBAAJ,EAA8B;MAC5B,MAAMY,GAAG,GAAGD,KAAK,CAACF,WAAN,CAAkBG,GAAlB,IAAyB,IAArC;MACAZ,wBAAwB,CAACY,GAAD,CAAxB;IACD;EACF,CALoC,EAKlC,CAACZ,wBAAD,CALkC,CAArC;EAOAd,SAAS,CAAC,MAAM;IACd,IAAIE,QAAQ,CAACyB,EAAT,KAAgB,SAApB,EAA+B;MAC7B,MAAMC,MAAM,GAAGzB,cAAc,CAACe,GAAG,CAACW,OAAL,CAA7B;MACAvB,cAAc,CAACsB,MAAD,CAAd;IACD;EACF,CALQ,EAKN,EALM,CAAT;EAOA,oBACE,oBAAC,IAAD;IACE,KAAK,EAAEE,MAAM,CAACC,SADhB;IAEE,QAAQ,EAAET;EAFZ,gBAIE,oBAAC,eAAD;IACE,MAAM,EAAEH,MADV;IAEE,KAAK,EAAEC;EAFT,GAGMH,KAHN;IAIE,gBAAgB,EAAEN,gBAJpB;IAKE,iBAAiB,EAAEE,iBALrB;IAME,QAAQ,EAAEG,gBAAgB,GAAGX,QAAQ,CAAC2B,GAAT,CAAahB,gBAAb,CAAH,GAAoCiB,SANhE;IAOE,GAAG,EAAEf;EAPP,GAJF,CADF;AAgBD,CAvDM;AAyDP,MAAMY,MAAM,GAAG1B,UAAU,CAAC8B,MAAX,CAAkB;EAC/BH,SAAS,EAAE;IAAEX,KAAK,EAAE,MAAT;IAAiBD,MAAM,EAAE;EAAzB;AADoB,CAAlB,CAAf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["Appearance"],"sources":["Appearance.ts"],"sourcesContent":["// NOTE: readium uses an index so the order is very important here\nexport enum Appearance {\n /**\n * A traditional \"light\" mode\n */\n DEFAULT = 'readium-default-on',\n\n SEPIA = 'readium-sepia-on',\n\n /**\n * A traditional \"dark\" mode\n */\n NIGHT = 'readium-night-on',\n}\n"],"mappings":"AAAA;AACA,WAAYA,UAAZ;;WAAYA,U;EAAAA,U;EAAAA,U;EAAAA,U;GAAAA,U,KAAAA,U"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["ColumnCount"],"sources":["ColumnCount.ts"],"sourcesContent":["// NOTE: readium uses an index so the order is very important here\nexport enum ColumnCount {\n AUTO = 'auto',\n ONE = '1',\n TWO = '2',\n}\n"],"mappings":"AAAA;AACA,WAAYA,WAAZ;;WAAYA,W;EAAAA,W;EAAAA,W;EAAAA,W;GAAAA,W,KAAAA,W"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["FontFamily"],"sources":["FontFamily.ts"],"sourcesContent":["// NOTE: readium uses an index so the order is very important here\nexport enum FontFamily {\n ORIGINAL = 'Original',\n HELVETICA_NEUE = 'Helvetica Neue',\n IOWAN_OLD_STYLE = 'Iowan Old Style',\n ATHELAS = 'Athelas',\n SERAVEK = 'Seravek',\n OPEN_DYSLEXIC = 'OpenDyslexic',\n ACCESSIBLE_DFA = 'AccessibleDfA',\n IA_WRITER_DUOSPACE = 'IA Writer Duospace',\n}\n"],"mappings":"AAAA;AACA,WAAYA,UAAZ;;WAAYA,U;EAAAA,U;EAAAA,U;EAAAA,U;EAAAA,U;EAAAA,U;EAAAA,U;EAAAA,U;EAAAA,U;GAAAA,U,KAAAA,U"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["TextAlignment"],"sources":["TextAlignment.ts"],"sourcesContent":["// NOTE: readium uses an index so the order is very important here\nexport enum TextAlignment {\n JUSTIFY = 'justify',\n START = 'start',\n}\n"],"mappings":"AAAA;AACA,WAAYA,aAAZ;;WAAYA,a;EAAAA,a;EAAAA,a;GAAAA,a,KAAAA,a"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from './Appearance';\nexport * from './ColumnCount';\nexport * from './FontFamily';\nexport * from './TextAlignment';\n"],"mappings":"AAAA,cAAc,cAAd;AACA,cAAc,eAAd;AACA,cAAc,cAAd;AACA,cAAc,iBAAd"}
|
package/lib/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["RANGES"],"sources":["index.tsx"],"sourcesContent":["export * from './enums';\nexport * from './interfaces';\nexport { RANGES } from './utils';\nexport * from './components/ReadiumView';\n"],"mappings":"AAAA,cAAc,SAAd;AACA,cAAc,cAAd;AACA,SAASA,MAAT,QAAuB,SAAvB;AACA,cAAc,0BAAd"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":[],"sources":["Dimensions.ts"],"sourcesContent":["export interface Dimensions {\n width: number;\n height: number;\n}\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":[],"sources":["File.ts"],"sourcesContent":["import type { Locator } from './Locator';\n\n\nexport interface File {\n /**\n * A string path to an eBook on disk.\n */\n url: string;\n\n /**\n * An optional location that the eBook will be opened at.\n */\n initialLocation?: Locator;\n}\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":[],"sources":["Link.ts"],"sourcesContent":["/**\n * An interface representing the Readium Link object.\n */\nexport interface Link {\n href: string;\n templated: boolean;\n type?: string | null;\n title?: string | null;\n rels?: Set<string>;\n properties?: any;\n height?: number | null;\n width?: number | null;\n bitrate?: number | null;\n duration?: number | null;\n languages?: string[];\n alternates?: Link[];\n children?: Link[];\n}\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":[],"sources":["Locator.ts"],"sourcesContent":["/**\n * An interface representing the Readium Locator object.\n */\nexport interface Locator {\n href: string;\n type: string;\n target?: number;\n title?: string;\n locations?: {\n progression: number;\n position?: number;\n totalProgression?: number;\n };\n}\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["Appearance","FontFamily","TextAlignment","ColumnCount","RANGES","indexOfObjectValue","clamp","Settings","DEFAULT","ORIGINAL","JUSTIFY","AUTO","map","settings","defaultValues","mapped","Object","keys","forEach","key","undefined","appearance","fontFamily","textAlign","colCount"],"sources":["Settings.ts"],"sourcesContent":["import {\n Appearance,\n FontFamily,\n TextAlignment,\n ColumnCount,\n} from '../enums';\n\nimport {\n RANGES,\n indexOfObjectValue,\n clamp,\n} from '../utils';\n\n/**\n * A reader settings object with sensible defaults.\n */\nexport class Settings {\n // TODO:\n // - ligatures\n // - paraIndent\n appearance: Appearance = Appearance.DEFAULT;\n fontFamily: FontFamily = FontFamily.ORIGINAL;\n textAlign: TextAlignment = TextAlignment.JUSTIFY;\n colCount: ColumnCount = ColumnCount.AUTO;\n\n scroll: boolean = false;\n fontOverride: boolean = false;\n verticalScroll: boolean = false;\n bodyHyphens: boolean = false;\n advancedSettings: boolean = true;\n\n /**\n * Range: 100.0 - 300.0\n */\n fontSize: number = 100;\n\n /**\n * Range: 0.0 - 0.5\n */\n wordSpacing: number = 0;\n\n /**\n * Range: 0.0 - 0.5\n */\n letterSpacing: number = 0;\n\n /**\n * Range: 0.5 - 4.0\n */\n pageMargins: number = 0;\n\n /**\n * Range: 1.0 - 2.0\n */\n lineHeight: number = 1;\n\n /**\n * Range: 0.0 - 2.0\n */\n paragraphMargins?: number = 0;\n\n static map(settings: Partial<Settings>): any {\n const defaultValues = new Settings();\n const mapped: Record<string, any> = {};\n\n Object.keys(defaultValues)\n .forEach((key: string) => {\n // @ts-ignore\n mapped[key] = settings[key] !== undefined ? settings[key] : defaultValues[key];\n })\n ;\n\n mapped.appearance = indexOfObjectValue(Appearance, mapped.appearance);\n mapped.fontFamily = indexOfObjectValue(FontFamily, mapped.fontFamily);\n mapped.textAlign = indexOfObjectValue(TextAlignment, mapped.textAlign);\n mapped.colCount = indexOfObjectValue(ColumnCount, mapped.colCount);\n\n Object.keys(RANGES).forEach((key: string) => {\n // @ts-ignore\n mapped[key] = clamp(mapped[key], RANGES[key][0], RANGES[key][1]);\n });\n\n return mapped;\n }\n}\n"],"mappings":";;AAAA,SACEA,UADF,EAEEC,UAFF,EAGEC,aAHF,EAIEC,WAJF,QAKO,UALP;AAOA,SACEC,MADF,EAEEC,kBAFF,EAGEC,KAHF,QAIO,UAJP;AAMA;AACA;AACA;;AACA,OAAO,MAAMC,QAAN,CAAe;EAAA;IAAA,oCAIKP,UAAU,CAACQ,OAJhB;;IAAA,oCAKKP,UAAU,CAACQ,QALhB;;IAAA,mCAMOP,aAAa,CAACQ,OANrB;;IAAA,kCAOIP,WAAW,CAACQ,IAPhB;;IAAA,gCASF,KATE;;IAAA,sCAUI,KAVJ;;IAAA,wCAWM,KAXN;;IAAA,qCAYG,KAZH;;IAAA,0CAaQ,IAbR;;IAAA,kCAkBD,GAlBC;;IAAA,qCAuBE,CAvBF;;IAAA,uCA4BI,CA5BJ;;IAAA,qCAiCE,CAjCF;;IAAA,oCAsCC,CAtCD;;IAAA,0CA2CQ,CA3CR;EAAA;;EA6CV,OAAHC,GAAG,CAACC,QAAD,EAAmC;IAC3C,MAAMC,aAAa,GAAG,IAAIP,QAAJ,EAAtB;IACA,MAAMQ,MAA2B,GAAG,EAApC;IAEAC,MAAM,CAACC,IAAP,CAAYH,aAAZ,EACGI,OADH,CACYC,GAAD,IAAiB;MACxB;MACAJ,MAAM,CAACI,GAAD,CAAN,GAAcN,QAAQ,CAACM,GAAD,CAAR,KAAkBC,SAAlB,GAA8BP,QAAQ,CAACM,GAAD,CAAtC,GAA8CL,aAAa,CAACK,GAAD,CAAzE;IACD,CAJH;IAOAJ,MAAM,CAACM,UAAP,GAAoBhB,kBAAkB,CAACL,UAAD,EAAae,MAAM,CAACM,UAApB,CAAtC;IACAN,MAAM,CAACO,UAAP,GAAoBjB,kBAAkB,CAACJ,UAAD,EAAac,MAAM,CAACO,UAApB,CAAtC;IACAP,MAAM,CAACQ,SAAP,GAAmBlB,kBAAkB,CAACH,aAAD,EAAgBa,MAAM,CAACQ,SAAvB,CAArC;IACAR,MAAM,CAACS,QAAP,GAAkBnB,kBAAkB,CAACF,WAAD,EAAcY,MAAM,CAACS,QAArB,CAApC;IAEAR,MAAM,CAACC,IAAP,CAAYb,MAAZ,EAAoBc,OAApB,CAA6BC,GAAD,IAAiB;MAC3C;MACAJ,MAAM,CAACI,GAAD,CAAN,GAAcb,KAAK,CAACS,MAAM,CAACI,GAAD,CAAP,EAAcf,MAAM,CAACe,GAAD,CAAN,CAAY,CAAZ,CAAd,EAA8Bf,MAAM,CAACe,GAAD,CAAN,CAAY,CAAZ,CAA9B,CAAnB;IACD,CAHD;IAKA,OAAOJ,MAAP;EACD;;AAnEmB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from './Dimensions';\nexport * from './File';\nexport * from './Link';\nexport * from './Locator';\nexport * from './Settings';\n"],"mappings":"AAAA,cAAc,cAAd;AACA,cAAc,QAAd;AACA,cAAc,QAAd;AACA,cAAc,WAAd;AACA,cAAc,YAAd"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["COMPONENT_NAME"],"sources":["COMPONENT_NAME.ts"],"sourcesContent":["export const COMPONENT_NAME = 'ReadiumView';\n"],"mappings":"AAAA,OAAO,MAAMA,cAAc,GAAG,aAAvB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["Platform","LINKING_ERROR","select","ios","default"],"sources":["LINKING_ERROR.ts"],"sourcesContent":["import { Platform } from 'react-native';\n\nexport const LINKING_ERROR =\n `The package 'react-native-readium' doesn't seem to be linked. Make sure: \\n\\n` +\n Platform.select({ ios: \"- You have run 'pod install'\\n\", default: '' }) +\n '- You rebuilt the app after installing the package\\n' +\n '- You are not using Expo managed workflow\\n';\n"],"mappings":"AAAA,SAASA,QAAT,QAAyB,cAAzB;AAEA,OAAO,MAAMC,aAAa,GACvB,+EAAD,GACAD,QAAQ,CAACE,MAAT,CAAgB;EAAEC,GAAG,EAAE,gCAAP;EAAyCC,OAAO,EAAE;AAAlD,CAAhB,CADA,GAEA,sDAFA,GAGA,6CAJK"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["RANGES","fontSize","wordSpacing","letterSpacing","pageMargins","lineHeight","paragraphMargins"],"sources":["RANGES.ts"],"sourcesContent":["export const RANGES = {\n fontSize: [100.0, 300.0],\n wordSpacing: [0.0, 0.5],\n letterSpacing: [0.0, 0.5],\n pageMargins: [0.5, 4.0],\n lineHeight: [1.0, 2.0],\n paragraphMargins: [0.0, 2.0],\n};\n"],"mappings":"AAAA,OAAO,MAAMA,MAAM,GAAG;EACpBC,QAAQ,EAAU,CAAC,KAAD,EAAQ,KAAR,CADE;EAEpBC,WAAW,EAAO,CAAC,GAAD,EAAM,GAAN,CAFE;EAGpBC,aAAa,EAAK,CAAC,GAAD,EAAM,GAAN,CAHE;EAIpBC,WAAW,EAAO,CAAC,GAAD,EAAM,GAAN,CAJE;EAKpBC,UAAU,EAAQ,CAAC,GAAD,EAAM,GAAN,CALE;EAMpBC,gBAAgB,EAAE,CAAC,GAAD,EAAM,GAAN;AANE,CAAf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["clamp","val","lower","upper"],"sources":["clamp.ts"],"sourcesContent":["export const clamp = (val: number, lower: number, upper: number): number => {\n if (val < lower) return lower;\n if (val > upper) return upper;\n return val;\n}\n"],"mappings":"AAAA,OAAO,MAAMA,KAAK,GAAG,CAACC,GAAD,EAAcC,KAAd,EAA6BC,KAA7B,KAAuD;EAC1E,IAAIF,GAAG,GAAGC,KAAV,EAAiB,OAAOA,KAAP;EACjB,IAAID,GAAG,GAAGE,KAAV,EAAiB,OAAOA,KAAP;EACjB,OAAOF,GAAP;AACD,CAJM"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["UIManager","COMPONENT_NAME","createFragment","viewId","dispatchViewManagerCommand","getViewManagerConfig","Commands","create","toString"],"sources":["createFragment.ts"],"sourcesContent":["import { UIManager } from 'react-native';\n\nimport { COMPONENT_NAME } from './COMPONENT_NAME';\n\nexport const createFragment = (viewId: number | null) => {\n if (viewId !== null) {\n UIManager.dispatchViewManagerCommand(\n viewId,\n // we are calling the 'create' command\n // @ts-ignore\n UIManager.getViewManagerConfig(COMPONENT_NAME).Commands.create.toString(),\n [viewId],\n );\n }\n}\n"],"mappings":"AAAA,SAASA,SAAT,QAA0B,cAA1B;AAEA,SAASC,cAAT,QAA+B,kBAA/B;AAEA,OAAO,MAAMC,cAAc,GAAIC,MAAD,IAA2B;EACvD,IAAIA,MAAM,KAAK,IAAf,EAAqB;IACnBH,SAAS,CAACI,0BAAV,CACED,MADF,EAEE;IACA;IACAH,SAAS,CAACK,oBAAV,CAA+BJ,cAA/B,EAA+CK,QAA/C,CAAwDC,MAAxD,CAA+DC,QAA/D,EAJF,EAKE,CAACL,MAAD,CALF;EAOD;AACF,CAVM"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["Platform","PixelRatio","getWidthOrHeightValue","val","OS","getPixelSizeForLayoutSize"],"sources":["getWidthOrHeightValue.ts"],"sourcesContent":["import { Platform, PixelRatio } from 'react-native';\n\nexport const getWidthOrHeightValue = (val: number) => {\n return Platform.OS === 'android' ? PixelRatio.getPixelSizeForLayoutSize(val) : val;\n}\n"],"mappings":"AAAA,SAASA,QAAT,EAAmBC,UAAnB,QAAqC,cAArC;AAEA,OAAO,MAAMC,qBAAqB,GAAIC,GAAD,IAAiB;EACpD,OAAOH,QAAQ,CAACI,EAAT,KAAgB,SAAhB,GAA4BH,UAAU,CAACI,yBAAX,CAAqCF,GAArC,CAA5B,GAAwEA,GAA/E;AACD,CAFM"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from './clamp';\nexport * from './COMPONENT_NAME';\nexport * from './createFragment';\nexport * from './getWidthOrHeightValue';\nexport * from './indexOfObjectValue';\nexport * from './LINKING_ERROR';\nexport * from './RANGES';\n"],"mappings":"AAAA,cAAc,SAAd;AACA,cAAc,kBAAd;AACA,cAAc,kBAAd;AACA,cAAc,yBAAd;AACA,cAAc,sBAAd;AACA,cAAc,iBAAd;AACA,cAAc,UAAd"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["indexOfObjectValue","obj","val","Object","values","indexOf"],"sources":["indexOfObjectValue.ts"],"sourcesContent":["export const indexOfObjectValue = (obj: any, val: any): number => {\n return Object.values(obj).indexOf(val);\n}\n"],"mappings":"AAAA,OAAO,MAAMA,kBAAkB,GAAG,CAACC,GAAD,EAAWC,GAAX,KAAgC;EAChE,OAAOC,MAAM,CAACC,MAAP,CAAcH,GAAd,EAAmBI,OAAnB,CAA2BH,GAA3B,CAAP;AACD,CAFM"}
|