propro-common-components 0.1.4 → 0.1.5

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.
@@ -6,7 +6,6 @@ import React__default, { useCallback, createContext, useMemo as useMemo$1, creat
6
6
  import { useMutation, QueryClient, QueryClientProvider } from "@tanstack/react-query";
7
7
  import axios from "axios";
8
8
  import { ReactQueryDevtools } from "@tanstack/react-query-devtools";
9
- import { useNavigate } from "react-router-dom";
10
9
  function _mergeNamespaces(m, g) {
11
10
  for (var b = 0; b < g.length; b++) {
12
11
  const _ = g[b];
@@ -37077,7 +37076,7 @@ var parseStyle = function m(g) {
37077
37076
  function uniqueHash(m, g) {
37078
37077
  return murmur2$1("".concat(m.join("%")).concat(g));
37079
37078
  }
37080
- function Empty() {
37079
+ function Empty$1() {
37081
37080
  return null;
37082
37081
  }
37083
37082
  var STYLE_PREFIX = "style";
@@ -37137,7 +37136,7 @@ function useStyleRegister(m, g) {
37137
37136
  return function(ye) {
37138
37137
  var ve;
37139
37138
  if (!Z || re || !U)
37140
- ve = /* @__PURE__ */ React.createElement(Empty, null);
37139
+ ve = /* @__PURE__ */ React.createElement(Empty$1, null);
37141
37140
  else {
37142
37141
  var Se;
37143
37142
  ve = /* @__PURE__ */ React.createElement("style", _extends$5({}, (Se = {}, _defineProperty$1(Se, ATTR_TOKEN, me), _defineProperty$1(Se, ATTR_MARK, be), Se), {
@@ -56884,14 +56883,14 @@ var _propertyDesc = function(m, g) {
56884
56883
  writable: !(m & 4),
56885
56884
  value: g
56886
56885
  };
56887
- }, dP$1 = require_objectDp(), createDesc$2 = _propertyDesc, _hide = require_descriptors() ? function(m, g, b) {
56888
- return dP$1.f(m, g, createDesc$2(1, b));
56886
+ }, dP$2 = require_objectDp(), createDesc$2 = _propertyDesc, _hide = require_descriptors() ? function(m, g, b) {
56887
+ return dP$2.f(m, g, createDesc$2(1, b));
56889
56888
  } : function(m, g, b) {
56890
56889
  return m[g] = b, m;
56891
56890
  }, hasOwnProperty = {}.hasOwnProperty, _has = function(m, g) {
56892
56891
  return hasOwnProperty.call(m, g);
56893
- }, global$4 = _globalExports, core$2 = _coreExports, ctx = _ctx, hide$1 = _hide, has$6 = _has, PROTOTYPE$1 = "prototype", $export$5 = function(m, g, b) {
56894
- var _ = m & $export$5.F, x = m & $export$5.G, C = m & $export$5.S, $ = m & $export$5.P, I = m & $export$5.B, R = m & $export$5.W, P = x ? core$2 : core$2[g] || (core$2[g] = {}), N = P[PROTOTYPE$1], z = x ? global$4 : C ? global$4[g] : (global$4[g] || {})[PROTOTYPE$1], D, U, W;
56892
+ }, global$4 = _globalExports, core$2 = _coreExports, ctx = _ctx, hide$1 = _hide, has$6 = _has, PROTOTYPE$2 = "prototype", $export$5 = function(m, g, b) {
56893
+ var _ = m & $export$5.F, x = m & $export$5.G, C = m & $export$5.S, $ = m & $export$5.P, I = m & $export$5.B, R = m & $export$5.W, P = x ? core$2 : core$2[g] || (core$2[g] = {}), N = P[PROTOTYPE$2], z = x ? global$4 : C ? global$4[g] : (global$4[g] || {})[PROTOTYPE$2], D, U, W;
56895
56894
  x && (b = g);
56896
56895
  for (D in b)
56897
56896
  U = !_ && z && z[D] !== void 0, !(U && has$6(P, D)) && (W = U ? z[D] : b[D], P[D] = x && typeof z[D] != "function" ? b[D] : I && U ? ctx(W, global$4) : R && z[D] == W ? function(V) {
@@ -56909,7 +56908,7 @@ var _propertyDesc = function(m, g) {
56909
56908
  }
56910
56909
  return V.apply(this, arguments);
56911
56910
  };
56912
- return Z[PROTOTYPE$1] = V[PROTOTYPE$1], Z;
56911
+ return Z[PROTOTYPE$2] = V[PROTOTYPE$2], Z;
56913
56912
  }(W) : $ && typeof W == "function" ? ctx(Function.call, W) : W, $ && ((P.virtual || (P.virtual = {}))[D] = W, m & $export$5.R && N && !N[D] && hide$1(N, D, W)));
56914
56913
  };
56915
56914
  $export$5.F = 1;
@@ -56969,15 +56968,15 @@ var _sharedExports = _shared.exports, id$1 = 0, px = Math.random(), _uid = funct
56969
56968
  return "Symbol(".concat(m === void 0 ? "" : m, ")_", (++id$1 + px).toString(36));
56970
56969
  }, shared$1 = _sharedExports("keys"), uid$2 = _uid, _sharedKey = function(m) {
56971
56970
  return shared$1[m] || (shared$1[m] = uid$2(m));
56972
- }, has$5 = _has, toIObject$4 = _toIobject, arrayIndexOf = _arrayIncludes(!1), IE_PROTO$1 = _sharedKey("IE_PROTO"), _objectKeysInternal = function(m, g) {
56971
+ }, has$5 = _has, toIObject$4 = _toIobject, arrayIndexOf = _arrayIncludes(!1), IE_PROTO$2 = _sharedKey("IE_PROTO"), _objectKeysInternal = function(m, g) {
56973
56972
  var b = toIObject$4(m), _ = 0, x = [], C;
56974
56973
  for (C in b)
56975
- C != IE_PROTO$1 && has$5(b, C) && x.push(C);
56974
+ C != IE_PROTO$2 && has$5(b, C) && x.push(C);
56976
56975
  for (; g.length > _; )
56977
56976
  has$5(b, C = g[_++]) && (~arrayIndexOf(x, C) || x.push(C));
56978
56977
  return x;
56979
- }, _enumBugKeys = "constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(","), $keys$2 = _objectKeysInternal, enumBugKeys = _enumBugKeys, _objectKeys = Object.keys || function(g) {
56980
- return $keys$2(g, enumBugKeys);
56978
+ }, _enumBugKeys = "constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(","), $keys$1 = _objectKeysInternal, enumBugKeys$1 = _enumBugKeys, _objectKeys = Object.keys || function(g) {
56979
+ return $keys$1(g, enumBugKeys$1);
56981
56980
  }, _objectGops = {};
56982
56981
  _objectGops.f = Object.getOwnPropertySymbols;
56983
56982
  var _objectPie = {}, hasRequired_objectPie;
@@ -57020,8 +57019,8 @@ _extends.default = _assign2.default || function(m) {
57020
57019
  }
57021
57020
  return m;
57022
57021
  };
57023
- var has$4 = _has, toObject$2 = _toObject, IE_PROTO = _sharedKey("IE_PROTO"), ObjectProto$1 = Object.prototype, _objectGpo = Object.getPrototypeOf || function(m) {
57024
- return m = toObject$2(m), has$4(m, IE_PROTO) ? m[IE_PROTO] : typeof m.constructor == "function" && m instanceof m.constructor ? m.constructor.prototype : m instanceof Object ? ObjectProto$1 : null;
57022
+ var has$4 = _has, toObject$2 = _toObject, IE_PROTO$1 = _sharedKey("IE_PROTO"), ObjectProto$1 = Object.prototype, _objectGpo = Object.getPrototypeOf || function(m) {
57023
+ return m = toObject$2(m), has$4(m, IE_PROTO$1) ? m[IE_PROTO$1] : typeof m.constructor == "function" && m instanceof m.constructor ? m.constructor.prototype : m instanceof Object ? ObjectProto$1 : null;
57025
57024
  }, _objectSap, hasRequired_objectSap;
57026
57025
  function require_objectSap() {
57027
57026
  if (hasRequired_objectSap)
@@ -57073,20 +57072,12 @@ var possibleConstructorReturn = {}, _typeof$1 = {}, toInteger = _toInteger, defi
57073
57072
  var _ = String(defined(g)), x = toInteger(b), C = _.length, $, I;
57074
57073
  return x < 0 || x >= C ? m ? "" : void 0 : ($ = _.charCodeAt(x), $ < 55296 || $ > 56319 || x + 1 === C || (I = _.charCodeAt(x + 1)) < 56320 || I > 57343 ? m ? _.charAt(x) : $ : m ? _.slice(x, x + 2) : ($ - 55296 << 10) + (I - 56320) + 65536);
57075
57074
  };
57076
- }, _redefine = _hide, _iterators = {}, _objectDps, hasRequired_objectDps;
57077
- function require_objectDps() {
57078
- if (hasRequired_objectDps)
57079
- return _objectDps;
57080
- hasRequired_objectDps = 1;
57081
- var m = require_objectDp(), g = _anObject, b = _objectKeys;
57082
- return _objectDps = require_descriptors() ? Object.defineProperties : function(x, C) {
57083
- g(x);
57084
- for (var $ = b(C), I = $.length, R = 0, P; I > R; )
57085
- m.f(x, P = $[R++], C[P]);
57086
- return x;
57087
- }, _objectDps;
57088
- }
57089
- var _html, hasRequired_html;
57075
+ }, _redefine = _hide, _iterators = {}, dP$1 = require_objectDp(), anObject$2 = _anObject, getKeys$1 = _objectKeys, _objectDps = require_descriptors() ? Object.defineProperties : function(g, b) {
57076
+ anObject$2(g);
57077
+ for (var _ = getKeys$1(b), x = _.length, C = 0, $; x > C; )
57078
+ dP$1.f(g, $ = _[C++], b[$]);
57079
+ return g;
57080
+ }, _html, hasRequired_html;
57090
57081
  function require_html() {
57091
57082
  if (hasRequired_html)
57092
57083
  return _html;
@@ -57094,24 +57085,16 @@ function require_html() {
57094
57085
  var m = _globalExports.document;
57095
57086
  return _html = m && m.documentElement, _html;
57096
57087
  }
57097
- var _objectCreate, hasRequired_objectCreate;
57098
- function require_objectCreate() {
57099
- if (hasRequired_objectCreate)
57100
- return _objectCreate;
57101
- hasRequired_objectCreate = 1;
57102
- var m = _anObject, g = require_objectDps(), b = _enumBugKeys, _ = _sharedKey("IE_PROTO"), x = function() {
57103
- }, C = "prototype", $ = function() {
57104
- var I = require_domCreate()("iframe"), R = b.length, P = "<", N = ">", z;
57105
- for (I.style.display = "none", require_html().appendChild(I), I.src = "javascript:", z = I.contentWindow.document, z.open(), z.write(P + "script" + N + "document.F=Object" + P + "/script" + N), z.close(), $ = z.F; R--; )
57106
- delete $[C][b[R]];
57107
- return $();
57108
- };
57109
- return _objectCreate = Object.create || function(R, P) {
57110
- var N;
57111
- return R !== null ? (x[C] = m(R), N = new x(), x[C] = null, N[_] = R) : N = $(), P === void 0 ? N : g(N, P);
57112
- }, _objectCreate;
57113
- }
57114
- var _wks = { exports: {} }, store = _sharedExports("wks"), uid$1 = _uid, Symbol$1 = _globalExports.Symbol, USE_SYMBOL = typeof Symbol$1 == "function", $exports = _wks.exports = function(m) {
57088
+ var anObject$1 = _anObject, dPs = _objectDps, enumBugKeys = _enumBugKeys, IE_PROTO = _sharedKey("IE_PROTO"), Empty = function() {
57089
+ }, PROTOTYPE$1 = "prototype", createDict = function() {
57090
+ var m = require_domCreate()("iframe"), g = enumBugKeys.length, b = "<", _ = ">", x;
57091
+ for (m.style.display = "none", require_html().appendChild(m), m.src = "javascript:", x = m.contentWindow.document, x.open(), x.write(b + "script" + _ + "document.F=Object" + b + "/script" + _), x.close(), createDict = x.F; g--; )
57092
+ delete createDict[PROTOTYPE$1][enumBugKeys[g]];
57093
+ return createDict();
57094
+ }, _objectCreate = Object.create || function(g, b) {
57095
+ var _;
57096
+ return g !== null ? (Empty[PROTOTYPE$1] = anObject$1(g), _ = new Empty(), Empty[PROTOTYPE$1] = null, _[IE_PROTO] = g) : _ = createDict(), b === void 0 ? _ : dPs(_, b);
57097
+ }, _wks = { exports: {} }, store = _sharedExports("wks"), uid$1 = _uid, Symbol$1 = _globalExports.Symbol, USE_SYMBOL = typeof Symbol$1 == "function", $exports = _wks.exports = function(m) {
57115
57098
  return store[m] || (store[m] = USE_SYMBOL && Symbol$1[m] || (USE_SYMBOL ? Symbol$1 : uid$1)("Symbol." + m));
57116
57099
  };
57117
57100
  $exports.store = store;
@@ -57122,7 +57105,7 @@ function require_iterCreate() {
57122
57105
  if (hasRequired_iterCreate)
57123
57106
  return _iterCreate;
57124
57107
  hasRequired_iterCreate = 1;
57125
- var m = require_objectCreate(), g = _propertyDesc, b = _setToStringTag, _ = {};
57108
+ var m = _objectCreate, g = _propertyDesc, b = _setToStringTag, _ = {};
57126
57109
  return _hide(_, _wksExports("iterator"), function() {
57127
57110
  return this;
57128
57111
  }), _iterCreate = function(x, C, $) {
@@ -57245,11 +57228,17 @@ var iterator$1 = _wksExt.f("iterator"), iterator = { default: iterator$1, __esMo
57245
57228
  return g;
57246
57229
  }, cof = _cof, _isArray = Array.isArray || function(g) {
57247
57230
  return cof(g) == "Array";
57248
- }, _objectGopnExt = {}, _objectGopn = {}, $keys$1 = _objectKeysInternal, hiddenKeys = _enumBugKeys.concat("length", "prototype");
57249
- _objectGopn.f = Object.getOwnPropertyNames || function(g) {
57250
- return $keys$1(g, hiddenKeys);
57251
- };
57252
- var toIObject$2 = _toIobject, gOPN$1 = _objectGopn.f, toString = {}.toString, windowNames = typeof window == "object" && window && Object.getOwnPropertyNames ? Object.getOwnPropertyNames(window) : [], getWindowNames = function(m) {
57231
+ }, _objectGopnExt = {}, _objectGopn = {}, hasRequired_objectGopn;
57232
+ function require_objectGopn() {
57233
+ if (hasRequired_objectGopn)
57234
+ return _objectGopn;
57235
+ hasRequired_objectGopn = 1;
57236
+ var m = _objectKeysInternal, g = _enumBugKeys.concat("length", "prototype");
57237
+ return _objectGopn.f = Object.getOwnPropertyNames || function(_) {
57238
+ return m(_, g);
57239
+ }, _objectGopn;
57240
+ }
57241
+ var toIObject$2 = _toIobject, gOPN$1 = require_objectGopn().f, toString = {}.toString, windowNames = typeof window == "object" && window && Object.getOwnPropertyNames ? Object.getOwnPropertyNames(window) : [], getWindowNames = function(m) {
57253
57242
  try {
57254
57243
  return gOPN$1(m);
57255
57244
  } catch {
@@ -57269,7 +57258,7 @@ _objectGopd.f = require_descriptors() ? gOPD$1 : function(g, b) {
57269
57258
  if (has$1(g, b))
57270
57259
  return createDesc$1(!pIE.f.call(g, b), g[b]);
57271
57260
  };
57272
- var global$1 = _globalExports, has = _has, DESCRIPTORS = require_descriptors(), $export$2 = _export, redefine = _redefine, META = _metaExports.KEY, $fails = _fails, shared = _sharedExports, setToStringTag = _setToStringTag, uid = _uid, wks = _wksExports, wksExt = _wksExt, wksDefine = _wksDefine, enumKeys = _enumKeys, isArray = _isArray, anObject = _anObject, isObject = _isObject, toObject = _toObject, toIObject = _toIobject, toPrimitive = _toPrimitive, createDesc = _propertyDesc, _create$1 = require_objectCreate(), gOPNExt = _objectGopnExt, $GOPD = _objectGopd, $GOPS = _objectGops, $DP = require_objectDp(), $keys = _objectKeys, gOPD = $GOPD.f, dP = $DP.f, gOPN = gOPNExt.f, $Symbol = global$1.Symbol, $JSON = global$1.JSON, _stringify = $JSON && $JSON.stringify, PROTOTYPE = "prototype", HIDDEN = wks("_hidden"), TO_PRIMITIVE = wks("toPrimitive"), isEnum = {}.propertyIsEnumerable, SymbolRegistry = shared("symbol-registry"), AllSymbols = shared("symbols"), OPSymbols = shared("op-symbols"), ObjectProto = Object[PROTOTYPE], USE_NATIVE = typeof $Symbol == "function" && !!$GOPS.f, QObject = global$1.QObject, setter = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild, setSymbolDesc = DESCRIPTORS && $fails(function() {
57261
+ var global$1 = _globalExports, has = _has, DESCRIPTORS = require_descriptors(), $export$2 = _export, redefine = _redefine, META = _metaExports.KEY, $fails = _fails, shared = _sharedExports, setToStringTag = _setToStringTag, uid = _uid, wks = _wksExports, wksExt = _wksExt, wksDefine = _wksDefine, enumKeys = _enumKeys, isArray = _isArray, anObject = _anObject, isObject = _isObject, toObject = _toObject, toIObject = _toIobject, toPrimitive = _toPrimitive, createDesc = _propertyDesc, _create$1 = _objectCreate, gOPNExt = _objectGopnExt, $GOPD = _objectGopd, $GOPS = _objectGops, $DP = require_objectDp(), $keys = _objectKeys, gOPD = $GOPD.f, dP = $DP.f, gOPN = gOPNExt.f, $Symbol = global$1.Symbol, $JSON = global$1.JSON, _stringify = $JSON && $JSON.stringify, PROTOTYPE = "prototype", HIDDEN = wks("_hidden"), TO_PRIMITIVE = wks("toPrimitive"), isEnum = {}.propertyIsEnumerable, SymbolRegistry = shared("symbol-registry"), AllSymbols = shared("symbols"), OPSymbols = shared("op-symbols"), ObjectProto = Object[PROTOTYPE], USE_NATIVE = typeof $Symbol == "function" && !!$GOPS.f, QObject = global$1.QObject, setter = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild, setSymbolDesc = DESCRIPTORS && $fails(function() {
57273
57262
  return _create$1(dP({}, "a", {
57274
57263
  get: function() {
57275
57264
  return dP(this, "a", { value: 7 }).a;
@@ -57320,7 +57309,7 @@ USE_NATIVE || ($Symbol = function() {
57320
57309
  return DESCRIPTORS && setter && setSymbolDesc(ObjectProto, g, { configurable: !0, set: b }), wrap(g);
57321
57310
  }, redefine($Symbol[PROTOTYPE], "toString", function() {
57322
57311
  return this._k;
57323
- }), $GOPD.f = $getOwnPropertyDescriptor, $DP.f = $defineProperty, _objectGopn.f = gOPNExt.f = $getOwnPropertyNames, require_objectPie().f = $propertyIsEnumerable, $GOPS.f = $getOwnPropertySymbols, DESCRIPTORS && !_library && redefine(ObjectProto, "propertyIsEnumerable", $propertyIsEnumerable), wksExt.f = function(m) {
57312
+ }), $GOPD.f = $getOwnPropertyDescriptor, $DP.f = $defineProperty, require_objectGopn().f = gOPNExt.f = $getOwnPropertyNames, require_objectPie().f = $propertyIsEnumerable, $GOPS.f = $getOwnPropertySymbols, DESCRIPTORS && !_library && redefine(ObjectProto, "propertyIsEnumerable", $propertyIsEnumerable), wksExt.f = function(m) {
57324
57313
  return wrap(wks(m));
57325
57314
  });
57326
57315
  $export$2($export$2.G + $export$2.W + $export$2.F * !USE_NATIVE, { Symbol: $Symbol });
@@ -57447,7 +57436,7 @@ function require_setProto() {
57447
57436
  var $export$1 = _export;
57448
57437
  $export$1($export$1.S, "Object", { setPrototypeOf: require_setProto().set });
57449
57438
  var setPrototypeOf$1 = _coreExports.Object.setPrototypeOf, setPrototypeOf = { default: setPrototypeOf$1, __esModule: !0 }, $export = _export;
57450
- $export($export.S, "Object", { create: require_objectCreate() });
57439
+ $export($export.S, "Object", { create: _objectCreate });
57451
57440
  var $Object = _coreExports.Object, create$1 = function(g, b) {
57452
57441
  return $Object.create(g, b);
57453
57442
  }, create = { default: create$1, __esModule: !0 };
@@ -65332,23 +65321,31 @@ function PrivateRoute({
65332
65321
  // permission,
65333
65322
  children: m
65334
65323
  }) {
65335
- const g = getCookie("account"), b = useNavigate(), _ = async () => {
65324
+ const g = getCookie("account"), b = async () => {
65336
65325
  try {
65337
65326
  await axios.post("/api/refreshToken");
65338
- } catch (x) {
65339
- console.log(x);
65327
+ } catch (_) {
65328
+ console.log(_);
65340
65329
  }
65341
65330
  };
65342
65331
  return useEffect(() => {
65343
- g === void 0 && b("/testAuth");
65344
- const x = setInterval(() => {
65345
- _();
65332
+ g === void 0 && handleAuth();
65333
+ const _ = setInterval(() => {
65334
+ b();
65346
65335
  }, 28 * 60 * 1e3);
65347
65336
  return () => {
65348
- clearInterval(x);
65337
+ clearInterval(_);
65349
65338
  };
65350
65339
  }, []), /* @__PURE__ */ jsx$2(Fragment$2, { children: m });
65351
65340
  }
65341
+ const handleAuth = async () => {
65342
+ try {
65343
+ const m = await axios.post("/api/auth");
65344
+ m.data.redirectUrl && (window.location.href = m.data.redirectUrl);
65345
+ } catch (m) {
65346
+ console.error("Error during authentication:", m);
65347
+ }
65348
+ };
65352
65349
  export {
65353
65350
  AppContext,
65354
65351
  AppHOC,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "propro-common-components",
3
- "version": "0.1.04",
3
+ "version": "0.1.05",
4
4
  "type": "module",
5
5
  "main": "dist/propro-common-components.js",
6
6
  "types": "dist/main.d.ts",