@ukpc-lib/react 0.16.3-sandbox.saas-9356-and-saas-9249.patch-7 → 0.16.3-sandbox.saas-9356-and-saas-9249.patch-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.
@@ -4,4 +4,4 @@ declare global {
4
4
  HostBridge?: any;
5
5
  }
6
6
  }
7
- export declare const useSyncRouter: (prefix?: string) => void;
7
+ export declare const useSyncRouter: (basePath?: string) => void;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../index.esm2017-Bmj_1y8w.cjs"),m=require("axios"),u=require("react"),c=require("react-router-dom"),i=require("react/jsx-runtime");require("@r2wc/react-to-web-component");require("@mui/material");const h=o=>{const[n,s]=u.useState([]);return u.useEffect(()=>{m.get(`${o}/user-management/api/v1/users/my-account/permissions`,{withCredentials:!0}).then(e=>s(e.data)).catch(e=>{console.error("Getting user permission error:",e)})},[o]),n},d=(o="/app")=>{const n=c.useNavigate(),s=c.useLocation();u.useEffect(()=>(window.hostNavigate=(e,t)=>{const a=s.pathname+s.search+s.hash;e!==a&&n(e,{replace:(t==null?void 0:t.replace)??!0})},()=>{delete window.hostNavigate}),[n,s]),u.useEffect(()=>{var t,a;const e=s.pathname+s.search+s.hash;(a=(t=window.top)==null?void 0:t.shellNavigate)==null||a.call(t,o+e,{replace:!0})},[s,o])};function g({open:o,disabled:n}){u.useMemo(()=>{var s,e,t,a;n||(o?(e=(s=window.top)==null?void 0:s.HostBridge)==null||e.openBackdrop(!0):(a=(t=window.top)==null?void 0:t.HostBridge)==null||a.openBackdrop(!1))},[o,n])}const l=o=>(n,s)=>{const e=h(o);return s?n.every(t=>e==null?void 0:e.includes(t)):n.some(t=>e==null?void 0:e.includes(t))},P=({baseUrl:o,accessWith:n,requireAll:s,children:e})=>l(o)(n,s)?i.jsx(i.Fragment,{children:e}):null,p=({accessWith:o,requireAll:n,baseUrl:s,unAuthorizedPath:e,children:t})=>l(s)(o,n)?i.jsx(i.Fragment,{children:t}):i.jsx(c.Navigate,{to:e,replace:!0});exports.AuthContext=r.AuthContext;exports.AuthProvider=r.AuthProvider;exports.ERROR_MESSAGE=r.ERROR_MESSAGE;exports.SaasThemeProvider=r.SaasThemeProvider;exports.TranslationProvider=r.TranslationProvider;exports.axiosInstance=r.axiosInstance;exports.color=r.color;exports.createCustomTheme=r.createCustomTheme;exports.handleErrorAxios=r.handleErrorAxios;exports.login=r.login;exports.logout=r.logout;exports.responseInterceptor=r.responseInterceptor;exports.search=r.search;exports.setFavicon=r.setFavicon;exports.setShellBackdrop=r.setShellBackdrop;exports.translate=r.translate;exports.translationConfig=r.translationConfig;exports.useAuth=r.useAuth;exports.useCustomTranslation=r.useCustomTranslation;exports.useTheme=r.useTheme;exports.useTranslation=r.useTranslation;exports.HasPermission=P;exports.PermissionRoute=p;exports.getUseHasPermission=l;exports.useGetPermission=h;exports.useSyncBackdrop=g;exports.useSyncRouter=d;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("../index.esm2017-Bmj_1y8w.cjs"),d=require("axios"),a=require("react"),l=require("react-router-dom"),i=require("react/jsx-runtime");require("@r2wc/react-to-web-component");require("@mui/material");const m=r=>{const[t,s]=a.useState([]);return a.useEffect(()=>{d.get(`${r}/user-management/api/v1/users/my-account/permissions`,{withCredentials:!0}).then(e=>s(e.data)).catch(e=>{console.error("Getting user permission error:",e)})},[r]),t},h=r=>{const t=l.useLocation();if(a.useEffect(()=>{var e,n;let s=t.pathname+t.search+t.hash;r&&!s.includes(r)&&(s=r+s),console.log("🚀 ~ PrivateLayout.tsx ~ fullPath:",s),(n=(e=window.top)==null?void 0:e.shellNavigate)==null||n.call(e,"/app"+s,{replace:!0})},[t,r]),window.self===window.top){console.log("useSyncRouter: Navigate to /app path"),window.location.href=window.location.href.replace(window.origin,`${window.origin}/app`);return}};function p({open:r,disabled:t}){a.useMemo(()=>{var s,e,n,u;t||(r?(e=(s=window.top)==null?void 0:s.HostBridge)==null||e.openBackdrop(!0):(u=(n=window.top)==null?void 0:n.HostBridge)==null||u.openBackdrop(!1))},[r,t])}const c=r=>(t,s)=>{const e=m(r);return s?t.every(n=>e==null?void 0:e.includes(n)):t.some(n=>e==null?void 0:e.includes(n))},g=({baseUrl:r,accessWith:t,requireAll:s,children:e})=>c(r)(t,s)?i.jsx(i.Fragment,{children:e}):null,f=({accessWith:r,requireAll:t,baseUrl:s,unAuthorizedPath:e,children:n})=>c(s)(r,t)?i.jsx(i.Fragment,{children:n}):i.jsx(l.Navigate,{to:e,replace:!0});exports.AuthContext=o.AuthContext;exports.AuthProvider=o.AuthProvider;exports.ERROR_MESSAGE=o.ERROR_MESSAGE;exports.SaasThemeProvider=o.SaasThemeProvider;exports.TranslationProvider=o.TranslationProvider;exports.axiosInstance=o.axiosInstance;exports.color=o.color;exports.createCustomTheme=o.createCustomTheme;exports.handleErrorAxios=o.handleErrorAxios;exports.login=o.login;exports.logout=o.logout;exports.responseInterceptor=o.responseInterceptor;exports.search=o.search;exports.setFavicon=o.setFavicon;exports.setShellBackdrop=o.setShellBackdrop;exports.translate=o.translate;exports.translationConfig=o.translationConfig;exports.useAuth=o.useAuth;exports.useCustomTranslation=o.useCustomTranslation;exports.useTheme=o.useTheme;exports.useTranslation=o.useTranslation;exports.HasPermission=g;exports.PermissionRoute=f;exports.getUseHasPermission=c;exports.useGetPermission=m;exports.useSyncBackdrop=p;exports.useSyncRouter=h;
@@ -1,86 +1,87 @@
1
- import { M as k, O as y, R as H, a1 as G, Z as M, a as F, c as I, $ as O, V as $, T as j, U as L, W as U, v as V, a0 as X, s as Y, t as Z, X as _, e as q, u as z, i as D, Y as J } from "../index.esm2017-YfeFmA6k.js";
2
- import m from "axios";
3
- import { useState as l, useEffect as n, useMemo as h } from "react";
4
- import { useNavigate as p, useLocation as d, Navigate as f } from "react-router-dom";
5
- import { jsx as i, Fragment as u } from "react/jsx-runtime";
1
+ import { M as E, O as k, R as H, a1 as G, Z as M, a as N, c as $, $ as F, V as I, T as L, U as O, W as j, v as U, a0 as V, s as X, t as Y, X as Z, e as _, u as q, i as z, Y as D } from "../index.esm2017-YfeFmA6k.js";
2
+ import l from "axios";
3
+ import { useState as m, useEffect as i, useMemo as p } from "react";
4
+ import { useLocation as d, Navigate as f } from "react-router-dom";
5
+ import { jsx as a, Fragment as u } from "react/jsx-runtime";
6
6
  import "@r2wc/react-to-web-component";
7
7
  import "@mui/material";
8
- const g = (r) => {
9
- const [a, s] = l([]);
10
- return n(() => {
11
- m.get(`${r}/user-management/api/v1/users/my-account/permissions`, {
8
+ const h = (o) => {
9
+ const [s, r] = m([]);
10
+ return i(() => {
11
+ l.get(`${o}/user-management/api/v1/users/my-account/permissions`, {
12
12
  withCredentials: !0
13
- }).then((e) => s(e.data)).catch((e) => {
13
+ }).then((e) => r(e.data)).catch((e) => {
14
14
  console.error("Getting user permission error:", e);
15
15
  });
16
- }, [r]), a;
17
- }, B = (r = "/app") => {
18
- const a = p(), s = d();
19
- n(() => (window.hostNavigate = (e, t) => {
20
- const o = s.pathname + s.search + s.hash;
21
- e !== o && a(e, { replace: (t == null ? void 0 : t.replace) ?? !0 });
22
- }, () => {
23
- delete window.hostNavigate;
24
- }), [a, s]), n(() => {
25
- var t, o;
26
- const e = s.pathname + s.search + s.hash;
27
- (o = (t = window.top) == null ? void 0 : t.shellNavigate) == null || o.call(t, r + e, { replace: !0 });
28
- }, [s, r]);
16
+ }, [o]), s;
17
+ }, R = (o) => {
18
+ const s = d();
19
+ if (i(() => {
20
+ var e, t;
21
+ let r = s.pathname + s.search + s.hash;
22
+ o && !r.includes(o) && (r = o + r), console.log("🚀 ~ PrivateLayout.tsx ~ fullPath:", r), (t = (e = window.top) == null ? void 0 : e.shellNavigate) == null || t.call(e, "/app" + r, { replace: !0 });
23
+ }, [s, o]), window.self === window.top) {
24
+ console.log("useSyncRouter: Navigate to /app path"), window.location.href = window.location.href.replace(
25
+ window.origin,
26
+ `${window.origin}/app`
27
+ );
28
+ return;
29
+ }
29
30
  };
30
- function R({
31
- open: r,
32
- disabled: a
31
+ function T({
32
+ open: o,
33
+ disabled: s
33
34
  }) {
34
- h(() => {
35
- var s, e, t, o;
36
- a || (r ? (e = (s = window.top) == null ? void 0 : s.HostBridge) == null || e.openBackdrop(!0) : (o = (t = window.top) == null ? void 0 : t.HostBridge) == null || o.openBackdrop(!1));
37
- }, [r, a]);
35
+ p(() => {
36
+ var r, e, t, n;
37
+ s || (o ? (e = (r = window.top) == null ? void 0 : r.HostBridge) == null || e.openBackdrop(!0) : (n = (t = window.top) == null ? void 0 : t.HostBridge) == null || n.openBackdrop(!1));
38
+ }, [o, s]);
38
39
  }
39
- const c = (r) => (a, s) => {
40
- const e = g(r);
41
- return s ? a.every(
40
+ const c = (o) => (s, r) => {
41
+ const e = h(o);
42
+ return r ? s.every(
42
43
  (t) => e == null ? void 0 : e.includes(t)
43
- ) : a.some(
44
+ ) : s.some(
44
45
  (t) => e == null ? void 0 : e.includes(t)
45
46
  );
46
- }, A = ({
47
- baseUrl: r,
48
- accessWith: a,
49
- requireAll: s,
47
+ }, y = ({
48
+ baseUrl: o,
49
+ accessWith: s,
50
+ requireAll: r,
50
51
  children: e
51
- }) => c(r)(a, s) ? /* @__PURE__ */ i(u, { children: e }) : null, C = ({
52
- accessWith: r,
53
- requireAll: a,
54
- baseUrl: s,
52
+ }) => c(o)(s, r) ? /* @__PURE__ */ a(u, { children: e }) : null, B = ({
53
+ accessWith: o,
54
+ requireAll: s,
55
+ baseUrl: r,
55
56
  unAuthorizedPath: e,
56
57
  children: t
57
- }) => c(s)(r, a) ? /* @__PURE__ */ i(u, { children: t }) : /* @__PURE__ */ i(f, { to: e, replace: !0 });
58
+ }) => c(r)(o, s) ? /* @__PURE__ */ a(u, { children: t }) : /* @__PURE__ */ a(f, { to: e, replace: !0 });
58
59
  export {
59
- k as AuthContext,
60
- y as AuthProvider,
60
+ E as AuthContext,
61
+ k as AuthProvider,
61
62
  H as ERROR_MESSAGE,
62
- A as HasPermission,
63
- C as PermissionRoute,
63
+ y as HasPermission,
64
+ B as PermissionRoute,
64
65
  G as SaasThemeProvider,
65
66
  M as TranslationProvider,
66
- F as axiosInstance,
67
- I as color,
68
- O as createCustomTheme,
67
+ N as axiosInstance,
68
+ $ as color,
69
+ F as createCustomTheme,
69
70
  c as getUseHasPermission,
70
- $ as handleErrorAxios,
71
- j as login,
72
- L as logout,
73
- U as responseInterceptor,
74
- V as search,
75
- X as setFavicon,
76
- Y as setShellBackdrop,
77
- Z as translate,
78
- _ as translationConfig,
79
- q as useAuth,
80
- z as useCustomTranslation,
81
- g as useGetPermission,
82
- R as useSyncBackdrop,
83
- B as useSyncRouter,
84
- D as useTheme,
85
- J as useTranslation
71
+ I as handleErrorAxios,
72
+ L as login,
73
+ O as logout,
74
+ j as responseInterceptor,
75
+ U as search,
76
+ V as setFavicon,
77
+ X as setShellBackdrop,
78
+ Y as translate,
79
+ Z as translationConfig,
80
+ _ as useAuth,
81
+ q as useCustomTranslation,
82
+ h as useGetPermission,
83
+ T as useSyncBackdrop,
84
+ R as useSyncRouter,
85
+ z as useTheme,
86
+ D as useTranslation
86
87
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ukpc-lib/react",
3
3
  "private": false,
4
- "version": "0.16.3-sandbox.saas-9356-and-saas-9249.patch-7",
4
+ "version": "0.16.3-sandbox.saas-9356-and-saas-9249.patch-8",
5
5
  "type": "module",
6
6
  "main": "./dist/",
7
7
  "module": "./dist/",
@@ -1,6 +1,6 @@
1
- import "../react-to-web-component-w5r1Fs9q.js";
2
- import { U as e } from "../index-DBpqFdvL.js";
3
- import "../index-UUkm_4Gc.js";
1
+ import "../react-to-web-component-BOygDorD.js";
2
+ import { U as e } from "../index-Giq9sshx.js";
3
+ import "../index-omnj2VPv.js";
4
4
  export {
5
5
  e as UnauthorizedPage
6
6
  };
@@ -1,5 +1,5 @@
1
- import "../react-to-web-component-w5r1Fs9q.js";
2
- import { ag as m } from "../index-UUkm_4Gc.js";
1
+ import "../react-to-web-component-BOygDorD.js";
2
+ import { ag as m } from "../index-omnj2VPv.js";
3
3
  export {
4
4
  m as BaseBreadcrumbs
5
5
  };
@@ -1,7 +1,7 @@
1
- import "../react-to-web-component-w5r1Fs9q.js";
2
- import { F as i, u as m } from "../index-DBpqFdvL.js";
3
- import "../index-DqxmsDJs.js";
4
- import "../index-UUkm_4Gc.js";
1
+ import "../react-to-web-component-BOygDorD.js";
2
+ import { F as i, u as m } from "../index-Giq9sshx.js";
3
+ import "../index-BUE-pz1x.js";
4
+ import "../index-omnj2VPv.js";
5
5
  export {
6
6
  i as FavoriteMenu,
7
7
  m as updateFavoriteItems
@@ -1,7 +1,7 @@
1
- import "../react-to-web-component-w5r1Fs9q.js";
2
- import { G as i } from "../index-DBpqFdvL.js";
3
- import "../index-DqxmsDJs.js";
4
- import "../index-UUkm_4Gc.js";
1
+ import "../react-to-web-component-BOygDorD.js";
2
+ import { G as i } from "../index-Giq9sshx.js";
3
+ import "../index-BUE-pz1x.js";
4
+ import "../index-omnj2VPv.js";
5
5
  export {
6
6
  i as GlobalMenu
7
7
  };
@@ -1,8 +1,8 @@
1
- import "../react-to-web-component-w5r1Fs9q.js";
2
- import { L as g, T as n } from "../index-DBpqFdvL.js";
3
- import "../index-DqxmsDJs.js";
4
- import "../index-UUkm_4Gc.js";
5
- import "../react-toastify.esm-H_Xdunfj.js";
1
+ import "../react-to-web-component-BOygDorD.js";
2
+ import { L as g, T as n } from "../index-Giq9sshx.js";
3
+ import "../index-BUE-pz1x.js";
4
+ import "../index-omnj2VPv.js";
5
+ import "../react-toastify.esm-DnABvuky.js";
6
6
  import "../toast-config/index.js";
7
7
  import "../toast-config-notification/index.js";
8
8
  export {
@@ -1,6 +1,6 @@
1
- import "../react-to-web-component-w5r1Fs9q.js";
2
- import { H as e, g as m } from "../index-DBpqFdvL.js";
3
- import "../index-UUkm_4Gc.js";
1
+ import "../react-to-web-component-BOygDorD.js";
2
+ import { H as e, g as m } from "../index-Giq9sshx.js";
3
+ import "../index-omnj2VPv.js";
4
4
  export {
5
5
  e as HasPermission,
6
6
  m as getUseHasPermission
@@ -1,4 +1,4 @@
1
- import { j as e, s as a } from "./react-to-web-component-w5r1Fs9q.js";
1
+ import { j as e, s as a } from "./react-to-web-component-BOygDorD.js";
2
2
  const l = "*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}";
3
3
  function s({ children: t, styles: o = [], ...i }) {
4
4
  return /* @__PURE__ */ e.jsxs("div", { ...i, children: [
@@ -1,11 +1,11 @@
1
1
  var z3 = Object.defineProperty;
2
2
  var Y3 = (e, t, n) => t in e ? z3(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
3
  var bh = (e, t, n) => (Y3(e, typeof t != "symbol" ? t + "" : t, n), n);
4
- import { c as Yn, g as xl, r as M, R as je, j as I, a as wh, b as Tg, s as Xf, d as q3 } from "./react-to-web-component-w5r1Fs9q.js";
5
- import { _ as G3, a as vs, b as da, i as Dp, s as K3, c as Te, d as Xy, f as X3, r as Qy, n as Wn, t as gk, e as Q3, g as mk, h as ln, j as kp, k as vk, p as Yo, m as JS, l as eC, o as Qh, q as xh, u as tC, v as Z3, T as yk, w as J3, x as eU, y as tU, z as bk, A as kr, D as nU, B as Pp, C as rU, E as wk, F as iU, G as Cf, H as Ap, I as nC, J as $u, K as Sl, L as rC, M as sU, N as Fu, O as Qf, P as ur, Q as oU, R as xk, S as Sk, U as Xr, V as aU, W as lU, X as Ck, Y as Tk, Z as _g, $ as Nb, a0 as qc, a1 as uU, a2 as iC, a3 as cU, a4 as Sh, a5 as fU, a6 as Rp, a7 as dU, a8 as hU, a9 as Dn, aa as pU, ab as gU, ac as mU, ad as _k, ae as Ek, af as Ok } from "./index-UUkm_4Gc.js";
4
+ import { c as Yn, g as xl, r as M, R as je, j as I, a as wh, b as Tg, s as Xf, d as q3 } from "./react-to-web-component-BOygDorD.js";
5
+ import { _ as G3, a as vs, b as da, i as Dp, s as K3, c as Te, d as Xy, f as X3, r as Qy, n as Wn, t as gk, e as Q3, g as mk, h as ln, j as kp, k as vk, p as Yo, m as JS, l as eC, o as Qh, q as xh, u as tC, v as Z3, T as yk, w as J3, x as eU, y as tU, z as bk, A as kr, D as nU, B as Pp, C as rU, E as wk, F as iU, G as Cf, H as Ap, I as nC, J as $u, K as Sl, L as rC, M as sU, N as Fu, O as Qf, P as ur, Q as oU, R as xk, S as Sk, U as Xr, V as aU, W as lU, X as Ck, Y as Tk, Z as _g, $ as Nb, a0 as qc, a1 as uU, a2 as iC, a3 as cU, a4 as Sh, a5 as fU, a6 as Rp, a7 as dU, a8 as hU, a9 as Dn, aa as pU, ab as gU, ac as mU, ad as _k, ae as Ek, af as Ok } from "./index-omnj2VPv.js";
6
6
  import { c as Gs } from "./clsx-DB4S2d7J.js";
7
- import { S as $b } from "./index-DqxmsDJs.js";
8
- import { B as Fb } from "./react-toastify.esm-H_Xdunfj.js";
7
+ import { S as $b } from "./index-BUE-pz1x.js";
8
+ import { B as Fb } from "./react-toastify.esm-DnABvuky.js";
9
9
  import "./toast-config/index.js";
10
10
  import "./toast-config-notification/index.js";
11
11
  function vU(e, t) {