@nivaro/react 0.3.56 → 0.3.58

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 (55) hide show
  1. package/dist/full.css +1 -1
  2. package/dist/hooks/useSessionRecorder.js +1 -1
  3. package/dist/index.d.ts +9 -2
  4. package/dist/shared/components/CollectionBrowserView.js +2827 -2750
  5. package/dist/shared/components/DataTable.js +247 -236
  6. package/dist/shared/components/ItemEditForm.js +1693 -1668
  7. package/dist/shared/components/ProfileView.js +716 -715
  8. package/dist/shared/components/RecordReadView.js +367 -364
  9. package/dist/shared/components/ReportView.js +64 -39
  10. package/dist/shared/components/alerts/AlertManagerView.js +284 -271
  11. package/dist/shared/components/cbv/row-focus.js +19 -0
  12. package/dist/shared/components/help-videos/HelpVideoPlayer.js +152 -147
  13. package/dist/shared/components/integrations/console/SignalCard.js +59 -59
  14. package/dist/shared/components/integrations/console/tone.js +52 -30
  15. package/dist/shared/components/item-edit/CatalogPickerField.js +525 -505
  16. package/dist/shared/components/item-edit/FieldRow.js +175 -173
  17. package/dist/shared/components/item-edit/InlineTableField.js +407 -402
  18. package/dist/shared/components/item-edit/M2MCombobox.js +313 -291
  19. package/dist/shared/components/item-edit/MidairCollisionDialog.js +1 -1
  20. package/dist/shared/components/item-edit/PlanGrid.js +826 -803
  21. package/dist/shared/components/item-edit/QuickCreateButton.js +115 -79
  22. package/dist/shared/components/item-edit/RecordLiveSync.js +77 -75
  23. package/dist/shared/components/item-edit/RelationCombobox.js +412 -328
  24. package/dist/shared/components/item-edit/RelationGroupedCombobox.js +147 -125
  25. package/dist/shared/components/item-edit/SummaryPanel.js +406 -392
  26. package/dist/shared/components/item-edit/option-disambiguate.js +44 -32
  27. package/dist/shared/components/item-edit/related-missing.js +45 -0
  28. package/dist/shared/components/item-edit/save-outcome.js +5 -5
  29. package/dist/shared/components/notifications/NotificationRulesEditor.js +130 -123
  30. package/dist/shared/components/panels/AccessDeniedPanel.js +52 -48
  31. package/dist/shared/components/panels/ItemLockBanner.js +2 -3
  32. package/dist/shared/components/panels/PipelinePanel.js +1027 -978
  33. package/dist/shared/components/panels/RevisionsPanel.js +4 -1
  34. package/dist/shared/components/panels/TaskPanel.js +265 -249
  35. package/dist/shared/components/panels/landing-state.js +27 -0
  36. package/dist/shared/components/pipeline/PipelineEditorView.js +86 -78
  37. package/dist/shared/components/profile/AiMemoryCard.js +12 -10
  38. package/dist/shared/components/queue/OwnerAvatars.js +80 -41
  39. package/dist/shared/components/queue/QueueItemSheet.js +111 -111
  40. package/dist/shared/components/queue/QueueQuickFilters.js +48 -48
  41. package/dist/shared/components/queue/QueueWorklist.js +975 -964
  42. package/dist/shared/components/queue/group-sums.js +27 -0
  43. package/dist/shared/components/queue/live-state-aspect.js +7 -3
  44. package/dist/shared/components/queue/path-label.js +14 -0
  45. package/dist/shared/components/widgets/ReviewListWidget.js +186 -168
  46. package/dist/shared/lib/back-closes.js +25 -0
  47. package/dist/shared/lib/cbv-page-warm.js +36 -0
  48. package/dist/shared/lib/form-usage-beacon.js +7 -7
  49. package/dist/shared/lib/list-page-memory.js +41 -0
  50. package/dist/shared/lib/live.js +44 -44
  51. package/dist/shared/lib/own-writes.js +76 -28
  52. package/dist/shared/lib/record-ref.js +78 -53
  53. package/dist/shared/lib/request-gate.js +110 -109
  54. package/dist/shared/lib/validation-rules.js +34 -19
  55. package/package.json +1 -1
@@ -69,7 +69,27 @@ const Ce = (t) => Math.abs(t) >= 1e9 ? `${(t / 1e9).toFixed(1).replace(/\.0$/, "
69
69
  }), Ia = (t) => {
70
70
  const n = String(t ?? "");
71
71
  return n.length > 22 ? `${n.slice(0, 21)}…` : n;
72
- }, Ot = () => import("./ReportEditMode.js"), el = Rt(() => Ot().then((t) => ({ default: t.AddWidgetBar }))), tl = Rt(() => Ot().then((t) => ({ default: t.WidgetConfigSheet }))), al = Rt(() => Ot().then((t) => ({ default: t.WidgetEditBar }))), Ge = "rgb(var(--nvr-cyan-rgb, 0 206 255))", oe = [Ge, "#172940", "#10b981", "#f59e0b", "#8b5cf6", "#ef4444", "#64748b"], ll = [
72
+ }, Ot = () => import("./ReportEditMode.js"), el = Rt(() => Ot().then((t) => ({ default: t.AddWidgetBar }))), tl = Rt(() => Ot().then((t) => ({ default: t.WidgetConfigSheet }))), al = Rt(() => Ot().then((t) => ({ default: t.WidgetEditBar }))), Ge = "rgb(var(--nvr-cyan-rgb, 0 206 255))", oe = [
73
+ Ge,
74
+ "#4f7cac",
75
+ // steel blue
76
+ "#c2703d",
77
+ // copper
78
+ "#6b9a5b",
79
+ // sage
80
+ "#c4525a",
81
+ // soft red
82
+ "#8a6fb0",
83
+ // dusty violet
84
+ "#7a8699",
85
+ // slate
86
+ "#b5658e",
87
+ // rose
88
+ "#5f7f3a",
89
+ // olive
90
+ "#9c7b56"
91
+ // tan
92
+ ], ll = [
73
93
  { id: "", label: "All time" },
74
94
  { id: "this_month", label: "This month" },
75
95
  { id: "last_30_days", label: "Last 30 days" },
@@ -208,8 +228,10 @@ function sa(t) {
208
228
  return null;
209
229
  }
210
230
  }
231
+ const rl = "No workflow number", nl = /^undefined-\d+$/;
211
232
  function je(t, n, a) {
212
233
  if (t == null || t === "") return "—";
234
+ if (typeof t == "string" && nl.test(t)) return rl;
213
235
  if (n === "date" || n === "datetime") {
214
236
  const m = new Date(String(t));
215
237
  if (Number.isNaN(m.getTime())) return String(t);
@@ -252,12 +274,12 @@ function ia(t, n, a) {
252
274
  }
253
275
  return o;
254
276
  }
255
- const rl = (t) => `$${Ce(Math.round(t))}`, nl = [
277
+ const sl = (t) => `$${Ce(Math.round(t))}`, il = [
256
278
  { gte: 90, color: "#ef4444" },
257
279
  { gte: 70, color: "#f59e0b" },
258
280
  { gte: -1 / 0, color: "#10b981" }
259
281
  ];
260
- function sl({
282
+ function ol({
261
283
  rows: t,
262
284
  cfg: n,
263
285
  onDrill: a
@@ -282,7 +304,7 @@ function sl({
282
304
  };
283
305
  N(m), f(u), L(!0);
284
306
  }, [m, p]);
285
- const q = (o == null ? void 0 : o.thresholds) ?? nl, w = (u) => {
307
+ const q = (o == null ? void 0 : o.thresholds) ?? il, w = (u) => {
286
308
  var N;
287
309
  return u == null ? void 0 : ((N = q.find((Y) => u >= Y.gte)) == null ? void 0 : N.color) ?? "#10b981";
288
310
  }, U = (u) => {
@@ -366,7 +388,7 @@ function sl({
366
388
  /* @__PURE__ */ e("div", { className: "ml-[18px] mt-0.5 flex flex-wrap gap-x-3 text-[10px] tabular-nums text-slate-400", children: c.map((X) => /* @__PURE__ */ i("span", { children: [
367
389
  X.label ?? X.field,
368
390
  " ",
369
- /* @__PURE__ */ e("span", { className: "font-medium text-slate-500 dark:text-slate-300", children: u.sums[X.field] == null ? X.empty_label ?? "—" : n.value_format === "currency" ? rl(u.sums[X.field]) : u.sums[X.field].toLocaleString() })
391
+ /* @__PURE__ */ e("span", { className: "font-medium text-slate-500 dark:text-slate-300", children: u.sums[X.field] == null ? X.empty_label ?? "—" : n.value_format === "currency" ? sl(u.sums[X.field]) : u.sums[X.field].toLocaleString() })
370
392
  ] }, X.field)) })
371
393
  ]
372
394
  }
@@ -376,7 +398,7 @@ function sl({
376
398
  };
377
399
  return !o || m.length === 0 ? /* @__PURE__ */ e("p", { className: "px-1 text-[12px] text-slate-400", children: "No data." }) : /* @__PURE__ */ e("div", { className: "min-h-0 flex-1 space-y-0.5 overflow-y-auto pr-1", children: m.map(U) });
378
400
  }
379
- function il(t) {
401
+ function dl(t) {
380
402
  const [n, a] = C(() => typeof IntersectionObserver > "u");
381
403
  return mt(() => {
382
404
  if (n) return;
@@ -398,7 +420,7 @@ function il(t) {
398
420
  };
399
421
  }, [n, t]), n;
400
422
  }
401
- function ol(t) {
423
+ function cl(t) {
402
424
  const n = Ke(), a = St(!1);
403
425
  return async (o) => {
404
426
  if (!(!t || a.current)) {
@@ -442,7 +464,7 @@ function da(t, n, a, o) {
442
464
  const c = fa(n, a);
443
465
  return t.request(o ? { ...c, _signal: o } : c).then((m) => m.data ?? []);
444
466
  }
445
- function dl({
467
+ function ml({
446
468
  cfg: t,
447
469
  dateRange: n,
448
470
  entityFilters: a,
@@ -452,7 +474,7 @@ function dl({
452
474
  deferred: h = !1
453
475
  }) {
454
476
  var le, ae;
455
- const f = Ke(), p = ol(m), [L, q] = C(""), [w, U] = C(0), [u, N] = C(null), Y = ia(t, n, a), { data: O, isLoading: ee, error: X, isFetching: ue, refetch: pe } = Ne({
477
+ const f = Ke(), p = cl(m), [L, q] = C(""), [w, U] = C(0), [u, N] = C(null), Y = ia(t, n, a), { data: O, isLoading: ee, error: X, isFetching: ue, refetch: pe } = Ne({
456
478
  queryKey: ["nivaro-report-query", t.slug, Y],
457
479
  queryFn: ({ signal: S }) => da(f, t.slug, Y, S),
458
480
  enabled: !h,
@@ -533,7 +555,7 @@ function dl({
533
555
  );
534
556
  }
535
557
  if (t.display === "tree")
536
- return /* @__PURE__ */ e(sl, { rows: H, cfg: t, onDrill: (S) => m == null ? void 0 : m(S) });
558
+ return /* @__PURE__ */ e(ol, { rows: H, cfg: t, onDrill: (S) => m == null ? void 0 : m(S) });
537
559
  if (t.display === "table") {
538
560
  const S = de.filter((_) => ze.has(_.format ?? "")), A = L.trim().toLowerCase(), E = A ? H.filter(
539
561
  (_) => Object.values(_).some(
@@ -833,7 +855,7 @@ function dl({
833
855
  stroke: "#94a3b8",
834
856
  width: 140,
835
857
  interval: 0,
836
- tickFormatter: gl
858
+ tickFormatter: yl
837
859
  }
838
860
  )
839
861
  ] }) : /* @__PURE__ */ i(He, { children: [
@@ -888,8 +910,8 @@ function dl({
888
910
  V
889
911
  ] });
890
912
  }
891
- const cl = ["gt", "gte", "lt", "lte", "eq"], ca = { gt: ">", gte: "≥", lt: "<", lte: "≤", eq: "=" }, ml = ["sum", "avg", "max", "min"];
892
- function ul(t) {
913
+ const ul = ["gt", "gte", "lt", "lte", "eq"], ca = { gt: ">", gte: "≥", lt: "<", lte: "≤", eq: "=" }, pl = ["sum", "avg", "max", "min"];
914
+ function hl(t) {
893
915
  var o, c, m;
894
916
  const n = [
895
917
  { value: "value", label: "Value (widget metric)" },
@@ -922,7 +944,7 @@ function jt(t, n) {
922
944
  const a = /^(sum|avg|max|min|tile):(.+)$/.exec(t.field), o = a ? a[2] : t.field, c = ((h = n.find((f) => f.value === t.field || f.value === o)) == null ? void 0 : h.label) ?? o;
923
945
  return `${a && a[1] !== "sum" && a[1] !== "tile" ? `${a[1]} ` : ""}${c} ${ca[t.op] ?? t.op} ${t.value.toLocaleString()}`;
924
946
  }
925
- function pl({ reportId: t, alert: n }) {
947
+ function fl({ reportId: t, alert: n }) {
926
948
  const a = Ke(), o = Ct(), { data: c = [] } = Ne({
927
949
  queryKey: ["nivaro-report-alert-log", t, n.id],
928
950
  queryFn: () => a.request(wa(t, n.id)).then((h) => h.data),
@@ -959,14 +981,14 @@ function pl({ reportId: t, alert: n }) {
959
981
  )
960
982
  ] }, h.id)) });
961
983
  }
962
- function hl({
984
+ function xl({
963
985
  reportId: t,
964
986
  widget: n,
965
987
  filterBar: a
966
988
  }) {
967
989
  const o = Ke(), c = Ct(), [m, h] = C(!1), [f, p] = C(""), [L, q] = C([
968
990
  { field: "value", agg: "sum", op: "gt", value: "" }
969
- ]), [w, U] = C([]), [u, N] = C(!1), [Y, O] = C(null), ee = ul(n), { data: X = [] } = Ne({
991
+ ]), [w, U] = C([]), [u, N] = C(!1), [Y, O] = C(null), ee = hl(n), { data: X = [] } = Ne({
970
992
  queryKey: ["nivaro-report-alerts", t],
971
993
  queryFn: () => o.request(va(t)).then((x) => x.data),
972
994
  enabled: m,
@@ -1068,7 +1090,7 @@ function hl({
1068
1090
  " · Last fired: ",
1069
1091
  x.last_fired ? new Date(x.last_fired).toLocaleString() : "Never"
1070
1092
  ] }),
1071
- Y === x.id && /* @__PURE__ */ e(pl, { reportId: t, alert: x })
1093
+ Y === x.id && /* @__PURE__ */ e(fl, { reportId: t, alert: x })
1072
1094
  ]
1073
1095
  },
1074
1096
  x.id
@@ -1103,7 +1125,7 @@ function hl({
1103
1125
  onChange: (V) => q(
1104
1126
  (he) => he.map((le, ae) => ae === Z ? { ...le, agg: V } : le)
1105
1127
  ),
1106
- options: ml.map((V) => ({ value: V, label: V })),
1128
+ options: pl.map((V) => ({ value: V, label: V })),
1107
1129
  ariaLabel: "Aggregate",
1108
1130
  className: "h-7 w-[62px] rounded-md px-1.5 py-0 text-[11.5px] dark:border-border dark:bg-card"
1109
1131
  }
@@ -1115,7 +1137,7 @@ function hl({
1115
1137
  onChange: (V) => q(
1116
1138
  (he) => he.map((le, ae) => ae === Z ? { ...le, op: V } : le)
1117
1139
  ),
1118
- options: cl.map((V) => ({ value: V, label: ca[V] })),
1140
+ options: ul.map((V) => ({ value: V, label: ca[V] })),
1119
1141
  ariaLabel: "Operator",
1120
1142
  className: "h-7 w-[52px] rounded-md px-1.5 py-0 text-[11.5px] dark:border-border dark:bg-card"
1121
1143
  }
@@ -1205,7 +1227,7 @@ function hl({
1205
1227
  ] })
1206
1228
  ] });
1207
1229
  }
1208
- const fl = {
1230
+ const bl = {
1209
1231
  eq: "_eq",
1210
1232
  neq: "_neq",
1211
1233
  gt: "_gt",
@@ -1221,7 +1243,7 @@ function Mt(t, n, a, o) {
1221
1243
  var L, q;
1222
1244
  const c = t.config ?? {}, m = [];
1223
1245
  for (const w of c.filters ?? []) {
1224
- const U = fl[w.op];
1246
+ const U = bl[w.op];
1225
1247
  if (!U) continue;
1226
1248
  let u = w.value;
1227
1249
  w.op === "in" && typeof u == "string" && (u = u.split(",").map((N) => N.trim())), m.push({ path: [w.field], op: U, value: u });
@@ -1264,7 +1286,7 @@ function Et(t) {
1264
1286
  }
1265
1287
  return a.length > 0 ? a.join(" · ") : "No configuration details";
1266
1288
  }
1267
- function xl(t) {
1289
+ function gl(t) {
1268
1290
  var n, a;
1269
1291
  return t ? t.value != null ? Number(t.value) : t.series ? t.series.reduce((o, c) => o + (Number(c.value) || 0), 0) : (n = t.tiles) != null && n.length ? Number(((a = t.tiles[0]) == null ? void 0 : a.value) ?? 0) : t.row_count != null ? Number(t.row_count) : null : null;
1270
1292
  }
@@ -1298,7 +1320,7 @@ function Wt(t, n, a) {
1298
1320
  const L = p.href;
1299
1321
  setTimeout(() => URL.revokeObjectURL(L), 1e4);
1300
1322
  }
1301
- function bl({
1323
+ function vl({
1302
1324
  collection: t,
1303
1325
  conditions: n,
1304
1326
  title: a,
@@ -1425,7 +1447,7 @@ const Lt = Ta(function({
1425
1447
  currentFilters: Y
1426
1448
  }) {
1427
1449
  var ft, Ue, xt, Ye, bt, gt, tt, vt, Ve, at, Je, lt, rt, nt, re, yt, st, it, ot, Le;
1428
- const O = Ke(), [ee, X] = C(""), [ue, pe] = C(0), [H, de] = C(null), [xe, be] = C(!1), [ge, $e] = C(""), [x, Z] = C(""), [te, V] = C(!1), [he, le] = C(!1), [ae, S] = C([]), A = St(null), E = il(A), [J, ne] = C(!1), [ce, fe] = C(null), [_, P] = C(!1), [me, ve] = C(null), we = ["bar", "line", "donut", "pareto", "area"].includes(a.type) || a.type === "kpi" && !!((ft = a.config) != null && ft.compare || (Ue = a.config) != null && Ue.sparkline), Te = Ct(), [Xe, ye] = C(!1), Ze = async () => {
1450
+ const O = Ke(), [ee, X] = C(""), [ue, pe] = C(0), [H, de] = C(null), [xe, be] = C(!1), [ge, $e] = C(""), [x, Z] = C(""), [te, V] = C(!1), [he, le] = C(!1), [ae, S] = C([]), A = St(null), E = dl(A), [J, ne] = C(!1), [ce, fe] = C(null), [_, P] = C(!1), [me, ve] = C(null), we = ["bar", "line", "donut", "pareto", "area"].includes(a.type) || a.type === "kpi" && !!((ft = a.config) != null && ft.compare || (Ue = a.config) != null && Ue.sparkline), Te = Ct(), [Xe, ye] = C(!1), Ze = async () => {
1429
1451
  ye(!0);
1430
1452
  try {
1431
1453
  const l = await O.request(
@@ -1511,7 +1533,7 @@ const Lt = Ta(function({
1511
1533
  let G = null;
1512
1534
  if (_e != null && _e.slug)
1513
1535
  G = /* @__PURE__ */ e(
1514
- dl,
1536
+ ml,
1515
1537
  {
1516
1538
  cfg: _e,
1517
1539
  dateRange: o,
@@ -2686,7 +2708,7 @@ const Lt = Ta(function({
2686
2708
  children: /* @__PURE__ */ e(Fa, { className: "h-3 w-3" })
2687
2709
  }
2688
2710
  ),
2689
- /* @__PURE__ */ e(hl, { reportId: n, widget: a, filterBar: h }),
2711
+ /* @__PURE__ */ e(xl, { reportId: n, widget: a, filterBar: h }),
2690
2712
  /* @__PURE__ */ e(
2691
2713
  "button",
2692
2714
  {
@@ -2763,7 +2785,7 @@ const Lt = Ta(function({
2763
2785
  ] })
2764
2786
  ] }),
2765
2787
  p && (() => {
2766
- const l = xl(R), s = p.value;
2788
+ const l = gl(R), s = p.value;
2767
2789
  if (l == null || s == null) return null;
2768
2790
  const g = s === 0 ? null : (l - s) / Math.abs(s) * 100;
2769
2791
  return /* @__PURE__ */ i("p", { className: "mb-1 flex items-center gap-1 text-[10.5px] text-slate-400", children: [
@@ -2855,7 +2877,7 @@ const Lt = Ta(function({
2855
2877
  ] }) }) : G }),
2856
2878
  ((Le = a.config) == null ? void 0 : Le.footnote) && /* @__PURE__ */ e("p", { className: "mt-1 border-t border-slate-100 pt-1 text-[10.5px] leading-snug text-slate-400 dark:border-border/50", children: a.config.footnote }),
2857
2879
  H && /* @__PURE__ */ e(
2858
- bl,
2880
+ vl,
2859
2881
  {
2860
2882
  collection: a.collection ?? "",
2861
2883
  conditions: H.conditions,
@@ -2877,7 +2899,7 @@ const Lt = Ta(function({
2877
2899
  }
2878
2900
  );
2879
2901
  });
2880
- function Bl({
2902
+ function Ul({
2881
2903
  reportId: t,
2882
2904
  widget: n,
2883
2905
  dateRange: a = null,
@@ -2898,15 +2920,15 @@ function Bl({
2898
2920
  }
2899
2921
  );
2900
2922
  }
2901
- function gl(t) {
2923
+ function yl(t) {
2902
2924
  const n = t == null ? "" : String(t);
2903
2925
  return n.length > 24 ? `${n.slice(0, 23)}…` : n;
2904
2926
  }
2905
- function vl(t) {
2927
+ function kl(t) {
2906
2928
  const n = t;
2907
2929
  return !(n != null && n.admin) || !n.access_scope_label ? null : `(your access scope: ${n.access_scope_label})`;
2908
2930
  }
2909
- function Ql({
2931
+ function Yl({
2910
2932
  reportId: t,
2911
2933
  showFilterBar: n = !0,
2912
2934
  dateRange: a,
@@ -3117,7 +3139,7 @@ function Ql({
3117
3139
  return /* @__PURE__ */ e("div", { className: Q("p-6 text-[13px] text-slate-400", m), children: "Loading report…" });
3118
3140
  if (!re)
3119
3141
  return /* @__PURE__ */ e("div", { className: Q("p-6 text-[13px] text-slate-400", m), children: "Report not found." });
3120
- const z = vl(H);
3142
+ const z = kl(H);
3121
3143
  return /* @__PURE__ */ i("div", { className: Q("flex flex-col gap-3", m), children: [
3122
3144
  z && (!n || s.length === 0 && l.length === 0) && /* @__PURE__ */ e("p", { className: "text-[11.5px] text-amber-700 dark:text-amber-300", children: z }),
3123
3145
  n && (s.length > 0 || l.length > 0) && /* @__PURE__ */ i("div", { className: "space-y-1.5", children: [
@@ -3570,11 +3592,14 @@ function Ql({
3570
3592
  ] });
3571
3593
  }
3572
3594
  export {
3573
- hl as AlertBell,
3574
- dl as QueryWidgetBody,
3575
- Ql as ReportView,
3576
- Bl as ReportWidgetCard,
3577
- vl as adminAccessScopeNote,
3595
+ xl as AlertBell,
3596
+ oe as CHART_COLORS,
3597
+ rl as NO_WORKFLOW_NUMBER,
3598
+ ml as QueryWidgetBody,
3599
+ Yl as ReportView,
3600
+ Ul as ReportWidgetCard,
3601
+ kl as adminAccessScopeNote,
3602
+ je as fmtCell,
3578
3603
  oa as shapeQueryRows,
3579
- gl as shortCategoryLabel
3604
+ yl as shortCategoryLabel
3580
3605
  };