@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,27 +1,28 @@
|
|
|
1
1
|
import { jsxs as c, jsx as r } from "react/jsx-runtime";
|
|
2
|
-
import { useQuery as
|
|
3
|
-
import { ChevronDown as
|
|
4
|
-
import { useState as
|
|
5
|
-
import { createPortal as
|
|
6
|
-
import { useNivaroClient as
|
|
7
|
-
import { get as
|
|
8
|
-
import { useRecordReader as
|
|
9
|
-
import { useOnlineUsers as
|
|
10
|
-
import { UserAvatar as
|
|
11
|
-
import { userOptionFilter as
|
|
12
|
-
import { applyDisplayTemplate as
|
|
13
|
-
|
|
2
|
+
import { useQuery as k } from "@tanstack/react-query";
|
|
3
|
+
import { ChevronDown as ye, Loader2 as te, AlertTriangle as je, Search as Fe, X as Te, Check as we } from "lucide-react";
|
|
4
|
+
import { useState as S, useRef as H, useEffect as j, useLayoutEffect as Ee, useMemo as ee } from "react";
|
|
5
|
+
import { createPortal as ve } from "react-dom";
|
|
6
|
+
import { useNivaroClient as re, useItemEditAuth as Oe, useStaleFieldReporter as Ae } from "../../context.js";
|
|
7
|
+
import { get as F, post as Ke } from "../../lib/commands.js";
|
|
8
|
+
import { useRecordReader as Ne } from "../../lib/record-loader.js";
|
|
9
|
+
import { useOnlineUsers as Ue } from "../../lib/use-online-users.js";
|
|
10
|
+
import { UserAvatar as Ie } from "../UserAvatar.js";
|
|
11
|
+
import { userOptionFilter as Pe, cn as U } from "../../lib/utils.js";
|
|
12
|
+
import { applyDisplayTemplate as N } from "./helpers.js";
|
|
13
|
+
import { usePickerMissReport as De } from "./picker-miss.js";
|
|
14
|
+
function ze(s) {
|
|
14
15
|
return s.replace(/\(.*$/, "").trim().split(/\s+/).map((t) => t[0]).filter(Boolean).slice(0, 2).join("").toUpperCase() || "?";
|
|
15
16
|
}
|
|
16
|
-
function
|
|
17
|
-
const [t, d] =
|
|
17
|
+
function Je(s) {
|
|
18
|
+
const [t, d] = S(null), h = {
|
|
18
19
|
onMouseEnter: (f) => {
|
|
19
20
|
if (!s) return;
|
|
20
21
|
const m = f.currentTarget.getBoundingClientRect(), u = window.innerHeight - m.bottom < 80;
|
|
21
22
|
d({ x: m.left, y: u ? m.top - 58 : m.bottom + 4 });
|
|
22
23
|
},
|
|
23
24
|
onMouseLeave: () => d(null)
|
|
24
|
-
},
|
|
25
|
+
}, y = s && t ? ve(
|
|
25
26
|
/* @__PURE__ */ r(
|
|
26
27
|
"div",
|
|
27
28
|
{
|
|
@@ -32,77 +33,78 @@ function De(s) {
|
|
|
32
33
|
),
|
|
33
34
|
document.body
|
|
34
35
|
) : null;
|
|
35
|
-
return { bind:
|
|
36
|
+
return { bind: h, tip: y };
|
|
36
37
|
}
|
|
37
|
-
function
|
|
38
|
+
function Me({
|
|
38
39
|
collection: s,
|
|
39
40
|
value: t,
|
|
40
41
|
onChange: d,
|
|
41
|
-
disabled:
|
|
42
|
-
placeholder:
|
|
42
|
+
disabled: h,
|
|
43
|
+
placeholder: y,
|
|
43
44
|
extraFilter: f,
|
|
44
45
|
autoSelectSingle: m,
|
|
45
46
|
optionSort: u,
|
|
46
|
-
requiredParent:
|
|
47
|
+
requiredParent: $,
|
|
47
48
|
facets: o,
|
|
48
|
-
fieldKey:
|
|
49
|
+
fieldKey: _,
|
|
49
50
|
narrowedBy: l,
|
|
50
|
-
pinned: p
|
|
51
|
+
pinned: p,
|
|
52
|
+
missPlacement: w
|
|
51
53
|
}) {
|
|
52
|
-
const
|
|
53
|
-
|
|
54
|
-
|
|
54
|
+
const T = re(), ne = Ne(), [g, E] = S(!1), [L, se] = S(""), [R, oe] = S(""), ie = H(null), I = H(null);
|
|
55
|
+
j(() => {
|
|
56
|
+
g ? setTimeout(() => {
|
|
55
57
|
var e;
|
|
56
|
-
return (e =
|
|
57
|
-
}, 30) : (
|
|
58
|
-
}, [
|
|
59
|
-
const e = setTimeout(() =>
|
|
58
|
+
return (e = ie.current) == null ? void 0 : e.focus();
|
|
59
|
+
}, 30) : (se(""), oe(""));
|
|
60
|
+
}, [g]), j(() => {
|
|
61
|
+
const e = setTimeout(() => oe(L), 300);
|
|
60
62
|
return () => clearTimeout(e);
|
|
61
|
-
}, [
|
|
62
|
-
if (!
|
|
63
|
+
}, [L]), j(() => {
|
|
64
|
+
if (!g) return;
|
|
63
65
|
const e = (i) => {
|
|
64
66
|
var a;
|
|
65
67
|
const n = i.target;
|
|
66
|
-
(a = n == null ? void 0 : n.closest) != null && a.call(n, "[data-nvr-combobox-panel]") ||
|
|
68
|
+
(a = n == null ? void 0 : n.closest) != null && a.call(n, "[data-nvr-combobox-panel]") || I.current && !I.current.contains(i.target) && E(!1);
|
|
67
69
|
};
|
|
68
70
|
return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
|
|
69
|
-
}, [
|
|
70
|
-
const [
|
|
71
|
-
|
|
72
|
-
if (!
|
|
73
|
-
|
|
71
|
+
}, [g]);
|
|
72
|
+
const [le, Y] = S(null), [ae, ke] = S(null);
|
|
73
|
+
Ee(() => {
|
|
74
|
+
if (!g) {
|
|
75
|
+
Y(null);
|
|
74
76
|
return;
|
|
75
77
|
}
|
|
76
78
|
const e = () => {
|
|
77
|
-
const i =
|
|
79
|
+
const i = I.current;
|
|
78
80
|
if (!i) return;
|
|
79
81
|
const n = i.getBoundingClientRect(), a = i.closest('[role="dialog"]') ?? document.body;
|
|
80
|
-
|
|
81
|
-
const
|
|
82
|
+
ke(a);
|
|
83
|
+
const fe = window.innerHeight - n.bottom < 340 && n.top > window.innerHeight - n.bottom, be = n.left, he = fe ? n.top - 4 : n.bottom + 4, ge = {
|
|
82
84
|
minWidth: n.width,
|
|
83
85
|
zIndex: 120,
|
|
84
|
-
...
|
|
86
|
+
...fe ? { transform: "translateY(-100%)" } : {}
|
|
85
87
|
};
|
|
86
88
|
if (a === document.body)
|
|
87
|
-
|
|
89
|
+
Y({ position: "fixed", left: be, top: he, ...ge });
|
|
88
90
|
else {
|
|
89
|
-
const
|
|
90
|
-
|
|
91
|
+
const xe = a.getBoundingClientRect();
|
|
92
|
+
Y({ position: "absolute", left: be - xe.left, top: he - xe.top, ...ge });
|
|
91
93
|
}
|
|
92
94
|
};
|
|
93
95
|
return e(), window.addEventListener("scroll", e, !0), window.addEventListener("resize", e), () => {
|
|
94
96
|
window.removeEventListener("scroll", e, !0), window.removeEventListener("resize", e);
|
|
95
97
|
};
|
|
96
|
-
}, [
|
|
97
|
-
const { data:
|
|
98
|
+
}, [g]);
|
|
99
|
+
const { data: W } = k({
|
|
98
100
|
queryKey: ["col-meta", s],
|
|
99
|
-
queryFn: () =>
|
|
101
|
+
queryFn: () => T.request(F(`/collections/${s}`)).then((e) => e.data),
|
|
100
102
|
staleTime: 3e5,
|
|
101
103
|
retry: !1
|
|
102
|
-
}), [
|
|
104
|
+
}), [X, Se] = S({}), { data: de = [] } = k({
|
|
103
105
|
queryKey: ["collection-meta", s],
|
|
104
|
-
queryFn: () =>
|
|
105
|
-
|
|
106
|
+
queryFn: () => T.request(
|
|
107
|
+
F(`/collections/${s}`)
|
|
106
108
|
).then(
|
|
107
109
|
(e) => {
|
|
108
110
|
var i;
|
|
@@ -111,65 +113,73 @@ function ze({
|
|
|
111
113
|
),
|
|
112
114
|
enabled: !!(o != null && o.length),
|
|
113
115
|
staleTime: 10 * 6e4
|
|
114
|
-
}),
|
|
116
|
+
}), _e = ee(() => {
|
|
115
117
|
const e = {};
|
|
116
118
|
for (const i of o ?? []) {
|
|
117
|
-
const n =
|
|
119
|
+
const n = de.find(
|
|
118
120
|
(a) => a.many_collection === s && a.many_field === i.field && !a.junction_field
|
|
119
121
|
);
|
|
120
122
|
n != null && n.one_collection && (e[i.field] = n.one_collection);
|
|
121
123
|
}
|
|
122
124
|
return e;
|
|
123
|
-
}, [o,
|
|
125
|
+
}, [o, de, s]), O = s === "nivaro_users", qe = Ue(O), ce = Oe().isAdmin, G = ee(() => {
|
|
124
126
|
const e = [];
|
|
125
|
-
|
|
126
|
-
for (const [i, n] of Object.entries(
|
|
127
|
+
O && e.push(Pe(ce)), f && e.push(f);
|
|
128
|
+
for (const [i, n] of Object.entries(X))
|
|
127
129
|
n != null && n !== "" && e.push({ [i]: { _eq: n } });
|
|
128
130
|
if (e.length !== 0)
|
|
129
131
|
return e.length === 1 ? e[0] : { _and: e };
|
|
130
|
-
}, [f,
|
|
131
|
-
if (!
|
|
132
|
-
const e = [...
|
|
132
|
+
}, [f, X, ce]), P = (W == null ? void 0 : W.display_template) ?? (O ? "{{first_name}} {{last_name}} ({{email}})" : null), q = ee(() => {
|
|
133
|
+
if (!P) return;
|
|
134
|
+
const e = [...P.matchAll(/\{\{([\w.]+)\}\}/g)].map((i) => i[1]);
|
|
133
135
|
if (e.length)
|
|
134
136
|
return ["id", ...e].join(",");
|
|
135
|
-
}, [
|
|
137
|
+
}, [P]), x = G ? JSON.stringify(G) : void 0, D = u && !/^-?label$/.test(u) ? u : void 0, { data: v, isFetching: V } = k({
|
|
136
138
|
queryKey: [
|
|
137
139
|
"relation-opts",
|
|
138
140
|
s,
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
141
|
+
R,
|
|
142
|
+
x,
|
|
143
|
+
q,
|
|
144
|
+
D ?? ""
|
|
143
145
|
],
|
|
144
|
-
queryFn: () =>
|
|
145
|
-
|
|
146
|
+
queryFn: () => T.request(
|
|
147
|
+
F(`/items/${s}`, {
|
|
146
148
|
limit: 200,
|
|
147
149
|
picker: "1",
|
|
148
|
-
...
|
|
149
|
-
...
|
|
150
|
-
...
|
|
151
|
-
...
|
|
150
|
+
...R ? { search: R } : {},
|
|
151
|
+
...x ? { filter: x } : {},
|
|
152
|
+
...q ? { fields: q } : {},
|
|
153
|
+
...D ? { sort: D } : {}
|
|
152
154
|
})
|
|
153
155
|
).then((e) => e.data ?? []),
|
|
154
|
-
enabled:
|
|
155
|
-
staleTime:
|
|
156
|
-
})
|
|
157
|
-
|
|
158
|
-
|
|
156
|
+
enabled: g,
|
|
157
|
+
staleTime: x ? 0 : 3e4
|
|
158
|
+
});
|
|
159
|
+
De({
|
|
160
|
+
placement: w,
|
|
161
|
+
open: g,
|
|
162
|
+
search: R,
|
|
163
|
+
settled: !V && v !== void 0,
|
|
164
|
+
count: (v == null ? void 0 : v.length) ?? 0
|
|
165
|
+
});
|
|
166
|
+
const { data: z, isLoading: Ce } = k({
|
|
167
|
+
queryKey: ["relation-single", s, String(t), q],
|
|
168
|
+
queryFn: () => ne(s, t, q),
|
|
159
169
|
enabled: !!t,
|
|
160
170
|
staleTime: 6e4
|
|
161
|
-
}),
|
|
162
|
-
queryKey: ["relation-single", s,
|
|
163
|
-
queryFn: () =>
|
|
171
|
+
}), b = (p == null ? void 0 : p.id) != null && p.id !== "" ? String(p.id) : null, { data: A } = k({
|
|
172
|
+
queryKey: ["relation-single", s, b ?? "", q],
|
|
173
|
+
queryFn: () => ne(s, b, q).catch(
|
|
164
174
|
() => null
|
|
165
175
|
),
|
|
166
|
-
enabled: !!
|
|
176
|
+
enabled: !!b && g,
|
|
167
177
|
staleTime: 6e4
|
|
168
|
-
}),
|
|
169
|
-
queryKey: ["relation-avail", s, String(t),
|
|
170
|
-
queryFn: () =>
|
|
171
|
-
|
|
172
|
-
filter:
|
|
178
|
+
}), $e = JSON.stringify(f ? { _and: [{ id: { _eq: t } }, f] } : { id: { _eq: t } }), { data: J } = k({
|
|
179
|
+
queryKey: ["relation-avail", s, String(t), x],
|
|
180
|
+
queryFn: () => T.request(
|
|
181
|
+
F(`/items/${s}`, {
|
|
182
|
+
filter: $e,
|
|
173
183
|
picker: "1",
|
|
174
184
|
limit: 1,
|
|
175
185
|
fields: "id"
|
|
@@ -178,35 +188,35 @@ function ze({
|
|
|
178
188
|
// The pinned option is offered OUTSIDE the option filter (a type's generic
|
|
179
189
|
// item is excluded from the general list on purpose), so a value that IS
|
|
180
190
|
// the pin is available by construction — never probe it, never flag it.
|
|
181
|
-
enabled: !!t && !!
|
|
191
|
+
enabled: !!t && !!z && String(t) !== b,
|
|
182
192
|
staleTime: 3e4
|
|
183
|
-
}),
|
|
184
|
-
|
|
193
|
+
}), K = !!t && String(t) !== b && J !== void 0 && J.length === 0, M = H(null), Z = H(!1), ue = `${s}|${x ?? ""}`, Le = () => {
|
|
194
|
+
Z.current = !0, M.current = ue, d(null);
|
|
185
195
|
}, Q = t == null || t === "";
|
|
186
|
-
|
|
187
|
-
Q || (
|
|
188
|
-
}, [Q]),
|
|
189
|
-
if (!m ||
|
|
190
|
-
const e =
|
|
191
|
-
|
|
192
|
-
|
|
196
|
+
j(() => {
|
|
197
|
+
Q || (Z.current = !1);
|
|
198
|
+
}, [Q]), j(() => {
|
|
199
|
+
if (!m || h || !Q || Z.current) return;
|
|
200
|
+
const e = ue;
|
|
201
|
+
M.current !== e && (M.current = e, T.request(
|
|
202
|
+
F(`/items/${s}`, {
|
|
193
203
|
limit: 2,
|
|
194
204
|
picker: "1",
|
|
195
205
|
fields: "id",
|
|
196
|
-
...
|
|
206
|
+
...x ? { filter: x } : {}
|
|
197
207
|
})
|
|
198
208
|
).then((i) => {
|
|
199
209
|
var a;
|
|
200
210
|
const n = i.data ?? [];
|
|
201
211
|
n.length === 1 && ((a = n[0]) == null ? void 0 : a.id) != null && d(n[0].id);
|
|
202
212
|
}).catch(() => {
|
|
203
|
-
|
|
213
|
+
M.current = null;
|
|
204
214
|
}));
|
|
205
|
-
}, [m,
|
|
206
|
-
const
|
|
207
|
-
return
|
|
208
|
-
!
|
|
209
|
-
}, [
|
|
215
|
+
}, [m, h, Q, s, x]);
|
|
216
|
+
const C = P, me = t && z ? N(C, z) : null, Re = !!t && Ce && !z, pe = Je(K), B = Ae();
|
|
217
|
+
return j(() => {
|
|
218
|
+
!B || !_ || J === void 0 || B(_, K);
|
|
219
|
+
}, [B, _, K, J]), $ ? /* @__PURE__ */ c(
|
|
210
220
|
"button",
|
|
211
221
|
{
|
|
212
222
|
type: "button",
|
|
@@ -215,66 +225,66 @@ function ze({
|
|
|
215
225
|
children: [
|
|
216
226
|
/* @__PURE__ */ c("span", { className: "truncate text-muted-foreground", children: [
|
|
217
227
|
"Select ",
|
|
218
|
-
|
|
228
|
+
$,
|
|
219
229
|
" first"
|
|
220
230
|
] }),
|
|
221
|
-
/* @__PURE__ */ r(
|
|
231
|
+
/* @__PURE__ */ r(ye, { className: "h-4 w-4 shrink-0 opacity-50" })
|
|
222
232
|
]
|
|
223
233
|
}
|
|
224
234
|
) : (
|
|
225
235
|
// Stale tooltip binds on the WRAPPER: a disabled trigger button swallows
|
|
226
236
|
// mouse events, so a locked-but-stale field would never show the hint.
|
|
227
|
-
/* @__PURE__ */ c("div", { ref:
|
|
237
|
+
/* @__PURE__ */ c("div", { ref: I, className: "relative", ...pe.bind, children: [
|
|
228
238
|
/* @__PURE__ */ c(
|
|
229
239
|
"button",
|
|
230
240
|
{
|
|
231
241
|
type: "button",
|
|
232
|
-
disabled:
|
|
233
|
-
onClick: () =>
|
|
234
|
-
className:
|
|
242
|
+
disabled: h,
|
|
243
|
+
onClick: () => E((e) => !e),
|
|
244
|
+
className: U(
|
|
235
245
|
"flex h-9 w-full items-center justify-between gap-2 rounded-md border bg-background px-3 text-sm text-left hover:bg-muted disabled:pointer-events-none disabled:opacity-50",
|
|
236
|
-
|
|
246
|
+
K ? "border-amber-300 dark:border-amber-600" : "border-input"
|
|
237
247
|
),
|
|
238
248
|
children: [
|
|
239
|
-
|
|
249
|
+
Re ? /* @__PURE__ */ r(te, { className: "h-3.5 w-3.5 animate-spin text-muted-foreground" }) : /* @__PURE__ */ c(
|
|
240
250
|
"span",
|
|
241
251
|
{
|
|
242
|
-
className:
|
|
252
|
+
className: U(
|
|
243
253
|
"flex items-center gap-1.5 truncate min-w-0",
|
|
244
|
-
!
|
|
254
|
+
!me && "text-muted-foreground"
|
|
245
255
|
),
|
|
246
256
|
children: [
|
|
247
|
-
|
|
248
|
-
/* @__PURE__ */ r("span", { className: "truncate", children:
|
|
257
|
+
K && /* @__PURE__ */ r(je, { className: "h-3.5 w-3.5 shrink-0 text-amber-500" }),
|
|
258
|
+
/* @__PURE__ */ r("span", { className: "truncate", children: me ?? y ?? "Select…" })
|
|
249
259
|
]
|
|
250
260
|
}
|
|
251
261
|
),
|
|
252
|
-
/* @__PURE__ */ r(
|
|
262
|
+
/* @__PURE__ */ r(ye, { className: "h-4 w-4 shrink-0 opacity-50" })
|
|
253
263
|
]
|
|
254
264
|
}
|
|
255
265
|
),
|
|
256
|
-
|
|
257
|
-
|
|
266
|
+
pe.tip,
|
|
267
|
+
g && le && ae && ve(
|
|
258
268
|
/* @__PURE__ */ c(
|
|
259
269
|
"div",
|
|
260
270
|
{
|
|
261
271
|
"data-nvr-combobox-panel": "",
|
|
262
|
-
style:
|
|
263
|
-
className:
|
|
272
|
+
style: le,
|
|
273
|
+
className: U(
|
|
264
274
|
"nvr-pop-in rounded-md border border-border bg-popover shadow-md",
|
|
265
275
|
o != null && o.length ? "w-[560px] max-w-[92vw]" : "min-w-[240px] w-max max-w-[360px]"
|
|
266
276
|
),
|
|
267
277
|
children: [
|
|
268
278
|
!!(o != null && o.length) && /* @__PURE__ */ r("div", { className: "grid grid-cols-2 gap-2 border-b border-border bg-slate-50/60 p-2 dark:bg-muted/40", children: o.map((e) => {
|
|
269
|
-
const i =
|
|
279
|
+
const i = _e[e.field];
|
|
270
280
|
return i ? /* @__PURE__ */ c("div", { children: [
|
|
271
281
|
/* @__PURE__ */ r("p", { className: "mb-0.5 text-[10px] font-medium uppercase tracking-wide text-slate-400", children: e.label ?? e.field }),
|
|
272
282
|
/* @__PURE__ */ r(
|
|
273
|
-
|
|
283
|
+
Me,
|
|
274
284
|
{
|
|
275
285
|
collection: i,
|
|
276
|
-
value:
|
|
277
|
-
onChange: (n) =>
|
|
286
|
+
value: X[e.field] ?? null,
|
|
287
|
+
onChange: (n) => Se((a) => ({ ...a, [e.field]: n })),
|
|
278
288
|
placeholder: "Any",
|
|
279
289
|
optionSort: e.sort,
|
|
280
290
|
extraFilter: e.filter
|
|
@@ -283,59 +293,59 @@ function ze({
|
|
|
283
293
|
] }, e.field) : null;
|
|
284
294
|
}) }),
|
|
285
295
|
/* @__PURE__ */ c("div", { className: "flex items-center border-b px-3", children: [
|
|
286
|
-
/* @__PURE__ */ r(
|
|
296
|
+
/* @__PURE__ */ r(Fe, { className: "mr-2 h-4 w-4 shrink-0 opacity-50" }),
|
|
287
297
|
/* @__PURE__ */ r(
|
|
288
298
|
"input",
|
|
289
299
|
{
|
|
290
|
-
ref:
|
|
291
|
-
value:
|
|
292
|
-
onChange: (e) =>
|
|
300
|
+
ref: ie,
|
|
301
|
+
value: L,
|
|
302
|
+
onChange: (e) => se(e.target.value),
|
|
293
303
|
placeholder: "Search…",
|
|
294
304
|
className: "flex h-9 w-full bg-transparent py-3 text-[13px] outline-none placeholder:text-muted-foreground"
|
|
295
305
|
}
|
|
296
306
|
)
|
|
297
307
|
] }),
|
|
298
308
|
/* @__PURE__ */ c("div", { className: "max-h-52 overflow-y-auto py-1", children: [
|
|
299
|
-
!!t && !
|
|
309
|
+
!!t && !h && /* @__PURE__ */ c(
|
|
300
310
|
"button",
|
|
301
311
|
{
|
|
302
312
|
type: "button",
|
|
303
313
|
onClick: () => {
|
|
304
|
-
|
|
314
|
+
Le(), E(!1);
|
|
305
315
|
},
|
|
306
316
|
className: "flex w-full items-center gap-2 px-3 py-1.5 text-[13px] text-slate-500 hover:bg-muted border-b border-slate-100 dark:text-slate-400 dark:border-border",
|
|
307
317
|
children: [
|
|
308
|
-
/* @__PURE__ */ r(
|
|
318
|
+
/* @__PURE__ */ r(Te, { className: "h-3.5 w-3.5 text-slate-400" }),
|
|
309
319
|
"Clear selection"
|
|
310
320
|
]
|
|
311
321
|
}
|
|
312
322
|
),
|
|
313
|
-
|
|
323
|
+
b && /* @__PURE__ */ c(
|
|
314
324
|
"button",
|
|
315
325
|
{
|
|
316
326
|
type: "button",
|
|
317
327
|
"data-nvr-pinned-option": !0,
|
|
318
328
|
onClick: () => {
|
|
319
|
-
d((
|
|
329
|
+
d((A == null ? void 0 : A.id) ?? (p == null ? void 0 : p.id)), E(!1);
|
|
320
330
|
},
|
|
321
331
|
className: "flex w-full items-center gap-2 border-b border-slate-100 bg-nvr-cyan/5 px-3 py-1.5 text-left text-[13px] hover:bg-nvr-cyan/10 dark:border-border",
|
|
322
332
|
children: [
|
|
323
333
|
/* @__PURE__ */ r(
|
|
324
334
|
"div",
|
|
325
335
|
{
|
|
326
|
-
className:
|
|
336
|
+
className: U(
|
|
327
337
|
"flex h-4 w-4 shrink-0 items-center justify-center rounded-full border transition-colors",
|
|
328
|
-
String(t) ===
|
|
338
|
+
String(t) === b ? "border-nvr-cyan bg-nvr-cyan" : "border-slate-300"
|
|
329
339
|
),
|
|
330
|
-
children: String(t) ===
|
|
340
|
+
children: String(t) === b && /* @__PURE__ */ r(we, { className: "h-2.5 w-2.5 text-white" })
|
|
331
341
|
}
|
|
332
342
|
),
|
|
333
|
-
/* @__PURE__ */ r("span", { className: "min-w-0 flex-1 truncate", children:
|
|
343
|
+
/* @__PURE__ */ r("span", { className: "min-w-0 flex-1 truncate", children: A ? N(C, A) || `#${b}` : `#${b}` }),
|
|
334
344
|
/* @__PURE__ */ r("span", { className: "shrink-0 rounded bg-nvr-cyan/15 px-1.5 py-0.5 text-[10px] font-semibold uppercase tracking-wide text-slate-700 dark:text-foreground", children: (p == null ? void 0 : p.tag) ?? "Default" })
|
|
335
345
|
]
|
|
336
346
|
}
|
|
337
347
|
),
|
|
338
|
-
|
|
348
|
+
V ? /* @__PURE__ */ r("div", { className: "flex items-center justify-center py-4", children: /* @__PURE__ */ r(te, { className: "h-4 w-4 animate-spin text-muted-foreground" }) }) : (v ?? []).length === 0 ? l && l.labels.length > 0 && !L.trim() ? /* @__PURE__ */ c("div", { className: "px-3 py-2 text-[12px] leading-5 text-muted-foreground", children: [
|
|
339
349
|
/* @__PURE__ */ c("p", { children: [
|
|
340
350
|
"No options for",
|
|
341
351
|
" ",
|
|
@@ -358,38 +368,38 @@ function ze({
|
|
|
358
368
|
},
|
|
359
369
|
e
|
|
360
370
|
)) })
|
|
361
|
-
] }) : /* @__PURE__ */ r("p", { className: "px-3 py-2 text-[13px] text-muted-foreground", children:
|
|
362
|
-
(e, i) => u === "-label" ?
|
|
363
|
-
)).filter((e) => !
|
|
364
|
-
const i =
|
|
371
|
+
] }) : /* @__PURE__ */ r("p", { className: "px-3 py-2 text-[13px] text-muted-foreground", children: L.trim() ? `No results for “${L.trim()}”` : "No results" }) : (D ? [...v ?? []] : [...v ?? []].sort(
|
|
372
|
+
(e, i) => u === "-label" ? N(C, i).localeCompare(N(C, e)) : N(C, e).localeCompare(N(C, i))
|
|
373
|
+
)).filter((e) => !b || String(e.id) !== b).map((e) => {
|
|
374
|
+
const i = N(C, e) || `#${e.id}`, n = String(e.id) === String(t);
|
|
365
375
|
return /* @__PURE__ */ c(
|
|
366
376
|
"button",
|
|
367
377
|
{
|
|
368
378
|
type: "button",
|
|
369
379
|
onClick: () => {
|
|
370
|
-
d(e.id),
|
|
380
|
+
d(e.id), E(!1);
|
|
371
381
|
},
|
|
372
382
|
className: "flex w-full items-center gap-2 px-3 py-1.5 text-[13px] text-left hover:bg-muted",
|
|
373
383
|
children: [
|
|
374
384
|
/* @__PURE__ */ r(
|
|
375
385
|
"div",
|
|
376
386
|
{
|
|
377
|
-
className:
|
|
387
|
+
className: U(
|
|
378
388
|
"flex h-4 w-4 shrink-0 items-center justify-center rounded-full border transition-colors",
|
|
379
389
|
n ? "border-nvr-cyan bg-nvr-cyan" : "border-slate-300"
|
|
380
390
|
),
|
|
381
|
-
children: n && /* @__PURE__ */ r(
|
|
391
|
+
children: n && /* @__PURE__ */ r(we, { className: "h-2.5 w-2.5 text-white" })
|
|
382
392
|
}
|
|
383
393
|
),
|
|
384
|
-
|
|
385
|
-
|
|
394
|
+
O && /* @__PURE__ */ r(
|
|
395
|
+
Ie,
|
|
386
396
|
{
|
|
387
397
|
userId: e.id,
|
|
388
398
|
className: "h-4 w-4",
|
|
389
|
-
fallback: /* @__PURE__ */ r("span", { className: "flex h-4 w-4 shrink-0 items-center justify-center rounded-full bg-nvr-cyan/20 text-[8px] font-bold text-nvr-navy dark:text-nvr-cyan", children:
|
|
399
|
+
fallback: /* @__PURE__ */ r("span", { className: "flex h-4 w-4 shrink-0 items-center justify-center rounded-full bg-nvr-cyan/20 text-[8px] font-bold text-nvr-navy dark:text-nvr-cyan", children: ze(i) })
|
|
390
400
|
}
|
|
391
401
|
),
|
|
392
|
-
|
|
402
|
+
O && qe.has(String(e.id).toUpperCase()) && /* @__PURE__ */ r(
|
|
393
403
|
"span",
|
|
394
404
|
{
|
|
395
405
|
className: "h-1.5 w-1.5 shrink-0 rounded-full bg-emerald-500",
|
|
@@ -403,59 +413,59 @@ function ze({
|
|
|
403
413
|
);
|
|
404
414
|
})
|
|
405
415
|
] }),
|
|
406
|
-
!
|
|
407
|
-
|
|
416
|
+
!V && /* @__PURE__ */ r(
|
|
417
|
+
Qe,
|
|
408
418
|
{
|
|
409
419
|
collection: s,
|
|
410
|
-
search:
|
|
411
|
-
filter:
|
|
420
|
+
search: R,
|
|
421
|
+
filter: G,
|
|
412
422
|
narrowedLabels: (l == null ? void 0 : l.labels) ?? [],
|
|
413
|
-
auto: (
|
|
423
|
+
auto: (v ?? []).length === 0 && !!R
|
|
414
424
|
}
|
|
415
425
|
)
|
|
416
426
|
]
|
|
417
427
|
}
|
|
418
428
|
),
|
|
419
|
-
|
|
429
|
+
ae
|
|
420
430
|
)
|
|
421
431
|
] })
|
|
422
432
|
);
|
|
423
433
|
}
|
|
424
|
-
function
|
|
434
|
+
function Qe({
|
|
425
435
|
collection: s,
|
|
426
436
|
search: t,
|
|
427
437
|
filter: d,
|
|
428
|
-
narrowedLabels:
|
|
429
|
-
auto:
|
|
438
|
+
narrowedLabels: h,
|
|
439
|
+
auto: y
|
|
430
440
|
}) {
|
|
431
|
-
const f =
|
|
432
|
-
queryKey: ["picker-narrowing", s, t,
|
|
441
|
+
const f = re(), [m, u] = S(!1), $ = d ? JSON.stringify(d) : "", { data: o, isFetching: _ } = k({
|
|
442
|
+
queryKey: ["picker-narrowing", s, t, $],
|
|
433
443
|
queryFn: () => f.request(
|
|
434
|
-
|
|
435
|
-
).then((
|
|
436
|
-
enabled: m ||
|
|
444
|
+
Ke("/picker-narrowing", { collection: s, search: t, filter: d ?? null })
|
|
445
|
+
).then((w) => w.data),
|
|
446
|
+
enabled: m || y,
|
|
437
447
|
staleTime: 3e4,
|
|
438
448
|
retry: !1
|
|
439
449
|
});
|
|
440
|
-
if (!m && !
|
|
450
|
+
if (!m && !y)
|
|
441
451
|
return /* @__PURE__ */ r(
|
|
442
452
|
"button",
|
|
443
453
|
{
|
|
444
454
|
type: "button",
|
|
445
|
-
onClick: (
|
|
446
|
-
|
|
455
|
+
onClick: (w) => {
|
|
456
|
+
w.stopPropagation(), u(!0);
|
|
447
457
|
},
|
|
448
458
|
className: "w-full border-t border-border px-3 py-1.5 text-left text-[11px] text-muted-foreground hover:text-foreground",
|
|
449
459
|
"data-picker-narrowing-ask": !0,
|
|
450
460
|
children: "Missing something?"
|
|
451
461
|
}
|
|
452
462
|
);
|
|
453
|
-
if (
|
|
463
|
+
if (_ && !o)
|
|
454
464
|
return /* @__PURE__ */ r("p", { className: "border-t border-border px-3 py-1.5 text-[11px] text-muted-foreground", children: "Checking what narrows this list…" });
|
|
455
465
|
if (!o) return null;
|
|
456
466
|
const l = [], p = t ? `match “${t}”` : "exist";
|
|
457
467
|
return o.by_field_filter > 0 && l.push(
|
|
458
|
-
`${o.by_field_filter.toLocaleString()} more ${p} but this field only offers ${
|
|
468
|
+
`${o.by_field_filter.toLocaleString()} more ${p} but this field only offers ${h.length ? `records that fit ${h.join(" · ")}` : "records its filter allows"}.`
|
|
459
469
|
), o.by_exclusions > 0 && l.push(
|
|
460
470
|
`${o.by_exclusions.toLocaleString()} ${o.by_exclusions === 1 ? "is" : "are"} hidden from pickers by an admin.`
|
|
461
471
|
), o.scopes.length > 0 && l.push(`Your ${o.scopes.join(", ")} access narrows what you can pick here.`), o.row_filter && l.push("Your role only sees some of these records."), l.length === 0 && l.push(
|
|
@@ -467,35 +477,35 @@ function Je({
|
|
|
467
477
|
"data-picker-narrowing": !0,
|
|
468
478
|
"data-picker-narrowing-field": o.by_field_filter,
|
|
469
479
|
"data-picker-narrowing-excluded": o.by_exclusions,
|
|
470
|
-
children: l.map((
|
|
480
|
+
children: l.map((w) => /* @__PURE__ */ r("p", { children: w }, w))
|
|
471
481
|
}
|
|
472
482
|
);
|
|
473
483
|
}
|
|
474
|
-
function
|
|
484
|
+
function ot({
|
|
475
485
|
collection: s,
|
|
476
486
|
id: t,
|
|
477
487
|
displayTemplate: d
|
|
478
488
|
}) {
|
|
479
|
-
const
|
|
489
|
+
const h = re(), y = Ne(), f = s === "nivaro_files" || s === "directus_files", m = (() => {
|
|
480
490
|
if (!d || !d.includes(".")) return null;
|
|
481
|
-
const o = [...d.matchAll(/\{\{([^}]+)\}\}/g)].map((
|
|
491
|
+
const o = [...d.matchAll(/\{\{([^}]+)\}\}/g)].map((_) => _[1].trim());
|
|
482
492
|
return o.length > 0 ? ["id", ...o].join(",") : null;
|
|
483
|
-
})(), { data: u, isLoading:
|
|
493
|
+
})(), { data: u, isLoading: $ } = k({
|
|
484
494
|
queryKey: ["relation-single", s, String(t), m ?? ""],
|
|
485
|
-
queryFn: () => f ?
|
|
495
|
+
queryFn: () => f ? h.request(F(`/files/${t}`)).then((o) => o.data) : y(s, t, m),
|
|
486
496
|
enabled: !!t && !!s,
|
|
487
497
|
staleTime: 6e4
|
|
488
498
|
});
|
|
489
|
-
if (
|
|
499
|
+
if ($) return /* @__PURE__ */ r(te, { className: "h-3 w-3 animate-spin text-slate-400" });
|
|
490
500
|
if (!u) return /* @__PURE__ */ r("span", { children: String(t ?? "") });
|
|
491
501
|
if (f) {
|
|
492
502
|
const o = u.title || u.filename_download || u.filename_disk || String(t);
|
|
493
503
|
return /* @__PURE__ */ r("span", { children: o });
|
|
494
504
|
}
|
|
495
|
-
return /* @__PURE__ */ r("span", { children:
|
|
505
|
+
return /* @__PURE__ */ r("span", { children: N(d, u) });
|
|
496
506
|
}
|
|
497
507
|
export {
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
508
|
+
ot as RelatedItemLabel,
|
|
509
|
+
Me as RelationCombobox,
|
|
510
|
+
Je as useStaleTip
|
|
501
511
|
};
|