@nivaro/react 0.3.103 → 0.3.105

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.
Files changed (28) hide show
  1. package/dist/full.css +1 -1
  2. package/dist/hooks/useSessionRecorder.js +1 -1
  3. package/dist/index.d.ts +15 -3
  4. package/dist/shared/components/CollectionBrowserView.js +1694 -1639
  5. package/dist/shared/components/ItemEditForm.js +2867 -2845
  6. package/dist/shared/components/imports/CollectionImportPanel.js +483 -459
  7. package/dist/shared/components/integrations/IntegrationStatusLines.js +71 -68
  8. package/dist/shared/components/item-edit/InlineTableField.js +88 -88
  9. package/dist/shared/components/item-edit/UserChip.js +38 -38
  10. package/dist/shared/components/layout-editor/DesignNode.js +16 -14
  11. package/dist/shared/components/layout-editor/LayoutEditor.js +445 -441
  12. package/dist/shared/components/layout-editor/inspector/Inspector.js +18 -18
  13. package/dist/shared/components/layout-editor/inspector/SlotInspector.js +80 -52
  14. package/dist/shared/components/layout-editor/parity-keys.json.js +1 -1
  15. package/dist/shared/components/layout-editor/settings/ButtonsSection.js +54 -26
  16. package/dist/shared/components/layout-editor/settings/settings-registry.js +23 -15
  17. package/dist/shared/components/layout-editor/useLayoutDraft.js +211 -196
  18. package/dist/shared/components/panels/ExternalRequestsChip.js +141 -122
  19. package/dist/shared/components/quick-filters/QuickFilterBarEditor.js +334 -0
  20. package/dist/shared/components/quick-filters/QuickFilterFieldPicker.js +151 -0
  21. package/dist/shared/components/quick-filters/QuickFilterForm.js +371 -0
  22. package/dist/shared/components/quick-filters/config.js +63 -0
  23. package/dist/shared/components/quick-filters/facets.js +55 -0
  24. package/dist/shared/components/quick-filters/useQuickFilterEditing.js +95 -0
  25. package/dist/shared/lib/entry-config.js +7 -7
  26. package/dist/shared/lib/integration-chip.js +10 -6
  27. package/dist/shared/lib/owners-header-tile.js +63 -0
  28. package/package.json +1 -1
@@ -1,34 +1,34 @@
1
- import { jsx as n, jsxs as u } from "react/jsx-runtime";
1
+ import { jsx as o, jsxs as u } from "react/jsx-runtime";
2
2
  import { useQuery as V, useQueryClient as w, useMutation as B } from "@tanstack/react-query";
3
3
  import { RotateCcw as F, RefreshCw as v, Eye as L, Loader2 as Q, Send as T } from "lucide-react";
4
4
  import { useState as A } from "react";
5
5
  import { toast as y } from "sonner";
6
6
  import { useNivaroClient as S } from "../../context.js";
7
- import { get as K, post as P } from "../../lib/commands.js";
8
- import { bannerLines as D } from "../../lib/obligation-banner.js";
9
- import { requestTransitionRun as E } from "../../lib/run-transition.js";
7
+ import { get as I, post as K } from "../../lib/commands.js";
8
+ import { bannerLines as P } from "../../lib/obligation-banner.js";
9
+ import { requestTransitionRun as D } from "../../lib/run-transition.js";
10
10
  import { cn as f } from "../../lib/utils.js";
11
- import { colorPair as I } from "../QueryTable.js";
11
+ import { colorPair as E } from "../QueryTable.js";
12
12
  import { roleForTone as O } from "./IntegrationObligationsView.js";
13
13
  import { SendCurrentDataButton as M } from "./SendCurrentData.js";
14
14
  function U({
15
15
  obligationId: d,
16
16
  collection: i,
17
17
  itemId: m,
18
- enabled: o = !0
18
+ enabled: r = !0
19
19
  }) {
20
- const e = S(), b = w(), [r, c] = A(!1), s = B({
20
+ const e = S(), b = w(), [t, c] = A(!1), l = B({
21
21
  mutationFn: () => e.request(
22
- P(`/integration-obligations/${d}/send`)
22
+ K(`/integration-obligations/${d}/send`)
23
23
  ),
24
- onSuccess: (l) => {
24
+ onSuccess: (s) => {
25
25
  var a;
26
- y.message(((a = l == null ? void 0 : l.data) == null ? void 0 : a.detail) ?? "Sent"), b.invalidateQueries({
26
+ y.message(((a = s == null ? void 0 : s.data) == null ? void 0 : a.detail) ?? "Sent"), b.invalidateQueries({
27
27
  queryKey: ["integration-obligations", "record", i, String(m)]
28
28
  });
29
29
  },
30
- onError: (l) => {
31
- const a = l == null ? void 0 : l.response;
30
+ onError: (s) => {
31
+ const a = s == null ? void 0 : s.response;
32
32
  y.error((a == null ? void 0 : a.error) ?? "Send now failed", { duration: 8e3 });
33
33
  },
34
34
  onSettled: () => c(!1)
@@ -38,33 +38,33 @@ function U({
38
38
  {
39
39
  type: "button",
40
40
  "data-obligation-send-now": !0,
41
- "data-obligation-send-now-enabled": o,
42
- disabled: s.isPending || !o,
43
- title: o ? "Send the stored request again, unchanged (admins)" : "Remediation is off for this deployment — an admin turns it on under Integrations › Remediation, then this sends from here",
41
+ "data-obligation-send-now-enabled": r,
42
+ disabled: l.isPending || !r,
43
+ title: r ? "Send the stored request again, unchanged (admins)" : "Remediation is off for this deployment — an admin turns it on under Integrations › Remediation, then this sends from here",
44
44
  onClick: () => {
45
- if (!r) {
45
+ if (!t) {
46
46
  c(!0);
47
47
  return;
48
48
  }
49
- s.mutate();
49
+ l.mutate();
50
50
  },
51
51
  className: f(
52
52
  "inline-flex shrink-0 items-center gap-1 rounded-full border px-2 py-0.5 text-[10.5px] font-medium transition-colors disabled:opacity-60",
53
- r ? "border-nvr-cyan bg-nvr-cyan/10 text-nvr-cyan dark:border-nvr-cyan dark:bg-nvr-cyan/15" : "border-slate-200 text-slate-500 hover:border-slate-300 hover:bg-slate-50 dark:border-border dark:text-muted-foreground dark:hover:bg-muted"
53
+ t ? "border-nvr-cyan bg-nvr-cyan/10 text-nvr-cyan dark:border-nvr-cyan dark:bg-nvr-cyan/15" : "border-slate-200 text-slate-500 hover:border-slate-300 hover:bg-slate-50 dark:border-border dark:text-muted-foreground dark:hover:bg-muted"
54
54
  ),
55
55
  children: [
56
- s.isPending ? /* @__PURE__ */ n(Q, { className: "h-3 w-3 animate-spin" }) : /* @__PURE__ */ n(T, { className: "h-3 w-3" }),
57
- r ? "Confirm send?" : "Send now"
56
+ l.isPending ? /* @__PURE__ */ o(Q, { className: "h-3 w-3 animate-spin" }) : /* @__PURE__ */ o(T, { className: "h-3 w-3" }),
57
+ t ? "Confirm send?" : "Send now"
58
58
  ]
59
59
  }
60
60
  );
61
61
  }
62
62
  function ae(d, i) {
63
- var e, b;
64
- const m = S(), o = V({
63
+ var e, b, t;
64
+ const m = S(), r = V({
65
65
  queryKey: ["integration-obligations", "record", d, String(i)],
66
66
  queryFn: () => m.request(
67
- K(`/integration-obligations/record/${d}/${encodeURIComponent(String(i))}`)
67
+ I(`/integration-obligations/record/${d}/${encodeURIComponent(String(i))}`)
68
68
  ),
69
69
  enabled: !!d && !!i,
70
70
  staleTime: 3e4,
@@ -73,9 +73,12 @@ function ae(d, i) {
73
73
  retry: !1
74
74
  });
75
75
  return {
76
- ...o,
77
- lines: D(((e = o.data) == null ? void 0 : e.data) ?? []),
78
- remediationEnabled: ((b = o.data) == null ? void 0 : b.remediation_enabled) === !0
76
+ ...r,
77
+ lines: P(((e = r.data) == null ? void 0 : e.data) ?? []),
78
+ remediationEnabled: ((b = r.data) == null ? void 0 : b.remediation_enabled) === !0,
79
+ /** Obligation rows on the record (null until answered). */
80
+ obligationCount: r.data ? (r.data.data ?? []).length : null,
81
+ partnerIntegration: (t = r.data) == null ? void 0 : t.partner_integration
79
82
  };
80
83
  }
81
84
  const h = "inline-flex shrink-0 items-center gap-1 rounded-full border border-slate-200 px-2 py-0.5 text-[10.5px] font-medium text-slate-600 transition-colors hover:border-slate-300 hover:bg-slate-50 disabled:opacity-60 dark:border-border dark:text-muted-foreground dark:hover:bg-muted";
@@ -83,20 +86,20 @@ function de({
83
86
  collection: d,
84
87
  itemId: i,
85
88
  lines: m,
86
- remediationEnabled: o,
89
+ remediationEnabled: r,
87
90
  actions: e
88
91
  }) {
89
92
  const b = w();
90
- return m.length === 0 ? null : /* @__PURE__ */ n("div", { className: "space-y-1.5", "data-integration-lines": !0, children: m.map((r) => {
93
+ return m.length === 0 ? null : /* @__PURE__ */ o("div", { className: "space-y-1.5", "data-integration-lines": !0, children: m.map((t) => {
91
94
  var k;
92
- const c = O(r.tone), [s, l] = c ? I(c) : [null, null], a = r.outcome === "failed" || r.outcome === "missing" || r.outcome === "overdue", N = a && r.can_resend !== !1, C = a && r.can_send_current === !0, g = (k = e == null ? void 0 : e.newestSubmissionByApi) == null ? void 0 : k.get(r.api.toLowerCase()), p = r.submission_id ?? (g == null ? void 0 : g.id) ?? null, q = !!(e != null && e.onRetry) && p != null && (r.outcome === "failed" || (g == null ? void 0 : g.status) === "failed"), R = !!(e != null && e.onView) && p != null, _ = !!r.transition_id && !!r.transition_label && a, $ = !!(e != null && e.onCheck) && (r.outcome === "pending" || r.outcome === "overdue"), j = () => {
95
+ const c = O(t.tone), [l, s] = c ? E(c) : [null, null], a = t.outcome === "failed" || t.outcome === "missing" || t.outcome === "overdue", C = a && t.can_resend !== !1, N = a && t.can_send_current === !0, g = (k = e == null ? void 0 : e.newestSubmissionByApi) == null ? void 0 : k.get(t.api.toLowerCase()), p = t.submission_id ?? (g == null ? void 0 : g.id) ?? null, _ = !!(e != null && e.onRetry) && p != null && (t.outcome === "failed" || (g == null ? void 0 : g.status) === "failed"), q = !!(e != null && e.onView) && p != null, R = !!t.transition_id && !!t.transition_label && a, $ = !!(e != null && e.onCheck) && (t.outcome === "pending" || t.outcome === "overdue"), j = () => {
93
96
  var x;
94
- if (!E({
97
+ if (!D({
95
98
  collection: d,
96
99
  item: String(i),
97
- transition_id: r.transition_id
100
+ transition_id: t.transition_id
98
101
  })) {
99
- y.error(`Open the record to run “${r.transition_label}”`);
102
+ y.error(`Open the record to run “${t.transition_label}”`);
100
103
  return;
101
104
  }
102
105
  (x = e == null ? void 0 : e.onRanTransition) == null || x.call(e);
@@ -104,68 +107,68 @@ function de({
104
107
  return /* @__PURE__ */ u(
105
108
  "div",
106
109
  {
107
- "data-integration-line": r.api,
108
- "data-integration-outcome": r.outcome,
109
- style: s ? { "--obt": s, "--obtd": l } : void 0,
110
+ "data-integration-line": t.api,
111
+ "data-integration-outcome": t.outcome,
112
+ style: l ? { "--obt": l, "--obtd": s } : void 0,
110
113
  className: f(
111
114
  "flex items-start gap-2 rounded-lg border border-slate-200 bg-white px-3 py-1.5 text-[12px] dark:border-border dark:bg-card",
112
- s && "border-t-2 border-t-[color:var(--obt)] dark:border-t-[color:var(--obtd)]"
115
+ l && "border-t-2 border-t-[color:var(--obt)] dark:border-t-[color:var(--obtd)]"
113
116
  ),
114
117
  children: [
115
- /* @__PURE__ */ n(
118
+ /* @__PURE__ */ o(
116
119
  "span",
117
120
  {
118
121
  "aria-hidden": !0,
119
122
  className: f(
120
123
  "mt-1 h-1.5 w-1.5 shrink-0 rounded-full",
121
- s ? "bg-[color:var(--obt)] dark:bg-[color:var(--obtd)]" : "bg-slate-400 dark:bg-slate-600"
124
+ l ? "bg-[color:var(--obt)] dark:bg-[color:var(--obtd)]" : "bg-slate-400 dark:bg-slate-600"
122
125
  )
123
126
  }
124
127
  ),
125
128
  /* @__PURE__ */ u("p", { className: "min-w-0 flex-1 leading-5 text-slate-700 dark:text-slate-200", children: [
126
129
  /* @__PURE__ */ u("span", { className: "font-semibold text-slate-800 dark:text-foreground", children: [
127
- r.api,
130
+ t.api,
128
131
  ":"
129
132
  ] }),
130
133
  " ",
131
- /* @__PURE__ */ n(
134
+ /* @__PURE__ */ o(
132
135
  "span",
133
136
  {
134
137
  "data-integration-reason": !0,
135
- className: s ? "text-[color:var(--obt)] dark:text-[color:var(--obtd)]" : "text-slate-500 dark:text-muted-foreground",
136
- children: r.text
138
+ className: l ? "text-[color:var(--obt)] dark:text-[color:var(--obtd)]" : "text-slate-500 dark:text-muted-foreground",
139
+ children: t.text
137
140
  }
138
141
  )
139
142
  ] }),
140
143
  /* @__PURE__ */ u("span", { className: "ml-auto flex shrink-0 flex-wrap items-center justify-end gap-1", children: [
141
- _ && /* @__PURE__ */ u(
144
+ R && /* @__PURE__ */ u(
142
145
  "button",
143
146
  {
144
147
  type: "button",
145
148
  "data-integration-action": "rerun",
146
149
  onClick: j,
147
- title: `Fix what ${r.api} rejected, then run “${r.transition_label}” again — it re-sends from the current values`,
150
+ title: `Fix what ${t.api} rejected, then run “${t.transition_label}” again — it re-sends from the current values`,
148
151
  className: f(h, "border-nvr-cyan/40 text-nvr-cyan hover:bg-nvr-cyan/10"),
149
152
  children: [
150
- /* @__PURE__ */ n(F, { className: "h-3 w-3" }),
153
+ /* @__PURE__ */ o(F, { className: "h-3 w-3" }),
151
154
  "Re-run ",
152
- r.transition_label
155
+ t.transition_label
153
156
  ]
154
157
  }
155
158
  ),
156
- q && /* @__PURE__ */ u(
159
+ _ && /* @__PURE__ */ u(
157
160
  "button",
158
161
  {
159
162
  type: "button",
160
163
  "data-integration-action": "retry",
161
164
  onClick: () => {
162
- var t;
163
- return (t = e == null ? void 0 : e.onRetry) == null ? void 0 : t.call(e, p);
165
+ var n;
166
+ return (n = e == null ? void 0 : e.onRetry) == null ? void 0 : n.call(e, p);
164
167
  },
165
168
  title: "Send the same request again, unchanged — for a partner that was down, not for data it rejected",
166
169
  className: h,
167
170
  children: [
168
- /* @__PURE__ */ n(v, { className: "h-3 w-3" }),
171
+ /* @__PURE__ */ o(v, { className: "h-3 w-3" }),
169
172
  "Retry"
170
173
  ]
171
174
  }
@@ -176,61 +179,61 @@ function de({
176
179
  type: "button",
177
180
  "data-integration-action": "check",
178
181
  onClick: () => {
179
- var t;
180
- return (t = e == null ? void 0 : e.onCheck) == null ? void 0 : t.call(e);
182
+ var n;
183
+ return (n = e == null ? void 0 : e.onCheck) == null ? void 0 : n.call(e);
181
184
  },
182
185
  title: "Ask again whether the partner has acknowledged it",
183
186
  className: h,
184
187
  children: [
185
- /* @__PURE__ */ n(v, { className: "h-3 w-3" }),
188
+ /* @__PURE__ */ o(v, { className: "h-3 w-3" }),
186
189
  "Check now"
187
190
  ]
188
191
  }
189
192
  ),
190
- R && /* @__PURE__ */ u(
193
+ q && /* @__PURE__ */ u(
191
194
  "button",
192
195
  {
193
196
  type: "button",
194
197
  "data-integration-action": "view",
195
198
  onClick: () => {
196
- var t;
197
- return (t = e == null ? void 0 : e.onView) == null ? void 0 : t.call(e, p);
199
+ var n;
200
+ return (n = e == null ? void 0 : e.onView) == null ? void 0 : n.call(e, p);
198
201
  },
199
202
  title: "Show the request and the reply",
200
203
  className: h,
201
204
  children: [
202
- /* @__PURE__ */ n(L, { className: "h-3 w-3" }),
203
- r.outcome === "failed" ? "View error" : "View request"
205
+ /* @__PURE__ */ o(L, { className: "h-3 w-3" }),
206
+ t.outcome === "failed" ? "View error" : "View request"
204
207
  ]
205
208
  }
206
209
  ),
207
- N && /* @__PURE__ */ n(
210
+ C && /* @__PURE__ */ o(
208
211
  U,
209
212
  {
210
- obligationId: r.obligation_id,
213
+ obligationId: t.obligation_id,
211
214
  collection: d,
212
215
  itemId: i,
213
- enabled: o
216
+ enabled: r
214
217
  }
215
218
  ),
216
- C && /* @__PURE__ */ n(
219
+ N && /* @__PURE__ */ o(
217
220
  M,
218
221
  {
219
- obligationId: r.obligation_id,
220
- api: r.api,
221
- enabled: o,
222
+ obligationId: t.obligation_id,
223
+ api: t.api,
224
+ enabled: r,
222
225
  onSent: () => {
223
- var t;
226
+ var n;
224
227
  b.invalidateQueries({
225
228
  queryKey: ["integration-obligations", "record", d, String(i)]
226
- }), (t = e == null ? void 0 : e.onCheck) == null || t.call(e);
229
+ }), (n = e == null ? void 0 : e.onCheck) == null || n.call(e);
227
230
  }
228
231
  }
229
232
  )
230
233
  ] })
231
234
  ]
232
235
  },
233
- r.api
236
+ t.api
234
237
  );
235
238
  }) });
236
239
  }