@nivaro/react 0.3.117 → 0.3.119
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 +4451 -4385
- 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 +135 -94
- 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 +88 -85
- 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 +245 -141
- 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 +15 -16
- 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/addendum-view.js +6 -0
- 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 +151 -130
- 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,111 +1,116 @@
|
|
|
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 k, Search as F, Loader2 as R } 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
|
-
import { Popover as B, PopoverTrigger as T, PopoverContent as
|
|
7
|
-
import { useCollectionBody as
|
|
8
|
-
function
|
|
9
|
-
collection:
|
|
10
|
-
fields:
|
|
11
|
-
relations:
|
|
6
|
+
import { Popover as B, PopoverTrigger as T, PopoverContent as W } from "../../ui/popover.js";
|
|
7
|
+
import { useCollectionBody as q } from "../collection-meta.js";
|
|
8
|
+
function V({
|
|
9
|
+
collection: n,
|
|
10
|
+
fields: f,
|
|
11
|
+
relations: u,
|
|
12
12
|
value: r,
|
|
13
|
-
valueLabel:
|
|
14
|
-
onChange:
|
|
15
|
-
onClear:
|
|
16
|
-
placeholder:
|
|
13
|
+
valueLabel: h,
|
|
14
|
+
onChange: a,
|
|
15
|
+
onClear: p,
|
|
16
|
+
placeholder: s,
|
|
17
|
+
walk: v
|
|
17
18
|
}) {
|
|
18
|
-
const [o,
|
|
19
|
-
|
|
19
|
+
const [o, i] = E(!1), [x, m] = E(""), y = O(null), b = O(null), [g, 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 d = (N = y.current) == null ? void 0 : N.getBoundingClientRect();
|
|
25
|
+
if (!d) return;
|
|
26
|
+
const C = Math.min(d.left, window.innerWidth - 288 - 8), j = Math.min(d.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 = (d) => {
|
|
35
|
+
var C, j, N;
|
|
36
|
+
const e = d.target;
|
|
37
|
+
(C = y.current) != null && C.contains(e) || (j = b.current) != null && j.contains(e) || (N = e.closest) != null && N.call(e, "[data-radix-popper-content-wrapper]") || i(!1);
|
|
37
38
|
};
|
|
38
39
|
return document.addEventListener("mousedown", t), () => document.removeEventListener("mousedown", t);
|
|
39
40
|
}, [o]);
|
|
40
|
-
const
|
|
41
|
+
const w = [...f].sort((t, d) => t.field.localeCompare(d.field)).filter((t) => t.field.toLowerCase().includes(x.trim().toLowerCase()));
|
|
41
42
|
return /* @__PURE__ */ c("div", { className: "relative", children: [
|
|
42
43
|
/* @__PURE__ */ c(
|
|
43
44
|
"button",
|
|
44
45
|
{
|
|
45
46
|
type: "button",
|
|
46
|
-
ref:
|
|
47
|
-
onClick: () =>
|
|
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 ${r &&
|
|
47
|
+
ref: y,
|
|
48
|
+
onClick: () => i((t) => !t),
|
|
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 ${r && p ? "pl-2.5 pr-8" : "px-2.5"}`,
|
|
49
50
|
children: [
|
|
50
|
-
/* @__PURE__ */
|
|
51
|
+
/* @__PURE__ */ l(
|
|
51
52
|
"span",
|
|
52
53
|
{
|
|
53
|
-
className:
|
|
54
|
-
|
|
54
|
+
className: (
|
|
55
|
+
// A readable label (valueLabel) reads like the rest of the UI; only a raw path is mono.
|
|
56
|
+
r && h ? "text-[12.5px] flex-1 text-left truncate" : r ? "font-mono text-[12px] flex-1 text-left truncate" : "text-slate-400 flex-1 text-left truncate whitespace-nowrap"
|
|
57
|
+
),
|
|
58
|
+
children: h || r || s || "Select field…"
|
|
55
59
|
}
|
|
56
60
|
),
|
|
57
|
-
/* @__PURE__ */
|
|
61
|
+
/* @__PURE__ */ l(M, { className: "h-3.5 w-3.5 text-slate-400 shrink-0" })
|
|
58
62
|
]
|
|
59
63
|
}
|
|
60
64
|
),
|
|
61
|
-
r &&
|
|
65
|
+
r && p && /* @__PURE__ */ l(
|
|
62
66
|
"button",
|
|
63
67
|
{
|
|
64
68
|
type: "button",
|
|
65
69
|
onClick: (t) => {
|
|
66
|
-
t.stopPropagation(),
|
|
70
|
+
t.stopPropagation(), p();
|
|
67
71
|
},
|
|
68
72
|
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__ */
|
|
73
|
+
children: /* @__PURE__ */ l(k, { className: "h-3 w-3" })
|
|
70
74
|
}
|
|
71
75
|
),
|
|
72
|
-
o &&
|
|
73
|
-
/* @__PURE__ */
|
|
76
|
+
o && g && $(
|
|
77
|
+
/* @__PURE__ */ l(
|
|
74
78
|
"div",
|
|
75
79
|
{
|
|
76
|
-
ref:
|
|
77
|
-
style: { position: "fixed", top:
|
|
80
|
+
ref: b,
|
|
81
|
+
style: { position: "fixed", top: g.top, left: g.left },
|
|
78
82
|
className: "z-50 w-72 rounded-xl border border-slate-200 bg-white shadow-lg dark:border-border dark:bg-card",
|
|
79
83
|
children: /* @__PURE__ */ c("div", { className: "p-2", children: [
|
|
80
84
|
/* @__PURE__ */ c("div", { className: "relative mb-1.5", children: [
|
|
81
|
-
/* @__PURE__ */
|
|
82
|
-
/* @__PURE__ */
|
|
85
|
+
/* @__PURE__ */ l(F, { className: "absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-slate-400" }),
|
|
86
|
+
/* @__PURE__ */ l(
|
|
83
87
|
"input",
|
|
84
88
|
{
|
|
85
|
-
value:
|
|
86
|
-
onChange: (t) =>
|
|
89
|
+
value: x,
|
|
90
|
+
onChange: (t) => m(t.target.value),
|
|
87
91
|
placeholder: "Search fields…",
|
|
88
92
|
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
93
|
}
|
|
90
94
|
)
|
|
91
95
|
] }),
|
|
92
96
|
/* @__PURE__ */ c("div", { className: "max-h-72 overflow-y-auto", children: [
|
|
93
|
-
|
|
94
|
-
|
|
97
|
+
w.map((t) => /* @__PURE__ */ l(
|
|
98
|
+
P,
|
|
95
99
|
{
|
|
96
100
|
field: t,
|
|
97
|
-
collection:
|
|
98
|
-
relations:
|
|
101
|
+
collection: n,
|
|
102
|
+
relations: u,
|
|
99
103
|
pathPrefix: [],
|
|
100
104
|
labelPrefix: [],
|
|
101
105
|
depth: 0,
|
|
102
|
-
|
|
103
|
-
|
|
106
|
+
walk: v,
|
|
107
|
+
onSelect: (d) => {
|
|
108
|
+
a(d), i(!1);
|
|
104
109
|
}
|
|
105
110
|
},
|
|
106
111
|
t.field
|
|
107
112
|
)),
|
|
108
|
-
|
|
113
|
+
w.length === 0 && /* @__PURE__ */ l("div", { className: "px-2 py-3 text-center text-[12px] text-slate-400", children: "No fields" })
|
|
109
114
|
] })
|
|
110
115
|
] })
|
|
111
116
|
}
|
|
@@ -115,116 +120,132 @@ function U({
|
|
|
115
120
|
] });
|
|
116
121
|
}
|
|
117
122
|
function Q({
|
|
118
|
-
relatedCollection:
|
|
119
|
-
pathPrefix:
|
|
120
|
-
labelPrefix:
|
|
121
|
-
onSelect: r
|
|
123
|
+
relatedCollection: n,
|
|
124
|
+
pathPrefix: f,
|
|
125
|
+
labelPrefix: u,
|
|
126
|
+
onSelect: r,
|
|
127
|
+
walk: h
|
|
122
128
|
}) {
|
|
123
|
-
const { data:
|
|
124
|
-
if (
|
|
129
|
+
const { data: a, isLoading: p } = q(n);
|
|
130
|
+
if (p)
|
|
125
131
|
return /* @__PURE__ */ c("div", { className: "py-2 text-[12px] text-slate-400 flex items-center gap-2 px-2", children: [
|
|
126
|
-
/* @__PURE__ */
|
|
132
|
+
/* @__PURE__ */ l(R, { className: "h-3.5 w-3.5 animate-spin" }),
|
|
127
133
|
"Loading…"
|
|
128
134
|
] });
|
|
129
|
-
const
|
|
130
|
-
(o,
|
|
131
|
-
),
|
|
135
|
+
const s = [...((a == null ? void 0 : a.fields) ?? []).filter((o) => !o.hidden)].sort(
|
|
136
|
+
(o, i) => o.field.localeCompare(i.field)
|
|
137
|
+
), v = (a == null ? void 0 : a.relations) ?? [];
|
|
132
138
|
return /* @__PURE__ */ c("div", { className: "max-h-64 overflow-y-auto", children: [
|
|
133
|
-
|
|
134
|
-
|
|
139
|
+
s.map((o) => /* @__PURE__ */ l(
|
|
140
|
+
P,
|
|
135
141
|
{
|
|
136
142
|
field: o,
|
|
137
|
-
collection:
|
|
138
|
-
relations:
|
|
139
|
-
pathPrefix:
|
|
140
|
-
labelPrefix:
|
|
143
|
+
collection: n,
|
|
144
|
+
relations: v,
|
|
145
|
+
pathPrefix: f,
|
|
146
|
+
labelPrefix: u,
|
|
141
147
|
depth: 0,
|
|
148
|
+
walk: h,
|
|
142
149
|
onSelect: r
|
|
143
150
|
},
|
|
144
151
|
o.field
|
|
145
152
|
)),
|
|
146
|
-
|
|
153
|
+
s.length === 0 && /* @__PURE__ */ l("div", { className: "px-2 py-1.5 text-[12px] text-slate-400", children: "No fields" })
|
|
147
154
|
] });
|
|
148
155
|
}
|
|
149
|
-
function
|
|
150
|
-
field:
|
|
151
|
-
collection:
|
|
152
|
-
relations:
|
|
156
|
+
function P({
|
|
157
|
+
field: n,
|
|
158
|
+
collection: f,
|
|
159
|
+
relations: u,
|
|
153
160
|
pathPrefix: r,
|
|
154
|
-
labelPrefix:
|
|
155
|
-
depth:
|
|
156
|
-
onSelect:
|
|
161
|
+
labelPrefix: h,
|
|
162
|
+
depth: a,
|
|
163
|
+
onSelect: p,
|
|
164
|
+
walk: s
|
|
157
165
|
}) {
|
|
158
|
-
const [
|
|
159
|
-
(e) => e.many_collection ===
|
|
160
|
-
) ?? null,
|
|
161
|
-
(e) => e.many_collection ===
|
|
162
|
-
) ?? null,
|
|
163
|
-
(e) => e.one_collection ===
|
|
164
|
-
) ?? null : null,
|
|
165
|
-
(e) => e.one_collection ===
|
|
166
|
-
) ?? null : null,
|
|
167
|
-
(e) => e.many_collection ===
|
|
168
|
-
) ?? null : null,
|
|
169
|
-
|
|
170
|
-
|
|
166
|
+
const [v, o] = E(!1), i = u.find(
|
|
167
|
+
(e) => e.many_collection === f && e.many_field === n.field && e.junction_field === null && e.one_collection
|
|
168
|
+
) ?? null, x = i ? null : u.find(
|
|
169
|
+
(e) => e.many_collection === f && e.many_field === n.field && e.junction_field !== null && e.one_collection
|
|
170
|
+
) ?? null, m = !i && !x ? u.find(
|
|
171
|
+
(e) => e.one_collection === f && e.one_field === n.field && e.junction_field !== null && e.many_collection
|
|
172
|
+
) ?? null : null, y = x ?? m, b = !i && !y ? u.find(
|
|
173
|
+
(e) => e.one_collection === f && e.one_field === n.field && e.junction_field === null && e.many_collection
|
|
174
|
+
) ?? null : null, g = m ? u.find(
|
|
175
|
+
(e) => e.many_collection === m.many_collection && e.many_field === m.junction_field && e.one_collection
|
|
176
|
+
) ?? null : null, L = (i == null ? void 0 : i.one_collection) ?? (x == null ? void 0 : x.one_collection) ?? (g == null ? void 0 : g.one_collection) ?? (m == null ? void 0 : m.many_collection) ?? (b == null ? void 0 : b.many_collection) ?? null;
|
|
177
|
+
if (s != null && s.m2oOnly && L && !i) return null;
|
|
178
|
+
const w = (s == null ? void 0 : s.maxHops) != null && r.length >= s.maxHops ? null : L, t = i ? "M2O" : y ? "M2M" : b ? "O2M" : null, d = typeof window < "u" && window.innerWidth < 640;
|
|
179
|
+
return w ? /* @__PURE__ */ c(B, { open: v, onOpenChange: o, children: [
|
|
180
|
+
/* @__PURE__ */ l(T, { asChild: !0, children: /* @__PURE__ */ c(
|
|
171
181
|
"button",
|
|
172
182
|
{
|
|
173
183
|
type: "button",
|
|
174
|
-
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 +
|
|
184
|
+
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 dark:data-[state=open]:bg-muted",
|
|
185
|
+
style: { paddingLeft: `${0.5 + a * 1}rem` },
|
|
176
186
|
children: [
|
|
177
|
-
/* @__PURE__ */
|
|
178
|
-
|
|
179
|
-
/* @__PURE__ */
|
|
187
|
+
/* @__PURE__ */ l("span", { className: "flex-1", children: _(n.field) }),
|
|
188
|
+
t && /* @__PURE__ */ l("span", { className: "rounded px-1 py-0.5 text-[10px] font-medium bg-slate-100 text-slate-500", children: t }),
|
|
189
|
+
/* @__PURE__ */ l(M, { className: "h-3.5 w-3.5 text-slate-400 shrink-0" })
|
|
180
190
|
]
|
|
181
191
|
}
|
|
182
192
|
) }),
|
|
183
|
-
/* @__PURE__ */ c(
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
193
|
+
/* @__PURE__ */ c(
|
|
194
|
+
W,
|
|
195
|
+
{
|
|
196
|
+
side: d ? "bottom" : "right",
|
|
197
|
+
align: d ? "end" : "start",
|
|
198
|
+
sideOffset: 4,
|
|
199
|
+
collisionPadding: 8,
|
|
200
|
+
className: "w-56 p-1",
|
|
201
|
+
children: [
|
|
202
|
+
(i || y) && /* @__PURE__ */ l(
|
|
203
|
+
"button",
|
|
204
|
+
{
|
|
205
|
+
type: "button",
|
|
206
|
+
onClick: () => {
|
|
207
|
+
p({
|
|
208
|
+
path: [...r, n.field],
|
|
209
|
+
pathLabels: [...h, _(n.field)],
|
|
210
|
+
fieldType: n.type,
|
|
211
|
+
relatedCollection: w ?? void 0
|
|
212
|
+
}), o(!1);
|
|
213
|
+
},
|
|
214
|
+
className: "w-full rounded-md px-2 py-1 text-left text-[12px] text-slate-500 hover:bg-slate-50 italic",
|
|
215
|
+
children: "(select this field)"
|
|
216
|
+
}
|
|
217
|
+
),
|
|
218
|
+
/* @__PURE__ */ l(
|
|
219
|
+
Q,
|
|
220
|
+
{
|
|
221
|
+
relatedCollection: w,
|
|
222
|
+
pathPrefix: [...r, n.field],
|
|
223
|
+
labelPrefix: [...h, _(n.field)],
|
|
224
|
+
walk: s,
|
|
225
|
+
onSelect: (e) => {
|
|
226
|
+
p(e), o(!1);
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
)
|
|
230
|
+
]
|
|
231
|
+
}
|
|
232
|
+
)
|
|
233
|
+
] }) : /* @__PURE__ */ l(
|
|
213
234
|
"button",
|
|
214
235
|
{
|
|
215
236
|
type: "button",
|
|
216
|
-
onClick: () =>
|
|
217
|
-
path: [...r,
|
|
218
|
-
pathLabels: [...
|
|
219
|
-
fieldType:
|
|
220
|
-
relatedCollection:
|
|
237
|
+
onClick: () => p({
|
|
238
|
+
path: [...r, n.field],
|
|
239
|
+
pathLabels: [...h, _(n.field)],
|
|
240
|
+
fieldType: n.type,
|
|
241
|
+
relatedCollection: a > 0 ? f : void 0
|
|
221
242
|
}),
|
|
222
243
|
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: _(
|
|
244
|
+
style: { paddingLeft: `${0.5 + a * 1}rem` },
|
|
245
|
+
children: _(n.field)
|
|
225
246
|
}
|
|
226
247
|
);
|
|
227
248
|
}
|
|
228
249
|
export {
|
|
229
|
-
|
|
250
|
+
V as FieldPicker
|
|
230
251
|
};
|
|
@@ -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
|
};
|