@nivaro/react 0.2.53 → 0.2.55
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/full.css +1 -1
- package/dist/hooks/useSessionRecorder.js +99 -98
- package/dist/index.d.ts +452 -4
- package/dist/index.js +644 -618
- package/dist/layout-editor.d.ts +252 -2
- package/dist/shared/components/BackgroundRunOffer.js +117 -0
- package/dist/shared/components/BroadcastView.js +214 -213
- package/dist/shared/components/CollectionBrowserView.js +2592 -2695
- package/dist/shared/components/FormWhatsNew.js +60 -0
- package/dist/shared/components/ItemEditForm.js +3968 -3618
- package/dist/shared/components/JobsTray.js +100 -55
- package/dist/shared/components/MyWorkView.js +91 -89
- package/dist/shared/components/NotificationBell.js +80 -79
- package/dist/shared/components/ProfileView.js +568 -520
- package/dist/shared/components/RecordCompare.js +254 -0
- package/dist/shared/components/RecordReadView.js +598 -543
- package/dist/shared/components/ReportView.js +578 -543
- package/dist/shared/components/RowPresence.js +91 -0
- package/dist/shared/components/TipLayer.js +27 -27
- package/dist/shared/components/WidgetSlot.js +474 -458
- package/dist/shared/components/ai/AiAnalyticsView.js +16 -6
- package/dist/shared/components/ai/AskPanel.js +139 -119
- package/dist/shared/components/ai/FirstWeekCard.js +126 -0
- package/dist/shared/components/bulk/BulkFieldUpdate.js +289 -0
- package/dist/shared/components/bulk/bulk-field-options.js +45 -0
- package/dist/shared/components/charts/CumulativeFlowChart.js +176 -0
- package/dist/shared/components/chat/ChannelArchive.js +326 -0
- package/dist/shared/components/chat/ChannelExtras.js +141 -121
- package/dist/shared/components/chat/ChatAnalyticsView.js +112 -110
- package/dist/shared/components/chat/ChatPanel.js +1695 -1733
- package/dist/shared/components/chat/Composer.js +357 -303
- package/dist/shared/components/chat/MessageActions.js +92 -0
- package/dist/shared/components/chat/MessageFormat.js +290 -264
- package/dist/shared/components/chat/OutboxBubbles.js +146 -0
- package/dist/shared/components/chat/RequestIdCard.js +135 -0
- package/dist/shared/components/chat/RoomHeaderMenu.js +202 -0
- package/dist/shared/components/chat/RoomParts.js +213 -274
- package/dist/shared/components/chat/ScreenClip.js +184 -0
- package/dist/shared/components/chat/chat-core.js +402 -483
- package/dist/shared/components/chat/chat-drafts.js +59 -0
- package/dist/shared/components/chat/chat-emoji.js +348 -0
- package/dist/shared/components/chat/chat-local-time.js +41 -0
- package/dist/shared/components/chat/chat-outbox.js +303 -0
- package/dist/shared/components/chat/chat-window.js +163 -0
- package/dist/shared/components/chat/huddle/HuddleControls.js +143 -0
- package/dist/shared/components/chat/huddle/HuddleStage.js +164 -0
- package/dist/shared/components/chat/huddle/huddle-store.js +342 -0
- package/dist/shared/components/chat/huddle/useHuddle.js +58 -0
- package/dist/shared/components/help-videos/api.js +80 -67
- package/dist/shared/components/help-videos/editor/DetailsTab.js +147 -130
- package/dist/shared/components/item-edit/CatalogPickerField.js +113 -112
- package/dist/shared/components/item-edit/ChangeReasonDialog.js +13 -13
- package/dist/shared/components/item-edit/FieldAffordances.js +9 -8
- package/dist/shared/components/item-edit/FieldRenderer.js +248 -245
- package/dist/shared/components/item-edit/FieldRow.js +382 -320
- package/dist/shared/components/item-edit/FormHelpVideoButton.js +59 -0
- package/dist/shared/components/item-edit/GroupSection.js +786 -639
- package/dist/shared/components/item-edit/HeaderTools.js +59 -56
- package/dist/shared/components/item-edit/InlineTableField.js +3 -1
- package/dist/shared/components/item-edit/LayoutContentBlock.js +47 -24
- package/dist/shared/components/item-edit/RelationCombobox.js +186 -176
- package/dist/shared/components/item-edit/entry/EntryStrip.js +54 -0
- package/dist/shared/components/item-edit/entry/entry-keys.js +27 -0
- package/dist/shared/components/item-edit/entry/useEntryKeyboard.js +70 -0
- package/dist/shared/components/item-edit/entry/useEntryMode.js +59 -0
- package/dist/shared/components/item-edit/form-structure-ui.js +105 -0
- package/dist/shared/components/item-edit/lazy-sections.js +36 -0
- package/dist/shared/components/item-edit/lock-why.js +94 -0
- package/dist/shared/components/item-edit/picker-miss.js +26 -0
- package/dist/shared/components/item-edit/placement-behaviour.js +196 -0
- package/dist/shared/components/item-edit/useFormUsageBeacon.js +65 -0
- package/dist/shared/components/layout-editor/AddPanel.js +226 -151
- package/dist/shared/components/layout-editor/ArrangeButton.js +34 -0
- package/dist/shared/components/layout-editor/AutoArrange.js +86 -0
- package/dist/shared/components/layout-editor/CanvasCompare.js +79 -0
- package/dist/shared/components/layout-editor/ChangeNote.js +147 -0
- package/dist/shared/components/layout-editor/CollabParts.js +175 -0
- package/dist/shared/components/layout-editor/DesignNode.js +311 -116
- package/dist/shared/components/layout-editor/EditorCanvas.js +30 -26
- package/dist/shared/components/layout-editor/EditorTopBar.js +463 -175
- package/dist/shared/components/layout-editor/FindReplace.js +188 -0
- package/dist/shared/components/layout-editor/FormMapButton.js +141 -0
- package/dist/shared/components/layout-editor/HistoryPanel.js +250 -109
- package/dist/shared/components/layout-editor/LayoutEditor.js +1196 -305
- package/dist/shared/components/layout-editor/LayoutsRail.js +94 -67
- package/dist/shared/components/layout-editor/NoteMarker.js +38 -0
- package/dist/shared/components/layout-editor/PlacementsTable.js +187 -0
- package/dist/shared/components/layout-editor/RestorePiece.js +143 -0
- package/dist/shared/components/layout-editor/ScheduleChange.js +106 -0
- package/dist/shared/components/layout-editor/SessionHistory.js +84 -0
- package/dist/shared/components/layout-editor/StagedChip.js +22 -0
- package/dist/shared/components/layout-editor/StructureMenu.js +464 -0
- package/dist/shared/components/layout-editor/UnsavedConfirm.js +103 -0
- package/dist/shared/components/layout-editor/ai/AiToolsButton.js +625 -0
- package/dist/shared/components/layout-editor/ai/ChangeCheck.js +153 -0
- package/dist/shared/components/layout-editor/ai/ai-tools-api.js +80 -0
- package/dist/shared/components/layout-editor/ai/assist-ops.js +38 -0
- package/dist/shared/components/layout-editor/ai/autofill-ops.js +73 -0
- package/dist/shared/components/layout-editor/ai/canvas-capture.js +41 -0
- package/dist/shared/components/layout-editor/ai-forms/AiComposer.js +271 -0
- package/dist/shared/components/layout-editor/ai-forms/AiFormsButton.js +182 -0
- package/dist/shared/components/layout-editor/ai-forms/MeaningSuggestions.js +109 -0
- package/dist/shared/components/layout-editor/ai-forms/SlimPanel.js +170 -0
- package/dist/shared/components/layout-editor/ai-forms/ai-forms-api.js +40 -0
- package/dist/shared/components/layout-editor/ai-forms/pending.js +25 -0
- package/dist/shared/components/layout-editor/ai-forms/plan.js +263 -0
- package/dist/shared/components/layout-editor/ai-rules/AiAskPopover.js +160 -0
- package/dist/shared/components/layout-editor/ai-rules/CascadeWriter.js +175 -0
- package/dist/shared/components/layout-editor/ai-rules/FieldRuleWriter.js +97 -0
- package/dist/shared/components/layout-editor/ai-rules/RuleWriter.js +94 -0
- package/dist/shared/components/layout-editor/ai-rules/ValidationSuggest.js +153 -0
- package/dist/shared/components/layout-editor/ai-rules/api.js +6 -0
- package/dist/shared/components/layout-editor/ai-text/AiTextTools.js +383 -0
- package/dist/shared/components/layout-editor/ai-text/text-ops.js +125 -0
- package/dist/shared/components/layout-editor/assist/AskPanel.js +278 -0
- package/dist/shared/components/layout-editor/assist/ExplainDiff.js +93 -0
- package/dist/shared/components/layout-editor/assist/ProposalsButton.js +150 -0
- package/dist/shared/components/layout-editor/assist/assist-api.js +63 -0
- package/dist/shared/components/layout-editor/assist/jump.js +142 -0
- package/dist/shared/components/layout-editor/assist/settings-index.js +118 -0
- package/dist/shared/components/layout-editor/auto-arrange.js +101 -0
- package/dist/shared/components/layout-editor/bulk/BulkChangesButton.js +221 -0
- package/dist/shared/components/layout-editor/bulk/BulkRun.js +237 -0
- package/dist/shared/components/layout-editor/bulk/MacrosPanel.js +230 -0
- package/dist/shared/components/layout-editor/bulk/bulk-api.js +65 -0
- package/dist/shared/components/layout-editor/bulk/field-labels.js +22 -0
- package/dist/shared/components/layout-editor/bulk/macro-record.js +142 -0
- package/dist/shared/components/layout-editor/bulk/useMacroRecorder.js +65 -0
- package/dist/shared/components/layout-editor/bundle-to-active.js +1 -0
- package/dist/shared/components/layout-editor/canvas-diff.js +157 -0
- package/dist/shared/components/layout-editor/collab/FormFollowShare.js +388 -0
- package/dist/shared/components/layout-editor/collab/collab-api.js +80 -0
- package/dist/shared/components/layout-editor/commands/CommandPalette.js +221 -0
- package/dist/shared/components/layout-editor/commands/intents.js +214 -0
- package/dist/shared/components/layout-editor/commands/parse.js +242 -0
- package/dist/shared/components/layout-editor/design-context.js +26 -6
- package/dist/shared/components/layout-editor/dnd/LayoutDndProvider.js +181 -164
- package/dist/shared/components/layout-editor/dnd/collision.js +25 -23
- package/dist/shared/components/layout-editor/dnd/node.js +69 -57
- package/dist/shared/components/layout-editor/dnd/rail-drop.js +56 -0
- package/dist/shared/components/layout-editor/draft-recovery.js +131 -0
- package/dist/shared/components/layout-editor/editor-notes.js +78 -0
- package/dist/shared/components/layout-editor/editors/swap-config.js +1 -0
- package/dist/shared/components/layout-editor/entry/PlacementPresets.js +149 -0
- package/dist/shared/components/layout-editor/entry/entry-editor-context.js +10 -0
- package/dist/shared/components/layout-editor/entry/presets.js +71 -0
- package/dist/shared/components/layout-editor/entry/tab-order.js +110 -0
- package/dist/shared/components/layout-editor/entry/theme-preview.js +37 -0
- package/dist/shared/components/layout-editor/explain/CanvasRules.js +142 -0
- package/dist/shared/components/layout-editor/explain/default-ghosts.js +81 -0
- package/dist/shared/components/layout-editor/explain/driver-hover.js +62 -0
- package/dist/shared/components/layout-editor/explain/field-sources.js +246 -0
- package/dist/shared/components/layout-editor/explain/rule-graph.js +215 -0
- package/dist/shared/components/layout-editor/explain/use-explain.js +132 -0
- package/dist/shared/components/layout-editor/field-zones.js +116 -0
- package/dist/shared/components/layout-editor/form-map.js +138 -0
- package/dist/shared/components/layout-editor/grid-guides.js +142 -0
- package/dist/shared/components/layout-editor/history-api.js +87 -0
- package/dist/shared/components/layout-editor/inheritance.js +55 -0
- package/dist/shared/components/layout-editor/inspect/inspect-api.js +66 -0
- package/dist/shared/components/layout-editor/inspect/picker-preview.js +48 -0
- package/dist/shared/components/layout-editor/inspect/width-fit.js +87 -0
- package/dist/shared/components/layout-editor/inspector/AiFillSetting.js +85 -0
- package/dist/shared/components/layout-editor/inspector/BehaviourSettings.js +402 -0
- package/dist/shared/components/layout-editor/inspector/Breadcrumb.js +36 -0
- package/dist/shared/components/layout-editor/inspector/BulkInspector.js +179 -0
- package/dist/shared/components/layout-editor/inspector/ColumnFit.js +112 -0
- package/dist/shared/components/layout-editor/inspector/GroupInspector.js +291 -141
- package/dist/shared/components/layout-editor/inspector/HelpTab.js +174 -0
- package/dist/shared/components/layout-editor/inspector/Inspector.js +282 -180
- package/dist/shared/components/layout-editor/inspector/LookTab.js +166 -109
- package/dist/shared/components/layout-editor/inspector/OverrideNotice.js +61 -0
- package/dist/shared/components/layout-editor/inspector/PickerMisses.js +129 -0
- package/dist/shared/components/layout-editor/inspector/PickerPreview.js +134 -0
- package/dist/shared/components/layout-editor/inspector/PickerTab.js +146 -118
- package/dist/shared/components/layout-editor/inspector/RulesTab.js +162 -111
- package/dist/shared/components/layout-editor/inspector/Translations.js +156 -0
- package/dist/shared/components/layout-editor/inspector/kit.js +71 -70
- package/dist/shared/components/layout-editor/inspector/tab-request.js +21 -0
- package/dist/shared/components/layout-editor/is-typing.js +9 -0
- package/dist/shared/components/layout-editor/keyboard-move.js +66 -0
- package/dist/shared/components/layout-editor/lint/LintPanel.js +190 -0
- package/dist/shared/components/layout-editor/lint/lint-api.js +52 -0
- package/dist/shared/components/layout-editor/load-error.js +37 -0
- package/dist/shared/components/layout-editor/matrix/FieldStateMatrix.js +305 -0
- package/dist/shared/components/layout-editor/matrix/MatrixGrid.js +181 -0
- package/dist/shared/components/layout-editor/matrix/RoleSectionMatrix.js +147 -0
- package/dist/shared/components/layout-editor/matrix/matrix-api.js +48 -0
- package/dist/shared/components/layout-editor/matrix/role-matrix.js +36 -0
- package/dist/shared/components/layout-editor/matrix/state-matrix.js +145 -0
- package/dist/shared/components/layout-editor/nav/FindPanel.js +109 -0
- package/dist/shared/components/layout-editor/nav/NavTools.js +114 -0
- package/dist/shared/components/layout-editor/nav/OutlinePanel.js +228 -0
- package/dist/shared/components/layout-editor/nav/ShortcutSheet.js +31 -0
- package/dist/shared/components/layout-editor/nav/find.js +20 -0
- package/dist/shared/components/layout-editor/nav/tree.js +142 -0
- package/dist/shared/components/layout-editor/nav/useEditorNav.js +101 -0
- package/dist/shared/components/layout-editor/nav/view-prefs.js +34 -0
- package/dist/shared/components/layout-editor/ops/ChangeRequestsPanel.js +143 -0
- package/dist/shared/components/layout-editor/ops/DependencyDiagram.js +179 -0
- package/dist/shared/components/layout-editor/ops/LayoutOpsBlocks.js +92 -0
- package/dist/shared/components/layout-editor/ops/PromotePanel.js +287 -0
- package/dist/shared/components/layout-editor/ops/ops-api.js +122 -0
- package/dist/shared/components/layout-editor/outputs/OutputsButton.js +254 -0
- package/dist/shared/components/layout-editor/outputs/help-sheet.js +154 -0
- package/dist/shared/components/layout-editor/outputs/output-api.js +61 -0
- package/dist/shared/components/layout-editor/overview/OverviewActions.js +15 -3
- package/dist/shared/components/layout-editor/overview/describe-conditions.js +24 -14
- package/dist/shared/components/layout-editor/overview/overview-api.js +105 -88
- package/dist/shared/components/layout-editor/overview/purpose.js +15 -13
- package/dist/shared/components/layout-editor/panel-style.js +8 -7
- package/dist/shared/components/layout-editor/parity-keys.json.js +4 -0
- package/dist/shared/components/layout-editor/pin.js +25 -0
- package/dist/shared/components/layout-editor/presence.js +111 -0
- package/dist/shared/components/layout-editor/preview/PreviewModes.js +224 -0
- package/dist/shared/components/layout-editor/preview/PreviewPanes.js +262 -0
- package/dist/shared/components/layout-editor/preview/preview-api.js +57 -0
- package/dist/shared/components/layout-editor/preview/preview-model.js +157 -0
- package/dist/shared/components/layout-editor/restore-piece.js +192 -0
- package/dist/shared/components/layout-editor/reuse/FieldMapStep.js +70 -0
- package/dist/shared/components/layout-editor/reuse/FormMoreMenu.js +127 -0
- package/dist/shared/components/layout-editor/reuse/LibraryRows.js +150 -0
- package/dist/shared/components/layout-editor/reuse/NewFormStart.js +20 -0
- package/dist/shared/components/layout-editor/reuse/SectionReuseActions.js +291 -0
- package/dist/shared/components/layout-editor/reuse/field-match.js +77 -0
- package/dist/shared/components/layout-editor/reuse/reuse-api.js +73 -0
- package/dist/shared/components/layout-editor/reuse/seed.js +13 -0
- package/dist/shared/components/layout-editor/reuse/useFormFromRecord.js +43 -0
- package/dist/shared/components/layout-editor/reuse/useRailCopy.js +34 -0
- package/dist/shared/components/layout-editor/section-structure.js +241 -0
- package/dist/shared/components/layout-editor/settings/EntrySection.js +296 -0
- package/dist/shared/components/layout-editor/settings/FormSettings.js +125 -103
- package/dist/shared/components/layout-editor/settings/InheritanceSection.js +1 -1
- package/dist/shared/components/layout-editor/settings/ResolveSettings.js +255 -0
- package/dist/shared/components/layout-editor/settings/ToolsSection.js +215 -105
- package/dist/shared/components/layout-editor/settings/WhoSection.js +139 -100
- package/dist/shared/components/layout-editor/settings/controls.js +8 -8
- package/dist/shared/components/layout-editor/settings/settings-registry.js +142 -21
- package/dist/shared/components/layout-editor/shortcuts.js +88 -0
- package/dist/shared/components/layout-editor/show-when.js +35 -0
- package/dist/shared/components/layout-editor/slot-names.js +4 -3
- package/dist/shared/components/layout-editor/staged-api.js +64 -0
- package/dist/shared/components/layout-editor/structure-ops.js +403 -0
- package/dist/shared/components/layout-editor/testing/CostLimitSetting.js +42 -0
- package/dist/shared/components/layout-editor/testing/TestingPanels.js +556 -0
- package/dist/shared/components/layout-editor/testing/testing-api.js +67 -0
- package/dist/shared/components/layout-editor/testing/testing-model.js +406 -0
- package/dist/shared/components/layout-editor/testing/use-record-check.js +44 -0
- package/dist/shared/components/layout-editor/toolbar-kit.js +242 -0
- package/dist/shared/components/layout-editor/unsaved-marks.js +72 -0
- package/dist/shared/components/layout-editor/usage/AbTestSection.js +355 -0
- package/dist/shared/components/layout-editor/usage/FillChip.js +27 -0
- package/dist/shared/components/layout-editor/usage/UsagePanel.js +232 -0
- package/dist/shared/components/layout-editor/usage/ab-api.js +86 -0
- package/dist/shared/components/layout-editor/usage/suggest-collapse.js +32 -0
- package/dist/shared/components/layout-editor/usage/suggest-sections.js +55 -0
- package/dist/shared/components/layout-editor/usage/usage-api.js +104 -0
- package/dist/shared/components/layout-editor/useLayoutDraft.js +573 -306
- package/dist/shared/components/notifications/NotificationAnalyticsView.js +148 -77
- package/dist/shared/components/panels/ErpFailureBanner.js +18 -17
- package/dist/shared/components/panels/ExternalRequestsChip.js +63 -62
- package/dist/shared/components/pipeline/PipelineEditorView.js +106 -104
- package/dist/shared/components/profile/AgentsPanel.js +479 -0
- package/dist/shared/components/queue/QueueWorklist.js +1026 -1040
- package/dist/shared/components/support/SuggestFormChange.js +143 -0
- package/dist/shared/components/support/SupportAnalytics.js +171 -0
- package/dist/shared/components/support/SupportView.js +75 -73
- package/dist/shared/lib/ai-fill.js +37 -0
- package/dist/shared/lib/background-runs.js +150 -0
- package/dist/shared/lib/delivery-ack.js +9 -0
- package/dist/shared/lib/entry-badge-style.js +13 -0
- package/dist/shared/lib/entry-config.js +71 -0
- package/dist/shared/lib/form-sections.js +64 -0
- package/dist/shared/lib/form-structure.js +99 -0
- package/dist/shared/lib/form-usage-beacon.js +133 -0
- package/dist/shared/lib/jobs-tray.js +25 -23
- package/dist/shared/lib/keyset-pager.js +37 -0
- package/dist/shared/lib/layout-i18n.js +66 -0
- package/dist/shared/lib/layout-lint.js +490 -0
- package/dist/shared/lib/layout-ops.js +116 -110
- package/dist/shared/lib/layout-resolve.js +113 -0
- package/dist/shared/lib/placement-behaviour.js +144 -0
- package/dist/shared/lib/prefetch.js +149 -0
- package/dist/shared/lib/presence-hooks.js +199 -0
- package/dist/shared/lib/record-outbox.js +82 -81
- package/dist/shared/lib/replay-socket.js +93 -0
- package/dist/shared/lib/request-gate.js +51 -50
- package/dist/shared/lib/room-gaps.js +96 -0
- package/dist/shared/lib/screenshot.js +54 -28
- package/dist/shared/lib/search-log.js +27 -0
- package/dist/shared/lib/socket-realtime.js +101 -80
- package/dist/shared/lib/visible-when.js +34 -0
- package/dist/shared/lib/worker-socket.js +200 -0
- package/package.json +1 -1
|
@@ -1,37 +1,53 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useQuery as
|
|
3
|
-
import { BarChart3 as
|
|
4
|
-
import { useState as
|
|
5
|
-
import { useNivaroClient as
|
|
6
|
-
import { get as
|
|
1
|
+
import { jsxs as d, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { useQuery as k } from "@tanstack/react-query";
|
|
3
|
+
import { BarChart3 as v } from "lucide-react";
|
|
4
|
+
import { useState as f } from "react";
|
|
5
|
+
import { useNivaroClient as w } from "../../context.js";
|
|
6
|
+
import { get as _ } from "../../lib/commands.js";
|
|
7
7
|
import { cn as p } from "../../lib/utils.js";
|
|
8
|
-
const
|
|
9
|
-
function
|
|
10
|
-
return /* @__PURE__ */
|
|
11
|
-
/* @__PURE__ */ e("p", { className: "text-[
|
|
12
|
-
/* @__PURE__ */ e("p", { className: "mt-1 text-[22px] font-semibold tabular-nums text-slate-900 dark:text-foreground", children:
|
|
13
|
-
s && /* @__PURE__ */ e("p", { className: "text-[11px] text-slate-
|
|
8
|
+
const o = (l) => `${Math.round(l * 100)}%`, y = (l) => l == null ? "—" : l < 60 ? `${Math.round(l)}m` : l < 1440 ? `${(l / 60).toFixed(1)}h` : `${(l / 1440).toFixed(1)}d`;
|
|
9
|
+
function m({ label: l, value: n, hint: s }) {
|
|
10
|
+
return /* @__PURE__ */ d("div", { className: "rounded-lg border border-slate-200 bg-white px-4 py-3 dark:border-border dark:bg-card", children: [
|
|
11
|
+
/* @__PURE__ */ e("p", { className: "text-[12px] font-medium text-slate-500 dark:text-muted-foreground", children: l }),
|
|
12
|
+
/* @__PURE__ */ e("p", { className: "mt-1 text-[22px] font-semibold tabular-nums text-slate-900 dark:text-foreground", children: n }),
|
|
13
|
+
s && /* @__PURE__ */ e("p", { className: "text-[11px] text-slate-500 dark:text-muted-foreground", children: s })
|
|
14
14
|
] });
|
|
15
15
|
}
|
|
16
|
-
function
|
|
17
|
-
const
|
|
18
|
-
return /* @__PURE__ */
|
|
16
|
+
function x({ title: l, rows: n, keyLabel: s }) {
|
|
17
|
+
const c = Math.max(1, ...n.map((t) => t.sent));
|
|
18
|
+
return /* @__PURE__ */ d("div", { className: "rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card", children: [
|
|
19
19
|
/* @__PURE__ */ e("header", { className: "border-b border-slate-100 px-4 py-2.5 dark:border-border/60", children: /* @__PURE__ */ e("h3", { className: "text-[13px] font-semibold text-slate-800 dark:text-slate-100", children: l }) }),
|
|
20
|
-
|
|
21
|
-
/* @__PURE__ */ e("thead", { children: /* @__PURE__ */
|
|
20
|
+
n.length === 0 ? /* @__PURE__ */ e("p", { className: "px-4 py-4 text-[12px] text-slate-500 dark:text-muted-foreground", children: "Nothing in this window." }) : /* @__PURE__ */ d("table", { className: "w-full text-[12px] tabular-nums", children: [
|
|
21
|
+
/* @__PURE__ */ e("thead", { children: /* @__PURE__ */ d("tr", { className: "text-left text-[11px] text-slate-500 dark:text-muted-foreground", children: [
|
|
22
22
|
/* @__PURE__ */ e("th", { className: "px-4 py-1.5 font-semibold", children: s }),
|
|
23
23
|
/* @__PURE__ */ e("th", { className: "px-2 py-1.5 text-right font-semibold", children: "Sent" }),
|
|
24
24
|
/* @__PURE__ */ e("th", { className: "px-2 py-1.5 text-right font-semibold", children: "Read" }),
|
|
25
|
-
/* @__PURE__ */ e("th", { className: "px-2 py-1.5 text-right font-semibold", children: "Time to read" })
|
|
25
|
+
/* @__PURE__ */ e("th", { className: "px-2 py-1.5 text-right font-semibold", children: "Time to read" }),
|
|
26
|
+
/* @__PURE__ */ e(
|
|
27
|
+
"th",
|
|
28
|
+
{
|
|
29
|
+
className: "px-2 py-1.5 text-right font-semibold",
|
|
30
|
+
"data-tip": "Share of record notifications the recipient acted on (transition, comment or task) within the window",
|
|
31
|
+
children: "Acted"
|
|
32
|
+
}
|
|
33
|
+
),
|
|
34
|
+
/* @__PURE__ */ e(
|
|
35
|
+
"th",
|
|
36
|
+
{
|
|
37
|
+
className: "px-2 py-1.5 text-right font-semibold",
|
|
38
|
+
"data-tip": "Opened but never acted on within the window",
|
|
39
|
+
children: "Read, no action"
|
|
40
|
+
}
|
|
41
|
+
)
|
|
26
42
|
] }) }),
|
|
27
|
-
/* @__PURE__ */ e("tbody", { children:
|
|
28
|
-
/* @__PURE__ */ e("td", { className: "px-4 py-1.5", children: /* @__PURE__ */
|
|
43
|
+
/* @__PURE__ */ e("tbody", { children: n.map((t) => /* @__PURE__ */ d("tr", { className: "border-t border-slate-100 dark:border-border", children: [
|
|
44
|
+
/* @__PURE__ */ e("td", { className: "px-4 py-1.5", children: /* @__PURE__ */ d("div", { className: "flex items-center gap-2", children: [
|
|
29
45
|
/* @__PURE__ */ e("span", { className: "min-w-0 truncate text-slate-700 dark:text-foreground", children: t.label ?? t.key.replace(/_/g, " ") }),
|
|
30
46
|
/* @__PURE__ */ e(
|
|
31
47
|
"span",
|
|
32
48
|
{
|
|
33
49
|
className: "h-1.5 rounded-full bg-nvr-cyan/40",
|
|
34
|
-
style: { width: `${Math.max(4, t.sent /
|
|
50
|
+
style: { width: `${Math.max(4, t.sent / c * 80)}px` }
|
|
35
51
|
}
|
|
36
52
|
)
|
|
37
53
|
] }) }),
|
|
@@ -42,45 +58,64 @@ function c({ title: l, rows: d, keyLabel: s }) {
|
|
|
42
58
|
className: p(
|
|
43
59
|
t.read_rate >= 0.6 ? "text-emerald-700 dark:text-emerald-400" : t.read_rate >= 0.3 ? "text-slate-700 dark:text-foreground" : "text-amber-700 dark:text-amber-400"
|
|
44
60
|
),
|
|
45
|
-
children:
|
|
61
|
+
children: o(t.read_rate)
|
|
46
62
|
}
|
|
47
63
|
) }),
|
|
48
|
-
/* @__PURE__ */ e("td", { className: "px-2 py-1.5 text-right text-slate-500", children:
|
|
64
|
+
/* @__PURE__ */ e("td", { className: "px-2 py-1.5 text-right text-slate-500", children: y(t.median_minutes_to_read) }),
|
|
65
|
+
/* @__PURE__ */ e(
|
|
66
|
+
"td",
|
|
67
|
+
{
|
|
68
|
+
className: "px-2 py-1.5 text-right text-slate-700 dark:text-foreground",
|
|
69
|
+
"data-tip": t.acted_eligible ? `${t.acted} of ${t.acted_eligible} record notifications` : "",
|
|
70
|
+
children: t.acted_rate == null ? "—" : o(t.acted_rate)
|
|
71
|
+
}
|
|
72
|
+
),
|
|
73
|
+
/* @__PURE__ */ e("td", { className: "px-2 py-1.5 text-right", children: t.read_ignored_rate == null ? /* @__PURE__ */ e("span", { className: "text-slate-400", children: "—" }) : /* @__PURE__ */ e(
|
|
74
|
+
"span",
|
|
75
|
+
{
|
|
76
|
+
className: t.read_ignored_rate >= 0.5 ? "text-amber-700 dark:text-amber-400" : "text-slate-500",
|
|
77
|
+
children: o(t.read_ignored_rate)
|
|
78
|
+
}
|
|
79
|
+
) })
|
|
49
80
|
] }, t.key)) })
|
|
50
81
|
] })
|
|
51
82
|
] });
|
|
52
83
|
}
|
|
53
|
-
function
|
|
54
|
-
const s = Object.entries(
|
|
55
|
-
return /* @__PURE__ */
|
|
56
|
-
/* @__PURE__ */ e("p", { className: "text-[
|
|
57
|
-
|
|
84
|
+
function h({ title: l, counts: n }) {
|
|
85
|
+
const s = Object.entries(n).filter(([, t]) => t > 0), c = s.reduce((t, [, i]) => t + i, 0);
|
|
86
|
+
return /* @__PURE__ */ d("div", { className: "rounded-lg border border-slate-200 bg-white px-4 py-3 dark:border-border dark:bg-card", children: [
|
|
87
|
+
/* @__PURE__ */ e("p", { className: "text-[12px] font-medium text-slate-500 dark:text-muted-foreground", children: l }),
|
|
88
|
+
c === 0 ? /* @__PURE__ */ e("p", { className: "mt-1 text-[12px] text-slate-500 dark:text-muted-foreground", children: "No tracked deliveries yet." }) : /* @__PURE__ */ e("ul", { className: "mt-1 space-y-0.5 text-[12px]", children: s.sort((t, i) => i[1] - t[1]).map(([t, i]) => /* @__PURE__ */ d("li", { className: "flex items-center justify-between", children: [
|
|
58
89
|
/* @__PURE__ */ e("span", { className: "text-slate-600 dark:text-muted-foreground", children: t.replace(/_/g, " ") }),
|
|
59
|
-
/* @__PURE__ */
|
|
60
|
-
|
|
61
|
-
/* @__PURE__ */ e("span", { className: "ml-1 text-[10.5px] text-slate-
|
|
90
|
+
/* @__PURE__ */ d("span", { className: "tabular-nums text-slate-800 dark:text-foreground", children: [
|
|
91
|
+
i,
|
|
92
|
+
/* @__PURE__ */ e("span", { className: "ml-1 text-[10.5px] text-slate-500 dark:text-muted-foreground", children: o(i / c) })
|
|
62
93
|
] })
|
|
63
94
|
] }, t)) })
|
|
64
95
|
] });
|
|
65
96
|
}
|
|
66
|
-
function
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
97
|
+
function R({ className: l }) {
|
|
98
|
+
var g;
|
|
99
|
+
const n = w(), [s, c] = f(30), [t, i] = f(24), { data: r, isLoading: N } = k({
|
|
100
|
+
queryKey: ["notification-analytics", s, t],
|
|
101
|
+
queryFn: () => n.request(
|
|
102
|
+
_("/notifications/analytics", { days: s, acted_hours: t })
|
|
103
|
+
).then((a) => a.data)
|
|
104
|
+
}), u = (r == null ? void 0 : r.series) ?? [], b = Math.max(1, ...u.map((a) => a.sent));
|
|
105
|
+
return /* @__PURE__ */ d("div", { className: p("flex flex-1 min-h-0 flex-col", l), "data-nvr-notification-analytics": !0, children: [
|
|
106
|
+
/* @__PURE__ */ e("header", { className: "shrink-0 border-b border-slate-200 bg-white px-6 py-4 dark:border-border dark:bg-card", children: /* @__PURE__ */ d("div", { className: "flex items-center gap-2.5", children: [
|
|
107
|
+
/* @__PURE__ */ e(v, { className: "h-5 w-5 text-muted-foreground" }),
|
|
108
|
+
/* @__PURE__ */ d("div", { children: [
|
|
75
109
|
/* @__PURE__ */ e("h1", { className: "text-[17px] font-semibold text-slate-900 dark:text-foreground", children: "Notification analytics" }),
|
|
76
110
|
/* @__PURE__ */ e("p", { className: "mt-0.5 text-[12.5px] text-slate-500 dark:text-muted-foreground", children: "Where the noise comes from and whether anyone reads it — by category, sender, collection and channel, plus what people have muted." })
|
|
77
111
|
] }),
|
|
78
112
|
/* @__PURE__ */ e("span", { className: "flex-1" }),
|
|
79
|
-
/* @__PURE__ */ e("div", { className: "inline-flex rounded-md border border-slate-200 p-0.5 dark:border-border", children: [7, 30, 90].map((a) => /* @__PURE__ */
|
|
113
|
+
/* @__PURE__ */ e("div", { className: "inline-flex rounded-md border border-slate-200 p-0.5 dark:border-border", children: [7, 30, 90].map((a) => /* @__PURE__ */ d(
|
|
80
114
|
"button",
|
|
81
115
|
{
|
|
82
116
|
type: "button",
|
|
83
|
-
onClick: () =>
|
|
117
|
+
onClick: () => c(a),
|
|
118
|
+
"aria-pressed": s === a,
|
|
84
119
|
className: p(
|
|
85
120
|
"rounded px-2.5 py-1 text-[12px] font-medium",
|
|
86
121
|
s === a ? "bg-slate-900 text-white dark:bg-nvr-cyan dark:text-[#172940]" : "text-slate-600 hover:bg-slate-100 dark:text-muted-foreground dark:hover:bg-muted"
|
|
@@ -91,34 +126,70 @@ function L({ className: l }) {
|
|
|
91
126
|
]
|
|
92
127
|
},
|
|
93
128
|
a
|
|
94
|
-
)) })
|
|
129
|
+
)) }),
|
|
130
|
+
/* @__PURE__ */ d(
|
|
131
|
+
"div",
|
|
132
|
+
{
|
|
133
|
+
className: "inline-flex items-center rounded-md border border-slate-200 p-0.5 dark:border-border",
|
|
134
|
+
"data-tip": "How long after a notification an action still counts as acted",
|
|
135
|
+
children: [
|
|
136
|
+
/* @__PURE__ */ e("span", { className: "px-2 text-[12px] text-slate-500 dark:text-muted-foreground", children: "Acted within" }),
|
|
137
|
+
[4, 24, 72].map((a) => /* @__PURE__ */ d(
|
|
138
|
+
"button",
|
|
139
|
+
{
|
|
140
|
+
type: "button",
|
|
141
|
+
onClick: () => i(a),
|
|
142
|
+
"aria-pressed": t === a,
|
|
143
|
+
"aria-label": `Acted within ${a} hours`,
|
|
144
|
+
className: p(
|
|
145
|
+
"rounded px-2.5 py-1 text-[12px] font-medium",
|
|
146
|
+
t === a ? "bg-slate-900 text-white dark:bg-nvr-cyan dark:text-[#172940]" : "text-slate-600 hover:bg-slate-100 dark:text-muted-foreground dark:hover:bg-muted"
|
|
147
|
+
),
|
|
148
|
+
children: [
|
|
149
|
+
a,
|
|
150
|
+
"h"
|
|
151
|
+
]
|
|
152
|
+
},
|
|
153
|
+
a
|
|
154
|
+
))
|
|
155
|
+
]
|
|
156
|
+
}
|
|
157
|
+
)
|
|
95
158
|
] }) }),
|
|
96
|
-
/* @__PURE__ */ e("div", { className: "flex-1 overflow-y-auto bg-slate-50 p-6 dark:bg-background", children:
|
|
97
|
-
/* @__PURE__ */
|
|
98
|
-
/* @__PURE__ */ e(
|
|
99
|
-
/* @__PURE__ */ e(
|
|
159
|
+
/* @__PURE__ */ e("div", { className: "flex-1 overflow-y-auto bg-slate-50 p-6 dark:bg-background", children: N || !r ? /* @__PURE__ */ e("p", { className: "text-[13px] text-slate-500 dark:text-muted-foreground", children: "Loading…" }) : /* @__PURE__ */ d("div", { className: "space-y-5", children: [
|
|
160
|
+
/* @__PURE__ */ d("div", { className: "grid grid-cols-2 gap-3 md:grid-cols-5", children: [
|
|
161
|
+
/* @__PURE__ */ e(m, { label: "Sent", value: String(r.total), hint: `last ${r.days} days` }),
|
|
162
|
+
/* @__PURE__ */ e(m, { label: "Read rate", value: o(r.read_rate), hint: `${r.read} read` }),
|
|
100
163
|
/* @__PURE__ */ e(
|
|
101
|
-
|
|
164
|
+
m,
|
|
102
165
|
{
|
|
103
166
|
label: "Median time to read",
|
|
104
|
-
value:
|
|
167
|
+
value: y(r.median_minutes_to_read),
|
|
105
168
|
hint: "rows read since read tracking began"
|
|
106
169
|
}
|
|
107
170
|
),
|
|
108
171
|
/* @__PURE__ */ e(
|
|
109
|
-
|
|
172
|
+
m,
|
|
173
|
+
{
|
|
174
|
+
label: `Acted within ${t}h`,
|
|
175
|
+
value: ((g = r.acted) == null ? void 0 : g.acted_rate) == null ? "—" : o(r.acted.acted_rate),
|
|
176
|
+
hint: r.acted ? `${r.acted.acted} of ${r.acted.acted_eligible} record notifications` : void 0
|
|
177
|
+
}
|
|
178
|
+
),
|
|
179
|
+
/* @__PURE__ */ e(
|
|
180
|
+
m,
|
|
110
181
|
{
|
|
111
182
|
label: "Muted records",
|
|
112
|
-
value: String(
|
|
113
|
-
hint: `${
|
|
183
|
+
value: String(r.mutes.total),
|
|
184
|
+
hint: `${r.mutes.muting_users} of ${r.mutes.active_users} active users mute something`
|
|
114
185
|
}
|
|
115
186
|
)
|
|
116
187
|
] }),
|
|
117
|
-
|
|
118
|
-
/* @__PURE__ */
|
|
119
|
-
/* @__PURE__ */ e("p", { className: "text-[
|
|
120
|
-
/* @__PURE__ */
|
|
121
|
-
|
|
188
|
+
r.truncated && /* @__PURE__ */ e("p", { className: "text-[11.5px] text-amber-700 dark:text-amber-400", children: "Window capped at 20,000 rows — figures cover the newest 20,000." }),
|
|
189
|
+
/* @__PURE__ */ d("div", { className: "rounded-lg border border-slate-200 bg-white px-4 py-3 dark:border-border dark:bg-card", children: [
|
|
190
|
+
/* @__PURE__ */ e("p", { className: "text-[12px] font-medium text-slate-500 dark:text-muted-foreground", children: "Per day · sent (bar) and read (filled)" }),
|
|
191
|
+
/* @__PURE__ */ d("div", { className: "mt-2 flex h-24 items-end gap-px", children: [
|
|
192
|
+
u.map((a) => /* @__PURE__ */ d(
|
|
122
193
|
"div",
|
|
123
194
|
{
|
|
124
195
|
className: "relative flex-1",
|
|
@@ -143,28 +214,28 @@ function L({ className: l }) {
|
|
|
143
214
|
},
|
|
144
215
|
a.day
|
|
145
216
|
)),
|
|
146
|
-
|
|
217
|
+
u.length === 0 && /* @__PURE__ */ e("p", { className: "text-[12px] text-slate-500 dark:text-muted-foreground", children: "No notifications in this window." })
|
|
147
218
|
] })
|
|
148
219
|
] }),
|
|
149
|
-
/* @__PURE__ */
|
|
150
|
-
/* @__PURE__ */ e(
|
|
151
|
-
/* @__PURE__ */ e(
|
|
152
|
-
/* @__PURE__ */ e(
|
|
153
|
-
/* @__PURE__ */ e(
|
|
154
|
-
/* @__PURE__ */ e(
|
|
155
|
-
/* @__PURE__ */
|
|
156
|
-
/* @__PURE__ */
|
|
220
|
+
/* @__PURE__ */ d("div", { className: "grid grid-cols-1 gap-4 lg:grid-cols-2", children: [
|
|
221
|
+
/* @__PURE__ */ e(x, { title: "By category", rows: r.by_category, keyLabel: "Category" }),
|
|
222
|
+
/* @__PURE__ */ e(x, { title: "By sender", rows: r.by_sender, keyLabel: "Sender" }),
|
|
223
|
+
/* @__PURE__ */ e(x, { title: "By lane", rows: r.by_lane, keyLabel: "Lane" }),
|
|
224
|
+
/* @__PURE__ */ e(x, { title: "By kind", rows: r.by_kind, keyLabel: "Kind" }),
|
|
225
|
+
/* @__PURE__ */ e(x, { title: "By collection", rows: r.by_collection, keyLabel: "Collection" }),
|
|
226
|
+
/* @__PURE__ */ d("div", { className: "rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card", children: [
|
|
227
|
+
/* @__PURE__ */ d("header", { className: "border-b border-slate-100 px-4 py-2.5 dark:border-border/60", children: [
|
|
157
228
|
/* @__PURE__ */ e("h3", { className: "text-[13px] font-semibold text-slate-800 dark:text-slate-100", children: "Most muted sources" }),
|
|
158
|
-
/* @__PURE__ */ e("p", { className: "text-[11px] text-slate-
|
|
229
|
+
/* @__PURE__ */ e("p", { className: "text-[11px] text-slate-500 dark:text-muted-foreground", children: "Records people asked to stop hearing about, against what that collection sent." })
|
|
159
230
|
] }),
|
|
160
|
-
|
|
161
|
-
/* @__PURE__ */ e("thead", { children: /* @__PURE__ */
|
|
231
|
+
r.mutes.top.length === 0 ? /* @__PURE__ */ e("p", { className: "px-4 py-4 text-[12px] text-slate-500 dark:text-muted-foreground", children: "Nobody has muted a record." }) : /* @__PURE__ */ d("table", { className: "w-full text-[12px] tabular-nums", children: [
|
|
232
|
+
/* @__PURE__ */ e("thead", { children: /* @__PURE__ */ d("tr", { className: "text-left text-[11px] text-slate-500 dark:text-muted-foreground", children: [
|
|
162
233
|
/* @__PURE__ */ e("th", { className: "px-4 py-1.5 font-semibold", children: "Collection" }),
|
|
163
234
|
/* @__PURE__ */ e("th", { className: "px-2 py-1.5 text-right font-semibold", children: "Mutes" }),
|
|
164
235
|
/* @__PURE__ */ e("th", { className: "px-2 py-1.5 text-right font-semibold", children: "Sent" }),
|
|
165
236
|
/* @__PURE__ */ e("th", { className: "px-2 py-1.5 text-right font-semibold", children: "Mute rate" })
|
|
166
237
|
] }) }),
|
|
167
|
-
/* @__PURE__ */ e("tbody", { children:
|
|
238
|
+
/* @__PURE__ */ e("tbody", { children: r.mutes.top.map((a) => /* @__PURE__ */ d(
|
|
168
239
|
"tr",
|
|
169
240
|
{
|
|
170
241
|
className: "border-t border-slate-100 dark:border-border",
|
|
@@ -172,7 +243,7 @@ function L({ className: l }) {
|
|
|
172
243
|
/* @__PURE__ */ e("td", { className: "px-4 py-1.5 text-slate-700 dark:text-foreground", children: a.collection.replace(/_/g, " ") }),
|
|
173
244
|
/* @__PURE__ */ e("td", { className: "px-2 py-1.5 text-right", children: a.mutes }),
|
|
174
245
|
/* @__PURE__ */ e("td", { className: "px-2 py-1.5 text-right text-slate-500", children: a.sent }),
|
|
175
|
-
/* @__PURE__ */ e("td", { className: "px-2 py-1.5 text-right text-amber-700 dark:text-amber-400", children: a.sent ?
|
|
246
|
+
/* @__PURE__ */ e("td", { className: "px-2 py-1.5 text-right text-amber-700 dark:text-amber-400", children: a.sent ? o(a.mute_rate) : "—" })
|
|
176
247
|
]
|
|
177
248
|
},
|
|
178
249
|
a.collection
|
|
@@ -180,15 +251,15 @@ function L({ className: l }) {
|
|
|
180
251
|
] })
|
|
181
252
|
] })
|
|
182
253
|
] }),
|
|
183
|
-
/* @__PURE__ */
|
|
184
|
-
/* @__PURE__ */ e(
|
|
185
|
-
/* @__PURE__ */ e(
|
|
186
|
-
/* @__PURE__ */ e(
|
|
187
|
-
/* @__PURE__ */ e(
|
|
254
|
+
/* @__PURE__ */ d("div", { className: "grid grid-cols-2 gap-3 md:grid-cols-4", children: [
|
|
255
|
+
/* @__PURE__ */ e(h, { title: "In-app", counts: r.channels.inapp }),
|
|
256
|
+
/* @__PURE__ */ e(h, { title: "Push", counts: r.channels.push }),
|
|
257
|
+
/* @__PURE__ */ e(h, { title: "Email", counts: r.channels.email }),
|
|
258
|
+
/* @__PURE__ */ e(h, { title: "SMS", counts: r.channels.sms })
|
|
188
259
|
] })
|
|
189
260
|
] }) })
|
|
190
261
|
] });
|
|
191
262
|
}
|
|
192
263
|
export {
|
|
193
|
-
|
|
264
|
+
R as NotificationAnalyticsView
|
|
194
265
|
};
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { jsxs as s, jsx as r } from "react/jsx-runtime";
|
|
2
|
-
import { useQueryClient as
|
|
3
|
-
import { CheckCircle2 as
|
|
4
|
-
import { useState as
|
|
2
|
+
import { useQueryClient as N, useQuery as w, useMutation as v } from "@tanstack/react-query";
|
|
3
|
+
import { CheckCircle2 as S, Clock3 as C, AlertTriangle as q, Loader2 as _, RefreshCw as R, Code2 as D, ChevronDown as $ } from "lucide-react";
|
|
4
|
+
import { useState as Q } from "react";
|
|
5
5
|
import { toast as u } from "sonner";
|
|
6
|
-
import { useNivaroClient as
|
|
7
|
-
import { get as
|
|
6
|
+
import { useNivaroClient as T } from "../../context.js";
|
|
7
|
+
import { get as E, post as K } from "../../lib/commands.js";
|
|
8
|
+
import { useLiveRefetchInterval as L } from "../../lib/live-queries.js";
|
|
8
9
|
import { cn as l } from "../../lib/utils.js";
|
|
9
10
|
function f(e) {
|
|
10
11
|
if (e == null) return null;
|
|
@@ -60,27 +61,27 @@ function k({
|
|
|
60
61
|
d === "red" ? "text-red-600 hover:text-red-800 dark:text-red-400 dark:hover:text-red-300" : "text-slate-500 hover:text-slate-700 dark:text-slate-400 dark:hover:text-slate-200"
|
|
61
62
|
),
|
|
62
63
|
children: [
|
|
63
|
-
/* @__PURE__ */ r(
|
|
64
|
+
/* @__PURE__ */ r(D, { className: "h-3 w-3" }),
|
|
64
65
|
"Request & response",
|
|
65
|
-
/* @__PURE__ */ r(
|
|
66
|
+
/* @__PURE__ */ r($, { className: l("h-3 w-3 transition-transform", e && "rotate-180") })
|
|
66
67
|
]
|
|
67
68
|
}
|
|
68
69
|
);
|
|
69
70
|
}
|
|
70
|
-
function
|
|
71
|
+
function U({
|
|
71
72
|
collection: e,
|
|
72
73
|
itemId: n
|
|
73
74
|
}) {
|
|
74
|
-
const d =
|
|
75
|
+
const d = T(), o = N(), [i, c] = Q(!1), y = L(6e4), { data: h } = w({
|
|
75
76
|
queryKey: ["erp-submissions", e, String(n)],
|
|
76
77
|
queryFn: () => d.request(
|
|
77
|
-
|
|
78
|
+
E(`/erp-submissions/${e}/${encodeURIComponent(n)}`)
|
|
78
79
|
).then((a) => a.data ?? []),
|
|
79
80
|
enabled: !!e && !!n,
|
|
80
81
|
staleTime: 15e3,
|
|
81
|
-
refetchInterval:
|
|
82
|
-
}), m =
|
|
83
|
-
mutationFn: (a) => d.request(
|
|
82
|
+
refetchInterval: y
|
|
83
|
+
}), m = v({
|
|
84
|
+
mutationFn: (a) => d.request(K(`/erp-submissions/${a}/retry`)),
|
|
84
85
|
onSuccess: (a) => {
|
|
85
86
|
var b;
|
|
86
87
|
const p = (b = a == null ? void 0 : a.data) == null ? void 0 : b.status;
|
|
@@ -103,7 +104,7 @@ function A({
|
|
|
103
104
|
"data-erp-status-banner": t.status,
|
|
104
105
|
children: [
|
|
105
106
|
/* @__PURE__ */ s("div", { className: "flex items-center gap-2.5", children: [
|
|
106
|
-
a ? /* @__PURE__ */ r(
|
|
107
|
+
a ? /* @__PURE__ */ r(S, { className: "h-4 w-4 shrink-0 text-emerald-500", strokeWidth: 2 }) : /* @__PURE__ */ r(C, { className: "h-4 w-4 shrink-0 text-sky-500", strokeWidth: 2 }),
|
|
107
108
|
/* @__PURE__ */ s("span", { className: "min-w-0 flex-1 truncate", children: [
|
|
108
109
|
/* @__PURE__ */ r("span", { className: "font-semibold", children: a ? "External submission accepted" : "Submitted to external system — awaiting acknowledgement" }),
|
|
109
110
|
t.endpoint_path ? ` · ${t.endpoint_path}` : ""
|
|
@@ -124,7 +125,7 @@ function A({
|
|
|
124
125
|
className: "flex items-start gap-2.5 rounded-lg border border-red-200 bg-red-50 px-3.5 py-2.5 dark:border-red-900/40 dark:bg-red-900/15",
|
|
125
126
|
"data-erp-failure-banner": !0,
|
|
126
127
|
children: [
|
|
127
|
-
/* @__PURE__ */ r(
|
|
128
|
+
/* @__PURE__ */ r(q, { className: "mt-0.5 h-4 w-4 shrink-0 text-red-500", strokeWidth: 2 }),
|
|
128
129
|
/* @__PURE__ */ s("div", { className: "min-w-0 flex-1", children: [
|
|
129
130
|
/* @__PURE__ */ s("p", { className: "text-[12.5px] font-semibold text-red-700 dark:text-red-300", children: [
|
|
130
131
|
"External submission failed",
|
|
@@ -162,7 +163,7 @@ function A({
|
|
|
162
163
|
"dark:border-red-800 dark:bg-transparent dark:text-red-300 dark:hover:bg-red-900/30"
|
|
163
164
|
),
|
|
164
165
|
children: [
|
|
165
|
-
m.isPending ? /* @__PURE__ */ r(
|
|
166
|
+
m.isPending ? /* @__PURE__ */ r(_, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ r(R, { className: "h-3.5 w-3.5" }),
|
|
166
167
|
"Retry"
|
|
167
168
|
]
|
|
168
169
|
}
|
|
@@ -172,5 +173,5 @@ function A({
|
|
|
172
173
|
);
|
|
173
174
|
}
|
|
174
175
|
export {
|
|
175
|
-
|
|
176
|
+
U as ErpFailureBanner
|
|
176
177
|
};
|