react-native-readium 4.0.0 → 4.0.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.
|
@@ -35,24 +35,20 @@ class ReadiumView(
|
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
fun updatePreferencesFromJsonString(preferences: String?) {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
} else if (fragment == null) {
|
|
41
|
-
lateInitSerializedUserPreferences = preferences
|
|
38
|
+
lateInitSerializedUserPreferences = preferences
|
|
39
|
+
if (preferences == null || fragment == null) {
|
|
42
40
|
return
|
|
43
41
|
}
|
|
44
42
|
|
|
45
43
|
if (fragment is EpubReaderFragment) {
|
|
46
44
|
(fragment as EpubReaderFragment).updatePreferencesFromJsonString(preferences)
|
|
47
45
|
}
|
|
48
|
-
|
|
49
|
-
lateInitSerializedUserPreferences = null
|
|
50
46
|
}
|
|
51
47
|
|
|
52
48
|
fun addFragment(frag: BaseReaderFragment) {
|
|
53
49
|
fragment = frag
|
|
54
50
|
setupLayout()
|
|
55
|
-
updatePreferencesFromJsonString(
|
|
51
|
+
lateInitSerializedUserPreferences?.let { updatePreferencesFromJsonString(it)}
|
|
56
52
|
val activity: FragmentActivity? = reactContext.currentActivity as FragmentActivity?
|
|
57
53
|
activity!!.supportFragmentManager
|
|
58
54
|
.beginTransaction()
|
|
@@ -69,17 +69,17 @@ export const useReaderRef = ({ file, onLocationChange, onTableOfContents, }) =>
|
|
|
69
69
|
const injectables = [
|
|
70
70
|
{
|
|
71
71
|
type: 'style',
|
|
72
|
-
url: 'https://cdn.statically.io/gh/d-i-t-a/R2D2BC
|
|
72
|
+
url: 'https://cdn.statically.io/gh/d-i-t-a/R2D2BC@production/viewer/readium-css/ReadiumCSS-before.css',
|
|
73
73
|
r2before: true,
|
|
74
74
|
},
|
|
75
75
|
{
|
|
76
76
|
type: 'style',
|
|
77
|
-
url: 'https://cdn.statically.io/gh/d-i-t-a/R2D2BC
|
|
77
|
+
url: 'https://cdn.statically.io/gh/d-i-t-a/R2D2BC@production/viewer/readium-css/ReadiumCSS-default.css',
|
|
78
78
|
r2default: true,
|
|
79
79
|
},
|
|
80
80
|
{
|
|
81
81
|
type: 'style',
|
|
82
|
-
url: 'https://cdn.statically.io/gh/d-i-t-a/R2D2BC
|
|
82
|
+
url: 'https://cdn.statically.io/gh/d-i-t-a/R2D2BC@production/viewer/readium-css/ReadiumCSS-after.css',
|
|
83
83
|
r2after: true,
|
|
84
84
|
},
|
|
85
85
|
];
|
package/package.json
CHANGED
|
@@ -93,17 +93,17 @@ export const useReaderRef = ({
|
|
|
93
93
|
const injectables: any[] = [
|
|
94
94
|
{
|
|
95
95
|
type: 'style',
|
|
96
|
-
url: 'https://cdn.statically.io/gh/d-i-t-a/R2D2BC
|
|
96
|
+
url: 'https://cdn.statically.io/gh/d-i-t-a/R2D2BC@production/viewer/readium-css/ReadiumCSS-before.css',
|
|
97
97
|
r2before: true,
|
|
98
98
|
},
|
|
99
99
|
{
|
|
100
100
|
type: 'style',
|
|
101
|
-
url: 'https://cdn.statically.io/gh/d-i-t-a/R2D2BC
|
|
101
|
+
url: 'https://cdn.statically.io/gh/d-i-t-a/R2D2BC@production/viewer/readium-css/ReadiumCSS-default.css',
|
|
102
102
|
r2default: true,
|
|
103
103
|
},
|
|
104
104
|
{
|
|
105
105
|
type: 'style',
|
|
106
|
-
url: 'https://cdn.statically.io/gh/d-i-t-a/R2D2BC
|
|
106
|
+
url: 'https://cdn.statically.io/gh/d-i-t-a/R2D2BC@production/viewer/readium-css/ReadiumCSS-after.css',
|
|
107
107
|
r2after: true,
|
|
108
108
|
},
|
|
109
109
|
];
|