@youversion/platform-react-ui 1.12.1 → 1.12.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"bible-reader.d.ts","sourceRoot":"","sources":["../../src/components/bible-reader.tsx"],"names":[],"mappings":"AAEA,OAAO,EAOL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAuCf,MAAM,MAAM,SAAS,GAAG;IACtB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,eAAe,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,UAAU,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IAC9B,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB,CAAC;AAMF,iBAAS,IAAI,CAAC,EACZ,IAAI,EAAE,cAAc,EACpB,WAAmB,EACnB,YAAY,EACZ,OAAO,EAAE,iBAAiB,EAC1B,cAAoB,EACpB,eAAe,EACf,SAAS,EAAE,mBAAmB,EAC9B,gBAAsB,EACtB,eAAe,EACf,UAAoB,EACpB,QAA4B,EAC5B,UAAU,EACV,gBAAuB,EACvB,UAAU,EACV,QAAQ,GACT,EAAE,SAAS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AsB,EACtB,eAAe,EACf,UAAoB,EACpB,QAA4B,EAC5B,UAAU,EACV,gBAAuB,EACvB,UAAU,EACV,QAAQ,GACT,EAAE,SAAS,2CAgFX;AAED,iBAAS,OAAO,4CAoEf;AAuCD,iBAAS,OAAO,CAAC,EAAE,MAAc,EAAE,EAAE;IAAE,MAAM,CAAC,EAAE,KAAK,GAAG,QAAQ,CAAA;CAAE,2CAmKjE;AAED,eAAO,MAAM,WAAW;;;;CAAgD,CAAC;AACzE,MAAM,MAAM,oBAAoB,GAAG,SAAS,CAAC"}
package/dist/index.cjs CHANGED
@@ -16087,6 +16087,30 @@ function Content4() {
16087
16087
  )
16088
16088
  ] });
16089
16089
  }
16090
+ function UserMenu() {
16091
+ const { auth, signIn, signOut, userInfo } = (0, import_platform_react_hooks4.useYVAuth)();
16092
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(Popover, { children: [
16093
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
16094
+ PopoverTrigger,
16095
+ {
16096
+ "data-testid": "user-menu-trigger",
16097
+ className: cn(
16098
+ "yv:inline-flex yv:items-center yv:justify-center yv:justify-self-end yv:mr-4 yv:h-9 yv:rounded-md yv:bg-muted yv:text-foreground yv:hover:bg-muted/80 yv:hover:cursor-pointer yv:overflow-hidden",
16099
+ !(auth.isAuthenticated && userInfo?.avatarUrlFormat) && "yv:px-2"
16100
+ ),
16101
+ children: auth.isAuthenticated && userInfo?.avatarUrlFormat ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
16102
+ "img",
16103
+ {
16104
+ src: userInfo.getAvatarUrl(32, 32)?.toString(),
16105
+ alt: userInfo.name || "User avatar",
16106
+ className: "yv:size-full yv:rounded-full yv:object-cover"
16107
+ }
16108
+ ) : /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(PersonIcon, {})
16109
+ }
16110
+ ),
16111
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(PopoverContent, { className: "yv:rounded-[6px] yv:sm:w-min yv:px-4 yv:mb-6", showHeader: false, children: auth.isAuthenticated ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Button, { className: "yv:text-black", onClick: () => signOut(), children: "Sign Out" }) : /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Button, { className: "yv:text-black", onClick: () => void signIn({ scopes: ["profile"] }), children: "Sign In" }) })
16112
+ ] });
16113
+ }
16090
16114
  function Toolbar({ border = "top" }) {
16091
16115
  const {
16092
16116
  book,
@@ -16100,7 +16124,8 @@ function Toolbar({ border = "top" }) {
16100
16124
  setCurrentFontSize,
16101
16125
  background
16102
16126
  } = useBibleReaderContext();
16103
- const { auth, signIn, signOut, userInfo } = (0, import_platform_react_hooks4.useYVAuth)();
16127
+ const yvContext = (0, import_react4.useContext)(import_platform_react_hooks4.YouVersionContext);
16128
+ const authEnabled = yvContext?.authEnabled || false;
16104
16129
  return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
16105
16130
  "section",
16106
16131
  {
@@ -16110,41 +16135,7 @@ function Toolbar({ border = "top" }) {
16110
16135
  border === "bottom" && "yv:border-b"
16111
16136
  ),
16112
16137
  children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "yv:grid yv:w-full yv:grid-cols-7 yv:items-center yv:max-w-lg yv:gap-0.5", children: [
16113
- /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(Popover, { children: [
16114
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
16115
- PopoverTrigger,
16116
- {
16117
- "data-testid": "user-menu-trigger",
16118
- className: cn(
16119
- "yv:inline-flex yv:items-center yv:justify-center yv:justify-self-end yv:mr-4 yv:h-9 yv:rounded-md yv:bg-muted yv:text-foreground yv:hover:bg-muted/80 yv:hover:cursor-pointer yv:overflow-hidden",
16120
- !(auth.isAuthenticated && userInfo?.avatarUrlFormat) && "yv:px-2"
16121
- ),
16122
- children: auth.isAuthenticated && userInfo?.avatarUrlFormat ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
16123
- "img",
16124
- {
16125
- src: userInfo.getAvatarUrl(32, 32)?.toString(),
16126
- alt: userInfo.name || "User avatar",
16127
- className: "yv:size-full yv:rounded-full yv:object-cover"
16128
- }
16129
- ) : /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(PersonIcon, {})
16130
- }
16131
- ),
16132
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
16133
- PopoverContent,
16134
- {
16135
- className: "yv:rounded-[6px] yv:sm:w-min yv:px-4 yv:mb-6",
16136
- showHeader: false,
16137
- children: auth.isAuthenticated ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Button, { className: "yv:text-black", onClick: signOut, children: "Sign Out" }) : /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
16138
- Button,
16139
- {
16140
- className: "yv:text-black",
16141
- onClick: () => void signIn({ scopes: ["profile"] }),
16142
- children: "Sign In"
16143
- }
16144
- )
16145
- }
16146
- )
16147
- ] }),
16138
+ authEnabled && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(UserMenu, {}),
16148
16139
  /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
16149
16140
  BibleChapterPicker.Root,
16150
16141
  {
package/dist/index.js CHANGED
@@ -14714,7 +14714,13 @@ import {
14714
14714
  useLayoutEffect as useLayoutEffect2
14715
14715
  } from "react";
14716
14716
  import { useControllableState as useControllableState3 } from "@radix-ui/react-use-controllable-state";
14717
- import { useBooks as useBooks2, useVersion as useVersion2, useTheme as useTheme4, useYVAuth } from "@youversion/platform-react-hooks";
14717
+ import {
14718
+ useBooks as useBooks2,
14719
+ useVersion as useVersion2,
14720
+ useTheme as useTheme4,
14721
+ useYVAuth,
14722
+ YouVersionContext
14723
+ } from "@youversion/platform-react-hooks";
14718
14724
 
14719
14725
  // src/components/bible-version-picker.tsx
14720
14726
  import { useControllableState as useControllableState2 } from "@radix-ui/react-use-controllable-state";
@@ -16070,6 +16076,30 @@ function Content4() {
16070
16076
  )
16071
16077
  ] });
16072
16078
  }
16079
+ function UserMenu() {
16080
+ const { auth, signIn, signOut, userInfo } = useYVAuth();
16081
+ return /* @__PURE__ */ jsxs7(Popover, { children: [
16082
+ /* @__PURE__ */ jsx20(
16083
+ PopoverTrigger,
16084
+ {
16085
+ "data-testid": "user-menu-trigger",
16086
+ className: cn(
16087
+ "yv:inline-flex yv:items-center yv:justify-center yv:justify-self-end yv:mr-4 yv:h-9 yv:rounded-md yv:bg-muted yv:text-foreground yv:hover:bg-muted/80 yv:hover:cursor-pointer yv:overflow-hidden",
16088
+ !(auth.isAuthenticated && userInfo?.avatarUrlFormat) && "yv:px-2"
16089
+ ),
16090
+ children: auth.isAuthenticated && userInfo?.avatarUrlFormat ? /* @__PURE__ */ jsx20(
16091
+ "img",
16092
+ {
16093
+ src: userInfo.getAvatarUrl(32, 32)?.toString(),
16094
+ alt: userInfo.name || "User avatar",
16095
+ className: "yv:size-full yv:rounded-full yv:object-cover"
16096
+ }
16097
+ ) : /* @__PURE__ */ jsx20(PersonIcon, {})
16098
+ }
16099
+ ),
16100
+ /* @__PURE__ */ jsx20(PopoverContent, { className: "yv:rounded-[6px] yv:sm:w-min yv:px-4 yv:mb-6", showHeader: false, children: auth.isAuthenticated ? /* @__PURE__ */ jsx20(Button, { className: "yv:text-black", onClick: () => signOut(), children: "Sign Out" }) : /* @__PURE__ */ jsx20(Button, { className: "yv:text-black", onClick: () => void signIn({ scopes: ["profile"] }), children: "Sign In" }) })
16101
+ ] });
16102
+ }
16073
16103
  function Toolbar({ border = "top" }) {
16074
16104
  const {
16075
16105
  book,
@@ -16083,7 +16113,8 @@ function Toolbar({ border = "top" }) {
16083
16113
  setCurrentFontSize,
16084
16114
  background
16085
16115
  } = useBibleReaderContext();
16086
- const { auth, signIn, signOut, userInfo } = useYVAuth();
16116
+ const yvContext = useContext3(YouVersionContext);
16117
+ const authEnabled = yvContext?.authEnabled || false;
16087
16118
  return /* @__PURE__ */ jsx20(
16088
16119
  "section",
16089
16120
  {
@@ -16093,41 +16124,7 @@ function Toolbar({ border = "top" }) {
16093
16124
  border === "bottom" && "yv:border-b"
16094
16125
  ),
16095
16126
  children: /* @__PURE__ */ jsxs7("div", { className: "yv:grid yv:w-full yv:grid-cols-7 yv:items-center yv:max-w-lg yv:gap-0.5", children: [
16096
- /* @__PURE__ */ jsxs7(Popover, { children: [
16097
- /* @__PURE__ */ jsx20(
16098
- PopoverTrigger,
16099
- {
16100
- "data-testid": "user-menu-trigger",
16101
- className: cn(
16102
- "yv:inline-flex yv:items-center yv:justify-center yv:justify-self-end yv:mr-4 yv:h-9 yv:rounded-md yv:bg-muted yv:text-foreground yv:hover:bg-muted/80 yv:hover:cursor-pointer yv:overflow-hidden",
16103
- !(auth.isAuthenticated && userInfo?.avatarUrlFormat) && "yv:px-2"
16104
- ),
16105
- children: auth.isAuthenticated && userInfo?.avatarUrlFormat ? /* @__PURE__ */ jsx20(
16106
- "img",
16107
- {
16108
- src: userInfo.getAvatarUrl(32, 32)?.toString(),
16109
- alt: userInfo.name || "User avatar",
16110
- className: "yv:size-full yv:rounded-full yv:object-cover"
16111
- }
16112
- ) : /* @__PURE__ */ jsx20(PersonIcon, {})
16113
- }
16114
- ),
16115
- /* @__PURE__ */ jsx20(
16116
- PopoverContent,
16117
- {
16118
- className: "yv:rounded-[6px] yv:sm:w-min yv:px-4 yv:mb-6",
16119
- showHeader: false,
16120
- children: auth.isAuthenticated ? /* @__PURE__ */ jsx20(Button, { className: "yv:text-black", onClick: signOut, children: "Sign Out" }) : /* @__PURE__ */ jsx20(
16121
- Button,
16122
- {
16123
- className: "yv:text-black",
16124
- onClick: () => void signIn({ scopes: ["profile"] }),
16125
- children: "Sign In"
16126
- }
16127
- )
16128
- }
16129
- )
16130
- ] }),
16127
+ authEnabled && /* @__PURE__ */ jsx20(UserMenu, {}),
16131
16128
  /* @__PURE__ */ jsx20(
16132
16129
  BibleChapterPicker.Root,
16133
16130
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@youversion/platform-react-ui",
3
- "version": "1.12.1",
3
+ "version": "1.12.2",
4
4
  "description": "React SDK for YouVersion Platform",
5
5
  "license": "TBD",
6
6
  "type": "module",
@@ -38,8 +38,8 @@
38
38
  "isomorphic-dompurify": "2.23.0",
39
39
  "tailwind-merge": "3.3.1",
40
40
  "tw-animate-css": "1.4.0",
41
- "@youversion/platform-core": "1.12.1",
42
- "@youversion/platform-react-hooks": "1.12.1"
41
+ "@youversion/platform-core": "1.12.2",
42
+ "@youversion/platform-react-hooks": "1.12.2"
43
43
  },
44
44
  "peerDependencies": {
45
45
  "react": ">=19.1.0 <20.0.0",
@@ -76,8 +76,8 @@
76
76
  "vite": "7.1.11",
77
77
  "vitest": "4.0.4",
78
78
  "vitest-browser-react": "2.0.2",
79
- "@internal/tsconfig": "0.0.0",
80
- "@internal/eslint-config": "0.0.0"
79
+ "@internal/eslint-config": "0.0.0",
80
+ "@internal/tsconfig": "0.0.0"
81
81
  },
82
82
  "publishConfig": {
83
83
  "access": "public",