@ukpc-lib/react 0.10.29-dev.3 → 0.10.29-dev.4

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.esm2017-7876529a.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,n]=u.useState([]);return u.useEffect(()=>{m.get(`${r}/user-management/api/v1/users/my-account/permissions`,{withCredentials:!0}).then(s=>n(s.data)).catch(s=>{console.error("Getting user permission error:",s)})},[r]),t},a=r=>(t,n)=>{const s=c(r);return n?t.every(o=>s==null?void 0:s.includes(o)):t.some(o=>s==null?void 0:s.includes(o))},h=({baseUrl:r,accessWith:t,requireAll:n,children:s})=>a(r)(t,n)?i.jsx(i.Fragment,{children:s}):null,P=({accessWith:r,requireAll:t,baseUrl:n,unAuthorizedPath:s,children:o})=>a(n)(r,t)?i.jsx(i.Fragment,{children:o}):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.esm2017-78c58f43.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,n]=u.useState([]);return u.useEffect(()=>{m.get(`${r}/user-management/api/v1/users/my-account/permissions`,{withCredentials:!0}).then(s=>n(s.data)).catch(s=>{console.error("Getting user permission error:",s)})},[r]),t},a=r=>(t,n)=>{const s=c(r);return n?t.every(o=>s==null?void 0:s.includes(o)):t.some(o=>s==null?void 0:s.includes(o))},h=({baseUrl:r,accessWith:t,requireAll:n,children:s})=>a(r)(t,n)?i.jsx(i.Fragment,{children:s}):null,P=({accessWith:r,requireAll:t,baseUrl:n,unAuthorizedPath:s,children:o})=>a(n)(r,t)?i.jsx(i.Fragment,{children:o}):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 { M as R, N as S, O as G, a0 as y, Y as F, a as H, c as I, Z as M, U as N, R as O, T as $, V as j, v as w, $ as U, t as V, W as X, b as Y, u as Z, g as _, X as b } from "../index.esm2017-f46777bc.js";
1
+ import { M as R, N as S, O as G, a0 as y, Y as F, a as H, c as I, Z as M, U as N, R as O, T as $, V as j, v as w, $ as U, t as V, W as X, b as Y, u as Z, g as _, X as b } from "../index.esm2017-b5881e5e.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";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ukpc-lib/react",
3
3
  "private": false,
4
- "version": "0.10.29-dev.3",
4
+ "version": "0.10.29-dev.4",
5
5
  "type": "module",
6
6
  "main": "./dist/",
7
7
  "module": "./dist/",
@@ -1,5 +1,5 @@
1
1
  import "../react-to-web-component-d5889290.js";
2
- import { F as a, u as s } from "../index-df1a4cb6.js";
2
+ import { F as a, u as s } from "../index-b161957e.js";
3
3
  import "../index-c91ec106.js";
4
4
  import "../react-toastify.esm-d8df41b8.js";
5
5
  import "../toast-config/index.js";
@@ -1,5 +1,5 @@
1
1
  import "../react-to-web-component-d5889290.js";
2
- import { G as e } from "../index-df1a4cb6.js";
2
+ import { G as e } from "../index-b161957e.js";
3
3
  import "../index-c91ec106.js";
4
4
  import "../react-toastify.esm-d8df41b8.js";
5
5
  import "../toast-config/index.js";
@@ -1,5 +1,5 @@
1
1
  import "../react-to-web-component-d5889290.js";
2
- import { L as e, T as g } from "../index-df1a4cb6.js";
2
+ import { L as e, T as g } from "../index-b161957e.js";
3
3
  import "../index-c91ec106.js";
4
4
  import "../react-toastify.esm-d8df41b8.js";
5
5
  import "../toast-config/index.js";
@@ -1,5 +1,5 @@
1
1
  import "../react-to-web-component-d5889290.js";
2
- import { H as e, g as a } from "../index-df1a4cb6.js";
2
+ import { H as e, g as a } from "../index-b161957e.js";
3
3
  import "../index-c91ec106.js";
4
4
  import "../react-toastify.esm-d8df41b8.js";
5
5
  import "../toast-config/index.js";
@@ -32293,11 +32293,11 @@ function _ge(e) {
32293
32293
  function T(E) {
32294
32294
  s(!0);
32295
32295
  const M = [...a];
32296
- u(E);
32297
- const k = E.map((I) => ({
32298
- menuItemIds: I.id
32299
- }));
32300
- dr.post("global-menu-config/api/v1/menu-items/user/order-favorites", k, {
32296
+ u(E), console.log("tree", E), console.log("prev", M);
32297
+ const k = {
32298
+ menuItemIds: E.map((I) => I.id)
32299
+ };
32300
+ console.log(k), dr.post("global-menu-config/api/v1/menu-items/user/order-favorites", k, {
32301
32301
  baseURL: e.baseUrl
32302
32302
  }).then(() => {
32303
32303
  }).catch((I) => {
@@ -32314,7 +32314,7 @@ function _ge(e) {
32314
32314
  text: M.name,
32315
32315
  data: M
32316
32316
  }));
32317
- u(E);
32317
+ u(E), console.log("nodes", E);
32318
32318
  }, [r]), /* @__PURE__ */ N.jsx(N.Fragment, { children: r.length ? /* @__PURE__ */ N.jsx("div", { className: v("favorite-menu"), children: /* @__PURE__ */ N.jsx(
32319
32319
  E1,
32320
32320
  {