@nivaro/react 0.3.116 → 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 +140 -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 +3855 -3785
- 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/ReportView.js +1086 -1091
- 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/cbv/column-totals.js +62 -57
- 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/charts/category-axis.js +93 -0
- 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/BindingStartStateSettings.js +163 -0
- package/dist/shared/components/pipeline/OwnerMatrixSheet.js +400 -288
- package/dist/shared/components/pipeline/PipelineEditorView.js +320 -299
- 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/use-query-entry.js +17 -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,43 +1,44 @@
|
|
|
1
|
-
import { jsxs as c, jsx as
|
|
2
|
-
import { ChevronRight as M, X as
|
|
3
|
-
import { useState as
|
|
1
|
+
import { jsxs as c, jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import { ChevronRight as M, X as F, Search as R, Loader2 as k } from "lucide-react";
|
|
3
|
+
import { useState as E, useRef as O, useLayoutEffect as z, useEffect as H } from "react";
|
|
4
4
|
import { createPortal as $ } from "react-dom";
|
|
5
5
|
import { titleCase as _ } from "../../../lib/utils.js";
|
|
6
6
|
import { Popover as B, PopoverTrigger as T, PopoverContent as q } from "../../ui/popover.js";
|
|
7
|
-
import { useCollectionBody as
|
|
8
|
-
function
|
|
9
|
-
collection:
|
|
7
|
+
import { useCollectionBody as Q } from "../collection-meta.js";
|
|
8
|
+
function V({
|
|
9
|
+
collection: n,
|
|
10
10
|
fields: d,
|
|
11
|
-
relations:
|
|
12
|
-
value:
|
|
13
|
-
valueLabel:
|
|
14
|
-
onChange:
|
|
15
|
-
onClear:
|
|
16
|
-
placeholder:
|
|
11
|
+
relations: u,
|
|
12
|
+
value: a,
|
|
13
|
+
valueLabel: h,
|
|
14
|
+
onChange: r,
|
|
15
|
+
onClear: f,
|
|
16
|
+
placeholder: i,
|
|
17
|
+
walk: w
|
|
17
18
|
}) {
|
|
18
|
-
const [o, s] =
|
|
19
|
-
|
|
19
|
+
const [o, s] = E(!1), [m, p] = E(""), x = O(null), y = O(null), [b, L] = E(null);
|
|
20
|
+
z(() => {
|
|
20
21
|
if (!o) return;
|
|
21
22
|
const t = () => {
|
|
22
23
|
var N;
|
|
23
|
-
const
|
|
24
|
-
if (!
|
|
25
|
-
const
|
|
26
|
-
|
|
24
|
+
const e = (N = x.current) == null ? void 0 : N.getBoundingClientRect();
|
|
25
|
+
if (!e) return;
|
|
26
|
+
const C = Math.min(e.left, window.innerWidth - 288 - 8), j = Math.min(e.bottom + 4, window.innerHeight - 60);
|
|
27
|
+
L({ top: j, left: Math.max(8, C) });
|
|
27
28
|
};
|
|
28
29
|
return t(), window.addEventListener("scroll", t, !0), window.addEventListener("resize", t), () => {
|
|
29
30
|
window.removeEventListener("scroll", t, !0), window.removeEventListener("resize", t);
|
|
30
31
|
};
|
|
31
|
-
}, [o]),
|
|
32
|
+
}, [o]), H(() => {
|
|
32
33
|
if (!o) return;
|
|
33
|
-
const t = (
|
|
34
|
-
var
|
|
35
|
-
const
|
|
36
|
-
(
|
|
34
|
+
const t = (e) => {
|
|
35
|
+
var C, j, N;
|
|
36
|
+
const v = e.target;
|
|
37
|
+
(C = x.current) != null && C.contains(v) || (j = y.current) != null && j.contains(v) || (N = v.closest) != null && N.call(v, "[data-radix-popper-content-wrapper]") || s(!1);
|
|
37
38
|
};
|
|
38
39
|
return document.addEventListener("mousedown", t), () => document.removeEventListener("mousedown", t);
|
|
39
40
|
}, [o]);
|
|
40
|
-
const
|
|
41
|
+
const g = [...d].sort((t, e) => t.field.localeCompare(e.field)).filter((t) => t.field.toLowerCase().includes(m.trim().toLowerCase()));
|
|
41
42
|
return /* @__PURE__ */ c("div", { className: "relative", children: [
|
|
42
43
|
/* @__PURE__ */ c(
|
|
43
44
|
"button",
|
|
@@ -45,32 +46,32 @@ function U({
|
|
|
45
46
|
type: "button",
|
|
46
47
|
ref: x,
|
|
47
48
|
onClick: () => s((t) => !t),
|
|
48
|
-
className: `flex h-8 w-full items-center justify-between gap-1.5 rounded-md border border-slate-200 bg-white text-[13px] text-slate-700 hover:border-slate-300 ${
|
|
49
|
+
className: `flex h-8 w-full items-center justify-between gap-1.5 rounded-md border border-slate-200 bg-white text-[13px] text-slate-700 hover:border-slate-300 ${a && f ? "pl-2.5 pr-8" : "px-2.5"}`,
|
|
49
50
|
children: [
|
|
50
|
-
/* @__PURE__ */
|
|
51
|
+
/* @__PURE__ */ l(
|
|
51
52
|
"span",
|
|
52
53
|
{
|
|
53
|
-
className:
|
|
54
|
-
children:
|
|
54
|
+
className: a ? "font-mono text-[12px] flex-1 text-left truncate" : "text-slate-400 flex-1 text-left truncate whitespace-nowrap",
|
|
55
|
+
children: h || a || i || "Select field…"
|
|
55
56
|
}
|
|
56
57
|
),
|
|
57
|
-
/* @__PURE__ */
|
|
58
|
+
/* @__PURE__ */ l(M, { className: "h-3.5 w-3.5 text-slate-400 shrink-0" })
|
|
58
59
|
]
|
|
59
60
|
}
|
|
60
61
|
),
|
|
61
|
-
|
|
62
|
+
a && f && /* @__PURE__ */ l(
|
|
62
63
|
"button",
|
|
63
64
|
{
|
|
64
65
|
type: "button",
|
|
65
66
|
onClick: (t) => {
|
|
66
|
-
t.stopPropagation(),
|
|
67
|
+
t.stopPropagation(), f();
|
|
67
68
|
},
|
|
68
69
|
className: "absolute right-2 top-1/2 -translate-y-1/2 flex h-5 w-5 items-center justify-center rounded text-slate-400 hover:bg-slate-100 hover:text-slate-600 dark:hover:bg-muted dark:hover:text-slate-300",
|
|
69
|
-
children: /* @__PURE__ */
|
|
70
|
+
children: /* @__PURE__ */ l(F, { className: "h-3 w-3" })
|
|
70
71
|
}
|
|
71
72
|
),
|
|
72
73
|
o && b && $(
|
|
73
|
-
/* @__PURE__ */
|
|
74
|
+
/* @__PURE__ */ l(
|
|
74
75
|
"div",
|
|
75
76
|
{
|
|
76
77
|
ref: y,
|
|
@@ -78,34 +79,35 @@ function U({
|
|
|
78
79
|
className: "z-50 w-72 rounded-xl border border-slate-200 bg-white shadow-lg dark:border-border dark:bg-card",
|
|
79
80
|
children: /* @__PURE__ */ c("div", { className: "p-2", children: [
|
|
80
81
|
/* @__PURE__ */ c("div", { className: "relative mb-1.5", children: [
|
|
81
|
-
/* @__PURE__ */
|
|
82
|
-
/* @__PURE__ */
|
|
82
|
+
/* @__PURE__ */ l(R, { className: "absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-slate-400" }),
|
|
83
|
+
/* @__PURE__ */ l(
|
|
83
84
|
"input",
|
|
84
85
|
{
|
|
85
86
|
value: m,
|
|
86
|
-
onChange: (t) =>
|
|
87
|
+
onChange: (t) => p(t.target.value),
|
|
87
88
|
placeholder: "Search fields…",
|
|
88
89
|
className: "h-8 w-full rounded-md border border-slate-200 bg-slate-50 pl-8 pr-3 text-[13px] placeholder-slate-400 focus:border-nvr-cyan/50 focus:outline-none focus:ring-2 focus:ring-nvr-cyan/30"
|
|
89
90
|
}
|
|
90
91
|
)
|
|
91
92
|
] }),
|
|
92
93
|
/* @__PURE__ */ c("div", { className: "max-h-72 overflow-y-auto", children: [
|
|
93
|
-
|
|
94
|
-
|
|
94
|
+
g.map((t) => /* @__PURE__ */ l(
|
|
95
|
+
P,
|
|
95
96
|
{
|
|
96
97
|
field: t,
|
|
97
|
-
collection:
|
|
98
|
-
relations:
|
|
98
|
+
collection: n,
|
|
99
|
+
relations: u,
|
|
99
100
|
pathPrefix: [],
|
|
100
101
|
labelPrefix: [],
|
|
101
102
|
depth: 0,
|
|
102
|
-
|
|
103
|
-
|
|
103
|
+
walk: w,
|
|
104
|
+
onSelect: (e) => {
|
|
105
|
+
r(e), s(!1);
|
|
104
106
|
}
|
|
105
107
|
},
|
|
106
108
|
t.field
|
|
107
109
|
)),
|
|
108
|
-
|
|
110
|
+
g.length === 0 && /* @__PURE__ */ l("div", { className: "px-2 py-3 text-center text-[12px] text-slate-400", children: "No fields" })
|
|
109
111
|
] })
|
|
110
112
|
] })
|
|
111
113
|
}
|
|
@@ -114,117 +116,123 @@ function U({
|
|
|
114
116
|
)
|
|
115
117
|
] });
|
|
116
118
|
}
|
|
117
|
-
function
|
|
118
|
-
relatedCollection:
|
|
119
|
+
function W({
|
|
120
|
+
relatedCollection: n,
|
|
119
121
|
pathPrefix: d,
|
|
120
|
-
labelPrefix:
|
|
121
|
-
onSelect:
|
|
122
|
+
labelPrefix: u,
|
|
123
|
+
onSelect: a,
|
|
124
|
+
walk: h
|
|
122
125
|
}) {
|
|
123
|
-
const { data:
|
|
124
|
-
if (
|
|
126
|
+
const { data: r, isLoading: f } = Q(n);
|
|
127
|
+
if (f)
|
|
125
128
|
return /* @__PURE__ */ c("div", { className: "py-2 text-[12px] text-slate-400 flex items-center gap-2 px-2", children: [
|
|
126
|
-
/* @__PURE__ */
|
|
129
|
+
/* @__PURE__ */ l(k, { className: "h-3.5 w-3.5 animate-spin" }),
|
|
127
130
|
"Loading…"
|
|
128
131
|
] });
|
|
129
|
-
const
|
|
132
|
+
const i = [...((r == null ? void 0 : r.fields) ?? []).filter((o) => !o.hidden)].sort(
|
|
130
133
|
(o, s) => o.field.localeCompare(s.field)
|
|
131
|
-
),
|
|
134
|
+
), w = (r == null ? void 0 : r.relations) ?? [];
|
|
132
135
|
return /* @__PURE__ */ c("div", { className: "max-h-64 overflow-y-auto", children: [
|
|
133
|
-
|
|
134
|
-
|
|
136
|
+
i.map((o) => /* @__PURE__ */ l(
|
|
137
|
+
P,
|
|
135
138
|
{
|
|
136
139
|
field: o,
|
|
137
|
-
collection:
|
|
138
|
-
relations:
|
|
140
|
+
collection: n,
|
|
141
|
+
relations: w,
|
|
139
142
|
pathPrefix: d,
|
|
140
|
-
labelPrefix:
|
|
143
|
+
labelPrefix: u,
|
|
141
144
|
depth: 0,
|
|
142
|
-
|
|
145
|
+
walk: h,
|
|
146
|
+
onSelect: a
|
|
143
147
|
},
|
|
144
148
|
o.field
|
|
145
149
|
)),
|
|
146
|
-
|
|
150
|
+
i.length === 0 && /* @__PURE__ */ l("div", { className: "px-2 py-1.5 text-[12px] text-slate-400", children: "No fields" })
|
|
147
151
|
] });
|
|
148
152
|
}
|
|
149
|
-
function
|
|
150
|
-
field:
|
|
153
|
+
function P({
|
|
154
|
+
field: n,
|
|
151
155
|
collection: d,
|
|
152
|
-
relations:
|
|
153
|
-
pathPrefix:
|
|
154
|
-
labelPrefix:
|
|
155
|
-
depth:
|
|
156
|
-
onSelect:
|
|
156
|
+
relations: u,
|
|
157
|
+
pathPrefix: a,
|
|
158
|
+
labelPrefix: h,
|
|
159
|
+
depth: r,
|
|
160
|
+
onSelect: f,
|
|
161
|
+
walk: i
|
|
157
162
|
}) {
|
|
158
|
-
const [
|
|
159
|
-
(e) => e.many_collection === d && e.many_field ===
|
|
160
|
-
) ?? null, m = s ? null :
|
|
161
|
-
(e) => e.many_collection === d && e.many_field ===
|
|
162
|
-
) ?? null,
|
|
163
|
-
(e) => e.one_collection === d && e.one_field ===
|
|
164
|
-
) ?? null : null, x = m ??
|
|
165
|
-
(e) => e.one_collection === d && e.one_field ===
|
|
166
|
-
) ?? null : null, b =
|
|
167
|
-
(e) => e.many_collection ===
|
|
168
|
-
) ?? null : null,
|
|
169
|
-
|
|
170
|
-
|
|
163
|
+
const [w, o] = E(!1), s = u.find(
|
|
164
|
+
(e) => e.many_collection === d && e.many_field === n.field && e.junction_field === null && e.one_collection
|
|
165
|
+
) ?? null, m = s ? null : u.find(
|
|
166
|
+
(e) => e.many_collection === d && e.many_field === n.field && e.junction_field !== null && e.one_collection
|
|
167
|
+
) ?? null, p = !s && !m ? u.find(
|
|
168
|
+
(e) => e.one_collection === d && e.one_field === n.field && e.junction_field !== null && e.many_collection
|
|
169
|
+
) ?? null : null, x = m ?? p, y = !s && !x ? u.find(
|
|
170
|
+
(e) => e.one_collection === d && e.one_field === n.field && e.junction_field === null && e.many_collection
|
|
171
|
+
) ?? null : null, b = p ? u.find(
|
|
172
|
+
(e) => e.many_collection === p.many_collection && e.many_field === p.junction_field && e.one_collection
|
|
173
|
+
) ?? null : null, L = (s == null ? void 0 : s.one_collection) ?? (m == null ? void 0 : m.one_collection) ?? (b == null ? void 0 : b.one_collection) ?? (p == null ? void 0 : p.many_collection) ?? (y == null ? void 0 : y.many_collection) ?? null;
|
|
174
|
+
if (i != null && i.m2oOnly && L && !s) return null;
|
|
175
|
+
const g = (i == null ? void 0 : i.maxHops) != null && a.length >= i.maxHops ? null : L, t = s ? "M2O" : x ? "M2M" : y ? "O2M" : null;
|
|
176
|
+
return g ? /* @__PURE__ */ c(B, { open: w, onOpenChange: o, children: [
|
|
177
|
+
/* @__PURE__ */ l(T, { asChild: !0, children: /* @__PURE__ */ c(
|
|
171
178
|
"button",
|
|
172
179
|
{
|
|
173
180
|
type: "button",
|
|
174
181
|
className: "flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-[13px] text-slate-700 hover:bg-slate-50 data-[state=open]:bg-slate-100",
|
|
175
|
-
style: { paddingLeft: `${0.5 +
|
|
182
|
+
style: { paddingLeft: `${0.5 + r * 1}rem` },
|
|
176
183
|
children: [
|
|
177
|
-
/* @__PURE__ */
|
|
178
|
-
|
|
179
|
-
/* @__PURE__ */
|
|
184
|
+
/* @__PURE__ */ l("span", { className: "flex-1", children: _(n.field) }),
|
|
185
|
+
t && /* @__PURE__ */ l("span", { className: "rounded px-1 py-0.5 text-[10px] font-medium bg-slate-100 text-slate-500", children: t }),
|
|
186
|
+
/* @__PURE__ */ l(M, { className: "h-3.5 w-3.5 text-slate-400 shrink-0" })
|
|
180
187
|
]
|
|
181
188
|
}
|
|
182
189
|
) }),
|
|
183
190
|
/* @__PURE__ */ c(q, { side: "right", align: "start", sideOffset: 4, className: "w-56 p-1", children: [
|
|
184
|
-
(s || x) && /* @__PURE__ */
|
|
191
|
+
(s || x) && /* @__PURE__ */ l(
|
|
185
192
|
"button",
|
|
186
193
|
{
|
|
187
194
|
type: "button",
|
|
188
195
|
onClick: () => {
|
|
189
|
-
|
|
190
|
-
path: [...
|
|
191
|
-
pathLabels: [...
|
|
192
|
-
fieldType:
|
|
193
|
-
relatedCollection:
|
|
196
|
+
f({
|
|
197
|
+
path: [...a, n.field],
|
|
198
|
+
pathLabels: [...h, _(n.field)],
|
|
199
|
+
fieldType: n.type,
|
|
200
|
+
relatedCollection: g ?? void 0
|
|
194
201
|
}), o(!1);
|
|
195
202
|
},
|
|
196
203
|
className: "w-full rounded-md px-2 py-1 text-left text-[12px] text-slate-500 hover:bg-slate-50 italic",
|
|
197
204
|
children: "(select this field)"
|
|
198
205
|
}
|
|
199
206
|
),
|
|
200
|
-
/* @__PURE__ */
|
|
201
|
-
|
|
207
|
+
/* @__PURE__ */ l(
|
|
208
|
+
W,
|
|
202
209
|
{
|
|
203
|
-
relatedCollection:
|
|
204
|
-
pathPrefix: [...
|
|
205
|
-
labelPrefix: [...
|
|
210
|
+
relatedCollection: g,
|
|
211
|
+
pathPrefix: [...a, n.field],
|
|
212
|
+
labelPrefix: [...h, _(n.field)],
|
|
213
|
+
walk: i,
|
|
206
214
|
onSelect: (e) => {
|
|
207
|
-
|
|
215
|
+
f(e), o(!1);
|
|
208
216
|
}
|
|
209
217
|
}
|
|
210
218
|
)
|
|
211
219
|
] })
|
|
212
|
-
] }) : /* @__PURE__ */
|
|
220
|
+
] }) : /* @__PURE__ */ l(
|
|
213
221
|
"button",
|
|
214
222
|
{
|
|
215
223
|
type: "button",
|
|
216
|
-
onClick: () =>
|
|
217
|
-
path: [...
|
|
218
|
-
pathLabels: [...
|
|
219
|
-
fieldType:
|
|
220
|
-
relatedCollection:
|
|
224
|
+
onClick: () => f({
|
|
225
|
+
path: [...a, n.field],
|
|
226
|
+
pathLabels: [...h, _(n.field)],
|
|
227
|
+
fieldType: n.type,
|
|
228
|
+
relatedCollection: r > 0 ? d : void 0
|
|
221
229
|
}),
|
|
222
230
|
className: "w-full rounded-md px-2 py-1.5 text-left text-[13px] text-slate-700 hover:bg-slate-50",
|
|
223
|
-
style: { paddingLeft: `${0.5 +
|
|
224
|
-
children: _(
|
|
231
|
+
style: { paddingLeft: `${0.5 + r * 1}rem` },
|
|
232
|
+
children: _(n.field)
|
|
225
233
|
}
|
|
226
234
|
);
|
|
227
235
|
}
|
|
228
236
|
export {
|
|
229
|
-
|
|
237
|
+
V as FieldPicker
|
|
230
238
|
};
|
|
@@ -1,25 +1,26 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as i, jsxs as d } from "react/jsx-runtime";
|
|
2
2
|
import { useItemEditAuth as f } from "../../context.js";
|
|
3
3
|
import { useListViewers as g, viewersSentence as x } from "../../lib/list-viewers.js";
|
|
4
4
|
import { cn as s } from "../../lib/utils.js";
|
|
5
|
-
import { UserAvatar as
|
|
6
|
-
|
|
5
|
+
import { UserAvatar as b } from "../UserAvatar.js";
|
|
6
|
+
import { UserChip as w } from "../item-edit/UserChip.js";
|
|
7
|
+
function k(r) {
|
|
7
8
|
var n;
|
|
8
|
-
const t =
|
|
9
|
+
const t = r.trim().split(/\s+/).filter(Boolean);
|
|
9
10
|
return ((((n = t[0]) == null ? void 0 : n[0]) ?? "") + (t.length > 1 ? t[t.length - 1][0] ?? "" : "")).toUpperCase().slice(0, 2);
|
|
10
11
|
}
|
|
11
|
-
const
|
|
12
|
-
function
|
|
13
|
-
kind:
|
|
12
|
+
const N = 3, h = "w-[84px]";
|
|
13
|
+
function C({
|
|
14
|
+
kind: r,
|
|
14
15
|
id: t,
|
|
15
16
|
variant: n = "inline",
|
|
16
17
|
selfId: l,
|
|
17
|
-
className:
|
|
18
|
+
className: a
|
|
18
19
|
}) {
|
|
19
|
-
const { isAdmin: o } = f(), e = g(
|
|
20
|
+
const { isAdmin: o } = f(), e = g(r, t, !0, l), c = n === "inline";
|
|
20
21
|
if (e.length === 0)
|
|
21
|
-
return c && o ? /* @__PURE__ */
|
|
22
|
-
const
|
|
22
|
+
return c && o ? /* @__PURE__ */ i("span", { "aria-hidden": !0, className: s("h-8 shrink-0", h, a) }) : null;
|
|
23
|
+
const u = x(e), m = `Viewing now: ${e.map((p) => p.name).join(", ")}`;
|
|
23
24
|
return /* @__PURE__ */ d(
|
|
24
25
|
"span",
|
|
25
26
|
{
|
|
@@ -30,36 +31,46 @@ function A({
|
|
|
30
31
|
className: s(
|
|
31
32
|
"nvr-fade-in inline-flex shrink-0 items-center gap-2 text-[12px] text-slate-500 dark:text-slate-400",
|
|
32
33
|
c ? s("h-8 justify-end", h) : "h-7",
|
|
33
|
-
|
|
34
|
+
a
|
|
34
35
|
),
|
|
35
36
|
children: [
|
|
36
|
-
/* @__PURE__ */
|
|
37
|
-
!c && /* @__PURE__ */
|
|
37
|
+
/* @__PURE__ */ i(v, { viewers: e, ring: c ? "toolbar" : "header" }),
|
|
38
|
+
!c && /* @__PURE__ */ i("span", { className: "hidden whitespace-nowrap md:inline", children: u })
|
|
38
39
|
]
|
|
39
40
|
}
|
|
40
41
|
);
|
|
41
42
|
}
|
|
42
|
-
function
|
|
43
|
-
const n =
|
|
43
|
+
function v({ viewers: r, ring: t }) {
|
|
44
|
+
const n = r.slice(0, N), l = r.length - n.length, a = t === "header" ? "ring-2 ring-white dark:ring-card" : "ring-2 ring-white dark:ring-slate-900", o = s("inline-flex h-6 w-6 shrink-0 items-center justify-center rounded-full", a);
|
|
44
45
|
return /* @__PURE__ */ d("span", { className: "flex -space-x-0.5", children: [
|
|
45
|
-
n.map((e) =>
|
|
46
|
-
|
|
47
|
-
{
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
"
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
46
|
+
n.map((e) => (
|
|
47
|
+
// Each face opens that person's user card, like avatars everywhere else.
|
|
48
|
+
/* @__PURE__ */ i(w, { userId: e.id, children: /* @__PURE__ */ i(
|
|
49
|
+
"button",
|
|
50
|
+
{
|
|
51
|
+
type: "button",
|
|
52
|
+
"aria-label": e.name,
|
|
53
|
+
className: "relative rounded-full hover:z-10 focus-visible:z-10 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan",
|
|
54
|
+
children: /* @__PURE__ */ i(
|
|
55
|
+
b,
|
|
56
|
+
{
|
|
57
|
+
userId: e.id,
|
|
58
|
+
alt: "",
|
|
59
|
+
className: s("h-6 w-6 shrink-0 rounded-full object-cover", a),
|
|
60
|
+
fallback: /* @__PURE__ */ i(
|
|
61
|
+
"span",
|
|
62
|
+
{
|
|
63
|
+
className: s(
|
|
64
|
+
o,
|
|
65
|
+
"bg-slate-200 text-[9.5px] font-semibold text-slate-700 dark:bg-slate-700 dark:text-slate-100"
|
|
66
|
+
),
|
|
67
|
+
children: k(e.name)
|
|
68
|
+
}
|
|
69
|
+
)
|
|
70
|
+
}
|
|
71
|
+
)
|
|
72
|
+
}
|
|
73
|
+
) }, e.id)
|
|
63
74
|
)),
|
|
64
75
|
l > 0 && /* @__PURE__ */ d(
|
|
65
76
|
"span",
|
|
@@ -77,5 +88,5 @@ function N({ viewers: i, ring: t }) {
|
|
|
77
88
|
] });
|
|
78
89
|
}
|
|
79
90
|
export {
|
|
80
|
-
|
|
91
|
+
C as ListViewers
|
|
81
92
|
};
|