@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
|
@@ -1,112 +1,113 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useQueryClient as
|
|
3
|
-
import { AlertTriangle as
|
|
4
|
-
import { useEffect as f, useSyncExternalStore as
|
|
5
|
-
import { toast as
|
|
6
|
-
import { useNivaroClient as
|
|
7
|
-
import { bindRecordOutbox as
|
|
1
|
+
import { jsx as a, jsxs as c } from "react/jsx-runtime";
|
|
2
|
+
import { useQueryClient as g } from "@tanstack/react-query";
|
|
3
|
+
import { AlertTriangle as w, CloudOff as y, GitMerge as k, RotateCcw as v, Trash2 as N } from "lucide-react";
|
|
4
|
+
import { useEffect as f, useSyncExternalStore as R } from "react";
|
|
5
|
+
import { toast as u } from "sonner";
|
|
6
|
+
import { useNivaroClient as $ } from "../../context.js";
|
|
7
|
+
import { bindRecordOutbox as O, onRecordOutboxEvent as C, subscribeRecordOutbox as j, getRecordOutbox as p } from "../../lib/record-outbox.js";
|
|
8
8
|
import { announceRecordTabs as S } from "../../lib/record-tabs.js";
|
|
9
|
-
import { formatRelative as
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
import { formatRelative as E, formatDate as T } from "../../lib/utils.js";
|
|
10
|
+
import { OutboxReviewTray as A } from "./OutboxReviewTray.js";
|
|
11
|
+
function x() {
|
|
12
|
+
return R(j, p, p);
|
|
12
13
|
}
|
|
13
|
-
function
|
|
14
|
-
const
|
|
15
|
-
return t == null || t === "new" ? null :
|
|
14
|
+
function z(e, t) {
|
|
15
|
+
const n = x();
|
|
16
|
+
return t == null || t === "new" ? null : n.find((o) => o.collection === e && o.item === String(t)) ?? null;
|
|
16
17
|
}
|
|
17
|
-
function
|
|
18
|
+
function F({
|
|
18
19
|
userId: e,
|
|
19
20
|
onOpenRecord: t
|
|
20
21
|
}) {
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
e &&
|
|
24
|
-
}, [
|
|
25
|
-
() =>
|
|
26
|
-
const { collection:
|
|
22
|
+
const n = $(), o = g();
|
|
23
|
+
f(() => {
|
|
24
|
+
e && O(n, e, o);
|
|
25
|
+
}, [n, e, o]), f(
|
|
26
|
+
() => C((r) => {
|
|
27
|
+
const { collection: i, item: l } = r.entry;
|
|
27
28
|
if (r.type === "replayed") {
|
|
28
|
-
S(e, "saved",
|
|
29
|
+
S(e, "saved", i, l), u.success("Your offline change was saved");
|
|
29
30
|
return;
|
|
30
31
|
}
|
|
31
32
|
if (r.type === "expired") {
|
|
32
|
-
|
|
33
|
-
`An unsaved change from ${
|
|
33
|
+
u.info(
|
|
34
|
+
`An unsaved change from ${T(r.entry.created_at)} was discarded — it waited more than a week to be sent`,
|
|
34
35
|
{ duration: 2e4 }
|
|
35
36
|
);
|
|
36
37
|
return;
|
|
37
38
|
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
...c
|
|
42
|
-
}) : b.error(`An offline change could not be saved: ${r.entry.error ?? ""}`, c);
|
|
39
|
+
if (r.type === "conflict" || r.type === "resolved") return;
|
|
40
|
+
const s = t ? { action: { label: "Review", onClick: () => t(i, l) } } : {};
|
|
41
|
+
u.error(`An offline change could not be saved: ${r.entry.error ?? ""}`, s);
|
|
43
42
|
}),
|
|
44
43
|
[e, t]
|
|
45
|
-
)
|
|
44
|
+
);
|
|
45
|
+
const b = x();
|
|
46
|
+
return /* @__PURE__ */ a(A, { entries: b, onOpenRecord: t });
|
|
46
47
|
}
|
|
47
|
-
const
|
|
48
|
+
const Y = (e) => {
|
|
48
49
|
if (e == null || e === "") return "empty";
|
|
49
50
|
if (typeof e == "boolean") return e ? "Yes" : "No";
|
|
50
51
|
const t = typeof e == "object" ? JSON.stringify(e) : String(e);
|
|
51
52
|
return t.length > 60 ? `${t.slice(0, 60)}…` : t;
|
|
52
53
|
};
|
|
53
|
-
function
|
|
54
|
+
function K({
|
|
54
55
|
entry: e,
|
|
55
56
|
labelFor: t,
|
|
56
|
-
onReview:
|
|
57
|
+
onReview: n,
|
|
57
58
|
onRetry: o,
|
|
58
|
-
onDiscard:
|
|
59
|
+
onDiscard: b
|
|
59
60
|
}) {
|
|
60
|
-
const
|
|
61
|
-
return /* @__PURE__ */
|
|
61
|
+
const r = Object.keys(e.payload), i = r.map((m) => t(m) || m), l = `${r.length} field${r.length === 1 ? "" : "s"} (${i.slice(0, 3).join(", ")}${i.length > 3 ? "…" : ""})`, s = e.status === "conflict", d = e.status === "failed";
|
|
62
|
+
return /* @__PURE__ */ c(
|
|
62
63
|
"div",
|
|
63
64
|
{
|
|
64
65
|
role: "status",
|
|
65
66
|
"data-record-outbox": e.status,
|
|
66
67
|
className: "flex flex-wrap items-center gap-2 rounded-lg border border-amber-300 bg-amber-50 px-3.5 py-2.5 text-[12px] text-amber-800 dark:border-amber-500/40 dark:bg-amber-500/10 dark:text-amber-300",
|
|
67
68
|
children: [
|
|
68
|
-
|
|
69
|
-
/* @__PURE__ */
|
|
70
|
-
/* @__PURE__ */
|
|
69
|
+
s || d ? /* @__PURE__ */ a(w, { className: "h-4 w-4 shrink-0 text-amber-500" }) : /* @__PURE__ */ a(y, { className: "h-4 w-4 shrink-0 text-amber-500" }),
|
|
70
|
+
/* @__PURE__ */ c("p", { className: "min-w-0 flex-1", children: [
|
|
71
|
+
/* @__PURE__ */ a("span", { className: "font-semibold", children: s ? "Someone else changed this record while your save was waiting." : d ? "Your offline save was refused." : "Will save when you are back online." }),
|
|
71
72
|
" ",
|
|
72
|
-
d ? e.error ?? "" : `${
|
|
73
|
+
d ? e.error ?? "" : `${l}, saved ${E(e.created_at)}.`
|
|
73
74
|
] }),
|
|
74
|
-
|
|
75
|
+
s && /* @__PURE__ */ c(
|
|
75
76
|
"button",
|
|
76
77
|
{
|
|
77
78
|
type: "button",
|
|
78
|
-
onClick:
|
|
79
|
+
onClick: n,
|
|
79
80
|
"data-record-outbox-review": !0,
|
|
80
81
|
className: "inline-flex h-7 items-center gap-1 rounded-md bg-amber-600 px-2.5 text-[11.5px] font-semibold text-white hover:bg-amber-700",
|
|
81
82
|
children: [
|
|
82
|
-
/* @__PURE__ */
|
|
83
|
+
/* @__PURE__ */ a(k, { className: "h-3 w-3" }),
|
|
83
84
|
" Review"
|
|
84
85
|
]
|
|
85
86
|
}
|
|
86
87
|
),
|
|
87
|
-
d && /* @__PURE__ */
|
|
88
|
+
d && /* @__PURE__ */ c(
|
|
88
89
|
"button",
|
|
89
90
|
{
|
|
90
91
|
type: "button",
|
|
91
92
|
onClick: o,
|
|
92
93
|
className: "inline-flex h-7 items-center gap-1 rounded-md border border-amber-300 px-2.5 text-[11.5px] font-medium hover:bg-amber-100 dark:border-amber-500/40 dark:hover:bg-amber-500/15",
|
|
93
94
|
children: [
|
|
94
|
-
/* @__PURE__ */
|
|
95
|
+
/* @__PURE__ */ a(v, { className: "h-3 w-3" }),
|
|
95
96
|
" Retry"
|
|
96
97
|
]
|
|
97
98
|
}
|
|
98
99
|
),
|
|
99
|
-
/* @__PURE__ */
|
|
100
|
+
/* @__PURE__ */ c(
|
|
100
101
|
"button",
|
|
101
102
|
{
|
|
102
103
|
type: "button",
|
|
103
|
-
onClick:
|
|
104
|
+
onClick: b,
|
|
104
105
|
"data-record-outbox-discard": !0,
|
|
105
|
-
title:
|
|
106
|
+
title: r.map((m, h) => `${i[h]}: ${Y(e.payload[m])}`).join(`
|
|
106
107
|
`),
|
|
107
108
|
className: "inline-flex h-7 items-center gap-1 rounded-md border border-amber-300 px-2.5 text-[11.5px] font-medium hover:bg-amber-100 dark:border-amber-500/40 dark:hover:bg-amber-500/15",
|
|
108
109
|
children: [
|
|
109
|
-
/* @__PURE__ */
|
|
110
|
+
/* @__PURE__ */ a(N, { className: "h-3 w-3" }),
|
|
110
111
|
" Discard"
|
|
111
112
|
]
|
|
112
113
|
}
|
|
@@ -116,8 +117,8 @@ function z({
|
|
|
116
117
|
);
|
|
117
118
|
}
|
|
118
119
|
export {
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
120
|
+
K as RecordOutboxBanner,
|
|
121
|
+
F as RecordOutboxHost,
|
|
122
|
+
x as useRecordOutbox,
|
|
123
|
+
z as useRecordOutboxEntry
|
|
123
124
|
};
|
|
@@ -1,60 +1,131 @@
|
|
|
1
|
-
import { jsxs as l, jsx as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { useNivaroClient as
|
|
5
|
-
import { post as
|
|
6
|
-
import { formatRelative as
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
1
|
+
import { jsxs as l, jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { Mail as v, X as k, History as y } from "lucide-react";
|
|
3
|
+
import { useState as m, useRef as $, useEffect as N } from "react";
|
|
4
|
+
import { useNivaroClient as S } from "../../context.js";
|
|
5
|
+
import { post as x, get as R } from "../../lib/commands.js";
|
|
6
|
+
import { formatRelative as _ } from "../../lib/utils.js";
|
|
7
|
+
import { RelativeTime as C } from "../RelativeTime.js";
|
|
8
|
+
function j(e) {
|
|
9
|
+
try {
|
|
10
|
+
const t = new URLSearchParams(e).get("since");
|
|
11
|
+
return !t || t.length > 40 || !Number.isFinite(Date.parse(t)) ? null : t;
|
|
12
|
+
} catch {
|
|
13
|
+
return null;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
function P(e) {
|
|
17
|
+
const t = [];
|
|
18
|
+
return e.moved_to && t.push(`moved to ${e.moved_to.label}`), e.field_changes > 0 && t.push(`${e.field_changes} field${e.field_changes === 1 ? "" : "s"} changed`), e.comments > 0 && t.push(`${e.comments} new comment${e.comments === 1 ? "" : "s"}`), t;
|
|
19
|
+
}
|
|
20
|
+
function U() {
|
|
21
|
+
try {
|
|
22
|
+
const e = new URL(window.location.href);
|
|
23
|
+
if (!e.searchParams.has("since")) return;
|
|
24
|
+
e.searchParams.delete("since"), window.history.replaceState(window.history.state, "", e.toString());
|
|
25
|
+
} catch {
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
function T({ collection: e, itemId: t }) {
|
|
29
|
+
const i = S(), [n, u] = m(null), [r, h] = m(null), [w, f] = m(!1), c = $(null);
|
|
30
|
+
N(() => {
|
|
31
|
+
const a = `${e}|${t}`;
|
|
32
|
+
if (c.current === a) return;
|
|
33
|
+
c.current = a, u(null), h(null), f(!1), i.request(
|
|
34
|
+
x(`/record-views/${e}/${encodeURIComponent(t)}/touch`, {})
|
|
35
|
+
).then((d) => u(d.data ?? null)).catch(() => {
|
|
36
|
+
c.current = null;
|
|
37
|
+
});
|
|
38
|
+
const g = typeof window > "u" ? null : j(window.location.search);
|
|
39
|
+
g && i.request(
|
|
40
|
+
R(`/record-views/${e}/${encodeURIComponent(t)}/since`, { at: g })
|
|
41
|
+
).then((d) => h(d.data ?? null)).catch(() => {
|
|
42
|
+
});
|
|
43
|
+
}, [i, e, t]);
|
|
44
|
+
const p = () => {
|
|
45
|
+
if (f(!0), r) {
|
|
46
|
+
U();
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
i.request(x(`/record-views/${e}/${encodeURIComponent(t)}/dismiss`, {})).catch(() => {
|
|
22
50
|
});
|
|
23
51
|
};
|
|
24
|
-
if (
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
52
|
+
if (w) return null;
|
|
53
|
+
if (r) {
|
|
54
|
+
const a = P(r);
|
|
55
|
+
return a.length === 0 ? null : /* @__PURE__ */ l(
|
|
56
|
+
"div",
|
|
57
|
+
{
|
|
58
|
+
className: "nvr-expand-in flex items-center gap-2.5 rounded-lg border border-slate-200 bg-slate-50 px-3 py-1.5 dark:border-border dark:bg-white/[0.03]",
|
|
59
|
+
"data-record-since-email": !0,
|
|
60
|
+
children: [
|
|
61
|
+
/* @__PURE__ */ s(v, { className: "h-3.5 w-3.5 shrink-0 text-slate-400 dark:text-slate-500" }),
|
|
62
|
+
/* @__PURE__ */ l(
|
|
63
|
+
"p",
|
|
64
|
+
{
|
|
65
|
+
className: "min-w-0 flex-1 truncate text-[12px] text-slate-600 dark:text-slate-300",
|
|
66
|
+
"data-tip": r.fields.length > 0 ? `Changed: ${r.fields.join(", ")}` : `Email sent ${_(r.since)}`,
|
|
67
|
+
children: [
|
|
68
|
+
/* @__PURE__ */ s("span", { className: "text-slate-500 dark:text-slate-400", children: "Since this email:" }),
|
|
69
|
+
" ",
|
|
70
|
+
r.moved_to && /* @__PURE__ */ s(
|
|
71
|
+
"span",
|
|
72
|
+
{
|
|
73
|
+
"aria-hidden": !0,
|
|
74
|
+
className: "mr-1 inline-block h-1.5 w-1.5 rounded-full align-middle",
|
|
75
|
+
style: { backgroundColor: r.moved_to.color ?? "#94a3b8" }
|
|
76
|
+
}
|
|
77
|
+
),
|
|
78
|
+
/* @__PURE__ */ s("span", { className: "font-medium text-slate-700 dark:text-slate-200", children: a.join(" · ") })
|
|
79
|
+
]
|
|
80
|
+
}
|
|
81
|
+
),
|
|
82
|
+
/* @__PURE__ */ s(
|
|
83
|
+
"button",
|
|
84
|
+
{
|
|
85
|
+
type: "button",
|
|
86
|
+
onClick: p,
|
|
87
|
+
"aria-label": "Dismiss",
|
|
88
|
+
className: "shrink-0 rounded p-0.5 text-slate-400 hover:bg-slate-200/70 hover:text-slate-600 dark:hover:bg-white/10 dark:hover:text-slate-300",
|
|
89
|
+
children: /* @__PURE__ */ s(k, { className: "h-3.5 w-3.5" })
|
|
90
|
+
}
|
|
91
|
+
)
|
|
92
|
+
]
|
|
93
|
+
}
|
|
94
|
+
);
|
|
95
|
+
}
|
|
96
|
+
if (!n) return null;
|
|
97
|
+
const o = [];
|
|
98
|
+
n.field_changes > 0 && o.push(`${n.field_changes} field${n.field_changes === 1 ? "" : "s"} changed`), n.comments > 0 && o.push(`${n.comments} new comment${n.comments === 1 ? "" : "s"}`), n.transitions > 0 && o.push(`${n.transitions} workflow transition${n.transitions === 1 ? "" : "s"}`);
|
|
99
|
+
const b = n.editors.length > 0 ? ` by ${n.editors.join(", ")}` : "";
|
|
28
100
|
return /* @__PURE__ */ l(
|
|
29
101
|
"div",
|
|
30
102
|
{
|
|
31
103
|
className: "nvr-expand-in flex items-center gap-3 rounded-lg border border-sky-200 bg-sky-50 px-3.5 py-2 dark:border-sky-500/30 dark:bg-sky-500/10",
|
|
32
104
|
"data-record-recap": !0,
|
|
33
105
|
children: [
|
|
34
|
-
/* @__PURE__ */
|
|
106
|
+
/* @__PURE__ */ s(y, { className: "h-4 w-4 shrink-0 text-sky-500" }),
|
|
35
107
|
/* @__PURE__ */ l(
|
|
36
108
|
"p",
|
|
37
109
|
{
|
|
38
110
|
className: "min-w-0 flex-1 truncate text-[12px] text-sky-800 dark:text-sky-300",
|
|
39
|
-
"data-tip":
|
|
111
|
+
"data-tip": n.fields.length > 0 ? `Changed: ${n.fields.join(", ")}` : void 0,
|
|
40
112
|
children: [
|
|
41
113
|
"Since you last viewed (",
|
|
42
|
-
|
|
43
|
-
"):",
|
|
44
|
-
" ",
|
|
45
|
-
|
|
46
|
-
h
|
|
114
|
+
/* @__PURE__ */ s(C, { value: n.since }),
|
|
115
|
+
"): ",
|
|
116
|
+
/* @__PURE__ */ s("span", { className: "font-medium", children: o.join(" · ") }),
|
|
117
|
+
b
|
|
47
118
|
]
|
|
48
119
|
}
|
|
49
120
|
),
|
|
50
|
-
/* @__PURE__ */
|
|
121
|
+
/* @__PURE__ */ s(
|
|
51
122
|
"button",
|
|
52
123
|
{
|
|
53
124
|
type: "button",
|
|
54
|
-
onClick:
|
|
125
|
+
onClick: p,
|
|
55
126
|
"aria-label": "Dismiss recap",
|
|
56
127
|
className: "shrink-0 rounded p-0.5 text-sky-400 hover:bg-sky-100 hover:text-sky-600 dark:hover:bg-sky-500/15",
|
|
57
|
-
children: /* @__PURE__ */
|
|
128
|
+
children: /* @__PURE__ */ s(k, { className: "h-3.5 w-3.5" })
|
|
58
129
|
}
|
|
59
130
|
)
|
|
60
131
|
]
|
|
@@ -62,5 +133,7 @@ function _({
|
|
|
62
133
|
);
|
|
63
134
|
}
|
|
64
135
|
export {
|
|
65
|
-
|
|
136
|
+
T as RecordRecapStrip,
|
|
137
|
+
j as emailSinceFromSearch,
|
|
138
|
+
P as emailSinceParts
|
|
66
139
|
};
|