@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
|
@@ -0,0 +1,326 @@
|
|
|
1
|
+
import { jsxs as n, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { useQueryClient as C, useQuery as f, useMutation as v } from "@tanstack/react-query";
|
|
3
|
+
import { History as W, Archive as H } from "lucide-react";
|
|
4
|
+
import { useState as k } from "react";
|
|
5
|
+
import { toast as u } from "sonner";
|
|
6
|
+
import { useNivaroClient as g } from "../../context.js";
|
|
7
|
+
import { get as N, put as M, post as q } from "../../lib/commands.js";
|
|
8
|
+
import { cn as w, formatRelative as $ } from "../../lib/utils.js";
|
|
9
|
+
import { Skeleton as p } from "../ui/skeleton.js";
|
|
10
|
+
function b(s, i) {
|
|
11
|
+
var t;
|
|
12
|
+
return ((t = s == null ? void 0 : s.response) == null ? void 0 : t.error) ?? i;
|
|
13
|
+
}
|
|
14
|
+
function Y({
|
|
15
|
+
channelId: s,
|
|
16
|
+
channelName: i,
|
|
17
|
+
suggestedAt: t
|
|
18
|
+
}) {
|
|
19
|
+
const d = g(), o = C(), r = v({
|
|
20
|
+
mutationFn: (c) => d.request(q(`/chat/channels/${s}/archive-suggestion`, { action: c })),
|
|
21
|
+
onSuccess: (c, l) => {
|
|
22
|
+
u.success(l === "archive" ? "Channel archived" : "Channel kept open"), o.invalidateQueries({ queryKey: ["nvr-chat-rooms"] }), o.invalidateQueries({ queryKey: ["nvr-chat-directory"] });
|
|
23
|
+
},
|
|
24
|
+
onError: (c) => u.error(b(c, "Could not save your answer"))
|
|
25
|
+
});
|
|
26
|
+
return /* @__PURE__ */ n(
|
|
27
|
+
"div",
|
|
28
|
+
{
|
|
29
|
+
className: "flex flex-wrap items-center gap-x-3 gap-y-1.5 border-b border-slate-200 bg-slate-50 px-3 py-2 dark:border-border dark:bg-muted/40",
|
|
30
|
+
"data-chat-archive-suggestion": !0,
|
|
31
|
+
children: [
|
|
32
|
+
/* @__PURE__ */ e(H, { className: "h-3.5 w-3.5 shrink-0 text-slate-500", strokeWidth: 2 }),
|
|
33
|
+
/* @__PURE__ */ n("p", { className: "min-w-0 flex-1 text-[12px] text-slate-700 dark:text-slate-200", children: [
|
|
34
|
+
"#",
|
|
35
|
+
i,
|
|
36
|
+
" has been quiet. Archive it to tidy the list, or keep it open. Suggested",
|
|
37
|
+
" ",
|
|
38
|
+
$(t),
|
|
39
|
+
"."
|
|
40
|
+
] }),
|
|
41
|
+
/* @__PURE__ */ n("span", { className: "flex shrink-0 gap-1.5", children: [
|
|
42
|
+
/* @__PURE__ */ e(
|
|
43
|
+
"button",
|
|
44
|
+
{
|
|
45
|
+
type: "button",
|
|
46
|
+
disabled: r.isPending,
|
|
47
|
+
onClick: () => r.mutate("archive"),
|
|
48
|
+
className: "h-7 rounded-md bg-nvr-cyan px-2.5 text-[12px] font-medium text-white disabled:opacity-50",
|
|
49
|
+
"data-chat-archive-accept": !0,
|
|
50
|
+
children: "Archive"
|
|
51
|
+
}
|
|
52
|
+
),
|
|
53
|
+
/* @__PURE__ */ e(
|
|
54
|
+
"button",
|
|
55
|
+
{
|
|
56
|
+
type: "button",
|
|
57
|
+
disabled: r.isPending,
|
|
58
|
+
onClick: () => r.mutate("keep"),
|
|
59
|
+
className: "h-7 rounded-md border border-slate-200 bg-white px-2.5 text-[12px] font-medium text-slate-700 hover:bg-slate-50 disabled:opacity-50 dark:border-border dark:bg-card dark:text-slate-200 dark:hover:bg-muted",
|
|
60
|
+
"data-chat-archive-keep": !0,
|
|
61
|
+
children: "Keep open"
|
|
62
|
+
}
|
|
63
|
+
)
|
|
64
|
+
] })
|
|
65
|
+
]
|
|
66
|
+
}
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
function B(s) {
|
|
70
|
+
const i = s.user_name ?? "Someone", t = s.by_name ?? "someone";
|
|
71
|
+
switch (s.kind) {
|
|
72
|
+
case "joined":
|
|
73
|
+
return `${i} joined`;
|
|
74
|
+
case "left":
|
|
75
|
+
return `${i} left`;
|
|
76
|
+
case "added":
|
|
77
|
+
return `${t} added ${i}${s.note ? ` (${s.note})` : ""}`;
|
|
78
|
+
case "removed":
|
|
79
|
+
return `${t} removed ${i}`;
|
|
80
|
+
case "auto_joined":
|
|
81
|
+
return `${i} joined by default role`;
|
|
82
|
+
case "bulk_added":
|
|
83
|
+
return `${t} added ${s.count ?? 0} people (${s.note ?? "a group"})`;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
function T({ events: s, showChannel: i }) {
|
|
87
|
+
return /* @__PURE__ */ e("ul", { className: "divide-y divide-slate-100 dark:divide-border", children: s.map((t) => /* @__PURE__ */ n(
|
|
88
|
+
"li",
|
|
89
|
+
{
|
|
90
|
+
className: "flex items-baseline gap-2 px-2 py-1.5 text-[12px]",
|
|
91
|
+
"data-chat-membership-event": t.kind,
|
|
92
|
+
children: [
|
|
93
|
+
/* @__PURE__ */ n("span", { className: "min-w-0 flex-1 text-slate-700 dark:text-slate-200", children: [
|
|
94
|
+
i && /* @__PURE__ */ n("span", { className: "mr-1.5 font-medium text-slate-900 dark:text-slate-50", children: [
|
|
95
|
+
"#",
|
|
96
|
+
t.channel_name ?? t.channel
|
|
97
|
+
] }),
|
|
98
|
+
B(t)
|
|
99
|
+
] }),
|
|
100
|
+
/* @__PURE__ */ e(
|
|
101
|
+
"span",
|
|
102
|
+
{
|
|
103
|
+
className: "shrink-0 text-[11px] text-slate-500 dark:text-slate-400",
|
|
104
|
+
"data-tip": new Date(t.at).toLocaleString(),
|
|
105
|
+
children: $(t.at)
|
|
106
|
+
}
|
|
107
|
+
)
|
|
108
|
+
]
|
|
109
|
+
},
|
|
110
|
+
t.id
|
|
111
|
+
)) });
|
|
112
|
+
}
|
|
113
|
+
function Z({ channelId: s, border: i }) {
|
|
114
|
+
const t = g(), [d, o] = k(!1), { data: r, isLoading: c, isError: l } = f({
|
|
115
|
+
queryKey: ["nvr-chat-membership-history", s],
|
|
116
|
+
queryFn: () => t.request(N(`/chat/channels/${s}/membership-history`)).then((h) => h.data ?? []),
|
|
117
|
+
enabled: d,
|
|
118
|
+
staleTime: 3e4
|
|
119
|
+
});
|
|
120
|
+
return /* @__PURE__ */ n("div", { "data-chat-membership-history": !0, children: [
|
|
121
|
+
/* @__PURE__ */ n(
|
|
122
|
+
"button",
|
|
123
|
+
{
|
|
124
|
+
type: "button",
|
|
125
|
+
onClick: () => o((h) => !h),
|
|
126
|
+
"aria-expanded": d,
|
|
127
|
+
className: "inline-flex items-center gap-1 text-[11.5px] font-medium text-slate-600 hover:text-slate-900 dark:text-slate-300 dark:hover:text-white",
|
|
128
|
+
children: [
|
|
129
|
+
/* @__PURE__ */ e(W, { className: "h-3.5 w-3.5" }),
|
|
130
|
+
" ",
|
|
131
|
+
d ? "Hide who joined and left" : "Who joined and left"
|
|
132
|
+
]
|
|
133
|
+
}
|
|
134
|
+
),
|
|
135
|
+
d && /* @__PURE__ */ e("div", { className: w("mt-1.5 max-h-60 overflow-y-auto rounded-lg border", i), children: c ? /* @__PURE__ */ n("div", { className: "space-y-1.5 p-2", children: [
|
|
136
|
+
/* @__PURE__ */ e(p, { className: "h-4 w-3/4" }),
|
|
137
|
+
/* @__PURE__ */ e(p, { className: "h-4 w-2/3" })
|
|
138
|
+
] }) : l ? /* @__PURE__ */ e("p", { className: "p-2 text-[11.5px] text-slate-500 dark:text-slate-400", children: "Could not load the history." }) : !r || r.length === 0 ? /* @__PURE__ */ e("p", { className: "p-2 text-[11.5px] text-slate-500 dark:text-slate-400", children: "No joins or leaves recorded yet." }) : /* @__PURE__ */ e(T, { events: r }) })
|
|
139
|
+
] });
|
|
140
|
+
}
|
|
141
|
+
function A({
|
|
142
|
+
title: s,
|
|
143
|
+
note: i,
|
|
144
|
+
children: t
|
|
145
|
+
}) {
|
|
146
|
+
return /* @__PURE__ */ n("section", { className: "rounded-lg border border-slate-200 bg-white p-4 dark:border-border dark:bg-card", children: [
|
|
147
|
+
/* @__PURE__ */ n("div", { className: "mb-3 flex items-baseline justify-between gap-3", children: [
|
|
148
|
+
/* @__PURE__ */ e("h3", { className: "text-[13px] font-semibold text-slate-800 dark:text-slate-100", children: s }),
|
|
149
|
+
i && /* @__PURE__ */ e("p", { className: "text-[11px] text-slate-500 dark:text-slate-400", children: i })
|
|
150
|
+
] }),
|
|
151
|
+
t
|
|
152
|
+
] });
|
|
153
|
+
}
|
|
154
|
+
function F({ rows: s, empty: i }) {
|
|
155
|
+
const t = g(), d = C(), o = v({
|
|
156
|
+
mutationFn: (r) => t.request(q(`/chat/channels/${r}/archive-suggestion`, { action: "keep" })),
|
|
157
|
+
onSuccess: () => void d.invalidateQueries({ queryKey: ["nvr-chat-archive-overview"] }),
|
|
158
|
+
onError: (r) => u.error(b(r, "Could not keep that channel open"))
|
|
159
|
+
});
|
|
160
|
+
return s.length === 0 ? /* @__PURE__ */ e("p", { className: "py-2 text-[12px] text-slate-500 dark:text-slate-400", children: i }) : /* @__PURE__ */ e("ul", { className: "divide-y divide-slate-100 dark:divide-border", children: s.map((r) => /* @__PURE__ */ n("li", { className: "flex items-baseline gap-3 py-1.5 text-[12px]", children: [
|
|
161
|
+
/* @__PURE__ */ n("span", { className: "min-w-0 flex-1 truncate font-medium text-slate-800 dark:text-slate-100", children: [
|
|
162
|
+
"#",
|
|
163
|
+
r.name
|
|
164
|
+
] }),
|
|
165
|
+
/* @__PURE__ */ e("span", { className: "hidden shrink-0 text-slate-500 sm:inline dark:text-slate-400", children: r.owner_name ?? "No owner" }),
|
|
166
|
+
/* @__PURE__ */ e("span", { className: "shrink-0 tabular-nums text-slate-500 dark:text-slate-400", children: r.last_post_at ? `last post ${$(r.last_post_at)}` : "no posts" }),
|
|
167
|
+
r.suggested_at && /* @__PURE__ */ e(
|
|
168
|
+
"button",
|
|
169
|
+
{
|
|
170
|
+
type: "button",
|
|
171
|
+
disabled: o.isPending,
|
|
172
|
+
onClick: () => o.mutate(r.id),
|
|
173
|
+
className: "shrink-0 rounded text-[11.5px] font-medium text-slate-600 hover:text-slate-900 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan disabled:opacity-50 dark:text-slate-300 dark:hover:text-white",
|
|
174
|
+
children: o.isPending && o.variables === r.id ? "Keeping…" : "Keep open"
|
|
175
|
+
}
|
|
176
|
+
)
|
|
177
|
+
] }, r.id)) });
|
|
178
|
+
}
|
|
179
|
+
function ee() {
|
|
180
|
+
var j, K, E, P, Q;
|
|
181
|
+
const s = g(), i = C(), t = f({
|
|
182
|
+
queryKey: ["nvr-chat-archive-overview"],
|
|
183
|
+
queryFn: () => s.request(N("/chat/admin/archive-overview")).then((a) => a.data),
|
|
184
|
+
staleTime: 3e4
|
|
185
|
+
}), [d, o] = k(null), r = (j = t.data) == null ? void 0 : j.idle_days, c = d ?? (r === void 0 ? "" : String(r)), l = d === null || d.trim() === "" ? null : Number(d), h = l !== null && (!Number.isInteger(l) || l < 0 || l > 3650), S = (a) => {
|
|
186
|
+
a ? i.setQueryData(["nvr-chat-archive-overview"], a) : i.invalidateQueries({ queryKey: ["nvr-chat-archive-overview"] });
|
|
187
|
+
}, _ = v({
|
|
188
|
+
mutationFn: (a) => s.request(M("/chat/admin/archive-settings", { idle_days: a })).then((D) => D.data),
|
|
189
|
+
onSuccess: (a) => {
|
|
190
|
+
S(a), o(null), u.success("Saved");
|
|
191
|
+
},
|
|
192
|
+
onError: (a) => u.error(b(a, "Could not save"))
|
|
193
|
+
}), y = v({
|
|
194
|
+
mutationFn: () => s.request(
|
|
195
|
+
q("/chat/admin/archive-suggest-now")
|
|
196
|
+
).then((a) => a.data),
|
|
197
|
+
onSuccess: (a) => {
|
|
198
|
+
S(a.overview), u.success(
|
|
199
|
+
a.suggested === 0 ? "No quiet channels found" : `${a.suggested} ${a.suggested === 1 ? "suggestion" : "suggestions"} sent`
|
|
200
|
+
);
|
|
201
|
+
},
|
|
202
|
+
onError: (a) => u.error(b(a, "Could not run the check"))
|
|
203
|
+
}), [m, L] = k(30), x = f({
|
|
204
|
+
queryKey: ["nvr-chat-membership-history-all", m],
|
|
205
|
+
queryFn: () => s.request(
|
|
206
|
+
N("/chat/admin/membership-history", { days: m })
|
|
207
|
+
).then((a) => a.data ?? []),
|
|
208
|
+
staleTime: 3e4
|
|
209
|
+
});
|
|
210
|
+
return /* @__PURE__ */ n("div", { className: "space-y-4", "data-chat-channels-admin": !0, children: [
|
|
211
|
+
/* @__PURE__ */ n(
|
|
212
|
+
A,
|
|
213
|
+
{
|
|
214
|
+
title: "Quiet channels",
|
|
215
|
+
note: r === 0 ? "Suggestions are off" : `Owners are asked after ${r ?? 90} days with no posts`,
|
|
216
|
+
children: [
|
|
217
|
+
/* @__PURE__ */ n("div", { className: "mb-3 flex flex-wrap items-center gap-2", children: [
|
|
218
|
+
/* @__PURE__ */ n("label", { className: "flex items-center gap-1.5 text-[12px] text-slate-700 dark:text-slate-200", children: [
|
|
219
|
+
"Suggest archiving after",
|
|
220
|
+
/* @__PURE__ */ e(
|
|
221
|
+
"input",
|
|
222
|
+
{
|
|
223
|
+
type: "number",
|
|
224
|
+
min: 0,
|
|
225
|
+
max: 3650,
|
|
226
|
+
value: c,
|
|
227
|
+
onChange: (a) => o(a.target.value),
|
|
228
|
+
"aria-invalid": h || void 0,
|
|
229
|
+
className: w(
|
|
230
|
+
"h-7 w-16 rounded-md border bg-white px-2 text-[12px] tabular-nums outline-none focus:border-nvr-cyan dark:bg-card",
|
|
231
|
+
h ? "border-red-400 dark:border-red-500/60" : "border-slate-200 dark:border-border"
|
|
232
|
+
),
|
|
233
|
+
"aria-label": "Idle days before an archive suggestion"
|
|
234
|
+
}
|
|
235
|
+
),
|
|
236
|
+
"days (0 turns it off)"
|
|
237
|
+
] }),
|
|
238
|
+
/* @__PURE__ */ e(
|
|
239
|
+
"button",
|
|
240
|
+
{
|
|
241
|
+
type: "button",
|
|
242
|
+
disabled: d === null || h || _.isPending,
|
|
243
|
+
onClick: () => _.mutate(l),
|
|
244
|
+
className: "h-7 rounded-md bg-nvr-cyan px-2.5 text-[12px] font-medium text-white disabled:opacity-40",
|
|
245
|
+
children: "Save"
|
|
246
|
+
}
|
|
247
|
+
),
|
|
248
|
+
/* @__PURE__ */ e(
|
|
249
|
+
"button",
|
|
250
|
+
{
|
|
251
|
+
type: "button",
|
|
252
|
+
disabled: y.isPending,
|
|
253
|
+
onClick: () => y.mutate(),
|
|
254
|
+
className: "h-7 rounded-md border border-slate-200 px-2.5 text-[12px] font-medium text-slate-700 hover:bg-slate-50 disabled:opacity-50 dark:border-border dark:text-slate-200 dark:hover:bg-muted",
|
|
255
|
+
children: y.isPending ? "Checking…" : "Check now"
|
|
256
|
+
}
|
|
257
|
+
)
|
|
258
|
+
] }),
|
|
259
|
+
t.isLoading ? /* @__PURE__ */ n("div", { className: "space-y-1.5", children: [
|
|
260
|
+
/* @__PURE__ */ e(p, { className: "h-4 w-2/3" }),
|
|
261
|
+
/* @__PURE__ */ e(p, { className: "h-4 w-1/2" })
|
|
262
|
+
] }) : t.isError ? /* @__PURE__ */ e("p", { className: "text-[12px] text-slate-500 dark:text-slate-400", children: "Could not load the channel lists." }) : /* @__PURE__ */ n("div", { className: "space-y-4", children: [
|
|
263
|
+
/* @__PURE__ */ n("div", { children: [
|
|
264
|
+
/* @__PURE__ */ n("p", { className: "mb-1 text-[12px] font-medium text-slate-600 dark:text-slate-300", children: [
|
|
265
|
+
"Waiting on the owner (",
|
|
266
|
+
((K = t.data) == null ? void 0 : K.suggested.length) ?? 0,
|
|
267
|
+
")"
|
|
268
|
+
] }),
|
|
269
|
+
/* @__PURE__ */ e(
|
|
270
|
+
F,
|
|
271
|
+
{
|
|
272
|
+
rows: ((E = t.data) == null ? void 0 : E.suggested) ?? [],
|
|
273
|
+
empty: "No archive suggestions are waiting."
|
|
274
|
+
}
|
|
275
|
+
)
|
|
276
|
+
] }),
|
|
277
|
+
/* @__PURE__ */ n("div", { children: [
|
|
278
|
+
/* @__PURE__ */ n("p", { className: "mb-1 text-[12px] font-medium text-slate-600 dark:text-slate-300", children: [
|
|
279
|
+
"Archived (",
|
|
280
|
+
((P = t.data) == null ? void 0 : P.archived.length) ?? 0,
|
|
281
|
+
")"
|
|
282
|
+
] }),
|
|
283
|
+
/* @__PURE__ */ e(
|
|
284
|
+
F,
|
|
285
|
+
{
|
|
286
|
+
rows: ((Q = t.data) == null ? void 0 : Q.archived) ?? [],
|
|
287
|
+
empty: "No channels are archived. Archived channels stay searchable and can be reopened in their settings."
|
|
288
|
+
}
|
|
289
|
+
)
|
|
290
|
+
] })
|
|
291
|
+
] })
|
|
292
|
+
]
|
|
293
|
+
}
|
|
294
|
+
),
|
|
295
|
+
/* @__PURE__ */ n(A, { title: "Membership changes", note: "Who joined, left, was added or removed", children: [
|
|
296
|
+
/* @__PURE__ */ e("div", { className: "mb-2 flex gap-1", children: [7, 30, 90].map((a) => /* @__PURE__ */ n(
|
|
297
|
+
"button",
|
|
298
|
+
{
|
|
299
|
+
type: "button",
|
|
300
|
+
onClick: () => L(a),
|
|
301
|
+
"aria-pressed": m === a,
|
|
302
|
+
className: w(
|
|
303
|
+
"h-6 rounded-md px-2 text-[11.5px] font-medium",
|
|
304
|
+
m === a ? "bg-slate-100 text-slate-900 dark:bg-muted dark:text-slate-50" : "text-slate-500 hover:text-slate-800 dark:text-slate-400 dark:hover:text-slate-100"
|
|
305
|
+
),
|
|
306
|
+
children: [
|
|
307
|
+
a,
|
|
308
|
+
" days"
|
|
309
|
+
]
|
|
310
|
+
},
|
|
311
|
+
a
|
|
312
|
+
)) }),
|
|
313
|
+
x.isLoading ? /* @__PURE__ */ e(p, { className: "h-16 w-full" }) : x.isError ? /* @__PURE__ */ e("p", { className: "text-[12px] text-slate-500 dark:text-slate-400", children: "Could not load membership changes." }) : (x.data ?? []).length === 0 ? /* @__PURE__ */ n("p", { className: "py-2 text-[12px] text-slate-500 dark:text-slate-400", children: [
|
|
314
|
+
"No joins or leaves in the last ",
|
|
315
|
+
m,
|
|
316
|
+
" days."
|
|
317
|
+
] }) : /* @__PURE__ */ e("div", { className: "max-h-[420px] overflow-y-auto", children: /* @__PURE__ */ e(T, { events: x.data ?? [], showChannel: !0 }) })
|
|
318
|
+
] })
|
|
319
|
+
] });
|
|
320
|
+
}
|
|
321
|
+
export {
|
|
322
|
+
Y as ArchiveSuggestionBanner,
|
|
323
|
+
ee as ChannelsAdminTab,
|
|
324
|
+
Z as MembershipHistory,
|
|
325
|
+
B as eventText
|
|
326
|
+
};
|