react-semaphor 0.0.340 → 0.0.342

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.
@@ -11024,40 +11024,30 @@ function bK() {
11024
11024
  return e;
11025
11025
  }
11026
11026
  function yK({
11027
- children: e,
11028
- isPdfRender: t
11027
+ children: e
11029
11028
  }) {
11030
- const { setIsSessionExpired: n } = nr(), r = bK(), [i] = Ae(() => {
11031
- let o = {};
11032
- t ? o = {
11033
- queries: {
11034
- refetchOnWindowFocus: !1,
11035
- refetchOnReconnect: !1,
11036
- refetchOnMount: !1,
11037
- staleTime: 1 / 0
11038
- }
11039
- } : o = {
11040
- queries: {
11041
- gcTime: 1e3 * 60 * 60,
11042
- // 1 hour
11043
- staleTime: 1e3 * 60 * 5,
11044
- // 5 minutes
11045
- refetchOnWindowFocus: !1,
11046
- retry: 1
11047
- // retry once
11048
- }
11049
- };
11050
- const s = new eK({
11029
+ const { setIsSessionExpired: t } = nr(), n = bK(), [r] = Ae(() => {
11030
+ const i = new eK({
11051
11031
  queryCache: new fN({
11052
- onError: (a) => {
11053
- a instanceof Error ? (console.error(`Something went wrong: ${a.message}`), a.message === "invalid token" && n(!0)) : console.error("Something went wrong:", a);
11032
+ onError: (o) => {
11033
+ o instanceof Error ? (console.error(`Something went wrong: ${o.message}`), o.message === "invalid token" && t(!0)) : console.error("Something went wrong:", o);
11054
11034
  }
11055
11035
  }),
11056
- defaultOptions: o
11036
+ defaultOptions: {
11037
+ queries: {
11038
+ gcTime: 36e5,
11039
+ // 1 hour
11040
+ staleTime: 3e5,
11041
+ // 5 minutes
11042
+ refetchOnWindowFocus: !1,
11043
+ retry: 1
11044
+ // retry once
11045
+ }
11046
+ }
11057
11047
  });
11058
- return s.isSemaphorClient = !0, s;
11048
+ return i.isSemaphorClient = !0, i;
11059
11049
  });
11060
- return r ? /* @__PURE__ */ y.jsx(y.Fragment, { children: e }) : /* @__PURE__ */ y.jsx(iK, { client: i, children: e });
11050
+ return n ? /* @__PURE__ */ y.jsx(y.Fragment, { children: e }) : /* @__PURE__ */ y.jsx(iK, { client: r, children: e });
11061
11051
  }
11062
11052
  const Fc = Kn(({ children: e, className: t, ...n }, r) => /* @__PURE__ */ y.jsx("div", { className: be("semaphor-scope", t), ref: r, ...n, children: e })), vK = {
11063
11053
  id: "",
@@ -11065,10 +11055,7 @@ const Fc = Kn(({ children: e, className: t, ...n }, r) => /* @__PURE__ */ y.jsx(
11065
11055
  }, mN = mn(vK), xK = ({
11066
11056
  children: e,
11067
11057
  dashboardProps: t
11068
- }) => {
11069
- const { isPdfRender: n } = t;
11070
- return /* @__PURE__ */ y.jsx(yK, { isPdfRender: n, children: /* @__PURE__ */ y.jsx(mN.Provider, { value: t, children: /* @__PURE__ */ y.jsx(Fc, { style: { height: "100%" }, children: e }) }) });
11071
- };
11058
+ }) => /* @__PURE__ */ y.jsx(yK, { children: /* @__PURE__ */ y.jsx(mN.Provider, { value: t, children: /* @__PURE__ */ y.jsx(Fc, { style: { height: "100%" }, children: e }) }) });
11072
11059
  function xo() {
11073
11060
  const e = Yt(mN);
11074
11061
  if (e === void 0)
@@ -11285,10 +11272,9 @@ function EK({
11285
11272
  showAssistant: p,
11286
11273
  defaultFilterValues: h,
11287
11274
  onFilterValuesChange: m,
11288
- isPdfRender: b,
11289
- ...v
11275
+ ...b
11290
11276
  }) {
11291
- const { placeholders: x } = xo(), S = ve((M) => M.themeStyle), _ = ve((M) => M.isSessionExpired), { isLoading: E, isError: C } = _K({
11277
+ const { placeholders: v } = xo(), x = ve((C) => C.themeStyle), S = ve((C) => C.isSessionExpired), { isLoading: _, isError: E } = _K({
11292
11278
  // id,
11293
11279
  // version,
11294
11280
  authToken: l,
@@ -11299,10 +11285,10 @@ function EK({
11299
11285
  defaultFilterValues: h,
11300
11286
  onFilterValuesChange: m
11301
11287
  });
11302
- return E || !l ? (r == null || r({
11288
+ return _ || !l ? (r == null || r({
11303
11289
  type: "info",
11304
11290
  message: "Loading dashboard"
11305
- }), i ? /* @__PURE__ */ y.jsx(i, { message: "loading" }) : /* @__PURE__ */ y.jsx("div", { className: "flex items-center gap-3", children: /* @__PURE__ */ y.jsx(Nu, { className: "h-1 w-full dark:h-[2px]" }) })) : C ? (r == null || r({ type: "error", message: "Error fetching dashboard" }), o ? (console.log("Error fetching dashboard"), /* @__PURE__ */ y.jsx(o, {})) : /* @__PURE__ */ y.jsx("div", { children: "Error" })) : _ ? (r == null || r({ type: "error", message: "Session Expired" }), x != null && x.SessionExpired ? /* @__PURE__ */ y.jsx("div", { className: "flex h-full items-center justify-center", children: /* @__PURE__ */ y.jsx("div", { children: x.SessionExpired }) }) : /* @__PURE__ */ y.jsx("div", { className: "flex h-full items-center justify-center", children: /* @__PURE__ */ y.jsxs("div", { className: "space-y-4 rounded-md border border-muted p-10", children: [
11291
+ }), i ? /* @__PURE__ */ y.jsx(i, { message: "loading" }) : /* @__PURE__ */ y.jsx("div", { className: "flex items-center gap-3", children: /* @__PURE__ */ y.jsx(Nu, { className: "h-1 w-full dark:h-[2px]" }) })) : E ? (r == null || r({ type: "error", message: "Error fetching dashboard" }), o ? (console.log("Error fetching dashboard"), /* @__PURE__ */ y.jsx(o, {})) : /* @__PURE__ */ y.jsx("div", { children: "Error" })) : S ? (r == null || r({ type: "error", message: "Session Expired" }), v != null && v.SessionExpired ? /* @__PURE__ */ y.jsx("div", { className: "flex h-full items-center justify-center", children: /* @__PURE__ */ y.jsx("div", { children: v.SessionExpired }) }) : /* @__PURE__ */ y.jsx("div", { className: "flex h-full items-center justify-center", children: /* @__PURE__ */ y.jsxs("div", { className: "space-y-4 rounded-md border border-muted p-10", children: [
11306
11292
  /* @__PURE__ */ y.jsx(Sp, { children: "Session Expired" }),
11307
11293
  /* @__PURE__ */ y.jsx("p", { className: "text-muted-foreground", children: "Please refresh your page to continue." })
11308
11294
  ] }) })) : /* @__PURE__ */ y.jsx(
@@ -11310,14 +11296,14 @@ function EK({
11310
11296
  {
11311
11297
  className: be(
11312
11298
  "flex h-full flex-col justify-between",
11313
- S == null ? void 0 : S.dashboardPanel,
11299
+ x == null ? void 0 : x.dashboardPanel,
11314
11300
  e
11315
11301
  ),
11316
11302
  style: {
11317
11303
  // fontFamily: currentStyle?.chart?.font?.family,
11318
11304
  },
11319
11305
  role: "dashboard-panel",
11320
- ...v
11306
+ ...b
11321
11307
  }
11322
11308
  );
11323
11309
  }
@@ -16728,6 +16714,25 @@ const bi = Uk()(
16728
16714
  activeCardId: ""
16729
16715
  },
16730
16716
  actions: {
16717
+ updateCardTab: (n, r) => {
16718
+ e((i) => {
16719
+ const o = i.frame, s = {
16720
+ ...o,
16721
+ cards: o.cards.map((l) => l.id === r.id ? r : l),
16722
+ activeCardId: n
16723
+ };
16724
+ i.frame = s;
16725
+ const a = s.cards.find(
16726
+ (l) => l.id === n
16727
+ );
16728
+ i.card = a;
16729
+ });
16730
+ },
16731
+ setActiveTabCardId: (n) => {
16732
+ e((r) => {
16733
+ r.activeTabCardId = n;
16734
+ });
16735
+ },
16731
16736
  setCustomCardPreferences: (n) => {
16732
16737
  e((r) => {
16733
16738
  r.card.customCardPreferences = n;
@@ -60940,8 +60945,7 @@ const jMe = {
60940
60945
  onSave: "function",
60941
60946
  LoadingComponent: "function",
60942
60947
  ErrorComponent: "function",
60943
- showAssistant: "boolean",
60944
- isPdfRender: "boolean"
60948
+ showAssistant: "boolean"
60945
60949
  }, $Te = FMe(KEe, {
60946
60950
  props: jMe
60947
60951
  });
@@ -60975,7 +60979,7 @@ export {
60975
60979
  uRe as Z,
60976
60980
  dRe as _,
60977
60981
  Rp as a,
60978
- gde as a$,
60982
+ FL as a$,
60979
60983
  cRe as a0,
60980
60984
  be as a1,
60981
60985
  VJ as a2,
@@ -60995,24 +60999,24 @@ export {
60995
60999
  jY as aG,
60996
61000
  pN as aH,
60997
61001
  NTe as aI,
60998
- Sc as aJ,
60999
- Cr as aK,
61000
- iee as aL,
61001
- LTe as aM,
61002
- SEe as aN,
61003
- bk as aO,
61004
- HMe as aP,
61005
- RTe as aQ,
61006
- TY as aR,
61007
- oZ as aS,
61008
- rZ as aT,
61009
- Sde as aU,
61010
- kL as aV,
61011
- mb as aW,
61012
- LL as aX,
61013
- gA as aY,
61014
- NL as aZ,
61015
- FL as a_,
61002
+ OC as aJ,
61003
+ Sc as aK,
61004
+ Cr as aL,
61005
+ iee as aM,
61006
+ LTe as aN,
61007
+ SEe as aO,
61008
+ bk as aP,
61009
+ HMe as aQ,
61010
+ RTe as aR,
61011
+ TY as aS,
61012
+ oZ as aT,
61013
+ rZ as aU,
61014
+ Sde as aV,
61015
+ kL as aW,
61016
+ mb as aX,
61017
+ LL as aY,
61018
+ gA as aZ,
61019
+ NL as a_,
61016
61020
  Oa as aa,
61017
61021
  Ws as ab,
61018
61022
  Da as ac,
@@ -61041,11 +61045,11 @@ export {
61041
61045
  VMe as az,
61042
61046
  DC as b,
61043
61047
  xRe as b$,
61044
- bde as b0,
61045
- yde as b1,
61046
- Zq as b2,
61047
- xhe as b3,
61048
- OC as b4,
61048
+ gde as b0,
61049
+ bde as b1,
61050
+ yde as b2,
61051
+ Zq as b3,
61052
+ xhe as b4,
61049
61053
  whe as b5,
61050
61054
  mle as b6,
61051
61055
  k3 as b7,