@declarion/react 0.2.7 → 0.2.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.
@@ -7,6 +7,7 @@ export declare function useAuth(): {
7
7
  login: import("@tanstack/react-query").UseMutateFunction<import("..").LoginResponse, Error, {
8
8
  email: string;
9
9
  password: string;
10
+ remember?: boolean;
10
11
  }, unknown>;
11
12
  signup: import("@tanstack/react-query").UseMutateFunction<import("..").LoginResponse, Error, {
12
13
  email: string;
package/dist-lib/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { $ as e, $t as t, A as n, At as r, B as i, Bt as a, C as o, Ct as s, D as c, Dt as l, E as u, Et as d, F as f, Ft as p, G as m, Gt as h, H as g, Ht as _, I as v, It as y, J as b, Jt as x, K as S, Kt as C, L as w, Lt as T, M as E, Mt as D, N as O, Nt as k, O as A, Ot as j, P as M, Pt as N, Q as P, Qt as F, R as I, Rt as L, S as ee, St as te, T as ne, Tt as re, U as ie, Ut as ae, V as R, Vt as oe, W as se, Wt as ce, X as le, Xt as z, Y as ue, Yt as B, Z as de, Zt as V, _ as fe, _t as pe, a as H, at as me, b as he, bt as ge, c as _e, ct as ve, d as ye, dt as be, et as xe, f as Se, ft as Ce, g as U, gt as W, h as we, ht as Te, i as Ee, it as De, j as Oe, jt as ke, k as Ae, kt as je, l as Me, lt as Ne, m as Pe, mt as Fe, n as Ie, nt as Le, o as Re, ot as ze, p as Be, pt as Ve, q as He, qt as Ue, r as We, rt as Ge, s as Ke, st as qe, t as Je, tt as Ye, u as Xe, ut as Ze, v as Qe, vt as $e, w as et, wt as tt, x as nt, xt as rt, y as it, yt as at, z as ot, zt as st } from "./dataTableStyles-4q9A0Djy.js";
1
+ import { $ as e, $t as t, A as n, At as r, B as i, Bt as a, C as o, Ct as s, D as c, Dt as l, E as u, Et as d, F as f, Ft as p, G as m, Gt as h, H as g, Ht as _, I as v, It as y, J as b, Jt as x, K as S, Kt as C, L as w, Lt as T, M as E, Mt as D, N as O, Nt as k, O as A, Ot as j, P as M, Pt as N, Q as P, Qt as F, R as I, Rt as L, S as ee, St as te, T as ne, Tt as re, U as ie, Ut as ae, V as R, Vt as oe, W as se, Wt as ce, X as le, Xt as z, Y as ue, Yt as B, Z as de, Zt as V, _ as fe, _t as pe, a as H, at as me, b as he, bt as ge, c as _e, ct as ve, d as ye, dt as be, et as xe, f as Se, ft as Ce, g as U, gt as W, h as we, ht as Te, i as Ee, it as De, j as Oe, jt as ke, k as Ae, kt as je, l as Me, lt as Ne, m as Pe, mt as Fe, n as Ie, nt as Le, o as Re, ot as ze, p as Be, pt as Ve, q as He, qt as Ue, r as We, rt as Ge, s as Ke, st as qe, t as Je, tt as Ye, u as Xe, ut as Ze, v as Qe, vt as $e, w as et, wt as tt, x as nt, xt as rt, y as it, yt as at, z as ot, zt as st } from "./dataTableStyles-DVOINYzY.js";
2
2
  import { A as ct, B as lt, C as ut, D as dt, F as ft, H as pt, I as mt, L as ht, M as gt, N as _t, O as vt, P as yt, R as bt, S as xt, T as St, U as Ct, V as wt, W as Tt, _ as Et, a as Dt, b as Ot, j as kt, o as At, s as jt, v as Mt, x as Nt, y as Pt } from "./value-qao1rdkR.js";
3
3
  import { Component as Ft, Fragment as It, Suspense as Lt, createContext as Rt, createElement as zt, lazy as Bt, useCallback as G, useContext as Vt, useEffect as K, useLayoutEffect as Ht, useMemo as q, useRef as J, useState as Y } from "react";
4
4
  import { BrowserRouter as Ut, Link as Wt, Navigate as Gt, Outlet as Kt, Route as qt, Routes as Jt, useLocation as Yt, useLocation as Xt, useNavigate as Zt, useNavigate as Qt, useParams as $t, useParams as en, useSearchParams as tn, useSearchParams as nn } from "react-router-dom";
@@ -1489,7 +1489,7 @@ var $ = {
1489
1489
  //#region src/hooks/useAuth.ts
1490
1490
  function Fr() {
1491
1491
  let { user: e, isAuthenticated: t, isLoading: n, activeTenant: r, tenants: i, setUser: a, setTenants: o, logout: s } = He(), c = Qt(), l = ln(), u = sn({
1492
- mutationFn: ({ email: e, password: t }) => Le(e, t),
1492
+ mutationFn: ({ email: e, password: t, remember: n }) => Le(e, t, n ?? !0),
1493
1493
  onSuccess: (e) => {
1494
1494
  a(e.user, e.tenant), l.invalidateQueries({ queryKey: ["schema"] }), Ye().then(o).catch(() => {});
1495
1495
  }
@@ -6902,39 +6902,40 @@ var Uo = "Invalid email or password.", Wo = "You do not have access to that page
6902
6902
  }
6903
6903
  };
6904
6904
  function Ko() {
6905
- let e = Qt(), [t] = nn(), { login: n, isLoginPending: r, isAuthenticated: i } = Fr(), { data: a } = ti(), { data: o } = S(), [s, c] = Y(""), [l, u] = Y(""), f = Ct(t.get("next") || t.get("redirect")), p = t.get("sso_error"), m = Vo(a?.parameters), { data: h } = cn({
6905
+ let e = Qt(), [t] = nn(), { login: n, isLoginPending: r, isAuthenticated: i } = Fr(), { data: a } = ti(), { data: o } = S(), [s, c] = Y(""), [l, u] = Y(""), [f, p] = Y(!0), m = Ct(t.get("next") || t.get("redirect")), h = t.get("sso_error"), g = Vo(a?.parameters), { data: _ } = cn({
6906
6906
  queryKey: ["check-setup"],
6907
6907
  queryFn: ue
6908
- }), { data: g } = cn({
6908
+ }), { data: v } = cn({
6909
6909
  queryKey: ["sso-providers"],
6910
6910
  queryFn: () => xe(),
6911
6911
  staleTime: 6e4
6912
6912
  });
6913
6913
  K(() => {
6914
- h?.needs_setup && e("/signup", { replace: !0 });
6915
- }, [h, e]), K(() => {
6914
+ _?.needs_setup && e("/signup", { replace: !0 });
6915
+ }, [_, e]), K(() => {
6916
6916
  if (!i || !o) return;
6917
- let t = No(f, o);
6918
- Jo(f, t) && $.warning(Bo(o.messages, "auth.inaccessible_redirect", m, Wo)), e(t, { replace: !0 });
6917
+ let t = No(m, o);
6918
+ Jo(m, t) && $.warning(Bo(o.messages, "auth.inaccessible_redirect", g, Wo)), e(t, { replace: !0 });
6919
6919
  }, [
6920
6920
  i,
6921
- m,
6921
+ g,
6922
6922
  e,
6923
- f,
6923
+ m,
6924
6924
  o
6925
6925
  ]), K(() => {
6926
- p && $.error(p);
6927
- }, [p]);
6928
- function _(e) {
6926
+ h && $.error(h);
6927
+ }, [h]);
6928
+ function y(e) {
6929
6929
  e.preventDefault(), n({
6930
6930
  email: s,
6931
- password: l
6931
+ password: l,
6932
+ remember: f
6932
6933
  }, { onError: (e) => {
6933
- $.error(qo(e, a?.messages, m));
6934
+ $.error(qo(e, a?.messages, g));
6934
6935
  } });
6935
6936
  }
6936
6937
  return /* @__PURE__ */ Z(Oo, { children: /* @__PURE__ */ Q("form", {
6937
- onSubmit: _,
6938
+ onSubmit: y,
6938
6939
  children: [
6939
6940
  /* @__PURE__ */ Z("div", {
6940
6941
  style: {
@@ -6963,14 +6964,14 @@ function Ko() {
6963
6964
  },
6964
6965
  children: "Use your corporate SSO or email & password."
6965
6966
  }),
6966
- g && g.length > 0 && /* @__PURE__ */ Q(X, { children: [/* @__PURE__ */ Z("div", {
6967
+ v && v.length > 0 && /* @__PURE__ */ Q(X, { children: [/* @__PURE__ */ Z("div", {
6967
6968
  style: {
6968
6969
  display: "flex",
6969
6970
  flexDirection: "column",
6970
6971
  gap: 6,
6971
6972
  marginBottom: 12
6972
6973
  },
6973
- children: g.map((e) => {
6974
+ children: v.map((e) => {
6974
6975
  let t = Go[e.slug.toLowerCase()] ?? {
6975
6976
  label: `Continue with ${e.name}`,
6976
6977
  icon: /* @__PURE__ */ Z(F.shield, { size: 13 })
@@ -6983,7 +6984,7 @@ function Ko() {
6983
6984
  },
6984
6985
  icon: t.icon,
6985
6986
  onClick: (t) => {
6986
- t.preventDefault(), window.location.href = De(e.slug, void 0, f);
6987
+ t.preventDefault(), window.location.href = De(e.slug, void 0, m);
6987
6988
  },
6988
6989
  children: t.label
6989
6990
  }, e.slug);
@@ -7066,7 +7067,9 @@ function Ko() {
7066
7067
  },
7067
7068
  children: [/* @__PURE__ */ Z("input", {
7068
7069
  type: "checkbox",
7069
- defaultChecked: !0
7070
+ name: "remember",
7071
+ checked: f,
7072
+ onChange: (e) => p(e.target.checked)
7070
7073
  }), " Keep me signed in on this device"]
7071
7074
  }),
7072
7075
  /* @__PURE__ */ Z(V, {
@@ -16799,7 +16802,7 @@ function pd({ config: e, childEntity: t, schema: n, rows: r, onChange: i, valida
16799
16802
  }
16800
16803
  //#endregion
16801
16804
  //#region src/components/detail-layout/ChildrenBlock.tsx
16802
- var md = Bt(() => import("./DraggableChildrenTable-BKQNXZdc.js").then((e) => ({ default: e.DraggableChildrenTable })));
16805
+ var md = Bt(() => import("./DraggableChildrenTable-CzdhUQ-B.js").then((e) => ({ default: e.DraggableChildrenTable })));
16803
16806
  function hd({ node: e, ctx: t }) {
16804
16807
  let n = e.children;
16805
16808
  if (!n || t.isNew && t.mode !== "edit") return null;
@@ -19162,7 +19165,7 @@ var pf = [
19162
19165
  () => import("./MarkdownRenderer-Dl3GDuY9.js"),
19163
19166
  () => import("./JsonEditor-CexL5HXN.js"),
19164
19167
  () => import("./Grid-pE2-dvug.js"),
19165
- () => import("./DraggableChildrenTable-BKQNXZdc.js")
19168
+ () => import("./DraggableChildrenTable-CzdhUQ-B.js")
19166
19169
  ];
19167
19170
  function mf() {
19168
19171
  for (let e of pf) e().catch(() => {});