@ukpc-lib/react 0.9.2 → 0.9.3

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.
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../index.module-0c3c857a.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=s=>{const[t,o]=u.useState([]);return u.useEffect(()=>{m.get(`${s}/user-management/api/v1/users/my-account/permissions`,{withCredentials:!0}).then(r=>o(r.data)).catch(r=>{console.error("Getting user permission error:",r)})},[s]),t},a=s=>(t,o)=>{const r=c(s);return o?t.every(n=>r==null?void 0:r.includes(n)):t.some(n=>r==null?void 0:r.includes(n))},h=({baseUrl:s,accessWith:t,requireAll:o,children:r})=>a(s)(t,o)?i.jsx(i.Fragment,{children:r}):null,P=({accessWith:s,requireAll:t,baseUrl:o,unAuthorizedPath:r,children:n})=>a(o)(s,t)?i.jsx(i.Fragment,{children:n}):i.jsx(l.Navigate,{to:r,replace:!0});exports.AuthContext=e.AuthContext;exports.AuthProvider=e.AuthProvider;exports.ERROR_MESSAGE=e.ERROR_MESSAGE;exports.ErrorManager=e.ErrorManager;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-608572d9.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;
@@ -5,4 +5,3 @@ export * from './permissions';
5
5
  export * from './helpers';
6
6
  export * from './TranslationProvider';
7
7
  export * from '../theme';
8
- export * from './error-logs';
@@ -1,7 +1,7 @@
1
- import { M as R, N as S, O as G, a2 as M, a1 as y, Z as F, a as H, c as I, $ as N, U as O, R as $, T as j, V as w, t as U, a0 as V, X, W as Y, b as Z, u as _, g as b, Y as k } from "../index.module-04bdd843.js";
1
+ import { M as R, N as S, O as G, a1 as y, Z as F, a as H, c as I, $ as M, U as N, R as O, T as $, V as j, t as w, a0 as U, X as V, W as X, b as Y, u as Z, g as _, Y as b } from "../index.module-b9d1f264.js";
2
2
  import u from "axios";
3
3
  import { useState as m, useEffect as c } from "react";
4
- import { jsx as o, Fragment as n } from "react/jsx-runtime";
4
+ import { jsx as a, Fragment as n } from "react/jsx-runtime";
5
5
  import "@r2wc/react-to-web-component";
6
6
  import { Navigate as l } from "react-router-dom";
7
7
  import "@mui/material";
@@ -17,46 +17,45 @@ const h = (e) => {
17
17
  }, i = (e) => (r, t) => {
18
18
  const s = h(e);
19
19
  return t ? r.every(
20
- (a) => s == null ? void 0 : s.includes(a)
20
+ (o) => s == null ? void 0 : s.includes(o)
21
21
  ) : r.some(
22
- (a) => s == null ? void 0 : s.includes(a)
22
+ (o) => s == null ? void 0 : s.includes(o)
23
23
  );
24
24
  }, T = ({
25
25
  baseUrl: e,
26
26
  accessWith: r,
27
27
  requireAll: t,
28
28
  children: s
29
- }) => i(e)(r, t) ? /* @__PURE__ */ o(n, { children: s }) : null, E = ({
29
+ }) => i(e)(r, t) ? /* @__PURE__ */ a(n, { children: s }) : null, A = ({
30
30
  accessWith: e,
31
31
  requireAll: r,
32
32
  baseUrl: t,
33
33
  unAuthorizedPath: s,
34
- children: a
35
- }) => i(t)(e, r) ? /* @__PURE__ */ o(n, { children: a }) : /* @__PURE__ */ o(l, { to: s, replace: !0 });
34
+ children: o
35
+ }) => i(t)(e, r) ? /* @__PURE__ */ a(n, { children: o }) : /* @__PURE__ */ a(l, { to: s, replace: !0 });
36
36
  export {
37
37
  R as AuthContext,
38
38
  S as AuthProvider,
39
39
  G as ERROR_MESSAGE,
40
- M as ErrorManager,
41
40
  T as HasPermission,
42
- E as PermissionRoute,
41
+ A as PermissionRoute,
43
42
  y as SaasThemeProvider,
44
43
  F as TranslationProvider,
45
44
  H as axiosInstance,
46
45
  I as color,
47
- N as createCustomTheme,
46
+ M as createCustomTheme,
48
47
  i as getUseHasPermission,
49
- O as handleErrorAxios,
50
- $ as login,
51
- j as logout,
52
- w as responseInterceptor,
53
- U as search,
54
- V as setFavicon,
55
- X as translate,
56
- Y as translationConfig,
57
- Z as useAuth,
58
- _ as useCustomTranslation,
48
+ N as handleErrorAxios,
49
+ O as login,
50
+ $ as logout,
51
+ j as responseInterceptor,
52
+ w as search,
53
+ U as setFavicon,
54
+ V as translate,
55
+ X as translationConfig,
56
+ Y as useAuth,
57
+ Z as useCustomTranslation,
59
58
  h as useGetPermission,
60
- b as useTheme,
61
- k as useTranslation
59
+ _ as useTheme,
60
+ b as useTranslation
62
61
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ukpc-lib/react",
3
3
  "private": false,
4
- "version": "0.9.2",
4
+ "version": "0.9.3",
5
5
  "type": "module",
6
6
  "main": "./dist/",
7
7
  "module": "./dist/",
@@ -1,5 +1,5 @@
1
1
  import "../index-0de70dab.js";
2
- import { F as o, u as r } from "../index-1feb4da1.js";
2
+ import { F as o, u as r } from "../index-864f30dd.js";
3
3
  export {
4
4
  o as FavoriteMenu,
5
5
  r as updateFavoriteItems
@@ -1,5 +1,5 @@
1
1
  import "../index-0de70dab.js";
2
- import { G as e } from "../index-1feb4da1.js";
2
+ import { G as e } from "../index-864f30dd.js";
3
3
  export {
4
4
  e as GlobalMenu
5
5
  };
@@ -1,5 +1,5 @@
1
1
  import "../index-0de70dab.js";
2
- import { L as p, T as e } from "../index-1feb4da1.js";
2
+ import { L as p, T as e } from "../index-864f30dd.js";
3
3
  export {
4
4
  p as LanguageDropdown,
5
5
  e as TopBar
@@ -1,5 +1,5 @@
1
1
  import "../index-0de70dab.js";
2
- import { H as o, g as r } from "../index-1feb4da1.js";
2
+ import { H as o, g as r } from "../index-864f30dd.js";
3
3
  export {
4
4
  o as HasPermission,
5
5
  r as getUseHasPermission