@nivaro/react 0.3.114 → 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 +1717 -21
- 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 +1 -0
- 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/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 +1927 -1635
- 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-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,229 +1,243 @@
|
|
|
1
|
-
import { useQuery as
|
|
2
|
-
import { useRef as
|
|
1
|
+
import { useQuery as R, useQueryClient as v, useQueries as T } from "@tanstack/react-query";
|
|
2
|
+
import { useRef as p, useState as S, useCallback as y, useEffect as w, useMemo as b } from "react";
|
|
3
3
|
import { useNivaroClient as k } from "../context.js";
|
|
4
|
-
import { post as A, get as
|
|
5
|
-
import { useLiveCollection as
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
4
|
+
import { post as A, get as N } from "./commands.js";
|
|
5
|
+
import { useLiveCollection as L } from "./live.js";
|
|
6
|
+
import { useLivePreference as j, liveMotionAllowed as Q } from "./live-preference.js";
|
|
7
|
+
import { loadUserCard as D } from "./user-cards.js";
|
|
8
|
+
const E = 6e4, F = 6e4, $ = 400;
|
|
9
|
+
function K(t, e = Date.now()) {
|
|
10
|
+
const r = Math.max(0, Math.round((e - t) / 1e3));
|
|
11
|
+
return r < 10 ? "just now" : r < 60 ? `${r}s ago` : `${Math.round(r / 60)} min ago`;
|
|
11
12
|
}
|
|
12
|
-
function
|
|
13
|
-
const n =
|
|
14
|
-
return t.kind === "create" ?
|
|
13
|
+
function x(t, e, r = Date.now()) {
|
|
14
|
+
const n = K(t.at, r), o = e ?? (t.by ? "someone" : null);
|
|
15
|
+
return t.kind === "create" ? o ? `New — added by ${o} ${n}` : `New — added ${n}` : o ? `Changed by ${o} ${n}` : `Changed ${n}`;
|
|
15
16
|
}
|
|
16
|
-
function
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
const a = typeof CSS < "u" && CSS.escape ? CSS.escape(i) : i.replace(/"/g, '\\"'), s = t.querySelector(`[data-row-key="${a}"]`);
|
|
26
|
-
if (s)
|
|
27
|
-
for (const u of Array.from(s.children)) {
|
|
28
|
-
const c = u;
|
|
29
|
-
typeof c.animate == "function" && c.animate(
|
|
17
|
+
function O(t, e, r = {}) {
|
|
18
|
+
if (!t || e.length === 0 || typeof window > "u" || !Q()) return;
|
|
19
|
+
const n = r.strong ? 0.34 : 0.22;
|
|
20
|
+
for (const o of e) {
|
|
21
|
+
const u = typeof CSS < "u" && CSS.escape ? CSS.escape(o) : o.replace(/"/g, '\\"'), c = t.querySelector(`[data-row-key="${u}"]`);
|
|
22
|
+
if (c)
|
|
23
|
+
for (const s of Array.from(c.children)) {
|
|
24
|
+
const i = s;
|
|
25
|
+
typeof i.animate == "function" && i.animate(
|
|
30
26
|
[
|
|
31
27
|
{ boxShadow: `inset 0 0 0 9999px rgba(0, 206, 255, ${n})` },
|
|
32
28
|
{ boxShadow: "inset 0 0 0 9999px rgba(0, 206, 255, 0)" }
|
|
33
29
|
],
|
|
34
|
-
{ duration:
|
|
30
|
+
{ duration: r.strong ? 2600 : 1800, easing: "ease-out" }
|
|
35
31
|
);
|
|
36
32
|
}
|
|
37
33
|
}
|
|
38
34
|
}
|
|
39
|
-
function
|
|
40
|
-
const e = k(),
|
|
41
|
-
return
|
|
42
|
-
let
|
|
43
|
-
const s =
|
|
44
|
-
for (const
|
|
45
|
-
|
|
46
|
-
queryKey: ["live-actor-name",
|
|
47
|
-
queryFn: () =>
|
|
48
|
-
(
|
|
35
|
+
function U(t) {
|
|
36
|
+
const e = k(), r = v(), [n, o] = S(() => /* @__PURE__ */ new Map()), u = t.join(",");
|
|
37
|
+
return w(() => {
|
|
38
|
+
let c = !0;
|
|
39
|
+
const s = u ? u.split(",") : [];
|
|
40
|
+
for (const i of s)
|
|
41
|
+
r.fetchQuery({
|
|
42
|
+
queryKey: ["live-actor-name", i.toUpperCase()],
|
|
43
|
+
queryFn: () => D(e, i).then(
|
|
44
|
+
(a) => [a == null ? void 0 : a.first_name, a == null ? void 0 : a.last_name].filter(Boolean).join(" ") || (a == null ? void 0 : a.email) || ""
|
|
49
45
|
),
|
|
50
46
|
staleTime: 10 * 6e4
|
|
51
|
-
}).then((
|
|
52
|
-
!
|
|
47
|
+
}).then((a) => {
|
|
48
|
+
!c || !a || o((l) => l.get(i) === a ? l : new Map(l).set(i, a));
|
|
53
49
|
}).catch(() => {
|
|
54
50
|
});
|
|
55
51
|
return () => {
|
|
56
|
-
|
|
52
|
+
c = !1;
|
|
57
53
|
};
|
|
58
|
-
}, [
|
|
54
|
+
}, [u, r, e]), n;
|
|
59
55
|
}
|
|
60
|
-
function
|
|
61
|
-
const t =
|
|
56
|
+
function P() {
|
|
57
|
+
const t = p(null), e = p(/* @__PURE__ */ new Map()), [, r] = S(0), n = p([]), o = p(null), [u, c] = S([]), s = U(u), i = y(() => {
|
|
62
58
|
const d = Date.now();
|
|
63
59
|
let f = !1;
|
|
64
60
|
for (const [h, g] of e.current)
|
|
65
|
-
d - g.at > (g.kind === "create" ?
|
|
66
|
-
f &&
|
|
67
|
-
}, []),
|
|
61
|
+
d - g.at > (g.kind === "create" ? F : E) && (e.current.delete(h), f = !0);
|
|
62
|
+
f && r((h) => h + 1), e.current.size > 0 ? o.current = setTimeout(i, 1e4) : o.current = null;
|
|
63
|
+
}, []), a = y(
|
|
68
64
|
(d, f, h = "update") => {
|
|
69
65
|
const g = Date.now();
|
|
70
66
|
for (const m of d)
|
|
71
67
|
m !== "*" && e.current.set(m, { at: g, by: f, kind: h });
|
|
72
|
-
if (e.current.size >
|
|
73
|
-
const m = [...e.current.keys()].slice(0, e.current.size -
|
|
68
|
+
if (e.current.size > $) {
|
|
69
|
+
const m = [...e.current.keys()].slice(0, e.current.size - $);
|
|
74
70
|
for (const _ of m) e.current.delete(_);
|
|
75
71
|
}
|
|
76
|
-
n.current.push({ ids: d.filter((m) => m !== "*"), strong: h === "create" }), f &&
|
|
72
|
+
n.current.push({ ids: d.filter((m) => m !== "*"), strong: h === "create" }), f && c((m) => m.includes(f) ? m : [...m, f].slice(-30)), r((m) => m + 1), o.current || (o.current = setTimeout(i, 1e4));
|
|
77
73
|
},
|
|
78
|
-
[
|
|
74
|
+
[i]
|
|
79
75
|
);
|
|
80
|
-
|
|
76
|
+
w(() => {
|
|
81
77
|
if (n.current.length === 0) return;
|
|
82
78
|
const d = n.current;
|
|
83
79
|
n.current = [];
|
|
84
80
|
const f = requestAnimationFrame(() => {
|
|
85
|
-
for (const h of d)
|
|
81
|
+
for (const h of d) O(t.current ?? document, h.ids, { strong: h.strong });
|
|
86
82
|
});
|
|
87
83
|
return () => cancelAnimationFrame(f);
|
|
88
|
-
}),
|
|
84
|
+
}), w(
|
|
89
85
|
() => () => {
|
|
90
|
-
|
|
86
|
+
o.current && clearTimeout(o.current);
|
|
91
87
|
},
|
|
92
88
|
[]
|
|
93
89
|
);
|
|
94
|
-
const l =
|
|
90
|
+
const l = y(
|
|
95
91
|
(d) => {
|
|
96
92
|
const f = e.current.get(d);
|
|
97
93
|
if (!f) return;
|
|
98
94
|
const h = f.by ? s.get(f.by) ?? null : null;
|
|
99
|
-
return
|
|
95
|
+
return x(f, h);
|
|
100
96
|
},
|
|
101
97
|
// names changing re-renders the list; tooltips are read at render time
|
|
102
98
|
[s]
|
|
103
|
-
),
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
99
|
+
), { quiet: q } = j(), M = y(
|
|
100
|
+
(d) => {
|
|
101
|
+
var f;
|
|
102
|
+
return !q && ((f = e.current.get(d)) == null ? void 0 : f.kind) === "create";
|
|
103
|
+
},
|
|
104
|
+
[q]
|
|
105
|
+
), C = y((d) => {
|
|
107
106
|
for (const f of d) e.current.delete(f);
|
|
108
107
|
}, []);
|
|
109
108
|
return b(
|
|
110
|
-
() => ({ note:
|
|
111
|
-
[
|
|
109
|
+
() => ({ note: a, titleFor: l, isNew: M, forget: C, rootRef: t }),
|
|
110
|
+
[a, l, M, C]
|
|
112
111
|
);
|
|
113
112
|
}
|
|
114
|
-
function
|
|
115
|
-
const n = k(),
|
|
116
|
-
queryKey: ["live-row-locks", t,
|
|
113
|
+
function X(t, e, r = 0) {
|
|
114
|
+
const n = k(), o = e.slice(0, 200).join(","), { data: u } = R({
|
|
115
|
+
queryKey: ["live-row-locks", t, o, r],
|
|
117
116
|
queryFn: () => n.request(
|
|
118
117
|
A(`/item-locks/${encodeURIComponent(String(t))}/active`, {
|
|
119
|
-
ids:
|
|
118
|
+
ids: o.split(",")
|
|
120
119
|
})
|
|
121
|
-
).then((
|
|
122
|
-
enabled: !!t &&
|
|
120
|
+
).then((c) => c.data ?? []).catch(() => []),
|
|
121
|
+
enabled: !!t && o !== "" && !String(t).startsWith("nivaro_"),
|
|
123
122
|
staleTime: 15e3,
|
|
124
|
-
placeholderData: (
|
|
123
|
+
placeholderData: (c) => c,
|
|
125
124
|
retry: !1
|
|
126
125
|
});
|
|
127
126
|
return b(() => {
|
|
128
|
-
const
|
|
129
|
-
for (const s of
|
|
130
|
-
return
|
|
131
|
-
}, [
|
|
127
|
+
const c = /* @__PURE__ */ new Map();
|
|
128
|
+
for (const s of u ?? []) c.set(String(s.item), s);
|
|
129
|
+
return c;
|
|
130
|
+
}, [u]);
|
|
132
131
|
}
|
|
133
|
-
function
|
|
134
|
-
const
|
|
132
|
+
function Y(t, e = 0) {
|
|
133
|
+
const r = k(), n = /* @__PURE__ */ new Map();
|
|
135
134
|
for (const s of t) {
|
|
136
135
|
if (s.collection.startsWith("nivaro_")) continue;
|
|
137
|
-
const
|
|
138
|
-
|
|
136
|
+
const i = n.get(s.collection) ?? [];
|
|
137
|
+
i.length < 200 && i.push(s.id), n.set(s.collection, i);
|
|
139
138
|
}
|
|
140
|
-
const
|
|
141
|
-
queries:
|
|
142
|
-
queryKey: ["live-row-locks", s,
|
|
143
|
-
queryFn: () =>
|
|
144
|
-
A(`/item-locks/${encodeURIComponent(s)}/active`, { ids:
|
|
145
|
-
).then((
|
|
139
|
+
const o = [...n.entries()].slice(0, 12), u = T({
|
|
140
|
+
queries: o.map(([s, i]) => ({
|
|
141
|
+
queryKey: ["live-row-locks", s, i.join(","), e],
|
|
142
|
+
queryFn: () => r.request(
|
|
143
|
+
A(`/item-locks/${encodeURIComponent(s)}/active`, { ids: i })
|
|
144
|
+
).then((a) => a.data ?? []).catch(() => []),
|
|
146
145
|
staleTime: 15e3,
|
|
147
|
-
placeholderData: (
|
|
146
|
+
placeholderData: (a) => a,
|
|
148
147
|
retry: !1
|
|
149
148
|
}))
|
|
150
|
-
}),
|
|
149
|
+
}), c = u.map((s) => s.dataUpdatedAt).join(",");
|
|
151
150
|
return b(() => {
|
|
152
151
|
const s = /* @__PURE__ */ new Map();
|
|
153
|
-
return
|
|
154
|
-
for (const l of
|
|
152
|
+
return u.forEach((i, a) => {
|
|
153
|
+
for (const l of i.data ?? []) s.set(`${o[a][0]}:${l.item}`, l);
|
|
155
154
|
}), s;
|
|
156
|
-
}, [
|
|
155
|
+
}, [c]);
|
|
157
156
|
}
|
|
158
|
-
function
|
|
157
|
+
function V(t) {
|
|
159
158
|
return t.is_mine ? "You are editing this" : `${t.locked_by_name ?? "Someone"} is editing this`;
|
|
160
159
|
}
|
|
161
|
-
async function
|
|
162
|
-
const
|
|
163
|
-
if (
|
|
160
|
+
async function Z(t, e, r, n, o) {
|
|
161
|
+
const u = /* @__PURE__ */ new Map(), c = [...new Set(r)].filter((l) => l && l !== "*").slice(0, 100);
|
|
162
|
+
if (c.length === 0) return u;
|
|
164
163
|
let s = [];
|
|
165
164
|
try {
|
|
166
165
|
s = n ? JSON.parse(n) : [];
|
|
167
166
|
} catch {
|
|
168
167
|
s = [];
|
|
169
168
|
}
|
|
170
|
-
const
|
|
171
|
-
|
|
172
|
-
limit:
|
|
173
|
-
conditions: JSON.stringify(
|
|
174
|
-
...
|
|
169
|
+
const i = [...s, { path: ["id"], op: "_in", value: c }], a = await t.request(
|
|
170
|
+
N(`/items/${e}`, {
|
|
171
|
+
limit: c.length,
|
|
172
|
+
conditions: JSON.stringify(i),
|
|
173
|
+
...o ? { search: o } : {}
|
|
175
174
|
})
|
|
176
175
|
);
|
|
177
|
-
for (const l of
|
|
178
|
-
return
|
|
176
|
+
for (const l of a.data ?? []) u.set(String(l.id), l);
|
|
177
|
+
return u;
|
|
179
178
|
}
|
|
180
|
-
function
|
|
179
|
+
function ee(t) {
|
|
181
180
|
const e = /* @__PURE__ */ new Set();
|
|
182
181
|
if (!t) return e;
|
|
183
|
-
const
|
|
182
|
+
const r = (n) => {
|
|
184
183
|
if (!n || typeof n != "object") return;
|
|
185
|
-
const
|
|
186
|
-
Array.isArray(
|
|
187
|
-
for (const
|
|
184
|
+
const o = n;
|
|
185
|
+
Array.isArray(o.path) && typeof o.path[0] == "string" && e.add(o.path[0]);
|
|
186
|
+
for (const u of [o.or, o.and]) Array.isArray(u) && u.forEach(r);
|
|
188
187
|
};
|
|
189
188
|
try {
|
|
190
189
|
const n = JSON.parse(t);
|
|
191
|
-
Array.isArray(n) && n.forEach(
|
|
190
|
+
Array.isArray(n) && n.forEach(r);
|
|
192
191
|
} catch {
|
|
193
192
|
}
|
|
194
193
|
return e;
|
|
195
194
|
}
|
|
196
|
-
function
|
|
195
|
+
function te(t, e) {
|
|
197
196
|
if (t.action === "create" || t.action === "delete") return !0;
|
|
198
|
-
const
|
|
199
|
-
return !
|
|
197
|
+
const r = t.changed_fields;
|
|
198
|
+
return !r || r.length === 0 ? !0 : r.every((n) => n.startsWith("$")) ? !1 : e.has("$changed") ? !0 : e.size === 0 ? !1 : r.some((n) => e.has(n));
|
|
200
199
|
}
|
|
201
|
-
function
|
|
202
|
-
const n =
|
|
203
|
-
|
|
200
|
+
function ne(t, e, r = {}) {
|
|
201
|
+
const n = v(), o = p(e);
|
|
202
|
+
o.current = e;
|
|
203
|
+
const u = p(!!r.paused);
|
|
204
|
+
u.current = !!r.paused;
|
|
205
|
+
const c = p(!1);
|
|
206
|
+
L(
|
|
204
207
|
t,
|
|
205
|
-
(
|
|
206
|
-
if (!
|
|
207
|
-
|
|
208
|
+
(s) => {
|
|
209
|
+
if (!s.aspectsOnly) {
|
|
210
|
+
if (u.current) {
|
|
211
|
+
c.current = !0;
|
|
212
|
+
return;
|
|
213
|
+
}
|
|
214
|
+
for (const i of o.current) n.invalidateQueries({ queryKey: i });
|
|
215
|
+
}
|
|
208
216
|
},
|
|
209
|
-
{ debounceMs:
|
|
210
|
-
)
|
|
217
|
+
{ debounceMs: r.debounceMs ?? 600, enabled: r.enabled, focusable: !0 }
|
|
218
|
+
), w(() => {
|
|
219
|
+
if (!(r.paused || !c.current)) {
|
|
220
|
+
c.current = !1;
|
|
221
|
+
for (const s of o.current) n.invalidateQueries({ queryKey: s });
|
|
222
|
+
}
|
|
223
|
+
}, [r.paused, n]);
|
|
211
224
|
}
|
|
212
|
-
function
|
|
225
|
+
function re(t) {
|
|
213
226
|
const e = t == null ? void 0 : t.user_updated;
|
|
214
227
|
return typeof e == "string" && e ? e : e && typeof e == "object" && typeof e.id == "string" ? e.id : null;
|
|
215
228
|
}
|
|
216
229
|
export {
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
Z as
|
|
230
|
+
K as agoLabel,
|
|
231
|
+
x as changeTitle,
|
|
232
|
+
ee as conditionFields,
|
|
233
|
+
O as flashRows,
|
|
234
|
+
V as lockLabel,
|
|
235
|
+
te as mayAffectMatch,
|
|
236
|
+
U as useActorNames,
|
|
237
|
+
ne as useLiveQueryRefresh,
|
|
238
|
+
P as useRowChanges,
|
|
239
|
+
X as useRowLocks,
|
|
240
|
+
Y as useRowLocksByCollection,
|
|
241
|
+
Z as viewerMatches,
|
|
242
|
+
re as writerOf
|
|
229
243
|
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { useQueryClient as M } from "@tanstack/react-query";
|
|
2
|
+
import { useRef as m, useEffect as p } from "react";
|
|
3
|
+
import { useLiveRecord as y, LIVE_ASPECTS as i } from "./live.js";
|
|
4
|
+
const R = 1500, g = /* @__PURE__ */ new Set([
|
|
5
|
+
i.comments,
|
|
6
|
+
i.tasks,
|
|
7
|
+
i.lock,
|
|
8
|
+
i.sla
|
|
9
|
+
]);
|
|
10
|
+
function w(e) {
|
|
11
|
+
return e.deleted ? !1 : e.changedFields === null ? !0 : e.changedFields.some((n) => !g.has(n));
|
|
12
|
+
}
|
|
13
|
+
const a = /* @__PURE__ */ new Map(), f = /* @__PURE__ */ new Map();
|
|
14
|
+
function E(e, n, t = R) {
|
|
15
|
+
return e == null ? n : Math.max(n, e + t);
|
|
16
|
+
}
|
|
17
|
+
function L(e, n, t = {}) {
|
|
18
|
+
const d = M(), l = m(!!t.hold);
|
|
19
|
+
l.current = !!t.hold;
|
|
20
|
+
const o = m(!1), r = n == null ? "" : String(n), s = `${e ?? ""}${r}`, c = () => {
|
|
21
|
+
if (!e || !r) return;
|
|
22
|
+
if (l.current) {
|
|
23
|
+
o.current = !0;
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
if (f.has(s)) return;
|
|
27
|
+
const u = Date.now(), h = E(a.get(s), u), v = setTimeout(
|
|
28
|
+
() => {
|
|
29
|
+
f.delete(s), a.set(s, Date.now()), a.size > 200 && a.clear(), d.invalidateQueries({ queryKey: ["pipeline-instance", e, r] }), d.invalidateQueries({ queryKey: ["pipeline-instance", e, Number(r)] });
|
|
30
|
+
},
|
|
31
|
+
Math.max(250, h - u)
|
|
32
|
+
);
|
|
33
|
+
f.set(s, v);
|
|
34
|
+
};
|
|
35
|
+
y(
|
|
36
|
+
e,
|
|
37
|
+
r || null,
|
|
38
|
+
(u) => {
|
|
39
|
+
w(u) && c();
|
|
40
|
+
},
|
|
41
|
+
{ enabled: t.enabled !== !1 && !!e && !!r }
|
|
42
|
+
), p(() => {
|
|
43
|
+
!t.hold && o.current && (o.current = !1, c());
|
|
44
|
+
}, [t.hold]);
|
|
45
|
+
}
|
|
46
|
+
export {
|
|
47
|
+
R as MOVES_GAP_MS,
|
|
48
|
+
w as movesMayChange,
|
|
49
|
+
E as nextMovesRefresh,
|
|
50
|
+
L as useLiveMoves
|
|
51
|
+
};
|
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useRef as m, useEffect as l, useState as h } from "react";
|
|
2
2
|
import { useLiveEvent as S } from "./live.js";
|
|
3
3
|
import { useOptionalRealtime as b } from "./realtime.js";
|
|
4
|
-
function
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
if (!(!
|
|
8
|
-
return
|
|
9
|
-
}, [
|
|
4
|
+
function O(t, c, n = {}) {
|
|
5
|
+
const s = b(), u = n.enabled !== !1 && !!t, r = m(n.match);
|
|
6
|
+
r.current = n.match, l(() => {
|
|
7
|
+
if (!(!s || !u || !t))
|
|
8
|
+
return s.emit("ops:join", { topic: t }), () => s.emit("ops:leave", { topic: t });
|
|
9
|
+
}, [s, u, t]), S(
|
|
10
10
|
"ops:changed",
|
|
11
11
|
(e) => {
|
|
12
|
-
|
|
12
|
+
c(e ?? {});
|
|
13
13
|
},
|
|
14
14
|
{
|
|
15
|
-
enabled:
|
|
16
|
-
debounceMs:
|
|
15
|
+
enabled: u,
|
|
16
|
+
debounceMs: n.debounceMs ?? 300,
|
|
17
17
|
includeOwn: !0,
|
|
18
|
-
match: (e) => (e == null ? void 0 : e.topic) === t
|
|
18
|
+
match: (e) => (e == null ? void 0 : e.topic) === t && (!r.current || r.current(e ?? {}))
|
|
19
19
|
}
|
|
20
20
|
);
|
|
21
21
|
}
|
|
22
|
-
function
|
|
23
|
-
const
|
|
24
|
-
return
|
|
25
|
-
const
|
|
26
|
-
if (
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
() =>
|
|
30
|
-
const
|
|
31
|
-
for (const d of
|
|
32
|
-
return
|
|
22
|
+
function R(t, c = 4e3) {
|
|
23
|
+
const n = m(null), [s, u] = h(() => /* @__PURE__ */ new Set()), r = (t ?? []).map(String).join("\0");
|
|
24
|
+
return l(() => {
|
|
25
|
+
const e = new Set(r ? r.split("\0") : []), i = n.current;
|
|
26
|
+
if (n.current = e, !i || i.size === 0) return;
|
|
27
|
+
const f = [...e].filter((o) => !i.has(o));
|
|
28
|
+
f.length !== 0 && (u((o) => /* @__PURE__ */ new Set([...o, ...f])), setTimeout(
|
|
29
|
+
() => u((o) => {
|
|
30
|
+
const a = new Set(o);
|
|
31
|
+
for (const d of f) a.delete(d);
|
|
32
|
+
return a;
|
|
33
33
|
}),
|
|
34
|
-
|
|
34
|
+
c
|
|
35
35
|
));
|
|
36
|
-
}, [
|
|
36
|
+
}, [r, c]), s;
|
|
37
37
|
}
|
|
38
38
|
export {
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
R as useFreshIds,
|
|
40
|
+
O as useLiveOps
|
|
41
41
|
};
|