@authowl/react-native 0.4.5 → 0.4.7
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/dist/index.cjs +24 -19
- package/dist/index.js +24 -19
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -868,6 +868,7 @@ function NativePrivacySignUpEvidence({
|
|
|
868
868
|
// src/components/PrivacyCenter.tsx
|
|
869
869
|
var import_react6 = require("react");
|
|
870
870
|
var import_react_native5 = require("react-native");
|
|
871
|
+
var import_core = require("@authowl/core");
|
|
871
872
|
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
872
873
|
var RIGHT_KEYS = {
|
|
873
874
|
access: "privacy.right.access",
|
|
@@ -961,6 +962,7 @@ function PrivacyCenter({ theme = defaultTheme } = {}) {
|
|
|
961
962
|
}
|
|
962
963
|
if (!signedIn) return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native5.Text, { style: { color: theme.mutedText }, children: t("privacy.signedOut") });
|
|
963
964
|
const privacy = config.data?.privacy;
|
|
965
|
+
const offeredRights = (0, import_core.offeredRightTypes)(privacy?.availableRightTypes);
|
|
964
966
|
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
965
967
|
import_react_native5.View,
|
|
966
968
|
{
|
|
@@ -1021,31 +1023,34 @@ function PrivacyCenter({ theme = defaultTheme } = {}) {
|
|
|
1021
1023
|
})
|
|
1022
1024
|
}
|
|
1023
1025
|
),
|
|
1024
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.
|
|
1026
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
1025
1027
|
PrivacyBlock,
|
|
1026
1028
|
{
|
|
1027
1029
|
title: t("privacy.rights.title"),
|
|
1028
1030
|
description: t("privacy.rights.description"),
|
|
1029
1031
|
theme,
|
|
1030
|
-
children:
|
|
1031
|
-
import_react_native5.
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1032
|
+
children: [
|
|
1033
|
+
offeredRights.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native5.Text, { style: { color: theme.mutedText }, children: t("privacy.rights.unavailable") }),
|
|
1034
|
+
offeredRights.map((right) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
1035
|
+
import_react_native5.Pressable,
|
|
1036
|
+
{
|
|
1037
|
+
testID: `authowl-privacy-right-${right}`,
|
|
1038
|
+
accessibilityRole: "button",
|
|
1039
|
+
accessibilityState: { disabled: pendingRight !== null, busy: pendingRight === right },
|
|
1040
|
+
disabled: pendingRight !== null,
|
|
1041
|
+
onPress: () => void createRequest(right),
|
|
1042
|
+
style: {
|
|
1043
|
+
borderWidth: 1,
|
|
1044
|
+
borderColor: right === "erasure" ? theme.danger : theme.border,
|
|
1045
|
+
borderRadius: theme.radius,
|
|
1046
|
+
padding: 12,
|
|
1047
|
+
opacity: pendingRight !== null ? 0.55 : 1
|
|
1048
|
+
},
|
|
1049
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native5.Text, { style: { color: right === "erasure" ? theme.danger : theme.text, fontWeight: "600" }, children: pendingRight === right ? t("common.working") : t(RIGHT_KEYS[right]) })
|
|
1044
1050
|
},
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
))
|
|
1051
|
+
right
|
|
1052
|
+
))
|
|
1053
|
+
]
|
|
1049
1054
|
}
|
|
1050
1055
|
),
|
|
1051
1056
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
package/dist/index.js
CHANGED
|
@@ -836,6 +836,7 @@ function NativePrivacySignUpEvidence({
|
|
|
836
836
|
// src/components/PrivacyCenter.tsx
|
|
837
837
|
import { useCallback as useCallback2, useEffect as useEffect3, useMemo as useMemo4, useState as useState4 } from "react";
|
|
838
838
|
import { ActivityIndicator as ActivityIndicator2, Pressable as Pressable3, Text as Text4, View as View4 } from "react-native";
|
|
839
|
+
import { offeredRightTypes } from "@authowl/core";
|
|
839
840
|
import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
840
841
|
var RIGHT_KEYS = {
|
|
841
842
|
access: "privacy.right.access",
|
|
@@ -929,6 +930,7 @@ function PrivacyCenter({ theme = defaultTheme } = {}) {
|
|
|
929
930
|
}
|
|
930
931
|
if (!signedIn) return /* @__PURE__ */ jsx4(Text4, { style: { color: theme.mutedText }, children: t("privacy.signedOut") });
|
|
931
932
|
const privacy = config.data?.privacy;
|
|
933
|
+
const offeredRights = offeredRightTypes(privacy?.availableRightTypes);
|
|
932
934
|
return /* @__PURE__ */ jsxs4(
|
|
933
935
|
View4,
|
|
934
936
|
{
|
|
@@ -989,31 +991,34 @@ function PrivacyCenter({ theme = defaultTheme } = {}) {
|
|
|
989
991
|
})
|
|
990
992
|
}
|
|
991
993
|
),
|
|
992
|
-
/* @__PURE__ */
|
|
994
|
+
/* @__PURE__ */ jsxs4(
|
|
993
995
|
PrivacyBlock,
|
|
994
996
|
{
|
|
995
997
|
title: t("privacy.rights.title"),
|
|
996
998
|
description: t("privacy.rights.description"),
|
|
997
999
|
theme,
|
|
998
|
-
children:
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1000
|
+
children: [
|
|
1001
|
+
offeredRights.length === 0 && /* @__PURE__ */ jsx4(Text4, { style: { color: theme.mutedText }, children: t("privacy.rights.unavailable") }),
|
|
1002
|
+
offeredRights.map((right) => /* @__PURE__ */ jsx4(
|
|
1003
|
+
Pressable3,
|
|
1004
|
+
{
|
|
1005
|
+
testID: `authowl-privacy-right-${right}`,
|
|
1006
|
+
accessibilityRole: "button",
|
|
1007
|
+
accessibilityState: { disabled: pendingRight !== null, busy: pendingRight === right },
|
|
1008
|
+
disabled: pendingRight !== null,
|
|
1009
|
+
onPress: () => void createRequest(right),
|
|
1010
|
+
style: {
|
|
1011
|
+
borderWidth: 1,
|
|
1012
|
+
borderColor: right === "erasure" ? theme.danger : theme.border,
|
|
1013
|
+
borderRadius: theme.radius,
|
|
1014
|
+
padding: 12,
|
|
1015
|
+
opacity: pendingRight !== null ? 0.55 : 1
|
|
1016
|
+
},
|
|
1017
|
+
children: /* @__PURE__ */ jsx4(Text4, { style: { color: right === "erasure" ? theme.danger : theme.text, fontWeight: "600" }, children: pendingRight === right ? t("common.working") : t(RIGHT_KEYS[right]) })
|
|
1012
1018
|
},
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
))
|
|
1019
|
+
right
|
|
1020
|
+
))
|
|
1021
|
+
]
|
|
1017
1022
|
}
|
|
1018
1023
|
),
|
|
1019
1024
|
/* @__PURE__ */ jsx4(
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@authowl/react-native",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.7",
|
|
4
4
|
"description": "React Native provider, hooks, and secure session storage for AuthOwl, the multi-tenant auth SaaS.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"publishConfig": {
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"LICENSE"
|
|
45
45
|
],
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@authowl/core": "0.24.
|
|
47
|
+
"@authowl/core": "0.24.2"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
50
50
|
"react": ">=18",
|