@smart-factor/gem-ui-components 0.0.162 → 0.0.163

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.
@@ -2,7 +2,7 @@ import './assets/SignEditor.css';var N4 = Object.defineProperty;
2
2
  var I4 = (o, e, t) => e in o ? N4(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t;
3
3
  var Eu = (o, e, t) => I4(o, typeof e != "symbol" ? e + "" : e, t);
4
4
  import { jsx as Vt, jsxs as ia, Fragment as o_ } from "react/jsx-runtime";
5
- import { G as Ib, u as i_, a as rA, Q as uc, b as hs, c as Lp, D as KE, B as sp, d as ow, e as M4, z as Dc, f as a_, s as $E, I as Of, A as WE, F as O4, U as Ax, g as q4, h as R4, i as Q4, j as G4, T as V4, K as D4, k as H4 } from "./index-DyibW4jU.js";
5
+ import { G as Ib, u as i_, a as rA, Q as uc, b as hs, c as Lp, D as KE, B as sp, d as ow, e as M4, z as Dc, f as a_, s as $E, I as Of, A as WE, F as O4, U as Ax, g as q4, h as R4, i as Q4, j as G4, T as V4, K as D4, k as H4 } from "./index-BEZDiGup.js";
6
6
  import { q as XE, s as Di, I as tu, J as r_, H as YE, S as lp } from "./Stack-hsHMA5b6.js";
7
7
  import { createContext as U4, useContext as z4, useState as vl, useCallback as zu, useEffect as oc, useMemo as cp, useRef as K4 } from "react";
8
8
  import "react-dom";
@@ -283081,19 +283081,16 @@ async function queryAppInfo() {
283081
283081
  }), { ...r0, applicationDomain: l0, licenses: D0 };
283082
283082
  }
283083
283083
  const COOKIE_OPTIONS = { path: "/" };
283084
- function cookieOptions(s0) {
283085
- return { ...COOKIE_OPTIONS, domain: s0 };
283086
- }
283087
- function setAuthCookies(s0, o0, r0) {
283088
- const l0 = cookieOptions(s0);
283089
- api.set("x-auth-token", o0, l0), api.set("x-auth-login", r0.login, l0), api.set(
283084
+ function setAuthCookies(s0, o0) {
283085
+ const r0 = COOKIE_OPTIONS;
283086
+ api.set("x-auth-token", s0, r0), api.set("x-auth-login", o0.login, r0), api.set(
283090
283087
  "consent",
283091
283088
  JSON.stringify({
283092
- consent: r0.consent,
283093
- consent_expiration_date: r0.consent_expiration_date
283089
+ consent: o0.consent,
283090
+ consent_expiration_date: o0.consent_expiration_date
283094
283091
  }),
283095
- l0
283096
- ), api.set("roles", r0.roles_list.join(","), l0);
283092
+ r0
283093
+ ), api.set("roles", o0.roles_list.join(","), r0);
283097
283094
  }
283098
283095
  const IS_AUTHENTICATED_KEY = "isAuthenticated", LOGIN_KEY = "x-auth-login", TOKEN_KEY = "x-auth-token", CONSENT_KEY = "consent", ROLES_KEY = "roles", USER_PROJECTION_KEY = "user-projection";
283099
283096
  function setAuthSessionLegacy(s0, o0) {
@@ -283105,7 +283102,7 @@ function setAuthSessionLegacy(s0, o0) {
283105
283102
  }
283106
283103
  async function applyAuthResult(s0, o0) {
283107
283104
  const r0 = s0.token, l0 = normalizeUser(s0.user_account);
283108
- !r0 || !l0 || (setAuthSessionLegacy(r0, l0), setAppInfoToStorage(o0.applicationDomain, o0.licenses), setAuthCookies(o0.applicationDomain, r0, l0), applyLoginSession({
283105
+ !r0 || !l0 || (setAuthSessionLegacy(r0, l0), setAppInfoToStorage(o0.applicationDomain, o0.licenses), setAuthCookies(r0, l0), applyLoginSession({
283109
283106
  token: r0,
283110
283107
  user: l0,
283111
283108
  domain: o0.applicationDomain,
@@ -283268,26 +283265,26 @@ const useUnauthorizedInCurrentRun = () => {
283268
283265
  onSessionRenewed: l0,
283269
283266
  onSessionTerminated: u0
283270
283267
  }) => {
283271
- const a0 = SessionService.getLoginPathname(o0), D0 = useMemo(() => [a0], [a0]), { showModal: $0 } = useSessionModal(D0, {
283272
- activated: s0,
283268
+ const a0 = s0 && SessionService.hasLicense("SESSION_TERMINATED_MODAL"), D0 = SessionService.getLoginPathname(o0), $0 = useMemo(() => [D0], [D0]), { showModal: z0 } = useSessionModal($0, {
283269
+ activated: a0,
283273
283270
  loginUrl: o0
283274
- }), z0 = useTheme$2(), K0 = useMediaQuery(z0.breakpoints.down("sm")), Q0 = useCallback(
283275
- (J0, f1) => {
283276
- f1 ? u0 == null || u0() : l0 == null || l0();
283271
+ }), K0 = useTheme$2(), Q0 = useMediaQuery(K0.breakpoints.down("sm")), c1 = useCallback(
283272
+ (f1, d1) => {
283273
+ d1 ? u0 == null || u0() : l0 == null || l0();
283277
283274
  },
283278
283275
  [u0, l0]
283279
283276
  );
283280
- useDidUpdate($0, Q0);
283281
- const c1 = useCallback(() => {
283277
+ useDidUpdate(z0, c1);
283278
+ const J0 = useCallback(() => {
283282
283279
  window.open(SessionService.buildLoginUrl(o0), "_blank"), r0 == null || r0();
283283
283280
  }, [o0, r0]);
283284
283281
  return /* @__PURE__ */ jsx(
283285
283282
  Dialog$2,
283286
283283
  {
283287
- open: $0,
283284
+ open: z0,
283288
283285
  PaperProps: {
283289
283286
  sx: {
283290
- borderRadius: K0 ? 0 : 3,
283287
+ borderRadius: Q0 ? 0 : 3,
283291
283288
  boxShadow: 6,
283292
283289
  padding: 0,
283293
283290
  zIndex: 9999
@@ -283303,7 +283300,7 @@ const useUnauthorizedInCurrentRun = () => {
283303
283300
  variant: "contained",
283304
283301
  color: "primary",
283305
283302
  startIcon: /* @__PURE__ */ jsx(LoginIcon, {}),
283306
- onClick: c1,
283303
+ onClick: J0,
283307
283304
  sx: { mt: 1 },
283308
283305
  children: "Odnów sesję"
283309
283306
  }
package/dist/main.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { jsx as c, jsxs as k, Fragment as De } from "react/jsx-runtime";
2
2
  import { P as d, R as Ar, U as jr, V as kr, W as Ir, y as $r, X as Yr, q as ee, T as pe, Y as zr, Z as Nr, $ as Fr, c as dt, g as ut, e as Le, A as ge, k as Xe, s as Ae, l as Ke, o as it, t as Rr, a0 as er, J as me, a1 as Lt, K as Pe, I as X, H as tr, i as Qe, S as rr, a2 as je, _ as Br } from "./Stack-hsHMA5b6.js";
3
- import { l as Vr, r as Ur, L as _r, m as Hr, n as ze, S as Gr, o as Wr, p as qr, q as Jr, B as we, j as Zr, t as Xr, d as At, v as Kr, w as or, x as Je, y as Qr, C as eo, E as to, H as ro, J as jt, M as kt, N as oo, O as et, P as ft, R as ht, V as ye, W as no, X as so, Y as io, Z as ao, _ as nr, $ as co, a0 as lo, a1 as uo, a2 as A, a3 as he, z as sr, b as fo, e as ho, G as mo, a4 as po, a5 as go, a6 as yo, K as bo, a7 as be, a8 as So, a9 as To, aa as xo, ab as Mo, ac as Co, F as vo, ad as tt, ae as wo, af as Po, ag as Eo, ah as ir, ai as Oo, aj as ar, ak as cr, al as ce, am as lr, an as Do, ao as Lo, i as Ao, ap as jo, aq as dr, ar as ko, as as Io, at as $o, au as Yo, av as zo, aw as No, ax as Fo, ay as Ro, az as Bo, aA as Vo, aB as Uo, h as _o, aC as Ho, aD as mt, aE as pt, aF as gt, aG as Ne, aH as Go, aI as Wo, aJ as qo } from "./index-DyibW4jU.js";
4
- import { aX as ul, b1 as fl, A as hl, aK as ml, aL as pl, D as gl, aY as yl, g as bl, aZ as Sl, aM as Tl, I as xl, aN as Ml, aO as Cl, aP as vl, aQ as wl, aR as Pl, aS as El, aU as Ol, T as Dl, U as Ll, a_ as Al, b0 as jl, aW as kl, a$ as Il, aV as $l, aT as Yl } from "./index-DyibW4jU.js";
3
+ import { l as Vr, r as Ur, L as _r, m as Hr, n as ze, S as Gr, o as Wr, p as qr, q as Jr, B as we, j as Zr, t as Xr, d as At, v as Kr, w as or, x as Je, y as Qr, C as eo, E as to, H as ro, J as jt, M as kt, N as oo, O as et, P as ft, R as ht, V as ye, W as no, X as so, Y as io, Z as ao, _ as nr, $ as co, a0 as lo, a1 as uo, a2 as A, a3 as he, z as sr, b as fo, e as ho, G as mo, a4 as po, a5 as go, a6 as yo, K as bo, a7 as be, a8 as So, a9 as To, aa as xo, ab as Mo, ac as Co, F as vo, ad as tt, ae as wo, af as Po, ag as Eo, ah as ir, ai as Oo, aj as ar, ak as cr, al as ce, am as lr, an as Do, ao as Lo, i as Ao, ap as jo, aq as dr, ar as ko, as as Io, at as $o, au as Yo, av as zo, aw as No, ax as Fo, ay as Ro, az as Bo, aA as Vo, aB as Uo, h as _o, aC as Ho, aD as mt, aE as pt, aF as gt, aG as Ne, aH as Go, aI as Wo, aJ as qo } from "./index-BEZDiGup.js";
4
+ import { aX as ul, b1 as fl, A as hl, aK as ml, aL as pl, D as gl, aY as yl, g as bl, aZ as Sl, aM as Tl, I as xl, aN as Ml, aO as Cl, aP as vl, aQ as wl, aR as Pl, aS as El, aU as Ol, T as Dl, U as Ll, a_ as Al, b0 as jl, aW as kl, a$ as Il, aV as $l, aT as Yl } from "./index-BEZDiGup.js";
5
5
  import * as E from "react";
6
6
  import { useState as R, useCallback as le, useEffect as Z, useLayoutEffect as Ee, useMemo as Q } from "react";
7
7
  import { e as ur, P as Jo, i as Zo } from "./Drawer-BMToHNA7.js";
@@ -1,2 +1,2 @@
1
1
  import { NormalizedUser } from './normalizeUser';
2
- export declare function setAuthCookies(applicationDomain: string, token: string, user: NormalizedUser): void;
2
+ export declare function setAuthCookies(token: string, user: NormalizedUser): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smart-factor/gem-ui-components",
3
- "version": "0.0.162",
3
+ "version": "0.0.163",
4
4
  "private": false,
5
5
  "description": "Gem UI Components",
6
6
  "type": "module",