@nivaro/react 0.3.113 → 0.3.115
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/ScreenShareHost.js +24 -0
- package/dist/full.css +50 -2
- package/dist/hooks/useSessionRecorder.js +61 -60
- package/dist/index.d.ts +1727 -19
- package/dist/index.js +1091 -950
- package/dist/shared/components/ActivityEntry.js +209 -97
- package/dist/shared/components/AgentPresenceChip.js +51 -0
- package/dist/shared/components/AnnouncementBanner.js +56 -41
- package/dist/shared/components/AutolinkedText.js +98 -85
- package/dist/shared/components/BroadcastView.js +149 -141
- package/dist/shared/components/CacheStamp.js +78 -30
- package/dist/shared/components/CollectionBrowserView.js +4088 -3592
- package/dist/shared/components/ConfigChangeStrip.js +63 -0
- package/dist/shared/components/ConfigReachNote.js +107 -0
- package/dist/shared/components/ConformanceView.js +389 -319
- package/dist/shared/components/DataTable.js +544 -504
- package/dist/shared/components/DelegateCoverLine.js +164 -0
- package/dist/shared/components/EnvironmentNotice.js +56 -65
- package/dist/shared/components/FilePreviewLightbox.js +89 -43
- package/dist/shared/components/FindingFixedMark.js +23 -0
- package/dist/shared/components/GridPresenceLine.js +100 -0
- package/dist/shared/components/IdleReloadWatcher.js +82 -43
- package/dist/shared/components/InStep.js +46 -0
- package/dist/shared/components/ItemEditForm.js +5504 -4889
- package/dist/shared/components/LiveAnnouncer.js +62 -0
- package/dist/shared/components/LiveCount.js +54 -0
- package/dist/shared/components/LiveFigure.js +28 -0
- package/dist/shared/components/LiveListControls.js +114 -0
- package/dist/shared/components/LiveNewMatchesPill.js +25 -0
- package/dist/shared/components/LiveOffNote.js +44 -0
- package/dist/shared/components/LivePreferenceHost.js +42 -0
- package/dist/shared/components/LiveRowMark.js +25 -20
- package/dist/shared/components/LiveTraceView.js +257 -0
- package/dist/shared/components/MapView.js +30 -29
- package/dist/shared/components/MatrixEditor.js +497 -462
- package/dist/shared/components/MyWorkView.js +346 -272
- package/dist/shared/components/NotificationBell.js +215 -201
- package/dist/shared/components/PageRenderer.js +636 -599
- package/dist/shared/components/PresenceDot.js +21 -0
- package/dist/shared/components/ProfileView.js +656 -536
- package/dist/shared/components/RealtimeStatusBanner.js +25 -25
- package/dist/shared/components/RecentRecordsRail.js +51 -48
- package/dist/shared/components/RecordCompare.js +241 -150
- package/dist/shared/components/RecordDrilldownSheet.js +66 -64
- package/dist/shared/components/RecordGridEditor.js +350 -311
- package/dist/shared/components/RecordHoverCard.js +147 -0
- package/dist/shared/components/RecordPeekHost.js +111 -0
- package/dist/shared/components/RecordReadView.js +414 -412
- package/dist/shared/components/RelativeTime.js +16 -0
- package/dist/shared/components/ReportView.js +1396 -1304
- package/dist/shared/components/ScreenRefreshButton.js +77 -0
- package/dist/shared/components/TabCountHost.js +10 -0
- package/dist/shared/components/TickerNumber.js +19 -18
- package/dist/shared/components/TipLayer.js +70 -58
- package/dist/shared/components/WidgetImageMenu.js +59 -0
- package/dist/shared/components/WidgetSlot.js +571 -524
- package/dist/shared/components/activity/RecordActivityStream.js +317 -0
- package/dist/shared/components/bulk/BulkSelectionNotices.js +220 -0
- package/dist/shared/components/cbv/approval-changed.js +20 -0
- package/dist/shared/components/cbv/changed-by-others.js +251 -0
- package/dist/shared/components/cbv/column-totals.js +75 -67
- package/dist/shared/components/change-proposals/ChangeProposalsPanel.js +320 -0
- package/dist/shared/components/change-proposals/ProposalValue.js +28 -0
- package/dist/shared/components/change-proposals/ProposeChangeButton.js +44 -0
- package/dist/shared/components/change-proposals/ProposeChangeDialog.js +359 -0
- package/dist/shared/components/change-proposals/types.js +4 -0
- package/dist/shared/components/chat/ChatPanel.js +1571 -1528
- package/dist/shared/components/chat/Composer.js +276 -298
- package/dist/shared/components/chat/room-due.js +13 -0
- package/dist/shared/components/collections-directory/CollectionRow.js +76 -75
- package/dist/shared/components/collections-directory/CollectionsDirectory.js +415 -395
- package/dist/shared/components/collections-directory/directory-data.js +75 -63
- package/dist/shared/components/imports/ImportConsole.js +159 -155
- package/dist/shared/components/imports/ImportDuplicatesNotice.js +46 -31
- package/dist/shared/components/integrations/SendStatus.js +202 -0
- package/dist/shared/components/integrations/console/IntegrationsConsole.js +45 -36
- package/dist/shared/components/integrations/console/ReadyToSendView.js +453 -0
- package/dist/shared/components/integrations/console/api.js +161 -117
- package/dist/shared/components/integrations/console/tone.js +15 -12
- package/dist/shared/components/item-edit/CatalogPickerField.js +1353 -1245
- package/dist/shared/components/item-edit/ChangedAfterApprovalBadge.js +162 -0
- package/dist/shared/components/item-edit/CloneDialog.js +208 -206
- package/dist/shared/components/item-edit/DerivedCauseNote.js +57 -0
- package/dist/shared/components/item-edit/DraftRecoveryBanner.js +81 -70
- package/dist/shared/components/item-edit/DuplicateNotice.js +169 -101
- package/dist/shared/components/item-edit/FieldAffordances.js +294 -385
- package/dist/shared/components/item-edit/FieldComments.js +159 -116
- package/dist/shared/components/item-edit/FieldPointer.js +132 -0
- package/dist/shared/components/item-edit/FieldRenderer.js +277 -273
- package/dist/shared/components/item-edit/FieldRow.js +519 -439
- package/dist/shared/components/item-edit/FieldSourceBadge.js +88 -0
- package/dist/shared/components/item-edit/FilePickerField.js +454 -369
- package/dist/shared/components/item-edit/GroupSection.js +618 -567
- package/dist/shared/components/item-edit/HeldEditsChip.js +113 -0
- package/dist/shared/components/item-edit/InlineTableField.js +2891 -2723
- package/dist/shared/components/item-edit/ListNeighborNav.js +79 -0
- package/dist/shared/components/item-edit/LiveTraceSheet.js +26 -0
- package/dist/shared/components/item-edit/M2MCombobox.js +284 -273
- package/dist/shared/components/item-edit/OutboxReviewTray.js +313 -0
- package/dist/shared/components/item-edit/PickerBadges.js +52 -0
- package/dist/shared/components/item-edit/PlanGrid.js +434 -439
- package/dist/shared/components/item-edit/RecalcValue.js +55 -0
- package/dist/shared/components/item-edit/RecordChatActions.js +76 -64
- package/dist/shared/components/item-edit/RecordChatMentionsChip.js +103 -0
- package/dist/shared/components/item-edit/RecordGrantTools.js +87 -86
- package/dist/shared/components/item-edit/RecordHelpChip.js +70 -0
- package/dist/shared/components/item-edit/RecordLiveSync.js +230 -217
- package/dist/shared/components/item-edit/RecordOutbox.js +53 -52
- package/dist/shared/components/item-edit/RecordRecapStrip.js +109 -36
- package/dist/shared/components/item-edit/RelationCombobox.js +229 -217
- package/dist/shared/components/item-edit/RelationGroupedCombobox.js +105 -100
- package/dist/shared/components/item-edit/RemoteChangeUi.js +454 -0
- package/dist/shared/components/item-edit/RemoteUploads.js +55 -0
- package/dist/shared/components/item-edit/RemovedLineNote.js +92 -0
- package/dist/shared/components/item-edit/RichTextEditorImpl.js +298 -223
- package/dist/shared/components/item-edit/ScheduledChangeChip.js +244 -0
- package/dist/shared/components/item-edit/SectionPresence.js +78 -0
- package/dist/shared/components/item-edit/SplitLinesButton.js +166 -0
- package/dist/shared/components/item-edit/catalog-line-watch.js +94 -0
- package/dist/shared/components/item-edit/coedit/collab.js +84 -0
- package/dist/shared/components/item-edit/coedit/context.js +24 -0
- package/dist/shared/components/item-edit/coedit/cursors.js +103 -0
- package/dist/shared/components/item-edit/coedit/safe-link.js +15 -0
- package/dist/shared/components/item-edit/coedit/session.js +382 -0
- package/dist/shared/components/item-edit/coedit/useCoedit.js +49 -0
- package/dist/shared/components/item-edit/file-live.js +77 -0
- package/dist/shared/components/item-edit/file-processing.js +87 -0
- package/dist/shared/components/item-edit/layout-switch.js +148 -0
- package/dist/shared/components/item-edit/live-related.js +23 -0
- package/dist/shared/components/item-edit/live-title.js +66 -0
- package/dist/shared/components/item-edit/partner-needs.js +142 -0
- package/dist/shared/components/item-edit/removed-line.js +58 -0
- package/dist/shared/components/item-edit/render-stability.js +70 -59
- package/dist/shared/components/layout-editor/ChangeNote.js +36 -34
- package/dist/shared/components/layout-editor/CollabParts.js +72 -70
- package/dist/shared/components/layout-editor/LayoutEditor.js +306 -303
- package/dist/shared/components/list/InlineEdit.js +504 -208
- package/dist/shared/components/list/ListViewers.js +81 -0
- package/dist/shared/components/merge/MergeRecordsDialog.js +1227 -0
- package/dist/shared/components/merge/MergeWithFlow.js +290 -0
- package/dist/shared/components/merge/merge-values.js +110 -0
- package/dist/shared/components/monitoring/InactiveUserLinksView.js +285 -258
- package/dist/shared/components/notifications/NotificationCenterView.js +388 -321
- package/dist/shared/components/notifications/NotificationDetailBits.js +205 -130
- package/dist/shared/components/notifications/NotificationRulesEditor.js +72 -52
- package/dist/shared/components/notifications/bundles.js +21 -19
- package/dist/shared/components/notifications/resolved-line.js +25 -0
- package/dist/shared/components/ops/OpsTasksView.js +45 -44
- package/dist/shared/components/panels/AccessGrantedNote.js +85 -0
- package/dist/shared/components/panels/AlertBanners.js +132 -0
- package/dist/shared/components/panels/AsyncUserPicker.js +54 -45
- package/dist/shared/components/panels/BranchLanes.js +82 -54
- package/dist/shared/components/panels/CommentAwareness.js +332 -0
- package/dist/shared/components/panels/CommentImages.js +219 -0
- package/dist/shared/components/panels/CommentPanel.js +649 -530
- package/dist/shared/components/panels/ExternalRequestsChip.js +98 -80
- package/dist/shared/components/panels/NewSinceChip.js +16 -0
- package/dist/shared/components/panels/OwnerOpenedLine.js +85 -0
- package/dist/shared/components/panels/PipelinePanel.js +1644 -1494
- package/dist/shared/components/panels/ResubmissionDiff.js +293 -0
- package/dist/shared/components/panels/SlaBreachBanner.js +30 -29
- package/dist/shared/components/panels/SlaClock.js +130 -99
- package/dist/shared/components/panels/TaskPanel.js +308 -287
- package/dist/shared/components/panels/unseen-move-check.js +101 -0
- package/dist/shared/components/pipeline/OwnerMatrix.js +80 -71
- package/dist/shared/components/pipeline/OwnerMatrixSheet.js +495 -0
- package/dist/shared/components/pipeline/PipelineEditorView.js +1855 -1771
- package/dist/shared/components/profile/AgentNameField.js +141 -0
- package/dist/shared/components/profile/AgentsPanel.js +55 -46
- package/dist/shared/components/profile/PersonAccess.js +398 -330
- package/dist/shared/components/profile/PersonAdminTools.js +127 -113
- package/dist/shared/components/profile/PersonProfile.js +81 -73
- package/dist/shared/components/profile/SignInTroubleshooter.js +361 -0
- package/dist/shared/components/queue/QueueBulkBar.js +101 -84
- package/dist/shared/components/queue/QueueItemSheet.js +66 -66
- package/dist/shared/components/queue/QueueTeamStrip.js +279 -0
- package/dist/shared/components/queue/QueueWorklist.js +2076 -1686
- package/dist/shared/components/queue/queue-totals.js +92 -0
- package/dist/shared/components/queue/worklist-helpers.js +18 -14
- package/dist/shared/components/send-view/SendViewButton.js +136 -0
- package/dist/shared/components/send-view/SentViewCards.js +147 -0
- package/dist/shared/components/support/ReportProblem.js +1 -0
- package/dist/shared/components/support/ScreenShare.js +554 -0
- package/dist/shared/components/support/SupportView.js +160 -129
- package/dist/shared/components/support/TicketDetailSheet.js +101 -89
- package/dist/shared/components/watch-list/WatchDock.js +1044 -0
- package/dist/shared/components/watch-list/WatchExtras.js +723 -0
- package/dist/shared/components/watch-list/WatchListButton.js +46 -0
- package/dist/shared/components/watch-list/WatchPinButton.js +67 -0
- package/dist/shared/components/watch-list/WatchRows.js +348 -0
- package/dist/shared/lib/activity-sentence.js +87 -75
- package/dist/shared/lib/agent-presence.js +46 -0
- package/dist/shared/lib/approval-progress.js +49 -0
- package/dist/shared/lib/attention-prefs.js +27 -0
- package/dist/shared/lib/cell-locks.js +56 -0
- package/dist/shared/lib/co-edit.js +166 -0
- package/dist/shared/lib/coedit-registry.js +44 -0
- package/dist/shared/lib/comment-awareness.js +124 -0
- package/dist/shared/lib/comment-images.js +45 -0
- package/dist/shared/lib/config-watch.js +94 -0
- package/dist/shared/lib/copy-rules.js +65 -0
- package/dist/shared/lib/count-step.js +30 -0
- package/dist/shared/lib/deadline-ticker.js +68 -0
- package/dist/shared/lib/derived-causes.js +115 -0
- package/dist/shared/lib/draft-store.js +114 -85
- package/dist/shared/lib/error-hints.js +1 -0
- package/dist/shared/lib/field-merge.js +126 -0
- package/dist/shared/lib/filter-sentence.js +10 -10
- package/dist/shared/lib/focus-mode.js +16 -12
- package/dist/shared/lib/grid-cursors.js +77 -0
- package/dist/shared/lib/grid-presence.js +182 -0
- package/dist/shared/lib/idle-reload.js +100 -73
- package/dist/shared/lib/in-step.js +45 -0
- package/dist/shared/lib/integration-chip.js +19 -18
- package/dist/shared/lib/line-locks.js +141 -0
- package/dist/shared/lib/line-split.js +41 -0
- package/dist/shared/lib/linked-changes.js +150 -0
- package/dist/shared/lib/list-link.js +56 -50
- package/dist/shared/lib/list-return.js +231 -0
- package/dist/shared/lib/list-viewers.js +52 -0
- package/dist/shared/lib/live-announcer.js +86 -0
- package/dist/shared/lib/live-counts.js +85 -0
- package/dist/shared/lib/live-data-changed.js +108 -0
- package/dist/shared/lib/live-deltas.js +81 -0
- package/dist/shared/lib/live-findings.js +113 -0
- package/dist/shared/lib/live-groups.js +122 -0
- package/dist/shared/lib/live-link-labels.js +162 -0
- package/dist/shared/lib/live-list-flow.js +334 -0
- package/dist/shared/lib/live-list.js +143 -129
- package/dist/shared/lib/live-moves.js +51 -0
- package/dist/shared/lib/live-ops.js +26 -26
- package/dist/shared/lib/live-pickers.js +7 -0
- package/dist/shared/lib/live-preference.js +184 -0
- package/dist/shared/lib/live-queries.js +226 -181
- package/dist/shared/lib/live-screen.js +333 -0
- package/dist/shared/lib/live-search.js +108 -0
- package/dist/shared/lib/live-seen.js +35 -0
- package/dist/shared/lib/live-views.js +100 -0
- package/dist/shared/lib/live.js +159 -133
- package/dist/shared/lib/missed-updates.js +198 -0
- package/dist/shared/lib/newer-file.js +56 -0
- package/dist/shared/lib/notification-sound.js +42 -20
- package/dist/shared/lib/own-writes.js +59 -41
- package/dist/shared/lib/picker-badges.js +94 -0
- package/dist/shared/lib/presence-signals.js +131 -84
- package/dist/shared/lib/realtime.js +49 -24
- package/dist/shared/lib/record-gaps.js +85 -0
- package/dist/shared/lib/record-outbox.js +369 -222
- package/dist/shared/lib/record-peek.js +75 -0
- package/dist/shared/lib/record-tabs.js +92 -72
- package/dist/shared/lib/relative-ticker.js +42 -0
- package/dist/shared/lib/request-gate.js +119 -119
- package/dist/shared/lib/rollup-recalc.js +107 -0
- package/dist/shared/lib/room-gaps.js +40 -36
- package/dist/shared/lib/rum.js +137 -87
- package/dist/shared/lib/save-progress.js +20 -0
- package/dist/shared/lib/scheduled-countdown.js +67 -0
- package/dist/shared/lib/screen-refresh.js +160 -0
- package/dist/shared/lib/screen-share.js +234 -0
- package/dist/shared/lib/seen-since.js +74 -0
- package/dist/shared/lib/selection-watch.js +205 -0
- package/dist/shared/lib/send-status.js +132 -0
- package/dist/shared/lib/send-view.js +23 -0
- package/dist/shared/lib/socket-liveness.js +155 -0
- package/dist/shared/lib/socket-realtime.js +168 -140
- package/dist/shared/lib/state-census.js +53 -0
- package/dist/shared/lib/summary-mode.js +61 -39
- package/dist/shared/lib/tab-attention.js +143 -32
- package/dist/shared/lib/table-density.js +64 -0
- package/dist/shared/lib/track-travel.js +40 -0
- package/dist/shared/lib/unseen-changes.js +68 -0
- package/dist/shared/lib/upload-file.js +33 -0
- package/dist/shared/lib/upload-presence.js +127 -0
- package/dist/shared/lib/urgent-chime.js +65 -0
- package/dist/shared/lib/use-online-users.js +32 -11
- package/dist/shared/lib/user-sync.js +155 -39
- package/dist/shared/lib/waiting-count.js +44 -0
- package/dist/shared/lib/watch-desktop.js +83 -0
- package/dist/shared/lib/watch-list.js +447 -0
- package/dist/shared/lib/widget-image-render.js +64 -0
- package/dist/shared/lib/widget-image.js +111 -0
- package/dist/shared/lib/worker-socket.js +130 -104
- package/dist/shared/lib/write-to-screen.js +133 -0
- package/package.json +1 -1
- package/styles.css +49 -1
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { jsxs as l, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { QueryClientContext as p } from "@tanstack/react-query";
|
|
3
|
+
import { Check as g, RotateCw as b } from "lucide-react";
|
|
4
|
+
import { useContext as x, useEffect as h } from "react";
|
|
5
|
+
import { useLivePreference as v } from "../lib/live-preference.js";
|
|
6
|
+
import { registerPageRefreshButton as w, usePageRefreshButtonShown as R, useScreenRefreshState as k, refreshScreenData as y, screenRefreshClient as C, setScreenRefreshClient as S } from "../lib/screen-refresh.js";
|
|
7
|
+
import { cn as o } from "../lib/utils.js";
|
|
8
|
+
import { LiveOffNote as u } from "./LiveOffNote.js";
|
|
9
|
+
function E({
|
|
10
|
+
variant: e = "header",
|
|
11
|
+
className: c
|
|
12
|
+
}) {
|
|
13
|
+
const a = x(p);
|
|
14
|
+
h(() => {
|
|
15
|
+
a && !C() && S(a);
|
|
16
|
+
}, [a]);
|
|
17
|
+
const n = e === "header";
|
|
18
|
+
h(() => n ? w() : void 0, [n]);
|
|
19
|
+
const m = R(), { phase: t } = k(), i = t === "running", { off: s } = v(), f = s && t !== "running" && t !== "partial" ? "Live updates are off. Refresh this page’s data (keeps your edits and place)" : t === "running" ? "Refreshing this page’s data…" : t === "partial" ? "Some parts of this page did not refresh. Refresh again" : "Refresh this page’s data (keeps your edits and place)";
|
|
20
|
+
if (!n && m) return null;
|
|
21
|
+
const d = /* @__PURE__ */ l(
|
|
22
|
+
"button",
|
|
23
|
+
{
|
|
24
|
+
type: "button",
|
|
25
|
+
"aria-label": f,
|
|
26
|
+
"data-tip": f,
|
|
27
|
+
"data-screen-refresh": t,
|
|
28
|
+
"aria-busy": i || void 0,
|
|
29
|
+
onClick: () => {
|
|
30
|
+
i || y({ reason: "button", qc: a ?? void 0 });
|
|
31
|
+
},
|
|
32
|
+
className: o(
|
|
33
|
+
"relative inline-flex shrink-0 items-center justify-center rounded-md transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan",
|
|
34
|
+
e === "rail" && "h-8 w-8 text-slate-400 hover:bg-white/[0.05] hover:text-white focus-visible:ring-offset-0",
|
|
35
|
+
e === "header" && "h-8 w-8 text-slate-400 hover:bg-muted hover:text-slate-700 dark:text-muted-foreground dark:hover:text-foreground",
|
|
36
|
+
e === "bar" && "h-8 w-8 opacity-80 hover:opacity-100",
|
|
37
|
+
c
|
|
38
|
+
),
|
|
39
|
+
children: [
|
|
40
|
+
t === "done" ? /* @__PURE__ */ r(
|
|
41
|
+
g,
|
|
42
|
+
{
|
|
43
|
+
"aria-hidden": !0,
|
|
44
|
+
className: o(
|
|
45
|
+
"h-[15px] w-[15px] motion-safe:animate-in motion-safe:fade-in",
|
|
46
|
+
e === "rail" ? "text-emerald-400" : "text-emerald-600 dark:text-emerald-400"
|
|
47
|
+
)
|
|
48
|
+
}
|
|
49
|
+
) : /* @__PURE__ */ r(
|
|
50
|
+
b,
|
|
51
|
+
{
|
|
52
|
+
"aria-hidden": !0,
|
|
53
|
+
className: o(
|
|
54
|
+
"h-[15px] w-[15px]",
|
|
55
|
+
i && "animate-spin [animation-duration:900ms] motion-reduce:animate-none"
|
|
56
|
+
)
|
|
57
|
+
}
|
|
58
|
+
),
|
|
59
|
+
t === "partial" && /* @__PURE__ */ r(
|
|
60
|
+
"span",
|
|
61
|
+
{
|
|
62
|
+
"aria-hidden": !0,
|
|
63
|
+
className: "absolute right-1 top-1 h-1.5 w-1.5 rounded-full bg-amber-500 dark:bg-amber-400"
|
|
64
|
+
}
|
|
65
|
+
),
|
|
66
|
+
e === "rail" && /* @__PURE__ */ r(u, { variant: "dot" })
|
|
67
|
+
]
|
|
68
|
+
}
|
|
69
|
+
);
|
|
70
|
+
return !s || e === "rail" ? d : /* @__PURE__ */ l("span", { className: "inline-flex items-center gap-1.5", children: [
|
|
71
|
+
/* @__PURE__ */ r(u, { variant: e === "bar" ? "bar" : "header" }),
|
|
72
|
+
d
|
|
73
|
+
] });
|
|
74
|
+
}
|
|
75
|
+
export {
|
|
76
|
+
E as ScreenRefreshButton
|
|
77
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { useAttentionPrefs as e } from "../lib/attention-prefs.js";
|
|
2
|
+
import { useTabAttention as i } from "../lib/tab-attention.js";
|
|
3
|
+
import { useWaitingCount as r } from "../lib/waiting-count.js";
|
|
4
|
+
function f({ extra: n = 0 }) {
|
|
5
|
+
const { tabCount: t } = e(), o = r(t);
|
|
6
|
+
return i(o + (t ? n : 0), { enabled: t, favicon: !0 }), null;
|
|
7
|
+
}
|
|
8
|
+
export {
|
|
9
|
+
f as TabCountHost
|
|
10
|
+
};
|
|
@@ -1,28 +1,29 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useState as
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { jsx as F, Fragment as h } from "react/jsx-runtime";
|
|
2
|
+
import { useState as R, useRef as u, useEffect as g } from "react";
|
|
3
|
+
import { liveMotionAllowed as k } from "../lib/live-preference.js";
|
|
4
|
+
function y({
|
|
5
|
+
value: r,
|
|
6
|
+
format: c,
|
|
6
7
|
durationMs: i = 450
|
|
7
8
|
}) {
|
|
8
|
-
const [s,
|
|
9
|
-
return
|
|
10
|
-
const
|
|
11
|
-
if (m.current =
|
|
12
|
-
r
|
|
9
|
+
const [s, n] = R(r), m = u(null), t = u(0);
|
|
10
|
+
return g(() => {
|
|
11
|
+
const e = m.current;
|
|
12
|
+
if (m.current = r, e === null || e === r) {
|
|
13
|
+
n(r);
|
|
13
14
|
return;
|
|
14
15
|
}
|
|
15
|
-
if (
|
|
16
|
-
r
|
|
16
|
+
if (!k()) {
|
|
17
|
+
n(r);
|
|
17
18
|
return;
|
|
18
19
|
}
|
|
19
|
-
const
|
|
20
|
-
const
|
|
21
|
-
|
|
20
|
+
const p = performance.now(), f = e, l = r - f, a = (d) => {
|
|
21
|
+
const o = Math.min(1, (d - p) / i), A = 1 - (1 - o) ** 3;
|
|
22
|
+
n(o >= 1 ? r : Math.round(f + l * A)), o < 1 && (t.current = requestAnimationFrame(a));
|
|
22
23
|
};
|
|
23
|
-
return cancelAnimationFrame(t.current), t.current = requestAnimationFrame(
|
|
24
|
-
}, [
|
|
24
|
+
return cancelAnimationFrame(t.current), t.current = requestAnimationFrame(a), () => cancelAnimationFrame(t.current);
|
|
25
|
+
}, [r, i]), /* @__PURE__ */ F(h, { children: c ? c(s) : s.toLocaleString() });
|
|
25
26
|
}
|
|
26
27
|
export {
|
|
27
|
-
|
|
28
|
+
y as TickerNumber
|
|
28
29
|
};
|
|
@@ -1,84 +1,96 @@
|
|
|
1
1
|
import { jsx as L } from "react/jsx-runtime";
|
|
2
|
-
import { useState as
|
|
2
|
+
import { useState as x, useRef as y, useEffect as b, useLayoutEffect as E } from "react";
|
|
3
3
|
import { createPortal as M } from "react-dom";
|
|
4
|
-
const a = [],
|
|
5
|
-
function
|
|
6
|
-
const [
|
|
7
|
-
return
|
|
8
|
-
var
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
}), []),
|
|
12
|
-
if (!
|
|
13
|
-
const
|
|
4
|
+
const a = [], O = '[data-nvr-header-menu-panel], [role="menu"]', g = 6;
|
|
5
|
+
function W() {
|
|
6
|
+
const [t, h] = x(null), [r, l] = x(!1), p = y(null);
|
|
7
|
+
return b(() => (a.push(l), a[0] === l && l(!0), () => {
|
|
8
|
+
var e;
|
|
9
|
+
const c = a.indexOf(l);
|
|
10
|
+
c < 0 || (a.splice(c, 1), c === 0 && ((e = a[0]) == null || e.call(a, !0)));
|
|
11
|
+
}), []), b(() => {
|
|
12
|
+
if (!r) return;
|
|
13
|
+
const c = (n) => {
|
|
14
14
|
var v;
|
|
15
|
-
const
|
|
16
|
-
if (!
|
|
17
|
-
|
|
15
|
+
const i = (v = n == null ? void 0 : n.closest) == null ? void 0 : v.call(n, "[data-tip]"), u = i == null ? void 0 : i.getAttribute("data-tip");
|
|
16
|
+
if (!i || !u || i.getAttribute("aria-expanded") === "true") {
|
|
17
|
+
h((w) => w && null);
|
|
18
18
|
return;
|
|
19
19
|
}
|
|
20
|
-
const
|
|
21
|
-
if (m && m !==
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
x:
|
|
25
|
-
y:
|
|
26
|
-
text:
|
|
27
|
-
beside: { left:
|
|
20
|
+
const o = i.getBoundingClientRect(), m = i.closest(O);
|
|
21
|
+
if (m && m !== i) {
|
|
22
|
+
const w = m.getBoundingClientRect();
|
|
23
|
+
h({
|
|
24
|
+
x: w.left,
|
|
25
|
+
y: o.top,
|
|
26
|
+
text: u,
|
|
27
|
+
beside: { left: w.left, right: w.right, rowTop: o.top, rowHeight: o.height }
|
|
28
28
|
});
|
|
29
29
|
return;
|
|
30
30
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
31
|
+
if (i.getAttribute("data-tip-side") === "right") {
|
|
32
|
+
h({
|
|
33
|
+
x: o.right + g,
|
|
34
|
+
y: o.top,
|
|
35
|
+
text: u,
|
|
36
|
+
rightOf: { left: o.left, right: o.right, top: o.top, height: o.height }
|
|
37
|
+
});
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
h({ x: o.left, y: o.bottom + 4, text: u });
|
|
41
|
+
}, e = (n) => c(n.target), f = () => h(null), s = (n) => {
|
|
42
|
+
var u, o;
|
|
43
|
+
const i = (o = (u = n.target) == null ? void 0 : u.closest) == null ? void 0 : o.call(u, "[data-tip-focus]");
|
|
44
|
+
i && c(i);
|
|
45
|
+
}, d = (n) => {
|
|
46
|
+
var i, u;
|
|
47
|
+
(u = (i = n.target) == null ? void 0 : i.closest) != null && u.call(i, "[data-tip-focus]") && h(null);
|
|
39
48
|
};
|
|
40
|
-
return window.addEventListener("mouseover",
|
|
41
|
-
window.removeEventListener("mouseover",
|
|
49
|
+
return window.addEventListener("mouseover", e), window.addEventListener("focusin", s), window.addEventListener("focusout", d), window.addEventListener("pointerdown", f, !0), window.addEventListener("scroll", f, !0), () => {
|
|
50
|
+
window.removeEventListener("mouseover", e), window.removeEventListener("focusin", s), window.removeEventListener("focusout", d), window.removeEventListener("pointerdown", f, !0), window.removeEventListener("scroll", f, !0);
|
|
42
51
|
};
|
|
43
|
-
}, [
|
|
44
|
-
if (!
|
|
45
|
-
const
|
|
46
|
-
if (!
|
|
47
|
-
const
|
|
48
|
-
let { x:
|
|
49
|
-
if (
|
|
50
|
-
const
|
|
51
|
-
|
|
52
|
+
}, [r]), E(() => {
|
|
53
|
+
if (!t) return;
|
|
54
|
+
const c = p.current;
|
|
55
|
+
if (!c) return;
|
|
56
|
+
const e = c.getBoundingClientRect();
|
|
57
|
+
let { x: f, y: s } = t;
|
|
58
|
+
if (t.rightOf) {
|
|
59
|
+
const d = t.rightOf, n = d.right + g;
|
|
60
|
+
f = n + e.width <= window.innerWidth - 8 ? n : Math.max(8, d.left - g - e.width), s = Math.round(d.top + (d.height - e.height) / 2), s = Math.max(8, Math.min(s, window.innerHeight - e.height - 8));
|
|
61
|
+
} else if (t.beside) {
|
|
62
|
+
const d = t.beside, n = d.left - g - e.width;
|
|
63
|
+
f = n >= 8 ? n : Math.min(d.right + g, Math.max(8, window.innerWidth - e.width - 8)), s = Math.round(d.rowTop + (d.rowHeight - e.height) / 2), s = Math.max(8, Math.min(s, window.innerHeight - e.height - 8));
|
|
52
64
|
} else
|
|
53
|
-
|
|
54
|
-
(
|
|
55
|
-
}, [
|
|
65
|
+
e.right > window.innerWidth - 8 && (f = Math.max(8, window.innerWidth - e.width - 8)), e.bottom > window.innerHeight - 8 && (s = Math.max(8, t.y - e.height - 30));
|
|
66
|
+
(f !== t.x || s !== t.y) && h({ ...t, x: f, y: s });
|
|
67
|
+
}, [t]), !r || !t ? null : M(
|
|
56
68
|
/* @__PURE__ */ L(
|
|
57
69
|
"div",
|
|
58
70
|
{
|
|
59
71
|
ref: p,
|
|
60
|
-
style: { position: "fixed", left:
|
|
72
|
+
style: { position: "fixed", left: t.x, top: t.y, zIndex: 120 },
|
|
61
73
|
className: "pointer-events-none max-w-[340px] whitespace-pre-wrap break-words rounded-md bg-[#0f172a] px-2 py-1 text-[11px] font-medium leading-snug text-white shadow-lg dark:bg-[#334155] dark:ring-1 dark:ring-white/10",
|
|
62
|
-
children:
|
|
74
|
+
children: t.text
|
|
63
75
|
}
|
|
64
76
|
),
|
|
65
77
|
document.body
|
|
66
78
|
);
|
|
67
79
|
}
|
|
68
|
-
function
|
|
69
|
-
const
|
|
80
|
+
function T(t) {
|
|
81
|
+
const h = y(null);
|
|
70
82
|
return E(() => {
|
|
71
|
-
const
|
|
72
|
-
if (!
|
|
73
|
-
const
|
|
74
|
-
(
|
|
83
|
+
const r = h.current;
|
|
84
|
+
if (!r) return;
|
|
85
|
+
const l = () => {
|
|
86
|
+
(r.scrollWidth > r.clientWidth + 1 || r.scrollHeight > r.clientHeight + 1) && t ? r.setAttribute("data-tip", t) : r.removeAttribute("data-tip");
|
|
75
87
|
};
|
|
76
|
-
if (
|
|
77
|
-
const p = new ResizeObserver(
|
|
78
|
-
return p.observe(
|
|
79
|
-
}, [
|
|
88
|
+
if (l(), typeof ResizeObserver > "u") return;
|
|
89
|
+
const p = new ResizeObserver(l);
|
|
90
|
+
return p.observe(r), () => p.disconnect();
|
|
91
|
+
}, [t]), h;
|
|
80
92
|
}
|
|
81
93
|
export {
|
|
82
|
-
|
|
83
|
-
|
|
94
|
+
W as TipLayer,
|
|
95
|
+
T as useOverflowTip
|
|
84
96
|
};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { jsxs as o, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { Loader2 as x, MoreHorizontal as N, ImageIcon as I, Download as C } from "lucide-react";
|
|
3
|
+
import { useState as D, useRef as M } from "react";
|
|
4
|
+
import { toast as n } from "sonner";
|
|
5
|
+
import { toastError as f } from "../lib/error-toast.js";
|
|
6
|
+
import { cn as k } from "../lib/utils.js";
|
|
7
|
+
import { widgetImageFileName as S, buildWidgetImageLabel as T } from "../lib/widget-image.js";
|
|
8
|
+
import { WIDGET_IMAGE_IGNORE_ATTR as W, renderWidgetImage as E, copyPngOrSave as G, downloadBlob as j } from "../lib/widget-image-render.js";
|
|
9
|
+
import { DropdownMenu as L, DropdownMenuTrigger as P, DropdownMenuContent as R, DropdownMenuItem as h } from "./ui/dropdown-menu.js";
|
|
10
|
+
function J({
|
|
11
|
+
getTarget: g,
|
|
12
|
+
label: a,
|
|
13
|
+
className: w,
|
|
14
|
+
align: y = "end"
|
|
15
|
+
}) {
|
|
16
|
+
const [i, s] = D(!1), r = M(!1), b = () => T(typeof a == "function" ? a() : a), c = (v) => {
|
|
17
|
+
const l = g();
|
|
18
|
+
if (!l || r.current) return;
|
|
19
|
+
r.current = !0, s(!0);
|
|
20
|
+
const d = b(), u = S(d.title), m = E(l, d), p = () => {
|
|
21
|
+
r.current = !1, s(!1);
|
|
22
|
+
};
|
|
23
|
+
v === "copy" ? G(m, u).then((e) => {
|
|
24
|
+
e === "copied" ? n.success("Copied the picture. Paste it into an email or Teams.") : n.info("Your browser would not copy a picture, so it was saved as a file.");
|
|
25
|
+
}).catch((e) => f(e, "Could not make the picture.")).finally(p) : m.then((e) => {
|
|
26
|
+
j(e, u), n.success("Saved the picture.");
|
|
27
|
+
}).catch((e) => f(e, "Could not make the picture.")).finally(p);
|
|
28
|
+
};
|
|
29
|
+
return /* @__PURE__ */ o(L, { children: [
|
|
30
|
+
/* @__PURE__ */ t(P, { asChild: !0, children: /* @__PURE__ */ t(
|
|
31
|
+
"button",
|
|
32
|
+
{
|
|
33
|
+
type: "button",
|
|
34
|
+
[W]: "",
|
|
35
|
+
"aria-label": "Widget options",
|
|
36
|
+
"data-tip": "Copy or save as a picture",
|
|
37
|
+
disabled: i,
|
|
38
|
+
className: k(
|
|
39
|
+
"inline-flex h-6 w-6 items-center justify-center rounded text-slate-400 transition-colors hover:bg-slate-100 hover:text-slate-700 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan disabled:opacity-60 dark:text-slate-500 dark:hover:bg-white/[0.06] dark:hover:text-slate-200",
|
|
40
|
+
w
|
|
41
|
+
),
|
|
42
|
+
children: i ? /* @__PURE__ */ t(x, { className: "h-3.5 w-3.5 animate-spin", "aria-hidden": !0 }) : /* @__PURE__ */ t(N, { className: "h-3.5 w-3.5", "aria-hidden": !0 })
|
|
43
|
+
}
|
|
44
|
+
) }),
|
|
45
|
+
/* @__PURE__ */ o(R, { align: y, className: "min-w-[170px]", children: [
|
|
46
|
+
/* @__PURE__ */ o(h, { onSelect: () => c("copy"), className: "gap-2 text-[12.5px]", children: [
|
|
47
|
+
/* @__PURE__ */ t(I, { className: "h-3.5 w-3.5", "aria-hidden": !0 }),
|
|
48
|
+
"Copy as image"
|
|
49
|
+
] }),
|
|
50
|
+
/* @__PURE__ */ o(h, { onSelect: () => c("download"), className: "gap-2 text-[12.5px]", children: [
|
|
51
|
+
/* @__PURE__ */ t(C, { className: "h-3.5 w-3.5", "aria-hidden": !0 }),
|
|
52
|
+
"Download PNG"
|
|
53
|
+
] })
|
|
54
|
+
] })
|
|
55
|
+
] });
|
|
56
|
+
}
|
|
57
|
+
export {
|
|
58
|
+
J as WidgetImageMenu
|
|
59
|
+
};
|