@youversion/platform-react-ui 0.4.2 → 0.4.4
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 +102 -270
- package/dist/components/SignInButton.stories.d.ts.map +1 -1
- package/dist/components/bible-chapter-picker.d.ts +8 -1
- package/dist/components/bible-chapter-picker.d.ts.map +1 -1
- package/dist/components/bible-chapter-picker.stories.d.ts.map +1 -1
- package/dist/components/bible-reader.d.ts +31 -0
- package/dist/components/bible-reader.d.ts.map +1 -0
- package/dist/components/bible-reader.stories.d.ts +18 -0
- package/dist/components/bible-reader.stories.d.ts.map +1 -0
- package/dist/components/bible-version-picker.d.ts +9 -2
- package/dist/components/bible-version-picker.d.ts.map +1 -1
- package/dist/components/bible-version-picker.stories.d.ts.map +1 -1
- package/dist/components/bible-widget-view.stories.d.ts +2 -2
- package/dist/components/bible-widget-view.stories.d.ts.map +1 -1
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/verse-of-the-day.stories.d.ts.map +1 -1
- package/dist/components/verse.stories.d.ts.map +1 -1
- package/dist/index.cjs +1016 -458
- package/dist/index.js +1015 -454
- package/dist/tailwind.css +1 -1
- package/package.json +6 -9
package/dist/index.js
CHANGED
|
@@ -12565,7 +12565,7 @@ var ApiClient = class {
|
|
|
12565
12565
|
/**
|
|
12566
12566
|
* Creates an instance of ApiClient.
|
|
12567
12567
|
*
|
|
12568
|
-
* @param config - The API configuration object containing baseUrl, timeout, and
|
|
12568
|
+
* @param config - The API configuration object containing baseUrl, timeout, and appKey.
|
|
12569
12569
|
*/
|
|
12570
12570
|
constructor(config2) {
|
|
12571
12571
|
__publicField(this, "baseURL");
|
|
@@ -12573,14 +12573,17 @@ var ApiClient = class {
|
|
|
12573
12573
|
__publicField(this, "defaultHeaders");
|
|
12574
12574
|
__publicField(this, "config");
|
|
12575
12575
|
this.config = {
|
|
12576
|
-
version: config2.version || "v1",
|
|
12577
12576
|
...config2
|
|
12578
12577
|
};
|
|
12579
|
-
|
|
12578
|
+
const apiHost = config2.apiHost || "api.youversion.com";
|
|
12579
|
+
if (!apiHost) {
|
|
12580
|
+
throw new Error("ApiClient requires a host name. Provide an apiHost in the config.");
|
|
12581
|
+
}
|
|
12582
|
+
this.baseURL = "https://" + apiHost;
|
|
12580
12583
|
this.timeout = config2.timeout || 1e4;
|
|
12581
12584
|
this.defaultHeaders = {
|
|
12582
12585
|
"Content-Type": "application/json",
|
|
12583
|
-
"X-YVP-App-Key": this.config.
|
|
12586
|
+
"X-YVP-App-Key": this.config.appKey,
|
|
12584
12587
|
"X-YVP-Installation-Id": this.config.installationId || "web-sdk-default"
|
|
12585
12588
|
};
|
|
12586
12589
|
}
|
|
@@ -12719,9 +12722,6 @@ var BibleClient = class {
|
|
|
12719
12722
|
__publicField(this, "booleanSchema", external_exports.boolean());
|
|
12720
12723
|
this.client = client;
|
|
12721
12724
|
}
|
|
12722
|
-
get rootPath() {
|
|
12723
|
-
return `/${this.client.config.version}`;
|
|
12724
|
-
}
|
|
12725
12725
|
/**
|
|
12726
12726
|
* Fetches a collection of Bible versions filtered by language ranges.
|
|
12727
12727
|
*
|
|
@@ -12737,7 +12737,7 @@ var BibleClient = class {
|
|
|
12737
12737
|
if (license_id !== void 0) {
|
|
12738
12738
|
params.license_id = license_id;
|
|
12739
12739
|
}
|
|
12740
|
-
return this.client.get(
|
|
12740
|
+
return this.client.get(`/v1/bibles`, params);
|
|
12741
12741
|
}
|
|
12742
12742
|
/**
|
|
12743
12743
|
* Fetches a Bible version by its ID.
|
|
@@ -12746,7 +12746,7 @@ var BibleClient = class {
|
|
|
12746
12746
|
*/
|
|
12747
12747
|
async getVersion(id) {
|
|
12748
12748
|
this.versionIdSchema.parse(id);
|
|
12749
|
-
return this.client.get(
|
|
12749
|
+
return this.client.get(`/v1/bibles/${id}`);
|
|
12750
12750
|
}
|
|
12751
12751
|
/**
|
|
12752
12752
|
* Fetches all books for a given Bible version.
|
|
@@ -12756,7 +12756,7 @@ var BibleClient = class {
|
|
|
12756
12756
|
*/
|
|
12757
12757
|
async getBooks(versionId, canon) {
|
|
12758
12758
|
this.versionIdSchema.parse(versionId);
|
|
12759
|
-
return this.client.get(
|
|
12759
|
+
return this.client.get(`/v1/bibles/${versionId}/books`, {
|
|
12760
12760
|
...canon && { canon }
|
|
12761
12761
|
});
|
|
12762
12762
|
}
|
|
@@ -12769,7 +12769,7 @@ var BibleClient = class {
|
|
|
12769
12769
|
async getBook(versionId, book) {
|
|
12770
12770
|
this.versionIdSchema.parse(versionId);
|
|
12771
12771
|
this.bookSchema.parse(book);
|
|
12772
|
-
return this.client.get(
|
|
12772
|
+
return this.client.get(`/v1/bibles/${versionId}/books/${book}`);
|
|
12773
12773
|
}
|
|
12774
12774
|
/**
|
|
12775
12775
|
* Fetches all chapters for a specific book in a version.
|
|
@@ -12781,7 +12781,7 @@ var BibleClient = class {
|
|
|
12781
12781
|
this.versionIdSchema.parse(versionId);
|
|
12782
12782
|
this.bookSchema.parse(book);
|
|
12783
12783
|
return this.client.get(
|
|
12784
|
-
|
|
12784
|
+
`/v1/bibles/${versionId}/books/${book}/chapters`
|
|
12785
12785
|
);
|
|
12786
12786
|
}
|
|
12787
12787
|
/**
|
|
@@ -12796,7 +12796,7 @@ var BibleClient = class {
|
|
|
12796
12796
|
this.bookSchema.parse(book);
|
|
12797
12797
|
this.chapterSchema.parse(chapter);
|
|
12798
12798
|
return this.client.get(
|
|
12799
|
-
|
|
12799
|
+
`/v1/bibles/${versionId}/books/${book}/chapters/${chapter}`
|
|
12800
12800
|
);
|
|
12801
12801
|
}
|
|
12802
12802
|
/**
|
|
@@ -12811,7 +12811,7 @@ var BibleClient = class {
|
|
|
12811
12811
|
this.bookSchema.parse(book);
|
|
12812
12812
|
this.chapterSchema.parse(chapter);
|
|
12813
12813
|
return this.client.get(
|
|
12814
|
-
|
|
12814
|
+
`/v1/bibles/${versionId}/books/${book}/chapters/${chapter}/verses`
|
|
12815
12815
|
);
|
|
12816
12816
|
}
|
|
12817
12817
|
/**
|
|
@@ -12828,7 +12828,7 @@ var BibleClient = class {
|
|
|
12828
12828
|
this.chapterSchema.parse(chapter);
|
|
12829
12829
|
this.verseSchema.parse(verse);
|
|
12830
12830
|
return this.client.get(
|
|
12831
|
-
|
|
12831
|
+
`/v1/bibles/${versionId}/books/${book}/chapters/${chapter}/verses/${verse}`
|
|
12832
12832
|
);
|
|
12833
12833
|
}
|
|
12834
12834
|
/**
|
|
@@ -12869,10 +12869,7 @@ var BibleClient = class {
|
|
|
12869
12869
|
if (include_notes !== void 0) {
|
|
12870
12870
|
params.include_notes = include_notes;
|
|
12871
12871
|
}
|
|
12872
|
-
return this.client.get(
|
|
12873
|
-
`${this.rootPath}/bibles/${versionId}/passages/${usfm}`,
|
|
12874
|
-
params
|
|
12875
|
-
);
|
|
12872
|
+
return this.client.get(`/v1/bibles/${versionId}/passages/${usfm}`, params);
|
|
12876
12873
|
}
|
|
12877
12874
|
/**
|
|
12878
12875
|
* Fetches the indexing structure for a Bible version.
|
|
@@ -12881,14 +12878,14 @@ var BibleClient = class {
|
|
|
12881
12878
|
*/
|
|
12882
12879
|
async getIndex(versionId) {
|
|
12883
12880
|
this.versionIdSchema.parse(versionId);
|
|
12884
|
-
return this.client.get(
|
|
12881
|
+
return this.client.get(`/v1/bibles/${versionId}/index`);
|
|
12885
12882
|
}
|
|
12886
12883
|
/**
|
|
12887
12884
|
* Fetches the verse of the day calendar for an entire year.
|
|
12888
12885
|
* @returns A collection of VOTD objects for all days of the year.
|
|
12889
12886
|
*/
|
|
12890
12887
|
async getAllVOTDs() {
|
|
12891
|
-
return this.client.get(
|
|
12888
|
+
return this.client.get(`/v1/verse_of_the_days`);
|
|
12892
12889
|
}
|
|
12893
12890
|
/**
|
|
12894
12891
|
* Fetches the passage_id for the Verse Of The Day.
|
|
@@ -12906,7 +12903,7 @@ var BibleClient = class {
|
|
|
12906
12903
|
async getVOTD(day) {
|
|
12907
12904
|
const daySchema = external_exports.number().int().min(1).max(366);
|
|
12908
12905
|
daySchema.parse(day);
|
|
12909
|
-
return this.client.get(
|
|
12906
|
+
return this.client.get(`/v1/verse_of_the_days/${day}`);
|
|
12910
12907
|
}
|
|
12911
12908
|
};
|
|
12912
12909
|
var LanguagesClient = class {
|
|
@@ -12923,9 +12920,6 @@ var LanguagesClient = class {
|
|
|
12923
12920
|
__publicField(this, "countrySchema", external_exports.string().trim().length(2, "Country code must be a 2-character ISO 3166-1 alpha-2 code").toUpperCase());
|
|
12924
12921
|
this.client = client;
|
|
12925
12922
|
}
|
|
12926
|
-
get rootPath() {
|
|
12927
|
-
return `/${this.client.config.version}`;
|
|
12928
|
-
}
|
|
12929
12923
|
/**
|
|
12930
12924
|
* Fetches a collection of languages supported in the Platform.
|
|
12931
12925
|
* @param options Query parameters for pagination and filtering (country is required).
|
|
@@ -12943,7 +12937,7 @@ var LanguagesClient = class {
|
|
|
12943
12937
|
if (options.page_token !== void 0) {
|
|
12944
12938
|
params.page_token = options.page_token;
|
|
12945
12939
|
}
|
|
12946
|
-
return this.client.get(
|
|
12940
|
+
return this.client.get(`/v1/languages`, params);
|
|
12947
12941
|
}
|
|
12948
12942
|
/**
|
|
12949
12943
|
* Fetches details about a specific language in the Platform.
|
|
@@ -12952,7 +12946,7 @@ var LanguagesClient = class {
|
|
|
12952
12946
|
*/
|
|
12953
12947
|
async getLanguage(languageId) {
|
|
12954
12948
|
this.languageIdSchema.parse(languageId);
|
|
12955
|
-
return this.client.get(
|
|
12949
|
+
return this.client.get(`/v1/languages/${languageId}`);
|
|
12956
12950
|
}
|
|
12957
12951
|
};
|
|
12958
12952
|
var _a;
|
|
@@ -12969,11 +12963,11 @@ var YouVersionPlatformConfiguration = (_a = class {
|
|
|
12969
12963
|
localStorage.setItem("x-yvp-installation-id", newId);
|
|
12970
12964
|
return newId;
|
|
12971
12965
|
}
|
|
12972
|
-
static get
|
|
12973
|
-
return this.
|
|
12966
|
+
static get appKey() {
|
|
12967
|
+
return this._appKey;
|
|
12974
12968
|
}
|
|
12975
|
-
static set
|
|
12976
|
-
this.
|
|
12969
|
+
static set appKey(value) {
|
|
12970
|
+
this._appKey = value;
|
|
12977
12971
|
}
|
|
12978
12972
|
static get installationId() {
|
|
12979
12973
|
if (!this._installationId) {
|
|
@@ -13011,7 +13005,7 @@ var YouVersionPlatformConfiguration = (_a = class {
|
|
|
13011
13005
|
static set previewUserInfo(value) {
|
|
13012
13006
|
this._previewUserInfo = value;
|
|
13013
13007
|
}
|
|
13014
|
-
}, __publicField(_a, "
|
|
13008
|
+
}, __publicField(_a, "_appKey", null), __publicField(_a, "_installationId", null), __publicField(_a, "_accessToken", null), __publicField(_a, "_apiHost", "api.youversion.com"), __publicField(_a, "_isPreviewMode", false), __publicField(_a, "_previewUserInfo", null), _a);
|
|
13015
13009
|
var HighlightsClient = class {
|
|
13016
13010
|
/**
|
|
13017
13011
|
* Creates a new HighlightsClient instance.
|
|
@@ -13024,9 +13018,6 @@ var HighlightsClient = class {
|
|
|
13024
13018
|
__publicField(this, "colorSchema", external_exports.string().regex(/^[0-9a-f]{6}$/i, "Color must be a 6-character hex string without #"));
|
|
13025
13019
|
this.client = client;
|
|
13026
13020
|
}
|
|
13027
|
-
get rootPath() {
|
|
13028
|
-
return `/${this.client.config.version}`;
|
|
13029
|
-
}
|
|
13030
13021
|
/**
|
|
13031
13022
|
* Gets the authentication token, either from the provided parameter or from the platform configuration.
|
|
13032
13023
|
* @param lat Optional explicit long access token. If not provided, retrieves from YouVersionPlatformConfiguration.
|
|
@@ -13096,7 +13087,7 @@ var HighlightsClient = class {
|
|
|
13096
13087
|
this.validatePassageId(options.passage_id);
|
|
13097
13088
|
params.passage_id = options.passage_id;
|
|
13098
13089
|
}
|
|
13099
|
-
return this.client.get(
|
|
13090
|
+
return this.client.get(`/v1/highlights`, params);
|
|
13100
13091
|
}
|
|
13101
13092
|
/**
|
|
13102
13093
|
* Creates or updates a highlight on a passage.
|
|
@@ -13111,7 +13102,7 @@ var HighlightsClient = class {
|
|
|
13111
13102
|
this.validatePassageId(data.passage_id);
|
|
13112
13103
|
this.validateColor(data.color);
|
|
13113
13104
|
const token = this.getAuthToken(lat);
|
|
13114
|
-
return this.client.post(
|
|
13105
|
+
return this.client.post(`/v1/highlights`, data, { lat: token });
|
|
13115
13106
|
}
|
|
13116
13107
|
/**
|
|
13117
13108
|
* Clears highlights for a passage.
|
|
@@ -13131,7 +13122,7 @@ var HighlightsClient = class {
|
|
|
13131
13122
|
this.validateVersionId(options.version_id);
|
|
13132
13123
|
params.version_id = options.version_id;
|
|
13133
13124
|
}
|
|
13134
|
-
await this.client.delete(
|
|
13125
|
+
await this.client.delete(`/v1/highlights/${passageId}`, params);
|
|
13135
13126
|
}
|
|
13136
13127
|
};
|
|
13137
13128
|
var AuthClient = class {
|
|
@@ -13415,13 +13406,13 @@ var YouVersionAPI = class {
|
|
|
13415
13406
|
Accept: "application/json",
|
|
13416
13407
|
"Content-Type": "application/json"
|
|
13417
13408
|
};
|
|
13418
|
-
const
|
|
13419
|
-
if (
|
|
13420
|
-
headers["X-App-
|
|
13409
|
+
const appKey = YouVersionPlatformConfiguration.appKey;
|
|
13410
|
+
if (appKey) {
|
|
13411
|
+
headers["X-YVP-App-Key"] = appKey;
|
|
13421
13412
|
}
|
|
13422
13413
|
const installationId = YouVersionPlatformConfiguration.installationId;
|
|
13423
13414
|
if (installationId) {
|
|
13424
|
-
headers["
|
|
13415
|
+
headers["X-YVP-Installation-ID"] = installationId;
|
|
13425
13416
|
}
|
|
13426
13417
|
const request = new Request(url2.toString(), {
|
|
13427
13418
|
headers
|
|
@@ -13433,15 +13424,15 @@ var URLBuilder = class {
|
|
|
13433
13424
|
static get baseURL() {
|
|
13434
13425
|
return new URL(`https://${YouVersionPlatformConfiguration.apiHost}`);
|
|
13435
13426
|
}
|
|
13436
|
-
static authURL(
|
|
13437
|
-
if (typeof
|
|
13438
|
-
throw new Error("
|
|
13427
|
+
static authURL(appKey, requiredPermissions = /* @__PURE__ */ new Set(), optionalPermissions = /* @__PURE__ */ new Set()) {
|
|
13428
|
+
if (typeof appKey !== "string" || appKey.trim().length === 0) {
|
|
13429
|
+
throw new Error("appKey must be a non-empty string");
|
|
13439
13430
|
}
|
|
13440
13431
|
try {
|
|
13441
13432
|
const url2 = new URL(this.baseURL);
|
|
13442
13433
|
url2.pathname = "/auth/login";
|
|
13443
13434
|
const searchParams = new URLSearchParams();
|
|
13444
|
-
searchParams.append("
|
|
13435
|
+
searchParams.append("APP_KEY", appKey);
|
|
13445
13436
|
searchParams.append("language", "en");
|
|
13446
13437
|
if (requiredPermissions.size > 0) {
|
|
13447
13438
|
const requiredList = Array.from(requiredPermissions).map((p) => p.toString());
|
|
@@ -13503,11 +13494,11 @@ var YouVersionAPIUsers = class {
|
|
|
13503
13494
|
if (!optionalPermissions || !(optionalPermissions instanceof Set)) {
|
|
13504
13495
|
throw new Error("Invalid optionalPermissions: must be a Set");
|
|
13505
13496
|
}
|
|
13506
|
-
const
|
|
13507
|
-
if (!
|
|
13508
|
-
throw new Error("YouVersionPlatformConfiguration.
|
|
13497
|
+
const appKey = YouVersionPlatformConfiguration.appKey;
|
|
13498
|
+
if (!appKey) {
|
|
13499
|
+
throw new Error("YouVersionPlatformConfiguration.appKey must be set before calling signIn");
|
|
13509
13500
|
}
|
|
13510
|
-
const url2 = URLBuilder.authURL(
|
|
13501
|
+
const url2 = URLBuilder.authURL(appKey, requiredPermissions, optionalPermissions);
|
|
13511
13502
|
const strategy = AuthenticationStrategyRegistry.get();
|
|
13512
13503
|
const callbackUrl = await strategy.authenticate(url2);
|
|
13513
13504
|
const result = new SignInWithYouVersionResult(callbackUrl);
|
|
@@ -14153,7 +14144,7 @@ function Root3({
|
|
|
14153
14144
|
/* @__PURE__ */ jsx6(
|
|
14154
14145
|
Accordion,
|
|
14155
14146
|
{
|
|
14156
|
-
className: "yv:relative yv:overflow-y-auto yv:bg-background yv:mx-6
|
|
14147
|
+
className: "yv:relative yv:overflow-y-auto yv:bg-background yv:mx-6",
|
|
14157
14148
|
type: "single",
|
|
14158
14149
|
collapsible: true,
|
|
14159
14150
|
defaultValue: defaultBook || book || "GEN",
|
|
@@ -14221,207 +14212,937 @@ function Trigger3({ asChild = true, children, ...props }) {
|
|
|
14221
14212
|
const { books, loading } = useBooks(versionId);
|
|
14222
14213
|
const currentBook = books?.data?.find((bookItem) => bookItem.id === book);
|
|
14223
14214
|
const buttonText = loading ? "Loading..." : `${currentBook?.title || "Select a chapter"}${chapter ? ` ${chapter}` : ""}`;
|
|
14224
|
-
|
|
14215
|
+
const content = typeof children === "function" ? children({ book, chapter, currentBook, loading }) : children || /* @__PURE__ */ jsx6(Button, { variant: background === "light" ? "outline" : "default", children: buttonText });
|
|
14216
|
+
return /* @__PURE__ */ jsx6(PopoverTrigger, { asChild, ...props, children: content });
|
|
14225
14217
|
}
|
|
14226
14218
|
var BibleChapterPicker = Object.assign({}, { Root: Root3, Trigger: Trigger3 });
|
|
14227
14219
|
|
|
14228
|
-
// src/components/
|
|
14229
|
-
import
|
|
14230
|
-
import {
|
|
14220
|
+
// src/components/bible-reader.tsx
|
|
14221
|
+
import { createContext as createContext3, useContext as useContext3, useMemo as useMemo3 } from "react";
|
|
14222
|
+
import { useControllableState as useControllableState3 } from "@radix-ui/react-use-controllable-state";
|
|
14223
|
+
import { useBooks as useBooks2, useVersion as useVersion2 } from "@youversion/platform-react-hooks";
|
|
14231
14224
|
|
|
14232
|
-
// src/
|
|
14225
|
+
// src/components/bible-version-picker.tsx
|
|
14226
|
+
import { createContext as createContext2, useContext as useContext2, useState as useState2, useMemo as useMemo2, useRef as useRef2 } from "react";
|
|
14227
|
+
import { useControllableState as useControllableState2 } from "@radix-ui/react-use-controllable-state";
|
|
14233
14228
|
import {
|
|
14234
|
-
|
|
14235
|
-
|
|
14236
|
-
|
|
14237
|
-
|
|
14238
|
-
|
|
14239
|
-
} from "react";
|
|
14229
|
+
useFilteredVersions,
|
|
14230
|
+
useVersion,
|
|
14231
|
+
useVersions,
|
|
14232
|
+
useLanguages
|
|
14233
|
+
} from "@youversion/platform-react-hooks";
|
|
14240
14234
|
|
|
14241
|
-
// src/
|
|
14242
|
-
import
|
|
14243
|
-
import {
|
|
14244
|
-
|
|
14245
|
-
|
|
14246
|
-
|
|
14247
|
-
|
|
14248
|
-
|
|
14249
|
-
|
|
14250
|
-
|
|
14251
|
-
|
|
14252
|
-
|
|
14253
|
-
|
|
14254
|
-
if (onError) {
|
|
14255
|
-
onError(error46, errorInfo);
|
|
14235
|
+
// src/components/ui/item.tsx
|
|
14236
|
+
import "react";
|
|
14237
|
+
import { Slot as Slot2 } from "@radix-ui/react-slot";
|
|
14238
|
+
import { cva as cva3 } from "class-variance-authority";
|
|
14239
|
+
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
14240
|
+
function ItemGroup({ className, ...props }) {
|
|
14241
|
+
return /* @__PURE__ */ jsx7(
|
|
14242
|
+
"div",
|
|
14243
|
+
{
|
|
14244
|
+
role: "list",
|
|
14245
|
+
"data-slot": "item-group",
|
|
14246
|
+
className: cn("yv:group/item-group yv:flex yv:flex-col", className),
|
|
14247
|
+
...props
|
|
14256
14248
|
}
|
|
14257
|
-
|
|
14258
|
-
|
|
14249
|
+
);
|
|
14250
|
+
}
|
|
14251
|
+
var itemVariants = cva3(
|
|
14252
|
+
"yv:group/item yv:flex yv:items-center yv:border yv:border-transparent yv:text-sm yv:rounded-md yv:transition-colors yv:[a]:hover:bg-accent/50 yv:[a]:transition-colors yv:duration-100 yv:flex-wrap yv:outline-none yv:focus-visible:border-ring yv:focus-visible:ring-ring/50 yv:focus-visible:ring-[3px]",
|
|
14253
|
+
{
|
|
14254
|
+
variants: {
|
|
14255
|
+
variant: {
|
|
14256
|
+
default: "yv:bg-transparent",
|
|
14257
|
+
outline: "yv:border-border",
|
|
14258
|
+
muted: "yv:bg-muted/50"
|
|
14259
|
+
},
|
|
14260
|
+
size: {
|
|
14261
|
+
default: "yv:p-4 yv:gap-4 yv:",
|
|
14262
|
+
sm: "yv:py-3 yv:px-4 yv:gap-2.5"
|
|
14263
|
+
}
|
|
14264
|
+
},
|
|
14265
|
+
defaultVariants: {
|
|
14266
|
+
variant: "default",
|
|
14267
|
+
size: "default"
|
|
14259
14268
|
}
|
|
14260
14269
|
}
|
|
14261
|
-
|
|
14262
|
-
|
|
14263
|
-
|
|
14264
|
-
|
|
14265
|
-
|
|
14266
|
-
|
|
14267
|
-
|
|
14270
|
+
);
|
|
14271
|
+
function Item2({
|
|
14272
|
+
className,
|
|
14273
|
+
variant = "default",
|
|
14274
|
+
size = "default",
|
|
14275
|
+
asChild = false,
|
|
14276
|
+
...props
|
|
14277
|
+
}) {
|
|
14278
|
+
const Comp = asChild ? Slot2 : "div";
|
|
14279
|
+
return /* @__PURE__ */ jsx7(
|
|
14280
|
+
Comp,
|
|
14281
|
+
{
|
|
14282
|
+
"data-slot": "item",
|
|
14283
|
+
"data-variant": variant,
|
|
14284
|
+
"data-size": size,
|
|
14285
|
+
className: cn(itemVariants({ variant, size, className })),
|
|
14286
|
+
...props
|
|
14287
|
+
}
|
|
14288
|
+
);
|
|
14289
|
+
}
|
|
14290
|
+
var itemMediaVariants = cva3(
|
|
14291
|
+
"yv:flex yv:shrink-0 yv:items-center yv:justify-center yv:gap-2 yv:group-has-[[data-slot=item-description]]/item:self-start yv:[&_svg]:pointer-events-none yv:group-has-[[data-slot=item-description]]/item:translate-y-0.5",
|
|
14292
|
+
{
|
|
14293
|
+
variants: {
|
|
14294
|
+
variant: {
|
|
14295
|
+
default: "yv:bg-transparent",
|
|
14296
|
+
icon: "yv:size-8 yv:border yv:rounded-sm yv:bg-muted yv:[&_svg:not([class*=size-])]:size-4",
|
|
14297
|
+
image: "yv:size-10 yv:rounded-sm yv:overflow-hidden yv:[&_img]:size-full yv:[&_img]:object-cover"
|
|
14268
14298
|
}
|
|
14269
|
-
|
|
14270
|
-
|
|
14271
|
-
|
|
14272
|
-
isDevelopment && error46 && /* @__PURE__ */ jsxs3("details", { style: { marginTop: "10px" }, children: [
|
|
14273
|
-
/* @__PURE__ */ jsx7("summary", { children: "Error details (development only)" }),
|
|
14274
|
-
/* @__PURE__ */ jsx7("pre", { style: { textAlign: "left", overflow: "auto" }, children: error46.toString() })
|
|
14275
|
-
] })
|
|
14276
|
-
] });
|
|
14299
|
+
},
|
|
14300
|
+
defaultVariants: {
|
|
14301
|
+
variant: "default"
|
|
14277
14302
|
}
|
|
14278
|
-
return children;
|
|
14279
14303
|
}
|
|
14280
|
-
|
|
14304
|
+
);
|
|
14305
|
+
function ItemMedia({
|
|
14306
|
+
className,
|
|
14307
|
+
variant = "default",
|
|
14308
|
+
...props
|
|
14309
|
+
}) {
|
|
14310
|
+
return /* @__PURE__ */ jsx7(
|
|
14311
|
+
"div",
|
|
14312
|
+
{
|
|
14313
|
+
"data-slot": "item-media",
|
|
14314
|
+
"data-variant": variant,
|
|
14315
|
+
className: cn(itemMediaVariants({ variant, className })),
|
|
14316
|
+
...props
|
|
14317
|
+
}
|
|
14318
|
+
);
|
|
14319
|
+
}
|
|
14320
|
+
function ItemContent({ className, ...props }) {
|
|
14321
|
+
return /* @__PURE__ */ jsx7(
|
|
14322
|
+
"div",
|
|
14323
|
+
{
|
|
14324
|
+
"data-slot": "item-content",
|
|
14325
|
+
className: cn(
|
|
14326
|
+
"yv:flex yv:flex-1 yv:flex-col yv:gap-1 yv:[&+[data-slot=item-content]]:flex-none",
|
|
14327
|
+
className
|
|
14328
|
+
),
|
|
14329
|
+
...props
|
|
14330
|
+
}
|
|
14331
|
+
);
|
|
14332
|
+
}
|
|
14333
|
+
function ItemTitle({ className, ...props }) {
|
|
14334
|
+
return /* @__PURE__ */ jsx7(
|
|
14335
|
+
"div",
|
|
14336
|
+
{
|
|
14337
|
+
"data-slot": "item-title",
|
|
14338
|
+
className: cn(
|
|
14339
|
+
"yv:flex yv:w-fit yv:items-center yv:gap-2 yv:text-sm yv:leading-snug yv:font-medium",
|
|
14340
|
+
className
|
|
14341
|
+
),
|
|
14342
|
+
...props
|
|
14343
|
+
}
|
|
14344
|
+
);
|
|
14345
|
+
}
|
|
14346
|
+
function ItemDescription({ className, ...props }) {
|
|
14347
|
+
return /* @__PURE__ */ jsx7(
|
|
14348
|
+
"p",
|
|
14349
|
+
{
|
|
14350
|
+
"data-slot": "item-description",
|
|
14351
|
+
className: cn(
|
|
14352
|
+
"yv:text-muted-foreground yv:line-clamp-2 yv:text-sm yv:leading-normal yv:font-normal yv:text-balance",
|
|
14353
|
+
"yv:[&>a:hover]:text-primary yv:[&>a]:underline yv:[&>a]:underline-offset-4",
|
|
14354
|
+
className
|
|
14355
|
+
),
|
|
14356
|
+
...props
|
|
14357
|
+
}
|
|
14358
|
+
);
|
|
14359
|
+
}
|
|
14281
14360
|
|
|
14282
|
-
// src/
|
|
14361
|
+
// src/components/bible-version-picker.tsx
|
|
14362
|
+
import { Search as Search2, Globe, X as XIcon2, ArrowLeft } from "lucide-react";
|
|
14363
|
+
|
|
14364
|
+
// src/components/ui/badge.tsx
|
|
14365
|
+
import "react";
|
|
14366
|
+
import { Slot as Slot3 } from "@radix-ui/react-slot";
|
|
14367
|
+
import { cva as cva4 } from "class-variance-authority";
|
|
14283
14368
|
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
14284
|
-
var
|
|
14285
|
-
|
|
14286
|
-
|
|
14287
|
-
|
|
14288
|
-
|
|
14289
|
-
|
|
14290
|
-
|
|
14291
|
-
|
|
14292
|
-
|
|
14293
|
-
isAuthenticated: false,
|
|
14294
|
-
isLoading: false,
|
|
14295
|
-
accessToken: null,
|
|
14296
|
-
result: null,
|
|
14297
|
-
error: null
|
|
14298
|
-
});
|
|
14299
|
-
useEffect2(() => {
|
|
14300
|
-
const initializeAuth = () => {
|
|
14301
|
-
YouVersionPlatformConfiguration.appId = config2.appId;
|
|
14302
|
-
YouVersionPlatformConfiguration.installationId = config2.installationId ?? null;
|
|
14303
|
-
const strategy = new WebAuthenticationStrategy({
|
|
14304
|
-
redirectUri: config2.redirectUri || ""
|
|
14305
|
-
});
|
|
14306
|
-
AuthenticationStrategyRegistry.register(strategy);
|
|
14307
|
-
const existingToken = YouVersionPlatformConfiguration.accessToken;
|
|
14308
|
-
if (existingToken) {
|
|
14309
|
-
setAuthState({
|
|
14310
|
-
isAuthenticated: true,
|
|
14311
|
-
isLoading: false,
|
|
14312
|
-
accessToken: existingToken,
|
|
14313
|
-
result: null,
|
|
14314
|
-
error: null
|
|
14315
|
-
});
|
|
14316
|
-
return;
|
|
14317
|
-
}
|
|
14318
|
-
WebAuthenticationStrategy.handleCallback();
|
|
14319
|
-
const storedCallback = WebAuthenticationStrategy.getStoredCallback();
|
|
14320
|
-
if (storedCallback) {
|
|
14321
|
-
try {
|
|
14322
|
-
const result = new SignInWithYouVersionResult(storedCallback);
|
|
14323
|
-
const { accessToken, errorMsg } = result;
|
|
14324
|
-
if (accessToken) {
|
|
14325
|
-
YouVersionPlatformConfiguration.setAccessToken(accessToken);
|
|
14326
|
-
}
|
|
14327
|
-
setAuthState({
|
|
14328
|
-
isAuthenticated: !!accessToken,
|
|
14329
|
-
isLoading: false,
|
|
14330
|
-
accessToken: accessToken ?? null,
|
|
14331
|
-
result,
|
|
14332
|
-
error: errorMsg ? new Error(errorMsg) : null
|
|
14333
|
-
});
|
|
14334
|
-
} catch (error46) {
|
|
14335
|
-
setAuthState({
|
|
14336
|
-
isAuthenticated: false,
|
|
14337
|
-
isLoading: false,
|
|
14338
|
-
accessToken: null,
|
|
14339
|
-
result: null,
|
|
14340
|
-
error: error46
|
|
14341
|
-
});
|
|
14342
|
-
}
|
|
14343
|
-
} else {
|
|
14344
|
-
setAuthState({
|
|
14345
|
-
isAuthenticated: false,
|
|
14346
|
-
isLoading: false,
|
|
14347
|
-
accessToken: null,
|
|
14348
|
-
result: null,
|
|
14349
|
-
error: null
|
|
14350
|
-
});
|
|
14369
|
+
var badgeVariants = cva4(
|
|
14370
|
+
"yv:inline-flex yv:items-center yv:justify-center yv:rounded-full yv:border yv:px-2 yv:py-0.5 yv:text-xs yv:font-medium yv:w-fit yv:whitespace-nowrap yv:shrink-0 yv:[&>svg]:size-3 yv:gap-1 yv:[&>svg]:pointer-events-none yv:focus-visible:border-ring yv:focus-visible:ring-ring/50 yv:focus-visible:ring-[3px] yv:aria-invalid:ring-destructive/20 yv:dark:aria-invalid:ring-destructive/40 yv:aria-invalid:border-destructive yv:transition-[color,box-shadow] yv:overflow-hidden",
|
|
14371
|
+
{
|
|
14372
|
+
variants: {
|
|
14373
|
+
variant: {
|
|
14374
|
+
default: "yv:border-transparent yv:bg-primary yv:text-primary-foreground yv:[a&]:hover:bg-primary/90",
|
|
14375
|
+
secondary: "yv:border-transparent yv:bg-muted yv:text-muted-foreground yv:[a&]:hover:bg-muted/90",
|
|
14376
|
+
destructive: "yv:border-transparent yv:bg-destructive yv:text-white yv:[a&]:hover:bg-destructive/90 yv:focus-visible:ring-destructive/20 yv:dark:focus-visible:ring-destructive/40 yv:dark:bg-destructive/60",
|
|
14377
|
+
outline: "yv:text-foreground yv:[a&]:hover:bg-accent yv:[a&]:hover:text-accent-foreground"
|
|
14351
14378
|
}
|
|
14352
|
-
}
|
|
14353
|
-
|
|
14354
|
-
|
|
14355
|
-
const signOut = useCallback(() => {
|
|
14356
|
-
YouVersionPlatformConfiguration.setAccessToken(null);
|
|
14357
|
-
setAuthState({
|
|
14358
|
-
isAuthenticated: false,
|
|
14359
|
-
isLoading: false,
|
|
14360
|
-
accessToken: null,
|
|
14361
|
-
result: null,
|
|
14362
|
-
error: null
|
|
14363
|
-
});
|
|
14364
|
-
}, []);
|
|
14365
|
-
const fetchUserInfo = useCallback(async () => {
|
|
14366
|
-
if (!authState.isAuthenticated || !authState.accessToken) {
|
|
14367
|
-
throw new Error("User is not authenticated");
|
|
14379
|
+
},
|
|
14380
|
+
defaultVariants: {
|
|
14381
|
+
variant: "default"
|
|
14368
14382
|
}
|
|
14369
|
-
|
|
14370
|
-
|
|
14371
|
-
|
|
14372
|
-
|
|
14373
|
-
|
|
14374
|
-
|
|
14375
|
-
|
|
14376
|
-
|
|
14377
|
-
|
|
14378
|
-
return /* @__PURE__ */ jsx8(
|
|
14383
|
+
}
|
|
14384
|
+
);
|
|
14385
|
+
function Badge({
|
|
14386
|
+
className,
|
|
14387
|
+
variant,
|
|
14388
|
+
asChild = false,
|
|
14389
|
+
...props
|
|
14390
|
+
}) {
|
|
14391
|
+
const Comp = asChild ? Slot3 : "span";
|
|
14392
|
+
return /* @__PURE__ */ jsx8(Comp, { "data-slot": "badge", className: cn(badgeVariants({ variant }), className), ...props });
|
|
14379
14393
|
}
|
|
14380
|
-
|
|
14381
|
-
|
|
14394
|
+
|
|
14395
|
+
// src/components/bible-version-picker.tsx
|
|
14396
|
+
import { jsx as jsx9, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
14397
|
+
var BibleVersionPickerContext = createContext2(null);
|
|
14398
|
+
function useBibleVersionPickerContext() {
|
|
14399
|
+
const context = useContext2(BibleVersionPickerContext);
|
|
14382
14400
|
if (!context) {
|
|
14383
|
-
throw new Error("
|
|
14401
|
+
throw new Error("BibleVersionPicker components must be used within BibleVersionPicker.Root");
|
|
14384
14402
|
}
|
|
14385
14403
|
return context;
|
|
14386
14404
|
}
|
|
14387
|
-
|
|
14388
|
-
|
|
14389
|
-
|
|
14390
|
-
|
|
14391
|
-
|
|
14392
|
-
|
|
14393
|
-
|
|
14394
|
-
|
|
14395
|
-
|
|
14396
|
-
|
|
14397
|
-
|
|
14398
|
-
|
|
14399
|
-
|
|
14405
|
+
function Root4({
|
|
14406
|
+
versionId: controlledVersionId,
|
|
14407
|
+
onVersionChange,
|
|
14408
|
+
background = "light",
|
|
14409
|
+
side = "top",
|
|
14410
|
+
children
|
|
14411
|
+
}) {
|
|
14412
|
+
const [versionId, setVersionIdState] = useControllableState2({
|
|
14413
|
+
prop: controlledVersionId,
|
|
14414
|
+
defaultProp: controlledVersionId,
|
|
14415
|
+
onChange: onVersionChange
|
|
14416
|
+
});
|
|
14417
|
+
const [selectedLanguageId, setSelectedLanguageId] = useState2("en");
|
|
14418
|
+
const [searchQuery, setSearchQuery] = useState2("");
|
|
14419
|
+
const [isLanguagesOpen, setIsLanguagesOpen] = useState2(false);
|
|
14420
|
+
const { languages: hookLanguages } = useLanguages({ country: "US" });
|
|
14421
|
+
const languages = useMemo2(() => {
|
|
14422
|
+
if (hookLanguages?.data && hookLanguages.data.length > 0) {
|
|
14423
|
+
return hookLanguages.data.map((lang) => ({
|
|
14424
|
+
id: lang.id || "",
|
|
14425
|
+
englishName: lang.display_names?.en || lang.language,
|
|
14426
|
+
name: lang.display_names?.[lang.id] || lang.language
|
|
14427
|
+
}));
|
|
14428
|
+
}
|
|
14429
|
+
return [];
|
|
14430
|
+
}, [hookLanguages?.data]);
|
|
14431
|
+
const { versions } = useVersions(selectedLanguageId);
|
|
14432
|
+
const filteredVersions = useFilteredVersions(
|
|
14433
|
+
versions?.data || [],
|
|
14434
|
+
searchQuery,
|
|
14435
|
+
selectedLanguageId
|
|
14400
14436
|
);
|
|
14401
|
-
|
|
14402
|
-
|
|
14403
|
-
|
|
14404
|
-
|
|
14405
|
-
|
|
14406
|
-
|
|
14437
|
+
const contextValue = {
|
|
14438
|
+
versionId,
|
|
14439
|
+
setVersionId: setVersionIdState,
|
|
14440
|
+
background,
|
|
14441
|
+
side,
|
|
14442
|
+
languages,
|
|
14443
|
+
selectedLanguageId,
|
|
14444
|
+
setSelectedLanguageId,
|
|
14445
|
+
searchQuery,
|
|
14446
|
+
setSearchQuery,
|
|
14447
|
+
filteredVersions,
|
|
14448
|
+
isLanguagesOpen,
|
|
14449
|
+
setIsLanguagesOpen
|
|
14450
|
+
};
|
|
14451
|
+
return /* @__PURE__ */ jsx9(BibleVersionPickerContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx9(Popover, { children }) });
|
|
14452
|
+
}
|
|
14453
|
+
function Trigger4({ asChild = true, children, ...props }) {
|
|
14454
|
+
const { versionId, background } = useBibleVersionPickerContext();
|
|
14455
|
+
const { version: version2, loading } = useVersion(versionId);
|
|
14456
|
+
const content = typeof children === "function" ? children({ version: version2, loading }) : children || /* @__PURE__ */ jsx9(
|
|
14457
|
+
Button,
|
|
14458
|
+
{
|
|
14459
|
+
variant: background === "light" ? "outline" : "default",
|
|
14460
|
+
className: "yv:cursor-pointer",
|
|
14461
|
+
children: version2?.local_abbreviation || "Select"
|
|
14462
|
+
}
|
|
14463
|
+
);
|
|
14464
|
+
return /* @__PURE__ */ jsx9(PopoverTrigger, { asChild, ...props, children: content });
|
|
14407
14465
|
}
|
|
14408
|
-
|
|
14409
|
-
|
|
14410
|
-
|
|
14411
|
-
|
|
14412
|
-
|
|
14413
|
-
|
|
14414
|
-
|
|
14466
|
+
function Content3() {
|
|
14467
|
+
const {
|
|
14468
|
+
searchQuery,
|
|
14469
|
+
setSearchQuery,
|
|
14470
|
+
filteredVersions,
|
|
14471
|
+
versionId,
|
|
14472
|
+
setVersionId,
|
|
14473
|
+
background,
|
|
14474
|
+
side,
|
|
14475
|
+
setIsLanguagesOpen,
|
|
14476
|
+
isLanguagesOpen,
|
|
14477
|
+
languages,
|
|
14478
|
+
selectedLanguageId,
|
|
14479
|
+
setSelectedLanguageId
|
|
14480
|
+
} = useBibleVersionPickerContext();
|
|
14481
|
+
const closeRef = useRef2(null);
|
|
14482
|
+
const handleSelectLanguage = (languageId) => {
|
|
14483
|
+
setSelectedLanguageId(languageId);
|
|
14484
|
+
setIsLanguagesOpen(false);
|
|
14485
|
+
};
|
|
14486
|
+
const handleSelectVersion = (versionId2) => {
|
|
14487
|
+
setVersionId(versionId2);
|
|
14488
|
+
setIsLanguagesOpen(false);
|
|
14489
|
+
closeRef.current?.click();
|
|
14490
|
+
};
|
|
14491
|
+
return /* @__PURE__ */ jsxs3(
|
|
14492
|
+
PopoverContent,
|
|
14415
14493
|
{
|
|
14416
|
-
|
|
14417
|
-
|
|
14418
|
-
|
|
14419
|
-
|
|
14420
|
-
"aria-label": "YouVersion",
|
|
14421
|
-
...props,
|
|
14494
|
+
"data-yv-sdk": true,
|
|
14495
|
+
"data-yv-theme": background === "dark" ? "dark" : "light",
|
|
14496
|
+
side,
|
|
14497
|
+
className: "yv:flex yv:flex-col yv:bg-background yv:p-0 yv:h-[66vh] yv:max-h-[66vh] yv:w-96 yv:sm:w-sm yv:overflow-hidden yv:rounded-2xl yv:border-0 yv:shadow-lg",
|
|
14422
14498
|
children: [
|
|
14423
|
-
/* @__PURE__ */
|
|
14424
|
-
"
|
|
14499
|
+
/* @__PURE__ */ jsxs3(
|
|
14500
|
+
"div",
|
|
14501
|
+
{
|
|
14502
|
+
className: `yv:h-[66vh] yv:absolute yv:inset-0 yv:flex yv:flex-col yv:transition-all yv:duration-300 yv:rounded-2xl yv:origin-center ${isLanguagesOpen ? "yv:opacity-0 yv:pointer-events-none yv:blur-sm yv:scale-95" : "yv:opacity-100 yv:pointer-events-auto yv:blur-none yv:scale-100"}`,
|
|
14503
|
+
children: [
|
|
14504
|
+
/* @__PURE__ */ jsxs3("section", { className: "yv:bg-muted yv:py-3 yv:w-full yv:rounded-t-2xl yv:px-4 yv:border-b yv:border-border yv:flex yv:flex-row yv:justify-between yv:items-center", children: [
|
|
14505
|
+
/* @__PURE__ */ jsx9("div", { className: "yv:flex yv:flex-col", children: /* @__PURE__ */ jsx9("h2", { className: "yv:font-bold yv:text-base yv:line-clamp-1", children: "Bible Versions" }) }),
|
|
14506
|
+
/* @__PURE__ */ jsxs3("div", { className: "yv:flex yv:items-center yv:gap-2", children: [
|
|
14507
|
+
/* @__PURE__ */ jsxs3(
|
|
14508
|
+
Button,
|
|
14509
|
+
{
|
|
14510
|
+
"aria-label": "Select language",
|
|
14511
|
+
className: "yv:bg-card yv:border yv:border-transparent yv:hover:bg-card yv:hover:border-border",
|
|
14512
|
+
size: "sm",
|
|
14513
|
+
onClick: () => setIsLanguagesOpen(true),
|
|
14514
|
+
variant: "secondary",
|
|
14515
|
+
children: [
|
|
14516
|
+
/* @__PURE__ */ jsx9(Globe, { size: 16 }),
|
|
14517
|
+
/* @__PURE__ */ jsx9("span", { className: "yv:text-sm yv:font-medium yv:line-clamp-1", children: languages.find((language) => language.id === selectedLanguageId)?.englishName }),
|
|
14518
|
+
/* @__PURE__ */ jsx9(
|
|
14519
|
+
Badge,
|
|
14520
|
+
{
|
|
14521
|
+
variant: "secondary",
|
|
14522
|
+
className: "yv:h-5 yv:min-w-5 yv:rounded-full yv:px-1 yv:font-mono yv:tabular-nums",
|
|
14523
|
+
children: filteredVersions.length
|
|
14524
|
+
}
|
|
14525
|
+
)
|
|
14526
|
+
]
|
|
14527
|
+
}
|
|
14528
|
+
),
|
|
14529
|
+
/* @__PURE__ */ jsx9(PopoverClose, { asChild: true, children: /* @__PURE__ */ jsxs3(
|
|
14530
|
+
Button,
|
|
14531
|
+
{
|
|
14532
|
+
ref: closeRef,
|
|
14533
|
+
variant: "ghost",
|
|
14534
|
+
size: "icon",
|
|
14535
|
+
className: "yv:w-8 yv:h-8 yv:text-muted-foreground",
|
|
14536
|
+
children: [
|
|
14537
|
+
/* @__PURE__ */ jsx9(XIcon2, { size: 16 }),
|
|
14538
|
+
/* @__PURE__ */ jsx9("span", { className: "yv:sr-only", children: "Close version selector" })
|
|
14539
|
+
]
|
|
14540
|
+
}
|
|
14541
|
+
) })
|
|
14542
|
+
] })
|
|
14543
|
+
] }),
|
|
14544
|
+
/* @__PURE__ */ jsx9("div", { className: "yv:flex-1 yv:overflow-y-auto yv:py-2", children: filteredVersions && filteredVersions.length > 0 ? /* @__PURE__ */ jsx9(ItemGroup, { children: filteredVersions.map((version2) => /* @__PURE__ */ jsx9(
|
|
14545
|
+
Item2,
|
|
14546
|
+
{
|
|
14547
|
+
className: cn(
|
|
14548
|
+
"yv:hover:bg-muted yv:rounded-[8px]",
|
|
14549
|
+
versionId === version2.id ? "yv:bg-muted" : ""
|
|
14550
|
+
),
|
|
14551
|
+
size: "sm",
|
|
14552
|
+
variant: "default",
|
|
14553
|
+
role: "listitem",
|
|
14554
|
+
asChild: true,
|
|
14555
|
+
"aria-label": version2.title,
|
|
14556
|
+
children: /* @__PURE__ */ jsxs3(
|
|
14557
|
+
"button",
|
|
14558
|
+
{
|
|
14559
|
+
type: "button",
|
|
14560
|
+
className: "yv:w-full",
|
|
14561
|
+
onClick: () => handleSelectVersion(version2.id),
|
|
14562
|
+
children: [
|
|
14563
|
+
/* @__PURE__ */ jsx9(
|
|
14564
|
+
ItemMedia,
|
|
14565
|
+
{
|
|
14566
|
+
variant: "icon",
|
|
14567
|
+
className: "yv:rounded-[8px] yv:size-12 yv:border-border",
|
|
14568
|
+
children: /* @__PURE__ */ jsx9("span", { className: "yv:font-serif yv:font-bold", children: version2.local_abbreviation })
|
|
14569
|
+
}
|
|
14570
|
+
),
|
|
14571
|
+
/* @__PURE__ */ jsx9(ItemContent, { children: /* @__PURE__ */ jsx9(ItemTitle, { className: "yv:line-clamp-2", children: version2.title }) })
|
|
14572
|
+
]
|
|
14573
|
+
}
|
|
14574
|
+
)
|
|
14575
|
+
},
|
|
14576
|
+
version2.id
|
|
14577
|
+
)) }) : /* @__PURE__ */ jsx9("div", { className: "yv:w-full yv:flex yv:items-center yv:justify-center yv:py-8 yv:text-center yv:text-muted-foreground yv:text-sm", children: "No versions found" }) }),
|
|
14578
|
+
/* @__PURE__ */ jsx9("section", { className: "yv:bg-muted yv:border-t yv:border-border yv:p-4 yv:w-full yv:rounded-b-2xl yv:flex yv:gap-3", children: /* @__PURE__ */ jsxs3("div", { className: "yv:flex-1 yv:relative", children: [
|
|
14579
|
+
/* @__PURE__ */ jsx9(
|
|
14580
|
+
Search2,
|
|
14581
|
+
{
|
|
14582
|
+
size: 13,
|
|
14583
|
+
className: "yv:absolute yv:left-3 yv:top-1/2 yv:-translate-y-1/2 yv:text-muted-foreground"
|
|
14584
|
+
}
|
|
14585
|
+
),
|
|
14586
|
+
/* @__PURE__ */ jsx9(
|
|
14587
|
+
Input,
|
|
14588
|
+
{
|
|
14589
|
+
className: "yv:rounded-3xl yv:bg-background yv:pl-9 yv:py-3 yv:border-border",
|
|
14590
|
+
type: "text",
|
|
14591
|
+
placeholder: "Search",
|
|
14592
|
+
value: searchQuery,
|
|
14593
|
+
onChange: (e) => setSearchQuery(e.target.value)
|
|
14594
|
+
}
|
|
14595
|
+
)
|
|
14596
|
+
] }) })
|
|
14597
|
+
]
|
|
14598
|
+
}
|
|
14599
|
+
),
|
|
14600
|
+
/* @__PURE__ */ jsxs3(
|
|
14601
|
+
"div",
|
|
14602
|
+
{
|
|
14603
|
+
className: `yv:h-[66vh] yv:absolute yv:inset-0 yv:flex yv:flex-col yv:transition-all yv:duration-300 yv:rounded-2xl yv:origin-center ${isLanguagesOpen ? "yv:opacity-100 yv:pointer-events-auto yv:blur-none yv:scale-100" : "yv:opacity-0 yv:pointer-events-none yv:blur-sm yv:scale-95"}`,
|
|
14604
|
+
children: [
|
|
14605
|
+
/* @__PURE__ */ jsxs3("section", { className: "yv:bg-muted yv:py-3 yv:w-full yv:rounded-t-2xl yv:px-4 yv:border-b yv:border-border yv:grid yv:grid-cols-[auto_1fr] yv:gap-2 yv:items-center", children: [
|
|
14606
|
+
/* @__PURE__ */ jsxs3(
|
|
14607
|
+
Button,
|
|
14608
|
+
{
|
|
14609
|
+
onClick: () => setIsLanguagesOpen(false),
|
|
14610
|
+
variant: "ghost",
|
|
14611
|
+
size: "icon",
|
|
14612
|
+
className: "yv:w-8 yv:h-8 yv:text-muted-foreground",
|
|
14613
|
+
children: [
|
|
14614
|
+
/* @__PURE__ */ jsx9(ArrowLeft, { size: 16 }),
|
|
14615
|
+
/* @__PURE__ */ jsx9("span", { className: "yv:sr-only", children: "Close Language selector" })
|
|
14616
|
+
]
|
|
14617
|
+
}
|
|
14618
|
+
),
|
|
14619
|
+
/* @__PURE__ */ jsx9("h2", { className: "yv:font-bold yv:text-base", children: "Select Language" })
|
|
14620
|
+
] }),
|
|
14621
|
+
/* @__PURE__ */ jsx9(ItemGroup, { className: "yv:overflow-y-auto yv:py-2", children: languages.map((language) => /* @__PURE__ */ jsx9(
|
|
14622
|
+
Item2,
|
|
14623
|
+
{
|
|
14624
|
+
className: "yv:hover:bg-muted yv:rounded-[8px]",
|
|
14625
|
+
size: "sm",
|
|
14626
|
+
role: "listitem",
|
|
14627
|
+
"aria-label": language.englishName,
|
|
14628
|
+
asChild: true,
|
|
14629
|
+
children: /* @__PURE__ */ jsxs3("button", { className: "yv:w-full", onClick: () => handleSelectLanguage(language.id), children: [
|
|
14630
|
+
/* @__PURE__ */ jsx9(ItemContent, { children: /* @__PURE__ */ jsx9(ItemTitle, { className: "yv:line-clamp-2", children: language.englishName }) }),
|
|
14631
|
+
/* @__PURE__ */ jsx9(ItemContent, { className: "flex-none text-center", children: /* @__PURE__ */ jsx9(ItemDescription, { children: language.name }) })
|
|
14632
|
+
] })
|
|
14633
|
+
},
|
|
14634
|
+
language.id
|
|
14635
|
+
)) })
|
|
14636
|
+
]
|
|
14637
|
+
}
|
|
14638
|
+
)
|
|
14639
|
+
]
|
|
14640
|
+
}
|
|
14641
|
+
);
|
|
14642
|
+
}
|
|
14643
|
+
var BibleVersionPicker = Object.assign({}, { Root: Root4, Trigger: Trigger4, Content: Content3 });
|
|
14644
|
+
|
|
14645
|
+
// src/components/verse.tsx
|
|
14646
|
+
import React8 from "react";
|
|
14647
|
+
import DOMPurify from "isomorphic-dompurify";
|
|
14648
|
+
import { usePassage } from "@youversion/platform-react-hooks";
|
|
14649
|
+
import { jsx as jsx10, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
14650
|
+
var NON_BREAKING_SPACE = "\xA0";
|
|
14651
|
+
var DOMPURIFY_CONFIG = {
|
|
14652
|
+
ALLOWED_ATTR: ["class", "style", "id"],
|
|
14653
|
+
ALLOW_DATA_ATTR: true
|
|
14654
|
+
};
|
|
14655
|
+
function yvDomTransformer(html) {
|
|
14656
|
+
if (!window || !("DOMParser" in window)) {
|
|
14657
|
+
return html;
|
|
14658
|
+
}
|
|
14659
|
+
const sanitizedHtml = DOMPurify.sanitize(html, DOMPURIFY_CONFIG);
|
|
14660
|
+
const parser = new DOMParser();
|
|
14661
|
+
const doc = parser.parseFromString(sanitizedHtml, "text/html");
|
|
14662
|
+
const paragraphs = doc.querySelectorAll(".yv-vlbl");
|
|
14663
|
+
paragraphs.forEach((p) => {
|
|
14664
|
+
const text = p.textContent || "";
|
|
14665
|
+
if (!text.endsWith(NON_BREAKING_SPACE)) {
|
|
14666
|
+
p.textContent = text + NON_BREAKING_SPACE;
|
|
14667
|
+
}
|
|
14668
|
+
});
|
|
14669
|
+
const tables = doc.querySelectorAll("table");
|
|
14670
|
+
tables.forEach((table) => {
|
|
14671
|
+
const rows = table.querySelectorAll("tr");
|
|
14672
|
+
if (rows.length === 0) return;
|
|
14673
|
+
let maxColumns = 0;
|
|
14674
|
+
rows.forEach((row) => {
|
|
14675
|
+
const cells = row.querySelectorAll("td, th");
|
|
14676
|
+
let rowColumnCount = 0;
|
|
14677
|
+
cells.forEach((cell) => {
|
|
14678
|
+
if (cell instanceof HTMLTableCellElement) {
|
|
14679
|
+
const colspan = parseInt(cell.getAttribute("colspan") || "1", 10);
|
|
14680
|
+
rowColumnCount += colspan;
|
|
14681
|
+
} else {
|
|
14682
|
+
rowColumnCount += 1;
|
|
14683
|
+
}
|
|
14684
|
+
});
|
|
14685
|
+
maxColumns = Math.max(maxColumns, rowColumnCount);
|
|
14686
|
+
});
|
|
14687
|
+
if (maxColumns > 1) {
|
|
14688
|
+
rows.forEach((row) => {
|
|
14689
|
+
const cells = row.querySelectorAll("td, th");
|
|
14690
|
+
if (cells.length === 1) {
|
|
14691
|
+
const cell = cells[0];
|
|
14692
|
+
if (cell instanceof HTMLTableCellElement) {
|
|
14693
|
+
const existingColspan = parseInt(cell.getAttribute("colspan") || "1", 10);
|
|
14694
|
+
if (existingColspan < maxColumns) {
|
|
14695
|
+
cell.setAttribute("colspan", maxColumns.toString());
|
|
14696
|
+
}
|
|
14697
|
+
}
|
|
14698
|
+
}
|
|
14699
|
+
});
|
|
14700
|
+
}
|
|
14701
|
+
});
|
|
14702
|
+
const modifiedHtml = doc.body.innerHTML;
|
|
14703
|
+
return modifiedHtml;
|
|
14704
|
+
}
|
|
14705
|
+
var Verse = {
|
|
14706
|
+
/**
|
|
14707
|
+
* Renders a single verse with superscript number and text.
|
|
14708
|
+
*
|
|
14709
|
+
* @param props - The verse properties.
|
|
14710
|
+
* @param props.number - The verse number.
|
|
14711
|
+
* @param props.text - The verse text.
|
|
14712
|
+
* @param props.size - The size variant. Defaults to 'default'.
|
|
14713
|
+
* @returns The rendered verse element.
|
|
14714
|
+
*/
|
|
14715
|
+
Text: ({ number: number4, text, size = "default" }) => {
|
|
14716
|
+
if (size === "lg") {
|
|
14717
|
+
return /* @__PURE__ */ jsxs4("span", { className: "yv:[&>p]:inline-block", children: [
|
|
14718
|
+
/* @__PURE__ */ jsx10("sup", { className: "yv:text-muted-foreground yv:align-super yv:text-[0.6em]", children: number4 }),
|
|
14719
|
+
"\xA0",
|
|
14720
|
+
/* @__PURE__ */ jsx10("span", { className: "yv:font-serif! yv:text-xl yv:text-primary", children: text }),
|
|
14721
|
+
"\xA0"
|
|
14722
|
+
] });
|
|
14723
|
+
}
|
|
14724
|
+
return /* @__PURE__ */ jsxs4("span", { className: "yv:[&>p]:inline-block", children: [
|
|
14725
|
+
/* @__PURE__ */ jsx10("sup", { className: "yv:text-muted-foreground yv:align-super yv:text-[0.6em]", children: number4 }),
|
|
14726
|
+
"\xA0",
|
|
14727
|
+
/* @__PURE__ */ jsx10("span", { className: "yv:text-primary", children: text }),
|
|
14728
|
+
"\xA0"
|
|
14729
|
+
] });
|
|
14730
|
+
},
|
|
14731
|
+
Html: ({
|
|
14732
|
+
html,
|
|
14733
|
+
fontFamily,
|
|
14734
|
+
fontSize,
|
|
14735
|
+
lineHeight,
|
|
14736
|
+
showVerseNumbers = true
|
|
14737
|
+
}) => {
|
|
14738
|
+
const [transformedHtml, setTransformedHtml] = React8.useState(html);
|
|
14739
|
+
React8.useEffect(() => {
|
|
14740
|
+
setTransformedHtml(yvDomTransformer(html));
|
|
14741
|
+
}, [html]);
|
|
14742
|
+
return /* @__PURE__ */ jsx10(
|
|
14743
|
+
"section",
|
|
14744
|
+
{
|
|
14745
|
+
style: {
|
|
14746
|
+
...fontFamily ? { "--yv-reader-font-family": fontFamily } : {},
|
|
14747
|
+
...fontSize ? { "--yv-reader-font-size": `${fontSize}px` } : {},
|
|
14748
|
+
...lineHeight ? { "--yv-reader-line-height": lineHeight } : {}
|
|
14749
|
+
},
|
|
14750
|
+
"data-show-verse-numbers": showVerseNumbers,
|
|
14751
|
+
"data-slot": "yv-bible-renderer",
|
|
14752
|
+
dangerouslySetInnerHTML: { __html: transformedHtml }
|
|
14753
|
+
}
|
|
14754
|
+
);
|
|
14755
|
+
}
|
|
14756
|
+
};
|
|
14757
|
+
var BibleTextView = ({
|
|
14758
|
+
reference,
|
|
14759
|
+
fontFamily,
|
|
14760
|
+
fontSize,
|
|
14761
|
+
lineHeight,
|
|
14762
|
+
versionId,
|
|
14763
|
+
showVerseNumbers
|
|
14764
|
+
}) => {
|
|
14765
|
+
const { passage, loading, error: error46 } = usePassage({
|
|
14766
|
+
versionId,
|
|
14767
|
+
usfm: reference,
|
|
14768
|
+
include_headings: true,
|
|
14769
|
+
include_notes: true
|
|
14770
|
+
});
|
|
14771
|
+
if (loading) {
|
|
14772
|
+
return /* @__PURE__ */ jsx10(
|
|
14773
|
+
Verse.Html,
|
|
14774
|
+
{
|
|
14775
|
+
html: "<span>Loading...</span>",
|
|
14776
|
+
fontFamily,
|
|
14777
|
+
fontSize,
|
|
14778
|
+
lineHeight,
|
|
14779
|
+
showVerseNumbers
|
|
14780
|
+
}
|
|
14781
|
+
);
|
|
14782
|
+
}
|
|
14783
|
+
if (error46) {
|
|
14784
|
+
return /* @__PURE__ */ jsx10(
|
|
14785
|
+
Verse.Html,
|
|
14786
|
+
{
|
|
14787
|
+
html: '<span class="wj">We have run into an error...</span>',
|
|
14788
|
+
fontFamily,
|
|
14789
|
+
fontSize,
|
|
14790
|
+
lineHeight,
|
|
14791
|
+
showVerseNumbers
|
|
14792
|
+
}
|
|
14793
|
+
);
|
|
14794
|
+
}
|
|
14795
|
+
return /* @__PURE__ */ jsx10(
|
|
14796
|
+
Verse.Html,
|
|
14797
|
+
{
|
|
14798
|
+
html: passage?.content || "",
|
|
14799
|
+
fontFamily,
|
|
14800
|
+
fontSize,
|
|
14801
|
+
lineHeight,
|
|
14802
|
+
showVerseNumbers
|
|
14803
|
+
}
|
|
14804
|
+
);
|
|
14805
|
+
};
|
|
14806
|
+
|
|
14807
|
+
// src/components/bible-reader.tsx
|
|
14808
|
+
import { jsx as jsx11, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
14809
|
+
var BibleReaderContext = createContext3(null);
|
|
14810
|
+
function useBibleReaderContext() {
|
|
14811
|
+
const context = useContext3(BibleReaderContext);
|
|
14812
|
+
if (!context) {
|
|
14813
|
+
throw new Error("BibleReader components must be used within BibleReader.Root");
|
|
14814
|
+
}
|
|
14815
|
+
return context;
|
|
14816
|
+
}
|
|
14817
|
+
function Root5({
|
|
14818
|
+
book: controlledBook,
|
|
14819
|
+
defaultBook = "JHN",
|
|
14820
|
+
onBookChange,
|
|
14821
|
+
chapter: controlledChapter,
|
|
14822
|
+
defaultChapter = "1",
|
|
14823
|
+
onChapterChange,
|
|
14824
|
+
versionId: controlledVersionId,
|
|
14825
|
+
defaultVersionId = 111,
|
|
14826
|
+
onVersionChange,
|
|
14827
|
+
fontFamily,
|
|
14828
|
+
fontSize = 16,
|
|
14829
|
+
lineHeight,
|
|
14830
|
+
showVerseNumbers = true,
|
|
14831
|
+
background = "light",
|
|
14832
|
+
children
|
|
14833
|
+
}) {
|
|
14834
|
+
const [book, setBook] = useControllableState3({
|
|
14835
|
+
prop: controlledBook,
|
|
14836
|
+
defaultProp: defaultBook,
|
|
14837
|
+
onChange: onBookChange
|
|
14838
|
+
});
|
|
14839
|
+
const [chapter, setChapter] = useControllableState3({
|
|
14840
|
+
prop: controlledChapter,
|
|
14841
|
+
defaultProp: defaultChapter,
|
|
14842
|
+
onChange: onChapterChange
|
|
14843
|
+
});
|
|
14844
|
+
const [versionId, setVersionId] = useControllableState3({
|
|
14845
|
+
prop: controlledVersionId,
|
|
14846
|
+
defaultProp: defaultVersionId,
|
|
14847
|
+
onChange: onVersionChange
|
|
14848
|
+
});
|
|
14849
|
+
const contextValue = {
|
|
14850
|
+
book,
|
|
14851
|
+
chapter,
|
|
14852
|
+
versionId,
|
|
14853
|
+
setBook,
|
|
14854
|
+
setChapter,
|
|
14855
|
+
setVersionId,
|
|
14856
|
+
fontFamily,
|
|
14857
|
+
fontSize,
|
|
14858
|
+
lineHeight,
|
|
14859
|
+
showVerseNumbers,
|
|
14860
|
+
background
|
|
14861
|
+
};
|
|
14862
|
+
return /* @__PURE__ */ jsx11(BibleReaderContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx11(
|
|
14863
|
+
"div",
|
|
14864
|
+
{
|
|
14865
|
+
"data-yv-sdk": true,
|
|
14866
|
+
"data-yv-theme": background === "dark" ? "dark" : "light",
|
|
14867
|
+
className: "yv:flex yv:flex-col yv:h-full yv:bg-background yv:text-foreground",
|
|
14868
|
+
children
|
|
14869
|
+
}
|
|
14870
|
+
) });
|
|
14871
|
+
}
|
|
14872
|
+
function Content4() {
|
|
14873
|
+
const { book, chapter, versionId, fontFamily, fontSize, lineHeight, showVerseNumbers } = useBibleReaderContext();
|
|
14874
|
+
const { books } = useBooks2(versionId);
|
|
14875
|
+
const { version: version2 } = useVersion2(versionId);
|
|
14876
|
+
const bookData = useMemo3(() => {
|
|
14877
|
+
return books?.data?.find((b) => b.id === book);
|
|
14878
|
+
}, [books?.data, book]);
|
|
14879
|
+
const usfmReference = `${book}.${chapter}`;
|
|
14880
|
+
return /* @__PURE__ */ jsxs5("main", { className: "yv:*:max-w-lg yv:flex yv:flex-col yv:items-center yv:gap-6 yv:overflow-y-auto yv:px-6 yv:max-sm:px-4 yv:py-12 yv:h-full", children: [
|
|
14881
|
+
/* @__PURE__ */ jsxs5("h1", { className: "yv:flex yv:gap-2 yv:flex-col yv:justify-center yv:items-center yv:font-serif yv:text-muted-foreground yv:font-medium", children: [
|
|
14882
|
+
/* @__PURE__ */ jsx11(
|
|
14883
|
+
"span",
|
|
14884
|
+
{
|
|
14885
|
+
className: cn(
|
|
14886
|
+
"yv:leading-none yv:block yv:text-2xl yv:transition-[filter]",
|
|
14887
|
+
!bookData?.title && "yv:blur-sm"
|
|
14888
|
+
),
|
|
14889
|
+
children: bookData?.title || "Loading..."
|
|
14890
|
+
}
|
|
14891
|
+
),
|
|
14892
|
+
/* @__PURE__ */ jsx11("span", { className: "yv:leading-none yv:block yv:ml-2 yv:text-[2.5rem] yv:font-normal", children: chapter || "-" })
|
|
14893
|
+
] }),
|
|
14894
|
+
/* @__PURE__ */ jsx11(
|
|
14895
|
+
BibleTextView,
|
|
14896
|
+
{
|
|
14897
|
+
reference: usfmReference,
|
|
14898
|
+
versionId,
|
|
14899
|
+
fontFamily,
|
|
14900
|
+
fontSize,
|
|
14901
|
+
lineHeight,
|
|
14902
|
+
showVerseNumbers
|
|
14903
|
+
}
|
|
14904
|
+
),
|
|
14905
|
+
version2?.copyright_short && /* @__PURE__ */ jsx11("footer", { style: { fontSize }, children: /* @__PURE__ */ jsx11("p", { className: "yv:text-balance yv:text-[0.75em] yv:text-center yv:text-muted-foreground", children: version2.copyright_short }) })
|
|
14906
|
+
] });
|
|
14907
|
+
}
|
|
14908
|
+
function Toolbar({ border = "top" }) {
|
|
14909
|
+
const { book, chapter, versionId, setBook, setChapter, setVersionId, background } = useBibleReaderContext();
|
|
14910
|
+
return /* @__PURE__ */ jsx11(
|
|
14911
|
+
"section",
|
|
14912
|
+
{
|
|
14913
|
+
className: cn(
|
|
14914
|
+
"yv:flex yv:justify-center yv:gap-2 yv:p-4 yv:bg-background yv:border-border",
|
|
14915
|
+
border === "top" && "yv:border-t",
|
|
14916
|
+
border === "bottom" && "yv:border-b"
|
|
14917
|
+
),
|
|
14918
|
+
children: /* @__PURE__ */ jsxs5("div", { className: "yv:grid yv:w-full yv:grid-cols-2 yv:items-center yv:max-w-lg yv:gap-1", children: [
|
|
14919
|
+
/* @__PURE__ */ jsx11(
|
|
14920
|
+
BibleChapterPicker.Root,
|
|
14921
|
+
{
|
|
14922
|
+
book,
|
|
14923
|
+
chapter,
|
|
14924
|
+
onBookChange: setBook,
|
|
14925
|
+
onChapterChange: setChapter,
|
|
14926
|
+
versionId,
|
|
14927
|
+
background,
|
|
14928
|
+
children: /* @__PURE__ */ jsx11(BibleChapterPicker.Trigger, { "aria-label": "Change Bible book and chapter", children: ({ chapter: chapter2, currentBook, loading }) => /* @__PURE__ */ jsx11(Button, { variant: "secondary", className: "yv:rounded-r-none", disabled: loading, children: loading ? "Loading..." : `${currentBook?.title || "Select"} ${chapter2 || ""}` }) })
|
|
14929
|
+
}
|
|
14930
|
+
),
|
|
14931
|
+
/* @__PURE__ */ jsxs5(
|
|
14932
|
+
BibleVersionPicker.Root,
|
|
14933
|
+
{
|
|
14934
|
+
versionId,
|
|
14935
|
+
onVersionChange: setVersionId,
|
|
14936
|
+
background,
|
|
14937
|
+
children: [
|
|
14938
|
+
/* @__PURE__ */ jsx11(BibleVersionPicker.Trigger, { "aria-label": "Change Bible version", children: ({ version: version2, loading }) => /* @__PURE__ */ jsx11(Button, { variant: "secondary", className: "yv:rounded-l-none", disabled: loading, children: loading ? "Loading..." : version2?.local_abbreviation || "Select version" }) }),
|
|
14939
|
+
/* @__PURE__ */ jsx11(BibleVersionPicker.Content, {})
|
|
14940
|
+
]
|
|
14941
|
+
}
|
|
14942
|
+
)
|
|
14943
|
+
] })
|
|
14944
|
+
}
|
|
14945
|
+
);
|
|
14946
|
+
}
|
|
14947
|
+
var BibleReader = Object.assign({}, { Root: Root5, Content: Content4, Toolbar });
|
|
14948
|
+
|
|
14949
|
+
// src/components/SignInButton.tsx
|
|
14950
|
+
import React12 from "react";
|
|
14951
|
+
import { Loader2 } from "lucide-react";
|
|
14952
|
+
|
|
14953
|
+
// src/providers/YVPProvider.tsx
|
|
14954
|
+
import {
|
|
14955
|
+
createContext as createContext4,
|
|
14956
|
+
useContext as useContext4,
|
|
14957
|
+
useEffect as useEffect2,
|
|
14958
|
+
useState as useState3,
|
|
14959
|
+
useCallback
|
|
14960
|
+
} from "react";
|
|
14961
|
+
|
|
14962
|
+
// src/providers/YVPErrorBoundary.tsx
|
|
14963
|
+
import { Component } from "react";
|
|
14964
|
+
import { jsx as jsx12, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
14965
|
+
var YVPErrorBoundary = class extends Component {
|
|
14966
|
+
constructor(props) {
|
|
14967
|
+
super(props);
|
|
14968
|
+
this.state = { hasError: false, error: null };
|
|
14969
|
+
}
|
|
14970
|
+
static getDerivedStateFromError(error46) {
|
|
14971
|
+
return { hasError: true, error: error46 };
|
|
14972
|
+
}
|
|
14973
|
+
componentDidCatch(error46, errorInfo) {
|
|
14974
|
+
const { onError } = this.props;
|
|
14975
|
+
if (onError) {
|
|
14976
|
+
onError(error46, errorInfo);
|
|
14977
|
+
}
|
|
14978
|
+
if (process.env.NODE_ENV === "development") {
|
|
14979
|
+
console.error("YVP Error Boundary caught error:", error46, errorInfo);
|
|
14980
|
+
}
|
|
14981
|
+
}
|
|
14982
|
+
render() {
|
|
14983
|
+
const { hasError, error: error46 } = this.state;
|
|
14984
|
+
const { children, fallback } = this.props;
|
|
14985
|
+
const isDevelopment = process.env.NODE_ENV === "development";
|
|
14986
|
+
if (hasError) {
|
|
14987
|
+
if (fallback) {
|
|
14988
|
+
return fallback;
|
|
14989
|
+
}
|
|
14990
|
+
return /* @__PURE__ */ jsxs6("div", { style: { padding: "20px", textAlign: "center" }, children: [
|
|
14991
|
+
/* @__PURE__ */ jsx12("h2", { children: "Something went wrong" }),
|
|
14992
|
+
/* @__PURE__ */ jsx12("p", { children: "We encountered an error while loading YouVersion Platform components." }),
|
|
14993
|
+
isDevelopment && error46 && /* @__PURE__ */ jsxs6("details", { style: { marginTop: "10px" }, children: [
|
|
14994
|
+
/* @__PURE__ */ jsx12("summary", { children: "Error details (development only)" }),
|
|
14995
|
+
/* @__PURE__ */ jsx12("pre", { style: { textAlign: "left", overflow: "auto" }, children: error46.toString() })
|
|
14996
|
+
] })
|
|
14997
|
+
] });
|
|
14998
|
+
}
|
|
14999
|
+
return children;
|
|
15000
|
+
}
|
|
15001
|
+
};
|
|
15002
|
+
|
|
15003
|
+
// src/providers/YVPProvider.tsx
|
|
15004
|
+
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
15005
|
+
var YVPContext = createContext4(null);
|
|
15006
|
+
function YVPProvider({
|
|
15007
|
+
config: config2,
|
|
15008
|
+
children,
|
|
15009
|
+
errorFallback,
|
|
15010
|
+
onError,
|
|
15011
|
+
theme = "light"
|
|
15012
|
+
}) {
|
|
15013
|
+
const [authState, setAuthState] = useState3({
|
|
15014
|
+
isAuthenticated: false,
|
|
15015
|
+
isLoading: false,
|
|
15016
|
+
accessToken: null,
|
|
15017
|
+
result: null,
|
|
15018
|
+
error: null
|
|
15019
|
+
});
|
|
15020
|
+
useEffect2(() => {
|
|
15021
|
+
const initializeAuth = () => {
|
|
15022
|
+
YouVersionPlatformConfiguration.appKey = config2.appKey;
|
|
15023
|
+
YouVersionPlatformConfiguration.installationId = config2.installationId ?? null;
|
|
15024
|
+
const strategy = new WebAuthenticationStrategy({
|
|
15025
|
+
redirectUri: config2.redirectUri || ""
|
|
15026
|
+
});
|
|
15027
|
+
AuthenticationStrategyRegistry.register(strategy);
|
|
15028
|
+
const existingToken = YouVersionPlatformConfiguration.accessToken;
|
|
15029
|
+
if (existingToken) {
|
|
15030
|
+
setAuthState({
|
|
15031
|
+
isAuthenticated: true,
|
|
15032
|
+
isLoading: false,
|
|
15033
|
+
accessToken: existingToken,
|
|
15034
|
+
result: null,
|
|
15035
|
+
error: null
|
|
15036
|
+
});
|
|
15037
|
+
return;
|
|
15038
|
+
}
|
|
15039
|
+
WebAuthenticationStrategy.handleCallback();
|
|
15040
|
+
const storedCallback = WebAuthenticationStrategy.getStoredCallback();
|
|
15041
|
+
if (storedCallback) {
|
|
15042
|
+
try {
|
|
15043
|
+
const result = new SignInWithYouVersionResult(storedCallback);
|
|
15044
|
+
const { accessToken, errorMsg } = result;
|
|
15045
|
+
if (accessToken) {
|
|
15046
|
+
YouVersionPlatformConfiguration.setAccessToken(accessToken);
|
|
15047
|
+
}
|
|
15048
|
+
setAuthState({
|
|
15049
|
+
isAuthenticated: !!accessToken,
|
|
15050
|
+
isLoading: false,
|
|
15051
|
+
accessToken: accessToken ?? null,
|
|
15052
|
+
result,
|
|
15053
|
+
error: errorMsg ? new Error(errorMsg) : null
|
|
15054
|
+
});
|
|
15055
|
+
} catch (error46) {
|
|
15056
|
+
setAuthState({
|
|
15057
|
+
isAuthenticated: false,
|
|
15058
|
+
isLoading: false,
|
|
15059
|
+
accessToken: null,
|
|
15060
|
+
result: null,
|
|
15061
|
+
error: error46
|
|
15062
|
+
});
|
|
15063
|
+
}
|
|
15064
|
+
} else {
|
|
15065
|
+
setAuthState({
|
|
15066
|
+
isAuthenticated: false,
|
|
15067
|
+
isLoading: false,
|
|
15068
|
+
accessToken: null,
|
|
15069
|
+
result: null,
|
|
15070
|
+
error: null
|
|
15071
|
+
});
|
|
15072
|
+
}
|
|
15073
|
+
};
|
|
15074
|
+
initializeAuth();
|
|
15075
|
+
}, [config2.appKey, config2.installationId, config2.redirectUri]);
|
|
15076
|
+
const signOut = useCallback(() => {
|
|
15077
|
+
YouVersionPlatformConfiguration.setAccessToken(null);
|
|
15078
|
+
setAuthState({
|
|
15079
|
+
isAuthenticated: false,
|
|
15080
|
+
isLoading: false,
|
|
15081
|
+
accessToken: null,
|
|
15082
|
+
result: null,
|
|
15083
|
+
error: null
|
|
15084
|
+
});
|
|
15085
|
+
}, []);
|
|
15086
|
+
const fetchUserInfo = useCallback(async () => {
|
|
15087
|
+
if (!authState.isAuthenticated || !authState.accessToken) {
|
|
15088
|
+
throw new Error("User is not authenticated");
|
|
15089
|
+
}
|
|
15090
|
+
return YouVersionAPIUsers.userInfo(authState.accessToken);
|
|
15091
|
+
}, [authState.isAuthenticated, authState.accessToken]);
|
|
15092
|
+
const value = {
|
|
15093
|
+
config: config2,
|
|
15094
|
+
client: ApiClient,
|
|
15095
|
+
auth: authState,
|
|
15096
|
+
signOut,
|
|
15097
|
+
fetchUserInfo
|
|
15098
|
+
};
|
|
15099
|
+
return /* @__PURE__ */ jsx13(YVPErrorBoundary, { fallback: errorFallback, onError, children: /* @__PURE__ */ jsx13(YVPContext.Provider, { value, children: /* @__PURE__ */ jsx13("div", { className: "yv:contents", "data-yv-sdk": true, "data-yv-theme": theme, children }) }) });
|
|
15100
|
+
}
|
|
15101
|
+
function useYVP() {
|
|
15102
|
+
const context = useContext4(YVPContext);
|
|
15103
|
+
if (!context) {
|
|
15104
|
+
throw new Error("useYVP must be used within a YVPProvider");
|
|
15105
|
+
}
|
|
15106
|
+
return context;
|
|
15107
|
+
}
|
|
15108
|
+
|
|
15109
|
+
// src/hooks/useAuthentication.ts
|
|
15110
|
+
import { useCallback as useCallback2 } from "react";
|
|
15111
|
+
function useAuthentication() {
|
|
15112
|
+
const { auth, signOut, fetchUserInfo, client: _client } = useYVP();
|
|
15113
|
+
const signIn = useCallback2(
|
|
15114
|
+
async (requiredPermissions = [], optionalPermissions = []) => {
|
|
15115
|
+
return await YouVersionAPIUsers.signIn(
|
|
15116
|
+
new Set(requiredPermissions),
|
|
15117
|
+
new Set(optionalPermissions)
|
|
15118
|
+
);
|
|
15119
|
+
},
|
|
15120
|
+
[]
|
|
15121
|
+
);
|
|
15122
|
+
return {
|
|
15123
|
+
auth,
|
|
15124
|
+
signIn,
|
|
15125
|
+
signOut,
|
|
15126
|
+
fetchUserInfo
|
|
15127
|
+
};
|
|
15128
|
+
}
|
|
15129
|
+
|
|
15130
|
+
// src/components/youversion-logo.tsx
|
|
15131
|
+
import "react";
|
|
15132
|
+
import { jsx as jsx14, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
15133
|
+
function YouVersionLogo(props) {
|
|
15134
|
+
return /* @__PURE__ */ jsxs7(
|
|
15135
|
+
"svg",
|
|
15136
|
+
{
|
|
15137
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
15138
|
+
fill: "none",
|
|
15139
|
+
viewBox: "0 0 26 26",
|
|
15140
|
+
role: "img",
|
|
15141
|
+
"aria-label": "YouVersion",
|
|
15142
|
+
...props,
|
|
15143
|
+
children: [
|
|
15144
|
+
/* @__PURE__ */ jsx14(
|
|
15145
|
+
"mask",
|
|
14425
15146
|
{
|
|
14426
15147
|
id: "youversion-logo-mask",
|
|
14427
15148
|
width: 26,
|
|
@@ -14432,7 +15153,7 @@ function YouVersionLogo(props) {
|
|
|
14432
15153
|
style: {
|
|
14433
15154
|
maskType: "alpha"
|
|
14434
15155
|
},
|
|
14435
|
-
children: /* @__PURE__ */
|
|
15156
|
+
children: /* @__PURE__ */ jsx14(
|
|
14436
15157
|
"path",
|
|
14437
15158
|
{
|
|
14438
15159
|
fill: "url(#youversion-logo-gradient-a)",
|
|
@@ -14443,9 +15164,9 @@ function YouVersionLogo(props) {
|
|
|
14443
15164
|
)
|
|
14444
15165
|
}
|
|
14445
15166
|
),
|
|
14446
|
-
/* @__PURE__ */
|
|
14447
|
-
/* @__PURE__ */
|
|
14448
|
-
/* @__PURE__ */
|
|
15167
|
+
/* @__PURE__ */ jsxs7("g", { mask: "url(#youversion-logo-mask)", children: [
|
|
15168
|
+
/* @__PURE__ */ jsx14("path", { fill: "url(#youversion-logo-gradient-c)", d: "M0 0h26v26H0z" }),
|
|
15169
|
+
/* @__PURE__ */ jsx14(
|
|
14449
15170
|
"path",
|
|
14450
15171
|
{
|
|
14451
15172
|
fill: "#FEF5EB",
|
|
@@ -14454,8 +15175,8 @@ function YouVersionLogo(props) {
|
|
|
14454
15175
|
clipRule: "evenodd"
|
|
14455
15176
|
}
|
|
14456
15177
|
),
|
|
14457
|
-
/* @__PURE__ */
|
|
14458
|
-
/* @__PURE__ */
|
|
15178
|
+
/* @__PURE__ */ jsx14("path", { fill: "#FF3D4D", d: "M4.774 20.468h4.073v3.055l-2.036-1.019-2.037 1.019v-3.055Z" }),
|
|
15179
|
+
/* @__PURE__ */ jsx14(
|
|
14459
15180
|
"path",
|
|
14460
15181
|
{
|
|
14461
15182
|
fill: "#FEF5EB",
|
|
@@ -14463,8 +15184,8 @@ function YouVersionLogo(props) {
|
|
|
14463
15184
|
}
|
|
14464
15185
|
)
|
|
14465
15186
|
] }),
|
|
14466
|
-
/* @__PURE__ */
|
|
14467
|
-
/* @__PURE__ */
|
|
15187
|
+
/* @__PURE__ */ jsxs7("defs", { children: [
|
|
15188
|
+
/* @__PURE__ */ jsxs7(
|
|
14468
15189
|
"linearGradient",
|
|
14469
15190
|
{
|
|
14470
15191
|
id: "youversion-logo-gradient-a",
|
|
@@ -14474,12 +15195,12 @@ function YouVersionLogo(props) {
|
|
|
14474
15195
|
y2: 26,
|
|
14475
15196
|
gradientUnits: "userSpaceOnUse",
|
|
14476
15197
|
children: [
|
|
14477
|
-
/* @__PURE__ */
|
|
14478
|
-
/* @__PURE__ */
|
|
15198
|
+
/* @__PURE__ */ jsx14("stop", { stopColor: "#C93D34" }),
|
|
15199
|
+
/* @__PURE__ */ jsx14("stop", { offset: 1, stopColor: "#7A2629" })
|
|
14479
15200
|
]
|
|
14480
15201
|
}
|
|
14481
15202
|
),
|
|
14482
|
-
/* @__PURE__ */
|
|
15203
|
+
/* @__PURE__ */ jsxs7(
|
|
14483
15204
|
"linearGradient",
|
|
14484
15205
|
{
|
|
14485
15206
|
id: "youversion-logo-gradient-c",
|
|
@@ -14489,8 +15210,8 @@ function YouVersionLogo(props) {
|
|
|
14489
15210
|
y2: 26,
|
|
14490
15211
|
gradientUnits: "userSpaceOnUse",
|
|
14491
15212
|
children: [
|
|
14492
|
-
/* @__PURE__ */
|
|
14493
|
-
/* @__PURE__ */
|
|
15213
|
+
/* @__PURE__ */ jsx14("stop", { stopColor: "#C93D34" }),
|
|
15214
|
+
/* @__PURE__ */ jsx14("stop", { offset: 1, stopColor: "#7A2629" })
|
|
14494
15215
|
]
|
|
14495
15216
|
}
|
|
14496
15217
|
)
|
|
@@ -14501,8 +15222,8 @@ function YouVersionLogo(props) {
|
|
|
14501
15222
|
}
|
|
14502
15223
|
|
|
14503
15224
|
// src/components/SignInButton.tsx
|
|
14504
|
-
import { jsx as
|
|
14505
|
-
var SignInButton =
|
|
15225
|
+
import { jsx as jsx15, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
15226
|
+
var SignInButton = React12.forwardRef(
|
|
14506
15227
|
({
|
|
14507
15228
|
background = "light",
|
|
14508
15229
|
className,
|
|
@@ -14518,7 +15239,7 @@ var SignInButton = React9.forwardRef(
|
|
|
14518
15239
|
...props
|
|
14519
15240
|
}, ref) => {
|
|
14520
15241
|
const { signIn, auth } = useAuthentication();
|
|
14521
|
-
const [localLoading, setLocalLoading] =
|
|
15242
|
+
const [localLoading, setLocalLoading] = React12.useState(false);
|
|
14522
15243
|
const handleClick = async (e) => {
|
|
14523
15244
|
e.preventDefault();
|
|
14524
15245
|
if (onClick) {
|
|
@@ -14543,9 +15264,9 @@ var SignInButton = React9.forwardRef(
|
|
|
14543
15264
|
if (size === "short") {
|
|
14544
15265
|
buttonCopy = "Sign in";
|
|
14545
15266
|
}
|
|
14546
|
-
const loadingSpinner = /* @__PURE__ */
|
|
15267
|
+
const loadingSpinner = /* @__PURE__ */ jsx15(Loader2, { className: "yv:z-20 yv:absolute yv:left-1/2 yv:top-1/2 yv:animate-spin yv:-translate-x-1/2 yv:-translate-y-1/2 yv:fill-primary-foreground yv:text-primary" });
|
|
14547
15268
|
if (size === "icon") {
|
|
14548
|
-
return /* @__PURE__ */
|
|
15269
|
+
return /* @__PURE__ */ jsxs8(
|
|
14549
15270
|
Button,
|
|
14550
15271
|
{
|
|
14551
15272
|
...props,
|
|
@@ -14568,13 +15289,13 @@ var SignInButton = React9.forwardRef(
|
|
|
14568
15289
|
variant: background === "light" ? "outline" : "default",
|
|
14569
15290
|
children: [
|
|
14570
15291
|
buttonLoading ? loadingSpinner : null,
|
|
14571
|
-
/* @__PURE__ */
|
|
14572
|
-
/* @__PURE__ */
|
|
15292
|
+
/* @__PURE__ */ jsx15(YouVersionLogo, {}),
|
|
15293
|
+
/* @__PURE__ */ jsx15("span", { className: "yv:sr-only", children: buttonCopy })
|
|
14573
15294
|
]
|
|
14574
15295
|
}
|
|
14575
15296
|
);
|
|
14576
15297
|
}
|
|
14577
|
-
return /* @__PURE__ */
|
|
15298
|
+
return /* @__PURE__ */ jsxs8(
|
|
14578
15299
|
Button,
|
|
14579
15300
|
{
|
|
14580
15301
|
...props,
|
|
@@ -14597,7 +15318,7 @@ var SignInButton = React9.forwardRef(
|
|
|
14597
15318
|
variant: background === "light" ? "outline" : "default",
|
|
14598
15319
|
children: [
|
|
14599
15320
|
buttonLoading ? loadingSpinner : null,
|
|
14600
|
-
/* @__PURE__ */
|
|
15321
|
+
/* @__PURE__ */ jsx15(YouVersionLogo, {}),
|
|
14601
15322
|
buttonCopy
|
|
14602
15323
|
]
|
|
14603
15324
|
}
|
|
@@ -14607,12 +15328,12 @@ var SignInButton = React9.forwardRef(
|
|
|
14607
15328
|
SignInButton.displayName = "SignInButton";
|
|
14608
15329
|
|
|
14609
15330
|
// src/components/verse-of-the-day.tsx
|
|
14610
|
-
import
|
|
15331
|
+
import React13 from "react";
|
|
14611
15332
|
|
|
14612
15333
|
// src/components/icons/votd.tsx
|
|
14613
15334
|
import "react";
|
|
14614
|
-
import { jsx as
|
|
14615
|
-
var SvgComponent = (props) => /* @__PURE__ */
|
|
15335
|
+
import { jsx as jsx16, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
15336
|
+
var SvgComponent = (props) => /* @__PURE__ */ jsxs9(
|
|
14616
15337
|
"svg",
|
|
14617
15338
|
{
|
|
14618
15339
|
width: "44",
|
|
@@ -14622,8 +15343,8 @@ var SvgComponent = (props) => /* @__PURE__ */ jsxs6(
|
|
|
14622
15343
|
fill: "none",
|
|
14623
15344
|
xmlns: "http://www.w3.org/2000/svg",
|
|
14624
15345
|
children: [
|
|
14625
|
-
/* @__PURE__ */
|
|
14626
|
-
/* @__PURE__ */
|
|
15346
|
+
/* @__PURE__ */ jsx16("title", { children: "Sun" }),
|
|
15347
|
+
/* @__PURE__ */ jsx16(
|
|
14627
15348
|
"path",
|
|
14628
15349
|
{
|
|
14629
15350
|
fillRule: "evenodd",
|
|
@@ -14637,8 +15358,8 @@ var SvgComponent = (props) => /* @__PURE__ */ jsxs6(
|
|
|
14637
15358
|
);
|
|
14638
15359
|
|
|
14639
15360
|
// src/components/icons/share.tsx
|
|
14640
|
-
import { jsx as
|
|
14641
|
-
var SvgComponent2 = (props) => /* @__PURE__ */
|
|
15361
|
+
import { jsx as jsx17, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
15362
|
+
var SvgComponent2 = (props) => /* @__PURE__ */ jsxs10(
|
|
14642
15363
|
"svg",
|
|
14643
15364
|
{
|
|
14644
15365
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -14648,14 +15369,14 @@ var SvgComponent2 = (props) => /* @__PURE__ */ jsxs7(
|
|
|
14648
15369
|
fill: "none",
|
|
14649
15370
|
...props,
|
|
14650
15371
|
children: [
|
|
14651
|
-
/* @__PURE__ */
|
|
15372
|
+
/* @__PURE__ */ jsx17(
|
|
14652
15373
|
"path",
|
|
14653
15374
|
{
|
|
14654
15375
|
fill: "currentColor",
|
|
14655
15376
|
d: "M16.121 9.187a1 1 0 0 1-1.414 0L13 7.48V15a1 1 0 1 1-2 0V7.348L9.121 9.227a1 1 0 1 1-1.414-1.414l3.52-3.52a1 1 0 0 1 1.414 0l3.48 3.48a1 1 0 0 1 0 1.414Z"
|
|
14656
15377
|
}
|
|
14657
15378
|
),
|
|
14658
|
-
/* @__PURE__ */
|
|
15379
|
+
/* @__PURE__ */ jsx17(
|
|
14659
15380
|
"path",
|
|
14660
15381
|
{
|
|
14661
15382
|
fill: "currentColor",
|
|
@@ -14667,8 +15388,8 @@ var SvgComponent2 = (props) => /* @__PURE__ */ jsxs7(
|
|
|
14667
15388
|
);
|
|
14668
15389
|
|
|
14669
15390
|
// src/components/bible-app-logo-lockup.tsx
|
|
14670
|
-
import { jsx as
|
|
14671
|
-
var SvgComponent3 = (props) => /* @__PURE__ */
|
|
15391
|
+
import { jsx as jsx18, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
15392
|
+
var SvgComponent3 = (props) => /* @__PURE__ */ jsxs11(
|
|
14672
15393
|
"svg",
|
|
14673
15394
|
{
|
|
14674
15395
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -14678,8 +15399,8 @@ var SvgComponent3 = (props) => /* @__PURE__ */ jsxs8(
|
|
|
14678
15399
|
fill: "none",
|
|
14679
15400
|
...props,
|
|
14680
15401
|
children: [
|
|
14681
|
-
/* @__PURE__ */
|
|
14682
|
-
/* @__PURE__ */
|
|
15402
|
+
/* @__PURE__ */ jsx18("title", { children: "Bible App" }),
|
|
15403
|
+
/* @__PURE__ */ jsx18(
|
|
14683
15404
|
"mask",
|
|
14684
15405
|
{
|
|
14685
15406
|
id: "bible-app-logo-lockup-mask",
|
|
@@ -14691,7 +15412,7 @@ var SvgComponent3 = (props) => /* @__PURE__ */ jsxs8(
|
|
|
14691
15412
|
style: {
|
|
14692
15413
|
maskType: "alpha"
|
|
14693
15414
|
},
|
|
14694
|
-
children: /* @__PURE__ */
|
|
15415
|
+
children: /* @__PURE__ */ jsx18(
|
|
14695
15416
|
"path",
|
|
14696
15417
|
{
|
|
14697
15418
|
fill: "url(#bible-app-logo-lockup-gradient-a)",
|
|
@@ -14702,9 +15423,9 @@ var SvgComponent3 = (props) => /* @__PURE__ */ jsxs8(
|
|
|
14702
15423
|
)
|
|
14703
15424
|
}
|
|
14704
15425
|
),
|
|
14705
|
-
/* @__PURE__ */
|
|
14706
|
-
/* @__PURE__ */
|
|
14707
|
-
/* @__PURE__ */
|
|
15426
|
+
/* @__PURE__ */ jsxs11("g", { mask: "url(#bible-app-logo-lockup-mask)", children: [
|
|
15427
|
+
/* @__PURE__ */ jsx18("path", { fill: "url(#bible-app-logo-lockup-gradient-c)", d: "M63.562 0H80v16.438H63.562z" }),
|
|
15428
|
+
/* @__PURE__ */ jsx18(
|
|
14708
15429
|
"path",
|
|
14709
15430
|
{
|
|
14710
15431
|
fill: "#FEF5EB",
|
|
@@ -14713,18 +15434,18 @@ var SvgComponent3 = (props) => /* @__PURE__ */ jsxs8(
|
|
|
14713
15434
|
clipRule: "evenodd"
|
|
14714
15435
|
}
|
|
14715
15436
|
),
|
|
14716
|
-
/* @__PURE__ */
|
|
14717
|
-
/* @__PURE__ */
|
|
15437
|
+
/* @__PURE__ */ jsx18("path", { fill: "#FF3D4D", d: "M66.58 12.94h2.575v1.932l-1.287-.644-1.288.644v-1.931Z" }),
|
|
15438
|
+
/* @__PURE__ */ jsx18("g", { fill: "#FEF5EB", clipPath: "url(#bible-app-logo-lockup-clip)", children: /* @__PURE__ */ jsx18("path", { d: "M70.602 5.614c.173.105.374.156.603.156.219 0 .42-.055.593-.17.178-.113.31-.273.407-.474.1-.206.146-.439.146-.694a1.57 1.57 0 0 0-.142-.694 1.05 1.05 0 0 0-.402-.452 1.135 1.135 0 0 0-.598-.156c-.219 0-.42.055-.598.17a1.15 1.15 0 0 0-.406.474 1.626 1.626 0 0 0-.142.694c0 .265.046.498.142.694.091.197.223.347.397.452Zm-.096-1.16c0-.232.027-.438.087-.616a.906.906 0 0 1 .246-.406.512.512 0 0 1 .356-.142c.133 0 .247.046.357.137.11.091.196.224.26.402.069.174.1.379.1.616 0 .233-.032.439-.09.617a.951.951 0 0 1-.248.41.516.516 0 0 1-.356.142.537.537 0 0 1-.356-.137.95.95 0 0 1-.265-.401 1.995 1.995 0 0 1-.091-.621ZM76.675 9.14a3.91 3.91 0 0 1-.014-.68l.005-.056h-.178l-.005.046a1.256 1.256 0 0 1-.073.36.324.324 0 0 1-.141.16.704.704 0 0 1-.302.05h-.25a.696.696 0 0 1-.17-.013.073.073 0 0 1-.046-.05.654.654 0 0 1-.018-.174v-.78h.178c.082 0 .142.022.183.059.041.036.069.1.082.187.014.096.019.15.023.169l.005.041H76.122l-.004-.05a8.485 8.485 0 0 1-.023-.489v-.164c0-.119.005-.228.01-.324l.004-.05H75.936l-.005.04-.01.07c-.009.077-.022.14-.036.186a.188.188 0 0 1-.073.11c-.032.027-.082.046-.155.046h-.178v-.768c0-.086.009-.141.018-.173.01-.028.023-.041.046-.046a.637.637 0 0 1 .169-.018h.287c.119 0 .201.018.251.046a.241.241 0 0 1 .105.132c.023.064.046.174.06.32l.004.045h.178l-.009-.054a2.264 2.264 0 0 1-.009-.21c0-.12.01-.252.023-.402l.005-.055h-1.832v.164l.046.005a.719.719 0 0 1 .165.023.07.07 0 0 1 .05.05c.009.032.018.087.018.173v1.708c0 .087-.01.142-.018.174a.07.07 0 0 1-.05.05.72.72 0 0 1-.165.023l-.046.004v.165h1.9v-.05ZM74.543 5.724l-.005-.055a3.91 3.91 0 0 1-.014-.717l.005-.055h-.178l-.005.046a1.678 1.678 0 0 1-.073.38.31.31 0 0 1-.146.173.693.693 0 0 1-.301.054h-.251a.695.695 0 0 1-.17-.013.072.072 0 0 1-.045-.05.653.653 0 0 1-.018-.174V3.587c0-.087.009-.142.018-.174a.072.072 0 0 1 .046-.05.82.82 0 0 1 .168-.023l.046-.004v-.164h-.982V3.34l.046.005a.72.72 0 0 1 .165.023.07.07 0 0 1 .05.05c.009.032.018.087.018.173v1.713c0 .087-.01.141-.018.173a.07.07 0 0 1-.05.05.72.72 0 0 1-.165.023l-.046.005v.164l1.904.005ZM68.762 8.034c-.091-.095-.233-.164-.411-.205a.685.685 0 0 0 .27-.2.61.61 0 0 0 .136-.389.522.522 0 0 0-.21-.434c-.137-.11-.329-.16-.57-.16l-.996-.009V6.806l.046.005a.72.72 0 0 1 .164.023.07.07 0 0 1 .05.05c.01.032.019.087.019.173v1.717c0 .087-.01.142-.019.174a.07.07 0 0 1-.05.05.72.72 0 0 1-.164.023l-.046.004v.169l1.073-.004c.178 0 .329-.028.461-.087a.705.705 0 0 0 .306-.256.666.666 0 0 0 .11-.374.555.555 0 0 0-.17-.439Zm-1.078-.977a.71.71 0 0 1 .018-.173c.01-.032.028-.046.046-.06a.349.349 0 0 1 .142-.018c.164 0 .269.041.333.11.064.073.1.187.1.356a.637.637 0 0 1-.105.383c-.059.083-.173.133-.356.133h-.182v-.73h.004Zm.662 1.818c-.096.091-.242.137-.452.137a.375.375 0 0 1-.146-.019c-.023-.009-.036-.027-.046-.054a.639.639 0 0 1-.018-.17v-.826h.242c.21 0 .352.046.434.128.087.082.132.205.132.379 0 .2-.05.338-.146.425ZM72.232 8.034s-.004 0 0 0c-.004 0-.004 0 0 0a.812.812 0 0 0-.41-.205.686.686 0 0 0 .269-.2.61.61 0 0 0 .137-.389.522.522 0 0 0-.21-.434c-.138-.11-.33-.16-.571-.16l-.996-.009V6.806l.046.005a.72.72 0 0 1 .164.023.07.07 0 0 1 .05.05c.01.032.019.087.019.173v1.717c0 .087-.01.142-.018.174a.07.07 0 0 1-.05.05.72.72 0 0 1-.165.023l-.046.004v.169l1.073-.004c.178 0 .33-.028.462-.087a.706.706 0 0 0 .305-.256.667.667 0 0 0 .11-.374.588.588 0 0 0-.169-.439Zm-.242-1.191c-.004 0-.004 0 0 0Zm-.835.214c0-.082.009-.137.018-.173.009-.032.027-.046.045-.06a.35.35 0 0 1 .142-.018c.164 0 .27.041.333.11.064.073.1.187.1.356a.637.637 0 0 1-.104.383c-.06.083-.174.133-.356.133h-.183v-.73h.004Zm.662 1.818c-.096.091-.242.137-.452.137a.36.36 0 0 1-.147-.019c-.022-.009-.036-.027-.045-.054a.634.634 0 0 1-.019-.17v-.826h.243c.21 0 .351.046.433.128.087.082.133.205.133.379 0 .2-.05.338-.146.425ZM69.2 6.637V6.806l.046.005a.72.72 0 0 1 .164.023.07.07 0 0 1 .05.05c.01.032.019.087.019.173v1.717c0 .087-.01.142-.019.174a.07.07 0 0 1-.05.05.72.72 0 0 1-.164.023l-.046.004v.169h.982V9.03l-.046-.005a.824.824 0 0 1-.169-.023.073.073 0 0 1-.046-.05.654.654 0 0 1-.018-.173V7.062c0-.087.01-.142.018-.174a.073.073 0 0 1 .046-.05.824.824 0 0 1 .17-.023l.045-.004v-.164l-.982-.01ZM68.328 5.724v-.165l-.046-.004a.823.823 0 0 1-.169-.023.072.072 0 0 1-.045-.05.648.648 0 0 1-.019-.174v-.785h1.028v.78c0 .087-.01.142-.019.174a.07.07 0 0 1-.05.05.72.72 0 0 1-.164.023l-.046.005v.164h.982V5.55l-.046-.004a.821.821 0 0 1-.169-.023.072.072 0 0 1-.045-.05.653.653 0 0 1-.019-.174V3.587c0-.087.01-.142.019-.174a.072.072 0 0 1 .045-.05.821.821 0 0 1 .17-.023l.045-.004v-.169h-.982v.164l.046.005a.719.719 0 0 1 .164.023.07.07 0 0 1 .05.05c.01.032.019.087.019.173v.767h-1.028v-.762c0-.087.01-.142.019-.174a.072.072 0 0 1 .045-.05.824.824 0 0 1 .17-.023l.045-.004v-.164h-.982V3.34l.046.005a.72.72 0 0 1 .164.023.07.07 0 0 1 .05.05c.01.032.019.087.019.173v1.713c0 .086-.01.141-.019.173a.07.07 0 0 1-.05.05.72.72 0 0 1-.164.023l-.046.005v.169h.982ZM74.465 3.372c.027.023.06.064.1.142l.699 1.287v.503c0 .086-.01.141-.018.173a.07.07 0 0 1-.05.05.72.72 0 0 1-.165.023l-.046.005v.169l.927-.005.05.005v-.165l-.045-.004a.82.82 0 0 1-.169-.023.072.072 0 0 1-.046-.05.652.652 0 0 1-.018-.174v-.616l.539-1.069a1.07 1.07 0 0 1 .132-.205.244.244 0 0 1 .11-.078l.036-.009v-.16h-.703l-.05-.004v.164h.046c.1 0 .164.018.205.041.032.018.05.046.05.096a.673.673 0 0 1-.086.274l-.402.795-.53-1.014a.195.195 0 0 1-.027-.1c0-.014.004-.023.009-.033a.047.047 0 0 1 .027-.022c.028-.019.082-.028.16-.028h.05v-.173h-.885v.178h.05c.004 0 .023.004.05.027ZM74.538 8.701c0-.119.005-.21.01-.278l.004-.055h-.178l-.005.045a1.678 1.678 0 0 1-.073.38.32.32 0 0 1-.142.173.693.693 0 0 1-.3.055h-.252a.696.696 0 0 1-.169-.014.072.072 0 0 1-.046-.05.648.648 0 0 1-.018-.174V7.066c0-.086.01-.141.018-.173a.072.072 0 0 1 .046-.05.824.824 0 0 1 .169-.023l.046-.005v-.164h-.982V6.82l.046.004a.719.719 0 0 1 .164.023.07.07 0 0 1 .05.05c.01.032.018.087.018.174v1.703c0 .087-.009.142-.018.174a.07.07 0 0 1-.05.05.72.72 0 0 1-.164.023l-.046.004v.164h1.9l-.005-.054a5.229 5.229 0 0 1-.023-.434Z" }) })
|
|
14718
15439
|
] }),
|
|
14719
|
-
/* @__PURE__ */
|
|
15440
|
+
/* @__PURE__ */ jsx18(
|
|
14720
15441
|
"path",
|
|
14721
15442
|
{
|
|
14722
15443
|
fill: "currentColor",
|
|
14723
15444
|
d: "M1 2.706h3.248c.684 0 1.245.066 1.683.198.438.122.785.298 1.039.526.263.219.443.482.539.789a3.1 3.1 0 0 1 .145.96c0 .394-.088.762-.263 1.104-.176.333-.496.61-.96.829.298.131.543.28.736.447.193.167.346.346.46.54.114.183.193.38.237.59a3.206 3.206 0 0 1-.118 1.71c-.114.342-.307.64-.579.895-.272.245-.627.442-1.065.591-.438.14-.978.21-1.618.21H1V2.707ZM4.431 6.56c.622 0 1.056-.114 1.302-.342.245-.228.368-.557.368-.987 0-.447-.145-.767-.434-.96-.28-.201-.772-.302-1.473-.302H2.538v2.59h1.894Zm0 4.26c.377 0 .688-.035.933-.105.255-.07.452-.17.592-.302.15-.132.255-.29.316-.474s.092-.39.092-.618c0-.473-.136-.833-.408-1.078-.263-.254-.723-.382-1.38-.382H2.537v2.96h1.894Zm6.373-8.114v1.486H9.253V2.706h1.552Zm-.026 2.552v6.838h-1.5V5.258h1.5ZM13.976 8.9c.009.439.061.798.158 1.079.105.28.236.504.394.67.167.167.355.28.566.342.21.062.43.092.657.092.246 0 .474-.043.684-.131.21-.088.395-.224.552-.408.158-.193.28-.443.369-.75.087-.306.131-.683.131-1.13 0-.43-.048-.794-.145-1.092a2.062 2.062 0 0 0-.355-.736 1.314 1.314 0 0 0-.539-.421 1.566 1.566 0 0 0-.631-.132 2.06 2.06 0 0 0-.842.158 1.493 1.493 0 0 0-.565.447 1.9 1.9 0 0 0-.329.697c-.07.263-.105.557-.105.881V8.9Zm.013-6.194v3.446c.272-.36.583-.631.934-.816.36-.192.775-.289 1.249-.289.49 0 .916.088 1.276.263.359.176.657.421.894.737a3.2 3.2 0 0 1 .526 1.144c.123.438.184.925.184 1.46 0 .56-.07 1.07-.21 1.525-.14.447-.342.828-.605 1.144a2.768 2.768 0 0 1-.947.736c-.368.167-.78.25-1.236.25-.412 0-.794-.079-1.144-.236-.351-.158-.671-.421-.96-.79v.816h-1.447v-9.39h1.486Zm8.053 0v9.39h-1.5v-9.39h1.5Zm7.8 7.365c-.123.71-.426 1.262-.908 1.657-.482.386-1.175.578-2.078.578-1.087 0-1.916-.31-2.485-.933-.561-.632-.842-1.517-.842-2.657 0-.587.079-1.109.237-1.565.166-.456.394-.837.684-1.144a2.868 2.868 0 0 1 1.052-.71c.412-.167.863-.25 1.354-.25.526 0 .982.083 1.368.25.386.158.706.386.96.684.254.29.443.64.565 1.052.123.403.184.855.184 1.354v.658h-4.905c.018.622.176 1.127.474 1.512.298.386.75.579 1.354.579.474 0 .829-.092 1.065-.276.237-.184.395-.447.474-.79h1.446Zm-1.368-2.065c0-.561-.132-1.004-.395-1.328-.263-.325-.684-.487-1.262-.487-.553 0-.973.167-1.263.5-.29.324-.456.763-.5 1.315h3.42Zm8.715-5.3h1.578l3.577 9.39h-1.696l-.881-2.393h-3.643l-.868 2.393h-1.644l3.577-9.39Zm2.144 5.668-1.394-3.866-1.381 3.866h2.775Zm3.992-3.116h1.46v.946c.28-.377.6-.661.96-.854.367-.202.788-.303 1.262-.303.482 0 .903.088 1.262.263.36.167.658.408.894.723.246.316.426.697.54 1.145.122.438.184.929.184 1.472 0 .553-.07 1.057-.21 1.513a3.46 3.46 0 0 1-.606 1.157 2.642 2.642 0 0 1-.933.736c-.368.167-.785.25-1.25.25-.368 0-.727-.07-1.078-.21-.35-.14-.68-.399-.986-.776v3.327h-1.5v-9.39Zm1.485 3.537c0 .447.049.82.145 1.118.097.29.224.522.382.697.166.175.355.298.565.368.22.07.447.105.684.105.245 0 .473-.043.684-.131.21-.088.394-.228.552-.421.158-.193.28-.443.368-.75.088-.306.132-.679.132-1.117 0-.447-.048-.82-.145-1.118a1.933 1.933 0 0 0-.368-.737 1.229 1.229 0 0 0-.526-.407 1.718 1.718 0 0 0-.631-.119c-.535 0-.978.176-1.329.526-.342.351-.513.903-.513 1.657v.33Zm6.541-3.537h1.46v.946c.28-.377.6-.661.96-.854a2.585 2.585 0 0 1 1.262-.303c.482 0 .903.088 1.263.263.36.167.657.408.894.723.245.316.425.697.54 1.145.122.438.183.929.183 1.472 0 .553-.07 1.057-.21 1.513a3.46 3.46 0 0 1-.605 1.157 2.642 2.642 0 0 1-.934.736c-.368.167-.784.25-1.25.25a2.88 2.88 0 0 1-1.078-.21c-.35-.14-.679-.399-.986-.776v3.327h-1.499v-9.39Zm1.486 3.537c0 .447.048.82.145 1.118.096.29.223.522.381.697.167.175.355.298.566.368.219.07.447.105.683.105.246 0 .474-.043.684-.131a1.41 1.41 0 0 0 .553-.421c.157-.193.28-.443.368-.75.087-.306.131-.679.131-1.117 0-.447-.048-.82-.144-1.118a1.933 1.933 0 0 0-.369-.737 1.228 1.228 0 0 0-.526-.407 1.717 1.717 0 0 0-.63-.119c-.536 0-.978.176-1.329.526-.342.351-.513.903-.513 1.657v.33Z"
|
|
14724
15445
|
}
|
|
14725
15446
|
),
|
|
14726
|
-
/* @__PURE__ */
|
|
14727
|
-
/* @__PURE__ */
|
|
15447
|
+
/* @__PURE__ */ jsxs11("defs", { children: [
|
|
15448
|
+
/* @__PURE__ */ jsxs11(
|
|
14728
15449
|
"linearGradient",
|
|
14729
15450
|
{
|
|
14730
15451
|
id: "bible-app-logo-lockup-gradient-a",
|
|
@@ -14734,12 +15455,12 @@ var SvgComponent3 = (props) => /* @__PURE__ */ jsxs8(
|
|
|
14734
15455
|
y2: 16.438,
|
|
14735
15456
|
gradientUnits: "userSpaceOnUse",
|
|
14736
15457
|
children: [
|
|
14737
|
-
/* @__PURE__ */
|
|
14738
|
-
/* @__PURE__ */
|
|
15458
|
+
/* @__PURE__ */ jsx18("stop", { stopColor: "#C93D34" }),
|
|
15459
|
+
/* @__PURE__ */ jsx18("stop", { offset: 1, stopColor: "#7A2629" })
|
|
14739
15460
|
]
|
|
14740
15461
|
}
|
|
14741
15462
|
),
|
|
14742
|
-
/* @__PURE__ */
|
|
15463
|
+
/* @__PURE__ */ jsxs11(
|
|
14743
15464
|
"linearGradient",
|
|
14744
15465
|
{
|
|
14745
15466
|
id: "bible-app-logo-lockup-gradient-c",
|
|
@@ -14749,186 +15470,24 @@ var SvgComponent3 = (props) => /* @__PURE__ */ jsxs8(
|
|
|
14749
15470
|
y2: 16.438,
|
|
14750
15471
|
gradientUnits: "userSpaceOnUse",
|
|
14751
15472
|
children: [
|
|
14752
|
-
/* @__PURE__ */
|
|
14753
|
-
/* @__PURE__ */
|
|
15473
|
+
/* @__PURE__ */ jsx18("stop", { stopColor: "#C93D34" }),
|
|
15474
|
+
/* @__PURE__ */ jsx18("stop", { offset: 1, stopColor: "#7A2629" })
|
|
14754
15475
|
]
|
|
14755
15476
|
}
|
|
14756
15477
|
),
|
|
14757
|
-
/* @__PURE__ */
|
|
15478
|
+
/* @__PURE__ */ jsx18("clipPath", { id: "bible-app-logo-lockup-clip", children: /* @__PURE__ */ jsx18("path", { fill: "#fff", d: "M65.52 2.472h12.521V9.68h-12.52z" }) })
|
|
14758
15479
|
] })
|
|
14759
15480
|
]
|
|
14760
15481
|
}
|
|
14761
15482
|
);
|
|
14762
15483
|
|
|
14763
|
-
// src/components/verse.tsx
|
|
14764
|
-
import React10 from "react";
|
|
14765
|
-
import DOMPurify from "isomorphic-dompurify";
|
|
14766
|
-
import { usePassage } from "@youversion/platform-react-hooks";
|
|
14767
|
-
import { jsx as jsx14, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
14768
|
-
var NON_BREAKING_SPACE = "\xA0";
|
|
14769
|
-
var DOMPURIFY_CONFIG = {
|
|
14770
|
-
ALLOWED_ATTR: ["class", "style", "id"],
|
|
14771
|
-
ALLOW_DATA_ATTR: true
|
|
14772
|
-
};
|
|
14773
|
-
function yvDomTransformer(html) {
|
|
14774
|
-
if (!window || !("DOMParser" in window)) {
|
|
14775
|
-
return html;
|
|
14776
|
-
}
|
|
14777
|
-
const sanitizedHtml = DOMPurify.sanitize(html, DOMPURIFY_CONFIG);
|
|
14778
|
-
const parser = new DOMParser();
|
|
14779
|
-
const doc = parser.parseFromString(sanitizedHtml, "text/html");
|
|
14780
|
-
const paragraphs = doc.querySelectorAll(".yv-vlbl");
|
|
14781
|
-
paragraphs.forEach((p) => {
|
|
14782
|
-
const text = p.textContent || "";
|
|
14783
|
-
if (!text.endsWith(NON_BREAKING_SPACE)) {
|
|
14784
|
-
p.textContent = text + NON_BREAKING_SPACE;
|
|
14785
|
-
}
|
|
14786
|
-
});
|
|
14787
|
-
const tables = doc.querySelectorAll("table");
|
|
14788
|
-
tables.forEach((table) => {
|
|
14789
|
-
const rows = table.querySelectorAll("tr");
|
|
14790
|
-
if (rows.length === 0) return;
|
|
14791
|
-
let maxColumns = 0;
|
|
14792
|
-
rows.forEach((row) => {
|
|
14793
|
-
const cells = row.querySelectorAll("td, th");
|
|
14794
|
-
let rowColumnCount = 0;
|
|
14795
|
-
cells.forEach((cell) => {
|
|
14796
|
-
if (cell instanceof HTMLTableCellElement) {
|
|
14797
|
-
const colspan = parseInt(cell.getAttribute("colspan") || "1", 10);
|
|
14798
|
-
rowColumnCount += colspan;
|
|
14799
|
-
} else {
|
|
14800
|
-
rowColumnCount += 1;
|
|
14801
|
-
}
|
|
14802
|
-
});
|
|
14803
|
-
maxColumns = Math.max(maxColumns, rowColumnCount);
|
|
14804
|
-
});
|
|
14805
|
-
if (maxColumns > 1) {
|
|
14806
|
-
rows.forEach((row) => {
|
|
14807
|
-
const cells = row.querySelectorAll("td, th");
|
|
14808
|
-
if (cells.length === 1) {
|
|
14809
|
-
const cell = cells[0];
|
|
14810
|
-
if (cell instanceof HTMLTableCellElement) {
|
|
14811
|
-
const existingColspan = parseInt(cell.getAttribute("colspan") || "1", 10);
|
|
14812
|
-
if (existingColspan < maxColumns) {
|
|
14813
|
-
cell.setAttribute("colspan", maxColumns.toString());
|
|
14814
|
-
}
|
|
14815
|
-
}
|
|
14816
|
-
}
|
|
14817
|
-
});
|
|
14818
|
-
}
|
|
14819
|
-
});
|
|
14820
|
-
const modifiedHtml = doc.body.innerHTML;
|
|
14821
|
-
return modifiedHtml;
|
|
14822
|
-
}
|
|
14823
|
-
var Verse = {
|
|
14824
|
-
/**
|
|
14825
|
-
* Renders a single verse with superscript number and text.
|
|
14826
|
-
*
|
|
14827
|
-
* @param props - The verse properties.
|
|
14828
|
-
* @param props.number - The verse number.
|
|
14829
|
-
* @param props.text - The verse text.
|
|
14830
|
-
* @param props.size - The size variant. Defaults to 'default'.
|
|
14831
|
-
* @returns The rendered verse element.
|
|
14832
|
-
*/
|
|
14833
|
-
Text: ({ number: number4, text, size = "default" }) => {
|
|
14834
|
-
if (size === "lg") {
|
|
14835
|
-
return /* @__PURE__ */ jsxs9("span", { className: "yv:[&>p]:inline-block", children: [
|
|
14836
|
-
/* @__PURE__ */ jsx14("sup", { className: "yv:text-muted-foreground yv:align-super yv:text-[0.6em]", children: number4 }),
|
|
14837
|
-
"\xA0",
|
|
14838
|
-
/* @__PURE__ */ jsx14("span", { className: "yv:font-serif! yv:text-xl yv:text-primary", children: text }),
|
|
14839
|
-
"\xA0"
|
|
14840
|
-
] });
|
|
14841
|
-
}
|
|
14842
|
-
return /* @__PURE__ */ jsxs9("span", { className: "yv:[&>p]:inline-block", children: [
|
|
14843
|
-
/* @__PURE__ */ jsx14("sup", { className: "yv:text-muted-foreground yv:align-super yv:text-[0.6em]", children: number4 }),
|
|
14844
|
-
"\xA0",
|
|
14845
|
-
/* @__PURE__ */ jsx14("span", { className: "yv:text-primary", children: text }),
|
|
14846
|
-
"\xA0"
|
|
14847
|
-
] });
|
|
14848
|
-
},
|
|
14849
|
-
Html: ({
|
|
14850
|
-
html,
|
|
14851
|
-
fontFamily,
|
|
14852
|
-
fontSize,
|
|
14853
|
-
lineHeight,
|
|
14854
|
-
showVerseNumbers = true
|
|
14855
|
-
}) => {
|
|
14856
|
-
const [transformedHtml, setTransformedHtml] = React10.useState(html);
|
|
14857
|
-
React10.useEffect(() => {
|
|
14858
|
-
setTransformedHtml(yvDomTransformer(html));
|
|
14859
|
-
}, [html]);
|
|
14860
|
-
return /* @__PURE__ */ jsx14(
|
|
14861
|
-
"section",
|
|
14862
|
-
{
|
|
14863
|
-
style: {
|
|
14864
|
-
...fontFamily ? { "--yv-reader-font-family": fontFamily } : {},
|
|
14865
|
-
...fontSize ? { "--yv-reader-font-size": `${fontSize}px` } : {},
|
|
14866
|
-
...lineHeight ? { "--yv-reader-line-height": lineHeight } : {}
|
|
14867
|
-
},
|
|
14868
|
-
"data-show-verse-numbers": showVerseNumbers,
|
|
14869
|
-
"data-slot": "yv-bible-renderer",
|
|
14870
|
-
dangerouslySetInnerHTML: { __html: transformedHtml }
|
|
14871
|
-
}
|
|
14872
|
-
);
|
|
14873
|
-
}
|
|
14874
|
-
};
|
|
14875
|
-
var BibleTextView = ({
|
|
14876
|
-
reference,
|
|
14877
|
-
fontFamily,
|
|
14878
|
-
fontSize,
|
|
14879
|
-
lineHeight,
|
|
14880
|
-
versionId,
|
|
14881
|
-
showVerseNumbers
|
|
14882
|
-
}) => {
|
|
14883
|
-
const { passage, loading, error: error46 } = usePassage({
|
|
14884
|
-
versionId,
|
|
14885
|
-
usfm: reference,
|
|
14886
|
-
include_headings: true,
|
|
14887
|
-
include_notes: true
|
|
14888
|
-
});
|
|
14889
|
-
if (loading) {
|
|
14890
|
-
return /* @__PURE__ */ jsx14(
|
|
14891
|
-
Verse.Html,
|
|
14892
|
-
{
|
|
14893
|
-
html: "<span>Loading...</span>",
|
|
14894
|
-
fontFamily,
|
|
14895
|
-
fontSize,
|
|
14896
|
-
lineHeight,
|
|
14897
|
-
showVerseNumbers
|
|
14898
|
-
}
|
|
14899
|
-
);
|
|
14900
|
-
}
|
|
14901
|
-
if (error46) {
|
|
14902
|
-
return /* @__PURE__ */ jsx14(
|
|
14903
|
-
Verse.Html,
|
|
14904
|
-
{
|
|
14905
|
-
html: '<span class="wj">We have run into an error...</span>',
|
|
14906
|
-
fontFamily,
|
|
14907
|
-
fontSize,
|
|
14908
|
-
lineHeight,
|
|
14909
|
-
showVerseNumbers
|
|
14910
|
-
}
|
|
14911
|
-
);
|
|
14912
|
-
}
|
|
14913
|
-
return /* @__PURE__ */ jsx14(
|
|
14914
|
-
Verse.Html,
|
|
14915
|
-
{
|
|
14916
|
-
html: passage?.content || "",
|
|
14917
|
-
fontFamily,
|
|
14918
|
-
fontSize,
|
|
14919
|
-
lineHeight,
|
|
14920
|
-
showVerseNumbers
|
|
14921
|
-
}
|
|
14922
|
-
);
|
|
14923
|
-
};
|
|
14924
|
-
|
|
14925
15484
|
// src/components/verse-of-the-day.tsx
|
|
14926
15485
|
import {
|
|
14927
15486
|
useVerseOfTheDay,
|
|
14928
15487
|
usePassage as usePassage2,
|
|
14929
15488
|
getDayOfYear
|
|
14930
15489
|
} from "@youversion/platform-react-hooks";
|
|
14931
|
-
import { jsx as
|
|
15490
|
+
import { jsx as jsx19, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
14932
15491
|
function VerseOfTheDay({
|
|
14933
15492
|
dayOfYear,
|
|
14934
15493
|
versionId = 1,
|
|
@@ -14939,7 +15498,7 @@ function VerseOfTheDay({
|
|
|
14939
15498
|
showBibleAppAttribution = true,
|
|
14940
15499
|
size = "default"
|
|
14941
15500
|
}) {
|
|
14942
|
-
const day =
|
|
15501
|
+
const day = React13.useMemo(
|
|
14943
15502
|
() => dayOfYear || getDayOfYear(/* @__PURE__ */ new Date()),
|
|
14944
15503
|
[dayOfYear]
|
|
14945
15504
|
);
|
|
@@ -14969,34 +15528,34 @@ function VerseOfTheDay({
|
|
|
14969
15528
|
} else {
|
|
14970
15529
|
referenceText = "No verse found";
|
|
14971
15530
|
}
|
|
14972
|
-
return /* @__PURE__ */
|
|
15531
|
+
return /* @__PURE__ */ jsxs12(
|
|
14973
15532
|
"section",
|
|
14974
15533
|
{
|
|
14975
15534
|
"data-size": size,
|
|
14976
15535
|
className: "yv:data-[size=lg]:p-8 yv:data-[size=default]:p-4 yv:*:shrink-0 yv:font-sans yv:flex yv:flex-col yv:gap-3 yv:max-w-screen-sm yv:p-4 yv:shadow yv:rounded-2xl",
|
|
14977
15536
|
children: [
|
|
14978
|
-
/* @__PURE__ */
|
|
14979
|
-
showSunIcon ? /* @__PURE__ */
|
|
15537
|
+
/* @__PURE__ */ jsxs12("div", { className: "yv:flex yv:items-center yv:gap-2", children: [
|
|
15538
|
+
showSunIcon ? /* @__PURE__ */ jsx19(
|
|
14980
15539
|
"div",
|
|
14981
15540
|
{
|
|
14982
15541
|
"data-slot": "card-icon",
|
|
14983
15542
|
className: "yv:col-start-1 yv:row-start-1 yv:self-start yv:justify-self-start",
|
|
14984
|
-
children: /* @__PURE__ */
|
|
15543
|
+
children: /* @__PURE__ */ jsx19(SvgComponent, { className: "yv:shrink-0 yv:h-10 yv:w-10" })
|
|
14985
15544
|
}
|
|
14986
15545
|
) : null,
|
|
14987
|
-
/* @__PURE__ */
|
|
15546
|
+
/* @__PURE__ */ jsx19("div", { className: "yv:grow yv:grid", children: /* @__PURE__ */ jsx19(
|
|
14988
15547
|
"p",
|
|
14989
15548
|
{
|
|
14990
15549
|
className: "trim-both yv:line-clamp-1 yv:text-muted-foreground yv:uppercase yv:text-xs yv:font-medium yv:select-none",
|
|
14991
15550
|
children: "Verse of The Day"
|
|
14992
15551
|
}
|
|
14993
15552
|
) }),
|
|
14994
|
-
showShareButton ? /* @__PURE__ */
|
|
15553
|
+
showShareButton ? /* @__PURE__ */ jsx19(
|
|
14995
15554
|
"div",
|
|
14996
15555
|
{
|
|
14997
15556
|
"data-slot": "card-action",
|
|
14998
15557
|
className: "yv:col-start-2 yv:row-span-2 yv:row-start-1 yv:self-start yv:justify-self-end",
|
|
14999
|
-
children: /* @__PURE__ */
|
|
15558
|
+
children: /* @__PURE__ */ jsx19(
|
|
15000
15559
|
Button,
|
|
15001
15560
|
{
|
|
15002
15561
|
"aria-label": "Share",
|
|
@@ -15006,13 +15565,13 @@ function VerseOfTheDay({
|
|
|
15006
15565
|
onClick: () => alert("Share: To be implemented..."),
|
|
15007
15566
|
size: "icon",
|
|
15008
15567
|
variant: "ghost",
|
|
15009
|
-
children: /* @__PURE__ */
|
|
15568
|
+
children: /* @__PURE__ */ jsx19(SvgComponent2, { className: "yv:h-6! yv:w-6!" })
|
|
15010
15569
|
}
|
|
15011
15570
|
)
|
|
15012
15571
|
}
|
|
15013
15572
|
) : null
|
|
15014
15573
|
] }),
|
|
15015
|
-
/* @__PURE__ */
|
|
15574
|
+
/* @__PURE__ */ jsx19("div", { children: passage ? /* @__PURE__ */ jsx19(
|
|
15016
15575
|
Verse.Html,
|
|
15017
15576
|
{
|
|
15018
15577
|
fontSize: size === "default" ? 16 : 20,
|
|
@@ -15020,13 +15579,13 @@ function VerseOfTheDay({
|
|
|
15020
15579
|
html: passage?.content || ""
|
|
15021
15580
|
}
|
|
15022
15581
|
) : null }),
|
|
15023
|
-
/* @__PURE__ */
|
|
15024
|
-
showReadFullChapterButton || showBibleAppAttribution ? /* @__PURE__ */
|
|
15582
|
+
/* @__PURE__ */ jsx19("p", { className: "yv:text-(--yv-gray-30) yv:font-medium yv:text-sm", children: referenceText }),
|
|
15583
|
+
showReadFullChapterButton || showBibleAppAttribution ? /* @__PURE__ */ jsxs12(
|
|
15025
15584
|
"div",
|
|
15026
15585
|
{
|
|
15027
15586
|
className: 'yv:grid yv:grid-cols-1 yv:[:has([data-slot="card-action"]):has([data-slot="attribution"])]:grid-cols-2 yv:mt-4 yv:justify-between yv:items-center yv:gap-2 yv:w-full',
|
|
15028
15587
|
children: [
|
|
15029
|
-
showReadFullChapterButton ? /* @__PURE__ */
|
|
15588
|
+
showReadFullChapterButton ? /* @__PURE__ */ jsx19(
|
|
15030
15589
|
Button,
|
|
15031
15590
|
{
|
|
15032
15591
|
"data-slot": "card-action",
|
|
@@ -15036,7 +15595,7 @@ function VerseOfTheDay({
|
|
|
15036
15595
|
children: "Read Full Chapter"
|
|
15037
15596
|
}
|
|
15038
15597
|
) : null,
|
|
15039
|
-
showBibleAppAttribution ? /* @__PURE__ */
|
|
15598
|
+
showBibleAppAttribution ? /* @__PURE__ */ jsx19(
|
|
15040
15599
|
SvgComponent3,
|
|
15041
15600
|
{
|
|
15042
15601
|
"data-slot": "attribution",
|
|
@@ -15061,8 +15620,10 @@ export {
|
|
|
15061
15620
|
BOOK_IDS,
|
|
15062
15621
|
BibleChapterPicker,
|
|
15063
15622
|
BibleClient,
|
|
15623
|
+
BibleReader,
|
|
15064
15624
|
BibleSDKProvider,
|
|
15065
15625
|
BibleTextView,
|
|
15626
|
+
BibleVersionPicker,
|
|
15066
15627
|
HighlightsClient,
|
|
15067
15628
|
LanguagesClient,
|
|
15068
15629
|
MemoryStorageStrategy,
|