@redacto.io/consent-sdk-react 6.0.0 → 7.0.0
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/CHANGELOG.md +17 -0
- package/dist/privacy-center.d.mts +2 -4
- package/dist/privacy-center.d.ts +2 -4
- package/dist/privacy-center.js +1876 -2079
- package/dist/privacy-center.mjs +1470 -1679
- package/package.json +1 -1
- package/src/RedactoPrivacyCenter/PrivacyCenterLayout.tsx +6 -10
- package/src/RedactoPrivacyCenter/RedactoPrivacyCenter.tsx +18 -17
- package/src/RedactoPrivacyCenter/api/orgBranding.ts +9 -0
- package/src/RedactoPrivacyCenter/components/ConsentManager.tsx +16 -14
- package/src/RedactoPrivacyCenter/components/Form.tsx +3 -3
- package/src/RedactoPrivacyCenter/components/ModifyConsentModal.tsx +1 -1
- package/src/RedactoPrivacyCenter/components/PrivacyCenterLayout.tsx +0 -4
- package/src/RedactoPrivacyCenter/components/SideMenuBarPC/SideBarPC.tsx +16 -2
- package/src/RedactoPrivacyCenter/context/BrandingContext.tsx +44 -0
- package/src/RedactoPrivacyCenter/lib/types.ts +22 -0
- package/src/RedactoPrivacyCenter/styles/applyBrandingTheme.ts +66 -0
- package/src/RedactoPrivacyCenter/styles/injectStyles.ts +3 -111
- package/src/RedactoPrivacyCenter/styles/pcStyles.ts +3 -2
- package/src/RedactoPrivacyCenter/styles/variables.css +1 -43
- package/src/RedactoPrivacyCenter/ui/Footer.tsx +4 -10
- package/src/RedactoPrivacyCenter/components/ThemeTransitionOverlay.tsx +0 -85
- package/src/RedactoPrivacyCenter/context/theme.tsx +0 -127
- package/src/RedactoPrivacyCenter/ui/ThemeToggle.tsx +0 -70
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @redacto.io/consent-sdk-react
|
|
2
2
|
|
|
3
|
+
## 7.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- configurable privacy center SDK
|
|
8
|
+
- 331cbad: Apply org-level branding in `RedactoPrivacyCenter`. The privacy center now fetches `/user/api/0/public/org-branding/by-slug/{slug}` on mount and uses the response to:
|
|
9
|
+
- Swap the sidebar header avatar for the org's `icon_url` (collapsed) or wide `logo_url` (expanded).
|
|
10
|
+
- Show `brand_name` as the sidebar title.
|
|
11
|
+
- Hide the "Powered by Redacto" footer when `hide_platform_branding` is `true`.
|
|
12
|
+
- Apply the org's `theme` colors at runtime as `--pc-*` CSS custom-property overrides on `document.documentElement`. Primary/secondary hover and active variants are auto-derived. Cleared on unmount so the host page reverts to defaults.
|
|
13
|
+
|
|
14
|
+
**Breaking changes:**
|
|
15
|
+
- Removed dark mode from the privacy center. `ThemeProvider`, `useTheme`, `ThemeToggle`, and `ThemeTransitionOverlay` are deleted, the `[data-theme="dark"]` CSS block is gone, and the moon/sun toggle no longer appears in the navbar.
|
|
16
|
+
- Removed the `theme` prop from `RedactoPrivacyCenter`. The privacy center is now light-only; org-branding theme colors are applied on top.
|
|
17
|
+
|
|
18
|
+
Falls back to the previous initials avatar, slug-derived name, and SDK default colors when the branding response is unavailable.
|
|
19
|
+
|
|
3
20
|
## 6.0.0
|
|
4
21
|
|
|
5
22
|
### Major Changes
|
|
@@ -567,22 +567,20 @@ declare const useInternalNavigation: () => NavigationContextType;
|
|
|
567
567
|
interface RedactoPrivacyCenterProps {
|
|
568
568
|
baseUrl: string;
|
|
569
569
|
slug: string;
|
|
570
|
-
theme?: 'light' | 'dark';
|
|
571
570
|
accessToken: string;
|
|
572
571
|
refreshToken: string;
|
|
573
572
|
onError: (error: Error) => boolean;
|
|
574
573
|
initialPage?: InternalPage;
|
|
575
574
|
onBack?: 'back' | 'signout';
|
|
576
575
|
}
|
|
577
|
-
declare function RedactoPrivacyCenter({ baseUrl, slug,
|
|
576
|
+
declare function RedactoPrivacyCenter({ baseUrl, slug, accessToken, refreshToken, onError, initialPage, onBack, }: RedactoPrivacyCenterProps): react_jsx_runtime.JSX.Element;
|
|
578
577
|
|
|
579
578
|
interface PrivacyCenterLayoutProps {
|
|
580
579
|
children: ReactNode;
|
|
581
|
-
defaultTheme?: 'light' | 'dark';
|
|
582
580
|
slug: string;
|
|
583
581
|
onBack?: 'back' | 'signout';
|
|
584
582
|
}
|
|
585
|
-
declare function PrivacyCenterLayout({ children,
|
|
583
|
+
declare function PrivacyCenterLayout({ children, slug, onBack }: PrivacyCenterLayoutProps): react_jsx_runtime.JSX.Element;
|
|
586
584
|
|
|
587
585
|
declare function PrivacyCenterHomePage(): react_jsx_runtime.JSX.Element;
|
|
588
586
|
|
package/dist/privacy-center.d.ts
CHANGED
|
@@ -567,22 +567,20 @@ declare const useInternalNavigation: () => NavigationContextType;
|
|
|
567
567
|
interface RedactoPrivacyCenterProps {
|
|
568
568
|
baseUrl: string;
|
|
569
569
|
slug: string;
|
|
570
|
-
theme?: 'light' | 'dark';
|
|
571
570
|
accessToken: string;
|
|
572
571
|
refreshToken: string;
|
|
573
572
|
onError: (error: Error) => boolean;
|
|
574
573
|
initialPage?: InternalPage;
|
|
575
574
|
onBack?: 'back' | 'signout';
|
|
576
575
|
}
|
|
577
|
-
declare function RedactoPrivacyCenter({ baseUrl, slug,
|
|
576
|
+
declare function RedactoPrivacyCenter({ baseUrl, slug, accessToken, refreshToken, onError, initialPage, onBack, }: RedactoPrivacyCenterProps): react_jsx_runtime.JSX.Element;
|
|
578
577
|
|
|
579
578
|
interface PrivacyCenterLayoutProps {
|
|
580
579
|
children: ReactNode;
|
|
581
|
-
defaultTheme?: 'light' | 'dark';
|
|
582
580
|
slug: string;
|
|
583
581
|
onBack?: 'back' | 'signout';
|
|
584
582
|
}
|
|
585
|
-
declare function PrivacyCenterLayout({ children,
|
|
583
|
+
declare function PrivacyCenterLayout({ children, slug, onBack }: PrivacyCenterLayoutProps): react_jsx_runtime.JSX.Element;
|
|
586
584
|
|
|
587
585
|
declare function PrivacyCenterHomePage(): react_jsx_runtime.JSX.Element;
|
|
588
586
|
|