@redacto.io/consent-sdk-react-native 5.0.0-beta.10 → 5.0.0-beta.11
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.js +44 -136
- package/dist/index.mjs +44 -136
- package/dist/privacy-center.js +133 -74
- package/dist/privacy-center.mjs +110 -51
- package/package.json +10 -9
- package/LICENSE +0 -176
package/dist/privacy-center.js
CHANGED
|
@@ -18530,10 +18530,26 @@ var styles35 = import_react_native46.StyleSheet.create({
|
|
|
18530
18530
|
});
|
|
18531
18531
|
|
|
18532
18532
|
// src/RedactoPrivacyCenter/components/SlimTopBar.tsx
|
|
18533
|
-
var
|
|
18533
|
+
var import_react35 = require("react");
|
|
18534
18534
|
var import_react_native49 = require("react-native");
|
|
18535
18535
|
var import_react_i18next19 = require("react-i18next");
|
|
18536
18536
|
|
|
18537
|
+
// src/RedactoPrivacyCenter/context/ProfileSwitchContext.tsx
|
|
18538
|
+
var import_react32 = require("react");
|
|
18539
|
+
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
18540
|
+
var ProfileSwitchContext = (0, import_react32.createContext)({
|
|
18541
|
+
switchProfile: null
|
|
18542
|
+
});
|
|
18543
|
+
function ProfileSwitchProvider({
|
|
18544
|
+
switchProfile,
|
|
18545
|
+
children
|
|
18546
|
+
}) {
|
|
18547
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(ProfileSwitchContext.Provider, { value: { switchProfile }, children });
|
|
18548
|
+
}
|
|
18549
|
+
function useProfileSwitch() {
|
|
18550
|
+
return (0, import_react32.useContext)(ProfileSwitchContext);
|
|
18551
|
+
}
|
|
18552
|
+
|
|
18537
18553
|
// src/RedactoPrivacyCenter/lib/navigation.ts
|
|
18538
18554
|
function navigateBack(onBack) {
|
|
18539
18555
|
var _a3, _b;
|
|
@@ -18557,12 +18573,12 @@ function navigateBack(onBack) {
|
|
|
18557
18573
|
|
|
18558
18574
|
// src/RedactoPrivacyCenter/components/NotificationHub/NotificationBell.tsx
|
|
18559
18575
|
var import_react_native47 = require("react-native");
|
|
18560
|
-
var
|
|
18576
|
+
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
18561
18577
|
var NotificationBell = ({ count, onPress }) => {
|
|
18562
18578
|
const { colors } = useTheme();
|
|
18563
18579
|
const showBadge = count > 0;
|
|
18564
18580
|
const badgeLabel = count > 99 ? "99+" : String(count);
|
|
18565
|
-
return /* @__PURE__ */ (0,
|
|
18581
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
|
|
18566
18582
|
import_react_native47.TouchableOpacity,
|
|
18567
18583
|
{
|
|
18568
18584
|
onPress,
|
|
@@ -18572,8 +18588,8 @@ var NotificationBell = ({ count, onPress }) => {
|
|
|
18572
18588
|
accessibilityRole: "button",
|
|
18573
18589
|
accessibilityLabel: showBadge ? `Notifications, ${count} unread` : "Notifications",
|
|
18574
18590
|
children: [
|
|
18575
|
-
/* @__PURE__ */ (0,
|
|
18576
|
-
showBadge ? /* @__PURE__ */ (0,
|
|
18591
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(Icon, { name: "bell", size: 22, color: colors.text }),
|
|
18592
|
+
showBadge ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_react_native47.View, { style: [styles36.badge, { backgroundColor: colors.error, borderColor: colors.canvasSubtle }], children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_react_native47.Text, { style: styles36.badgeText, numberOfLines: 1, children: badgeLabel }) }) : null
|
|
18577
18593
|
]
|
|
18578
18594
|
}
|
|
18579
18595
|
);
|
|
@@ -18605,27 +18621,27 @@ var styles36 = import_react_native47.StyleSheet.create({
|
|
|
18605
18621
|
});
|
|
18606
18622
|
|
|
18607
18623
|
// src/RedactoPrivacyCenter/components/NotificationHub/useUnreadCount.ts
|
|
18608
|
-
var
|
|
18624
|
+
var import_react33 = require("react");
|
|
18609
18625
|
function useUnreadCount() {
|
|
18610
18626
|
const { accessToken, refreshToken, onError, updateTokens, organizationId, workspaceId } = useAuth();
|
|
18611
18627
|
const { consentClient } = useBaseUrl();
|
|
18612
|
-
const [count, setCount] = (0,
|
|
18613
|
-
const authContext = (0,
|
|
18628
|
+
const [count, setCount] = (0, import_react33.useState)(0);
|
|
18629
|
+
const authContext = (0, import_react33.useMemo)(
|
|
18614
18630
|
() => ({ accessToken, refreshToken, onError, updateTokens }),
|
|
18615
18631
|
[accessToken, refreshToken, onError, updateTokens]
|
|
18616
18632
|
);
|
|
18617
|
-
const loadRef = (0,
|
|
18633
|
+
const loadRef = (0, import_react33.useRef)();
|
|
18618
18634
|
loadRef.current = async () => {
|
|
18619
18635
|
if (!organizationId || !workspaceId) return;
|
|
18620
18636
|
if (isRefreshBlocked(authContext)) return;
|
|
18621
18637
|
const res = await fetchUnreadCount(organizationId, workspaceId, authContext, consentClient);
|
|
18622
18638
|
if (res && typeof res.count === "number") setCount(res.count);
|
|
18623
18639
|
};
|
|
18624
|
-
(0,
|
|
18640
|
+
(0, import_react33.useEffect)(() => {
|
|
18625
18641
|
var _a3;
|
|
18626
18642
|
(_a3 = loadRef.current) == null ? void 0 : _a3.call(loadRef);
|
|
18627
18643
|
}, [organizationId, workspaceId]);
|
|
18628
|
-
(0,
|
|
18644
|
+
(0, import_react33.useEffect)(() => {
|
|
18629
18645
|
const id = setInterval(() => {
|
|
18630
18646
|
var _a3;
|
|
18631
18647
|
(_a3 = loadRef.current) == null ? void 0 : _a3.call(loadRef);
|
|
@@ -18636,17 +18652,17 @@ function useUnreadCount() {
|
|
|
18636
18652
|
}
|
|
18637
18653
|
|
|
18638
18654
|
// src/RedactoPrivacyCenter/components/NavDrawer.tsx
|
|
18639
|
-
var
|
|
18655
|
+
var import_react34 = require("react");
|
|
18640
18656
|
var import_react_native48 = require("react-native");
|
|
18641
18657
|
var import_react_i18next18 = require("react-i18next");
|
|
18642
|
-
var
|
|
18658
|
+
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
18643
18659
|
var NavDrawer = ({ visible, onClose, onBack }) => {
|
|
18644
18660
|
const { t } = (0, import_react_i18next18.useTranslation)();
|
|
18645
18661
|
const { colors, branding } = useTheme();
|
|
18646
18662
|
const { organizationName, email } = useAuth();
|
|
18647
18663
|
const { currentPage, navigateTo } = useInternalNavigation();
|
|
18648
|
-
const [locale, setLocale] = (0,
|
|
18649
|
-
const items = (0,
|
|
18664
|
+
const [locale, setLocale] = (0, import_react34.useState)(i18n_default.language || "en");
|
|
18665
|
+
const items = (0, import_react34.useMemo)(
|
|
18650
18666
|
() => [
|
|
18651
18667
|
{ page: "home", label: t("privacyCenter") || "Home", icon: "shield", tone: "primary" },
|
|
18652
18668
|
{ page: "consent-manager", label: t("manageConsent") || "Consents", icon: "shield-check", tone: "primary" },
|
|
@@ -18661,18 +18677,18 @@ var NavDrawer = ({ visible, onClose, onBack }) => {
|
|
|
18661
18677
|
i18n_default.changeLanguage(value);
|
|
18662
18678
|
};
|
|
18663
18679
|
const brandName = (branding == null ? void 0 : branding.brand_name) || organizationName || t("privacyCenter") || "Privacy Center";
|
|
18664
|
-
return /* @__PURE__ */ (0,
|
|
18665
|
-
/* @__PURE__ */ (0,
|
|
18666
|
-
/* @__PURE__ */ (0,
|
|
18667
|
-
/* @__PURE__ */ (0,
|
|
18668
|
-
/* @__PURE__ */ (0,
|
|
18669
|
-
email ? /* @__PURE__ */ (0,
|
|
18680
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(BottomSheet, { visible, onClose, title: t("menu") || "Menu", children: /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(import_react_native48.View, { style: styles37.body, children: [
|
|
18681
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(import_react_native48.View, { style: [styles37.identity, { backgroundColor: colors.surfaceAlt }], children: [
|
|
18682
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(PCAvatar, { name: brandName, imageUrl: branding == null ? void 0 : branding.icon_url, size: 40 }),
|
|
18683
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(import_react_native48.View, { style: styles37.identityText, children: [
|
|
18684
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_react_native48.Text, { style: [styles37.brandName, { color: colors.text }], numberOfLines: 1, children: brandName }),
|
|
18685
|
+
email ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_react_native48.Text, { style: [styles37.email, { color: colors.textSecondary }], numberOfLines: 1, children: email }) : null
|
|
18670
18686
|
] })
|
|
18671
18687
|
] }),
|
|
18672
|
-
/* @__PURE__ */ (0,
|
|
18688
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_react_native48.View, { style: [styles37.menuGroup, { borderColor: colors.border, backgroundColor: colors.surface }], children: items.map((item, index) => {
|
|
18673
18689
|
const isActive = currentPage === item.page;
|
|
18674
|
-
return /* @__PURE__ */ (0,
|
|
18675
|
-
/* @__PURE__ */ (0,
|
|
18690
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(import_react_native48.View, { children: [
|
|
18691
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
|
|
18676
18692
|
import_react_native48.TouchableOpacity,
|
|
18677
18693
|
{
|
|
18678
18694
|
style: styles37.menuItem,
|
|
@@ -18685,8 +18701,8 @@ var NavDrawer = ({ visible, onClose, onBack }) => {
|
|
|
18685
18701
|
accessibilityState: { selected: isActive },
|
|
18686
18702
|
accessibilityLabel: item.label,
|
|
18687
18703
|
children: [
|
|
18688
|
-
/* @__PURE__ */ (0,
|
|
18689
|
-
/* @__PURE__ */ (0,
|
|
18704
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(IconTile, { name: item.icon, tone: item.tone, size: "sm" }),
|
|
18705
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
18690
18706
|
import_react_native48.Text,
|
|
18691
18707
|
{
|
|
18692
18708
|
style: [styles37.menuLabel, { color: isActive ? colors.primary : colors.text }],
|
|
@@ -18694,14 +18710,14 @@ var NavDrawer = ({ visible, onClose, onBack }) => {
|
|
|
18694
18710
|
children: item.label
|
|
18695
18711
|
}
|
|
18696
18712
|
),
|
|
18697
|
-
/* @__PURE__ */ (0,
|
|
18713
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Icon, { name: "chevron-right", size: 18, color: colors.textSecondary })
|
|
18698
18714
|
]
|
|
18699
18715
|
}
|
|
18700
18716
|
),
|
|
18701
|
-
index < items.length - 1 ? /* @__PURE__ */ (0,
|
|
18717
|
+
index < items.length - 1 ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_react_native48.View, { style: [styles37.separator, { backgroundColor: colors.hairline }] }) : null
|
|
18702
18718
|
] }, item.page);
|
|
18703
18719
|
}) }),
|
|
18704
|
-
/* @__PURE__ */ (0,
|
|
18720
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
18705
18721
|
PCSelect,
|
|
18706
18722
|
{
|
|
18707
18723
|
label: t("language"),
|
|
@@ -18711,7 +18727,7 @@ var NavDrawer = ({ visible, onClose, onBack }) => {
|
|
|
18711
18727
|
placeholder: t("language")
|
|
18712
18728
|
}
|
|
18713
18729
|
),
|
|
18714
|
-
onBack ? /* @__PURE__ */ (0,
|
|
18730
|
+
onBack ? /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
|
|
18715
18731
|
import_react_native48.TouchableOpacity,
|
|
18716
18732
|
{
|
|
18717
18733
|
style: [styles37.actionButton, { borderColor: colors.border, backgroundColor: colors.surface }],
|
|
@@ -18722,7 +18738,7 @@ var NavDrawer = ({ visible, onClose, onBack }) => {
|
|
|
18722
18738
|
activeOpacity: 0.7,
|
|
18723
18739
|
accessibilityRole: "button",
|
|
18724
18740
|
children: [
|
|
18725
|
-
/* @__PURE__ */ (0,
|
|
18741
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
18726
18742
|
Icon,
|
|
18727
18743
|
{
|
|
18728
18744
|
name: onBack === "signout" ? "log-out" : "arrow-left",
|
|
@@ -18730,11 +18746,11 @@ var NavDrawer = ({ visible, onClose, onBack }) => {
|
|
|
18730
18746
|
color: onBack === "signout" ? colors.error : colors.text
|
|
18731
18747
|
}
|
|
18732
18748
|
),
|
|
18733
|
-
/* @__PURE__ */ (0,
|
|
18749
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_react_native48.Text, { style: [styles37.actionLabel, { color: onBack === "signout" ? colors.error : colors.text }], children: onBack === "signout" ? t("signOut") || "Sign Out" : t("back") || "Back" })
|
|
18734
18750
|
]
|
|
18735
18751
|
}
|
|
18736
18752
|
) : null,
|
|
18737
|
-
/* @__PURE__ */ (0,
|
|
18753
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Footer, { inline: true })
|
|
18738
18754
|
] }) });
|
|
18739
18755
|
};
|
|
18740
18756
|
var styles37 = import_react_native48.StyleSheet.create({
|
|
@@ -18796,7 +18812,7 @@ var styles37 = import_react_native48.StyleSheet.create({
|
|
|
18796
18812
|
});
|
|
18797
18813
|
|
|
18798
18814
|
// src/RedactoPrivacyCenter/components/SlimTopBar.tsx
|
|
18799
|
-
var
|
|
18815
|
+
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
18800
18816
|
var SlimTopBar = ({ mode = "primary", onBack }) => {
|
|
18801
18817
|
const { t } = (0, import_react_i18next19.useTranslation)();
|
|
18802
18818
|
const { currentPage, navigateTo } = useInternalNavigation();
|
|
@@ -18804,10 +18820,11 @@ var SlimTopBar = ({ mode = "primary", onBack }) => {
|
|
|
18804
18820
|
const { organizationName } = useAuth();
|
|
18805
18821
|
const unreadCount = useUnreadCount();
|
|
18806
18822
|
const insets = useSafeInsets();
|
|
18807
|
-
const [menuOpen, setMenuOpen] = (0,
|
|
18823
|
+
const [menuOpen, setMenuOpen] = (0, import_react35.useState)(false);
|
|
18824
|
+
const { switchProfile } = useProfileSwitch();
|
|
18808
18825
|
const pageChrome = PAGE_CHROME_BY_PAGE[currentPage];
|
|
18809
18826
|
const isDetail = mode === "detail";
|
|
18810
|
-
const brandLabel = (0,
|
|
18827
|
+
const brandLabel = (0, import_react35.useMemo)(
|
|
18811
18828
|
() => (branding == null ? void 0 : branding.brand_name) || organizationName || t("privacyCenter") || "Privacy Center",
|
|
18812
18829
|
[branding == null ? void 0 : branding.brand_name, organizationName, t]
|
|
18813
18830
|
);
|
|
@@ -18822,16 +18839,16 @@ var SlimTopBar = ({ mode = "primary", onBack }) => {
|
|
|
18822
18839
|
}
|
|
18823
18840
|
navigateBack(onBack);
|
|
18824
18841
|
};
|
|
18825
|
-
return /* @__PURE__ */ (0,
|
|
18826
|
-
/* @__PURE__ */ (0,
|
|
18842
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(import_jsx_runtime49.Fragment, { children: [
|
|
18843
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
18827
18844
|
import_react_native49.View,
|
|
18828
18845
|
{
|
|
18829
18846
|
style: [
|
|
18830
18847
|
styles38.container,
|
|
18831
18848
|
{ backgroundColor: colors.canvasSubtle, borderBottomColor: colors.hairline, paddingTop: insets.top + spacing.xs }
|
|
18832
18849
|
],
|
|
18833
|
-
children: isDetail ? /* @__PURE__ */ (0,
|
|
18834
|
-
/* @__PURE__ */ (0,
|
|
18850
|
+
children: isDetail ? /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(import_react_native49.View, { style: styles38.detailRow, children: [
|
|
18851
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
18835
18852
|
import_react_native49.TouchableOpacity,
|
|
18836
18853
|
{
|
|
18837
18854
|
style: styles38.iconButton,
|
|
@@ -18840,27 +18857,39 @@ var SlimTopBar = ({ mode = "primary", onBack }) => {
|
|
|
18840
18857
|
hitSlop: DEFAULT_HIT_SLOP,
|
|
18841
18858
|
accessibilityRole: "button",
|
|
18842
18859
|
accessibilityLabel: t("back") || "Back",
|
|
18843
|
-
children: /* @__PURE__ */ (0,
|
|
18860
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Icon, { name: "arrow-left", size: 22, color: colors.text })
|
|
18844
18861
|
}
|
|
18845
18862
|
),
|
|
18846
|
-
/* @__PURE__ */ (0,
|
|
18847
|
-
/* @__PURE__ */ (0,
|
|
18848
|
-
] }) : /* @__PURE__ */ (0,
|
|
18849
|
-
/* @__PURE__ */ (0,
|
|
18863
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_react_native49.Text, { style: [styles38.detailTitle, { color: colors.text }], numberOfLines: 1, children: t((pageChrome == null ? void 0 : pageChrome.titleKey) || "privacyCenter") }),
|
|
18864
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_react_native49.View, { style: styles38.placeholder })
|
|
18865
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(import_react_native49.View, { style: styles38.row, children: [
|
|
18866
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_react_native49.View, { style: styles38.brandWrap, children: (branding == null ? void 0 : branding.logo_url) ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
18850
18867
|
BrandImage,
|
|
18851
18868
|
{
|
|
18852
18869
|
uri: branding.logo_url,
|
|
18853
18870
|
height: 24,
|
|
18854
18871
|
maxWidth: 124,
|
|
18855
|
-
fallback: /* @__PURE__ */ (0,
|
|
18872
|
+
fallback: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(PCAvatar, { name: brandLabel, imageUrl: branding == null ? void 0 : branding.icon_url, size: 24 })
|
|
18856
18873
|
}
|
|
18857
|
-
) : /* @__PURE__ */ (0,
|
|
18858
|
-
/* @__PURE__ */ (0,
|
|
18859
|
-
/* @__PURE__ */ (0,
|
|
18874
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(import_react_native49.View, { style: styles38.brandLockup, children: [
|
|
18875
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(PCAvatar, { name: brandLabel, imageUrl: branding == null ? void 0 : branding.icon_url, size: 24 }),
|
|
18876
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_react_native49.Text, { style: [styles38.brandText, { color: colors.text }], numberOfLines: 1, children: brandLabel })
|
|
18860
18877
|
] }) }),
|
|
18861
|
-
/* @__PURE__ */ (0,
|
|
18862
|
-
/* @__PURE__ */ (0,
|
|
18863
|
-
|
|
18878
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(import_react_native49.View, { style: styles38.actions, children: [
|
|
18879
|
+
switchProfile ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
18880
|
+
import_react_native49.TouchableOpacity,
|
|
18881
|
+
{
|
|
18882
|
+
style: styles38.iconButton,
|
|
18883
|
+
onPress: switchProfile,
|
|
18884
|
+
activeOpacity: 0.7,
|
|
18885
|
+
hitSlop: DEFAULT_HIT_SLOP,
|
|
18886
|
+
accessibilityRole: "button",
|
|
18887
|
+
accessibilityLabel: t("switchProfile"),
|
|
18888
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Icon, { name: "users", size: 22, color: colors.text })
|
|
18889
|
+
}
|
|
18890
|
+
) : null,
|
|
18891
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(NotificationBell, { count: unreadCount, onPress: () => navigateTo("notifications") }),
|
|
18892
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
18864
18893
|
import_react_native49.TouchableOpacity,
|
|
18865
18894
|
{
|
|
18866
18895
|
style: styles38.iconButton,
|
|
@@ -18869,14 +18898,14 @@ var SlimTopBar = ({ mode = "primary", onBack }) => {
|
|
|
18869
18898
|
hitSlop: DEFAULT_HIT_SLOP,
|
|
18870
18899
|
accessibilityRole: "button",
|
|
18871
18900
|
accessibilityLabel: t("menu") || "Menu",
|
|
18872
|
-
children: /* @__PURE__ */ (0,
|
|
18901
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Icon, { name: "menu", size: 22, color: colors.text })
|
|
18873
18902
|
}
|
|
18874
18903
|
)
|
|
18875
18904
|
] })
|
|
18876
18905
|
] })
|
|
18877
18906
|
}
|
|
18878
18907
|
),
|
|
18879
|
-
/* @__PURE__ */ (0,
|
|
18908
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(NavDrawer, { visible: menuOpen, onClose: () => setMenuOpen(false), onBack })
|
|
18880
18909
|
] });
|
|
18881
18910
|
};
|
|
18882
18911
|
var styles38 = import_react_native49.StyleSheet.create({
|
|
@@ -18937,18 +18966,18 @@ var styles38 = import_react_native49.StyleSheet.create({
|
|
|
18937
18966
|
|
|
18938
18967
|
// src/RedactoPrivacyCenter/components/PrivacyCenterEmptyState.tsx
|
|
18939
18968
|
var import_react_i18next20 = require("react-i18next");
|
|
18940
|
-
var
|
|
18969
|
+
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
18941
18970
|
function PrivacyCenterEmptyState() {
|
|
18942
18971
|
const { t } = (0, import_react_i18next20.useTranslation)();
|
|
18943
|
-
return /* @__PURE__ */ (0,
|
|
18972
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(PCEmpty, { iconName: "shield", title: t("noDataTitle"), description: t("noDataDescription") });
|
|
18944
18973
|
}
|
|
18945
18974
|
|
|
18946
18975
|
// src/RedactoPrivacyCenter/components/PrivacyCenterSessionExpired.tsx
|
|
18947
18976
|
var import_react_i18next21 = require("react-i18next");
|
|
18948
|
-
var
|
|
18977
|
+
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
18949
18978
|
function PrivacyCenterSessionExpired() {
|
|
18950
18979
|
const { t } = (0, import_react_i18next21.useTranslation)();
|
|
18951
|
-
return /* @__PURE__ */ (0,
|
|
18980
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
18952
18981
|
PCEmpty,
|
|
18953
18982
|
{
|
|
18954
18983
|
iconName: "shield",
|
|
@@ -18962,22 +18991,6 @@ function PrivacyCenterSessionExpired() {
|
|
|
18962
18991
|
var import_react36 = require("react");
|
|
18963
18992
|
var import_react_native51 = require("react-native");
|
|
18964
18993
|
|
|
18965
|
-
// src/RedactoPrivacyCenter/context/ProfileSwitchContext.tsx
|
|
18966
|
-
var import_react35 = require("react");
|
|
18967
|
-
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
18968
|
-
var ProfileSwitchContext = (0, import_react35.createContext)({
|
|
18969
|
-
switchProfile: null
|
|
18970
|
-
});
|
|
18971
|
-
function ProfileSwitchProvider({
|
|
18972
|
-
switchProfile,
|
|
18973
|
-
children
|
|
18974
|
-
}) {
|
|
18975
|
-
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(ProfileSwitchContext.Provider, { value: { switchProfile }, children });
|
|
18976
|
-
}
|
|
18977
|
-
function useProfileSwitch() {
|
|
18978
|
-
return (0, import_react35.useContext)(ProfileSwitchContext);
|
|
18979
|
-
}
|
|
18980
|
-
|
|
18981
18994
|
// src/RedactoPrivacyCenter/components/SelectUser.tsx
|
|
18982
18995
|
var import_react_native50 = require("react-native");
|
|
18983
18996
|
var import_react_i18next22 = require("react-i18next");
|
|
@@ -21739,6 +21752,7 @@ function Navbar({ mode = "primary", onBack }) {
|
|
|
21739
21752
|
const [menuOpen, setMenuOpen] = (0, import_react46.useState)(false);
|
|
21740
21753
|
const unreadCount = useUnreadCount();
|
|
21741
21754
|
const { status: pageStatus } = usePageStatus();
|
|
21755
|
+
const { switchProfile } = useProfileSwitch();
|
|
21742
21756
|
const pageChrome = PAGE_CHROME_BY_PAGE[currentPage] || PAGE_CHROME_BY_PAGE["consent-manager"];
|
|
21743
21757
|
const isDetail = mode === "detail";
|
|
21744
21758
|
(0, import_react46.useEffect)(() => {
|
|
@@ -21841,6 +21855,36 @@ function Navbar({ mode = "primary", onBack }) {
|
|
|
21841
21855
|
) : null,
|
|
21842
21856
|
/* @__PURE__ */ (0, import_jsx_runtime71.jsx)(import_react_native69.View, { style: styles57.brandWrap, children: (branding == null ? void 0 : branding.logo_url) ? /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(BrandImage, { uri: branding.logo_url, height: 34, maxWidth: 170, fallback: brandLockup }) : brandLockup }),
|
|
21843
21857
|
/* @__PURE__ */ (0, import_jsx_runtime71.jsxs)(import_react_native69.View, { style: styles57.actions, children: [
|
|
21858
|
+
switchProfile ? /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
|
|
21859
|
+
import_react_native69.TouchableOpacity,
|
|
21860
|
+
{
|
|
21861
|
+
style: styles57.iconButton,
|
|
21862
|
+
onPress: switchProfile,
|
|
21863
|
+
activeOpacity: 0.7,
|
|
21864
|
+
hitSlop: DEFAULT_HIT_SLOP,
|
|
21865
|
+
accessibilityRole: "button",
|
|
21866
|
+
accessibilityLabel: t("switchProfile"),
|
|
21867
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
|
|
21868
|
+
import_react_native69.View,
|
|
21869
|
+
{
|
|
21870
|
+
style: [
|
|
21871
|
+
styles57.iconCircle,
|
|
21872
|
+
{ backgroundColor: colors.surface, borderColor: colors.border }
|
|
21873
|
+
],
|
|
21874
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(import_react_native_svg6.default, { width: 18, height: 18, viewBox: "0 0 24 24", fill: "none", children: /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
|
|
21875
|
+
import_react_native_svg6.Path,
|
|
21876
|
+
{
|
|
21877
|
+
d: "M16 3h5v5 M21 3l-7 7 M8 21H3v-5 M3 21l7-7",
|
|
21878
|
+
stroke: colors.text,
|
|
21879
|
+
strokeWidth: 2,
|
|
21880
|
+
strokeLinecap: "round",
|
|
21881
|
+
strokeLinejoin: "round"
|
|
21882
|
+
}
|
|
21883
|
+
) })
|
|
21884
|
+
}
|
|
21885
|
+
)
|
|
21886
|
+
}
|
|
21887
|
+
) : null,
|
|
21844
21888
|
/* @__PURE__ */ (0, import_jsx_runtime71.jsx)(NotificationBell, { count: unreadCount, onPress: () => navigateTo("notifications") }),
|
|
21845
21889
|
/* @__PURE__ */ (0, import_jsx_runtime71.jsx)(PCSelect, { value: locale, options: languageOptions, onChange: handleLanguageChange, placeholder: t("language"), compact: true }),
|
|
21846
21890
|
/* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
|
|
@@ -21917,6 +21961,21 @@ var styles57 = import_react_native69.StyleSheet.create({
|
|
|
21917
21961
|
alignItems: "center",
|
|
21918
21962
|
justifyContent: "center"
|
|
21919
21963
|
},
|
|
21964
|
+
iconButton: {
|
|
21965
|
+
width: MIN_TAP_TARGET,
|
|
21966
|
+
height: MIN_TAP_TARGET,
|
|
21967
|
+
alignItems: "center",
|
|
21968
|
+
justifyContent: "center"
|
|
21969
|
+
},
|
|
21970
|
+
// Matches the Flutter navbar's 34pt bordered circle.
|
|
21971
|
+
iconCircle: {
|
|
21972
|
+
width: 34,
|
|
21973
|
+
height: 34,
|
|
21974
|
+
borderRadius: 17,
|
|
21975
|
+
borderWidth: 1,
|
|
21976
|
+
alignItems: "center",
|
|
21977
|
+
justifyContent: "center"
|
|
21978
|
+
},
|
|
21920
21979
|
pageHeader: {
|
|
21921
21980
|
marginTop: spacing.sm
|
|
21922
21981
|
},
|