@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,38 +1,38 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useQueryClient as
|
|
3
|
-
import { AlertTriangle as ce, AlertCircle as
|
|
4
|
-
import { useState as m, useCallback as I, useRef as
|
|
5
|
-
import { useNivaroClient as
|
|
1
|
+
import { jsxs as i, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { useQueryClient as Ne, useQuery as le, useQueries as Ce } from "@tanstack/react-query";
|
|
3
|
+
import { AlertTriangle as ce, AlertCircle as fe } from "lucide-react";
|
|
4
|
+
import { useState as m, useCallback as I, useRef as v, useEffect as H } from "react";
|
|
5
|
+
import { useNivaroClient as $e } from "../../../context.js";
|
|
6
6
|
import { get as z } from "../../../lib/commands.js";
|
|
7
7
|
import { Input as de } from "../../ui/input.js";
|
|
8
8
|
import { Label as E } from "../../ui/label.js";
|
|
9
|
-
import { Switch as
|
|
10
|
-
import { Textarea as
|
|
11
|
-
import { helpVideoKeys as ue, helpVideoApi as
|
|
12
|
-
import { collectionKeysOf as
|
|
13
|
-
import { RemovableChip as
|
|
9
|
+
import { Switch as _e } from "../../ui/switch.js";
|
|
10
|
+
import { Textarea as Le } from "../../ui/textarea.js";
|
|
11
|
+
import { helpVideoKeys as ue, helpVideoApi as _, useHelpVideoPages as Re } from "../api.js";
|
|
12
|
+
import { collectionKeysOf as Te, stepsOf as Ae, removeCollection as qe, toggleStep as De, addCollection as Ee } from "./contexts.js";
|
|
13
|
+
import { RemovableChip as he, PickerCombo as pe, RoleChips as me } from "./PickerCombo.js";
|
|
14
14
|
import { blindRequiredRoles as Oe, joinNames as Pe } from "./publish.js";
|
|
15
|
-
const G = (n) => n.replace(/_/g, " ").replace(/\b\w/g, (
|
|
16
|
-
function O({ title: n, hint:
|
|
17
|
-
return /* @__PURE__ */
|
|
18
|
-
/* @__PURE__ */
|
|
15
|
+
const G = (n) => n.replace(/_/g, " ").replace(/\b\w/g, (s) => s.toUpperCase()), Fe = "rounded-full border px-2.5 py-1 text-[12px] transition-colors duration-150 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan motion-reduce:transition-none", Ke = "border-nvr-cyan bg-nvr-cyan/15 font-medium text-foreground", Ve = "border-border text-foreground hover:bg-muted", M = "rounded-sm underline underline-offset-2 hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan";
|
|
16
|
+
function O({ title: n, hint: s, children: p }) {
|
|
17
|
+
return /* @__PURE__ */ i("section", { className: "space-y-2.5 border-t border-border pt-5", children: [
|
|
18
|
+
/* @__PURE__ */ i("div", { className: "space-y-0.5", children: [
|
|
19
19
|
/* @__PURE__ */ o("h3", { className: "text-[13px] font-semibold text-foreground", children: n }),
|
|
20
|
-
|
|
20
|
+
s && /* @__PURE__ */ o("p", { className: "max-w-[65ch] text-[12px] text-muted-foreground", children: s })
|
|
21
21
|
] }),
|
|
22
22
|
p
|
|
23
23
|
] });
|
|
24
24
|
}
|
|
25
|
-
function J({ error: n, what:
|
|
26
|
-
return n ? /* @__PURE__ */
|
|
25
|
+
function J({ error: n, what: s, onRetry: p }) {
|
|
26
|
+
return n ? /* @__PURE__ */ i(
|
|
27
27
|
"p",
|
|
28
28
|
{
|
|
29
29
|
className: "flex items-start gap-1.5 text-[12px] text-rose-700 dark:text-rose-300",
|
|
30
30
|
role: "alert",
|
|
31
31
|
children: [
|
|
32
|
-
/* @__PURE__ */ o(
|
|
33
|
-
/* @__PURE__ */
|
|
32
|
+
/* @__PURE__ */ o(fe, { className: "mt-px h-3.5 w-3.5 shrink-0", "aria-hidden": !0 }),
|
|
33
|
+
/* @__PURE__ */ i("span", { children: [
|
|
34
34
|
"The list of ",
|
|
35
|
-
|
|
35
|
+
s,
|
|
36
36
|
" couldn't load.",
|
|
37
37
|
" ",
|
|
38
38
|
/* @__PURE__ */ o("button", { type: "button", className: M, onClick: p, children: "Try again" })
|
|
@@ -41,179 +41,179 @@ function J({ error: n, what: i, onRetry: p }) {
|
|
|
41
41
|
}
|
|
42
42
|
) : null;
|
|
43
43
|
}
|
|
44
|
-
const
|
|
44
|
+
const k = [
|
|
45
45
|
["everyone", "Everyone"],
|
|
46
46
|
["roles", "Chosen roles"]
|
|
47
47
|
];
|
|
48
48
|
function Ze({ video: n }) {
|
|
49
|
-
const
|
|
49
|
+
const s = $e(), p = Ne(), [L, X] = m(n.title), [R, Y] = m(n.description ?? ""), [T, Z] = m(n.category ?? ""), [l, ye] = m(n.contexts), [d, ge] = m(
|
|
50
50
|
n.visibility ?? { mode: "everyone", role_ids: [] }
|
|
51
|
-
), [P,
|
|
51
|
+
), [P, xe] = m(n.required_role_ids ?? []), [F, be] = m(n.allow_downloads !== !1), [ee, K] = m(null), V = I(
|
|
52
52
|
() => p.invalidateQueries({ queryKey: ue.one(n.id) }),
|
|
53
53
|
[p, n.id]
|
|
54
54
|
), U = I((e, r) => {
|
|
55
55
|
const t = r == null ? void 0 : r.message;
|
|
56
56
|
K(`${e} didn't save${t ? `: ${t}` : "."} Change it again to retry.`);
|
|
57
|
-
}, []), w =
|
|
58
|
-
w.current = { title:
|
|
59
|
-
const f =
|
|
57
|
+
}, []), w = v({ title: L, description: R, category: T });
|
|
58
|
+
w.current = { title: L, description: R, category: T };
|
|
59
|
+
const f = v(w.current), N = v({
|
|
60
60
|
title: null,
|
|
61
61
|
description: null,
|
|
62
62
|
category: null
|
|
63
|
-
}),
|
|
63
|
+
}), C = I(() => {
|
|
64
64
|
const e = w.current, r = f.current, t = {};
|
|
65
65
|
e.title !== r.title && (t.title = e.title), e.description !== r.description && (t.description = e.description || null), e.category !== r.category && (t.category = e.category || null);
|
|
66
66
|
const a = Object.keys(t);
|
|
67
|
-
a.length && (f.current = { ...r, ...Object.fromEntries(a.map((
|
|
67
|
+
a.length && (f.current = { ...r, ...Object.fromEntries(a.map((c) => [c, e[c]])) }, _(s).update(n.id, t).then(() => (K(null), p.setQueryData(
|
|
68
68
|
ue.one(n.id),
|
|
69
|
-
(
|
|
70
|
-
), V())).catch((
|
|
71
|
-
f.current = { ...f.current, ...Object.fromEntries(a.map((y) => [y, r[y]])) }, U("The text",
|
|
69
|
+
(c) => c && { ...c, ...t }
|
|
70
|
+
), V())).catch((c) => {
|
|
71
|
+
f.current = { ...f.current, ...Object.fromEntries(a.map((y) => [y, r[y]])) }, U("The text", c);
|
|
72
72
|
}));
|
|
73
|
-
}, [
|
|
73
|
+
}, [s, n.id, p, V, U]);
|
|
74
74
|
H(() => {
|
|
75
|
-
const e = window.setTimeout(
|
|
75
|
+
const e = window.setTimeout(C, 800);
|
|
76
76
|
return () => window.clearTimeout(e);
|
|
77
|
-
}, [
|
|
77
|
+
}, [L, R, T]), H(() => C, []);
|
|
78
78
|
const W = (e, r, t) => {
|
|
79
|
-
w.current[e] === f.current[e] && (
|
|
79
|
+
w.current[e] === f.current[e] && (N.current[e] && document.activeElement === N.current[e] || w.current[e] !== r && (f.current = { ...f.current, [e]: r }, t(r)));
|
|
80
80
|
};
|
|
81
81
|
H(() => {
|
|
82
82
|
W("title", n.title, X), W("description", n.description ?? "", Y), W("category", n.category ?? "", Z);
|
|
83
83
|
}, [n.title, n.description, n.category]);
|
|
84
|
-
const j =
|
|
84
|
+
const j = v({ contexts: l, visibility: d, required: P, downloads: F }), te = v(Promise.resolve()), A = (e, r, t, a, c) => {
|
|
85
85
|
t(r), te.current = te.current.then(async () => {
|
|
86
86
|
try {
|
|
87
87
|
await a(), j.current = { ...j.current, [e]: r }, K(null), V();
|
|
88
88
|
} catch (y) {
|
|
89
|
-
t(j.current[e]), U(
|
|
89
|
+
t(j.current[e]), U(c, y);
|
|
90
90
|
}
|
|
91
91
|
});
|
|
92
|
-
},
|
|
92
|
+
}, g = (e) => A(
|
|
93
93
|
"contexts",
|
|
94
94
|
e,
|
|
95
|
-
|
|
96
|
-
() =>
|
|
95
|
+
ye,
|
|
96
|
+
() => _(s).setContexts(n.id, e),
|
|
97
97
|
"Where it shows"
|
|
98
|
-
),
|
|
98
|
+
), S = (e) => A(
|
|
99
99
|
"visibility",
|
|
100
100
|
e,
|
|
101
|
-
|
|
102
|
-
() =>
|
|
101
|
+
ge,
|
|
102
|
+
() => _(s).update(n.id, { visibility: e }),
|
|
103
103
|
"Who can watch"
|
|
104
|
-
),
|
|
104
|
+
), ve = (e) => A(
|
|
105
105
|
"downloads",
|
|
106
106
|
e,
|
|
107
|
-
|
|
108
|
-
() =>
|
|
107
|
+
be,
|
|
108
|
+
() => _(s).update(n.id, { allow_downloads: e }),
|
|
109
109
|
"Downloads"
|
|
110
|
-
),
|
|
110
|
+
), ke = (e) => A(
|
|
111
111
|
"required",
|
|
112
112
|
e,
|
|
113
|
-
|
|
114
|
-
() =>
|
|
113
|
+
xe,
|
|
114
|
+
() => _(s).setRequirements(n.id, e),
|
|
115
115
|
"Required for"
|
|
116
116
|
), h = le({
|
|
117
117
|
queryKey: ["chat-roles"],
|
|
118
|
-
queryFn: async () => (await
|
|
119
|
-
}),
|
|
118
|
+
queryFn: async () => (await s.request(z("/chat/roles"))).data
|
|
119
|
+
}), $ = le({
|
|
120
120
|
queryKey: ["hv-collections"],
|
|
121
|
-
queryFn: async () => (await
|
|
121
|
+
queryFn: async () => (await s.request(
|
|
122
122
|
z("/collections")
|
|
123
123
|
)).data
|
|
124
|
-
}),
|
|
125
|
-
queries:
|
|
124
|
+
}), x = Re(), B = Te(l), we = Ce({
|
|
125
|
+
queries: B.map((e) => ({
|
|
126
126
|
queryKey: ["hv-states", e],
|
|
127
|
-
queryFn: async () => (await
|
|
127
|
+
queryFn: async () => (await s.request(
|
|
128
128
|
z(`/queues/collection-states/${e}`)
|
|
129
129
|
)).data
|
|
130
130
|
}))
|
|
131
|
-
}), q = (e) => e.isLoading ? "Loading…" : e.isError ? "The list couldn't load." : void 0,
|
|
131
|
+
}), q = (e) => e.isLoading ? "Loading…" : e.isError ? "The list couldn't load." : void 0, Q = (e) => {
|
|
132
132
|
var r, t;
|
|
133
133
|
return ((t = (r = h.data) == null ? void 0 : r.find((a) => a.id.toUpperCase() === e.toUpperCase())) == null ? void 0 : t.name) ?? (h.isLoading ? "Loading…" : "Unknown role");
|
|
134
134
|
}, re = (e) => {
|
|
135
135
|
var r, t;
|
|
136
|
-
return ((t = (r =
|
|
136
|
+
return ((t = (r = $.data) == null ? void 0 : r.find((a) => a.collection === e)) == null ? void 0 : t.display_name) || G(e);
|
|
137
137
|
}, oe = (e) => {
|
|
138
138
|
var r, t;
|
|
139
|
-
return ((t = (r =
|
|
140
|
-
}, ne = Oe(d, P),
|
|
139
|
+
return ((t = (r = x.data) == null ? void 0 : r.find((a) => a.key === e)) == null ? void 0 : t.label) ?? (x.isLoading ? "Loading…" : "Unknown page");
|
|
140
|
+
}, ne = Oe(d, P), b = `hv-details-${n.id}`, ae = v([]), ie = (e) => {
|
|
141
141
|
var t;
|
|
142
|
-
const r =
|
|
143
|
-
|
|
142
|
+
const r = k[(e + k.length) % k.length][0];
|
|
143
|
+
S({ mode: r, role_ids: r === "everyone" ? [] : d.role_ids }), (t = ae.current[(e + k.length) % k.length]) == null || t.focus();
|
|
144
144
|
};
|
|
145
|
-
return /* @__PURE__ */
|
|
146
|
-
/* @__PURE__ */
|
|
147
|
-
/* @__PURE__ */ o(E, { htmlFor: `${
|
|
145
|
+
return /* @__PURE__ */ i("div", { className: "max-w-[760px] space-y-5 p-5 text-[13px]", "data-hv-details": !0, children: [
|
|
146
|
+
/* @__PURE__ */ i("div", { className: "space-y-1.5", children: [
|
|
147
|
+
/* @__PURE__ */ o(E, { htmlFor: `${b}-title`, children: "Title" }),
|
|
148
148
|
/* @__PURE__ */ o(
|
|
149
149
|
de,
|
|
150
150
|
{
|
|
151
|
-
id: `${
|
|
151
|
+
id: `${b}-title`,
|
|
152
152
|
ref: (e) => {
|
|
153
|
-
|
|
153
|
+
N.current.title = e;
|
|
154
154
|
},
|
|
155
|
-
value:
|
|
155
|
+
value: L,
|
|
156
156
|
maxLength: 200,
|
|
157
157
|
onChange: (e) => X(e.target.value),
|
|
158
|
-
onBlur:
|
|
158
|
+
onBlur: C,
|
|
159
159
|
className: "h-9 text-[13px]",
|
|
160
160
|
"data-hv-title": !0
|
|
161
161
|
}
|
|
162
162
|
)
|
|
163
163
|
] }),
|
|
164
|
-
/* @__PURE__ */
|
|
165
|
-
/* @__PURE__ */ o(E, { htmlFor: `${
|
|
164
|
+
/* @__PURE__ */ i("div", { className: "space-y-1.5", children: [
|
|
165
|
+
/* @__PURE__ */ o(E, { htmlFor: `${b}-description`, children: "Description" }),
|
|
166
166
|
/* @__PURE__ */ o(
|
|
167
|
-
|
|
167
|
+
Le,
|
|
168
168
|
{
|
|
169
|
-
id: `${
|
|
169
|
+
id: `${b}-description`,
|
|
170
170
|
ref: (e) => {
|
|
171
|
-
|
|
171
|
+
N.current.description = e;
|
|
172
172
|
},
|
|
173
|
-
value:
|
|
173
|
+
value: R,
|
|
174
174
|
rows: 3,
|
|
175
175
|
maxLength: 4e3,
|
|
176
176
|
onChange: (e) => Y(e.target.value),
|
|
177
|
-
onBlur:
|
|
177
|
+
onBlur: C,
|
|
178
178
|
className: "text-[13px]",
|
|
179
179
|
"data-hv-description": !0
|
|
180
180
|
}
|
|
181
181
|
)
|
|
182
182
|
] }),
|
|
183
|
-
/* @__PURE__ */
|
|
184
|
-
/* @__PURE__ */ o(E, { htmlFor: `${
|
|
183
|
+
/* @__PURE__ */ i("div", { className: "space-y-1.5", children: [
|
|
184
|
+
/* @__PURE__ */ o(E, { htmlFor: `${b}-category`, children: "Category" }),
|
|
185
185
|
/* @__PURE__ */ o(
|
|
186
186
|
de,
|
|
187
187
|
{
|
|
188
|
-
id: `${
|
|
188
|
+
id: `${b}-category`,
|
|
189
189
|
ref: (e) => {
|
|
190
|
-
|
|
190
|
+
N.current.category = e;
|
|
191
191
|
},
|
|
192
|
-
value:
|
|
192
|
+
value: T,
|
|
193
193
|
maxLength: 100,
|
|
194
194
|
onChange: (e) => Z(e.target.value),
|
|
195
|
-
onBlur:
|
|
195
|
+
onBlur: C,
|
|
196
196
|
placeholder: "For example, Workflows",
|
|
197
197
|
className: "h-9 text-[13px]"
|
|
198
198
|
}
|
|
199
199
|
)
|
|
200
200
|
] }),
|
|
201
|
-
/* @__PURE__ */
|
|
201
|
+
/* @__PURE__ */ i(
|
|
202
202
|
O,
|
|
203
203
|
{
|
|
204
204
|
title: "Where it shows",
|
|
205
205
|
hint: "On a record form, the Videos button lists the videos for that collection. Pick steps to show a video only at those steps, or leave them all off to show it at every step.",
|
|
206
206
|
children: [
|
|
207
|
-
|
|
208
|
-
var
|
|
209
|
-
const t = we[r], a = Ae(
|
|
210
|
-
return /* @__PURE__ */
|
|
207
|
+
B.map((e, r) => {
|
|
208
|
+
var se;
|
|
209
|
+
const t = we[r], a = Ae(l, e), c = (t == null ? void 0 : t.data) ?? [], y = a.filter((u) => !c.some((D) => D.key === u));
|
|
210
|
+
return /* @__PURE__ */ i(
|
|
211
211
|
"div",
|
|
212
212
|
{
|
|
213
213
|
className: "space-y-2 rounded-md border border-border p-3",
|
|
214
214
|
"data-hv-context-collection": e,
|
|
215
215
|
children: [
|
|
216
|
-
/* @__PURE__ */
|
|
216
|
+
/* @__PURE__ */ i("div", { className: "flex items-center gap-2", children: [
|
|
217
217
|
/* @__PURE__ */ o("span", { className: "font-medium text-foreground", children: re(e) }),
|
|
218
218
|
/* @__PURE__ */ o("span", { className: "text-[12px] text-muted-foreground", "data-hv-step-summary": !0, children: a.length ? "Only at the chosen steps" : "Every step" }),
|
|
219
219
|
/* @__PURE__ */ o(
|
|
@@ -222,20 +222,20 @@ function Ze({ video: n }) {
|
|
|
222
222
|
type: "button",
|
|
223
223
|
className: `ml-auto text-[12px] text-muted-foreground ${M}`,
|
|
224
224
|
"aria-label": `Remove ${re(e)}`,
|
|
225
|
-
onClick: () =>
|
|
225
|
+
onClick: () => g(qe(l, e)),
|
|
226
226
|
children: "Remove"
|
|
227
227
|
}
|
|
228
228
|
)
|
|
229
229
|
] }),
|
|
230
|
-
/* @__PURE__ */
|
|
231
|
-
[...
|
|
230
|
+
/* @__PURE__ */ i("div", { className: "flex flex-wrap items-center gap-1.5", children: [
|
|
231
|
+
[...c, ...y.map((u) => ({ key: u, label: G(u) }))].map((u) => {
|
|
232
232
|
const D = a.includes(u.key);
|
|
233
233
|
return /* @__PURE__ */ o(
|
|
234
234
|
"button",
|
|
235
235
|
{
|
|
236
236
|
type: "button",
|
|
237
237
|
"aria-pressed": D,
|
|
238
|
-
onClick: () =>
|
|
238
|
+
onClick: () => g(De(l, e, u.key)),
|
|
239
239
|
className: `${Fe} ${D ? Ke : Ve}`,
|
|
240
240
|
"data-hv-state-chip": u.key,
|
|
241
241
|
children: u.label
|
|
@@ -244,73 +244,90 @@ function Ze({ video: n }) {
|
|
|
244
244
|
);
|
|
245
245
|
}),
|
|
246
246
|
(t == null ? void 0 : t.isLoading) && /* @__PURE__ */ o("span", { className: "text-[12px] text-muted-foreground", children: "Loading steps…" }),
|
|
247
|
-
(t == null ? void 0 : t.isError) && /* @__PURE__ */
|
|
247
|
+
(t == null ? void 0 : t.isError) && /* @__PURE__ */ i("span", { className: "text-[12px] text-rose-700 dark:text-rose-300", role: "alert", children: [
|
|
248
248
|
"The steps couldn't load.",
|
|
249
249
|
" ",
|
|
250
250
|
/* @__PURE__ */ o("button", { type: "button", className: M, onClick: () => void t.refetch(), children: "Try again" })
|
|
251
251
|
] }),
|
|
252
|
-
((
|
|
252
|
+
((se = t == null ? void 0 : t.data) == null ? void 0 : se.length) === 0 && y.length === 0 && /* @__PURE__ */ o("span", { className: "text-[12px] text-muted-foreground", children: "This collection has no pipeline steps." })
|
|
253
253
|
] })
|
|
254
254
|
]
|
|
255
255
|
},
|
|
256
256
|
e
|
|
257
257
|
);
|
|
258
258
|
}),
|
|
259
|
-
|
|
260
|
-
|
|
259
|
+
l.some((e) => e.kind === "page") && /* @__PURE__ */ o("div", { className: "flex flex-wrap gap-1.5", children: l.filter((e) => e.kind === "page").map((e) => /* @__PURE__ */ o(
|
|
260
|
+
he,
|
|
261
261
|
{
|
|
262
262
|
removeLabel: `Remove ${oe(e.key)}`,
|
|
263
|
-
onRemove: () =>
|
|
263
|
+
onRemove: () => g(l.filter((r) => !(r.kind === "page" && r.key === e.key))),
|
|
264
264
|
"data-hv-context-page": e.key,
|
|
265
265
|
children: oe(e.key)
|
|
266
266
|
},
|
|
267
267
|
e.key
|
|
268
268
|
)) }),
|
|
269
|
-
|
|
269
|
+
l.some((e) => e.kind === "field" || e.kind === "section") && /* @__PURE__ */ o("div", { className: "flex flex-wrap gap-1.5", children: l.filter((e) => e.kind === "field" || e.kind === "section").map((e) => {
|
|
270
|
+
const r = `${e.kind === "field" ? "Field" : "Section"} ${e.state_key} on ${e.key}`;
|
|
271
|
+
return /* @__PURE__ */ o(
|
|
272
|
+
he,
|
|
273
|
+
{
|
|
274
|
+
removeLabel: `Remove ${r}`,
|
|
275
|
+
onRemove: () => g(
|
|
276
|
+
l.filter(
|
|
277
|
+
(t) => !(t.kind === e.kind && t.key === e.key && t.state_key === e.state_key)
|
|
278
|
+
)
|
|
279
|
+
),
|
|
280
|
+
"data-hv-context-target": `${e.kind}:${e.key}:${e.state_key}`,
|
|
281
|
+
children: r
|
|
282
|
+
},
|
|
283
|
+
`${e.kind}|${e.key}|${e.state_key}`
|
|
284
|
+
);
|
|
285
|
+
}) }),
|
|
286
|
+
l.length === 0 && /* @__PURE__ */ o("p", { className: "text-[12px] text-muted-foreground", children: "Not shown anywhere yet. Add a record form or a page to publish." }),
|
|
270
287
|
/* @__PURE__ */ o(
|
|
271
288
|
J,
|
|
272
289
|
{
|
|
273
|
-
error:
|
|
290
|
+
error: $.isError,
|
|
274
291
|
what: "record forms",
|
|
275
|
-
onRetry: () => void
|
|
292
|
+
onRetry: () => void $.refetch()
|
|
276
293
|
}
|
|
277
294
|
),
|
|
278
|
-
/* @__PURE__ */ o(J, { error:
|
|
279
|
-
/* @__PURE__ */
|
|
295
|
+
/* @__PURE__ */ o(J, { error: x.isError, what: "pages", onRetry: () => void x.refetch() }),
|
|
296
|
+
/* @__PURE__ */ i("div", { className: "flex flex-wrap gap-2", children: [
|
|
280
297
|
/* @__PURE__ */ o(
|
|
281
|
-
|
|
298
|
+
pe,
|
|
282
299
|
{
|
|
283
300
|
ariaLabel: "Add a record form",
|
|
284
301
|
placeholder: "Add a record form",
|
|
285
|
-
emptyText: q(
|
|
286
|
-
options: (
|
|
287
|
-
(e) => !e.collection.startsWith("nivaro_") && !
|
|
302
|
+
emptyText: q($),
|
|
303
|
+
options: ($.data ?? []).filter(
|
|
304
|
+
(e) => !e.collection.startsWith("nivaro_") && !B.includes(e.collection)
|
|
288
305
|
).map((e) => ({ value: e.collection, label: e.display_name || G(e.collection) })),
|
|
289
|
-
onPick: (e) =>
|
|
306
|
+
onPick: (e) => g(Ee(l, e))
|
|
290
307
|
}
|
|
291
308
|
),
|
|
292
309
|
/* @__PURE__ */ o(
|
|
293
|
-
|
|
310
|
+
pe,
|
|
294
311
|
{
|
|
295
312
|
ariaLabel: "Add a page",
|
|
296
313
|
placeholder: "Add a page",
|
|
297
|
-
emptyText: q(
|
|
298
|
-
options: (
|
|
299
|
-
onPick: (e) =>
|
|
314
|
+
emptyText: q(x),
|
|
315
|
+
options: (x.data ?? []).filter((e) => !l.some((r) => r.kind === "page" && r.key === e.key)).map((e) => ({ value: e.key, label: e.label, hint: e.app ?? void 0 })),
|
|
316
|
+
onPick: (e) => g([...l, { kind: "page", key: e, state_key: null }])
|
|
300
317
|
}
|
|
301
318
|
)
|
|
302
319
|
] })
|
|
303
320
|
]
|
|
304
321
|
}
|
|
305
322
|
),
|
|
306
|
-
/* @__PURE__ */
|
|
323
|
+
/* @__PURE__ */ i(O, { title: "Who can watch", children: [
|
|
307
324
|
/* @__PURE__ */ o(
|
|
308
325
|
"div",
|
|
309
326
|
{
|
|
310
327
|
className: "inline-flex overflow-hidden rounded-md border border-input",
|
|
311
328
|
role: "radiogroup",
|
|
312
329
|
"aria-label": "Who can watch",
|
|
313
|
-
children:
|
|
330
|
+
children: k.map(([e, r], t) => (
|
|
314
331
|
// biome-ignore lint/a11y/useSemanticElements: a segmented control — buttons in a radiogroup, not native radios
|
|
315
332
|
/* @__PURE__ */ o(
|
|
316
333
|
"button",
|
|
@@ -322,9 +339,9 @@ function Ze({ video: n }) {
|
|
|
322
339
|
role: "radio",
|
|
323
340
|
"aria-checked": d.mode === e,
|
|
324
341
|
tabIndex: d.mode === e ? 0 : -1,
|
|
325
|
-
onClick: () =>
|
|
342
|
+
onClick: () => S({ mode: e, role_ids: e === "everyone" ? [] : d.role_ids }),
|
|
326
343
|
onKeyDown: (a) => {
|
|
327
|
-
a.key === "ArrowRight" || a.key === "ArrowDown" ? (a.preventDefault(),
|
|
344
|
+
a.key === "ArrowRight" || a.key === "ArrowDown" ? (a.preventDefault(), ie(t + 1)) : (a.key === "ArrowLeft" || a.key === "ArrowUp") && (a.preventDefault(), ie(t - 1));
|
|
328
345
|
},
|
|
329
346
|
className: `h-8 border-l border-input px-3 text-[12.5px] transition-colors duration-150 first:border-l-0 focus-visible:relative focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-nvr-cyan motion-reduce:transition-none ${d.mode === e ? "bg-nvr-cyan/15 font-semibold text-foreground" : "bg-background text-foreground hover:bg-muted"}`,
|
|
330
347
|
"data-hv-visibility": e,
|
|
@@ -336,17 +353,17 @@ function Ze({ video: n }) {
|
|
|
336
353
|
}
|
|
337
354
|
),
|
|
338
355
|
d.mode === "roles" && /* @__PURE__ */ o(
|
|
339
|
-
|
|
356
|
+
me,
|
|
340
357
|
{
|
|
341
358
|
roles: h.data ?? [],
|
|
342
359
|
selected: d.role_ids,
|
|
343
|
-
onChange: (e) =>
|
|
344
|
-
roleName:
|
|
360
|
+
onChange: (e) => S({ mode: "roles", role_ids: e }),
|
|
361
|
+
roleName: Q,
|
|
345
362
|
addLabel: "Add a role that can watch",
|
|
346
363
|
emptyText: q(h)
|
|
347
364
|
}
|
|
348
365
|
),
|
|
349
|
-
d.mode === "roles" && d.role_ids.length === 0 && /* @__PURE__ */
|
|
366
|
+
d.mode === "roles" && d.role_ids.length === 0 && /* @__PURE__ */ i("p", { className: "flex items-start gap-1.5 text-[12px] text-amber-800 dark:text-amber-200", children: [
|
|
350
367
|
/* @__PURE__ */ o(ce, { className: "mt-px h-3.5 w-3.5 shrink-0", "aria-hidden": !0 }),
|
|
351
368
|
"Pick at least one role. Until then, only video authors can watch it."
|
|
352
369
|
] })
|
|
@@ -356,13 +373,13 @@ function Ze({ video: n }) {
|
|
|
356
373
|
{
|
|
357
374
|
title: "Downloads",
|
|
358
375
|
hint: "People who can watch it can save the video and its captions to their computer. Authors can always download.",
|
|
359
|
-
children: /* @__PURE__ */
|
|
376
|
+
children: /* @__PURE__ */ i("div", { className: "flex items-center gap-2.5", children: [
|
|
360
377
|
/* @__PURE__ */ o(
|
|
361
|
-
|
|
378
|
+
_e,
|
|
362
379
|
{
|
|
363
380
|
id: `hv-downloads-${n.id}`,
|
|
364
381
|
checked: F,
|
|
365
|
-
onCheckedChange: (e) =>
|
|
382
|
+
onCheckedChange: (e) => ve(e),
|
|
366
383
|
"data-hv-allow-downloads": F ? "on" : "off"
|
|
367
384
|
}
|
|
368
385
|
),
|
|
@@ -370,33 +387,33 @@ function Ze({ video: n }) {
|
|
|
370
387
|
] })
|
|
371
388
|
}
|
|
372
389
|
),
|
|
373
|
-
/* @__PURE__ */
|
|
390
|
+
/* @__PURE__ */ i(
|
|
374
391
|
O,
|
|
375
392
|
{
|
|
376
393
|
title: "Required for",
|
|
377
394
|
hint: "People in these roles see the video in their Required videos list until they have watched it.",
|
|
378
395
|
children: [
|
|
379
396
|
/* @__PURE__ */ o(
|
|
380
|
-
|
|
397
|
+
me,
|
|
381
398
|
{
|
|
382
399
|
roles: h.data ?? [],
|
|
383
400
|
selected: P,
|
|
384
|
-
onChange:
|
|
385
|
-
roleName:
|
|
401
|
+
onChange: ke,
|
|
402
|
+
roleName: Q,
|
|
386
403
|
addLabel: "Add a required role",
|
|
387
404
|
emptyText: q(h)
|
|
388
405
|
}
|
|
389
406
|
),
|
|
390
407
|
/* @__PURE__ */ o(J, { error: h.isError, what: "roles", onRetry: () => void h.refetch() }),
|
|
391
|
-
ne.length > 0 && !h.isLoading && /* @__PURE__ */
|
|
408
|
+
ne.length > 0 && !h.isLoading && /* @__PURE__ */ i(
|
|
392
409
|
"p",
|
|
393
410
|
{
|
|
394
411
|
className: "flex items-start gap-1.5 text-[12px] text-amber-800 dark:text-amber-200",
|
|
395
412
|
"data-hv-blind-roles": !0,
|
|
396
413
|
children: [
|
|
397
414
|
/* @__PURE__ */ o(ce, { className: "mt-px h-3.5 w-3.5 shrink-0", "aria-hidden": !0 }),
|
|
398
|
-
/* @__PURE__ */
|
|
399
|
-
Pe(ne.map(
|
|
415
|
+
/* @__PURE__ */ i("span", { children: [
|
|
416
|
+
Pe(ne.map(Q)),
|
|
400
417
|
" must watch this but can't see it. Add them to who can watch, or they won't be asked."
|
|
401
418
|
] })
|
|
402
419
|
]
|
|
@@ -405,13 +422,13 @@ function Ze({ video: n }) {
|
|
|
405
422
|
]
|
|
406
423
|
}
|
|
407
424
|
),
|
|
408
|
-
/* @__PURE__ */ o("div", { role: "status", "aria-live": "polite", className: "min-h-[1rem]", children: ee && /* @__PURE__ */
|
|
425
|
+
/* @__PURE__ */ o("div", { role: "status", "aria-live": "polite", className: "min-h-[1rem]", children: ee && /* @__PURE__ */ i(
|
|
409
426
|
"p",
|
|
410
427
|
{
|
|
411
428
|
className: "flex items-start gap-1.5 text-[12px] text-rose-700 dark:text-rose-300",
|
|
412
429
|
"data-hv-details-problem": !0,
|
|
413
430
|
children: [
|
|
414
|
-
/* @__PURE__ */ o(
|
|
431
|
+
/* @__PURE__ */ o(fe, { className: "mt-px h-3.5 w-3.5 shrink-0", "aria-hidden": !0 }),
|
|
415
432
|
ee
|
|
416
433
|
]
|
|
417
434
|
}
|