@nivaro/react 0.3.114 → 0.3.116
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 +1728 -22
- 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 +4909 -4182
- 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 +612 -551
- 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/OverflowRail.js +326 -0
- 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/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/SignalCard.js +84 -77
- 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/list/PhonePager.js +50 -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 +389 -323
- 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 +2050 -1942
- 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/OwnerAvatars.js +9 -9
- 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 +2407 -1950
- package/dist/shared/components/queue/worklist-helpers.js +10 -6
- 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/ui/popover.js +53 -29
- 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/keep-row-focus.js +43 -0
- 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-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/obligation-banner.js +17 -17
- 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/rail-menu-context.js +9 -0
- 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/row-surface.js +7 -0
- 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/table-pins.js +20 -18
- 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 +62 -0
- package/dist/shared/lib/upload-presence.js +127 -0
- package/dist/shared/lib/urgent-chime.js +65 -0
- package/dist/shared/lib/use-below-md.js +29 -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
|
@@ -5,7 +5,7 @@ function M(e) {
|
|
|
5
5
|
const o = (e.changes ?? []).filter((s) => s && i(s.label)).map((s) => `${i(s.label)} ${i(s.from) || "—"} → ${i(s.to) || "—"}`);
|
|
6
6
|
return o.length ? `changed ${r}: ${o.join(", ")}` : `changed ${r}`;
|
|
7
7
|
}
|
|
8
|
-
const
|
|
8
|
+
const k = "a record you can't see", U = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i, W = {
|
|
9
9
|
ai: "AI",
|
|
10
10
|
api: "API",
|
|
11
11
|
csv: "CSV",
|
|
@@ -46,7 +46,7 @@ function V(e) {
|
|
|
46
46
|
function O(e) {
|
|
47
47
|
return F(e).map((n) => W[n.toLowerCase()] ?? n.charAt(0).toUpperCase() + n.slice(1).toLowerCase()).join(" ");
|
|
48
48
|
}
|
|
49
|
-
function
|
|
49
|
+
function Q(e) {
|
|
50
50
|
return /ies$/i.test(e) ? e.replace(/ies$/i, (n) => n === "IES" ? "Y" : "y") : /(ss|us|is)$/i.test(e) ? e : /(x|ch|sh|ss|us)es$/i.test(e) ? e.replace(/es$/i, "") : /s$/i.test(e) && e.length > 1 ? e.slice(0, -1) : e;
|
|
51
51
|
}
|
|
52
52
|
function D(e) {
|
|
@@ -132,15 +132,15 @@ function C(e, n) {
|
|
|
132
132
|
if (!t) return { singular: "Record", plural: "Records" };
|
|
133
133
|
const r = (l = n == null ? void 0 : n.collections) == null ? void 0 : l[t], o = typeof r == "string" ? { plural: r } : r ?? {}, s = i(o.plural), a = i(o.singular);
|
|
134
134
|
if (a || s) {
|
|
135
|
-
const
|
|
136
|
-
return { singular:
|
|
135
|
+
const f = a || y(s, Q), $ = s && s !== f ? s : y(f, D);
|
|
136
|
+
return { singular: f, plural: $ };
|
|
137
137
|
}
|
|
138
138
|
const c = se[t];
|
|
139
|
-
if (c) return { singular: c, plural: c === "Settings" ? c :
|
|
140
|
-
const u = O(t.replace(/^(nivaro|directus)_/, "")) || "Record", d =
|
|
141
|
-
return { singular: d, plural:
|
|
139
|
+
if (c) return { singular: c, plural: c === "Settings" ? c : y(c, D) };
|
|
140
|
+
const u = O(t.replace(/^(nivaro|directus)_/, "")) || "Record", d = y(u, Q);
|
|
141
|
+
return { singular: d, plural: y(d, D) };
|
|
142
142
|
}
|
|
143
|
-
function
|
|
143
|
+
function y(e, n) {
|
|
144
144
|
const t = e.split(" ");
|
|
145
145
|
return t[t.length - 1] = n(t[t.length - 1] ?? ""), t.join(" ");
|
|
146
146
|
}
|
|
@@ -248,7 +248,7 @@ function I(e, n, t) {
|
|
|
248
248
|
const o = `${e}:${r}`, s = t == null ? void 0 : t.records, { singular: a } = C(e, t), c = ae.test(i(e));
|
|
249
249
|
if (s && o in s) {
|
|
250
250
|
const u = s[o];
|
|
251
|
-
if (u == null) return c ? N(a) :
|
|
251
|
+
if (u == null) return c ? N(a) : k;
|
|
252
252
|
const d = i(u);
|
|
253
253
|
return d ? c && (d === r || U.test(d)) ? N(a) : d.toLowerCase().startsWith(a.toLowerCase()) ? d : `${a} ${d}` : c ? N(a) : a;
|
|
254
254
|
}
|
|
@@ -301,7 +301,7 @@ function B(e) {
|
|
|
301
301
|
var n, t;
|
|
302
302
|
return (n = e.changes) != null && n.length ? e.changes.map((r) => r.field) : (t = e.changed_fields) != null && t.length ? e.changed_fields : e.delta && typeof e.delta == "object" ? Object.keys(e.delta) : [];
|
|
303
303
|
}
|
|
304
|
-
function
|
|
304
|
+
function J(e) {
|
|
305
305
|
const n = { from: null, to: null, via: null, note: null, auto: !1 };
|
|
306
306
|
let t = i(e);
|
|
307
307
|
if (!t) return n;
|
|
@@ -490,7 +490,7 @@ function te(e, n) {
|
|
|
490
490
|
const t = g(C(e.parent_collection, n).singular), r = `${/^[aeiou]/i.test(t) ? "an" : "a"} ${t} record`;
|
|
491
491
|
if (!i(e.parent_id)) return r;
|
|
492
492
|
const o = I(e.parent_collection, e.parent_id, n);
|
|
493
|
-
return !o || o ===
|
|
493
|
+
return !o || o === k ? r : o;
|
|
494
494
|
}
|
|
495
495
|
function E(e) {
|
|
496
496
|
const n = i(e.value);
|
|
@@ -502,24 +502,24 @@ function re(e, n, t) {
|
|
|
502
502
|
}
|
|
503
503
|
function ve(e, n) {
|
|
504
504
|
var l;
|
|
505
|
-
const t = e.map((
|
|
506
|
-
if (t.length === 0 || t.some((
|
|
507
|
-
const r = new Set(t.map((
|
|
505
|
+
const t = e.map((f) => ({ e: f, j: S(f, n) }));
|
|
506
|
+
if (t.length === 0 || t.some((f) => !f.j)) return null;
|
|
507
|
+
const r = new Set(t.map((f) => i(f.j.parent_id)).filter(Boolean)), o = new Set(t.map((f) => f.j.parent_collection));
|
|
508
508
|
if (r.size > 1 || o.size > 1) return null;
|
|
509
|
-
const s = ((l = t.find((
|
|
510
|
-
for (const { e:
|
|
511
|
-
const _ = a.get($.noun) ?? { removed: [], added: [], updated: [] }, h = i($.value), v = i(
|
|
509
|
+
const s = ((l = t.find((f) => i(f.j.parent_id))) == null ? void 0 : l.j) ?? t[0].j, a = /* @__PURE__ */ new Map();
|
|
510
|
+
for (const { e: f, j: $ } of [...t].reverse()) {
|
|
511
|
+
const _ = a.get($.noun) ?? { removed: [], added: [], updated: [] }, h = i($.value), v = i(f.action);
|
|
512
512
|
v === "delete" ? _.removed.push(h) : v === "create" ? _.added.push(h) : _.updated.push(h), a.set($.noun, _);
|
|
513
513
|
}
|
|
514
|
-
const c = (
|
|
515
|
-
for (const [
|
|
514
|
+
const c = (f, $) => $ ? `${f} ${$}` : ne(f), u = [], d = [];
|
|
515
|
+
for (const [f, $] of a) {
|
|
516
516
|
if ($.removed.length === 1 && $.added.length === 1 && $.updated.length === 0) {
|
|
517
|
-
u.push({ noun:
|
|
517
|
+
u.push({ noun: f, from: $.removed[0], to: $.added[0] });
|
|
518
518
|
continue;
|
|
519
519
|
}
|
|
520
|
-
for (const _ of $.removed) d.push(`removed ${c(
|
|
521
|
-
for (const _ of $.added) d.push(`added ${c(
|
|
522
|
-
for (const _ of $.updated) d.push(`updated ${c(
|
|
520
|
+
for (const _ of $.removed) d.push(`removed ${c(f, _)}`);
|
|
521
|
+
for (const _ of $.added) d.push(`added ${c(f, _)}`);
|
|
522
|
+
for (const _ of $.updated) d.push(`updated ${c(f, _)}`);
|
|
523
523
|
}
|
|
524
524
|
return { parent: te(s, n), pairs: u, rest: d };
|
|
525
525
|
}
|
|
@@ -540,7 +540,7 @@ function ge(e, n) {
|
|
|
540
540
|
}
|
|
541
541
|
return `changed ${r}: ${[...o.map(he), ...s].join("; ")}`;
|
|
542
542
|
}
|
|
543
|
-
const
|
|
543
|
+
const K = /* @__PURE__ */ new Set(["transition", "pipeline-transition"]);
|
|
544
544
|
function be(e) {
|
|
545
545
|
const n = i(e).toLowerCase();
|
|
546
546
|
return /approv/.test(n) ? "Approved" : /reject/.test(n) ? "Rejected" : /declin/.test(n) ? "Declined" : /send.?back|return/.test(n) ? "Sent back" : /submit/.test(n) ? "Submitted" : /cancel/.test(n) ? "Cancelled" : "Moved";
|
|
@@ -551,16 +551,16 @@ function ke(e, n) {
|
|
|
551
551
|
if (d && (t === "create" || t === "delete" || t === "update"))
|
|
552
552
|
return re(t, d, n);
|
|
553
553
|
if ((($ = e.event) == null ? void 0 : $.kind) === "start") {
|
|
554
|
-
const
|
|
555
|
-
return `started ${o ?? "the pipeline"}${
|
|
554
|
+
const p = i(e.event.to_label);
|
|
555
|
+
return `started ${o ?? "the pipeline"}${p ? ` in ${p}` : ""}`;
|
|
556
556
|
}
|
|
557
|
-
if (((_ = e.event) == null ? void 0 : _.kind) === "transition" ||
|
|
558
|
-
const
|
|
557
|
+
if (((_ = e.event) == null ? void 0 : _.kind) === "transition" || K.has(t)) {
|
|
558
|
+
const p = e.event ? {
|
|
559
559
|
from: i(e.event.from_label) || null,
|
|
560
560
|
to: i(e.event.to_label) || null,
|
|
561
561
|
via: i(e.event.transition_label) || null
|
|
562
|
-
} :
|
|
563
|
-
return
|
|
562
|
+
} : J(c), m = (h = e.event) != null && h.addendum ? `Addendum “${i(e.event.addendum.title) || "Untitled"}”` : o ?? "a record";
|
|
563
|
+
return p.from && p.to ? `moved ${m} from ${p.from} to ${p.to}` : p.to ? `moved ${m} to ${p.to}` : p.via ? `ran “${p.via}” on ${m}` : `moved ${m}`;
|
|
564
564
|
}
|
|
565
565
|
switch (t) {
|
|
566
566
|
case "create":
|
|
@@ -570,16 +570,16 @@ function ke(e, n) {
|
|
|
570
570
|
case "o2m-update": {
|
|
571
571
|
if (t === "o2m-update")
|
|
572
572
|
return e.o2m ? `${M(e.o2m)}${u}` : `changed related rows${u}`;
|
|
573
|
-
const
|
|
573
|
+
const p = B(e);
|
|
574
574
|
if (r === "nivaro_settings")
|
|
575
|
-
return
|
|
575
|
+
return p.length ? `changed the ${q(r, p, n)} setting${p.length === 1 ? "" : "s"}` : "changed the settings";
|
|
576
576
|
if (r === "nivaro_approval_instances" && ((v = e.why) != null && v.approval)) {
|
|
577
|
-
const m = e.why.approval,
|
|
578
|
-
return `${(b[i(m.decision).toLowerCase()] ?? i(m.decision).toLowerCase()) || "decided on"} ${
|
|
577
|
+
const m = e.why.approval, w = I(m.collection, m.item, n);
|
|
578
|
+
return `${(b[i(m.decision).toLowerCase()] ?? i(m.decision).toLowerCase()) || "decided on"} ${w ?? o ?? "an approval"}${m.chain ? ` (${m.chain})` : ""}`;
|
|
579
579
|
}
|
|
580
|
-
if (
|
|
580
|
+
if (p.length) {
|
|
581
581
|
const m = ((A = e.changes) == null ? void 0 : A.length) === 1 ? e.changes[0] : null;
|
|
582
|
-
return m && "value" in m && X(r, m.field, m.value, n) ? `set ${Z(r, m.field, n)} to ${H(r, m.field, m.value, n)}${u}` : `changed ${q(r,
|
|
582
|
+
return m && "value" in m && X(r, m.field, m.value, n) ? `set ${Z(r, m.field, n)} to ${H(r, m.field, m.value, n)}${u}` : `changed ${q(r, p, n)}${u}`;
|
|
583
583
|
}
|
|
584
584
|
return `updated ${o ?? a}`;
|
|
585
585
|
}
|
|
@@ -589,8 +589,8 @@ function ke(e, n) {
|
|
|
589
589
|
case "restore":
|
|
590
590
|
return `restored ${o ?? a}`;
|
|
591
591
|
case "pipeline-start": {
|
|
592
|
-
const
|
|
593
|
-
return `started ${o ?? "the pipeline"}${
|
|
592
|
+
const p = /initial state:\s*(.+)$/i.exec(c);
|
|
593
|
+
return `started ${o ?? "the pipeline"}${p ? ` in ${p[1]}` : ""}`;
|
|
594
594
|
}
|
|
595
595
|
case "login":
|
|
596
596
|
return "signed in";
|
|
@@ -598,32 +598,34 @@ function ke(e, n) {
|
|
|
598
598
|
return "signed out";
|
|
599
599
|
case "login-refused":
|
|
600
600
|
return "was refused sign-in";
|
|
601
|
+
case "sign-in-failed":
|
|
602
|
+
return o && o !== k ? `had a sign-in as ${o} fail` : "had a sign-in fail";
|
|
601
603
|
case "export": {
|
|
602
|
-
const
|
|
603
|
-
return `exported ${
|
|
604
|
+
const p = _e(c);
|
|
605
|
+
return `exported ${p.rows != null ? L(p.rows, r, n) : g(s.plural)}${p.format ? ` to ${p.format}` : ""}`;
|
|
604
606
|
}
|
|
605
607
|
case "masquerade-start":
|
|
606
|
-
return `started viewing as ${
|
|
608
|
+
return `started viewing as ${x(e, n, c)}`;
|
|
607
609
|
case "masquerade-stop":
|
|
608
|
-
return `stopped viewing as ${
|
|
610
|
+
return `stopped viewing as ${x(e, n, c)}`;
|
|
609
611
|
case "token.generate":
|
|
610
|
-
return `generated a static token for ${
|
|
612
|
+
return `generated a static token for ${x(e, n, "")}`;
|
|
611
613
|
case "token.revoke":
|
|
612
|
-
return `revoked the static token of ${
|
|
614
|
+
return `revoked the static token of ${x(e, n, "")}`;
|
|
613
615
|
case "api_key_created":
|
|
614
|
-
return `created ${o && o !==
|
|
616
|
+
return `created ${o && o !== k ? o : "an API key"}`;
|
|
615
617
|
case "api_key_revoked":
|
|
616
|
-
return `revoked ${o && o !==
|
|
618
|
+
return `revoked ${o && o !== k ? o : "an API key"}`;
|
|
617
619
|
case "api_key_deleted":
|
|
618
|
-
return `deleted ${o && o !==
|
|
620
|
+
return `deleted ${o && o !== k ? o : "an API key"}`;
|
|
619
621
|
case "api_key_simulate":
|
|
620
|
-
return `tested requests as ${o && o !==
|
|
622
|
+
return `tested requests as ${o && o !== k ? o : "an API key"}`;
|
|
621
623
|
case "set_role":
|
|
622
|
-
return `changed the role of ${
|
|
624
|
+
return `changed the role of ${x(e, n, "")}`;
|
|
623
625
|
case "bulk-write":
|
|
624
626
|
case "bulk-action-execute": {
|
|
625
|
-
const
|
|
626
|
-
return
|
|
627
|
+
const p = /(\d+)\s+(?:item|row)/i.exec(c), m = p ? L(Number(p[1]), r, n) : g(s.plural), w = t === "bulk-action-execute" ? /^(.+?)\s*\([^)]*\)\s+on\s/.exec(c) : null;
|
|
628
|
+
return w ? `ran “${w[1]}” on ${m}` : `changed ${m} in bulk`;
|
|
627
629
|
}
|
|
628
630
|
case "import-create":
|
|
629
631
|
case "import-queue":
|
|
@@ -635,14 +637,24 @@ function ke(e, n) {
|
|
|
635
637
|
case "comment":
|
|
636
638
|
return `commented${u}`;
|
|
637
639
|
case "file-download": {
|
|
638
|
-
let
|
|
640
|
+
let p = "", m = !1;
|
|
639
641
|
try {
|
|
640
642
|
const T = JSON.parse(c);
|
|
641
|
-
|
|
643
|
+
p = typeof T.name == "string" ? T.name : "", m = T.kind === "open";
|
|
644
|
+
} catch {
|
|
645
|
+
}
|
|
646
|
+
const w = p ? `“${p}”` : "a file";
|
|
647
|
+
return `${m ? "opened" : "downloaded"} ${w}${r === "nivaro_files" ? "" : u}`;
|
|
648
|
+
}
|
|
649
|
+
case "split-out":
|
|
650
|
+
case "split-in": {
|
|
651
|
+
let p = 0;
|
|
652
|
+
try {
|
|
653
|
+
p = Number(JSON.parse(c).lines) || 0;
|
|
642
654
|
} catch {
|
|
643
655
|
}
|
|
644
|
-
const
|
|
645
|
-
return
|
|
656
|
+
const m = p > 0 ? `${p} ${p === 1 ? "line" : "lines"}` : "lines";
|
|
657
|
+
return t === "split-out" ? `moved ${m}${o ? ` of ${o}` : ""} to a new record` : `created ${o ?? a} from ${m} of another record`;
|
|
646
658
|
}
|
|
647
659
|
case "picker-exclude":
|
|
648
660
|
return `hid ${o ?? a} from pickers`;
|
|
@@ -661,7 +673,7 @@ function ke(e, n) {
|
|
|
661
673
|
const l = ee(t);
|
|
662
674
|
return /settings$/.test(l.noun) && !l.verb ? `changed the ${l.noun}` : l.past ? o && l.noun && g(s.singular).toLowerCase().includes(l.noun.toLowerCase()) ? `${l.past} ${o}` : l.noun ? `${l.past} ${$e(l.verb, l.noun)}${u}` : `${l.past} ${o ?? "something"}` : `recorded “${V(t)}”${u}`;
|
|
663
675
|
}
|
|
664
|
-
function
|
|
676
|
+
function x(e, n, t) {
|
|
665
677
|
const r = i(e.item), o = P(r, n) ?? (t || null);
|
|
666
678
|
if (o) return o;
|
|
667
679
|
const s = e.collection === "nivaro_users" ? I(e.collection, e.item, n) : null;
|
|
@@ -674,7 +686,7 @@ function Ie(e) {
|
|
|
674
686
|
var c, u, d, l;
|
|
675
687
|
const n = i(e.action), t = i(e.comment);
|
|
676
688
|
let r = i((c = e.why) == null ? void 0 : c.reason) || null, o = i((u = e.why) == null ? void 0 : u.note) || null;
|
|
677
|
-
!o &&
|
|
689
|
+
!o && K.has(n) && !e.event && (o = J(t).note), !o && ((d = e.event) == null ? void 0 : d.kind) === "transition" && t && (o = t), !r && (n === "create" || n === "update" || n === "delete") && t && !/^import:/i.test(t) && (r = t);
|
|
678
690
|
const s = (l = e.why) == null ? void 0 : l.approval, a = s ? `${O(i(s.decision)) || "Decided"}${s.chain ? ` · ${s.chain}` : ""}${s.step != null && s.step !== "" ? ` · step ${s.step}` : ""}${i(s.comment) ? ` — “${i(s.comment)}”` : ""}` : null;
|
|
679
691
|
return { reason: r, note: o, approval: a };
|
|
680
692
|
}
|
|
@@ -686,7 +698,7 @@ function j(e) {
|
|
|
686
698
|
const n = Y(e);
|
|
687
699
|
return `${n.kind}|${i(n.id)}|${i(e.user ?? e.user_id).toUpperCase()}`;
|
|
688
700
|
}
|
|
689
|
-
function
|
|
701
|
+
function ye(e) {
|
|
690
702
|
const n = i(e.action);
|
|
691
703
|
return !i(e.item) && (n.startsWith("bulk-") || n === "import-complete");
|
|
692
704
|
}
|
|
@@ -696,7 +708,7 @@ function Ce(e, n = {}) {
|
|
|
696
708
|
const a = r[r.length - 1], c = a == null ? void 0 : a.entries[a.entries.length - 1], u = i(s.group_key);
|
|
697
709
|
if (a && c && n.labels) {
|
|
698
710
|
const d = S(s, n.labels), l = S(c, n.labels);
|
|
699
|
-
if (d && l && a.entries.every((
|
|
711
|
+
if (d && l && a.entries.every((f) => S(f, n.labels)) && o(d, l) && j(s) === j(c) && Math.abs(R(c) - R(s)) <= Ae) {
|
|
700
712
|
a.entries.push(s), a.by !== "group_key" && (a.by = "time");
|
|
701
713
|
continue;
|
|
702
714
|
}
|
|
@@ -718,36 +730,36 @@ function Ce(e, n = {}) {
|
|
|
718
730
|
}
|
|
719
731
|
function Ne(e, n) {
|
|
720
732
|
if (e.length === 0) return "";
|
|
721
|
-
const t = e.filter((v) => !
|
|
733
|
+
const t = e.filter((v) => !ye(v)), r = t[0] ?? e[0];
|
|
722
734
|
if (t.length <= 1) return we(r, n);
|
|
723
735
|
const o = G(r, n), s = ge(t, n);
|
|
724
736
|
if (s) return `${o} ${s}`;
|
|
725
|
-
const c = new Set(t.map((v) => i(v.collection))).size === 1 ? r.collection ?? null : null, u = new Set(t.map((v) => i(v.item))), d = u.size > 1 ? u.size : t.length, l = c ? u.size === 1 && i(r.item) ? I(c, r.item, n) ?? L(d, c, n) : L(d, c, n) : `${d} records`,
|
|
726
|
-
t.map((v) =>
|
|
737
|
+
const c = new Set(t.map((v) => i(v.collection))).size === 1 ? r.collection ?? null : null, u = new Set(t.map((v) => i(v.item))), d = u.size > 1 ? u.size : t.length, l = c ? u.size === 1 && i(r.item) ? I(c, r.item, n) ?? L(d, c, n) : L(d, c, n) : `${d} records`, f = u.size === 1 && t.length > 1 ? ` ${t.length} times` : "", $ = new Set(
|
|
738
|
+
t.map((v) => K.has(i(v.action)) ? "transition" : i(v.action))
|
|
727
739
|
);
|
|
728
740
|
if ($.size !== 1) return `${o} made ${t.length} changes to ${l}`;
|
|
729
741
|
const _ = [...$][0];
|
|
730
742
|
if (_ === "transition") {
|
|
731
743
|
const v = new Set(
|
|
732
|
-
t.map((
|
|
744
|
+
t.map((p) => {
|
|
733
745
|
var m;
|
|
734
|
-
return i(((m =
|
|
746
|
+
return i(((m = p.event) == null ? void 0 : m.to_label) ?? J(p.comment).to);
|
|
735
747
|
})
|
|
736
748
|
), A = v.size === 1 ? [...v][0] : "";
|
|
737
|
-
return `${o} moved ${l}${A ? ` to ${A}` : ""}${
|
|
749
|
+
return `${o} moved ${l}${A ? ` to ${A}` : ""}${f}`;
|
|
738
750
|
}
|
|
739
751
|
if (_ === "update") {
|
|
740
|
-
const v =
|
|
741
|
-
return `${o} updated ${l}${
|
|
752
|
+
const v = xe(t, c, n);
|
|
753
|
+
return `${o} updated ${l}${f}${v ? `: ${v}` : ""}`;
|
|
742
754
|
}
|
|
743
755
|
if (_ === "create") return `${o} created ${l}`;
|
|
744
756
|
if (_ === "delete") return `${o} deleted ${l}`;
|
|
745
|
-
if (_ === "picker-exclude") return `${o} hid ${l} from pickers${
|
|
746
|
-
if (_ === "picker-include") return `${o} showed ${l} in pickers again${
|
|
757
|
+
if (_ === "picker-exclude") return `${o} hid ${l} from pickers${f}`;
|
|
758
|
+
if (_ === "picker-include") return `${o} showed ${l} in pickers again${f}`;
|
|
747
759
|
const h = ee(_);
|
|
748
|
-
return h.past ? `${o} ${h.past} ${l}${h.noun && !g(C(c, n).plural).toLowerCase().includes(h.noun) ? ` (${h.noun})` : ""}${
|
|
760
|
+
return h.past ? `${o} ${h.past} ${l}${h.noun && !g(C(c, n).plural).toLowerCase().includes(h.noun) ? ` (${h.noun})` : ""}${f}` : `${o} recorded “${V(_)}” on ${l}`;
|
|
749
761
|
}
|
|
750
|
-
function
|
|
762
|
+
function xe(e, n, t) {
|
|
751
763
|
var c;
|
|
752
764
|
const r = ((c = e[0]) == null ? void 0 : c.changes) ?? null;
|
|
753
765
|
if (!(r != null && r.length)) {
|
|
@@ -774,8 +786,8 @@ function Re(e) {
|
|
|
774
786
|
const d = Y(c);
|
|
775
787
|
d.kind === "view_as" && d.id && t.add(d.id), d.on_behalf_of && t.add(d.on_behalf_of), i(c.collection) && o.add(i(c.collection)), s(c.collection, c.item), (a = c.why) != null && a.approval && s(c.why.approval.collection, c.why.approval.item);
|
|
776
788
|
for (const l of B(c)) {
|
|
777
|
-
const
|
|
778
|
-
|
|
789
|
+
const f = i(c.collection);
|
|
790
|
+
f && r.set(`${f}.${l}`, { collection: f, field: l });
|
|
779
791
|
}
|
|
780
792
|
}
|
|
781
793
|
return {
|
|
@@ -787,7 +799,7 @@ function Re(e) {
|
|
|
787
799
|
}
|
|
788
800
|
export {
|
|
789
801
|
Se as BURST_WINDOW_MS,
|
|
790
|
-
|
|
802
|
+
k as HIDDEN_RECORD,
|
|
791
803
|
Ae as LINK_WRITE_WINDOW_MS,
|
|
792
804
|
ee as actionParts,
|
|
793
805
|
Re as activityLabelRefs,
|
|
@@ -807,7 +819,7 @@ export {
|
|
|
807
819
|
he as linkPairText,
|
|
808
820
|
M as o2mSentence,
|
|
809
821
|
de as parseActor,
|
|
810
|
-
|
|
822
|
+
J as parseTransitionComment,
|
|
811
823
|
V as readableTitle,
|
|
812
824
|
I as recordPhrase,
|
|
813
825
|
Ne as renderActivityGroupSentence,
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { useState as g, useEffect as f, useMemo as l } from "react";
|
|
2
|
+
import { useLiveEvent as y } from "./live.js";
|
|
3
|
+
import { useLivePreference as h } from "./live-preference.js";
|
|
4
|
+
const c = (t, i) => typeof t == "string" ? t.slice(0, i) : "";
|
|
5
|
+
function p(t, i) {
|
|
6
|
+
var m, s;
|
|
7
|
+
if (!Array.isArray(t)) return [];
|
|
8
|
+
const r = [];
|
|
9
|
+
for (const e of t) {
|
|
10
|
+
const o = c(e == null ? void 0 : e.key, 40), n = c(e == null ? void 0 : e.name, 60), u = Number(e == null ? void 0 : e.ttl_ms);
|
|
11
|
+
!o || !n || !Number.isFinite(u) || u <= 0 || r.push({
|
|
12
|
+
key: o,
|
|
13
|
+
name: n,
|
|
14
|
+
for: { id: c((m = e == null ? void 0 : e.for) == null ? void 0 : m.id, 64), name: c((s = e == null ? void 0 : e.for) == null ? void 0 : s.name, 80) },
|
|
15
|
+
mode: (e == null ? void 0 : e.mode) === "updating" ? "updating" : "reading",
|
|
16
|
+
until: i + Math.min(u, 6e4)
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
return r.sort(
|
|
20
|
+
(e, o) => (e.mode === o.mode ? 0 : e.mode === "updating" ? -1 : 1) || e.name.localeCompare(o.name) || e.key.localeCompare(o.key)
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
function A(t, i, r = !1) {
|
|
24
|
+
const s = !!i && !!t.for.id && t.for.id.toUpperCase() === String(i).toUpperCase() ? "you" : t.for.name || "someone", e = t.mode === "updating" ? "is updating" : "is reading";
|
|
25
|
+
return r ? `${t.name} ${e}` : `${t.name} (for ${s}) ${e} this record`;
|
|
26
|
+
}
|
|
27
|
+
function C(t, i) {
|
|
28
|
+
const r = i == null ? "" : String(i), { quiet: m } = h(), s = !!t && !!r && r !== "new" && !m, [e, o] = g([]);
|
|
29
|
+
return f(() => o([]), [t, r, s]), y("record:agents", (n) => o(p(n == null ? void 0 : n.agents, Date.now())), {
|
|
30
|
+
enabled: s,
|
|
31
|
+
includeOwn: !0,
|
|
32
|
+
match: (n) => (n == null ? void 0 : n.collection) === t && String(n == null ? void 0 : n.item) === r
|
|
33
|
+
}), f(() => {
|
|
34
|
+
if (e.length === 0) return;
|
|
35
|
+
const n = Math.min(...e.map((a) => a.until)), u = setTimeout(
|
|
36
|
+
() => o((a) => a.filter((d) => d.until > Date.now())),
|
|
37
|
+
Math.max(250, n - Date.now() + 50)
|
|
38
|
+
);
|
|
39
|
+
return () => clearTimeout(u);
|
|
40
|
+
}, [e]), l(() => s ? e : [], [e, s]);
|
|
41
|
+
}
|
|
42
|
+
export {
|
|
43
|
+
A as agentSentence,
|
|
44
|
+
p as agentsFromPayload,
|
|
45
|
+
C as useRecordAgents
|
|
46
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { atClock as c } from "./send-status.js";
|
|
2
|
+
function d(t) {
|
|
3
|
+
const e = [...new Set(t.map((n) => n.trim()).filter(Boolean))];
|
|
4
|
+
return e.length <= 3 ? e.join(", ") : `${e.slice(0, 3).join(", ")} and ${e.length - 3} more`;
|
|
5
|
+
}
|
|
6
|
+
const m = [
|
|
7
|
+
[/^approve\b/i, "Approved"],
|
|
8
|
+
[/^reject\b/i, "Rejected"],
|
|
9
|
+
[/^decline\b/i, "Declined"],
|
|
10
|
+
[/^submit\b/i, "Submitted"],
|
|
11
|
+
[/^send back\b/i, "Sent back"],
|
|
12
|
+
[/^send\b/i, "Sent"],
|
|
13
|
+
[/^return\b/i, "Returned"],
|
|
14
|
+
[/^complete\b/i, "Completed"],
|
|
15
|
+
[/^accept\b/i, "Accepted"],
|
|
16
|
+
[/^review\b/i, "Reviewed"],
|
|
17
|
+
[/^sign off\b/i, "Signed off"],
|
|
18
|
+
[/^confirm\b/i, "Confirmed"],
|
|
19
|
+
[/^release\b/i, "Released"],
|
|
20
|
+
[/^close\b/i, "Closed"],
|
|
21
|
+
[/^cancel\b/i, "Cancelled"]
|
|
22
|
+
];
|
|
23
|
+
function b(t) {
|
|
24
|
+
const e = (t ?? "").trim();
|
|
25
|
+
if (!e) return null;
|
|
26
|
+
for (const [n, i] of m) if (n.test(e)) return e.replace(n, i);
|
|
27
|
+
return /^[A-Za-z]+ed\b/.test(e) ? e : null;
|
|
28
|
+
}
|
|
29
|
+
const f = (t) => {
|
|
30
|
+
var e;
|
|
31
|
+
return [t.first_name, t.last_name].filter(Boolean).join(" ").trim() || ((e = t.user_email) == null ? void 0 : e.trim()) || "";
|
|
32
|
+
};
|
|
33
|
+
function $(t) {
|
|
34
|
+
var l;
|
|
35
|
+
const e = t.now ?? Date.now();
|
|
36
|
+
if (t.stateId === t.currentStateId) {
|
|
37
|
+
const r = d(t.owners ?? []);
|
|
38
|
+
return r ? { kind: "waiting", text: `Waiting on ${r}` } : null;
|
|
39
|
+
}
|
|
40
|
+
const n = t.history.filter((r) => r.from_state === t.stateId).sort((r, s) => new Date(s.timestamp).getTime() - new Date(r.timestamp).getTime())[0];
|
|
41
|
+
if (!n) return null;
|
|
42
|
+
const i = f(n), o = c(n.timestamp, e), a = b(n.transition_label);
|
|
43
|
+
return a ? { kind: "done", text: `${a}${i ? ` by ${i}` : ""}${o ? ` at ${o}` : ""}` } : { kind: "done", text: `${((l = n.transition_label) == null ? void 0 : l.trim()) || "Moved on"}${i ? ` — ${i}` : ""}${o ? ` at ${o}` : ""}` };
|
|
44
|
+
}
|
|
45
|
+
export {
|
|
46
|
+
$ as chainStepText,
|
|
47
|
+
d as namesList,
|
|
48
|
+
b as pastMove
|
|
49
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { useQuery as o } from "@tanstack/react-query";
|
|
2
|
+
import { useOptionalNivaroClient as f } from "../context.js";
|
|
3
|
+
import { get as u } from "./commands.js";
|
|
4
|
+
function s(t) {
|
|
5
|
+
const n = t ?? {}, e = n.live_announce;
|
|
6
|
+
return {
|
|
7
|
+
tabCount: n.tab_count !== "off",
|
|
8
|
+
announce: e === "brief" || e === "off" ? e : "full"
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
function l() {
|
|
12
|
+
const t = f(), { data: n } = o({
|
|
13
|
+
queryKey: ["nvr-profile-prefs"],
|
|
14
|
+
queryFn: () => t.request(u("/users/me")).then((e) => {
|
|
15
|
+
var r;
|
|
16
|
+
return ((r = e.data) == null ? void 0 : r.preferences) ?? {};
|
|
17
|
+
}),
|
|
18
|
+
enabled: !!t,
|
|
19
|
+
staleTime: 6e4,
|
|
20
|
+
retry: !1
|
|
21
|
+
});
|
|
22
|
+
return s(n);
|
|
23
|
+
}
|
|
24
|
+
export {
|
|
25
|
+
s as attentionPrefsOf,
|
|
26
|
+
l as useAttentionPrefs
|
|
27
|
+
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { post as u } from "./commands.js";
|
|
2
|
+
import { inlineValueUnchanged as d } from "./list-inline-edit.js";
|
|
3
|
+
const S = 1e4, m = 600, p = 2e3;
|
|
4
|
+
function h(n, e, t) {
|
|
5
|
+
return `${n}${String(e).toUpperCase()}${t}`;
|
|
6
|
+
}
|
|
7
|
+
async function E(n, e, t = !1) {
|
|
8
|
+
try {
|
|
9
|
+
const l = await n.request(
|
|
10
|
+
u("/cell-locks/take", { collection: e.collection, id: String(e.id), field: e.field, beat: t })
|
|
11
|
+
);
|
|
12
|
+
return (l == null ? void 0 : l.ok) === !1 && l.holder ? { ok: !1, holder: l.holder } : { ok: !0 };
|
|
13
|
+
} catch {
|
|
14
|
+
return { ok: !0 };
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
function k(n, e) {
|
|
18
|
+
n.request(
|
|
19
|
+
u("/cell-locks/release", { collection: e.collection, id: String(e.id), field: e.field })
|
|
20
|
+
).catch(() => {
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
async function L(n, e, t) {
|
|
24
|
+
const l = /* @__PURE__ */ new Map(), o = [...new Set(t.map((r) => String(r.id)))], i = [...new Set(t.map((r) => r.field))];
|
|
25
|
+
if (o.length === 0 || i.length === 0) return l;
|
|
26
|
+
const f = Math.max(1, Math.floor(p / i.length));
|
|
27
|
+
for (let r = 0; r < o.length; r += f) {
|
|
28
|
+
const s = await n.request(
|
|
29
|
+
u("/cell-locks/read", { collection: e, ids: o.slice(r, r + f), fields: i })
|
|
30
|
+
);
|
|
31
|
+
for (const c of (s == null ? void 0 : s.data) ?? []) l.set(h(e, c.id, c.field), c);
|
|
32
|
+
}
|
|
33
|
+
return l;
|
|
34
|
+
}
|
|
35
|
+
function a(n, e, t) {
|
|
36
|
+
if (n === "m2o") {
|
|
37
|
+
if (e == null || e === "" || t == null || t === "") return (e ?? "") === (t ?? "");
|
|
38
|
+
const l = (o) => String(o && typeof o == "object" && "id" in o ? o.id : o);
|
|
39
|
+
return l(e).toUpperCase() === l(t).toUpperCase();
|
|
40
|
+
}
|
|
41
|
+
return (e === "" || e == null) && (t === "" || t == null) ? !0 : d(n, e, t);
|
|
42
|
+
}
|
|
43
|
+
function _(n, e, t, l) {
|
|
44
|
+
return !a(n, e, t) && !a(n, t, l);
|
|
45
|
+
}
|
|
46
|
+
export {
|
|
47
|
+
S as CELL_BEAT_MS,
|
|
48
|
+
m as CELL_READ_COALESCE_MS,
|
|
49
|
+
p as CELL_READ_MAX,
|
|
50
|
+
h as cellHolderKey,
|
|
51
|
+
_ as overwritesOthers,
|
|
52
|
+
L as readCellHolders,
|
|
53
|
+
k as releaseCell,
|
|
54
|
+
a as sameCellValue,
|
|
55
|
+
E as takeCell
|
|
56
|
+
};
|