@nivaro/react 0.3.9 → 0.3.11

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 (80) hide show
  1. package/dist/components/fields/FileField.js +20 -19
  2. package/dist/full.css +1 -1
  3. package/dist/hooks/useNivaroForm.js +129 -126
  4. package/dist/hooks/useSessionRecorder.js +1 -1
  5. package/dist/index.d.ts +103 -4
  6. package/dist/index.js +512 -501
  7. package/dist/shared/components/CollectionBrowserView.js +1632 -1564
  8. package/dist/shared/components/ConformanceView.js +36 -35
  9. package/dist/shared/components/ForceReloadBanner.js +58 -34
  10. package/dist/shared/components/ItemEditForm.js +4386 -4142
  11. package/dist/shared/components/JsonMapEditor.js +18 -17
  12. package/dist/shared/components/MatrixEditor.js +8 -7
  13. package/dist/shared/components/MyWorkView.js +32 -31
  14. package/dist/shared/components/PageRenderer.js +527 -479
  15. package/dist/shared/components/QueryStatStrip.js +74 -70
  16. package/dist/shared/components/RecordGridEditor.js +76 -75
  17. package/dist/shared/components/ReportView.js +818 -827
  18. package/dist/shared/components/SheetHeaderBody.js +16 -14
  19. package/dist/shared/components/ai/AiMemorySuggestions.js +15 -14
  20. package/dist/shared/components/ai/AskPanel.js +55 -54
  21. package/dist/shared/components/bulk/BulkActionButtons.js +30 -29
  22. package/dist/shared/components/bulk/PushBulkButtons.js +57 -56
  23. package/dist/shared/components/chat/SlashCommands.js +30 -29
  24. package/dist/shared/components/chat/chat-outbox.js +76 -75
  25. package/dist/shared/components/help-videos/recorder/useLeaveWarning.js +6 -5
  26. package/dist/shared/components/integrations/console/SignalCard.js +124 -123
  27. package/dist/shared/components/integrations/console/SnoozeMenu.js +24 -23
  28. package/dist/shared/components/item-edit/CatalogPickerField.js +1029 -933
  29. package/dist/shared/components/item-edit/CloneDialog.js +85 -78
  30. package/dist/shared/components/item-edit/FieldRenderer.js +161 -156
  31. package/dist/shared/components/item-edit/FieldRow.js +20 -19
  32. package/dist/shared/components/item-edit/FilePickerField.js +52 -40
  33. package/dist/shared/components/item-edit/GroupSection.js +221 -221
  34. package/dist/shared/components/item-edit/InlineGridField.js +41 -41
  35. package/dist/shared/components/item-edit/InlineTableField.js +2287 -2275
  36. package/dist/shared/components/item-edit/M2MCombobox.js +46 -44
  37. package/dist/shared/components/item-edit/MembershipSetField.js +24 -23
  38. package/dist/shared/components/item-edit/NestedRelationEditor.js +11 -11
  39. package/dist/shared/components/item-edit/QuickCreateButton.js +8 -7
  40. package/dist/shared/components/item-edit/QuickPicker.js +263 -216
  41. package/dist/shared/components/item-edit/RecordLiveSync.js +101 -100
  42. package/dist/shared/components/item-edit/RelationCombobox.js +285 -245
  43. package/dist/shared/components/item-edit/RichTextEditorImpl.js +42 -32
  44. package/dist/shared/components/item-edit/RowHistorySheet.js +130 -134
  45. package/dist/shared/components/item-edit/SummaryPanel.js +305 -279
  46. package/dist/shared/components/item-edit/helpers.js +133 -134
  47. package/dist/shared/components/item-edit/line-qty.js +57 -0
  48. package/dist/shared/components/item-edit/option-disambiguate.js +53 -0
  49. package/dist/shared/components/item-edit/staged-links.js +86 -0
  50. package/dist/shared/components/layout-editor/LayoutEditor.js +275 -274
  51. package/dist/shared/components/layout-editor/editors/cascade-rule-row.js +18 -17
  52. package/dist/shared/components/layout-editor/inspector/HelpTab.js +37 -36
  53. package/dist/shared/components/layout-editor/matrix/FieldStateMatrix.js +50 -49
  54. package/dist/shared/components/panels/AddendumLinesDiff.js +87 -90
  55. package/dist/shared/components/panels/CommentPanel.js +350 -315
  56. package/dist/shared/components/panels/ItemLockBanner.js +297 -230
  57. package/dist/shared/components/panels/PipelinePanel.js +719 -701
  58. package/dist/shared/components/profile/AiMemoryCard.js +15 -14
  59. package/dist/shared/components/profile/PersonAdminTools.js +70 -67
  60. package/dist/shared/components/queue/QueueItemSheet.js +36 -35
  61. package/dist/shared/components/queue/QueueQuickFilters.js +43 -41
  62. package/dist/shared/components/queue/QueueWorklist.js +1026 -957
  63. package/dist/shared/components/widgets/ReviewListWidget.js +99 -93
  64. package/dist/shared/lib/client-version.js +63 -0
  65. package/dist/shared/lib/force-reload.js +36 -0
  66. package/dist/shared/lib/load-error.js +11 -10
  67. package/dist/shared/lib/obligation-banner.js +14 -13
  68. package/dist/shared/lib/obligation-reason-text.js +13 -0
  69. package/dist/shared/lib/presence-live.js +54 -35
  70. package/dist/shared/lib/query-filter-seed.js +34 -11
  71. package/dist/shared/lib/record-outbox.js +76 -75
  72. package/dist/shared/lib/safe-error.js +39 -0
  73. package/dist/shared/lib/sanitize-html.js +24 -15
  74. package/dist/shared/lib/server-clock.js +11 -7
  75. package/dist/shared/lib/sheet-def.js +38 -22
  76. package/dist/shared/lib/unique-options.js +10 -0
  77. package/dist/shared/lib/unsaved-work.js +62 -0
  78. package/dist/shared/lib/utils.js +57 -43
  79. package/dist/shared/lib/validation-rules.js +58 -34
  80. package/package.json +1 -1
@@ -1,55 +1,55 @@
1
- import { jsxs as g, jsx as s, Fragment as q } from "react/jsx-runtime";
1
+ import { jsxs as g, jsx as s, Fragment as f } from "react/jsx-runtime";
2
2
  import { useQuery as S } from "@tanstack/react-query";
3
- import { useState as h, useEffect as v, useMemo as C } from "react";
3
+ import { useState as d, useEffect as C, useMemo as N } from "react";
4
4
  import { MultiPick as x } from "../CollectionBrowserView.js";
5
- const k = (t) => Array.isArray(t) ? t : t ? [t] : [];
6
- function N({
5
+ const b = (t) => Array.isArray(t) ? t : t ? [t] : [];
6
+ function O({
7
7
  def: t,
8
- selected: o,
9
- onChange: y,
10
- badge: m
8
+ selected: a,
9
+ onChange: k,
10
+ badge: p
11
11
  }) {
12
- const [d, i] = h(!1), [p, c] = h(""), l = t.loadOptions, { data: u = [], isLoading: e } = S({
13
- queryKey: ["queue-quick-facet", t.key, p],
14
- queryFn: () => l ? l(p) : Promise.resolve([]),
15
- enabled: !!l && (d || o.length > 0),
12
+ const [h, i] = d(!1), [y, c] = d(""), l = t.loadOptions, { data: u = [], isLoading: e } = S({
13
+ queryKey: ["queue-quick-facet", t.key, y],
14
+ queryFn: () => l ? l(y) : Promise.resolve([]),
15
+ enabled: !!l && (h || a.length > 0),
16
16
  staleTime: 6e4
17
- }), r = C(() => {
18
- const a = new Set(u.map((n) => n.value));
19
- return [...u, ...o.filter((n) => !a.has(n)).map((n) => ({ label: n, value: n }))];
20
- }, [u, o]);
17
+ }), r = N(() => {
18
+ const o = new Set(u.map((n) => n.value));
19
+ return [...u, ...a.filter((n) => !o.has(n)).map((n) => ({ label: n, value: n }))];
20
+ }, [u, a]);
21
21
  return /* @__PURE__ */ s(
22
22
  x,
23
23
  {
24
24
  label: t.placeholder,
25
25
  options: r,
26
- selected: o,
27
- onChange: (a) => y(a.map(String)),
26
+ selected: a,
27
+ onChange: (o) => k(o.map(String)),
28
28
  loading: e,
29
- badge: m,
29
+ badge: p,
30
30
  onSearch: c,
31
- onOpenChange: (a) => {
32
- a && i(!0);
31
+ onOpenChange: (o) => {
32
+ o && i(!0);
33
33
  }
34
34
  }
35
35
  );
36
36
  }
37
37
  function Q({
38
38
  defs: t,
39
- values: o,
40
- seededKeys: y,
41
- onApply: m,
42
- onClear: d,
39
+ values: a,
40
+ seededKeys: k,
41
+ onApply: p,
42
+ onClear: h,
43
43
  right: i
44
44
  }) {
45
- const p = JSON.stringify(t.map((e) => [e.key, k(o[e.key])])), [c, l] = h({});
46
- v(() => {
45
+ const y = JSON.stringify(t.map((e) => [e.key, b(a[e.key])])), [c, l] = d({});
46
+ C(() => {
47
47
  const e = {};
48
- for (const r of t) e[r.key] = k(o[r.key]);
48
+ for (const r of t) e[r.key] = b(a[r.key]);
49
49
  l(e);
50
- }, [p]);
50
+ }, [y]);
51
51
  const u = t.some(
52
- (e) => JSON.stringify(c[e.key] ?? []) !== JSON.stringify(k(o[e.key]))
52
+ (e) => JSON.stringify(c[e.key] ?? []) !== JSON.stringify(b(a[e.key]))
53
53
  );
54
54
  return t.length === 0 && !i ? null : /* @__PURE__ */ g(
55
55
  "div",
@@ -58,28 +58,30 @@ function Q({
58
58
  "data-queue-quick-filters": !0,
59
59
  children: [
60
60
  t.map((e) => {
61
- const r = c[e.key] ?? [], a = e.restricted ? {
61
+ const r = c[e.key] ?? [], o = e.restricted ? {
62
62
  label: "restricted",
63
63
  cls: "bg-amber-500/15 text-amber-700 dark:text-amber-300",
64
64
  title: `Options limited to your restricted ${e.placeholder} scope`
65
- } : y.has(e.key) && r.length > 0 ? {
66
- label: "default",
65
+ } : k.has(e.key) && r.length > 0 ? {
66
+ label: "your default",
67
67
  cls: "bg-nvr-cyan/[0.12] text-[#0284a8] dark:text-nvr-cyan",
68
68
  title: `Pre-selected from your default ${e.placeholder} scope — adjust freely`
69
- } : null, n = (b) => l((f) => ({ ...f, [e.key]: b }));
70
- return e.loadOptions ? /* @__PURE__ */ s(N, { def: e, selected: r, onChange: n, badge: a }, e.key) : /* @__PURE__ */ s(
69
+ } : null, n = (m) => {
70
+ l((q) => ({ ...q, [e.key]: m })), m.length === 0 && b(a[e.key]).length > 0 && p({ [e.key]: e.multi || e.type === "combobox" ? [] : "" });
71
+ };
72
+ return e.loadOptions ? /* @__PURE__ */ s(O, { def: e, selected: r, onChange: n, badge: o }, e.key) : /* @__PURE__ */ s(
71
73
  x,
72
74
  {
73
75
  label: e.placeholder,
74
76
  options: e.options ?? [],
75
77
  selected: r,
76
- onChange: (b) => n(b.map(String)),
77
- badge: a
78
+ onChange: (m) => n(m.map(String)),
79
+ badge: o
78
80
  },
79
81
  e.key
80
82
  );
81
83
  }),
82
- t.length > 0 && /* @__PURE__ */ g(q, { children: [
84
+ t.length > 0 && /* @__PURE__ */ g(f, { children: [
83
85
  /* @__PURE__ */ s(
84
86
  "button",
85
87
  {
@@ -87,10 +89,10 @@ function Q({
87
89
  onClick: () => {
88
90
  const e = {};
89
91
  for (const r of t) {
90
- const a = c[r.key] ?? [];
91
- e[r.key] = r.multi || r.type === "combobox" ? a : a[0] ?? "";
92
+ const o = c[r.key] ?? [];
93
+ e[r.key] = r.multi || r.type === "combobox" ? o : o[0] ?? "";
92
94
  }
93
- m(e);
95
+ p(e);
94
96
  },
95
97
  className: `h-6 rounded px-2.5 text-[11px] font-semibold text-white transition-[filter] hover:brightness-110 ${u ? "bg-nvr-cyan" : "bg-nvr-cyan opacity-60"}`,
96
98
  "data-queue-quick-apply": !0,
@@ -101,7 +103,7 @@ function Q({
101
103
  "button",
102
104
  {
103
105
  type: "button",
104
- onClick: d,
106
+ onClick: h,
105
107
  className: "h-6 rounded border border-slate-200 px-2 text-[11px] text-slate-500 hover:text-slate-700 dark:border-slate-700 dark:text-slate-400 dark:hover:text-slate-200",
106
108
  "data-queue-quick-clear": !0,
107
109
  children: "Clear"