@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,39 +1,42 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useQuery as
|
|
3
|
-
import { useState as
|
|
4
|
-
import { useNivaroClient as
|
|
5
|
-
import { get as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
import { jsxs as p, Fragment as Y, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { useQuery as E } from "@tanstack/react-query";
|
|
3
|
+
import { useState as Z, useEffect as ee, useContext as le } from "react";
|
|
4
|
+
import { useNivaroClient as K } from "../../../context.js";
|
|
5
|
+
import { get as j } from "../../../lib/commands.js";
|
|
6
|
+
import { CascadeWriter as oe } from "../ai-rules/CascadeWriter.js";
|
|
7
|
+
import { CascadeFiltersEditor as te } from "../editors/cascade-filters.js";
|
|
8
|
+
import { editorQueryKeys as ie } from "../editors/editor-queries.js";
|
|
9
|
+
import { useFieldCtx as ne } from "./field-context.js";
|
|
10
|
+
import { useGlobalValue as b, GlobalWriterContext as ae, Toggle as g, Setting as m, TextInput as re, Section as $, Choice as x } from "./kit.js";
|
|
11
|
+
import { asObject as de, asArray as se, relKindOf as ce, describeField as fe, withKey as F } from "./model.js";
|
|
12
|
+
import { PickerMisses as pe } from "./PickerMisses.js";
|
|
13
|
+
import { PickerPreview as ue } from "./PickerPreview.js";
|
|
14
|
+
function he(l) {
|
|
15
|
+
const o = K();
|
|
16
|
+
return E({
|
|
17
|
+
queryKey: ie.relationsFor(l),
|
|
18
|
+
queryFn: () => o.request(j(`/data-model/relations/for/${l}`)).then((d) => Array.isArray(d.data) ? d.data : []),
|
|
16
19
|
enabled: !!l,
|
|
17
20
|
staleTime: 5 * 6e4
|
|
18
21
|
});
|
|
19
22
|
}
|
|
20
|
-
function
|
|
21
|
-
const o =
|
|
22
|
-
return
|
|
23
|
+
function ge(l) {
|
|
24
|
+
const o = K();
|
|
25
|
+
return E({
|
|
23
26
|
queryKey: ["layout-editor", "layouts-of", l],
|
|
24
27
|
queryFn: () => o.request(
|
|
25
|
-
|
|
26
|
-
).then((
|
|
28
|
+
j("/collection-layouts", { collection: l })
|
|
29
|
+
).then((d) => Array.isArray(d.data) ? d.data : []),
|
|
27
30
|
enabled: !!l,
|
|
28
31
|
staleTime: 6e4
|
|
29
32
|
});
|
|
30
33
|
}
|
|
31
|
-
function
|
|
34
|
+
function S(l) {
|
|
32
35
|
const o = l.trim();
|
|
33
36
|
if (!o) return null;
|
|
34
|
-
const
|
|
35
|
-
if (
|
|
36
|
-
const a = Number(
|
|
37
|
+
const d = /^(\d{1,3})%$/.exec(o);
|
|
38
|
+
if (d) {
|
|
39
|
+
const a = Number(d[1]);
|
|
37
40
|
return a >= 10 && a <= 96 ? `${a}%` : "invalid";
|
|
38
41
|
}
|
|
39
42
|
if (/^\d+$/.test(o)) {
|
|
@@ -42,38 +45,38 @@ function x(l) {
|
|
|
42
45
|
}
|
|
43
46
|
return "invalid";
|
|
44
47
|
}
|
|
45
|
-
function
|
|
46
|
-
var
|
|
47
|
-
const l =
|
|
48
|
-
|
|
48
|
+
function Ne() {
|
|
49
|
+
var L;
|
|
50
|
+
const l = ne(), { info: o, ov: d, opts: a, env: s, globalOptions: r, globalDependency: q } = l, n = o.label, c = o.relKind === "M2O", u = o.relKind === "M2M", _ = o.iface === "relation-path" || o.isPath, N = o.iface === "file-image" || o.iface === "files-m2m", P = o.iface === "relation-grouped", h = de(d.drilldown), y = h.enabled ?? _, W = o.relatedCollection ?? (typeof r.path_target_collection == "string" ? r.path_target_collection : null), { data: D = [] } = ge(c || u || _ ? W : null), I = D.filter((e) => e.layout_type === "detail"), w = h.width == null ? "" : String(h.width), [G, T] = Z(w);
|
|
51
|
+
ee(() => {
|
|
49
52
|
T((e) => {
|
|
50
|
-
const
|
|
51
|
-
return (
|
|
53
|
+
const i = S(e);
|
|
54
|
+
return (i === null ? "" : String(i)) === w ? e : w;
|
|
52
55
|
});
|
|
53
|
-
}, [
|
|
54
|
-
const
|
|
56
|
+
}, [w]);
|
|
57
|
+
const R = S(G), k = (e, i, f) => l.setOverride("drilldown", { ...h, enabled: y, ...e }, i, f), { data: Q = [] } = he(P ? o.relatedCollection : null), A = Q.filter(
|
|
55
58
|
(e) => e.many_collection === o.relatedCollection && e.many_field && !e.junction_field
|
|
56
|
-
).map((e) => ({ value: e.many_field, label: `${e.many_field} → ${e.one_collection}` })),
|
|
59
|
+
).map((e) => ({ value: e.many_field, label: `${e.many_field} → ${e.one_collection}` })), B = b(
|
|
57
60
|
"field.group_field",
|
|
58
|
-
typeof
|
|
59
|
-
),
|
|
61
|
+
typeof r.group_field == "string" ? r.group_field : ""
|
|
62
|
+
), U = b(
|
|
60
63
|
"field.option_field",
|
|
61
|
-
typeof
|
|
62
|
-
),
|
|
64
|
+
typeof r.option_field == "string" ? r.option_field : ""
|
|
65
|
+
), V = (L = le(ae)) == null ? void 0 : L.draft.dependency_config, v = se((V ?? q).cascade_filters), C = new Set(l.globals.map((e) => e.field));
|
|
63
66
|
for (const e of l.relations)
|
|
64
|
-
e.one_field && e.one_field !== "id" && e.one_collection ===
|
|
65
|
-
const
|
|
66
|
-
const
|
|
67
|
+
e.one_field && e.one_field !== "id" && e.one_collection === s.collection && C.add(e.one_field), e.many_field && e.many_collection === s.collection && C.add(e.many_field);
|
|
68
|
+
const M = [...C].filter((e) => e !== o.field).map((e) => ({ f: e, kind: ce(e, l.relations) })).filter((e) => e.kind === "M2O" || e.kind === "M2M").map(({ f: e, kind: i }) => {
|
|
69
|
+
const f = s.bundle.placements.find((X) => X.field === e) ?? null;
|
|
67
70
|
return {
|
|
68
71
|
field: e,
|
|
69
|
-
label:
|
|
70
|
-
kind:
|
|
72
|
+
label: fe(e, l.globals, l.relations, f).label,
|
|
73
|
+
kind: i
|
|
71
74
|
};
|
|
72
|
-
}).sort((e,
|
|
73
|
-
return /* @__PURE__ */
|
|
74
|
-
(c ||
|
|
75
|
+
}).sort((e, i) => e.label.localeCompare(i.label)), O = (e, i) => typeof r[e] == "boolean" ? r[e] : i, z = b("field.allow_upload", O("allow_upload", !0)), H = b("field.allow_pick", O("allow_pick", !0)), J = b("field.pending_save", O("pending_save", !1));
|
|
76
|
+
return /* @__PURE__ */ p("div", { className: "space-y-5", children: [
|
|
77
|
+
(c || u) && /* @__PURE__ */ p(Y, { children: [
|
|
75
78
|
/* @__PURE__ */ t(
|
|
76
|
-
|
|
79
|
+
g,
|
|
77
80
|
{
|
|
78
81
|
k: "field.inline_relation",
|
|
79
82
|
label: "Edit the related record here",
|
|
@@ -82,18 +85,18 @@ function Ce() {
|
|
|
82
85
|
onChange: (e) => l.setOption(
|
|
83
86
|
"inline_relation",
|
|
84
87
|
e ? !0 : void 0,
|
|
85
|
-
e ? `Edit ${
|
|
88
|
+
e ? `Edit ${n} inline` : `Stop editing ${n} inline`
|
|
86
89
|
)
|
|
87
90
|
}
|
|
88
91
|
),
|
|
89
92
|
/* @__PURE__ */ t(
|
|
90
|
-
|
|
93
|
+
m,
|
|
91
94
|
{
|
|
92
95
|
k: "field.option_sort",
|
|
93
96
|
label: "Order of the options",
|
|
94
97
|
effect: 'Columns of the related record, "-" for descending; "label" sorts by what people read.',
|
|
95
98
|
children: /* @__PURE__ */ t(
|
|
96
|
-
|
|
99
|
+
re,
|
|
97
100
|
{
|
|
98
101
|
ariaLabel: "Order of the options",
|
|
99
102
|
mono: !0,
|
|
@@ -102,7 +105,7 @@ function Ce() {
|
|
|
102
105
|
onChange: (e) => l.setOption(
|
|
103
106
|
"option_sort",
|
|
104
107
|
e.trim() ? e : void 0,
|
|
105
|
-
`Change the order of ${
|
|
108
|
+
`Change the order of ${n} options`,
|
|
106
109
|
!0
|
|
107
110
|
)
|
|
108
111
|
}
|
|
@@ -111,7 +114,7 @@ function Ce() {
|
|
|
111
114
|
)
|
|
112
115
|
] }),
|
|
113
116
|
c && /* @__PURE__ */ t(
|
|
114
|
-
|
|
117
|
+
g,
|
|
115
118
|
{
|
|
116
119
|
k: "field.enforce_picker_rules",
|
|
117
120
|
label: "Refuse values the picker would not offer",
|
|
@@ -121,47 +124,49 @@ function Ce() {
|
|
|
121
124
|
onChange: (e) => l.setOption(
|
|
122
125
|
"enforce_picker_rules",
|
|
123
126
|
e ? !0 : void 0,
|
|
124
|
-
e ? `Enforce the picker rules of ${
|
|
127
|
+
e ? `Enforce the picker rules of ${n}` : `Stop enforcing the picker rules of ${n}`
|
|
125
128
|
)
|
|
126
129
|
}
|
|
127
130
|
),
|
|
128
|
-
(c ||
|
|
131
|
+
(c || u) && o.iface !== "files-m2m" && /* @__PURE__ */ t(ue, { rules: v }),
|
|
132
|
+
c && s.layoutType === "grouped" && Number(s.bundle.layout.id) > 0 && /* @__PURE__ */ t(pe, { layoutId: Number(s.bundle.layout.id), field: o.field }),
|
|
133
|
+
(c || u || _) && /* @__PURE__ */ p($, { title: "Detail panel", children: [
|
|
129
134
|
/* @__PURE__ */ t(
|
|
130
|
-
|
|
135
|
+
g,
|
|
131
136
|
{
|
|
132
137
|
k: "field.drilldown.enabled",
|
|
133
138
|
label: "Click the value to open it",
|
|
134
139
|
effect: "Opens the related record in a side panel.",
|
|
135
|
-
checked:
|
|
140
|
+
checked: y,
|
|
136
141
|
onChange: (e) => k(
|
|
137
142
|
{ enabled: e },
|
|
138
|
-
e ? `Open ${
|
|
143
|
+
e ? `Open ${n} in a panel` : `Stop opening ${n} in a panel`
|
|
139
144
|
)
|
|
140
145
|
}
|
|
141
146
|
),
|
|
142
147
|
/* @__PURE__ */ t(
|
|
143
|
-
|
|
148
|
+
m,
|
|
144
149
|
{
|
|
145
150
|
k: "field.drilldown.layout_id",
|
|
146
151
|
label: "Panel layout",
|
|
147
152
|
effect: "The layout the side panel shows the record with.",
|
|
148
153
|
children: /* @__PURE__ */ t(
|
|
149
|
-
|
|
154
|
+
x,
|
|
150
155
|
{
|
|
151
156
|
ariaLabel: "Panel layout",
|
|
152
|
-
disabled: !
|
|
153
|
-
value:
|
|
157
|
+
disabled: !y,
|
|
158
|
+
value: h.layout_id == null ? "" : String(h.layout_id),
|
|
154
159
|
options: [
|
|
155
160
|
{ value: "", label: "The default detail view" },
|
|
156
|
-
...
|
|
161
|
+
...I.map((e) => ({ value: String(e.id), label: e.name }))
|
|
157
162
|
],
|
|
158
|
-
onChange: (e) => k({ layout_id: e ? Number(e) : null }, `Change the panel layout of ${
|
|
163
|
+
onChange: (e) => k({ layout_id: e ? Number(e) : null }, `Change the panel layout of ${n}`)
|
|
159
164
|
}
|
|
160
165
|
)
|
|
161
166
|
}
|
|
162
167
|
),
|
|
163
|
-
/* @__PURE__ */
|
|
164
|
-
|
|
168
|
+
/* @__PURE__ */ p(
|
|
169
|
+
m,
|
|
165
170
|
{
|
|
166
171
|
k: "field.drilldown.width",
|
|
167
172
|
label: "Panel width",
|
|
@@ -171,42 +176,42 @@ function Ce() {
|
|
|
171
176
|
"input",
|
|
172
177
|
{
|
|
173
178
|
"aria-label": "Panel width",
|
|
174
|
-
disabled: !
|
|
179
|
+
disabled: !y,
|
|
175
180
|
value: G,
|
|
176
181
|
placeholder: "60%",
|
|
177
182
|
onChange: (e) => {
|
|
178
183
|
T(e.target.value);
|
|
179
|
-
const
|
|
180
|
-
|
|
184
|
+
const i = S(e.target.value);
|
|
185
|
+
i !== "invalid" && k({ width: i }, `Change the panel width of ${n}`, !0);
|
|
181
186
|
},
|
|
182
|
-
onBlur: () =>
|
|
187
|
+
onBlur: () => s.flush(),
|
|
183
188
|
className: "h-7 w-full rounded-md border border-slate-200 bg-white px-2 font-mono text-[12px] focus:border-nvr-cyan focus:outline-none disabled:opacity-40 dark:border-border dark:bg-card"
|
|
184
189
|
}
|
|
185
190
|
),
|
|
186
|
-
|
|
191
|
+
R === "invalid" && /* @__PURE__ */ t("p", { className: "text-[11px] text-red-600 dark:text-red-400", children: "Not a width — nothing saved" })
|
|
187
192
|
]
|
|
188
193
|
}
|
|
189
194
|
)
|
|
190
195
|
] }),
|
|
191
|
-
|
|
196
|
+
P && /* @__PURE__ */ p($, { title: "Grouped list", children: [
|
|
192
197
|
/* @__PURE__ */ t(
|
|
193
|
-
|
|
198
|
+
m,
|
|
194
199
|
{
|
|
195
200
|
k: "field.group_field",
|
|
196
201
|
label: "Group options by",
|
|
197
202
|
scope: "field",
|
|
198
203
|
effect: "A field of the related record whose value heads each group.",
|
|
199
204
|
children: /* @__PURE__ */ t(
|
|
200
|
-
|
|
205
|
+
x,
|
|
201
206
|
{
|
|
202
207
|
ariaLabel: "Group options by",
|
|
203
|
-
value:
|
|
204
|
-
options: [{ value: "", label: "Not grouped" }, ...
|
|
208
|
+
value: B,
|
|
209
|
+
options: [{ value: "", label: "Not grouped" }, ...A],
|
|
205
210
|
onChange: (e) => l.proposeGlobalOption(
|
|
206
211
|
"field.group_field",
|
|
207
212
|
"group_field",
|
|
208
213
|
e || void 0,
|
|
209
|
-
`Group the ${
|
|
214
|
+
`Group the ${n} options`,
|
|
210
215
|
e
|
|
211
216
|
)
|
|
212
217
|
}
|
|
@@ -214,23 +219,23 @@ function Ce() {
|
|
|
214
219
|
}
|
|
215
220
|
),
|
|
216
221
|
/* @__PURE__ */ t(
|
|
217
|
-
|
|
222
|
+
m,
|
|
218
223
|
{
|
|
219
224
|
k: "field.option_field",
|
|
220
225
|
label: "Option field",
|
|
221
226
|
scope: "field",
|
|
222
227
|
effect: "The field whose records are the options inside each group.",
|
|
223
228
|
children: /* @__PURE__ */ t(
|
|
224
|
-
|
|
229
|
+
x,
|
|
225
230
|
{
|
|
226
231
|
ariaLabel: "Option field",
|
|
227
|
-
value:
|
|
228
|
-
options: [{ value: "", label: "The related record itself" }, ...
|
|
232
|
+
value: U,
|
|
233
|
+
options: [{ value: "", label: "The related record itself" }, ...A],
|
|
229
234
|
onChange: (e) => l.proposeGlobalOption(
|
|
230
235
|
"field.option_field",
|
|
231
236
|
"option_field",
|
|
232
237
|
e || void 0,
|
|
233
|
-
`Change the ${
|
|
238
|
+
`Change the ${n} options`,
|
|
234
239
|
e
|
|
235
240
|
)
|
|
236
241
|
}
|
|
@@ -238,96 +243,119 @@ function Ce() {
|
|
|
238
243
|
}
|
|
239
244
|
)
|
|
240
245
|
] }),
|
|
241
|
-
(c ||
|
|
242
|
-
|
|
246
|
+
(c || u) && /* @__PURE__ */ p(
|
|
247
|
+
m,
|
|
243
248
|
{
|
|
244
249
|
k: "field.cascade_filters",
|
|
245
250
|
label: "Narrow the options by another field",
|
|
246
251
|
scope: "field",
|
|
247
252
|
effect: "Only options matching the value picked in a parent field are offered.",
|
|
248
|
-
children:
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
253
|
+
children: [
|
|
254
|
+
/* @__PURE__ */ t(
|
|
255
|
+
te,
|
|
256
|
+
{
|
|
257
|
+
rules: v,
|
|
258
|
+
m2oFields: M,
|
|
259
|
+
relatedCollection: o.relatedCollection,
|
|
260
|
+
onChange: (e) => l.proposeGlobal(
|
|
261
|
+
"field.cascade_filters",
|
|
262
|
+
e,
|
|
263
|
+
`Change how ${n} options are narrowed`,
|
|
264
|
+
(i) => ({
|
|
265
|
+
...i,
|
|
266
|
+
dependency_config: F(
|
|
267
|
+
i.dependency_config,
|
|
268
|
+
"cascade_filters",
|
|
269
|
+
e.length ? e : void 0
|
|
270
|
+
) ?? {}
|
|
271
|
+
})
|
|
272
|
+
)
|
|
273
|
+
}
|
|
274
|
+
),
|
|
275
|
+
/* @__PURE__ */ t(
|
|
276
|
+
oe,
|
|
277
|
+
{
|
|
278
|
+
layoutId: Number(s.bundle.layout.id),
|
|
279
|
+
collection: s.collection,
|
|
280
|
+
field: o.field,
|
|
281
|
+
rules: v,
|
|
282
|
+
currentOptionFilter: r.option_filter && typeof r.option_filter == "object" && !Array.isArray(r.option_filter) ? r.option_filter : null,
|
|
283
|
+
parentFields: M.filter((e) => e.kind === "M2O").map((e) => e.field),
|
|
284
|
+
disabled: l.readOnly,
|
|
285
|
+
onApply: (e, i) => l.proposeGlobal("field.cascade_filters", e.rules, i, (f) => ({
|
|
286
|
+
...f,
|
|
287
|
+
dependency_config: F(
|
|
288
|
+
f.dependency_config,
|
|
262
289
|
"cascade_filters",
|
|
263
|
-
e.length ? e : void 0
|
|
264
|
-
) ?? {}
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
290
|
+
e.rules.length ? e.rules : void 0
|
|
291
|
+
) ?? {},
|
|
292
|
+
options: F(f.options, "option_filter", e.optionFilter ?? void 0) ?? {}
|
|
293
|
+
}))
|
|
294
|
+
}
|
|
295
|
+
)
|
|
296
|
+
]
|
|
269
297
|
}
|
|
270
298
|
),
|
|
271
|
-
|
|
299
|
+
N && /* @__PURE__ */ p($, { title: "Files", children: [
|
|
272
300
|
/* @__PURE__ */ t(
|
|
273
|
-
|
|
301
|
+
g,
|
|
274
302
|
{
|
|
275
303
|
k: "field.allow_upload",
|
|
276
304
|
label: "Allow uploads",
|
|
277
305
|
effect: "People can upload new files into this field.",
|
|
278
306
|
scope: "field",
|
|
279
|
-
checked:
|
|
307
|
+
checked: z,
|
|
280
308
|
onChange: (e) => l.proposeGlobalOption(
|
|
281
309
|
"field.allow_upload",
|
|
282
310
|
"allow_upload",
|
|
283
311
|
e,
|
|
284
|
-
e ? `Allow uploads to ${
|
|
312
|
+
e ? `Allow uploads to ${n}` : `Stop uploads to ${n}`
|
|
285
313
|
)
|
|
286
314
|
}
|
|
287
315
|
),
|
|
288
316
|
/* @__PURE__ */ t(
|
|
289
|
-
|
|
317
|
+
g,
|
|
290
318
|
{
|
|
291
319
|
k: "field.allow_pick",
|
|
292
320
|
label: "Allow picking existing files",
|
|
293
321
|
effect: "People can attach files that are already stored.",
|
|
294
322
|
scope: "field",
|
|
295
|
-
checked:
|
|
323
|
+
checked: H,
|
|
296
324
|
onChange: (e) => l.proposeGlobalOption(
|
|
297
325
|
"field.allow_pick",
|
|
298
326
|
"allow_pick",
|
|
299
327
|
e,
|
|
300
|
-
`Change file picking for ${
|
|
328
|
+
`Change file picking for ${n}`
|
|
301
329
|
)
|
|
302
330
|
}
|
|
303
331
|
),
|
|
304
332
|
o.iface === "files-m2m" && /* @__PURE__ */ t(
|
|
305
|
-
|
|
333
|
+
g,
|
|
306
334
|
{
|
|
307
335
|
k: "field.pending_save",
|
|
308
336
|
label: "Save files with the form",
|
|
309
337
|
scope: "field",
|
|
310
338
|
effect: "Links wait for the record’s Save instead of saving at once.",
|
|
311
|
-
checked:
|
|
339
|
+
checked: J,
|
|
312
340
|
onChange: (e) => l.proposeGlobalOption(
|
|
313
341
|
"field.pending_save",
|
|
314
342
|
"pending_save",
|
|
315
343
|
e || void 0,
|
|
316
|
-
`Change when ${
|
|
344
|
+
`Change when ${n} files save`,
|
|
317
345
|
e
|
|
318
346
|
)
|
|
319
347
|
}
|
|
320
348
|
)
|
|
321
349
|
] }),
|
|
322
|
-
!(c ||
|
|
323
|
-
|
|
350
|
+
!(c || u || _ || N) && /* @__PURE__ */ p("p", { className: "text-[12px] text-muted-foreground", children: [
|
|
351
|
+
n,
|
|
324
352
|
" is not a picker. Nothing to set here."
|
|
325
353
|
] })
|
|
326
354
|
] });
|
|
327
355
|
}
|
|
328
356
|
export {
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
357
|
+
Ne as PickerTab,
|
|
358
|
+
S as parsePanelWidth,
|
|
359
|
+
ge as useLayoutsOf,
|
|
360
|
+
he as useRelationsFor
|
|
333
361
|
};
|