@youversion/platform-react-native 0.8.0 → 0.9.0

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/CHANGELOG.md CHANGED
@@ -2,6 +2,11 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
4
4
 
5
+ ## 0.9.0 (2026-01-31)
6
+
7
+ * feat: Update Kotlin SDK and fix all breaking changes (#36) ([0e03b0e](https://github.com/youversion/platform-sdk-reactnative/commit/0e03b0e)), closes [#36](https://github.com/youversion/platform-sdk-reactnative/issues/36)
8
+ * feat (android): add view module stubs for RN bridging (#31) ([66cf642](https://github.com/youversion/platform-sdk-reactnative/commit/66cf642)), closes [#31](https://github.com/youversion/platform-sdk-reactnative/issues/31)
9
+
5
10
  ## 0.8.0 (2026-01-16)
6
11
 
7
12
  * chore: Depend on most recent Swift SDK version and update breaking changes (#27) ([a042211](https://github.com/youversion/platform-sdk-reactnative/commit/a042211)), closes [#27](https://github.com/youversion/platform-sdk-reactnative/issues/27)
@@ -1,7 +1,16 @@
1
+ buildscript {
2
+ repositories {
3
+ mavenCentral()
4
+ }
5
+ dependencies {
6
+ classpath("org.jetbrains.kotlin.plugin.compose:org.jetbrains.kotlin.plugin.compose.gradle.plugin:${kotlinVersion}")
7
+ }
8
+ }
9
+
1
10
  apply plugin: 'com.android.library'
2
11
 
3
12
  group = 'com.youversion.reactnativesdk'
4
- version = '0.8.0'
13
+ version = '0.9.0'
5
14
 
6
15
  def expoModulesCorePlugin = new File(project(":expo-modules-core").projectDir.absolutePath, "ExpoModulesCorePlugin.gradle")
7
16
  apply from: expoModulesCorePlugin
@@ -36,7 +45,7 @@ android {
36
45
  namespace "com.youversion.reactnativesdk"
37
46
  defaultConfig {
38
47
  versionCode 1
39
- versionName "0.8.0"
48
+ versionName "0.9.0"
40
49
  }
41
50
  buildFeatures {
42
51
  compose true
@@ -51,7 +60,7 @@ dependencies {
51
60
  implementation 'androidx.compose.foundation:foundation-android:1.9.1'
52
61
  implementation 'androidx.compose.material3:material3-android:1.3.2'
53
62
 
54
- implementation 'com.youversion.platform:platform-core:0.5.0'
55
- implementation 'com.youversion.platform:platform-ui:0.5.0'
56
- implementation 'com.youversion.platform:platform-reader:0.5.0'
63
+ implementation 'com.youversion.platform:platform-core:0.6.0'
64
+ implementation 'com.youversion.platform:platform-ui:0.6.0'
65
+ implementation 'com.youversion.platform:platform-reader:0.6.0'
57
66
  }
@@ -0,0 +1,13 @@
1
+ package com.youversion.reactnativesdk
2
+
3
+ import com.youversion.reactnativesdk.views.YVPBibleReaderView
4
+ import expo.modules.kotlin.modules.Module
5
+ import expo.modules.kotlin.modules.ModuleDefinition
6
+
7
+ class RNBibleReaderViewModule : Module() {
8
+ override fun definition() = ModuleDefinition {
9
+ Name("BibleReaderView")
10
+
11
+ View(YVPBibleReaderView::class)
12
+ }
13
+ }
@@ -0,0 +1,15 @@
1
+ package com.youversion.reactnativesdk
2
+
3
+ import com.youversion.reactnativesdk.views.YVPBibleTextView
4
+ import expo.modules.kotlin.modules.Module
5
+ import expo.modules.kotlin.modules.ModuleDefinition
6
+
7
+ class RNBibleTextViewModule : Module() {
8
+ override fun definition() = ModuleDefinition {
9
+ Name("BibleTextView")
10
+
11
+ View(YVPBibleTextView::class) {
12
+ Events("onTap")
13
+ }
14
+ }
15
+ }
@@ -0,0 +1,13 @@
1
+ package com.youversion.reactnativesdk
2
+
3
+ import com.youversion.reactnativesdk.views.YVPBibleWidgetView
4
+ import expo.modules.kotlin.modules.Module
5
+ import expo.modules.kotlin.modules.ModuleDefinition
6
+
7
+ class RNBibleWidgetViewModule : Module() {
8
+ override fun definition() = ModuleDefinition {
9
+ Name("BibleWidgetView")
10
+
11
+ View(YVPBibleWidgetView::class)
12
+ }
13
+ }
@@ -0,0 +1,13 @@
1
+ package com.youversion.reactnativesdk
2
+
3
+ import com.youversion.reactnativesdk.views.YVPVotdView
4
+ import expo.modules.kotlin.modules.Module
5
+ import expo.modules.kotlin.modules.ModuleDefinition
6
+
7
+ class RNVotdViewModule : Module() {
8
+ override fun definition() = ModuleDefinition {
9
+ Name("VotdView")
10
+
11
+ View(YVPVotdView::class)
12
+ }
13
+ }
@@ -4,7 +4,7 @@ import com.youversion.platform.core.api.YouVersionApi
4
4
 
5
5
  object YVPLanguagesApi {
6
6
  suspend fun languages(country: String?): List<LanguageRecord> {
7
- val response = YouVersionApi.language.languages(country)
7
+ val response = YouVersionApi.languages.languages(country)
8
8
  val records = response.map { LanguageRecord(it) }
9
9
  return records
10
10
  }
@@ -43,7 +43,7 @@ data class LanguageRecord(
43
43
  @Field
44
44
  val textDirection: String,
45
45
  @Field
46
- val defaultBibleVersionId: Int?
46
+ val defaultBibleId: Int?
47
47
 
48
48
  ) : Record {
49
49
  constructor(language: Language) : this(
@@ -57,7 +57,7 @@ data class LanguageRecord(
57
57
  variants = language.variants,
58
58
  countries = language.countries,
59
59
  textDirection = language.textDirection,
60
- defaultBibleVersionId = language.defaultBibleVersionId
60
+ defaultBibleId = language.defaultBibleVersionId
61
61
  )
62
62
  }
63
63
 
@@ -67,9 +67,9 @@ data class BibleVersionRecord(
67
67
  @Field
68
68
  val abbreviation: String?,
69
69
  @Field
70
- val copyrightLong: String?,
70
+ val promotionalContent: String?,
71
71
  @Field
72
- val copyrightShort: String?,
72
+ val copyright: String?,
73
73
  @Field
74
74
  val languageTag: String?,
75
75
  @Field
@@ -87,13 +87,15 @@ data class BibleVersionRecord(
87
87
  @Field
88
88
  val books: List<BibleBookRecord>?,
89
89
  @Field
90
- val textDirection: String?
90
+ val textDirection: String?,
91
+ @Field
92
+ val organizationId: String?
91
93
  ) : Record {
92
94
  constructor(bibleVersion: BibleVersion) : this(
93
95
  id = bibleVersion.id,
94
96
  abbreviation = bibleVersion.abbreviation,
95
- copyrightLong = bibleVersion.copyrightLong,
96
- copyrightShort = bibleVersion.copyrightShort,
97
+ promotionalContent = bibleVersion.promotionalContent,
98
+ copyright = bibleVersion.copyright,
97
99
  languageTag = bibleVersion.languageTag,
98
100
  localizedAbbreviation = bibleVersion.localizedAbbreviation,
99
101
  localizedTitle = bibleVersion.localizedTitle,
@@ -102,13 +104,14 @@ data class BibleVersionRecord(
102
104
  title = bibleVersion.title,
103
105
  bookCodes = bibleVersion.bookCodes,
104
106
  books = bibleVersion.books?.map { BibleBookRecord(it) },
105
- textDirection = bibleVersion.textDirection
107
+ textDirection = bibleVersion.textDirection,
108
+ organizationId = bibleVersion.organizationId
106
109
  )
107
110
  }
108
111
 
109
112
  data class BibleBookRecord(
110
113
  @Field
111
- val usfm: String?,
114
+ val id: String?,
112
115
  @Field
113
116
  val title: String?,
114
117
  @Field
@@ -116,14 +119,17 @@ data class BibleBookRecord(
116
119
  @Field
117
120
  val canon: String?,
118
121
  @Field
119
- val chapters: List<BibleChapterRecord>?
122
+ val chapters: List<BibleChapterRecord>?,
123
+ @Field
124
+ val fullTitle: String?
120
125
  ) : Record {
121
126
  constructor(bibleBook: BibleBook) : this(
122
- usfm = bibleBook.usfm,
127
+ id = bibleBook.id,
123
128
  title = bibleBook.title,
124
129
  abbreviation = bibleBook.abbreviation,
125
130
  canon = bibleBook.canon,
126
- chapters = bibleBook.chapters?.map { BibleChapterRecord(it) }
131
+ chapters = bibleBook.chapters?.map { BibleChapterRecord(it) },
132
+ fullTitle = bibleBook.fullTitle
127
133
  )
128
134
  }
129
135
 
@@ -131,18 +137,12 @@ data class BibleChapterRecord(
131
137
  @Field
132
138
  val id: String?,
133
139
  @Field
134
- val bookUSFM: String?,
135
- @Field
136
- val isCanonical: Boolean?,
137
- @Field
138
140
  val passageId: String?,
139
141
  @Field
140
142
  val title: String?
141
143
  ) : Record {
142
144
  constructor(bibleChapter: BibleChapter) : this(
143
145
  id = bibleChapter.id,
144
- bookUSFM = bibleChapter.bookUSFM,
145
- isCanonical = bibleChapter.isCanonical,
146
146
  passageId = bibleChapter.passageId,
147
147
  title = bibleChapter.title
148
148
  )
@@ -0,0 +1,55 @@
1
+ package com.youversion.reactnativesdk.views
2
+
3
+ import android.content.Context
4
+ import androidx.compose.foundation.layout.Box
5
+ import androidx.compose.foundation.layout.fillMaxSize
6
+ import androidx.compose.foundation.layout.padding
7
+ import androidx.compose.material3.Text
8
+ import androidx.compose.runtime.Composable
9
+ import androidx.compose.runtime.MutableState
10
+ import androidx.compose.runtime.mutableStateOf
11
+ import androidx.compose.ui.Alignment
12
+ import androidx.compose.ui.Modifier
13
+ import androidx.compose.ui.graphics.Color
14
+ import androidx.compose.ui.unit.dp
15
+ import expo.modules.kotlin.AppContext
16
+ import expo.modules.kotlin.views.ComposeProps
17
+ import expo.modules.kotlin.views.ExpoComposeView
18
+
19
+ data class BibleReaderViewProps(
20
+ // Bible reference
21
+ val versionId: MutableState<Int?> = mutableStateOf(null),
22
+ val bookUSFM: MutableState<String?> = mutableStateOf(null),
23
+ val chapter: MutableState<Int?> = mutableStateOf(null),
24
+ val verse: MutableState<Int?> = mutableStateOf(null),
25
+ val verseStart: MutableState<Int?> = mutableStateOf(null),
26
+ val verseEnd: MutableState<Int?> = mutableStateOf(null),
27
+
28
+ val appName: MutableState<String?> = mutableStateOf(null),
29
+ val signInMessage: MutableState<String?> = mutableStateOf(null),
30
+ val hasReference: MutableState<Boolean?> = mutableStateOf(false),
31
+ ) : ComposeProps
32
+
33
+ class YVPBibleReaderView(context: Context, appContext: AppContext) :
34
+ ExpoComposeView<BibleReaderViewProps>(context, appContext, withHostingView = true) {
35
+
36
+ override val props = BibleReaderViewProps()
37
+
38
+ @Composable
39
+ override fun Content(modifier: Modifier) {
40
+ // TODO: Replace with actual BibleReaderView composable when Kotlin SDK is ready
41
+ Box(
42
+ modifier = modifier
43
+ .fillMaxSize()
44
+ .padding(16.dp),
45
+ contentAlignment = Alignment.Center
46
+ ) {
47
+ Text(
48
+ text = "BibleReaderView placeholder\n" +
49
+ "App: ${props.appName.value}\n" +
50
+ "Reference: ${props.bookUSFM.value} ${props.chapter.value}",
51
+ color = Color.Gray
52
+ )
53
+ }
54
+ }
55
+ }
@@ -0,0 +1,60 @@
1
+ package com.youversion.reactnativesdk.views
2
+
3
+ import android.content.Context
4
+ import androidx.compose.foundation.layout.Box
5
+ import androidx.compose.foundation.layout.fillMaxWidth
6
+ import androidx.compose.foundation.layout.padding
7
+ import androidx.compose.material3.Text
8
+ import androidx.compose.runtime.Composable
9
+ import androidx.compose.runtime.MutableState
10
+ import androidx.compose.runtime.mutableStateOf
11
+ import androidx.compose.ui.Modifier
12
+ import androidx.compose.ui.graphics.Color
13
+ import androidx.compose.ui.unit.dp
14
+ import expo.modules.kotlin.AppContext
15
+ import expo.modules.kotlin.viewevent.EventDispatcher
16
+ import expo.modules.kotlin.views.ComposeProps
17
+ import expo.modules.kotlin.views.ExpoComposeView
18
+
19
+ data class BibleTextViewProps(
20
+ // Styling
21
+ val fontFamily: MutableState<String?> = mutableStateOf(null),
22
+ val fontSize: MutableState<Float?> = mutableStateOf(16f),
23
+ val lineSpacing: MutableState<Float?> = mutableStateOf(null),
24
+ val paragraphSpacing: MutableState<Float?> = mutableStateOf(null),
25
+ val textColor: MutableState<Int?> = mutableStateOf(null),
26
+ val wocColor: MutableState<Int?> = mutableStateOf(null),
27
+ val footnoteMode: MutableState<String?> = mutableStateOf("none"),
28
+ val renderVerseNumbers: MutableState<Boolean?> = mutableStateOf(true),
29
+
30
+ // Bible reference
31
+ val versionId: MutableState<Int?> = mutableStateOf(null),
32
+ val bookUSFM: MutableState<String?> = mutableStateOf(null),
33
+ val chapter: MutableState<Int?> = mutableStateOf(null),
34
+ val verse: MutableState<Int?> = mutableStateOf(null),
35
+ val verseStart: MutableState<Int?> = mutableStateOf(null),
36
+ val verseEnd: MutableState<Int?> = mutableStateOf(null),
37
+ ) : ComposeProps
38
+
39
+ class YVPBibleTextView(context: Context, appContext: AppContext) :
40
+ ExpoComposeView<BibleTextViewProps>(context, appContext, withHostingView = true) {
41
+
42
+ override val props = BibleTextViewProps()
43
+ private val onTap by EventDispatcher()
44
+
45
+ @Composable
46
+ override fun Content(modifier: Modifier) {
47
+ // TODO: Replace with actual BibleText composable when Kotlin SDK is ready
48
+ Box(
49
+ modifier = modifier
50
+ .fillMaxWidth()
51
+ .padding(16.dp)
52
+ ) {
53
+ Text(
54
+ text = "BibleTextView placeholder - versionId: ${props.versionId.value}, " +
55
+ "book: ${props.bookUSFM.value}, chapter: ${props.chapter.value}",
56
+ color = Color.Gray
57
+ )
58
+ }
59
+ }
60
+ }
@@ -0,0 +1,60 @@
1
+ package com.youversion.reactnativesdk.views
2
+
3
+ import android.content.Context
4
+ import androidx.compose.foundation.isSystemInDarkTheme
5
+ import androidx.compose.foundation.layout.Box
6
+ import androidx.compose.foundation.layout.fillMaxWidth
7
+ import androidx.compose.foundation.layout.padding
8
+ import androidx.compose.material3.Text
9
+ import androidx.compose.runtime.Composable
10
+ import androidx.compose.runtime.MutableState
11
+ import androidx.compose.runtime.mutableStateOf
12
+ import androidx.compose.ui.Modifier
13
+ import androidx.compose.ui.graphics.Color
14
+ import androidx.compose.ui.unit.dp
15
+ import androidx.compose.ui.unit.sp
16
+ import expo.modules.kotlin.AppContext
17
+ import expo.modules.kotlin.views.ComposeProps
18
+ import expo.modules.kotlin.views.ExpoComposeView
19
+
20
+ data class BibleWidgetViewProps(
21
+ // Bible reference
22
+ val versionId: MutableState<Int?> = mutableStateOf(null),
23
+ val bookUSFM: MutableState<String?> = mutableStateOf(null),
24
+ val chapter: MutableState<Int?> = mutableStateOf(null),
25
+ val verse: MutableState<Int?> = mutableStateOf(null),
26
+ val verseStart: MutableState<Int?> = mutableStateOf(null),
27
+ val verseEnd: MutableState<Int?> = mutableStateOf(null),
28
+
29
+ val fontSize: MutableState<Float?> = mutableStateOf(23f),
30
+ val colorScheme: MutableState<String?> = mutableStateOf(null),
31
+ ) : ComposeProps
32
+
33
+ class YVPBibleWidgetView(context: Context, appContext: AppContext) :
34
+ ExpoComposeView<BibleWidgetViewProps>(context, appContext, withHostingView = true) {
35
+
36
+ override val props = BibleWidgetViewProps()
37
+
38
+ @Composable
39
+ override fun Content(modifier: Modifier) {
40
+ val isDark = when (props.colorScheme.value) {
41
+ "dark" -> true
42
+ "light" -> false
43
+ else -> isSystemInDarkTheme()
44
+ }
45
+
46
+ // TODO: Replace with actual BibleWidget composable when Kotlin SDK is ready
47
+ Box(
48
+ modifier = modifier
49
+ .fillMaxWidth()
50
+ .padding(16.dp)
51
+ ) {
52
+ Text(
53
+ text = "BibleWidgetView placeholder\n" +
54
+ "${props.bookUSFM.value} ${props.chapter.value}:${props.verse.value ?: "${props.verseStart.value}-${props.verseEnd.value}"}",
55
+ color = if (isDark) Color.White else Color.DarkGray,
56
+ fontSize = (props.fontSize.value ?: 23f).sp
57
+ )
58
+ }
59
+ }
60
+ }
@@ -11,7 +11,6 @@ import com.youversion.platform.ui.views.SignInWithYouVersionButton
11
11
  import com.youversion.platform.ui.views.SignInWithYouVersionButtonDefaults
12
12
  import com.youversion.platform.ui.views.SignInWithYouVersionButtonMode
13
13
  import expo.modules.kotlin.AppContext
14
- import expo.modules.kotlin.viewevent.EventDispatcher
15
14
  import expo.modules.kotlin.views.AutoSizingComposable
16
15
  import expo.modules.kotlin.views.ComposeProps
17
16
  import expo.modules.kotlin.views.Direction
@@ -28,17 +27,17 @@ data class SignInWithYouVersionButtonProps(
28
27
  class YVPSignInWithYouVersionButton(context: Context, appContext: AppContext) :
29
28
  ExpoComposeView<SignInWithYouVersionButtonProps>(context, appContext, withHostingView = true) {
30
29
  override val props = SignInWithYouVersionButtonProps()
31
- private val onTap by EventDispatcher()
30
+ // private val onTap by EventDispatcher()
32
31
 
33
32
  @Composable
34
33
  override fun Content(modifier: Modifier) {
35
34
  AutoSizingComposable(shadowNodeProxy, axis = EnumSet.of(Direction.HORIZONTAL, Direction.VERTICAL)) {
36
35
  SignInWithYouVersionButton(
37
- onClick = { onTap(mapOf()) },
38
36
  mode = mode(),
39
37
  stroked = stroked(),
40
38
  shape = shape(),
41
- dark = isDark()
39
+ dark = isDark(),
40
+ permissions = { HashSet() }
42
41
  )
43
42
  }
44
43
  }
@@ -0,0 +1,49 @@
1
+ package com.youversion.reactnativesdk.views
2
+
3
+ import android.content.Context
4
+ import androidx.compose.foundation.isSystemInDarkTheme
5
+ import androidx.compose.foundation.layout.Box
6
+ import androidx.compose.foundation.layout.fillMaxWidth
7
+ import androidx.compose.foundation.layout.padding
8
+ import androidx.compose.material3.Text
9
+ import androidx.compose.runtime.Composable
10
+ import androidx.compose.runtime.MutableState
11
+ import androidx.compose.runtime.mutableStateOf
12
+ import androidx.compose.ui.Modifier
13
+ import androidx.compose.ui.graphics.Color
14
+ import androidx.compose.ui.unit.dp
15
+ import expo.modules.kotlin.AppContext
16
+ import expo.modules.kotlin.views.ComposeProps
17
+ import expo.modules.kotlin.views.ExpoComposeView
18
+
19
+ data class VotdViewProps(
20
+ val bibleVersionId: MutableState<Int?> = mutableStateOf(111),
21
+ val colorScheme: MutableState<String?> = mutableStateOf(null),
22
+ ) : ComposeProps
23
+
24
+ class YVPVotdView(context: Context, appContext: AppContext) :
25
+ ExpoComposeView<VotdViewProps>(context, appContext, withHostingView = true) {
26
+
27
+ override val props = VotdViewProps()
28
+
29
+ @Composable
30
+ override fun Content(modifier: Modifier) {
31
+ val isDark = when (props.colorScheme.value) {
32
+ "dark" -> true
33
+ "light" -> false
34
+ else -> isSystemInDarkTheme()
35
+ }
36
+
37
+ // TODO: Replace with actual VerseOfTheDay composable when Kotlin SDK is ready
38
+ Box(
39
+ modifier = modifier
40
+ .fillMaxWidth()
41
+ .padding(16.dp)
42
+ ) {
43
+ Text(
44
+ text = "VotdView placeholder - versionId: ${props.bibleVersionId.value}",
45
+ color = if (isDark) Color.White else Color.DarkGray
46
+ )
47
+ }
48
+ }
49
+ }
@@ -14,7 +14,11 @@
14
14
  "android": {
15
15
  "modules": [
16
16
  "com.youversion.reactnativesdk.RNYouVersionPlatformModule",
17
- "com.youversion.reactnativesdk.RNSignInWithYouVersionButtonModule"
17
+ "com.youversion.reactnativesdk.RNSignInWithYouVersionButtonModule",
18
+ "com.youversion.reactnativesdk.RNBibleTextViewModule",
19
+ "com.youversion.reactnativesdk.RNVotdViewModule",
20
+ "com.youversion.reactnativesdk.RNBibleReaderViewModule",
21
+ "com.youversion.reactnativesdk.RNBibleWidgetViewModule"
18
22
  ]
19
23
  }
20
24
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@youversion/platform-react-native",
3
- "version": "0.8.0",
3
+ "version": "0.9.0",
4
4
  "description": "React Native SDK for YouVersion Platform",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",