@nivaro/react 0.3.113 → 0.3.115
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/ScreenShareHost.js +24 -0
- package/dist/full.css +50 -2
- package/dist/hooks/useSessionRecorder.js +61 -60
- package/dist/index.d.ts +1727 -19
- package/dist/index.js +1091 -950
- package/dist/shared/components/ActivityEntry.js +209 -97
- package/dist/shared/components/AgentPresenceChip.js +51 -0
- package/dist/shared/components/AnnouncementBanner.js +56 -41
- package/dist/shared/components/AutolinkedText.js +98 -85
- package/dist/shared/components/BroadcastView.js +149 -141
- package/dist/shared/components/CacheStamp.js +78 -30
- package/dist/shared/components/CollectionBrowserView.js +4088 -3592
- package/dist/shared/components/ConfigChangeStrip.js +63 -0
- package/dist/shared/components/ConfigReachNote.js +107 -0
- package/dist/shared/components/ConformanceView.js +389 -319
- package/dist/shared/components/DataTable.js +544 -504
- package/dist/shared/components/DelegateCoverLine.js +164 -0
- package/dist/shared/components/EnvironmentNotice.js +56 -65
- package/dist/shared/components/FilePreviewLightbox.js +89 -43
- package/dist/shared/components/FindingFixedMark.js +23 -0
- package/dist/shared/components/GridPresenceLine.js +100 -0
- package/dist/shared/components/IdleReloadWatcher.js +82 -43
- package/dist/shared/components/InStep.js +46 -0
- package/dist/shared/components/ItemEditForm.js +5504 -4889
- package/dist/shared/components/LiveAnnouncer.js +62 -0
- package/dist/shared/components/LiveCount.js +54 -0
- package/dist/shared/components/LiveFigure.js +28 -0
- package/dist/shared/components/LiveListControls.js +114 -0
- package/dist/shared/components/LiveNewMatchesPill.js +25 -0
- package/dist/shared/components/LiveOffNote.js +44 -0
- package/dist/shared/components/LivePreferenceHost.js +42 -0
- package/dist/shared/components/LiveRowMark.js +25 -20
- package/dist/shared/components/LiveTraceView.js +257 -0
- package/dist/shared/components/MapView.js +30 -29
- package/dist/shared/components/MatrixEditor.js +497 -462
- package/dist/shared/components/MyWorkView.js +346 -272
- package/dist/shared/components/NotificationBell.js +215 -201
- package/dist/shared/components/PageRenderer.js +636 -599
- package/dist/shared/components/PresenceDot.js +21 -0
- package/dist/shared/components/ProfileView.js +656 -536
- package/dist/shared/components/RealtimeStatusBanner.js +25 -25
- package/dist/shared/components/RecentRecordsRail.js +51 -48
- package/dist/shared/components/RecordCompare.js +241 -150
- package/dist/shared/components/RecordDrilldownSheet.js +66 -64
- package/dist/shared/components/RecordGridEditor.js +350 -311
- package/dist/shared/components/RecordHoverCard.js +147 -0
- package/dist/shared/components/RecordPeekHost.js +111 -0
- package/dist/shared/components/RecordReadView.js +414 -412
- package/dist/shared/components/RelativeTime.js +16 -0
- package/dist/shared/components/ReportView.js +1396 -1304
- package/dist/shared/components/ScreenRefreshButton.js +77 -0
- package/dist/shared/components/TabCountHost.js +10 -0
- package/dist/shared/components/TickerNumber.js +19 -18
- package/dist/shared/components/TipLayer.js +70 -58
- package/dist/shared/components/WidgetImageMenu.js +59 -0
- package/dist/shared/components/WidgetSlot.js +571 -524
- package/dist/shared/components/activity/RecordActivityStream.js +317 -0
- package/dist/shared/components/bulk/BulkSelectionNotices.js +220 -0
- package/dist/shared/components/cbv/approval-changed.js +20 -0
- package/dist/shared/components/cbv/changed-by-others.js +251 -0
- package/dist/shared/components/cbv/column-totals.js +75 -67
- package/dist/shared/components/change-proposals/ChangeProposalsPanel.js +320 -0
- package/dist/shared/components/change-proposals/ProposalValue.js +28 -0
- package/dist/shared/components/change-proposals/ProposeChangeButton.js +44 -0
- package/dist/shared/components/change-proposals/ProposeChangeDialog.js +359 -0
- package/dist/shared/components/change-proposals/types.js +4 -0
- package/dist/shared/components/chat/ChatPanel.js +1571 -1528
- package/dist/shared/components/chat/Composer.js +276 -298
- package/dist/shared/components/chat/room-due.js +13 -0
- package/dist/shared/components/collections-directory/CollectionRow.js +76 -75
- package/dist/shared/components/collections-directory/CollectionsDirectory.js +415 -395
- package/dist/shared/components/collections-directory/directory-data.js +75 -63
- package/dist/shared/components/imports/ImportConsole.js +159 -155
- package/dist/shared/components/imports/ImportDuplicatesNotice.js +46 -31
- package/dist/shared/components/integrations/SendStatus.js +202 -0
- package/dist/shared/components/integrations/console/IntegrationsConsole.js +45 -36
- package/dist/shared/components/integrations/console/ReadyToSendView.js +453 -0
- package/dist/shared/components/integrations/console/api.js +161 -117
- package/dist/shared/components/integrations/console/tone.js +15 -12
- package/dist/shared/components/item-edit/CatalogPickerField.js +1353 -1245
- package/dist/shared/components/item-edit/ChangedAfterApprovalBadge.js +162 -0
- package/dist/shared/components/item-edit/CloneDialog.js +208 -206
- package/dist/shared/components/item-edit/DerivedCauseNote.js +57 -0
- package/dist/shared/components/item-edit/DraftRecoveryBanner.js +81 -70
- package/dist/shared/components/item-edit/DuplicateNotice.js +169 -101
- package/dist/shared/components/item-edit/FieldAffordances.js +294 -385
- package/dist/shared/components/item-edit/FieldComments.js +159 -116
- package/dist/shared/components/item-edit/FieldPointer.js +132 -0
- package/dist/shared/components/item-edit/FieldRenderer.js +277 -273
- package/dist/shared/components/item-edit/FieldRow.js +519 -439
- package/dist/shared/components/item-edit/FieldSourceBadge.js +88 -0
- package/dist/shared/components/item-edit/FilePickerField.js +454 -369
- package/dist/shared/components/item-edit/GroupSection.js +618 -567
- package/dist/shared/components/item-edit/HeldEditsChip.js +113 -0
- package/dist/shared/components/item-edit/InlineTableField.js +2891 -2723
- package/dist/shared/components/item-edit/ListNeighborNav.js +79 -0
- package/dist/shared/components/item-edit/LiveTraceSheet.js +26 -0
- package/dist/shared/components/item-edit/M2MCombobox.js +284 -273
- package/dist/shared/components/item-edit/OutboxReviewTray.js +313 -0
- package/dist/shared/components/item-edit/PickerBadges.js +52 -0
- package/dist/shared/components/item-edit/PlanGrid.js +434 -439
- package/dist/shared/components/item-edit/RecalcValue.js +55 -0
- package/dist/shared/components/item-edit/RecordChatActions.js +76 -64
- package/dist/shared/components/item-edit/RecordChatMentionsChip.js +103 -0
- package/dist/shared/components/item-edit/RecordGrantTools.js +87 -86
- package/dist/shared/components/item-edit/RecordHelpChip.js +70 -0
- package/dist/shared/components/item-edit/RecordLiveSync.js +230 -217
- package/dist/shared/components/item-edit/RecordOutbox.js +53 -52
- package/dist/shared/components/item-edit/RecordRecapStrip.js +109 -36
- package/dist/shared/components/item-edit/RelationCombobox.js +229 -217
- package/dist/shared/components/item-edit/RelationGroupedCombobox.js +105 -100
- package/dist/shared/components/item-edit/RemoteChangeUi.js +454 -0
- package/dist/shared/components/item-edit/RemoteUploads.js +55 -0
- package/dist/shared/components/item-edit/RemovedLineNote.js +92 -0
- package/dist/shared/components/item-edit/RichTextEditorImpl.js +298 -223
- package/dist/shared/components/item-edit/ScheduledChangeChip.js +244 -0
- package/dist/shared/components/item-edit/SectionPresence.js +78 -0
- package/dist/shared/components/item-edit/SplitLinesButton.js +166 -0
- package/dist/shared/components/item-edit/catalog-line-watch.js +94 -0
- package/dist/shared/components/item-edit/coedit/collab.js +84 -0
- package/dist/shared/components/item-edit/coedit/context.js +24 -0
- package/dist/shared/components/item-edit/coedit/cursors.js +103 -0
- package/dist/shared/components/item-edit/coedit/safe-link.js +15 -0
- package/dist/shared/components/item-edit/coedit/session.js +382 -0
- package/dist/shared/components/item-edit/coedit/useCoedit.js +49 -0
- package/dist/shared/components/item-edit/file-live.js +77 -0
- package/dist/shared/components/item-edit/file-processing.js +87 -0
- package/dist/shared/components/item-edit/layout-switch.js +148 -0
- package/dist/shared/components/item-edit/live-related.js +23 -0
- package/dist/shared/components/item-edit/live-title.js +66 -0
- package/dist/shared/components/item-edit/partner-needs.js +142 -0
- package/dist/shared/components/item-edit/removed-line.js +58 -0
- package/dist/shared/components/item-edit/render-stability.js +70 -59
- package/dist/shared/components/layout-editor/ChangeNote.js +36 -34
- package/dist/shared/components/layout-editor/CollabParts.js +72 -70
- package/dist/shared/components/layout-editor/LayoutEditor.js +306 -303
- package/dist/shared/components/list/InlineEdit.js +504 -208
- package/dist/shared/components/list/ListViewers.js +81 -0
- package/dist/shared/components/merge/MergeRecordsDialog.js +1227 -0
- package/dist/shared/components/merge/MergeWithFlow.js +290 -0
- package/dist/shared/components/merge/merge-values.js +110 -0
- package/dist/shared/components/monitoring/InactiveUserLinksView.js +285 -258
- package/dist/shared/components/notifications/NotificationCenterView.js +388 -321
- package/dist/shared/components/notifications/NotificationDetailBits.js +205 -130
- package/dist/shared/components/notifications/NotificationRulesEditor.js +72 -52
- package/dist/shared/components/notifications/bundles.js +21 -19
- package/dist/shared/components/notifications/resolved-line.js +25 -0
- package/dist/shared/components/ops/OpsTasksView.js +45 -44
- package/dist/shared/components/panels/AccessGrantedNote.js +85 -0
- package/dist/shared/components/panels/AlertBanners.js +132 -0
- package/dist/shared/components/panels/AsyncUserPicker.js +54 -45
- package/dist/shared/components/panels/BranchLanes.js +82 -54
- package/dist/shared/components/panels/CommentAwareness.js +332 -0
- package/dist/shared/components/panels/CommentImages.js +219 -0
- package/dist/shared/components/panels/CommentPanel.js +649 -530
- package/dist/shared/components/panels/ExternalRequestsChip.js +98 -80
- package/dist/shared/components/panels/NewSinceChip.js +16 -0
- package/dist/shared/components/panels/OwnerOpenedLine.js +85 -0
- package/dist/shared/components/panels/PipelinePanel.js +1644 -1494
- package/dist/shared/components/panels/ResubmissionDiff.js +293 -0
- package/dist/shared/components/panels/SlaBreachBanner.js +30 -29
- package/dist/shared/components/panels/SlaClock.js +130 -99
- package/dist/shared/components/panels/TaskPanel.js +308 -287
- package/dist/shared/components/panels/unseen-move-check.js +101 -0
- package/dist/shared/components/pipeline/OwnerMatrix.js +80 -71
- package/dist/shared/components/pipeline/OwnerMatrixSheet.js +495 -0
- package/dist/shared/components/pipeline/PipelineEditorView.js +1855 -1771
- package/dist/shared/components/profile/AgentNameField.js +141 -0
- package/dist/shared/components/profile/AgentsPanel.js +55 -46
- package/dist/shared/components/profile/PersonAccess.js +398 -330
- package/dist/shared/components/profile/PersonAdminTools.js +127 -113
- package/dist/shared/components/profile/PersonProfile.js +81 -73
- package/dist/shared/components/profile/SignInTroubleshooter.js +361 -0
- package/dist/shared/components/queue/QueueBulkBar.js +101 -84
- package/dist/shared/components/queue/QueueItemSheet.js +66 -66
- package/dist/shared/components/queue/QueueTeamStrip.js +279 -0
- package/dist/shared/components/queue/QueueWorklist.js +2076 -1686
- package/dist/shared/components/queue/queue-totals.js +92 -0
- package/dist/shared/components/queue/worklist-helpers.js +18 -14
- package/dist/shared/components/send-view/SendViewButton.js +136 -0
- package/dist/shared/components/send-view/SentViewCards.js +147 -0
- package/dist/shared/components/support/ReportProblem.js +1 -0
- package/dist/shared/components/support/ScreenShare.js +554 -0
- package/dist/shared/components/support/SupportView.js +160 -129
- package/dist/shared/components/support/TicketDetailSheet.js +101 -89
- package/dist/shared/components/watch-list/WatchDock.js +1044 -0
- package/dist/shared/components/watch-list/WatchExtras.js +723 -0
- package/dist/shared/components/watch-list/WatchListButton.js +46 -0
- package/dist/shared/components/watch-list/WatchPinButton.js +67 -0
- package/dist/shared/components/watch-list/WatchRows.js +348 -0
- package/dist/shared/lib/activity-sentence.js +87 -75
- package/dist/shared/lib/agent-presence.js +46 -0
- package/dist/shared/lib/approval-progress.js +49 -0
- package/dist/shared/lib/attention-prefs.js +27 -0
- package/dist/shared/lib/cell-locks.js +56 -0
- package/dist/shared/lib/co-edit.js +166 -0
- package/dist/shared/lib/coedit-registry.js +44 -0
- package/dist/shared/lib/comment-awareness.js +124 -0
- package/dist/shared/lib/comment-images.js +45 -0
- package/dist/shared/lib/config-watch.js +94 -0
- package/dist/shared/lib/copy-rules.js +65 -0
- package/dist/shared/lib/count-step.js +30 -0
- package/dist/shared/lib/deadline-ticker.js +68 -0
- package/dist/shared/lib/derived-causes.js +115 -0
- package/dist/shared/lib/draft-store.js +114 -85
- package/dist/shared/lib/error-hints.js +1 -0
- package/dist/shared/lib/field-merge.js +126 -0
- package/dist/shared/lib/filter-sentence.js +10 -10
- package/dist/shared/lib/focus-mode.js +16 -12
- package/dist/shared/lib/grid-cursors.js +77 -0
- package/dist/shared/lib/grid-presence.js +182 -0
- package/dist/shared/lib/idle-reload.js +100 -73
- package/dist/shared/lib/in-step.js +45 -0
- package/dist/shared/lib/integration-chip.js +19 -18
- package/dist/shared/lib/line-locks.js +141 -0
- package/dist/shared/lib/line-split.js +41 -0
- package/dist/shared/lib/linked-changes.js +150 -0
- package/dist/shared/lib/list-link.js +56 -50
- package/dist/shared/lib/list-return.js +231 -0
- package/dist/shared/lib/list-viewers.js +52 -0
- package/dist/shared/lib/live-announcer.js +86 -0
- package/dist/shared/lib/live-counts.js +85 -0
- package/dist/shared/lib/live-data-changed.js +108 -0
- package/dist/shared/lib/live-deltas.js +81 -0
- package/dist/shared/lib/live-findings.js +113 -0
- package/dist/shared/lib/live-groups.js +122 -0
- package/dist/shared/lib/live-link-labels.js +162 -0
- package/dist/shared/lib/live-list-flow.js +334 -0
- package/dist/shared/lib/live-list.js +143 -129
- package/dist/shared/lib/live-moves.js +51 -0
- package/dist/shared/lib/live-ops.js +26 -26
- package/dist/shared/lib/live-pickers.js +7 -0
- package/dist/shared/lib/live-preference.js +184 -0
- package/dist/shared/lib/live-queries.js +226 -181
- package/dist/shared/lib/live-screen.js +333 -0
- package/dist/shared/lib/live-search.js +108 -0
- package/dist/shared/lib/live-seen.js +35 -0
- package/dist/shared/lib/live-views.js +100 -0
- package/dist/shared/lib/live.js +159 -133
- package/dist/shared/lib/missed-updates.js +198 -0
- package/dist/shared/lib/newer-file.js +56 -0
- package/dist/shared/lib/notification-sound.js +42 -20
- package/dist/shared/lib/own-writes.js +59 -41
- package/dist/shared/lib/picker-badges.js +94 -0
- package/dist/shared/lib/presence-signals.js +131 -84
- package/dist/shared/lib/realtime.js +49 -24
- package/dist/shared/lib/record-gaps.js +85 -0
- package/dist/shared/lib/record-outbox.js +369 -222
- package/dist/shared/lib/record-peek.js +75 -0
- package/dist/shared/lib/record-tabs.js +92 -72
- package/dist/shared/lib/relative-ticker.js +42 -0
- package/dist/shared/lib/request-gate.js +119 -119
- package/dist/shared/lib/rollup-recalc.js +107 -0
- package/dist/shared/lib/room-gaps.js +40 -36
- package/dist/shared/lib/rum.js +137 -87
- package/dist/shared/lib/save-progress.js +20 -0
- package/dist/shared/lib/scheduled-countdown.js +67 -0
- package/dist/shared/lib/screen-refresh.js +160 -0
- package/dist/shared/lib/screen-share.js +234 -0
- package/dist/shared/lib/seen-since.js +74 -0
- package/dist/shared/lib/selection-watch.js +205 -0
- package/dist/shared/lib/send-status.js +132 -0
- package/dist/shared/lib/send-view.js +23 -0
- package/dist/shared/lib/socket-liveness.js +155 -0
- package/dist/shared/lib/socket-realtime.js +168 -140
- package/dist/shared/lib/state-census.js +53 -0
- package/dist/shared/lib/summary-mode.js +61 -39
- package/dist/shared/lib/tab-attention.js +143 -32
- package/dist/shared/lib/table-density.js +64 -0
- package/dist/shared/lib/track-travel.js +40 -0
- package/dist/shared/lib/unseen-changes.js +68 -0
- package/dist/shared/lib/upload-file.js +33 -0
- package/dist/shared/lib/upload-presence.js +127 -0
- package/dist/shared/lib/urgent-chime.js +65 -0
- package/dist/shared/lib/use-online-users.js +32 -11
- package/dist/shared/lib/user-sync.js +155 -39
- package/dist/shared/lib/waiting-count.js +44 -0
- package/dist/shared/lib/watch-desktop.js +83 -0
- package/dist/shared/lib/watch-list.js +447 -0
- package/dist/shared/lib/widget-image-render.js +64 -0
- package/dist/shared/lib/widget-image.js +111 -0
- package/dist/shared/lib/worker-socket.js +130 -104
- package/dist/shared/lib/write-to-screen.js +133 -0
- package/package.json +1 -1
- package/styles.css +49 -1
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
import { jsx as u, jsxs as v } from "react/jsx-runtime";
|
|
2
|
+
import { useQueryClient as w, useQuery as x } from "@tanstack/react-query";
|
|
3
|
+
import { UserCheck as k } from "lucide-react";
|
|
4
|
+
import { useRef as g, useEffect as p, useMemo as N } from "react";
|
|
5
|
+
import { useNivaroClient as C } from "../context.js";
|
|
6
|
+
import { get as D } from "../lib/commands.js";
|
|
7
|
+
import { useLiveEvent as _, useLiveCollection as M } from "../lib/live.js";
|
|
8
|
+
import { useLiveOps as S } from "../lib/live-ops.js";
|
|
9
|
+
import { cn as h } from "../lib/utils.js";
|
|
10
|
+
import { TickerNumber as T } from "./TickerNumber.js";
|
|
11
|
+
const y = ["my-work-covering"], E = 5e3;
|
|
12
|
+
function $(e, o = /* @__PURE__ */ new Date()) {
|
|
13
|
+
const r = e.first_name || e.name, t = q(e.ends_at, o), a = `You're covering for ${e.name} ${t ?? "today"}`;
|
|
14
|
+
return e.records === 0 ? { lead: a, count: null, tail: `none of ${r}'s records need you right now` } : {
|
|
15
|
+
lead: a,
|
|
16
|
+
count: e.records,
|
|
17
|
+
tail: `of ${r}'s record${e.records === 1 ? "" : "s"} need${e.records === 1 ? "s" : ""} you`
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
function q(e, o = /* @__PURE__ */ new Date()) {
|
|
21
|
+
if (!e) return null;
|
|
22
|
+
const r = new Date(e);
|
|
23
|
+
return !Number.isFinite(r.getTime()) || r.toDateString() === o.toDateString() ? null : `until ${r.toLocaleDateString(void 0, { weekday: "short", month: "short", day: "numeric" })}`;
|
|
24
|
+
}
|
|
25
|
+
function L(e, o = Date.now()) {
|
|
26
|
+
const r = e.map((t) => t.ends_at ? new Date(t.ends_at).getTime() : Number.NaN).filter((t) => Number.isFinite(t) && t > o);
|
|
27
|
+
return r.length ? Math.min(...r) - o : null;
|
|
28
|
+
}
|
|
29
|
+
function Q(e, o) {
|
|
30
|
+
return o.some((r) => {
|
|
31
|
+
const t = e.get(String(r.collection));
|
|
32
|
+
return !!t && (r.item === "*" || t.has(String(r.item)));
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
function O(e = !0) {
|
|
36
|
+
const o = C();
|
|
37
|
+
return x({
|
|
38
|
+
queryKey: y,
|
|
39
|
+
queryFn: () => o.request(D("/my-work/covering")).then((r) => {
|
|
40
|
+
var t;
|
|
41
|
+
return Array.isArray((t = r.data) == null ? void 0 : t.covering) ? r.data.covering : [];
|
|
42
|
+
}),
|
|
43
|
+
enabled: e,
|
|
44
|
+
staleTime: 6e4,
|
|
45
|
+
// Without a socket (or with live updates off) it still catches up now and then.
|
|
46
|
+
refetchInterval: 5 * 6e4
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
function F(e = !0) {
|
|
50
|
+
const o = w(), r = O(e), t = r.data ?? [], a = g(0), c = g(null), i = g(() => {
|
|
51
|
+
});
|
|
52
|
+
i.current = () => {
|
|
53
|
+
if (c.current) return;
|
|
54
|
+
const n = () => {
|
|
55
|
+
c.current = null, a.current = Date.now(), o.invalidateQueries({ queryKey: y });
|
|
56
|
+
}, d = a.current + E - Date.now();
|
|
57
|
+
d <= 0 ? n() : c.current = setTimeout(n, d);
|
|
58
|
+
}, p(
|
|
59
|
+
() => () => {
|
|
60
|
+
c.current && clearTimeout(c.current);
|
|
61
|
+
},
|
|
62
|
+
[]
|
|
63
|
+
), _("owners:changed", () => i.current(), { debounceMs: 1500, enabled: e }), S("my-work", () => i.current(), { debounceMs: 1500, enabled: e });
|
|
64
|
+
const s = N(() => {
|
|
65
|
+
var d;
|
|
66
|
+
const n = /* @__PURE__ */ new Map();
|
|
67
|
+
for (const b of t)
|
|
68
|
+
for (const l of b.keys) {
|
|
69
|
+
const m = l.indexOf(":");
|
|
70
|
+
if (m <= 0) continue;
|
|
71
|
+
const f = l.slice(0, m);
|
|
72
|
+
n.has(f) || n.set(f, /* @__PURE__ */ new Set()), (d = n.get(f)) == null || d.add(l.slice(m + 1));
|
|
73
|
+
}
|
|
74
|
+
return n;
|
|
75
|
+
}, [t]);
|
|
76
|
+
return M(
|
|
77
|
+
[...s.keys()],
|
|
78
|
+
(n) => {
|
|
79
|
+
Q(s, n.events) && i.current();
|
|
80
|
+
},
|
|
81
|
+
{ debounceMs: 1e3, includeOwn: !0, enabled: e && s.size > 0 }
|
|
82
|
+
), p(() => {
|
|
83
|
+
const n = L(t);
|
|
84
|
+
if (n == null || n > 2 ** 31 - 1) return;
|
|
85
|
+
const d = setTimeout(() => i.current(), n + 1e3);
|
|
86
|
+
return () => clearTimeout(d);
|
|
87
|
+
}, [t]), r;
|
|
88
|
+
}
|
|
89
|
+
function P({
|
|
90
|
+
onShow: e,
|
|
91
|
+
showing: o,
|
|
92
|
+
showLabel: r = "Show them",
|
|
93
|
+
className: t
|
|
94
|
+
}) {
|
|
95
|
+
const { data: a } = F(), c = a ?? [];
|
|
96
|
+
return c.length === 0 ? null : /* @__PURE__ */ u(
|
|
97
|
+
"section",
|
|
98
|
+
{
|
|
99
|
+
"data-delegate-cover": !0,
|
|
100
|
+
"aria-label": "Covering for colleagues",
|
|
101
|
+
className: h(
|
|
102
|
+
"rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card",
|
|
103
|
+
t
|
|
104
|
+
),
|
|
105
|
+
children: /* @__PURE__ */ u("ul", { className: "divide-y divide-slate-100 dark:divide-border/60", children: c.map((i) => {
|
|
106
|
+
const s = $(i), n = o != null && o === i.user_id;
|
|
107
|
+
return (
|
|
108
|
+
// Wraps instead of squeezing: in a narrow column (phone, the home side card) the
|
|
109
|
+
// action drops under the sentence; the icon sits in the first line, not a gutter.
|
|
110
|
+
/* @__PURE__ */ v(
|
|
111
|
+
"li",
|
|
112
|
+
{
|
|
113
|
+
"data-delegate-cover-line": i.user_id,
|
|
114
|
+
className: "flex flex-wrap items-center gap-x-4 gap-y-2 px-4 py-2.5",
|
|
115
|
+
children: [
|
|
116
|
+
/* @__PURE__ */ v("p", { className: "min-w-[min(100%,18rem)] flex-1 text-[12.5px] leading-5 text-foreground", children: [
|
|
117
|
+
/* @__PURE__ */ u(
|
|
118
|
+
k,
|
|
119
|
+
{
|
|
120
|
+
className: "-mt-0.5 mr-2 inline-block h-4 w-4 text-nvr-cyan",
|
|
121
|
+
strokeWidth: 2,
|
|
122
|
+
"aria-hidden": !0
|
|
123
|
+
}
|
|
124
|
+
),
|
|
125
|
+
/* @__PURE__ */ u("span", { children: s.lead }),
|
|
126
|
+
/* @__PURE__ */ u("span", { className: "text-muted-foreground", children: " — " }),
|
|
127
|
+
s.count != null && /* @__PURE__ */ v("span", { className: "font-semibold tabular-nums", "data-delegate-cover-count": !0, children: [
|
|
128
|
+
/* @__PURE__ */ u(T, { value: s.count }),
|
|
129
|
+
" "
|
|
130
|
+
] }),
|
|
131
|
+
/* @__PURE__ */ u("span", { className: s.count == null ? "text-muted-foreground" : void 0, children: s.tail })
|
|
132
|
+
] }),
|
|
133
|
+
e && i.records > 0 && /* @__PURE__ */ u(
|
|
134
|
+
"button",
|
|
135
|
+
{
|
|
136
|
+
type: "button",
|
|
137
|
+
onClick: () => e(i),
|
|
138
|
+
"aria-pressed": o !== void 0 ? n : void 0,
|
|
139
|
+
className: h(
|
|
140
|
+
"max-w-full shrink-0 rounded-md border px-2.5 py-1 text-[11.5px] font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan",
|
|
141
|
+
n ? "border-nvr-cyan/50 bg-nvr-cyan/10 text-[#0e7490] dark:text-[#67e8f9]" : "border-slate-200 text-foreground hover:bg-muted dark:border-border"
|
|
142
|
+
),
|
|
143
|
+
children: n ? "Showing" : r
|
|
144
|
+
}
|
|
145
|
+
)
|
|
146
|
+
]
|
|
147
|
+
},
|
|
148
|
+
i.user_id
|
|
149
|
+
)
|
|
150
|
+
);
|
|
151
|
+
}) })
|
|
152
|
+
}
|
|
153
|
+
);
|
|
154
|
+
}
|
|
155
|
+
export {
|
|
156
|
+
y as COVERING_QUERY_KEY,
|
|
157
|
+
P as DelegateCoverLine,
|
|
158
|
+
Q as coverBatchMatters,
|
|
159
|
+
q as coverEnds,
|
|
160
|
+
$ as coverSentence,
|
|
161
|
+
L as nextCoverEnd,
|
|
162
|
+
F as useCovering,
|
|
163
|
+
O as useCoveringQuery
|
|
164
|
+
};
|
|
@@ -1,60 +1,51 @@
|
|
|
1
|
-
import { jsxs as l, jsx as
|
|
2
|
-
import { FlaskConical as
|
|
3
|
-
import { useState as
|
|
1
|
+
import { jsxs as l, jsx as i, Fragment as m } from "react/jsx-runtime";
|
|
2
|
+
import { FlaskConical as f, ArrowUpRight as x } from "lucide-react";
|
|
3
|
+
import { useState as g, useEffect as h } from "react";
|
|
4
|
+
import { useTabTitleLabel as b } from "../lib/tab-attention.js";
|
|
4
5
|
const c = /* @__PURE__ */ new Map();
|
|
5
|
-
function
|
|
6
|
-
let e = c.get(
|
|
7
|
-
return e || (e = fetch(`${
|
|
8
|
-
const
|
|
9
|
-
if (!
|
|
10
|
-
const
|
|
11
|
-
if (!
|
|
12
|
-
const
|
|
6
|
+
function v(r) {
|
|
7
|
+
let e = c.get(r);
|
|
8
|
+
return e || (e = fetch(`${r}/api/app-info`, { credentials: "omit" }).then((n) => n.ok ? n.json() : null).then((n) => {
|
|
9
|
+
const t = n == null ? void 0 : n.environment_notice;
|
|
10
|
+
if (!t || typeof t != "object") return null;
|
|
11
|
+
const s = typeof t.label == "string" ? t.label.trim().slice(0, 40) : "";
|
|
12
|
+
if (!s) return null;
|
|
13
|
+
const d = typeof t.message == "string" ? t.message.trim().slice(0, 200) : "", o = typeof t.production_url == "string" ? t.production_url : null;
|
|
13
14
|
return {
|
|
14
|
-
label:
|
|
15
|
-
message:
|
|
15
|
+
label: s,
|
|
16
|
+
message: d,
|
|
16
17
|
productionUrl: o && /^https:\/\//.test(o) ? o : null,
|
|
17
|
-
inAdminApp:
|
|
18
|
+
inAdminApp: t.in_admin_app !== !1
|
|
18
19
|
};
|
|
19
|
-
}).catch(() => null), c.set(
|
|
20
|
+
}).catch(() => null), c.set(r, e)), e;
|
|
20
21
|
}
|
|
21
|
-
function
|
|
22
|
-
const [e,
|
|
23
|
-
return
|
|
24
|
-
let
|
|
25
|
-
return
|
|
26
|
-
|
|
22
|
+
function p(r = "") {
|
|
23
|
+
const [e, n] = g(null);
|
|
24
|
+
return h(() => {
|
|
25
|
+
let t = !0;
|
|
26
|
+
return v(r).then((s) => {
|
|
27
|
+
t && n(s);
|
|
27
28
|
}), () => {
|
|
28
|
-
|
|
29
|
+
t = !1;
|
|
29
30
|
};
|
|
30
|
-
}, [
|
|
31
|
+
}, [r]), e;
|
|
31
32
|
}
|
|
32
|
-
function
|
|
33
|
-
|
|
34
|
-
if (!i || typeof document > "u") return;
|
|
35
|
-
const e = `${i} · `, t = () => {
|
|
36
|
-
document.title.startsWith(e) || (document.title = e + document.title);
|
|
37
|
-
};
|
|
38
|
-
t();
|
|
39
|
-
const n = document.querySelector("title"), r = n ? new MutationObserver(t) : null;
|
|
40
|
-
return n && r && r.observe(n, { childList: !0, characterData: !0, subtree: !0 }), () => {
|
|
41
|
-
r == null || r.disconnect(), document.title.startsWith(e) && (document.title = document.title.slice(e.length));
|
|
42
|
-
};
|
|
43
|
-
}, [i]);
|
|
33
|
+
function u(r) {
|
|
34
|
+
b(r);
|
|
44
35
|
}
|
|
45
36
|
const a = "repeating-linear-gradient(-45deg, #111827 0 9px, #facc15 9px 18px)";
|
|
46
|
-
function
|
|
47
|
-
const e =
|
|
48
|
-
return
|
|
49
|
-
/* @__PURE__ */
|
|
50
|
-
|
|
37
|
+
function E({ apiBase: r = "" }) {
|
|
38
|
+
const e = p(r);
|
|
39
|
+
return u(e ? e.label : null), e ? /* @__PURE__ */ l(m, { children: [
|
|
40
|
+
/* @__PURE__ */ i(
|
|
41
|
+
w,
|
|
51
42
|
{
|
|
52
43
|
label: e.label,
|
|
53
44
|
message: e.message,
|
|
54
45
|
productionUrl: e.productionUrl
|
|
55
46
|
}
|
|
56
47
|
),
|
|
57
|
-
/* @__PURE__ */
|
|
48
|
+
/* @__PURE__ */ i(
|
|
58
49
|
"div",
|
|
59
50
|
{
|
|
60
51
|
"aria-hidden": !0,
|
|
@@ -65,63 +56,63 @@ function N({ apiBase: i = "" }) {
|
|
|
65
56
|
)
|
|
66
57
|
] }) : null;
|
|
67
58
|
}
|
|
68
|
-
function
|
|
69
|
-
label:
|
|
59
|
+
function w({
|
|
60
|
+
label: r,
|
|
70
61
|
message: e,
|
|
71
|
-
productionUrl:
|
|
72
|
-
preview:
|
|
62
|
+
productionUrl: n,
|
|
63
|
+
preview: t = !1
|
|
73
64
|
}) {
|
|
74
65
|
return /* @__PURE__ */ l(
|
|
75
66
|
"div",
|
|
76
67
|
{
|
|
77
|
-
role:
|
|
68
|
+
role: t ? void 0 : "alert",
|
|
78
69
|
"data-environment-banner": !0,
|
|
79
70
|
className: "relative z-30 flex min-h-[84px] w-full shrink-0 items-stretch bg-[#facc15] text-[#111827] shadow-[0_3px_16px_rgba(17,24,39,0.4)]",
|
|
80
71
|
children: [
|
|
81
|
-
/* @__PURE__ */
|
|
72
|
+
/* @__PURE__ */ i("div", { "aria-hidden": !0, className: "w-8 shrink-0 sm:w-28", style: { backgroundImage: a } }),
|
|
82
73
|
/* @__PURE__ */ l("div", { className: "flex min-w-0 flex-1 flex-wrap items-center justify-center gap-x-6 gap-y-1.5 px-5 py-3 text-center", children: [
|
|
83
74
|
/* @__PURE__ */ l("span", { className: "inline-flex items-center gap-2.5 text-[22px] font-black uppercase leading-none tracking-[0.16em] sm:text-[28px]", children: [
|
|
84
|
-
/* @__PURE__ */
|
|
85
|
-
|
|
75
|
+
/* @__PURE__ */ i(f, { className: "h-6 w-6 sm:h-7 sm:w-7", strokeWidth: 2.6 }),
|
|
76
|
+
r
|
|
86
77
|
] }),
|
|
87
|
-
e && /* @__PURE__ */
|
|
88
|
-
|
|
78
|
+
e && /* @__PURE__ */ i("span", { className: "max-w-[52ch] text-[14px] font-semibold leading-snug sm:text-[15.5px]", children: e }),
|
|
79
|
+
n && /* @__PURE__ */ l(
|
|
89
80
|
"a",
|
|
90
81
|
{
|
|
91
|
-
href:
|
|
92
|
-
onClick:
|
|
82
|
+
href: n,
|
|
83
|
+
onClick: t ? (s) => s.preventDefault() : void 0,
|
|
93
84
|
className: "inline-flex items-center gap-1.5 rounded-md bg-[#111827] px-3.5 py-2 text-[13.5px] font-bold text-[#facc15] transition-colors hover:bg-[#1f2937] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#111827] focus-visible:ring-offset-2 focus-visible:ring-offset-[#facc15]",
|
|
94
85
|
children: [
|
|
95
86
|
"Go to production",
|
|
96
|
-
/* @__PURE__ */
|
|
87
|
+
/* @__PURE__ */ i(x, { className: "h-3.5 w-3.5", strokeWidth: 2.4 })
|
|
97
88
|
]
|
|
98
89
|
}
|
|
99
90
|
)
|
|
100
91
|
] }),
|
|
101
|
-
/* @__PURE__ */
|
|
92
|
+
/* @__PURE__ */ i("div", { "aria-hidden": !0, className: "w-8 shrink-0 sm:w-28", style: { backgroundImage: a } })
|
|
102
93
|
]
|
|
103
94
|
}
|
|
104
95
|
);
|
|
105
96
|
}
|
|
106
|
-
function
|
|
107
|
-
const e =
|
|
108
|
-
return
|
|
97
|
+
function j({ apiBase: r = "" }) {
|
|
98
|
+
const e = p(r), n = e != null && e.inAdminApp ? e : null;
|
|
99
|
+
return u(n ? n.label : null), n ? /* @__PURE__ */ l(
|
|
109
100
|
"div",
|
|
110
101
|
{
|
|
111
102
|
"aria-hidden": !0,
|
|
112
103
|
"data-environment-edge": !0,
|
|
113
104
|
className: "pointer-events-none fixed inset-x-0 top-0 z-[60] flex justify-center",
|
|
114
105
|
children: [
|
|
115
|
-
/* @__PURE__ */
|
|
116
|
-
/* @__PURE__ */
|
|
106
|
+
/* @__PURE__ */ i("div", { className: "absolute inset-x-0 top-0 h-[4px]", style: { backgroundImage: a } }),
|
|
107
|
+
/* @__PURE__ */ i("span", { className: "relative mt-[4px] rounded-b-md bg-[#facc15] px-2.5 pb-[3px] pt-[1px] text-[10.5px] font-extrabold uppercase leading-[14px] tracking-[0.14em] text-[#111827] shadow-[0_2px_6px_rgba(17,24,39,0.3)]", children: n.label })
|
|
117
108
|
]
|
|
118
109
|
}
|
|
119
110
|
) : null;
|
|
120
111
|
}
|
|
121
112
|
export {
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
113
|
+
w as EnvironmentBand,
|
|
114
|
+
j as EnvironmentEdge,
|
|
115
|
+
E as EnvironmentLoginBanner,
|
|
116
|
+
v as readEnvironment,
|
|
117
|
+
p as useInstanceEnvironment
|
|
127
118
|
};
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { jsx as t, jsxs as s } from "react/jsx-runtime";
|
|
2
|
-
import { Download as
|
|
3
|
-
import { useEffect as
|
|
4
|
-
import { createPortal as
|
|
5
|
-
|
|
2
|
+
import { Download as w, RefreshCw as N, X as y } from "lucide-react";
|
|
3
|
+
import { useEffect as k } from "react";
|
|
4
|
+
import { createPortal as P } from "react-dom";
|
|
5
|
+
import { useParentDraft as $ } from "../context.js";
|
|
6
|
+
import { useNewerFile as z, versionedUrl as D } from "../lib/newer-file.js";
|
|
7
|
+
const E = /* @__PURE__ */ new Set([
|
|
6
8
|
"text/plain",
|
|
7
9
|
"text/csv",
|
|
8
10
|
"text/tab-separated-values",
|
|
@@ -10,53 +12,65 @@ const p = /* @__PURE__ */ new Set([
|
|
|
10
12
|
"text/x-markdown",
|
|
11
13
|
"text/x-log"
|
|
12
14
|
]);
|
|
13
|
-
function
|
|
15
|
+
function m(e) {
|
|
14
16
|
return String(e ?? "").split(";")[0].trim().toLowerCase();
|
|
15
17
|
}
|
|
16
|
-
function
|
|
17
|
-
return
|
|
18
|
+
function p(e) {
|
|
19
|
+
return E.has(m(e));
|
|
18
20
|
}
|
|
19
|
-
function
|
|
21
|
+
function S(e) {
|
|
20
22
|
if (!e) return !1;
|
|
21
|
-
const r =
|
|
22
|
-
return r.startsWith("image/") || r === "application/pdf" || r.startsWith("video/") || r.startsWith("audio/") ||
|
|
23
|
+
const r = m(e);
|
|
24
|
+
return r.startsWith("image/") || r === "application/pdf" || r.startsWith("video/") || r.startsWith("audio/") || p(r);
|
|
23
25
|
}
|
|
24
|
-
function
|
|
26
|
+
function F(e) {
|
|
25
27
|
return e == null || !Number.isFinite(e) ? null : e < 1024 ? `${e} B` : e < 1024 * 1024 ? `${(e / 1024).toFixed(1)} KB` : `${(e / (1024 * 1024)).toFixed(1)} MB`;
|
|
26
28
|
}
|
|
27
|
-
function
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
function T({
|
|
30
|
+
file: e,
|
|
31
|
+
onClose: r,
|
|
32
|
+
record: v
|
|
33
|
+
}) {
|
|
34
|
+
var x;
|
|
35
|
+
const n = $(), f = (x = n == null ? void 0 : n.draft) == null ? void 0 : x.id, b = v ?? (n != null && n.collection && f != null && !n.isNew ? { collection: n.collection, itemId: String(f) } : null), { current: l, newer: d, showNewer: g } = z(e.id, b), i = l ? {
|
|
36
|
+
...e,
|
|
37
|
+
url: D(e.url, l),
|
|
38
|
+
name: l.filename_download || l.title || e.name,
|
|
39
|
+
type: l.type ?? e.type,
|
|
40
|
+
size: l.filesize != null ? Number(l.filesize) : e.size
|
|
41
|
+
} : e;
|
|
42
|
+
k(() => {
|
|
43
|
+
const c = (h) => {
|
|
44
|
+
h.key === "Escape" && (h.stopPropagation(), r());
|
|
31
45
|
};
|
|
32
|
-
return window.addEventListener("keydown",
|
|
46
|
+
return window.addEventListener("keydown", c, !0), () => window.removeEventListener("keydown", c, !0);
|
|
33
47
|
}, [r]);
|
|
34
|
-
const a =
|
|
35
|
-
let
|
|
36
|
-
return a.startsWith("image/") ?
|
|
48
|
+
const a = i.type ?? "", u = F(i.size);
|
|
49
|
+
let o;
|
|
50
|
+
return a.startsWith("image/") ? o = /* @__PURE__ */ t(
|
|
37
51
|
"img",
|
|
38
52
|
{
|
|
39
|
-
src:
|
|
40
|
-
alt:
|
|
53
|
+
src: i.url,
|
|
54
|
+
alt: i.name,
|
|
41
55
|
className: "max-h-[82vh] max-w-full rounded object-contain"
|
|
42
56
|
}
|
|
43
|
-
) :
|
|
57
|
+
) : m(a) === "application/pdf" ? o = /* @__PURE__ */ t(
|
|
44
58
|
"iframe",
|
|
45
59
|
{
|
|
46
|
-
src:
|
|
47
|
-
title:
|
|
60
|
+
src: i.url,
|
|
61
|
+
title: i.name,
|
|
48
62
|
className: "h-[82vh] w-[min(920px,92vw)] rounded border-0 bg-white"
|
|
49
63
|
}
|
|
50
|
-
) :
|
|
64
|
+
) : p(a) ? o = /* @__PURE__ */ t(
|
|
51
65
|
"iframe",
|
|
52
66
|
{
|
|
53
|
-
src:
|
|
54
|
-
title:
|
|
67
|
+
src: i.url,
|
|
68
|
+
title: i.name,
|
|
55
69
|
sandbox: "",
|
|
56
70
|
className: "h-[82vh] w-[min(920px,92vw)] rounded border-0 bg-white"
|
|
57
71
|
}
|
|
58
|
-
) : a.startsWith("video/") ?
|
|
59
|
-
/* @__PURE__ */ t("p", { className: "text-[13px] font-medium text-slate-700 dark:text-slate-200", children:
|
|
72
|
+
) : a.startsWith("video/") ? o = /* @__PURE__ */ t("video", { src: i.url, controls: !0, className: "max-h-[82vh] max-w-full rounded" }) : a.startsWith("audio/") ? o = /* @__PURE__ */ t("audio", { src: i.url, controls: !0, className: "w-[min(480px,90vw)]" }) : o = /* @__PURE__ */ s("div", { className: "flex w-[min(420px,90vw)] flex-col items-center gap-3 rounded-lg bg-white p-8 text-center dark:bg-card", children: [
|
|
73
|
+
/* @__PURE__ */ t("p", { className: "text-[13px] font-medium text-slate-700 dark:text-slate-200", children: i.name }),
|
|
60
74
|
/* @__PURE__ */ s("p", { className: "text-[12px] text-slate-500 dark:text-slate-400", children: [
|
|
61
75
|
"No inline preview for this file type",
|
|
62
76
|
a ? ` (${a})` : "",
|
|
@@ -65,15 +79,15 @@ function y({ file: e, onClose: r }) {
|
|
|
65
79
|
/* @__PURE__ */ s(
|
|
66
80
|
"a",
|
|
67
81
|
{
|
|
68
|
-
href: `${e.url}?download=1`,
|
|
82
|
+
href: `${e.url}${e.url.includes("?") ? "&" : "?"}download=1`,
|
|
69
83
|
className: "inline-flex items-center gap-1.5 rounded-md bg-nvr-cyan px-3 py-1.5 text-[12.5px] font-medium text-white hover:brightness-110",
|
|
70
84
|
children: [
|
|
71
|
-
/* @__PURE__ */ t(
|
|
85
|
+
/* @__PURE__ */ t(w, { className: "h-3.5 w-3.5" }),
|
|
72
86
|
" Download"
|
|
73
87
|
]
|
|
74
88
|
}
|
|
75
89
|
)
|
|
76
|
-
] }),
|
|
90
|
+
] }), P(
|
|
77
91
|
// biome-ignore lint/a11y/useKeyWithClickEvents: Escape handled globally above
|
|
78
92
|
/* @__PURE__ */ s(
|
|
79
93
|
"div",
|
|
@@ -85,22 +99,54 @@ function y({ file: e, onClose: r }) {
|
|
|
85
99
|
/* @__PURE__ */ s(
|
|
86
100
|
"div",
|
|
87
101
|
{
|
|
88
|
-
className: "flex items-center gap-3 px-4 py-2.5",
|
|
89
|
-
onClick: (
|
|
102
|
+
className: "flex flex-wrap items-center gap-x-3 gap-y-2 px-4 py-2.5",
|
|
103
|
+
onClick: (c) => c.stopPropagation(),
|
|
90
104
|
onKeyDown: () => {
|
|
91
105
|
},
|
|
92
106
|
children: [
|
|
93
107
|
/* @__PURE__ */ s("p", { className: "min-w-0 flex-1 truncate text-[13px] font-medium text-white", children: [
|
|
94
|
-
|
|
95
|
-
|
|
108
|
+
i.name,
|
|
109
|
+
u && /* @__PURE__ */ t("span", { className: "ml-2 text-[11px] font-normal text-white/60", children: u })
|
|
96
110
|
] }),
|
|
111
|
+
d.kind === "newer" && /* @__PURE__ */ s(
|
|
112
|
+
"p",
|
|
113
|
+
{
|
|
114
|
+
role: "status",
|
|
115
|
+
"data-file-newer": !0,
|
|
116
|
+
className: "nvr-fade-in flex shrink-0 items-center gap-2 rounded-md bg-white/10 py-1 pr-1 pl-2.5 text-[12px] text-white/90 max-sm:order-last max-sm:w-full max-sm:justify-between",
|
|
117
|
+
children: [
|
|
118
|
+
/* @__PURE__ */ t("span", { className: "min-w-0 truncate sm:max-w-[42vw]", children: d.renamed && !d.replaced ? `Renamed to ${d.renamed}` : "A newer version of this file exists" }),
|
|
119
|
+
/* @__PURE__ */ s(
|
|
120
|
+
"button",
|
|
121
|
+
{
|
|
122
|
+
type: "button",
|
|
123
|
+
onClick: g,
|
|
124
|
+
className: "inline-flex shrink-0 items-center gap-1 rounded bg-[#ffffff] px-2 py-0.5 text-[11.5px] font-medium text-[#0f172a] hover:bg-[#e2e8f0] focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[#ffffff]",
|
|
125
|
+
children: [
|
|
126
|
+
/* @__PURE__ */ t(N, { "aria-hidden": !0, className: "h-3 w-3" }),
|
|
127
|
+
" Show newer"
|
|
128
|
+
]
|
|
129
|
+
}
|
|
130
|
+
)
|
|
131
|
+
]
|
|
132
|
+
}
|
|
133
|
+
),
|
|
134
|
+
d.kind === "gone" && /* @__PURE__ */ t(
|
|
135
|
+
"p",
|
|
136
|
+
{
|
|
137
|
+
role: "status",
|
|
138
|
+
"data-file-gone": !0,
|
|
139
|
+
className: "nvr-fade-in shrink-0 rounded-md bg-white/10 px-2.5 py-1 text-[12px] text-white/80 max-sm:order-last max-sm:w-full",
|
|
140
|
+
children: "This file was removed from the record"
|
|
141
|
+
}
|
|
142
|
+
),
|
|
97
143
|
/* @__PURE__ */ t(
|
|
98
144
|
"a",
|
|
99
145
|
{
|
|
100
|
-
href: `${e.url}?download=1`,
|
|
146
|
+
href: `${e.url}${e.url.includes("?") ? "&" : "?"}download=1`,
|
|
101
147
|
title: "Download",
|
|
102
148
|
className: "rounded p-1.5 text-white/80 hover:bg-white/10 hover:text-white",
|
|
103
|
-
children: /* @__PURE__ */ t(
|
|
149
|
+
children: /* @__PURE__ */ t(w, { className: "h-4 w-4" })
|
|
104
150
|
}
|
|
105
151
|
),
|
|
106
152
|
/* @__PURE__ */ t(
|
|
@@ -110,7 +156,7 @@ function y({ file: e, onClose: r }) {
|
|
|
110
156
|
onClick: r,
|
|
111
157
|
title: "Close (Esc)",
|
|
112
158
|
className: "rounded p-1.5 text-white/80 hover:bg-white/10 hover:text-white",
|
|
113
|
-
children: /* @__PURE__ */ t(
|
|
159
|
+
children: /* @__PURE__ */ t(y, { className: "h-4 w-4" })
|
|
114
160
|
}
|
|
115
161
|
)
|
|
116
162
|
]
|
|
@@ -120,10 +166,10 @@ function y({ file: e, onClose: r }) {
|
|
|
120
166
|
"div",
|
|
121
167
|
{
|
|
122
168
|
className: "flex min-h-0 flex-1 items-center justify-center p-4 pt-0",
|
|
123
|
-
onClick: (
|
|
169
|
+
onClick: (c) => c.stopPropagation(),
|
|
124
170
|
onKeyDown: () => {
|
|
125
171
|
},
|
|
126
|
-
children:
|
|
172
|
+
children: o
|
|
127
173
|
}
|
|
128
174
|
)
|
|
129
175
|
]
|
|
@@ -133,6 +179,6 @@ function y({ file: e, onClose: r }) {
|
|
|
133
179
|
);
|
|
134
180
|
}
|
|
135
181
|
export {
|
|
136
|
-
|
|
137
|
-
|
|
182
|
+
T as FilePreviewLightbox,
|
|
183
|
+
S as canPreviewFile
|
|
138
184
|
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsxs as o, jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { Check as m } from "lucide-react";
|
|
3
|
+
import { useContext as d } from "react";
|
|
4
|
+
import { ItemEditAuthContext as a } from "../context.js";
|
|
5
|
+
import { resolvedLabel as x } from "../lib/live-findings.js";
|
|
6
|
+
import { useActorNames as f } from "../lib/live-list.js";
|
|
7
|
+
function g({ mark: e, className: t }) {
|
|
8
|
+
const { userId: r } = d(a), i = f(e.by ? [e.by] : []), n = x(e, e.by ? i.get(e.by) : null, r);
|
|
9
|
+
return /* @__PURE__ */ o(
|
|
10
|
+
"span",
|
|
11
|
+
{
|
|
12
|
+
"data-finding-fixed": !0,
|
|
13
|
+
className: `inline-flex shrink-0 items-center gap-1 text-[11.5px] font-medium text-emerald-700 dark:text-emerald-400 ${t ?? ""}`,
|
|
14
|
+
children: [
|
|
15
|
+
/* @__PURE__ */ s(m, { className: "h-3 w-3", "aria-hidden": !0 }),
|
|
16
|
+
n
|
|
17
|
+
]
|
|
18
|
+
}
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
export {
|
|
22
|
+
g as FindingFixedMark
|
|
23
|
+
};
|