@nivaro/react 0.3.117 → 0.3.118
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/full.css +1 -1
- package/dist/hooks/useSessionRecorder.js +1 -1
- package/dist/index.d.ts +136 -14
- package/dist/index.js +488 -485
- package/dist/shared/components/ActivityEntry.js +130 -125
- package/dist/shared/components/AgentPresenceChip.js +36 -26
- package/dist/shared/components/CellCopyLayer.js +50 -45
- package/dist/shared/components/CollectionBrowserView.js +3757 -3695
- package/dist/shared/components/FilePreviewLightbox.js +96 -58
- package/dist/shared/components/InStep.js +18 -17
- package/dist/shared/components/ItemEditForm.js +4220 -4175
- package/dist/shared/components/JobsTray.js +8 -8
- package/dist/shared/components/LiveNewMatchesPill.js +21 -14
- package/dist/shared/components/LiveOffNote.js +3 -2
- package/dist/shared/components/LiveRowMark.js +53 -23
- package/dist/shared/components/LiveTraceView.js +162 -123
- package/dist/shared/components/MyWorkView.js +320 -299
- package/dist/shared/components/NotificationBell.js +14 -14
- package/dist/shared/components/OverflowRail.js +1 -1
- package/dist/shared/components/PageRenderer.js +120 -116
- package/dist/shared/components/ProfileView.js +203 -202
- package/dist/shared/components/RealtimeStatusBanner.js +31 -29
- package/dist/shared/components/RecordDrilldownSheet.js +7 -7
- package/dist/shared/components/RecordHoverCard.js +102 -84
- package/dist/shared/components/RecordReadView.js +146 -146
- package/dist/shared/components/ScreenRefreshButton.js +34 -32
- package/dist/shared/components/TipLayer.js +65 -58
- package/dist/shared/components/WidgetImageMenu.js +83 -43
- package/dist/shared/components/activity/RecordActivityStream.js +175 -173
- package/dist/shared/components/bulk/BulkSelectionNotices.js +142 -119
- package/dist/shared/components/change-proposals/ChangeProposalsPanel.js +158 -143
- package/dist/shared/components/change-proposals/ProposeChangeButton.js +17 -11
- package/dist/shared/components/change-proposals/ProposeChangeDialog.js +201 -173
- package/dist/shared/components/chat/ChatAnalyticsView.js +27 -27
- package/dist/shared/components/chat/HuddleAnalyticsTab.js +17 -17
- package/dist/shared/components/collections-directory/CollectionsToolbar.js +39 -41
- package/dist/shared/components/collections-directory/page-model.js +72 -67
- package/dist/shared/components/integrations/RecordIntegrationPreview.js +48 -56
- package/dist/shared/components/integrations/SendStatus.js +65 -59
- package/dist/shared/components/integrations/console/ReadyToSendView.js +275 -209
- package/dist/shared/components/integrations/console/SignalCard.js +237 -230
- package/dist/shared/components/item-edit/CatalogPickerField.js +227 -205
- package/dist/shared/components/item-edit/ChangedAfterApprovalBadge.js +131 -92
- package/dist/shared/components/item-edit/CloneDialog.js +191 -161
- package/dist/shared/components/item-edit/DerivedCauseNote.js +44 -30
- package/dist/shared/components/item-edit/DraftRecoveryBanner.js +153 -134
- package/dist/shared/components/item-edit/FieldComments.js +54 -53
- package/dist/shared/components/item-edit/FieldPointer.js +82 -67
- package/dist/shared/components/item-edit/FieldRow.js +106 -100
- package/dist/shared/components/item-edit/FieldSourceBadge.js +58 -56
- package/dist/shared/components/item-edit/FilePickerField.js +452 -387
- package/dist/shared/components/item-edit/HeaderSummaryChip.js +78 -56
- package/dist/shared/components/item-edit/HeaderTools.js +94 -85
- package/dist/shared/components/item-edit/InlineTableField.js +1242 -1218
- package/dist/shared/components/item-edit/ListNeighborNav.js +47 -50
- package/dist/shared/components/item-edit/LiveTraceSheet.js +15 -10
- package/dist/shared/components/item-edit/MembershipSetField.js +285 -254
- package/dist/shared/components/item-edit/OutboxReviewTray.js +155 -144
- package/dist/shared/components/item-edit/QueueReturnChip.js +15 -36
- package/dist/shared/components/item-edit/RecalcValue.js +57 -32
- package/dist/shared/components/item-edit/RecordHelpChip.js +21 -22
- package/dist/shared/components/item-edit/RecordLiveSync.js +283 -231
- package/dist/shared/components/item-edit/RelationCombobox.js +439 -393
- package/dist/shared/components/item-edit/RemoteChangeUi.js +292 -224
- package/dist/shared/components/item-edit/RemoteUploads.js +26 -20
- package/dist/shared/components/item-edit/RemovedLineNote.js +77 -67
- package/dist/shared/components/item-edit/RichTextEditorImpl.js +184 -179
- package/dist/shared/components/item-edit/ScheduledChangeChip.js +168 -134
- package/dist/shared/components/item-edit/SectionPresence.js +18 -10
- package/dist/shared/components/item-edit/SplitLinesButton.js +163 -139
- package/dist/shared/components/item-edit/UserChip.js +1 -1
- package/dist/shared/components/item-edit/file-live.js +69 -54
- package/dist/shared/components/item-edit/layout-switch.js +98 -89
- package/dist/shared/components/item-edit/partner-needs.js +12 -12
- package/dist/shared/components/item-edit/removed-line.js +31 -25
- package/dist/shared/components/layout-editor/pickers/field-picker.js +112 -104
- package/dist/shared/components/list/ListViewers.js +46 -35
- package/dist/shared/components/notifications/NotificationCenterView.js +479 -437
- package/dist/shared/components/panels/AccessDeniedPanel.js +176 -101
- package/dist/shared/components/panels/AlertBanners.js +82 -72
- package/dist/shared/components/panels/BranchLanes.js +22 -22
- package/dist/shared/components/panels/CommentImages.js +123 -102
- package/dist/shared/components/panels/CommentPanel.js +186 -185
- package/dist/shared/components/panels/ExternalRequestsChip.js +111 -119
- package/dist/shared/components/panels/OwnerOpenedLine.js +31 -24
- package/dist/shared/components/panels/PipelinePanel.js +2037 -1885
- package/dist/shared/components/panels/ResubmissionDiff.js +163 -142
- package/dist/shared/components/pipeline/OwnerMatrixSheet.js +400 -288
- package/dist/shared/components/pipeline/PipelineEditorView.js +7 -2
- package/dist/shared/components/profile/AgentNameField.js +107 -81
- package/dist/shared/components/profile/AgentsPanel.js +184 -184
- package/dist/shared/components/profile/PersonAccess.js +599 -495
- package/dist/shared/components/profile/SignInTroubleshooter.js +160 -127
- package/dist/shared/components/profile/SignedInDevices.js +17 -17
- package/dist/shared/components/profile/primitives.js +1 -1
- package/dist/shared/components/queue/OwnerAvatars.js +91 -54
- package/dist/shared/components/queue/QueueTeamStrip.js +56 -46
- package/dist/shared/components/queue/QueueWorklist.js +1002 -983
- package/dist/shared/components/support/AssignRules.js +1733 -0
- package/dist/shared/components/support/PersonPick.js +88 -0
- package/dist/shared/components/support/RequestList.js +790 -0
- package/dist/shared/components/support/ScreenShare.js +158 -152
- package/dist/shared/components/support/SupportRequestDialog.js +50 -48
- package/dist/shared/components/support/SupportView.js +140 -246
- package/dist/shared/components/support/TicketDetailSheet.js +82 -75
- package/dist/shared/components/support/TicketSlowScreens.js +9 -9
- package/dist/shared/components/support/assign-rules-text.js +171 -0
- package/dist/shared/components/support/support-list.js +125 -0
- package/dist/shared/components/ui/SimpleSelect.js +28 -20
- package/dist/shared/components/ui/checkbox.js +6 -6
- package/dist/shared/components/ui/select.js +43 -39
- package/dist/shared/components/ui/sheet.js +9 -9
- package/dist/shared/components/ui/switch.js +12 -11
- package/dist/shared/components/watch-list/WatchDock.js +532 -459
- package/dist/shared/components/watch-list/WatchExtras.js +332 -286
- package/dist/shared/components/watch-list/WatchRows.js +164 -140
- package/dist/shared/lib/activity-sentence.js +103 -91
- package/dist/shared/lib/agent-presence.js +27 -21
- package/dist/shared/lib/approval-progress.js +2 -2
- package/dist/shared/lib/copy-rules.js +31 -24
- package/dist/shared/lib/derived-causes.js +113 -78
- package/dist/shared/lib/grid-cursors.js +26 -26
- package/dist/shared/lib/label-flash.js +27 -0
- package/dist/shared/lib/list-return.js +137 -125
- package/dist/shared/lib/live-deltas.js +40 -34
- package/dist/shared/lib/live-groups.js +56 -52
- package/dist/shared/lib/live-preference.js +64 -59
- package/dist/shared/lib/live-screen.js +223 -192
- package/dist/shared/lib/partner-failure.js +11 -11
- package/dist/shared/lib/rollup-recalc.js +68 -64
- package/dist/shared/lib/screen-refresh.js +74 -68
- package/dist/shared/lib/screen-share.js +108 -104
- package/dist/shared/lib/send-status.js +77 -61
- package/dist/shared/lib/text-diff-window.js +29 -0
- package/dist/shared/lib/watch-list.js +210 -209
- package/dist/shared/lib/widget-image-render.js +72 -49
- package/package.json +1 -1
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useQuery as D, useQueryClient as
|
|
3
|
-
import { ChevronRight as
|
|
1
|
+
import { jsxs as r, jsx as e, Fragment as C } from "react/jsx-runtime";
|
|
2
|
+
import { useQuery as D, useQueryClient as W, useMutation as E } from "@tanstack/react-query";
|
|
3
|
+
import { ChevronRight as K, GitPullRequestArrow as Q, Loader2 as v, Check as T, ArrowRight as $, AlertTriangle as j } from "lucide-react";
|
|
4
4
|
import { useState as f } from "react";
|
|
5
5
|
import { toast as w } from "sonner";
|
|
6
|
-
import { useNivaroClient as
|
|
6
|
+
import { useNivaroClient as P } from "../../context.js";
|
|
7
7
|
import { get as F, post as L } from "../../lib/commands.js";
|
|
8
|
-
import { describeError as
|
|
9
|
-
import { toastError as
|
|
8
|
+
import { describeError as M } from "../../lib/error-message.js";
|
|
9
|
+
import { toastError as O } from "../../lib/error-toast.js";
|
|
10
10
|
import { noteOwnWrite as U } from "../../lib/own-writes.js";
|
|
11
11
|
import { invalidateRecordRow as B } from "../../lib/record-loader.js";
|
|
12
|
-
import { cn as N, formatRelative as
|
|
13
|
-
import { ProposalValue as
|
|
14
|
-
import { proposalsQueryKey as
|
|
15
|
-
function G(
|
|
16
|
-
const i =
|
|
12
|
+
import { cn as N, formatRelative as q } from "../../lib/utils.js";
|
|
13
|
+
import { ProposalValue as k } from "./ProposalValue.js";
|
|
14
|
+
import { proposalsQueryKey as S } from "./types.js";
|
|
15
|
+
function G(a, d, c) {
|
|
16
|
+
const i = P();
|
|
17
17
|
return D({
|
|
18
|
-
queryKey:
|
|
18
|
+
queryKey: S(a, d ?? ""),
|
|
19
19
|
queryFn: () => i.request(
|
|
20
|
-
F(`/change-proposals/record/${
|
|
21
|
-
).then((
|
|
22
|
-
enabled:
|
|
20
|
+
F(`/change-proposals/record/${a}/${encodeURIComponent(String(d))}`)
|
|
21
|
+
).then((l) => l.data).catch(() => null),
|
|
22
|
+
enabled: c && !!d,
|
|
23
23
|
staleTime: 15e3
|
|
24
24
|
});
|
|
25
25
|
}
|
|
@@ -31,124 +31,139 @@ const _ = {
|
|
|
31
31
|
declined: { text: "Declined", cls: "bg-rose-500/10 text-rose-700 dark:text-rose-300" },
|
|
32
32
|
withdrawn: { text: "Withdrawn", cls: "bg-slate-500/10 text-slate-600 dark:text-slate-400" }
|
|
33
33
|
};
|
|
34
|
-
function
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
34
|
+
function A({ p: a }) {
|
|
35
|
+
const d = a.status === "pending" || a.status === "accepting", c = d ? "Now" : "Before", i = (t) => {
|
|
36
|
+
const o = t.stale && "now" in t ? t.now : t.from;
|
|
37
|
+
return /* @__PURE__ */ r(C, { children: [
|
|
38
|
+
/* @__PURE__ */ e(
|
|
39
|
+
"span",
|
|
40
|
+
{
|
|
41
|
+
className: N(!d && "line-through decoration-slate-300 dark:decoration-slate-600"),
|
|
42
|
+
children: /* @__PURE__ */ e(k, { value: o, kind: t.kind, relation: t.relation, choices: t.choices })
|
|
43
|
+
}
|
|
44
|
+
),
|
|
45
|
+
t.stale && /* @__PURE__ */ r("span", { className: "mt-0.5 block text-[11px] text-amber-700 dark:text-amber-400", children: [
|
|
46
|
+
"Was",
|
|
47
|
+
" ",
|
|
48
|
+
/* @__PURE__ */ e(k, { value: t.from, kind: t.kind, relation: t.relation, choices: t.choices }),
|
|
49
|
+
" ",
|
|
50
|
+
"when proposed"
|
|
51
|
+
] })
|
|
52
|
+
] });
|
|
53
|
+
}, l = (t) => t.stale && /* @__PURE__ */ r(
|
|
54
|
+
"span",
|
|
55
|
+
{
|
|
56
|
+
className: "mt-0.5 flex items-center gap-1 text-[11px] font-normal text-amber-700 dark:text-amber-400",
|
|
57
|
+
"data-tip": "Someone changed this field after the proposal was made",
|
|
58
|
+
children: [
|
|
59
|
+
/* @__PURE__ */ e(j, { className: "h-3 w-3", "aria-hidden": !0 }),
|
|
60
|
+
" Changed since"
|
|
61
|
+
]
|
|
62
|
+
}
|
|
63
|
+
), m = (t) => /* @__PURE__ */ e(k, { value: t.to, kind: t.kind, relation: t.relation, choices: t.choices });
|
|
64
|
+
return /* @__PURE__ */ r("div", { className: "overflow-hidden rounded-md border border-slate-200 dark:border-border", children: [
|
|
65
|
+
/* @__PURE__ */ r("table", { className: "hidden w-full table-fixed text-[12.5px] sm:table", children: [
|
|
66
|
+
/* @__PURE__ */ e("thead", { className: "bg-slate-50 text-left text-[11px] font-medium uppercase tracking-wide text-slate-500 dark:bg-muted/40 dark:text-muted-foreground", children: /* @__PURE__ */ r("tr", { children: [
|
|
38
67
|
/* @__PURE__ */ e("th", { className: "w-[30%] px-3 py-1.5 font-medium", children: "Field" }),
|
|
39
|
-
/* @__PURE__ */ e("th", { className: "w-[30%] px-3 py-1.5 font-medium", children:
|
|
68
|
+
/* @__PURE__ */ e("th", { className: "w-[30%] px-3 py-1.5 font-medium", children: c }),
|
|
40
69
|
/* @__PURE__ */ e("th", { className: "w-5", "aria-hidden": !0 }),
|
|
41
70
|
/* @__PURE__ */ e("th", { className: "px-3 py-1.5 font-medium", children: "Proposed" })
|
|
42
71
|
] }) }),
|
|
43
|
-
/* @__PURE__ */ e("tbody", { className: "divide-y divide-slate-100 dark:divide-border", children:
|
|
44
|
-
/* @__PURE__ */
|
|
45
|
-
/* @__PURE__ */ e("span", { className: "break-words", children:
|
|
46
|
-
|
|
47
|
-
"span",
|
|
48
|
-
{
|
|
49
|
-
className: "mt-0.5 flex items-center gap-1 text-[11px] font-normal text-amber-700 dark:text-amber-400",
|
|
50
|
-
"data-tip": "Someone changed this field after the proposal was made",
|
|
51
|
-
children: [
|
|
52
|
-
/* @__PURE__ */ e($, { className: "h-3 w-3" }),
|
|
53
|
-
" Changed since"
|
|
54
|
-
]
|
|
55
|
-
}
|
|
56
|
-
)
|
|
72
|
+
/* @__PURE__ */ e("tbody", { className: "divide-y divide-slate-100 dark:divide-border", children: a.changes.map((t) => /* @__PURE__ */ r("tr", { "data-proposal-change": t.field, className: "align-top", children: [
|
|
73
|
+
/* @__PURE__ */ r("td", { className: "px-3 py-2 font-medium text-slate-700 dark:text-slate-200", children: [
|
|
74
|
+
/* @__PURE__ */ e("span", { className: "break-words", children: t.label }),
|
|
75
|
+
l(t)
|
|
57
76
|
] }),
|
|
58
|
-
/* @__PURE__ */ e("td", { className: "px-3 py-2 text-slate-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
kind: r.kind,
|
|
63
|
-
relation: r.relation,
|
|
64
|
-
choices: r.choices
|
|
65
|
-
}
|
|
66
|
-
) }),
|
|
67
|
-
/* @__PURE__ */ e("td", { className: "py-2 text-slate-400", "aria-hidden": !0, children: /* @__PURE__ */ e(j, { className: "mt-0.5 h-3.5 w-3.5" }) }),
|
|
68
|
-
/* @__PURE__ */ e("td", { className: "px-3 py-2 font-medium text-slate-900 dark:text-slate-50", children: /* @__PURE__ */ e(
|
|
69
|
-
v,
|
|
70
|
-
{
|
|
71
|
-
value: r.to,
|
|
72
|
-
kind: r.kind,
|
|
73
|
-
relation: r.relation,
|
|
74
|
-
choices: r.choices
|
|
75
|
-
}
|
|
76
|
-
) })
|
|
77
|
-
] }, r.field)) })
|
|
77
|
+
/* @__PURE__ */ e("td", { className: "px-3 py-2 text-slate-600 dark:text-slate-400", children: i(t) }),
|
|
78
|
+
/* @__PURE__ */ e("td", { className: "py-2 text-slate-400", "aria-hidden": !0, children: /* @__PURE__ */ e($, { className: "mt-0.5 h-3.5 w-3.5" }) }),
|
|
79
|
+
/* @__PURE__ */ e("td", { className: "px-3 py-2 font-medium text-slate-900 dark:text-slate-50", children: m(t) })
|
|
80
|
+
] }, t.field)) })
|
|
78
81
|
] }),
|
|
79
|
-
|
|
80
|
-
|
|
82
|
+
/* @__PURE__ */ e("ul", { className: "divide-y divide-slate-100 text-[12.5px] sm:hidden dark:divide-border", children: a.changes.map((t) => /* @__PURE__ */ r("li", { "data-proposal-change-stacked": t.field, className: "px-3 py-2.5", children: [
|
|
83
|
+
/* @__PURE__ */ r("p", { className: "font-medium text-slate-800 dark:text-slate-100", children: [
|
|
84
|
+
/* @__PURE__ */ e("span", { className: "break-words", children: t.label }),
|
|
85
|
+
l(t)
|
|
86
|
+
] }),
|
|
87
|
+
/* @__PURE__ */ r("dl", { className: "mt-1.5 grid grid-cols-[auto_minmax(0,1fr)] gap-x-3 gap-y-1", children: [
|
|
88
|
+
/* @__PURE__ */ e("dt", { className: "text-[11px] font-medium uppercase tracking-wide text-slate-500 dark:text-muted-foreground", children: c }),
|
|
89
|
+
/* @__PURE__ */ e("dd", { className: "min-w-0 text-slate-600 dark:text-slate-400", children: i(t) }),
|
|
90
|
+
/* @__PURE__ */ e("dt", { className: "text-[11px] font-medium uppercase tracking-wide text-slate-500 dark:text-muted-foreground", children: "Proposed" }),
|
|
91
|
+
/* @__PURE__ */ e("dd", { className: "min-w-0 font-medium text-slate-900 dark:text-slate-50", children: m(t) })
|
|
92
|
+
] })
|
|
93
|
+
] }, t.field)) }),
|
|
94
|
+
a.hidden_fields > 0 && /* @__PURE__ */ r("p", { className: "border-t border-slate-100 px-3 py-1.5 text-[11.5px] text-slate-500 dark:border-border dark:text-muted-foreground", children: [
|
|
95
|
+
a.hidden_fields === 1 ? "One more field" : `${a.hidden_fields} more fields`,
|
|
81
96
|
" you can’t see."
|
|
82
97
|
] })
|
|
83
98
|
] });
|
|
84
99
|
}
|
|
85
|
-
function
|
|
86
|
-
p:
|
|
87
|
-
collection:
|
|
88
|
-
item:
|
|
100
|
+
function H({
|
|
101
|
+
p: a,
|
|
102
|
+
collection: d,
|
|
103
|
+
item: c
|
|
89
104
|
}) {
|
|
90
|
-
const i =
|
|
91
|
-
|
|
92
|
-
},
|
|
93
|
-
onMutate: (
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
105
|
+
const i = P(), l = W(), [m, t] = f(!1), [o, s] = f(""), [h, b] = f(null), y = () => {
|
|
106
|
+
l.invalidateQueries({ queryKey: S(d, c) }), l.invalidateQueries({ queryKey: ["my-work"] });
|
|
107
|
+
}, u = E({
|
|
108
|
+
onMutate: (n) => {
|
|
109
|
+
n.kind === "accept" && U(
|
|
110
|
+
d,
|
|
111
|
+
c,
|
|
97
112
|
void 0,
|
|
98
|
-
|
|
113
|
+
a.changes.map((x) => x.field)
|
|
99
114
|
);
|
|
100
115
|
},
|
|
101
|
-
mutationFn: (
|
|
102
|
-
L(`/change-proposals/${
|
|
116
|
+
mutationFn: (n) => i.request(
|
|
117
|
+
L(`/change-proposals/${a.id}/${n.kind}`, n.kind === "decline" ? { note: n.note } : {})
|
|
103
118
|
),
|
|
104
|
-
onSuccess: (
|
|
105
|
-
|
|
119
|
+
onSuccess: (n, x) => {
|
|
120
|
+
y(), x.kind === "accept" ? (l.invalidateQueries({ queryKey: ["item", d] }), l.invalidateQueries({ queryKey: ["comments-related", d] }), B(l, d, c), w.success("Accepted — the new values are on the record.")) : x.kind === "decline" ? w.success("Declined — the proposer has been told.") : w.success("Proposal withdrawn.");
|
|
106
121
|
},
|
|
107
|
-
onError: (
|
|
108
|
-
const
|
|
109
|
-
|
|
122
|
+
onError: (n, x) => {
|
|
123
|
+
const R = M(n, "Could not do that");
|
|
124
|
+
x.kind === "decline" ? b(R.title) : O(n, "Could not do that"), y();
|
|
110
125
|
}
|
|
111
|
-
}),
|
|
112
|
-
return /* @__PURE__ */
|
|
126
|
+
}), p = u.isPending, g = a.changes.some((n) => n.stale);
|
|
127
|
+
return /* @__PURE__ */ r(
|
|
113
128
|
"div",
|
|
114
129
|
{
|
|
115
|
-
"data-change-proposal":
|
|
130
|
+
"data-change-proposal": a.id,
|
|
116
131
|
className: "rounded-lg border border-nvr-cyan/30 bg-white p-4 shadow-sm dark:border-nvr-cyan/25 dark:bg-card",
|
|
117
132
|
children: [
|
|
118
|
-
/* @__PURE__ */
|
|
119
|
-
/* @__PURE__ */
|
|
120
|
-
/* @__PURE__ */ e("span", { className: "flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-nvr-cyan/10 text-[#0e7490] dark:text-[#67e8f9]", children: /* @__PURE__ */ e(
|
|
121
|
-
/* @__PURE__ */
|
|
133
|
+
/* @__PURE__ */ r("div", { className: "mb-2 flex flex-wrap items-start justify-between gap-x-3 gap-y-1", children: [
|
|
134
|
+
/* @__PURE__ */ r("div", { className: "flex min-w-0 items-center gap-2", children: [
|
|
135
|
+
/* @__PURE__ */ e("span", { className: "flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-nvr-cyan/10 text-[#0e7490] dark:text-[#67e8f9]", children: /* @__PURE__ */ e(Q, { className: "h-3.5 w-3.5" }) }),
|
|
136
|
+
/* @__PURE__ */ r("div", { className: "min-w-0", children: [
|
|
122
137
|
/* @__PURE__ */ e("p", { className: "text-[13px] font-semibold text-slate-900 dark:text-slate-50", children: "Proposed change" }),
|
|
123
|
-
/* @__PURE__ */
|
|
124
|
-
|
|
138
|
+
/* @__PURE__ */ r("p", { className: "text-[11.5px] text-slate-500 dark:text-muted-foreground", children: [
|
|
139
|
+
a.created_by_name ?? "Someone",
|
|
125
140
|
" · ",
|
|
126
|
-
|
|
141
|
+
q(a.created_at)
|
|
127
142
|
] })
|
|
128
143
|
] })
|
|
129
144
|
] }),
|
|
130
145
|
/* @__PURE__ */ e("span", { className: "rounded-full bg-amber-400/15 px-2 py-0.5 text-[11px] font-medium text-amber-800 dark:text-amber-300", children: "Waiting for a decision" })
|
|
131
146
|
] }),
|
|
132
|
-
/* @__PURE__ */
|
|
147
|
+
/* @__PURE__ */ r("p", { className: "mb-3 max-w-[75ch] text-[12.5px] leading-relaxed text-slate-700 dark:text-slate-300", children: [
|
|
133
148
|
/* @__PURE__ */ e("span", { className: "mr-1.5 font-medium text-slate-500 dark:text-slate-400", children: "Why:" }),
|
|
134
|
-
|
|
149
|
+
a.reason
|
|
135
150
|
] }),
|
|
136
|
-
/* @__PURE__ */ e(
|
|
137
|
-
(
|
|
151
|
+
/* @__PURE__ */ e(A, { p: a }),
|
|
152
|
+
(a.can_decide || a.can_withdraw) && /* @__PURE__ */ e("div", { className: "mt-3 space-y-2", children: m ? /* @__PURE__ */ r(
|
|
138
153
|
"form",
|
|
139
154
|
{
|
|
140
155
|
className: "space-y-2",
|
|
141
|
-
onSubmit: (
|
|
142
|
-
|
|
156
|
+
onSubmit: (n) => {
|
|
157
|
+
n.preventDefault(), !(o.trim().length < 3 || p) && (b(null), u.mutate({ kind: "decline", note: o.trim() }));
|
|
143
158
|
},
|
|
144
159
|
children: [
|
|
145
|
-
/* @__PURE__ */
|
|
160
|
+
/* @__PURE__ */ r("label", { className: "block", children: [
|
|
146
161
|
/* @__PURE__ */ e("span", { className: "mb-1 block text-[12px] font-medium text-slate-700 dark:text-slate-200", children: "Why are you declining it? The proposer sees this." }),
|
|
147
162
|
/* @__PURE__ */ e(
|
|
148
163
|
"textarea",
|
|
149
164
|
{
|
|
150
|
-
value:
|
|
151
|
-
onChange: (
|
|
165
|
+
value: o,
|
|
166
|
+
onChange: (n) => s(n.target.value),
|
|
152
167
|
rows: 2,
|
|
153
168
|
maxLength: 2e3,
|
|
154
169
|
"data-proposal-decline-note": !0,
|
|
@@ -156,17 +171,17 @@ function V({
|
|
|
156
171
|
}
|
|
157
172
|
)
|
|
158
173
|
] }),
|
|
159
|
-
|
|
160
|
-
/* @__PURE__ */
|
|
161
|
-
/* @__PURE__ */
|
|
174
|
+
h && /* @__PURE__ */ e("p", { role: "alert", className: "text-[12px] text-rose-700 dark:text-rose-300", children: h }),
|
|
175
|
+
/* @__PURE__ */ r("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
176
|
+
/* @__PURE__ */ r(
|
|
162
177
|
"button",
|
|
163
178
|
{
|
|
164
179
|
type: "submit",
|
|
165
|
-
disabled:
|
|
180
|
+
disabled: o.trim().length < 3 || p,
|
|
166
181
|
"data-proposal-decline-confirm": !0,
|
|
167
182
|
className: "inline-flex h-8 items-center gap-1.5 rounded-md bg-rose-600 px-3 text-[12.5px] font-semibold text-white shadow-sm transition-opacity hover:bg-rose-700 disabled:opacity-50",
|
|
168
183
|
children: [
|
|
169
|
-
|
|
184
|
+
p && /* @__PURE__ */ e(v, { className: "h-3.5 w-3.5 animate-spin" }),
|
|
170
185
|
"Decline proposal"
|
|
171
186
|
]
|
|
172
187
|
}
|
|
@@ -176,7 +191,7 @@ function V({
|
|
|
176
191
|
{
|
|
177
192
|
type: "button",
|
|
178
193
|
onClick: () => {
|
|
179
|
-
|
|
194
|
+
t(!1), b(null);
|
|
180
195
|
},
|
|
181
196
|
className: "h-8 rounded-md px-3 text-[12.5px] font-medium text-slate-600 hover:bg-muted dark:text-slate-300",
|
|
182
197
|
children: "Keep it"
|
|
@@ -185,19 +200,19 @@ function V({
|
|
|
185
200
|
] })
|
|
186
201
|
]
|
|
187
202
|
}
|
|
188
|
-
) : /* @__PURE__ */
|
|
189
|
-
|
|
190
|
-
/* @__PURE__ */
|
|
203
|
+
) : /* @__PURE__ */ r("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
204
|
+
a.can_decide && /* @__PURE__ */ r(C, { children: [
|
|
205
|
+
/* @__PURE__ */ r(
|
|
191
206
|
"button",
|
|
192
207
|
{
|
|
193
208
|
type: "button",
|
|
194
|
-
disabled:
|
|
209
|
+
disabled: p || g,
|
|
195
210
|
"data-tip": g ? "A field changed since this was proposed — decline it and ask for a new one" : void 0,
|
|
196
|
-
onClick: () =>
|
|
211
|
+
onClick: () => u.mutate({ kind: "accept" }),
|
|
197
212
|
"data-proposal-accept": !0,
|
|
198
213
|
className: "inline-flex h-8 items-center gap-1.5 rounded-md bg-nvr-cyan px-3 text-[12.5px] font-semibold text-white shadow-sm transition-opacity disabled:opacity-50",
|
|
199
214
|
children: [
|
|
200
|
-
|
|
215
|
+
p ? /* @__PURE__ */ e(v, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ e(T, { className: "h-3.5 w-3.5" }),
|
|
201
216
|
"Accept and apply"
|
|
202
217
|
]
|
|
203
218
|
}
|
|
@@ -206,27 +221,27 @@ function V({
|
|
|
206
221
|
"button",
|
|
207
222
|
{
|
|
208
223
|
type: "button",
|
|
209
|
-
disabled:
|
|
210
|
-
onClick: () =>
|
|
224
|
+
disabled: p,
|
|
225
|
+
onClick: () => t(!0),
|
|
211
226
|
"data-proposal-decline": !0,
|
|
212
227
|
className: "inline-flex h-8 items-center rounded-md border border-input bg-background px-3 text-[12.5px] font-medium text-slate-700 shadow-sm transition-colors hover:bg-muted disabled:opacity-50 dark:text-slate-200",
|
|
213
228
|
children: "Decline"
|
|
214
229
|
}
|
|
215
230
|
)
|
|
216
231
|
] }),
|
|
217
|
-
|
|
232
|
+
a.can_withdraw && /* @__PURE__ */ e(
|
|
218
233
|
"button",
|
|
219
234
|
{
|
|
220
235
|
type: "button",
|
|
221
|
-
disabled:
|
|
222
|
-
onClick: () =>
|
|
236
|
+
disabled: p,
|
|
237
|
+
onClick: () => u.mutate({ kind: "withdraw" }),
|
|
223
238
|
"data-proposal-withdraw": !0,
|
|
224
239
|
className: "inline-flex h-8 items-center rounded-md border border-input bg-background px-3 text-[12.5px] font-medium text-slate-700 shadow-sm transition-colors hover:bg-muted disabled:opacity-50 dark:text-slate-200",
|
|
225
240
|
children: "Withdraw"
|
|
226
241
|
}
|
|
227
242
|
)
|
|
228
243
|
] }) }),
|
|
229
|
-
|
|
244
|
+
a.can_decide && g && !m && /* @__PURE__ */ e(
|
|
230
245
|
"p",
|
|
231
246
|
{
|
|
232
247
|
className: "mt-2 text-[11.5px] text-amber-700 dark:text-amber-400",
|
|
@@ -234,79 +249,79 @@ function V({
|
|
|
234
249
|
children: "A field changed after this was proposed, so it can’t be applied as it stands. Decline it and ask for a new proposal."
|
|
235
250
|
}
|
|
236
251
|
),
|
|
237
|
-
!
|
|
238
|
-
|
|
252
|
+
!a.can_decide && !a.can_withdraw && a.decide_reason && /* @__PURE__ */ e("p", { className: "mt-2 text-[11.5px] text-slate-500 dark:text-muted-foreground", children: a.decide_reason }),
|
|
253
|
+
a.can_withdraw && a.decide_reason && /* @__PURE__ */ e("p", { className: "mt-2 text-[11.5px] text-slate-500 dark:text-muted-foreground", children: "The owners of this step will accept or decline it — you’ll get a notification." })
|
|
239
254
|
]
|
|
240
255
|
}
|
|
241
256
|
);
|
|
242
257
|
}
|
|
243
|
-
function
|
|
244
|
-
collection:
|
|
245
|
-
itemId:
|
|
246
|
-
enabled:
|
|
258
|
+
function le({
|
|
259
|
+
collection: a,
|
|
260
|
+
itemId: d,
|
|
261
|
+
enabled: c
|
|
247
262
|
}) {
|
|
248
|
-
const { data: i } = G(
|
|
249
|
-
if (!(i != null && i.enabled) || !
|
|
250
|
-
const
|
|
251
|
-
return
|
|
263
|
+
const { data: i } = G(a, d, c), [l, m] = f(!1);
|
|
264
|
+
if (!(i != null && i.enabled) || !d) return null;
|
|
265
|
+
const t = i.proposals.filter((s) => s.status === "pending" || s.status === "accepting"), o = i.proposals.filter((s) => !t.includes(s));
|
|
266
|
+
return t.length === 0 && o.length === 0 ? null : /* @__PURE__ */ r(
|
|
252
267
|
"section",
|
|
253
268
|
{
|
|
254
269
|
className: "nvr-expand-in space-y-2",
|
|
255
270
|
"data-change-proposals": !0,
|
|
256
271
|
"aria-label": "Proposed changes",
|
|
257
272
|
children: [
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
/* @__PURE__ */
|
|
273
|
+
t.map((s) => /* @__PURE__ */ e(H, { p: s, collection: a, item: d }, s.id)),
|
|
274
|
+
o.length > 0 && /* @__PURE__ */ r("div", { className: "rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card", children: [
|
|
275
|
+
/* @__PURE__ */ r(
|
|
261
276
|
"button",
|
|
262
277
|
{
|
|
263
278
|
type: "button",
|
|
264
|
-
onClick: () =>
|
|
265
|
-
"aria-expanded":
|
|
279
|
+
onClick: () => m((s) => !s),
|
|
280
|
+
"aria-expanded": l,
|
|
266
281
|
className: "flex w-full items-center gap-1.5 px-4 py-2 text-left text-[12.5px] font-medium text-slate-600 hover:bg-muted dark:text-slate-300",
|
|
267
282
|
children: [
|
|
268
283
|
/* @__PURE__ */ e(
|
|
269
|
-
|
|
284
|
+
K,
|
|
270
285
|
{
|
|
271
|
-
className: N("h-3.5 w-3.5 transition-transform",
|
|
286
|
+
className: N("h-3.5 w-3.5 transition-transform", l && "rotate-90")
|
|
272
287
|
}
|
|
273
288
|
),
|
|
274
289
|
"Earlier proposals (",
|
|
275
|
-
|
|
290
|
+
o.length,
|
|
276
291
|
")"
|
|
277
292
|
]
|
|
278
293
|
}
|
|
279
294
|
),
|
|
280
|
-
|
|
281
|
-
const
|
|
282
|
-
return /* @__PURE__ */
|
|
283
|
-
/* @__PURE__ */
|
|
295
|
+
l && /* @__PURE__ */ e("ul", { className: "divide-y divide-slate-100 border-t border-slate-100 dark:divide-border dark:border-border", children: o.map((s) => {
|
|
296
|
+
const h = _[s.status] ?? _.withdrawn;
|
|
297
|
+
return /* @__PURE__ */ r("li", { className: "space-y-2 px-4 py-3", "data-change-proposal": s.id, children: [
|
|
298
|
+
/* @__PURE__ */ r("div", { className: "flex flex-wrap items-center gap-2 text-[12px]", children: [
|
|
284
299
|
/* @__PURE__ */ e(
|
|
285
300
|
"span",
|
|
286
301
|
{
|
|
287
|
-
className: N("rounded-full px-2 py-0.5 text-[11px] font-medium",
|
|
288
|
-
children:
|
|
302
|
+
className: N("rounded-full px-2 py-0.5 text-[11px] font-medium", h.cls),
|
|
303
|
+
children: h.text
|
|
289
304
|
}
|
|
290
305
|
),
|
|
291
|
-
/* @__PURE__ */
|
|
306
|
+
/* @__PURE__ */ r("span", { className: "text-slate-600 dark:text-slate-300", children: [
|
|
292
307
|
s.created_by_name ?? "Someone",
|
|
293
308
|
" proposed · ",
|
|
294
|
-
|
|
309
|
+
q(s.created_at)
|
|
295
310
|
] }),
|
|
296
|
-
s.decided_by_name && s.status !== "withdrawn" && /* @__PURE__ */
|
|
311
|
+
s.decided_by_name && s.status !== "withdrawn" && /* @__PURE__ */ r("span", { className: "text-slate-500 dark:text-muted-foreground", children: [
|
|
297
312
|
"· ",
|
|
298
|
-
|
|
313
|
+
h.text.toLowerCase(),
|
|
299
314
|
" by ",
|
|
300
315
|
s.decided_by_name
|
|
301
316
|
] })
|
|
302
317
|
] }),
|
|
303
318
|
/* @__PURE__ */ e("p", { className: "text-[12px] text-slate-600 dark:text-slate-400", children: s.reason }),
|
|
304
|
-
s.decision_note && /* @__PURE__ */
|
|
319
|
+
s.decision_note && /* @__PURE__ */ r("p", { className: "text-[12px] text-slate-600 dark:text-slate-400", children: [
|
|
305
320
|
/* @__PURE__ */ e("span", { className: "font-medium", children: "Note:" }),
|
|
306
321
|
" ",
|
|
307
322
|
s.decision_note
|
|
308
323
|
] }),
|
|
309
|
-
/* @__PURE__ */ e(
|
|
324
|
+
/* @__PURE__ */ e(A, { p: s })
|
|
310
325
|
] }, s.id);
|
|
311
326
|
}) })
|
|
312
327
|
] })
|
|
@@ -315,6 +330,6 @@ function ie({
|
|
|
315
330
|
);
|
|
316
331
|
}
|
|
317
332
|
export {
|
|
318
|
-
|
|
333
|
+
le as ChangeProposalsPanel,
|
|
319
334
|
G as useRecordProposals
|
|
320
335
|
};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { jsxs as n, Fragment as
|
|
1
|
+
import { jsxs as n, Fragment as u, jsx as s } from "react/jsx-runtime";
|
|
2
2
|
import { GitPullRequestArrow as c } from "lucide-react";
|
|
3
|
-
import { useState as
|
|
4
|
-
import { useRecordProposals as
|
|
5
|
-
import { ProposeChangeDialog as
|
|
6
|
-
function
|
|
3
|
+
import { useState as m } from "react";
|
|
4
|
+
import { useRecordProposals as d } from "./ChangeProposalsPanel.js";
|
|
5
|
+
import { ProposeChangeDialog as l } from "./ProposeChangeDialog.js";
|
|
6
|
+
function w({
|
|
7
7
|
collection: o,
|
|
8
8
|
itemId: t,
|
|
9
9
|
enabled: a,
|
|
10
10
|
recordLabel: p
|
|
11
11
|
}) {
|
|
12
|
-
const { data: e } =
|
|
13
|
-
return !(e != null && e.enabled) || !e.can_propose || !t ? null : /* @__PURE__ */ n(
|
|
12
|
+
const { data: e } = d(o, t, a), [i, r] = m(!1);
|
|
13
|
+
return !(e != null && e.enabled) || !e.can_propose || !t ? null : /* @__PURE__ */ n(u, { children: [
|
|
14
14
|
/* @__PURE__ */ n(
|
|
15
15
|
"button",
|
|
16
16
|
{
|
|
@@ -18,15 +18,21 @@ function v({
|
|
|
18
18
|
"data-tip": "Suggest new values — the owners of this step accept or decline them",
|
|
19
19
|
"data-propose-change-button": !0,
|
|
20
20
|
onClick: () => r(!0),
|
|
21
|
-
className: "inline-flex h-9 shrink-0 items-center gap-1.5 rounded-md border border-
|
|
21
|
+
className: "inline-flex h-9 shrink-0 items-center gap-1.5 rounded-md border border-input bg-background px-3 text-sm font-medium shadow-sm transition-colors hover:bg-accent hover:text-accent-foreground",
|
|
22
22
|
children: [
|
|
23
|
-
/* @__PURE__ */ s(
|
|
23
|
+
/* @__PURE__ */ s(
|
|
24
|
+
c,
|
|
25
|
+
{
|
|
26
|
+
className: "h-3.5 w-3.5 text-[#0e7490] dark:text-[#67e8f9]",
|
|
27
|
+
"aria-hidden": !0
|
|
28
|
+
}
|
|
29
|
+
),
|
|
24
30
|
"Propose change"
|
|
25
31
|
]
|
|
26
32
|
}
|
|
27
33
|
),
|
|
28
34
|
/* @__PURE__ */ s(
|
|
29
|
-
|
|
35
|
+
l,
|
|
30
36
|
{
|
|
31
37
|
open: i,
|
|
32
38
|
onOpenChange: r,
|
|
@@ -40,5 +46,5 @@ function v({
|
|
|
40
46
|
] });
|
|
41
47
|
}
|
|
42
48
|
export {
|
|
43
|
-
|
|
49
|
+
w as ProposeChangeButton
|
|
44
50
|
};
|