@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.
- package/dist/components/LayoutForm.js +100 -98
- package/dist/full.css +1 -1
- package/dist/hooks/useSessionRecorder.js +1 -1
- package/dist/index.d.ts +645 -16
- package/dist/index.js +814 -775
- package/dist/shared/components/ActivityEntry.js +154 -0
- package/dist/shared/components/AudienceConfirmPanel.js +98 -0
- package/dist/shared/components/BackgroundRunOffer.js +43 -31
- package/dist/shared/components/BroadcastView.js +225 -204
- package/dist/shared/components/CollectionBrowserView.js +3924 -3584
- package/dist/shared/components/ConfigHistory.js +153 -0
- package/dist/shared/components/ConfigReadBack.js +65 -0
- package/dist/shared/components/DataTable.js +379 -346
- package/dist/shared/components/ForceReloadBanner.js +47 -40
- package/dist/shared/components/IdleReloadWatcher.js +69 -0
- package/dist/shared/components/ItemEditForm.js +4041 -3853
- package/dist/shared/components/MyWorkView.js +278 -213
- package/dist/shared/components/NotificationBell.js +130 -121
- package/dist/shared/components/PickerExcludedRows.js +3 -3
- package/dist/shared/components/ProfileView.js +776 -1003
- package/dist/shared/components/RecentRecordsRail.js +34 -16
- package/dist/shared/components/RecordReadView.js +500 -477
- package/dist/shared/components/Skeletons.js +199 -0
- package/dist/shared/components/SlowNotice.js +63 -0
- package/dist/shared/components/Term.js +23 -0
- package/dist/shared/components/WidgetSlot.js +350 -353
- package/dist/shared/components/access/PermissionSummary.js +106 -0
- package/dist/shared/components/bulk/BulkActionButtons.js +76 -73
- package/dist/shared/components/chat/ChatPanel.js +902 -886
- package/dist/shared/components/chat/MemberPaging.js +70 -0
- package/dist/shared/components/chat/RoomParts.js +147 -117
- package/dist/shared/components/chat/ScreenClip.js +73 -69
- package/dist/shared/components/chat/chat-core.js +449 -396
- package/dist/shared/components/chat/huddle/huddle-store.js +48 -43
- package/dist/shared/components/help-videos/api.js +2 -5
- package/dist/shared/components/help-videos/viewer/HelpVideoMatchChip.js +79 -0
- package/dist/shared/components/help-videos/viewer/matchChip.js +50 -0
- package/dist/shared/components/imports/CollectionImportPanel.js +139 -133
- package/dist/shared/components/imports/RunDetailSheet.js +222 -227
- package/dist/shared/components/integrations/console/ErrorExplanation.js +121 -0
- package/dist/shared/components/integrations/console/PartnerDetail.js +175 -174
- package/dist/shared/components/integrations/console/SubmissionRow.js +36 -34
- package/dist/shared/components/integrations/console/drill/SubmissionDrill.js +50 -48
- package/dist/shared/components/item-edit/FieldComments.js +212 -0
- package/dist/shared/components/item-edit/FieldRow.js +340 -336
- package/dist/shared/components/item-edit/RecordGrantTools.js +28 -28
- package/dist/shared/components/item-edit/RecordHeaderActions.js +23 -22
- package/dist/shared/components/item-edit/RelationCombobox.js +231 -222
- package/dist/shared/components/item-edit/RuleHiddenNotes.js +55 -0
- package/dist/shared/components/item-edit/field-comments-context.js +6 -0
- package/dist/shared/components/item-edit/field-sources.js +33 -0
- package/dist/shared/components/item-edit/rule-hidden.js +30 -0
- package/dist/shared/components/layout-editor/HistoryPanel.js +113 -96
- package/dist/shared/components/layout-editor/editors/cascade-filters.js +170 -145
- package/dist/shared/components/layout-editor/inspector/Breadcrumb.js +22 -18
- package/dist/shared/components/layout-editor/inspector/GroupInspector.js +177 -159
- package/dist/shared/components/layout-editor/inspector/PickerTab.js +35 -34
- package/dist/shared/components/layout-editor/inspector/RulesTab.js +124 -111
- package/dist/shared/components/layout-editor/inspector/kit.js +292 -277
- package/dist/shared/components/layout-editor/parity-keys.json.js +1 -1
- package/dist/shared/components/layout-editor/settings/settings-registry.js +1 -1
- package/dist/shared/components/list/CopyListLinkButton.js +41 -0
- package/dist/shared/components/list/InlineEdit.js +363 -0
- package/dist/shared/components/notifications/NotificationCenterView.js +213 -181
- package/dist/shared/components/notifications/NotificationDetailBits.js +205 -82
- package/dist/shared/components/notifications/NotificationRulesEditor.js +515 -0
- package/dist/shared/components/notifications/TestMyRules.js +137 -0
- package/dist/shared/components/notifications/changes-lines.js +24 -0
- package/dist/shared/components/notifications/why-lines.js +64 -0
- package/dist/shared/components/panels/CommentPanel.js +316 -281
- package/dist/shared/components/panels/LegalHoldBanner.js +38 -0
- package/dist/shared/components/panels/PipelinePanel.js +201 -196
- package/dist/shared/components/panels/RevisionsPanel.js +496 -479
- package/dist/shared/components/pipeline/PipelineEditorView.js +1587 -1560
- package/dist/shared/components/pipeline/PipelineStateOwners.js +116 -103
- package/dist/shared/components/profile/PersonDidPanel.js +188 -0
- package/dist/shared/components/profile/PersonProfile.js +57 -52
- package/dist/shared/components/queue/QueueWorklist.js +1526 -1365
- package/dist/shared/hooks/useSlowReason.js +39 -0
- package/dist/shared/lib/activity-sentence.js +670 -0
- package/dist/shared/lib/config-sentences.js +418 -0
- package/dist/shared/lib/core-glossary.js +229 -0
- package/dist/shared/lib/error-hints.js +159 -0
- package/dist/shared/lib/error-message.js +105 -0
- package/dist/shared/lib/error-toast.js +22 -0
- package/dist/shared/lib/field-comments.js +25 -0
- package/dist/shared/lib/filter-sentence.js +261 -0
- package/dist/shared/lib/glossary.js +55 -48
- package/dist/shared/lib/idle-reload.js +138 -0
- package/dist/shared/lib/layout-resolve.js +42 -29
- package/dist/shared/lib/list-inline-edit.js +190 -0
- package/dist/shared/lib/list-link.js +147 -0
- package/dist/shared/lib/prefetch.js +259 -106
- package/dist/shared/lib/record-ref.js +72 -0
- package/dist/shared/lib/reload-holds.js +25 -0
- package/dist/shared/lib/safe-error.js +52 -24
- package/dist/shared/lib/skeleton-shapes.js +72 -0
- package/dist/shared/lib/slow-reason.js +63 -0
- package/package.json +1 -1
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import { jsxs as n, jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import { useQueryClient as D, useQuery as I, useMutation as q } from "@tanstack/react-query";
|
|
3
|
-
import { Loader2 as K, EyeOff as L, CalendarClock as Q, ChevronsUpDown as
|
|
3
|
+
import { Loader2 as K, EyeOff as L, CalendarClock as Q, ChevronsUpDown as j, Check as H } from "lucide-react";
|
|
4
4
|
import { useState as m, useId as A, useMemo as B } from "react";
|
|
5
|
-
import { toast as
|
|
5
|
+
import { toast as x } from "sonner";
|
|
6
6
|
import { useNivaroClient as F } from "../../context.js";
|
|
7
7
|
import { get as M, post as O } from "../../lib/commands.js";
|
|
8
8
|
import { titleCase as U, cn as V } from "../../lib/utils.js";
|
|
9
9
|
import { PICKER_EXCLUSIONS_PAGE_KEY as W } from "../PickerExcludedRows.js";
|
|
10
10
|
import { Button as S } from "../ui/button.js";
|
|
11
|
-
import { Command as z, CommandInput as G, CommandList as
|
|
11
|
+
import { Command as z, CommandInput as G, CommandList as R, CommandEmpty as X, CommandItem as Y } from "../ui/command.js";
|
|
12
12
|
import { Input as w } from "../ui/input.js";
|
|
13
13
|
import { Popover as E, PopoverTrigger as _, PopoverContent as P } from "../ui/popover.js";
|
|
14
14
|
function $(a, r) {
|
|
15
15
|
return a instanceof Error && a.message ? a.message : r;
|
|
16
16
|
}
|
|
17
17
|
function J(a, r, l = {}) {
|
|
18
|
-
const
|
|
18
|
+
const o = F(), s = D(), h = ["picker-exclusion", a, r], { data: c, isLoading: p } = I({
|
|
19
19
|
queryKey: h,
|
|
20
|
-
queryFn: () =>
|
|
20
|
+
queryFn: () => o.request(
|
|
21
21
|
M(`/picker-exclusions/status/${a}/${r}`)
|
|
22
22
|
).then((i) => i.data),
|
|
23
23
|
enabled: l.enabled ?? !0,
|
|
@@ -25,15 +25,15 @@ function J(a, r, l = {}) {
|
|
|
25
25
|
}), d = (c == null ? void 0 : c.excluded) ?? !1, u = q({
|
|
26
26
|
mutationFn: () => {
|
|
27
27
|
const i = { collection: a, item_id: r, layout: l.layoutSlug ?? null };
|
|
28
|
-
return
|
|
28
|
+
return o.request(
|
|
29
29
|
d ? { _method: "DELETE", _path: "/picker-exclusions", _body: i } : O("/picker-exclusions", i)
|
|
30
30
|
);
|
|
31
31
|
},
|
|
32
32
|
onSuccess: () => {
|
|
33
33
|
var i;
|
|
34
|
-
|
|
34
|
+
s.invalidateQueries({ queryKey: h }), s.invalidateQueries({ queryKey: [W, a] }), x.success(d ? "Shown in pickers again" : "Hidden from pickers"), (i = l.onDone) == null || i.call(l);
|
|
35
35
|
},
|
|
36
|
-
onError: (i) =>
|
|
36
|
+
onError: (i) => x.error($(i, "Could not change picker visibility"))
|
|
37
37
|
});
|
|
38
38
|
return { excluded: d, isLoading: p, toggle: u };
|
|
39
39
|
}
|
|
@@ -42,20 +42,20 @@ function me({
|
|
|
42
42
|
itemId: r,
|
|
43
43
|
layoutSlug: l
|
|
44
44
|
}) {
|
|
45
|
-
const { excluded:
|
|
45
|
+
const { excluded: o, toggle: s } = J(a, r, { layoutSlug: l });
|
|
46
46
|
return /* @__PURE__ */ n(
|
|
47
47
|
"button",
|
|
48
48
|
{
|
|
49
49
|
type: "button",
|
|
50
50
|
"data-record-picker-exclusion": !0,
|
|
51
|
-
"data-excluded":
|
|
52
|
-
disabled:
|
|
53
|
-
onClick: () =>
|
|
54
|
-
"data-tip":
|
|
51
|
+
"data-excluded": o ? "true" : "false",
|
|
52
|
+
disabled: s.isPending,
|
|
53
|
+
onClick: () => s.mutate(),
|
|
54
|
+
"data-tip": o ? "This record is hidden from pickers — click to offer it again" : "Hide this record from every picker that would offer it",
|
|
55
55
|
className: "inline-flex items-center",
|
|
56
56
|
children: [
|
|
57
|
-
|
|
58
|
-
|
|
57
|
+
s.isPending ? /* @__PURE__ */ t(K, { className: "animate-spin" }) : /* @__PURE__ */ t(L, {}),
|
|
58
|
+
o ? "Show in pickers" : "Hide from pickers"
|
|
59
59
|
]
|
|
60
60
|
}
|
|
61
61
|
);
|
|
@@ -64,13 +64,13 @@ function he({
|
|
|
64
64
|
collection: a,
|
|
65
65
|
itemId: r,
|
|
66
66
|
fields: l,
|
|
67
|
-
layoutSlug:
|
|
67
|
+
layoutSlug: o
|
|
68
68
|
}) {
|
|
69
|
-
const
|
|
69
|
+
const s = F(), [h, c] = m(!1), [p, d] = m(!1), [u, i] = m(""), [b, N] = m(""), [f, C] = m(""), g = A(), k = B(
|
|
70
70
|
() => l.filter((e) => !e.field.startsWith("__") && !e.field.includes(".")).map((e) => ({ field: e.field, label: e.label || U(e.field) })),
|
|
71
71
|
[l]
|
|
72
72
|
), y = k.find((e) => e.field === u), v = q({
|
|
73
|
-
mutationFn: () =>
|
|
73
|
+
mutationFn: () => s.request(
|
|
74
74
|
O("/scheduled-changes", {
|
|
75
75
|
collection: a,
|
|
76
76
|
item_id: r,
|
|
@@ -78,13 +78,13 @@ function he({
|
|
|
78
78
|
changes: { [u]: b },
|
|
79
79
|
// datetime-local is the viewer's local time; the API stores UTC.
|
|
80
80
|
scheduled_at: new Date(f).toISOString(),
|
|
81
|
-
layout:
|
|
81
|
+
layout: o ?? null
|
|
82
82
|
})
|
|
83
83
|
),
|
|
84
84
|
onSuccess: () => {
|
|
85
|
-
c(!1), i(""), N(""), C(""),
|
|
85
|
+
c(!1), i(""), N(""), C(""), x.success("Change scheduled");
|
|
86
86
|
},
|
|
87
|
-
onError: (e) =>
|
|
87
|
+
onError: (e) => x.error($(e, "Could not schedule the change"))
|
|
88
88
|
}), T = f !== "" && !Number.isNaN(new Date(f).getTime());
|
|
89
89
|
return /* @__PURE__ */ n(E, { open: h, onOpenChange: c, children: [
|
|
90
90
|
/* @__PURE__ */ t(_, { asChild: !0, children: /* @__PURE__ */ n(
|
|
@@ -117,13 +117,13 @@ function he({
|
|
|
117
117
|
className: "h-8 w-full justify-between text-[12px] font-normal",
|
|
118
118
|
children: [
|
|
119
119
|
/* @__PURE__ */ t("span", { className: "truncate", children: (y == null ? void 0 : y.label) ?? "Select a field…" }),
|
|
120
|
-
/* @__PURE__ */ t(
|
|
120
|
+
/* @__PURE__ */ t(j, { className: "ml-1 h-3 w-3 shrink-0 opacity-50" })
|
|
121
121
|
]
|
|
122
122
|
}
|
|
123
123
|
) }),
|
|
124
124
|
/* @__PURE__ */ t(P, { className: "w-[--radix-popover-trigger-width] p-0", align: "start", children: /* @__PURE__ */ n(z, { children: [
|
|
125
125
|
/* @__PURE__ */ t(G, { placeholder: "Search fields…", className: "h-8 text-[12px]" }),
|
|
126
|
-
/* @__PURE__ */ n(
|
|
126
|
+
/* @__PURE__ */ n(R, { children: [
|
|
127
127
|
/* @__PURE__ */ t(X, { className: "py-3 text-center text-[12px] text-muted-foreground", children: "No field matches" }),
|
|
128
128
|
k.map((e) => /* @__PURE__ */ n(
|
|
129
129
|
Y,
|
|
@@ -135,7 +135,7 @@ function he({
|
|
|
135
135
|
className: "text-[12px]",
|
|
136
136
|
children: [
|
|
137
137
|
/* @__PURE__ */ t(
|
|
138
|
-
|
|
138
|
+
H,
|
|
139
139
|
{
|
|
140
140
|
className: V(
|
|
141
141
|
"mr-2 h-3.5 w-3.5",
|
|
@@ -157,7 +157,7 @@ function he({
|
|
|
157
157
|
/* @__PURE__ */ t(
|
|
158
158
|
"label",
|
|
159
159
|
{
|
|
160
|
-
htmlFor: `${
|
|
160
|
+
htmlFor: `${g}-value`,
|
|
161
161
|
className: "mb-1 block text-[11px] font-medium text-muted-foreground",
|
|
162
162
|
children: "New value"
|
|
163
163
|
}
|
|
@@ -165,7 +165,7 @@ function he({
|
|
|
165
165
|
/* @__PURE__ */ t(
|
|
166
166
|
w,
|
|
167
167
|
{
|
|
168
|
-
id: `${
|
|
168
|
+
id: `${g}-value`,
|
|
169
169
|
value: b,
|
|
170
170
|
onChange: (e) => N(e.target.value),
|
|
171
171
|
className: "h-8 text-[12px]"
|
|
@@ -176,7 +176,7 @@ function he({
|
|
|
176
176
|
/* @__PURE__ */ t(
|
|
177
177
|
"label",
|
|
178
178
|
{
|
|
179
|
-
htmlFor: `${
|
|
179
|
+
htmlFor: `${g}-at`,
|
|
180
180
|
className: "mb-1 block text-[11px] font-medium text-muted-foreground",
|
|
181
181
|
children: "When"
|
|
182
182
|
}
|
|
@@ -184,7 +184,7 @@ function he({
|
|
|
184
184
|
/* @__PURE__ */ t(
|
|
185
185
|
w,
|
|
186
186
|
{
|
|
187
|
-
id: `${
|
|
187
|
+
id: `${g}-at`,
|
|
188
188
|
type: "datetime-local",
|
|
189
189
|
value: f,
|
|
190
190
|
onChange: (e) => C(e.target.value),
|
|
@@ -5,14 +5,15 @@ import { useMemo as y, useState as F } from "react";
|
|
|
5
5
|
import { toast as p } from "sonner";
|
|
6
6
|
import { useNivaroClient as v } from "../../context.js";
|
|
7
7
|
import { get as j, post as k } from "../../lib/commands.js";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
8
|
+
import { errorToastOptions as A } from "../../lib/error-toast.js";
|
|
9
|
+
import { userErrorMessage as S } from "../../lib/safe-error.js";
|
|
10
|
+
import { cn as T } from "../../lib/utils.js";
|
|
10
11
|
import { useAvailableBulkActions as B, guardMatches as P } from "../bulk/BulkActionButtons.js";
|
|
11
12
|
import { Button as b } from "../ui/button.js";
|
|
12
|
-
import { Dialog as
|
|
13
|
-
import { Textarea as
|
|
14
|
-
import { invalidateRecordQueries as
|
|
15
|
-
function
|
|
13
|
+
import { Dialog as D, DialogContent as H, DialogHeader as M, DialogTitle as Q, DialogDescription as _, DialogBody as E, DialogFooter as J } from "../ui/dialog.js";
|
|
14
|
+
import { Textarea as K } from "../ui/textarea.js";
|
|
15
|
+
import { invalidateRecordQueries as O } from "./RecordLiveSync.js";
|
|
16
|
+
function se(e, n, t) {
|
|
16
17
|
const h = v(), m = !!n && n !== "new", { data: u } = B(m ? [e] : []), d = y(
|
|
17
18
|
() => ((u == null ? void 0 : u[e]) ?? []).filter(
|
|
18
19
|
(o) => o.header === !0 && (o.kind === "update_fields" || o.kind === "transition")
|
|
@@ -50,7 +51,7 @@ function W(e) {
|
|
|
50
51
|
const n = e.summary && e.summary !== "Built-in" ? e.summary : e.label;
|
|
51
52
|
return e.require_reason ? `${n}. You’ll be asked for a justification, saved as a note on the record.` : `${n}.`;
|
|
52
53
|
}
|
|
53
|
-
function
|
|
54
|
+
function de({
|
|
54
55
|
actions: e,
|
|
55
56
|
onPick: n
|
|
56
57
|
}) {
|
|
@@ -65,7 +66,7 @@ function ae({
|
|
|
65
66
|
"data-record-header-action": t.key,
|
|
66
67
|
"data-tip": W(t),
|
|
67
68
|
onClick: () => n(t),
|
|
68
|
-
className:
|
|
69
|
+
className: T(
|
|
69
70
|
"shrink-0 gap-1.5 text-[12px]",
|
|
70
71
|
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"
|
|
71
72
|
),
|
|
@@ -78,7 +79,7 @@ function ae({
|
|
|
78
79
|
)
|
|
79
80
|
)) });
|
|
80
81
|
}
|
|
81
|
-
function
|
|
82
|
+
function ue({
|
|
82
83
|
action: e,
|
|
83
84
|
collection: n,
|
|
84
85
|
itemId: t,
|
|
@@ -92,26 +93,26 @@ function se({
|
|
|
92
93
|
},
|
|
93
94
|
onSuccess: ({ a: r, result: c }) => {
|
|
94
95
|
var g;
|
|
95
|
-
(g = c.errors) != null && g.length ? p.error(c.errors[0].error) : !c.succeeded && c.skipped ? p.info(`${r.label}: nothing to change on this record`) : p.success(`${r.label} — done`),
|
|
96
|
+
(g = c.errors) != null && g.length ? p.error(c.errors[0].error) : !c.succeeded && c.skipped ? p.info(`${r.label}: nothing to change on this record`) : p.success(`${r.label} — done`), O(d, n, [t]), d.invalidateQueries({ queryKey: ["record-header-action-guard", n] }), l(""), m == null || m(), h();
|
|
96
97
|
},
|
|
97
|
-
onError: (r) => p.error(
|
|
98
|
+
onError: (r) => p.error(S(r, "The action did not run"), A(r))
|
|
98
99
|
});
|
|
99
100
|
return /* @__PURE__ */ i(
|
|
100
|
-
|
|
101
|
+
D,
|
|
101
102
|
{
|
|
102
103
|
open: !!e,
|
|
103
104
|
onOpenChange: (r) => {
|
|
104
105
|
r || (l(""), h());
|
|
105
106
|
},
|
|
106
|
-
children: /* @__PURE__ */ f(
|
|
107
|
-
/* @__PURE__ */ f(
|
|
108
|
-
/* @__PURE__ */ i(
|
|
109
|
-
/* @__PURE__ */ i(
|
|
107
|
+
children: /* @__PURE__ */ f(H, { className: "sm:max-w-md", "data-record-header-action-dialog": "", children: [
|
|
108
|
+
/* @__PURE__ */ f(M, { children: [
|
|
109
|
+
/* @__PURE__ */ i(Q, { children: e == null ? void 0 : e.label }),
|
|
110
|
+
/* @__PURE__ */ i(_, { children: o ? "Say why — your justification is saved as a note on this record." : "Runs on this record. A justification, if you add one, is saved as a note." })
|
|
110
111
|
] }),
|
|
111
|
-
/* @__PURE__ */ f(
|
|
112
|
+
/* @__PURE__ */ f(E, { className: "space-y-1.5", children: [
|
|
112
113
|
/* @__PURE__ */ i("label", { htmlFor: "record-header-action-reason", className: "text-[12.5px] font-medium", children: o ? "Justification (required)" : "Justification (optional)" }),
|
|
113
114
|
/* @__PURE__ */ i(
|
|
114
|
-
|
|
115
|
+
K,
|
|
115
116
|
{
|
|
116
117
|
id: "record-header-action-reason",
|
|
117
118
|
autoFocus: !0,
|
|
@@ -122,7 +123,7 @@ function se({
|
|
|
122
123
|
}
|
|
123
124
|
)
|
|
124
125
|
] }),
|
|
125
|
-
/* @__PURE__ */ f(
|
|
126
|
+
/* @__PURE__ */ f(J, { children: [
|
|
126
127
|
/* @__PURE__ */ i(b, { variant: "outline", onClick: h, disabled: a.isPending, children: "Cancel" }),
|
|
127
128
|
/* @__PURE__ */ i(
|
|
128
129
|
b,
|
|
@@ -139,7 +140,7 @@ function se({
|
|
|
139
140
|
);
|
|
140
141
|
}
|
|
141
142
|
export {
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
143
|
+
de as RecordHeaderActionButtons,
|
|
144
|
+
ue as RecordHeaderActionDialog,
|
|
145
|
+
se as useRecordHeaderActions
|
|
145
146
|
};
|