@nivaro/react 0.3.40 → 0.3.42

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 (99) hide show
  1. package/dist/components/LayoutForm.js +100 -98
  2. package/dist/full.css +1 -1
  3. package/dist/hooks/useSessionRecorder.js +1 -1
  4. package/dist/index.d.ts +645 -16
  5. package/dist/index.js +814 -775
  6. package/dist/shared/components/ActivityEntry.js +154 -0
  7. package/dist/shared/components/AudienceConfirmPanel.js +98 -0
  8. package/dist/shared/components/BackgroundRunOffer.js +43 -31
  9. package/dist/shared/components/BroadcastView.js +225 -204
  10. package/dist/shared/components/CollectionBrowserView.js +3924 -3584
  11. package/dist/shared/components/ConfigHistory.js +153 -0
  12. package/dist/shared/components/ConfigReadBack.js +65 -0
  13. package/dist/shared/components/DataTable.js +379 -346
  14. package/dist/shared/components/ForceReloadBanner.js +47 -40
  15. package/dist/shared/components/IdleReloadWatcher.js +69 -0
  16. package/dist/shared/components/ItemEditForm.js +4041 -3853
  17. package/dist/shared/components/MyWorkView.js +278 -213
  18. package/dist/shared/components/NotificationBell.js +130 -121
  19. package/dist/shared/components/PickerExcludedRows.js +3 -3
  20. package/dist/shared/components/ProfileView.js +776 -1003
  21. package/dist/shared/components/RecentRecordsRail.js +34 -16
  22. package/dist/shared/components/RecordReadView.js +500 -477
  23. package/dist/shared/components/Skeletons.js +199 -0
  24. package/dist/shared/components/SlowNotice.js +63 -0
  25. package/dist/shared/components/Term.js +23 -0
  26. package/dist/shared/components/WidgetSlot.js +350 -353
  27. package/dist/shared/components/access/PermissionSummary.js +106 -0
  28. package/dist/shared/components/bulk/BulkActionButtons.js +76 -73
  29. package/dist/shared/components/chat/ChatPanel.js +902 -886
  30. package/dist/shared/components/chat/MemberPaging.js +70 -0
  31. package/dist/shared/components/chat/RoomParts.js +147 -117
  32. package/dist/shared/components/chat/ScreenClip.js +73 -69
  33. package/dist/shared/components/chat/chat-core.js +449 -396
  34. package/dist/shared/components/chat/huddle/huddle-store.js +48 -43
  35. package/dist/shared/components/help-videos/api.js +2 -5
  36. package/dist/shared/components/help-videos/viewer/HelpVideoMatchChip.js +79 -0
  37. package/dist/shared/components/help-videos/viewer/matchChip.js +50 -0
  38. package/dist/shared/components/imports/CollectionImportPanel.js +139 -133
  39. package/dist/shared/components/imports/RunDetailSheet.js +222 -227
  40. package/dist/shared/components/integrations/console/ErrorExplanation.js +121 -0
  41. package/dist/shared/components/integrations/console/PartnerDetail.js +175 -174
  42. package/dist/shared/components/integrations/console/SubmissionRow.js +36 -34
  43. package/dist/shared/components/integrations/console/drill/SubmissionDrill.js +50 -48
  44. package/dist/shared/components/item-edit/FieldComments.js +212 -0
  45. package/dist/shared/components/item-edit/FieldRow.js +340 -336
  46. package/dist/shared/components/item-edit/RecordGrantTools.js +28 -28
  47. package/dist/shared/components/item-edit/RecordHeaderActions.js +23 -22
  48. package/dist/shared/components/item-edit/RelationCombobox.js +231 -222
  49. package/dist/shared/components/item-edit/RuleHiddenNotes.js +55 -0
  50. package/dist/shared/components/item-edit/field-comments-context.js +6 -0
  51. package/dist/shared/components/item-edit/field-sources.js +33 -0
  52. package/dist/shared/components/item-edit/rule-hidden.js +30 -0
  53. package/dist/shared/components/layout-editor/HistoryPanel.js +113 -96
  54. package/dist/shared/components/layout-editor/editors/cascade-filters.js +170 -145
  55. package/dist/shared/components/layout-editor/inspector/Breadcrumb.js +22 -18
  56. package/dist/shared/components/layout-editor/inspector/GroupInspector.js +177 -159
  57. package/dist/shared/components/layout-editor/inspector/PickerTab.js +35 -34
  58. package/dist/shared/components/layout-editor/inspector/RulesTab.js +124 -111
  59. package/dist/shared/components/layout-editor/inspector/kit.js +292 -277
  60. package/dist/shared/components/layout-editor/parity-keys.json.js +1 -1
  61. package/dist/shared/components/layout-editor/settings/settings-registry.js +1 -1
  62. package/dist/shared/components/list/CopyListLinkButton.js +41 -0
  63. package/dist/shared/components/list/InlineEdit.js +363 -0
  64. package/dist/shared/components/notifications/NotificationCenterView.js +213 -181
  65. package/dist/shared/components/notifications/NotificationDetailBits.js +205 -82
  66. package/dist/shared/components/notifications/NotificationRulesEditor.js +515 -0
  67. package/dist/shared/components/notifications/TestMyRules.js +137 -0
  68. package/dist/shared/components/notifications/changes-lines.js +24 -0
  69. package/dist/shared/components/notifications/why-lines.js +64 -0
  70. package/dist/shared/components/panels/CommentPanel.js +316 -281
  71. package/dist/shared/components/panels/LegalHoldBanner.js +38 -0
  72. package/dist/shared/components/panels/PipelinePanel.js +201 -196
  73. package/dist/shared/components/panels/RevisionsPanel.js +496 -479
  74. package/dist/shared/components/pipeline/PipelineEditorView.js +1587 -1560
  75. package/dist/shared/components/pipeline/PipelineStateOwners.js +116 -103
  76. package/dist/shared/components/profile/PersonDidPanel.js +188 -0
  77. package/dist/shared/components/profile/PersonProfile.js +57 -52
  78. package/dist/shared/components/queue/QueueWorklist.js +1526 -1365
  79. package/dist/shared/hooks/useSlowReason.js +39 -0
  80. package/dist/shared/lib/activity-sentence.js +670 -0
  81. package/dist/shared/lib/config-sentences.js +418 -0
  82. package/dist/shared/lib/core-glossary.js +229 -0
  83. package/dist/shared/lib/error-hints.js +159 -0
  84. package/dist/shared/lib/error-message.js +105 -0
  85. package/dist/shared/lib/error-toast.js +22 -0
  86. package/dist/shared/lib/field-comments.js +25 -0
  87. package/dist/shared/lib/filter-sentence.js +261 -0
  88. package/dist/shared/lib/glossary.js +55 -48
  89. package/dist/shared/lib/idle-reload.js +138 -0
  90. package/dist/shared/lib/layout-resolve.js +42 -29
  91. package/dist/shared/lib/list-inline-edit.js +190 -0
  92. package/dist/shared/lib/list-link.js +147 -0
  93. package/dist/shared/lib/prefetch.js +259 -106
  94. package/dist/shared/lib/record-ref.js +72 -0
  95. package/dist/shared/lib/reload-holds.js +25 -0
  96. package/dist/shared/lib/safe-error.js +52 -24
  97. package/dist/shared/lib/skeleton-shapes.js +72 -0
  98. package/dist/shared/lib/slow-reason.js +63 -0
  99. package/package.json +1 -1
@@ -0,0 +1,153 @@
1
+ import { jsxs as i, Fragment as H, jsx as t } from "react/jsx-runtime";
2
+ import { useInfiniteQuery as S } from "@tanstack/react-query";
3
+ import { History as C } from "lucide-react";
4
+ import { useState as B } from "react";
5
+ import { useNivaroClient as T, useNavigation as _ } from "../context.js";
6
+ import { get as j } from "../lib/commands.js";
7
+ import { cn as m, formatRelative as q, formatDateTime as E } from "../lib/utils.js";
8
+ import { AgentBadge as F } from "./AgentBadge.js";
9
+ import { Button as N } from "./ui/button.js";
10
+ import { Sheet as D, SheetContent as L, SheetHeader as U, SheetTitle as A, SheetDescription as O } from "./ui/sheet.js";
11
+ const R = {
12
+ create: "created this",
13
+ update: "changed this",
14
+ delete: "deleted this",
15
+ revert: "reverted a change",
16
+ restore: "restored this"
17
+ };
18
+ function z(a) {
19
+ return [a.first_name, a.last_name].filter(Boolean).join(" ").trim() || a.user_email || (a.user ? "Someone" : "The system");
20
+ }
21
+ function G(a) {
22
+ var l;
23
+ const n = R[a.action] ?? a.action.replace(/[-_]/g, " "), s = (l = a.comment) != null && l.trim() ? a.comment.trim() : null;
24
+ return { who: z(a), what: n, detail: s };
25
+ }
26
+ const I = 20;
27
+ function K({
28
+ collection: a,
29
+ item: n,
30
+ className: s,
31
+ pageSize: l = I
32
+ }) {
33
+ var p, x, g;
34
+ const h = T(), d = _(), u = n == null ? "" : String(n), o = S({
35
+ queryKey: ["nvr-config-history", a, u, l],
36
+ enabled: !!u,
37
+ initialPageParam: 0,
38
+ queryFn: ({ pageParam: e }) => h.request(
39
+ j("/activity", { collection: a, item: u, limit: l, offset: e })
40
+ ).then((r) => r),
41
+ getNextPageParam: (e, r) => {
42
+ var y;
43
+ const c = r.reduce((w, P) => {
44
+ var v;
45
+ return w + (((v = P.data) == null ? void 0 : v.length) ?? 0);
46
+ }, 0);
47
+ return c < (e.total ?? 0) && (((y = e.data) == null ? void 0 : y.length) ?? 0) > 0 ? c : void 0;
48
+ },
49
+ staleTime: 15e3
50
+ }), f = ((p = o.data) == null ? void 0 : p.pages.flatMap((e) => e.data ?? [])) ?? [], b = ((g = (x = o.data) == null ? void 0 : x.pages[0]) == null ? void 0 : g.total) ?? 0, k = (e) => {
51
+ const r = `/activity/${e}`;
52
+ return d.consoleUrl ? d.consoleUrl(r) : r;
53
+ };
54
+ return u ? o.isLoading ? /* @__PURE__ */ t("div", { className: m("space-y-2", s), "aria-busy": "true", "data-config-history-loading": !0, children: [0, 1, 2].map((e) => /* @__PURE__ */ t("div", { className: "h-10 animate-pulse rounded-md bg-slate-100 dark:bg-muted" }, e)) }) : o.isError ? /* @__PURE__ */ t("p", { className: m("text-[12px] text-red-600 dark:text-red-400", s), children: "History could not be loaded." }) : f.length === 0 ? /* @__PURE__ */ t("p", { className: m("text-[12px] text-slate-500 dark:text-slate-400", s), children: "No changes recorded yet." }) : /* @__PURE__ */ i("div", { className: m("flex flex-col gap-2", s), "data-config-history": !0, children: [
55
+ /* @__PURE__ */ t("ol", { className: "divide-y divide-slate-100 rounded-md border border-slate-200 bg-white dark:divide-border/60 dark:border-border dark:bg-card", children: f.map((e) => {
56
+ const r = G(e), c = k(e.id);
57
+ return /* @__PURE__ */ i("li", { className: "px-3 py-2", "data-config-history-entry": e.id, children: [
58
+ /* @__PURE__ */ i("div", { className: "flex items-baseline gap-2 text-[12.5px]", children: [
59
+ /* @__PURE__ */ i("span", { className: "min-w-0 truncate text-slate-800 dark:text-slate-100", children: [
60
+ /* @__PURE__ */ t("span", { className: "font-medium", children: r.who }),
61
+ " ",
62
+ r.what
63
+ ] }),
64
+ /* @__PURE__ */ t(F, { label: e.via_agent }),
65
+ /* @__PURE__ */ t(
66
+ "time",
67
+ {
68
+ className: "ml-auto shrink-0 text-[11px] text-slate-500 dark:text-slate-400",
69
+ dateTime: e.timestamp,
70
+ "data-tip": E(e.timestamp),
71
+ children: q(e.timestamp)
72
+ }
73
+ )
74
+ ] }),
75
+ (r.detail || c) && /* @__PURE__ */ i("div", { className: "mt-0.5 flex items-start gap-2 text-[11.5px] text-slate-500 dark:text-slate-400", children: [
76
+ r.detail && /* @__PURE__ */ t("p", { className: "min-w-0 flex-1 break-words", children: r.detail }),
77
+ c && /* @__PURE__ */ t(
78
+ "button",
79
+ {
80
+ type: "button",
81
+ className: "ml-auto shrink-0 text-nvr-navy hover:underline dark:text-nvr-cyan",
82
+ onClick: () => d.navigate(c),
83
+ children: "Details"
84
+ }
85
+ )
86
+ ] })
87
+ ] }, e.id);
88
+ }) }),
89
+ /* @__PURE__ */ i("div", { className: "flex items-center justify-between text-[11.5px] text-slate-500 dark:text-slate-400", children: [
90
+ /* @__PURE__ */ i("span", { children: [
91
+ f.length,
92
+ " of ",
93
+ b
94
+ ] }),
95
+ o.hasNextPage && /* @__PURE__ */ t(
96
+ N,
97
+ {
98
+ variant: "outline",
99
+ size: "sm",
100
+ className: "h-7 text-[12px]",
101
+ disabled: o.isFetchingNextPage,
102
+ onClick: () => void o.fetchNextPage(),
103
+ children: o.isFetchingNextPage ? "Loading…" : "Show older"
104
+ }
105
+ )
106
+ ] })
107
+ ] }) : /* @__PURE__ */ t("p", { className: m("text-[12px] text-slate-500 dark:text-slate-400", s), children: "History starts once this is saved." });
108
+ }
109
+ function te({
110
+ collection: a,
111
+ item: n,
112
+ title: s = "History",
113
+ className: l
114
+ }) {
115
+ const [h, d] = B(!1);
116
+ return n == null || n === "" || n === "new" ? null : /* @__PURE__ */ i(H, { children: [
117
+ /* @__PURE__ */ i(
118
+ N,
119
+ {
120
+ type: "button",
121
+ variant: "outline",
122
+ size: "sm",
123
+ className: m("h-8 gap-1.5 text-[12px]", l),
124
+ onClick: () => d(!0),
125
+ "data-config-history-button": !0,
126
+ children: [
127
+ /* @__PURE__ */ t(C, { className: "h-3.5 w-3.5" }),
128
+ "History"
129
+ ]
130
+ }
131
+ ),
132
+ /* @__PURE__ */ t(D, { open: h, onOpenChange: d, children: /* @__PURE__ */ i(
133
+ L,
134
+ {
135
+ side: "right",
136
+ className: "flex w-full flex-col gap-3 overflow-y-auto sm:max-w-md",
137
+ children: [
138
+ /* @__PURE__ */ i(U, { children: [
139
+ /* @__PURE__ */ t(A, { children: s }),
140
+ /* @__PURE__ */ t(O, { children: "Every change recorded for this, newest first." })
141
+ ] }),
142
+ h && /* @__PURE__ */ t(K, { collection: a, item: n })
143
+ ]
144
+ }
145
+ ) })
146
+ ] });
147
+ }
148
+ export {
149
+ K as ConfigHistory,
150
+ te as ConfigHistoryButton,
151
+ G as configHistoryLine,
152
+ z as entryPerson
153
+ };
@@ -0,0 +1,65 @@
1
+ import { jsx as r, jsxs as a } from "react/jsx-runtime";
2
+ import { Info as o } from "lucide-react";
3
+ import { createContext as s, useContext as i } from "react";
4
+ import { cn as d } from "../lib/utils.js";
5
+ import { Popover as c, PopoverTrigger as m, PopoverContent as u } from "./ui/popover.js";
6
+ function v({
7
+ sentences: e,
8
+ className: t,
9
+ kind: n
10
+ }) {
11
+ const l = (Array.isArray(e) ? e : e ? [e] : []).filter(Boolean);
12
+ return l.length ? /* @__PURE__ */ r(
13
+ "p",
14
+ {
15
+ "data-config-readback": n ?? "",
16
+ className: d("text-[12px] leading-snug text-slate-500 dark:text-slate-400", t),
17
+ children: l.join(" ")
18
+ }
19
+ ) : null;
20
+ }
21
+ function p({ source: e }) {
22
+ return /* @__PURE__ */ a("div", { "data-field-source-body": "", className: "space-y-1.5 text-[12px] leading-snug", children: [
23
+ /* @__PURE__ */ r("p", { className: "font-medium text-slate-900 dark:text-foreground", children: e.sentence }),
24
+ e.notes.map((t) => /* @__PURE__ */ r("p", { className: "text-slate-500 dark:text-slate-400", children: t }, t)),
25
+ e.inputs.length > 0 && /* @__PURE__ */ a("p", { className: "text-slate-500 dark:text-slate-400", children: [
26
+ "Reads:",
27
+ " ",
28
+ /* @__PURE__ */ r("span", { className: "text-slate-700 dark:text-slate-300", children: e.inputs.join(", ") })
29
+ ] })
30
+ ] });
31
+ }
32
+ function y({ source: e, label: t }) {
33
+ return /* @__PURE__ */ a(c, { children: [
34
+ /* @__PURE__ */ r(m, { asChild: !0, children: /* @__PURE__ */ r(
35
+ "button",
36
+ {
37
+ type: "button",
38
+ "data-field-source": "",
39
+ "aria-label": `Where ${t} comes from`,
40
+ "data-tip": "Where this value comes from",
41
+ className: "inline-flex h-4 w-4 items-center justify-center rounded text-slate-400 hover:bg-muted hover:text-slate-600 dark:hover:text-slate-200",
42
+ children: /* @__PURE__ */ r(o, { className: "h-3.5 w-3.5" })
43
+ }
44
+ ) }),
45
+ /* @__PURE__ */ a(u, { align: "start", className: "w-[300px] p-3", children: [
46
+ /* @__PURE__ */ a("p", { className: "mb-1.5 text-[11px] font-medium uppercase tracking-wide text-slate-400", children: [
47
+ "Where ",
48
+ t,
49
+ " comes from"
50
+ ] }),
51
+ /* @__PURE__ */ r(p, { source: e })
52
+ ] })
53
+ ] });
54
+ }
55
+ const x = s(null), b = (e) => {
56
+ var t;
57
+ return ((t = i(x)) == null ? void 0 : t[e]) ?? null;
58
+ };
59
+ export {
60
+ v as ConfigReadBack,
61
+ p as FieldSourceBody,
62
+ y as FieldSourceInfo,
63
+ x as FieldSourcesContext,
64
+ b as useFieldSource
65
+ };