@youversion/platform-react-native 0.7.2 → 0.8.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.
Files changed (40) hide show
  1. package/.releaserc.json +1 -0
  2. package/AGENTS.md +86 -0
  3. package/CHANGELOG.md +17 -0
  4. package/android/build.gradle +16 -2
  5. package/android/src/main/java/com/youversion/reactnativesdk/RNSignInWithYouVersionButtonModule.kt +15 -0
  6. package/android/src/main/java/com/youversion/reactnativesdk/RNYouVersionPlatformModule.kt +99 -0
  7. package/android/src/main/java/com/youversion/reactnativesdk/api/YVPBibleApi.kt +32 -0
  8. package/android/src/main/java/com/youversion/reactnativesdk/api/YVPHighlightsApi.kt +44 -0
  9. package/android/src/main/java/com/youversion/reactnativesdk/api/YVPLanguagesApi.kt +11 -0
  10. package/android/src/main/java/com/youversion/reactnativesdk/api/YVPRecords.kt +185 -0
  11. package/android/src/main/java/com/youversion/reactnativesdk/api/YVPVotdApi.kt +12 -0
  12. package/android/src/main/java/com/youversion/reactnativesdk/views/YVPSignInWithYouVersionButton.kt +76 -0
  13. package/build/api/bible.d.ts +4 -4
  14. package/build/api/bible.d.ts.map +1 -1
  15. package/build/api/bible.js +2 -2
  16. package/build/api/bible.js.map +1 -1
  17. package/build/api/index.d.ts +2 -2
  18. package/build/api/users.d.ts +1 -2
  19. package/build/api/users.d.ts.map +1 -1
  20. package/build/api/users.js +2 -3
  21. package/build/api/users.js.map +1 -1
  22. package/build/native.d.ts +3 -3
  23. package/build/native.d.ts.map +1 -1
  24. package/build/native.js.map +1 -1
  25. package/build/types.d.ts +33 -23
  26. package/build/types.d.ts.map +1 -1
  27. package/build/types.js.map +1 -1
  28. package/dist/{youversion-platform-react-native-0.7.2.tgz → youversion-platform-react-native-0.8.0.tgz} +0 -0
  29. package/expo-module.config.json +5 -2
  30. package/ios/APIs/YVPBibleAPI.swift +18 -14
  31. package/ios/APIs/YVPLanguagesAPI.swift +2 -2
  32. package/ios/Views/YVPBibleTextView.swift +5 -6
  33. package/ios/YVPAuthAPI.swift +9 -16
  34. package/ios/YouVersionReactNative.podspec +4 -4
  35. package/mocks/RNYouVersionPlatform.ts +7 -7
  36. package/package.json +2 -3
  37. package/src/api/bible.ts +4 -4
  38. package/src/api/users.ts +2 -3
  39. package/src/native.ts +3 -3
  40. package/src/types.ts +42 -29
package/src/api/bible.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  import { Module } from "../native";
2
- import { BibleReference, BibleVersion } from "../types";
2
+ import { BibleReferenceBase, BibleVersion } from "../types";
3
3
 
4
4
  export const BibleAPI = {
5
5
  /**
6
- * Retrieves a list of Bible versions available for a specified language code (like "en").
6
+ * Retrieves a list of Bible versions available for a specified language tag (like "eng").
7
7
  *
8
8
  * @param languageTag - An optional language code per BCP 47 for filtering available Bible versions. If `nil`
9
9
  * the function returns versions for all languages.
@@ -26,10 +26,10 @@ export const BibleAPI = {
26
26
  /**
27
27
  * Retrieves the content of a single Bible chapter from the server as an HTML string.
28
28
  *
29
- * @param bibleReference - A {@link BibleReference} object specifying the reference to retrieve.
29
+ * @param bibleReference - A {@link BibleReferenceBase} object specifying the reference to retrieve.
30
30
  * @returns The chapter content as an HTML string.
31
31
  */
32
- getChapter(bibleReference: BibleReference): Promise<string> {
32
+ getChapter(bibleReference: BibleReferenceBase): Promise<string> {
33
33
  return Module.chapter(bibleReference);
34
34
  },
35
35
  };
package/src/api/users.ts CHANGED
@@ -26,10 +26,9 @@ export const UsersAPI = {
26
26
  /**
27
27
  * Retrieves user information for the authenticated user using the provided access token.
28
28
  *
29
- * @param accessToken - Optionally provide an accessToken, or use the one stored in the SDK after the user signs in
30
29
  * @returns A promise that resolves to the user information as a {@link YouVersionUserInfo} object.
31
30
  */
32
- userInfo(accessToken?: string): Promise<YouVersionUserInfo> {
33
- return Module.userInfo(accessToken);
31
+ userInfo(): Promise<YouVersionUserInfo> {
32
+ return Module.userInfo();
34
33
  },
35
34
  };
package/src/native.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { NativeModule, requireNativeModule } from "expo";
2
2
 
3
3
  import {
4
- BibleReference,
4
+ BibleReferenceBase,
5
5
  BibleVersion,
6
6
  HighlightResponse,
7
7
  LanguageOverview,
@@ -19,7 +19,7 @@ declare class RNYouVersionPlatformModule extends NativeModule {
19
19
 
20
20
  signOut(): Promise<void>;
21
21
 
22
- userInfo(accessToken?: string): Promise<YouVersionUserInfo>;
22
+ userInfo(): Promise<YouVersionUserInfo>;
23
23
 
24
24
  verseOfTheDay(dayOfYear: number): Promise<YouVersionVerseOfTheDay>;
25
25
 
@@ -48,7 +48,7 @@ declare class RNYouVersionPlatformModule extends NativeModule {
48
48
 
49
49
  version(versionId: number): Promise<BibleVersion>;
50
50
 
51
- chapter(bibleReference: BibleReference): Promise<string>;
51
+ chapter(bibleReference: BibleReferenceBase): Promise<string>;
52
52
 
53
53
  getAccessToken(): string | null;
54
54
  }
package/src/types.ts CHANGED
@@ -9,20 +9,16 @@ export type SignInWithYouVersionResult = {
9
9
  name?: string;
10
10
  profilePicture?: string;
11
11
  email?: string;
12
+ idToken?: string;
12
13
  };
13
14
 
14
- export type SignInWithYouVersionPermission =
15
- | "bibles"
16
- | "highlights"
17
- | "votd"
18
- | "demographics"
19
- | "bible_activity";
15
+ export type SignInWithYouVersionPermission = "openid" | "email" | "profile";
20
16
 
21
17
  export interface YouVersionUserInfo {
22
- firstName?: string;
23
- lastName?: string;
24
- userId?: string;
25
- avatarUrl?: string;
18
+ name?: string;
19
+ email?: string;
20
+ id?: string;
21
+ profilePicture?: string;
26
22
  }
27
23
 
28
24
  export interface YouVersionVerseOfTheDay {
@@ -88,9 +84,14 @@ export interface BibleTextOptions {
88
84
  renderVerseNumbers?: boolean | null | undefined;
89
85
  }
90
86
 
91
- export type BibleTextFootnoteMode = "none" | "inline" | "marker";
87
+ export type BibleTextFootnoteMode =
88
+ | "none"
89
+ | "inline"
90
+ | "marker"
91
+ | "letters"
92
+ | "image";
92
93
 
93
- interface BibleReferenceBase {
94
+ export interface BibleReferenceBase {
94
95
  /** The ID of the Bible version */
95
96
  versionId: number;
96
97
 
@@ -139,12 +140,9 @@ export type BibleReference =
139
140
  export interface OnBibleTextPressEvent {
140
141
  /** A reference to the Bible verse that was pressed */
141
142
  bibleReference: BibleReferenceVerse;
142
-
143
- /** The coordinates of the press event */
144
- point: {
145
- x: number;
146
- y: number;
147
- };
143
+ urlScheme: string;
144
+ /** Not implemented yet */
145
+ footnotes: unknown[];
148
146
  }
149
147
 
150
148
  export interface LanguageOverview {
@@ -222,7 +220,7 @@ export interface LanguageOverview {
222
220
  *
223
221
  * @example 111
224
222
  */
225
- defaultBibleVersionId?: number;
223
+ defaultBibleId?: number;
226
224
  }
227
225
 
228
226
  export interface HighlightResponse {
@@ -273,14 +271,14 @@ export interface BibleVersion {
273
271
  *
274
272
  * @example "<p>Biblica is the worldwide publisher and translation sponsor of the New International Version—one of the most widely read contemporary English versions of the Bible. </p> <p>At Biblica, we believe that with God, all things are possible. Partnering with other ministries and people like you, we are reaching the world with God’s Word, providing Bibles that are easier to understand and faster to receive. When God’s Word is put into someone’s hands, it has the power to change everything. </p> <p>To learn more, visit <a href="https://www.biblica.com/privacy-policy/">biblica.com</a> and <a href="http://facebook.com/Biblica">facebook.com/Biblica</a>.</p> <p> </p>"
275
273
  */
276
- copyrightLong?: string;
274
+ promotionalContent?: string;
277
275
 
278
276
  /**
279
277
  * Short version of the copyright text provided by the publisher for the given Bible version.
280
278
  *
281
279
  * @example "The Holy Bible, New International Version® NIV® Copyright © 1973, 1978, 1984, 2011 by Biblica, Inc.® Used by Permission of Biblica, Inc.® All rights reserved worldwide."
282
280
  */
283
- copyrightShort?: string;
281
+ copyright?: string;
284
282
 
285
283
  /**
286
284
  * BCP47 canonical language tag for this Bible version
@@ -329,15 +327,18 @@ export interface BibleVersion {
329
327
  * @example "ltr"
330
328
  */
331
329
  textDirection?: string;
330
+
331
+ /** uuid */
332
+ organizationId?: string;
332
333
  }
333
334
 
334
335
  export interface BibleBook {
335
336
  /**
336
- * Standard book identifier for the Unified Scripture Format Markup (USFM) used in Scripture text processing
337
+ * Book identifier
337
338
  *
338
339
  * @example "GEN"
339
340
  */
340
- usfm?: string;
341
+ id?: string;
341
342
 
342
343
  /**
343
344
  * Book name abbreviation if provided by the publisher
@@ -352,19 +353,31 @@ export interface BibleBook {
352
353
  * @example "Genesis"
353
354
  */
354
355
  title?: string;
355
- titleLong?: string;
356
+
357
+ /**
358
+ * Full book title if available
359
+ *
360
+ * @example "The Book of Genesis"
361
+ */
362
+ fullTitle?: string;
363
+
364
+ /**
365
+ * Indicates if this is Old Testament, New Testament, or Deuterocanonical
366
+ *
367
+ * @example "new_testament"
368
+ */
369
+ canon?: "new_testament" | "old_testament" | "deuterocanon";
370
+
356
371
  chapters?: BibleChapter[];
357
372
  }
358
373
 
359
374
  export interface BibleChapter {
360
375
  /**
361
- * Book identifier
376
+ * Chapter identifier based off the USFM reference
362
377
  *
363
- * @example "GEN"
378
+ * @example 1
364
379
  */
365
- bookUSFM?: string;
366
-
367
- isCanonical?: boolean;
380
+ id?: string;
368
381
 
369
382
  /**
370
383
  * Canonical representation of the passage