@ukpc-lib/react 0.10.6 → 0.10.8

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.
@@ -2824,7 +2824,10 @@ function eM(e) {
2824
2824
  var l, c, d;
2825
2825
  const { data: t, isFetching: n } = ny(
2826
2826
  ["customTheme"],
2827
- () => e != null && e.url ? fetch(e.url).then((v) => v.json()) : void 0,
2827
+ () => e != null && e.url ? fetch(e.url).then((v) => v.json()).then((v) => (["image", "favicon", "icon"].forEach((p) => {
2828
+ var S;
2829
+ (S = v == null ? void 0 : v.theme) != null && S[p] && (v.theme[p] += `?v=${Date.now()}`);
2830
+ }), v)) : void 0,
2828
2831
  {
2829
2832
  enabled: !!(e != null && e.url) && (e == null ? void 0 : e.enabled),
2830
2833
  refetchOnWindowFocus: !1,
@@ -2840,7 +2843,8 @@ function eM(e) {
2840
2843
  theme: i,
2841
2844
  logo: o,
2842
2845
  icon: s,
2843
- isFetching: n
2846
+ isFetching: n,
2847
+ themeDto: t == null ? void 0 : t.theme
2844
2848
  };
2845
2849
  }
2846
2850
  const Y1 = gr({}), EY = () => nn(Y1), kY = (e) => {
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../index.module-939d1280.cjs"),m=require("axios"),u=require("react"),i=require("react/jsx-runtime");require("@r2wc/react-to-web-component");const l=require("react-router-dom");require("@mui/material");const c=r=>{const[t,o]=u.useState([]);return u.useEffect(()=>{m.get(`${r}/user-management/api/v1/users/my-account/permissions`,{withCredentials:!0}).then(s=>o(s.data)).catch(s=>{console.error("Getting user permission error:",s)})},[r]),t},a=r=>(t,o)=>{const s=c(r);return o?t.every(n=>s==null?void 0:s.includes(n)):t.some(n=>s==null?void 0:s.includes(n))},h=({baseUrl:r,accessWith:t,requireAll:o,children:s})=>a(r)(t,o)?i.jsx(i.Fragment,{children:s}):null,P=({accessWith:r,requireAll:t,baseUrl:o,unAuthorizedPath:s,children:n})=>a(o)(r,t)?i.jsx(i.Fragment,{children:n}):i.jsx(l.Navigate,{to:s,replace:!0});exports.AuthContext=e.AuthContext;exports.AuthProvider=e.AuthProvider;exports.ERROR_MESSAGE=e.ERROR_MESSAGE;exports.SaasThemeProvider=e.SaasThemeProvider;exports.TranslationProvider=e.TranslationProvider;exports.axiosInstance=e.axiosInstance;exports.color=e.color;exports.createCustomTheme=e.createCustomTheme;exports.handleErrorAxios=e.handleErrorAxios;exports.login=e.login;exports.logout=e.logout;exports.responseInterceptor=e.responseInterceptor;exports.search=e.search;exports.setFavicon=e.setFavicon;exports.translate=e.translate;exports.translationConfig=e.translationConfig;exports.useAuth=e.useAuth;exports.useCustomTranslation=e.useCustomTranslation;exports.useTheme=e.useTheme;exports.useTranslation=e.useTranslation$1;exports.HasPermission=h;exports.PermissionRoute=P;exports.getUseHasPermission=a;exports.useGetPermission=c;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../index.module-83a4ae8c.cjs"),m=require("axios"),u=require("react"),i=require("react/jsx-runtime");require("@r2wc/react-to-web-component");const l=require("react-router-dom");require("@mui/material");const c=r=>{const[t,o]=u.useState([]);return u.useEffect(()=>{m.get(`${r}/user-management/api/v1/users/my-account/permissions`,{withCredentials:!0}).then(s=>o(s.data)).catch(s=>{console.error("Getting user permission error:",s)})},[r]),t},a=r=>(t,o)=>{const s=c(r);return o?t.every(n=>s==null?void 0:s.includes(n)):t.some(n=>s==null?void 0:s.includes(n))},h=({baseUrl:r,accessWith:t,requireAll:o,children:s})=>a(r)(t,o)?i.jsx(i.Fragment,{children:s}):null,P=({accessWith:r,requireAll:t,baseUrl:o,unAuthorizedPath:s,children:n})=>a(o)(r,t)?i.jsx(i.Fragment,{children:n}):i.jsx(l.Navigate,{to:s,replace:!0});exports.AuthContext=e.AuthContext;exports.AuthProvider=e.AuthProvider;exports.ERROR_MESSAGE=e.ERROR_MESSAGE;exports.SaasThemeProvider=e.SaasThemeProvider;exports.TranslationProvider=e.TranslationProvider;exports.axiosInstance=e.axiosInstance;exports.color=e.color;exports.createCustomTheme=e.createCustomTheme;exports.handleErrorAxios=e.handleErrorAxios;exports.login=e.login;exports.logout=e.logout;exports.responseInterceptor=e.responseInterceptor;exports.search=e.search;exports.setFavicon=e.setFavicon;exports.translate=e.translate;exports.translationConfig=e.translationConfig;exports.useAuth=e.useAuth;exports.useCustomTranslation=e.useCustomTranslation;exports.useTheme=e.useTheme;exports.useTranslation=e.useTranslation$1;exports.HasPermission=h;exports.PermissionRoute=P;exports.getUseHasPermission=a;exports.useGetPermission=c;
@@ -1,4 +1,4 @@
1
- import { N as R, O as S, R as G, a1 as y, Z as F, a as H, c as I, $ as N, V as O, T as $, U as j, W as w, v as M, a0 as U, t as V, X, b as Y, u as Z, g as _, Y as b } from "../index.module-aa83269c.js";
1
+ import { N as R, O as S, R as G, a1 as y, Z as F, a as H, c as I, $ as N, V as O, T as $, U as j, W as w, v as M, a0 as U, t as V, X, b as Y, u as Z, g as _, Y as b } from "../index.module-c243311a.js";
2
2
  import u from "axios";
3
3
  import { useState as m, useEffect as c } from "react";
4
4
  import { jsx as a, Fragment as n } from "react/jsx-runtime";
@@ -2,6 +2,30 @@ import { Theme } from '@mui/material';
2
2
  import { PropsWithChildren } from 'react';
3
3
  import { ColorsType } from './Colors';
4
4
 
5
+ interface ValueThemeDto {
6
+ key: string;
7
+ saasValueThemeId?: number;
8
+ color: string;
9
+ }
10
+ interface KeyThemeDto {
11
+ key: string;
12
+ saasKeyThemeId?: number;
13
+ children: ValueThemeDto[];
14
+ }
15
+ export interface ThemeDto {
16
+ id?: number | null;
17
+ readonly createdAt?: Date;
18
+ readonly createdBy?: string | null;
19
+ readonly updatedAt?: Date | null;
20
+ readonly updatedBy?: string | null;
21
+ readonly deletedAt?: Date | null;
22
+ readonly deletedBy?: string | null;
23
+ image: string;
24
+ favicon?: string;
25
+ icon?: string;
26
+ saasThemeId?: number;
27
+ keyColor: KeyThemeDto[];
28
+ }
5
29
  export declare function setFavicon(favicon: string): void;
6
30
  type UseThemeContextProps = {
7
31
  url: string;
@@ -13,6 +37,7 @@ export declare const useTheme: () => {
13
37
  logo: any;
14
38
  icon: any;
15
39
  isFetching: boolean;
40
+ themeDto: ThemeDto;
16
41
  };
17
42
  type P = {
18
43
  brandTheme?: UseThemeContextProps;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ukpc-lib/react",
3
3
  "private": false,
4
- "version": "0.10.6",
4
+ "version": "0.10.8",
5
5
  "type": "module",
6
6
  "main": "./dist/",
7
7
  "module": "./dist/",
@@ -1,5 +1,5 @@
1
1
  import "../index-da73806d.js";
2
- import { F as o, u as r } from "../index-f73ddb24.js";
2
+ import { F as o, u as r } from "../index-03ce2fda.js";
3
3
  export {
4
4
  o as FavoriteMenu,
5
5
  r as updateFavoriteItems
@@ -1,5 +1,5 @@
1
1
  import "../index-da73806d.js";
2
- import { G as e } from "../index-f73ddb24.js";
2
+ import { G as e } from "../index-03ce2fda.js";
3
3
  export {
4
4
  e as GlobalMenu
5
5
  };
@@ -1,5 +1,5 @@
1
1
  import "../index-da73806d.js";
2
- import { L as p, T as e } from "../index-f73ddb24.js";
2
+ import { L as p, T as e } from "../index-03ce2fda.js";
3
3
  export {
4
4
  p as LanguageDropdown,
5
5
  e as TopBar
@@ -1,5 +1,5 @@
1
1
  import "../index-da73806d.js";
2
- import { H as o, g as r } from "../index-f73ddb24.js";
2
+ import { H as o, g as r } from "../index-03ce2fda.js";
3
3
  export {
4
4
  o as HasPermission,
5
5
  r as getUseHasPermission