@ukpc-lib/react 0.8.5 → 0.8.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.
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../index.module-24a2eb1c.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.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.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-dfee87ba.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.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.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,7 +1,7 @@
1
- import { U as R, V as S, W as G, a5 as y, a3 as H, a as I, c as $, a4 as j, Z as w, X as B, Y as F, $ as M, B as N, a1 as O, a0 as U, b as V, u as X, l as Y, a2 as Z } from "../index.module-054b4163.js";
1
+ import { N as R, O as S, R as G, a1 as y, $ as H, a as I, c as N, a0 as O, V as $, T as j, U as w, W as F, t as M, Y as U, X as V, b as X, u as Y, g as Z, Z as _ } from "../index.module-efc61dc4.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,44 +17,44 @@ 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
- }, T = ({
24
+ }, v = ({
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, A = ({
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
- T as HasPermission,
40
+ v as HasPermission,
41
41
  A as PermissionRoute,
42
42
  y as SaasThemeProvider,
43
43
  H as TranslationProvider,
44
44
  I as axiosInstance,
45
- $ as color,
46
- j as createCustomTheme,
45
+ N as color,
46
+ O as createCustomTheme,
47
47
  i as getUseHasPermission,
48
- w as handleErrorAxios,
49
- B as login,
50
- F as logout,
51
- M as responseInterceptor,
52
- N as search,
53
- O as translate,
54
- U as translationConfig,
55
- V as useAuth,
56
- X as useCustomTranslation,
48
+ $ as handleErrorAxios,
49
+ j as login,
50
+ w as logout,
51
+ F as responseInterceptor,
52
+ M as search,
53
+ U as translate,
54
+ V as translationConfig,
55
+ X as useAuth,
56
+ Y as useCustomTranslation,
57
57
  h as useGetPermission,
58
- Y as useTheme,
59
- Z as useTranslation
58
+ Z as useTheme,
59
+ _ as useTranslation
60
60
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ukpc-lib/react",
3
3
  "private": false,
4
- "version": "0.8.5",
4
+ "version": "0.8.7",
5
5
  "type": "module",
6
6
  "main": "./dist/",
7
7
  "module": "./dist/",
@@ -1,5 +1,6 @@
1
1
  import "../index-ef16a9d3.js";
2
- import { F as t } from "../index-70f8381f.js";
2
+ import { F as o, u as r } from "../index-ad1128d7.js";
3
3
  export {
4
- t as FavoriteMenu
4
+ o as FavoriteMenu,
5
+ r as updateFavoriteItems
5
6
  };
@@ -1,5 +1,5 @@
1
1
  import "../index-ef16a9d3.js";
2
- import { G as e } from "../index-70f8381f.js";
2
+ import { G as e } from "../index-ad1128d7.js";
3
3
  export {
4
4
  e as GlobalMenu
5
5
  };
@@ -1,5 +1,5 @@
1
1
  import "../index-ef16a9d3.js";
2
- import { L as p, T as e } from "../index-70f8381f.js";
2
+ import { L as p, T as e } from "../index-ad1128d7.js";
3
3
  export {
4
4
  p as LanguageDropdown,
5
5
  e as TopBar
@@ -1,5 +1,5 @@
1
1
  import "../index-ef16a9d3.js";
2
- import { H as o, g as r } from "../index-70f8381f.js";
2
+ import { H as o, g as r } from "../index-ad1128d7.js";
3
3
  export {
4
4
  o as HasPermission,
5
5
  r as getUseHasPermission