@nivaro/react 0.3.60 → 0.3.61

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.
@@ -5,16 +5,16 @@ import { useMemo as y, useState as j } from "react";
5
5
  import { toast as p } from "sonner";
6
6
  import { useNivaroClient as x } from "../../context.js";
7
7
  import { get as A, post as v } from "../../lib/commands.js";
8
- import { errorToastOptions as S } from "../../lib/error-toast.js";
9
- import { userErrorMessage as T } from "../../lib/safe-error.js";
10
- import { cn as B } from "../../lib/utils.js";
11
- import { useAvailableBulkActions as P, guardMatches as D } from "../bulk/BulkActionButtons.js";
8
+ import { errorToastOptions as P } from "../../lib/error-toast.js";
9
+ import { userErrorMessage as S } from "../../lib/safe-error.js";
10
+ import { cn as T } from "../../lib/utils.js";
11
+ import { useAvailableBulkActions as B, guardMatches as D } from "../bulk/BulkActionButtons.js";
12
12
  import { Button as k } from "../ui/button.js";
13
13
  import { Dialog as H, DialogContent as M, DialogHeader as Q, DialogTitle as _, DialogDescription as E, DialogBody as J, DialogFooter as K } from "../ui/dialog.js";
14
14
  import { Textarea as L } from "../ui/textarea.js";
15
15
  import { invalidateRecordQueries as O } from "./RecordLiveSync.js";
16
16
  function de(e, n, t, m = {}) {
17
- const f = x(), h = !!n && n !== "new", { data: u } = P(h ? [e] : []), a = y(
17
+ const f = x(), h = !!n && n !== "new", { data: u } = B(h ? [e] : []), a = y(
18
18
  () => ((u == null ? void 0 : u[e]) ?? []).filter(
19
19
  (r) => r.header === !0 && (r.kind === "update_fields" || r.kind === "transition")
20
20
  ),
@@ -32,7 +32,7 @@ function de(e, n, t, m = {}) {
32
32
  fields: d.join(",")
33
33
  })
34
34
  ).then((r) => r.data ?? {}).catch(() => ({})),
35
- enabled: h && d.length > 0,
35
+ enabled: h && d.length > 0 && m.valuesPending !== !0,
36
36
  staleTime: 0
37
37
  }), c = m.fieldsLocked === !0;
38
38
  return y(() => {
@@ -67,7 +67,7 @@ function ue({
67
67
  "data-record-header-action": t.key,
68
68
  "data-tip": W(t),
69
69
  onClick: () => n(t),
70
- className: B(
70
+ className: T(
71
71
  "shrink-0 gap-1.5 text-[12px]",
72
72
  t.variant === "danger" && "border-red-300 text-red-600 hover:bg-red-50 hover:text-red-700 dark:border-red-500/40 dark:text-red-400 dark:hover:bg-red-500/10"
73
73
  ),
@@ -96,7 +96,7 @@ function le({
96
96
  var o;
97
97
  (o = i.errors) != null && o.length ? p.error(i.errors[0].error) : !i.succeeded && i.skipped ? p.info(`${r.label}: nothing to change on this record`) : p.success(`${r.label} — done`), O(u, n, [t]), u.invalidateQueries({ queryKey: ["record-header-action-guard", n] }), d(""), f == null || f(), m();
98
98
  },
99
- onError: (r) => p.error(T(r, "The action did not run"), S(r))
99
+ onError: (r) => p.error(S(r, "The action did not run"), P(r))
100
100
  });
101
101
  return /* @__PURE__ */ s(
102
102
  H,