@authowl/react 0.25.0 → 0.25.1

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.
@@ -12,6 +12,7 @@ import {
12
12
 
13
13
  // src/components/PrivacyCenterContent.tsx
14
14
  import * as React from "react";
15
+ import { offeredRightTypes } from "@authowl/core";
15
16
  import { jsx, jsxs } from "react/jsx-runtime";
16
17
  var RIGHT_KEYS = {
17
18
  access: "privacy.right.access",
@@ -69,6 +70,7 @@ function PrivacyCenterContent({ className } = {}) {
69
70
  }
70
71
  if (!isSignedIn) return /* @__PURE__ */ jsx("p", { className: "ba-muted", children: t("privacy.signedOut") });
71
72
  const privacy = config?.privacy;
73
+ const offeredRights = offeredRightTypes(privacy?.availableRightTypes);
72
74
  const preferenceByCode = new Map(preferences.map((item) => [item.code, item]));
73
75
  async function updateConsent(purposeCode, granted) {
74
76
  const purpose = privacy?.consentPurposes.find((item) => item.code === purposeCode);
@@ -142,7 +144,7 @@ function PrivacyCenterContent({ className } = {}) {
142
144
  /* @__PURE__ */ jsx("h3", { children: t("privacy.rights.title") }),
143
145
  /* @__PURE__ */ jsx("p", { children: t("privacy.rights.description") })
144
146
  ] }),
145
- /* @__PURE__ */ jsx("div", { className: "ba-privacy-right-grid", children: Object.keys(RIGHT_KEYS).map((right) => /* @__PURE__ */ jsx(
147
+ offeredRights.length === 0 ? /* @__PURE__ */ jsx("p", { className: "ba-privacy-empty", children: t("privacy.rights.unavailable") }) : /* @__PURE__ */ jsx("div", { className: "ba-privacy-right-grid", children: offeredRights.map((right) => /* @__PURE__ */ jsx(
146
148
  "button",
147
149
  {
148
150
  type: "button",
package/dist/index.cjs CHANGED
@@ -2852,6 +2852,7 @@ function PrivacyCenterContent({ className } = {}) {
2852
2852
  }
2853
2853
  if (!isSignedIn) return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("p", { className: "ba-muted", children: t("privacy.signedOut") });
2854
2854
  const privacy = config?.privacy;
2855
+ const offeredRights = (0, import_core10.offeredRightTypes)(privacy?.availableRightTypes);
2855
2856
  const preferenceByCode = new Map(preferences.map((item) => [item.code, item]));
2856
2857
  async function updateConsent(purposeCode, granted) {
2857
2858
  const purpose = privacy?.consentPurposes.find((item) => item.code === purposeCode);
@@ -2925,7 +2926,7 @@ function PrivacyCenterContent({ className } = {}) {
2925
2926
  /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("h3", { children: t("privacy.rights.title") }),
2926
2927
  /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("p", { children: t("privacy.rights.description") })
2927
2928
  ] }),
2928
- /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { className: "ba-privacy-right-grid", children: Object.keys(RIGHT_KEYS).map((right) => /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
2929
+ offeredRights.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("p", { className: "ba-privacy-empty", children: t("privacy.rights.unavailable") }) : /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { className: "ba-privacy-right-grid", children: offeredRights.map((right) => /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
2929
2930
  "button",
2930
2931
  {
2931
2932
  type: "button",
@@ -2982,12 +2983,13 @@ function formatCairo(date, locale) {
2982
2983
  function classes(...values) {
2983
2984
  return values.filter(Boolean).join(" ");
2984
2985
  }
2985
- var React46, import_jsx_runtime53, RIGHT_KEYS, STATE_KEYS;
2986
+ var React46, import_core10, import_jsx_runtime53, RIGHT_KEYS, STATE_KEYS;
2986
2987
  var init_PrivacyCenterContent = __esm({
2987
2988
  "src/components/PrivacyCenterContent.tsx"() {
2988
2989
  "use strict";
2989
2990
  "use client";
2990
2991
  React46 = __toESM(require("react"), 1);
2992
+ import_core10 = require("@authowl/core");
2991
2993
  init_hooks();
2992
2994
  init_i18n();
2993
2995
  init_Spinner();
@@ -4554,7 +4556,7 @@ __export(index_exports, {
4554
4556
  AuthLoading: () => AuthLoading,
4555
4557
  AuthOwlBadge: () => AuthOwlBadge,
4556
4558
  AuthOwlBranding: () => AuthOwlBranding,
4557
- AuthOwlError: () => import_core10.AuthOwlError,
4559
+ AuthOwlError: () => import_core11.AuthOwlError,
4558
4560
  AuthOwlProvider: () => AuthOwlProvider,
4559
4561
  BackupCodesManager: () => BackupCodesManager,
4560
4562
  Bidi: () => Bidi,
@@ -4565,7 +4567,7 @@ __export(index_exports, {
4565
4567
  EmailOtpForm: () => EmailOtpForm,
4566
4568
  ForgotPassword: () => ForgotPassword,
4567
4569
  GoogleOneTap: () => GoogleOneTap,
4568
- InvalidKeyError: () => import_core10.InvalidKeyError,
4570
+ InvalidKeyError: () => import_core11.InvalidKeyError,
4569
4571
  InvitationPrompt: () => InvitationPrompt,
4570
4572
  KNOWN_METHODS: () => KNOWN_METHODS,
4571
4573
  MFAChallenge: () => MFAChallenge,
@@ -4581,7 +4583,7 @@ __export(index_exports, {
4581
4583
  PhoneOTP: () => PhoneOTP,
4582
4584
  PrivacyCenter: () => PrivacyCenter,
4583
4585
  Protect: () => Protect,
4584
- RateLimitedError: () => import_core10.RateLimitedError,
4586
+ RateLimitedError: () => import_core11.RateLimitedError,
4585
4587
  ResetPassword: () => ResetPassword,
4586
4588
  SECOND_FACTOR_REQUIRED: () => SECOND_FACTOR_REQUIRED,
4587
4589
  SignIn: () => SignIn,
@@ -4596,11 +4598,11 @@ __export(index_exports, {
4596
4598
  VerificationPending: () => VerificationPending,
4597
4599
  VerifyEmail: () => VerifyEmail,
4598
4600
  Waitlist: () => Waitlist,
4599
- createMembershipHas: () => import_core11.createMembershipHas,
4601
+ createMembershipHas: () => import_core12.createMembershipHas,
4600
4602
  emailAutocomplete: () => emailAutocomplete,
4601
- membershipHas: () => import_core11.membershipHas,
4602
- membershipHasPermission: () => import_core11.membershipHasPermission,
4603
- membershipHasTeam: () => import_core11.membershipHasTeam,
4603
+ membershipHas: () => import_core12.membershipHas,
4604
+ membershipHasPermission: () => import_core12.membershipHasPermission,
4605
+ membershipHasTeam: () => import_core12.membershipHasTeam,
4604
4606
  resolveSignInMethods: () => resolveSignInMethods,
4605
4607
  useAccount: () => useAccount,
4606
4608
  useAuth: () => useAuth,
@@ -9298,8 +9300,8 @@ function GoogleOneTap({
9298
9300
  }
9299
9301
 
9300
9302
  // src/index.ts
9301
- var import_core10 = require("@authowl/core");
9302
9303
  var import_core11 = require("@authowl/core");
9304
+ var import_core12 = require("@authowl/core");
9303
9305
  init_last_used_method();
9304
9306
  // Annotate the CommonJS export names for ESM import in node:
9305
9307
  0 && (module.exports = {
package/dist/index.js CHANGED
@@ -3969,7 +3969,7 @@ function UserProfileModal({
3969
3969
  import * as React39 from "react";
3970
3970
  import { jsx as jsx47, jsxs as jsxs44 } from "react/jsx-runtime";
3971
3971
  var PrivacyCenterContent = React39.lazy(async () => {
3972
- const module = await import("./PrivacyCenterContent-EQEXXSLA.js");
3972
+ const module = await import("./PrivacyCenterContent-C4ON7H74.js");
3973
3973
  return { default: module.PrivacyCenterContent };
3974
3974
  });
3975
3975
  function PrivacyCenter(props = {}) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@authowl/react",
3
- "version": "0.25.0",
3
+ "version": "0.25.1",
4
4
  "description": "React provider, hooks, and drop-in components for AuthOwl, the multi-tenant auth SaaS.",
5
5
  "license": "MIT",
6
6
  "publishConfig": {
@@ -47,7 +47,7 @@
47
47
  "LICENSE"
48
48
  ],
49
49
  "dependencies": {
50
- "@authowl/core": "0.24.0"
50
+ "@authowl/core": "0.24.1"
51
51
  },
52
52
  "peerDependencies": {
53
53
  "react": ">=18",