@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,16 +1,21 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useQuery as
|
|
3
|
-
import { X as
|
|
4
|
-
import { useNivaroClient as
|
|
5
|
-
import { get as
|
|
6
|
-
import { cn as
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
|
|
1
|
+
import { jsxs as c, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { useQuery as j } from "@tanstack/react-query";
|
|
3
|
+
import { X as B } from "lucide-react";
|
|
4
|
+
import { useNivaroClient as E } from "../../../context.js";
|
|
5
|
+
import { get as W } from "../../../lib/commands.js";
|
|
6
|
+
import { cn as D, titleCase as G } from "../../../lib/utils.js";
|
|
7
|
+
import { FieldRuleWriter as Q } from "../ai-rules/FieldRuleWriter.js";
|
|
8
|
+
import { RuleWriter as H } from "../ai-rules/RuleWriter.js";
|
|
9
|
+
import { ValidationSuggest as X } from "../ai-rules/ValidationSuggest.js";
|
|
10
|
+
import { FieldDefaultValueControl as z } from "../editors/field-default-value.js";
|
|
11
|
+
import { RoleConditionRow as J, PipelineStateConditionRow as U } from "../editors/lock-conditions.js";
|
|
12
|
+
import { useLayoutEditorHost as Y } from "../host.js";
|
|
13
|
+
import { tintCard as Z } from "../panel-style.js";
|
|
14
|
+
import { RecommendedToggle as ee, ConfirmChangeSetting as te, RepeatLastToggle as le } from "./BehaviourSettings.js";
|
|
15
|
+
import { useFieldCtx as ie } from "./field-context.js";
|
|
16
|
+
import { Toggle as g, Setting as f, Segmented as oe, AddButton as ae, Section as R, TextInput as S, Choice as T } from "./kit.js";
|
|
17
|
+
import { lockConditionsOf as ne, layoutGrids as re, asObject as de, defaultValuesOf as se, withDefaultValue as ce, lockConditionsColumn as ue } from "./model.js";
|
|
18
|
+
const L = /* @__PURE__ */ new Set([
|
|
14
19
|
"inline-table",
|
|
15
20
|
"inline-grid",
|
|
16
21
|
"list-o2m",
|
|
@@ -20,64 +25,67 @@ const Y = /* @__PURE__ */ new Set([
|
|
|
20
25
|
"o2m",
|
|
21
26
|
"relation-path"
|
|
22
27
|
]);
|
|
23
|
-
function
|
|
24
|
-
const
|
|
25
|
-
return
|
|
28
|
+
function pe(a, i) {
|
|
29
|
+
const u = E();
|
|
30
|
+
return j({
|
|
26
31
|
queryKey: ["layout-editor", "field-rows", a, i ?? null],
|
|
27
|
-
queryFn: () =>
|
|
28
|
-
|
|
29
|
-
).then((
|
|
32
|
+
queryFn: () => u.request(
|
|
33
|
+
W(`/field-config/${a}`, i ? { layout_id: i } : void 0)
|
|
34
|
+
).then((m) => Array.isArray(m.data) ? m.data : []),
|
|
30
35
|
enabled: !!a,
|
|
31
36
|
staleTime: 6e4
|
|
32
37
|
});
|
|
33
38
|
}
|
|
34
|
-
function
|
|
35
|
-
const a =
|
|
36
|
-
|
|
39
|
+
function Se() {
|
|
40
|
+
const a = ie(), { info: i, ov: u, opts: m, env: s, row: p } = a, o = i.label, y = s.bundle.layout, v = p.field.startsWith("__") || i.isPath, b = ne(p), _ = (e, l) => a.setPlacement({ lock_conditions: ue(e) }, l), w = (e, l, n) => _(
|
|
41
|
+
b.map((d, h) => h === e ? { ...d, ...l } : d),
|
|
37
42
|
n
|
|
38
|
-
),
|
|
43
|
+
), x = re(s.bundle, a.globals, a.relations), M = !v && i.relKind !== "M2M" && i.relKind !== "O2M" && !L.has(i.iface ?? "") && x.length > 0, r = de(u.apply_to_lines), $ = x.find((e) => e.field === r.grid) ?? null, { data: K = [] } = pe(M ? $ == null ? void 0 : $.childCollection : null), P = K.filter(
|
|
39
44
|
(e) => e.field !== "id" && !e.field.startsWith("__") && !e.field.includes(".") && !["alias", "o2m", "m2m"].includes(e.type ?? "")
|
|
40
|
-
),
|
|
41
|
-
return /* @__PURE__ */
|
|
45
|
+
), N = (e, l) => a.setOverride("apply_to_lines", e ?? void 0, l), I = Y().isAdmin && !v && !i.relKind && !L.has(i.iface ?? "") && i.type !== "alias" && i.computedType !== "virtual", q = se(y), A = typeof m.max_values == "number" ? m.max_values : null;
|
|
46
|
+
return /* @__PURE__ */ c("div", { className: "space-y-5", children: [
|
|
42
47
|
/* @__PURE__ */ t(
|
|
43
|
-
|
|
48
|
+
g,
|
|
44
49
|
{
|
|
45
50
|
k: "field.required",
|
|
46
51
|
label: "Required",
|
|
47
52
|
effect: "The form will not save without a value.",
|
|
48
|
-
checked:
|
|
53
|
+
checked: u.required === !0,
|
|
49
54
|
onChange: (e) => a.setOverride(
|
|
50
55
|
"required",
|
|
51
56
|
e ? !0 : void 0,
|
|
52
|
-
e ? `Make ${
|
|
57
|
+
e ? `Make ${o} required` : `Make ${o} optional`
|
|
53
58
|
)
|
|
54
59
|
}
|
|
55
60
|
),
|
|
61
|
+
/* @__PURE__ */ t(ee, {}),
|
|
56
62
|
/* @__PURE__ */ t(
|
|
57
|
-
|
|
63
|
+
g,
|
|
58
64
|
{
|
|
59
65
|
k: "field.readonly",
|
|
60
66
|
label: "Read-only",
|
|
61
67
|
effect: "Shown but not editable on this form.",
|
|
62
|
-
checked:
|
|
68
|
+
checked: u.readonly === !0,
|
|
63
69
|
onChange: (e) => a.setOverride(
|
|
64
70
|
"readonly",
|
|
65
71
|
e ? !0 : void 0,
|
|
66
|
-
e ? `Make ${
|
|
72
|
+
e ? `Make ${o} read-only` : `Make ${o} editable`
|
|
67
73
|
)
|
|
68
74
|
}
|
|
69
75
|
),
|
|
76
|
+
/* @__PURE__ */ t(te, {}),
|
|
77
|
+
/* @__PURE__ */ t(le, {}),
|
|
70
78
|
(i.computedType === "rollup" || i.computedType === "write") && /* @__PURE__ */ t(
|
|
71
|
-
|
|
79
|
+
g,
|
|
72
80
|
{
|
|
73
81
|
k: "field.editable_computed",
|
|
74
82
|
label: "Allow manual entry",
|
|
75
83
|
effect: "Lets people type over the calculated value here; the next recalculation still overwrites it.",
|
|
76
|
-
checked:
|
|
84
|
+
checked: u.editable_computed === !0,
|
|
77
85
|
onChange: (e) => a.setOverride(
|
|
78
86
|
"editable_computed",
|
|
79
87
|
e ? !0 : void 0,
|
|
80
|
-
e ? `Allow typing into ${
|
|
88
|
+
e ? `Allow typing into ${o}` : `Keep ${o} calculated only`
|
|
81
89
|
)
|
|
82
90
|
}
|
|
83
91
|
),
|
|
@@ -87,26 +95,26 @@ function pe() {
|
|
|
87
95
|
k: "field.lock_conditions",
|
|
88
96
|
label: "Read-only when",
|
|
89
97
|
effect: "Locks the field while any of these holds. No conditions: always editable.",
|
|
90
|
-
children: /* @__PURE__ */
|
|
91
|
-
|
|
98
|
+
children: /* @__PURE__ */ c("div", { className: "space-y-2", children: [
|
|
99
|
+
b.map((e, l) => /* @__PURE__ */ c(
|
|
92
100
|
"div",
|
|
93
101
|
{
|
|
94
|
-
className:
|
|
102
|
+
className: D(Z, "space-y-3 p-3"),
|
|
95
103
|
children: [
|
|
96
|
-
/* @__PURE__ */
|
|
104
|
+
/* @__PURE__ */ c("div", { className: "flex items-center gap-1.5", children: [
|
|
97
105
|
/* @__PURE__ */ t("div", { className: "flex-1", "data-setting": "field.lock_conditions.type", children: /* @__PURE__ */ t(
|
|
98
|
-
|
|
106
|
+
oe,
|
|
99
107
|
{
|
|
100
108
|
value: e.type,
|
|
101
109
|
options: [
|
|
102
110
|
{ value: "pipeline_state", label: "Pipeline state" },
|
|
103
111
|
{ value: "role", label: "Role" }
|
|
104
112
|
],
|
|
105
|
-
onChange: (n) =>
|
|
106
|
-
|
|
107
|
-
(
|
|
113
|
+
onChange: (n) => _(
|
|
114
|
+
b.map(
|
|
115
|
+
(d, h) => h === l ? n === "role" ? { type: "role", role_ids: [] } : { type: "pipeline_state", state_keys: [] } : d
|
|
108
116
|
),
|
|
109
|
-
`Change a lock condition of ${
|
|
117
|
+
`Change a lock condition of ${o}`
|
|
110
118
|
)
|
|
111
119
|
}
|
|
112
120
|
) }),
|
|
@@ -115,82 +123,125 @@ function pe() {
|
|
|
115
123
|
{
|
|
116
124
|
type: "button",
|
|
117
125
|
"aria-label": "Remove condition",
|
|
118
|
-
onClick: () =>
|
|
119
|
-
|
|
120
|
-
`Remove a lock condition from ${
|
|
126
|
+
onClick: () => _(
|
|
127
|
+
b.filter((n, d) => d !== l),
|
|
128
|
+
`Remove a lock condition from ${o}`
|
|
121
129
|
),
|
|
122
130
|
"data-tip": "Remove condition",
|
|
123
131
|
className: "inline-flex h-7 w-7 shrink-0 items-center justify-center rounded text-slate-500 transition-colors hover:bg-slate-100 hover:text-red-600 dark:hover:bg-muted dark:hover:text-red-400",
|
|
124
|
-
children: /* @__PURE__ */ t(
|
|
132
|
+
children: /* @__PURE__ */ t(B, { className: "h-3.5 w-3.5" })
|
|
125
133
|
}
|
|
126
134
|
)
|
|
127
135
|
] }),
|
|
128
136
|
e.type === "role" ? /* @__PURE__ */ t("div", { "data-setting": "field.lock_conditions.role_ids", children: /* @__PURE__ */ t(
|
|
129
|
-
|
|
137
|
+
J,
|
|
130
138
|
{
|
|
131
139
|
roleIds: e.role_ids ?? [],
|
|
132
|
-
onRoleIdsChange: (n) =>
|
|
140
|
+
onRoleIdsChange: (n) => w(l, { role_ids: n }, `Change the roles that lock ${o}`)
|
|
133
141
|
}
|
|
134
142
|
) }) : /* @__PURE__ */ t(
|
|
135
|
-
|
|
143
|
+
U,
|
|
136
144
|
{
|
|
137
|
-
collection:
|
|
145
|
+
collection: s.collection,
|
|
138
146
|
pipelineId: e.pipeline_id,
|
|
139
147
|
stateKeys: e.state_keys ?? [],
|
|
140
|
-
onPipelineChange: (n) =>
|
|
141
|
-
|
|
148
|
+
onPipelineChange: (n) => w(
|
|
149
|
+
l,
|
|
142
150
|
{ pipeline_id: n, state_keys: [] },
|
|
143
|
-
`Change the pipeline that locks ${
|
|
151
|
+
`Change the pipeline that locks ${o}`
|
|
144
152
|
),
|
|
145
|
-
onStateKeysChange: (n) =>
|
|
153
|
+
onStateKeysChange: (n) => w(l, { state_keys: n }, `Change the states that lock ${o}`)
|
|
146
154
|
}
|
|
147
155
|
)
|
|
148
156
|
]
|
|
149
157
|
},
|
|
150
|
-
|
|
158
|
+
l
|
|
151
159
|
)),
|
|
152
|
-
/* @__PURE__ */
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
160
|
+
/* @__PURE__ */ c("div", { className: "flex flex-wrap items-center gap-1.5", children: [
|
|
161
|
+
/* @__PURE__ */ t(
|
|
162
|
+
ae,
|
|
163
|
+
{
|
|
164
|
+
onClick: () => _(
|
|
165
|
+
[...b, { type: "pipeline_state", state_keys: [] }],
|
|
166
|
+
`Add a lock condition to ${o}`
|
|
167
|
+
),
|
|
168
|
+
children: "+ Add condition"
|
|
169
|
+
}
|
|
170
|
+
),
|
|
171
|
+
!v && /* @__PURE__ */ t(
|
|
172
|
+
H,
|
|
173
|
+
{
|
|
174
|
+
layoutId: Number(y.id),
|
|
175
|
+
target: { kind: "lock", field: p.field },
|
|
176
|
+
bundle: s.bundle,
|
|
177
|
+
apply: (e, l) => s.apply(e, l),
|
|
178
|
+
disabled: a.readOnly
|
|
179
|
+
}
|
|
180
|
+
)
|
|
181
|
+
] })
|
|
162
182
|
] })
|
|
163
183
|
}
|
|
164
184
|
),
|
|
165
|
-
!
|
|
185
|
+
!v && i.relKind !== "O2M" && /* @__PURE__ */ c(
|
|
166
186
|
f,
|
|
167
187
|
{
|
|
168
188
|
k: "field.default_value",
|
|
169
189
|
label: "Default for new records",
|
|
170
190
|
effect: "Filled in when someone creates a record on this form.",
|
|
171
|
-
children:
|
|
172
|
-
|
|
191
|
+
children: [
|
|
192
|
+
/* @__PURE__ */ t("div", { onBlurCapture: () => s.flush(), children: /* @__PURE__ */ t(
|
|
193
|
+
z,
|
|
194
|
+
{
|
|
195
|
+
value: q[p.field],
|
|
196
|
+
onChange: (e, l) => s.apply(
|
|
197
|
+
[
|
|
198
|
+
{
|
|
199
|
+
op: "layout_update",
|
|
200
|
+
patch: { default_values: ce(y, p.field, e) }
|
|
201
|
+
}
|
|
202
|
+
],
|
|
203
|
+
{ label: `Change the default of ${o}`, text: l }
|
|
204
|
+
),
|
|
205
|
+
isM2O: i.relKind === "M2O",
|
|
206
|
+
isM2M: i.relKind === "M2M",
|
|
207
|
+
relatedCollection: i.relatedCollection,
|
|
208
|
+
settings: { options: a.globalOptions, interface: i.iface },
|
|
209
|
+
abstractType: i.type
|
|
210
|
+
}
|
|
211
|
+
) }),
|
|
212
|
+
/* @__PURE__ */ t("div", { className: "pt-1", children: /* @__PURE__ */ t(
|
|
213
|
+
Q,
|
|
214
|
+
{
|
|
215
|
+
layoutId: Number(y.id),
|
|
216
|
+
field: p.field,
|
|
217
|
+
disabled: a.readOnly
|
|
218
|
+
}
|
|
219
|
+
) })
|
|
220
|
+
]
|
|
221
|
+
}
|
|
222
|
+
),
|
|
223
|
+
I && /* @__PURE__ */ t(
|
|
224
|
+
f,
|
|
225
|
+
{
|
|
226
|
+
k: "field.validation_rules",
|
|
227
|
+
label: "Checks",
|
|
228
|
+
scope: "field",
|
|
229
|
+
effect: "Learned from the values stored today, each with how many existing values it would refuse.",
|
|
230
|
+
children: /* @__PURE__ */ t(
|
|
231
|
+
X,
|
|
173
232
|
{
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
],
|
|
182
|
-
{ label: `Change the default of ${l}`, text: o }
|
|
183
|
-
),
|
|
184
|
-
isM2O: i.relKind === "M2O",
|
|
185
|
-
isM2M: i.relKind === "M2M",
|
|
186
|
-
relatedCollection: i.relatedCollection,
|
|
187
|
-
settings: { options: a.globalOptions, interface: i.iface },
|
|
188
|
-
abstractType: i.type
|
|
233
|
+
layoutId: Number(y.id),
|
|
234
|
+
field: p.field,
|
|
235
|
+
disabled: a.readOnly,
|
|
236
|
+
onApply: (e, l, n) => a.proposeGlobal("field.validation_rules", e.length, n, (d) => {
|
|
237
|
+
const h = d.columns.validation_rules, O = Array.isArray(h) ? h : l, F = (k, C) => k.type === C.type && String(k.value ?? "") === String(C.value ?? ""), V = e.filter((k) => !O.some((C) => F(C, k)));
|
|
238
|
+
return { ...d, columns: { ...d.columns, validation_rules: [...O, ...V] } };
|
|
239
|
+
})
|
|
189
240
|
}
|
|
190
|
-
)
|
|
241
|
+
)
|
|
191
242
|
}
|
|
192
243
|
),
|
|
193
|
-
i.relKind === "M2M" && /* @__PURE__ */
|
|
244
|
+
i.relKind === "M2M" && /* @__PURE__ */ c(R, { title: "How many", children: [
|
|
194
245
|
/* @__PURE__ */ t(
|
|
195
246
|
f,
|
|
196
247
|
{
|
|
@@ -198,37 +249,37 @@ function pe() {
|
|
|
198
249
|
label: "Most values",
|
|
199
250
|
effect: "Empty: no limit. 1 makes it a single pick.",
|
|
200
251
|
children: /* @__PURE__ */ t(
|
|
201
|
-
|
|
252
|
+
S,
|
|
202
253
|
{
|
|
203
254
|
type: "number",
|
|
204
255
|
ariaLabel: "Most values",
|
|
205
|
-
value:
|
|
256
|
+
value: A == null ? "" : String(A),
|
|
206
257
|
placeholder: "No limit",
|
|
207
258
|
onChange: (e) => {
|
|
208
|
-
const
|
|
209
|
-
|
|
259
|
+
const l = e === "" ? void 0 : Math.max(1, Math.round(Number(e)));
|
|
260
|
+
l !== void 0 && Number.isNaN(l) || a.setOption("max_values", l, `Limit how many ${o} can be picked`, !0);
|
|
210
261
|
}
|
|
211
262
|
}
|
|
212
263
|
)
|
|
213
264
|
}
|
|
214
265
|
),
|
|
215
|
-
|
|
216
|
-
|
|
266
|
+
A != null && /* @__PURE__ */ t(
|
|
267
|
+
g,
|
|
217
268
|
{
|
|
218
269
|
k: "field.max_values_enforce_on_write",
|
|
219
270
|
label: "Refuse more on the server too",
|
|
220
271
|
effect: "Imports, the API and other forms cannot store more than the limit.",
|
|
221
272
|
enforced: !0,
|
|
222
|
-
checked:
|
|
273
|
+
checked: m.enforce_on_write === !0,
|
|
223
274
|
onChange: (e) => a.setOption(
|
|
224
275
|
"enforce_on_write",
|
|
225
276
|
e ? !0 : void 0,
|
|
226
|
-
e ? `Enforce the limit of ${
|
|
277
|
+
e ? `Enforce the limit of ${o} on the server` : `Stop enforcing the limit of ${o}`
|
|
227
278
|
)
|
|
228
279
|
}
|
|
229
280
|
)
|
|
230
281
|
] }),
|
|
231
|
-
|
|
282
|
+
M && /* @__PURE__ */ c(R, { title: "Apply to lines", children: [
|
|
232
283
|
/* @__PURE__ */ t("p", { className: "text-[12px] leading-snug text-slate-500 dark:text-muted-foreground", children: "A button beside the field copies its value into one column of every line of a grid." }),
|
|
233
284
|
/* @__PURE__ */ t(
|
|
234
285
|
f,
|
|
@@ -237,17 +288,17 @@ function pe() {
|
|
|
237
288
|
label: "Grid",
|
|
238
289
|
effect: "The grid whose lines get the value.",
|
|
239
290
|
children: /* @__PURE__ */ t(
|
|
240
|
-
|
|
291
|
+
T,
|
|
241
292
|
{
|
|
242
293
|
ariaLabel: "Grid",
|
|
243
294
|
value: r.grid ?? "",
|
|
244
295
|
options: [
|
|
245
296
|
{ value: "", label: "Off" },
|
|
246
|
-
...
|
|
297
|
+
...x.map((e) => ({ value: e.field, label: e.label }))
|
|
247
298
|
],
|
|
248
|
-
onChange: (e) =>
|
|
299
|
+
onChange: (e) => N(
|
|
249
300
|
e ? { grid: e, target: "", ...r.label ? { label: r.label } : {} } : null,
|
|
250
|
-
e ? `Copy ${
|
|
301
|
+
e ? `Copy ${o} into lines` : `Stop copying ${o} into lines`
|
|
251
302
|
)
|
|
252
303
|
}
|
|
253
304
|
)
|
|
@@ -260,16 +311,16 @@ function pe() {
|
|
|
260
311
|
label: "Column",
|
|
261
312
|
effect: "The column of each line that receives the value.",
|
|
262
313
|
children: /* @__PURE__ */ t(
|
|
263
|
-
|
|
314
|
+
T,
|
|
264
315
|
{
|
|
265
316
|
ariaLabel: "Column",
|
|
266
317
|
disabled: !r.grid,
|
|
267
318
|
value: r.target ?? "",
|
|
268
319
|
options: [
|
|
269
320
|
{ value: "", label: r.grid ? "Pick a column…" : "Pick a grid first" },
|
|
270
|
-
...
|
|
321
|
+
...P.map((e) => ({ value: e.field, label: e.label || G(e.field) }))
|
|
271
322
|
],
|
|
272
|
-
onChange: (e) =>
|
|
323
|
+
onChange: (e) => N({ ...r, target: e }, `Copy ${o} into a column`)
|
|
273
324
|
}
|
|
274
325
|
)
|
|
275
326
|
}
|
|
@@ -281,18 +332,18 @@ function pe() {
|
|
|
281
332
|
label: "Button label",
|
|
282
333
|
effect: "The words on the button.",
|
|
283
334
|
children: /* @__PURE__ */ t(
|
|
284
|
-
|
|
335
|
+
S,
|
|
285
336
|
{
|
|
286
337
|
ariaLabel: "Button label",
|
|
287
338
|
disabled: !r.grid,
|
|
288
339
|
value: r.label ?? "",
|
|
289
340
|
placeholder: "Apply to lines",
|
|
290
341
|
onChange: (e) => {
|
|
291
|
-
const { label:
|
|
342
|
+
const { label: l, ...n } = r;
|
|
292
343
|
a.setOverride(
|
|
293
344
|
"apply_to_lines",
|
|
294
345
|
e ? { ...n, label: e } : n,
|
|
295
|
-
`Rename the apply-to-lines button of ${
|
|
346
|
+
`Rename the apply-to-lines button of ${o}`,
|
|
296
347
|
!0
|
|
297
348
|
);
|
|
298
349
|
}
|
|
@@ -301,23 +352,23 @@ function pe() {
|
|
|
301
352
|
}
|
|
302
353
|
)
|
|
303
354
|
] }),
|
|
304
|
-
|
|
305
|
-
|
|
355
|
+
s.layoutType === "addendum" && /* @__PURE__ */ t(
|
|
356
|
+
g,
|
|
306
357
|
{
|
|
307
358
|
k: "field.prefill_from_parent",
|
|
308
359
|
label: "Prefill from the record",
|
|
309
360
|
effect: "A new addendum starts with the record's current value.",
|
|
310
|
-
checked:
|
|
361
|
+
checked: u.prefill_from_parent !== !1,
|
|
311
362
|
onChange: (e) => a.setOverride(
|
|
312
363
|
"prefill_from_parent",
|
|
313
364
|
e ? void 0 : !1,
|
|
314
|
-
e ? `Prefill ${
|
|
365
|
+
e ? `Prefill ${o} from the record` : `Start ${o} empty on addendums`
|
|
315
366
|
)
|
|
316
367
|
}
|
|
317
368
|
)
|
|
318
369
|
] });
|
|
319
370
|
}
|
|
320
371
|
export {
|
|
321
|
-
|
|
322
|
-
|
|
372
|
+
Se as RulesTab,
|
|
373
|
+
pe as useFieldRows
|
|
323
374
|
};
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import { jsx as s, jsxs as b } from "react/jsx-runtime";
|
|
2
|
+
import { readLayoutI18n as g, approveLayoutText as S, withLayoutText as k } from "../../../lib/layout-i18n.js";
|
|
3
|
+
import { titleCase as E } from "../../../lib/utils.js";
|
|
4
|
+
import { useTranslationSummary as C } from "../inspect/inspect-api.js";
|
|
5
|
+
import { effectText as w } from "../panel-style.js";
|
|
6
|
+
import { useFieldCtx as I } from "./field-context.js";
|
|
7
|
+
import { useInspectorEnv as j, Section as A, Setting as $, TextInput as T } from "./kit.js";
|
|
8
|
+
const l = (n) => n.toUpperCase();
|
|
9
|
+
function W() {
|
|
10
|
+
var N;
|
|
11
|
+
const n = I(), { info: c, ov: a, env: v } = n, { data: i } = C(v.collection), d = (i == null ? void 0 : i.locales) ?? [];
|
|
12
|
+
if (!d.length) return null;
|
|
13
|
+
const r = g(a.i18n), y = typeof a.label == "string" && a.label ? a.label : c.label, t = typeof a.note == "string" && a.note || ((N = c.global) == null ? void 0 : N.note) || "", p = d.reduce(
|
|
14
|
+
(e, o) => {
|
|
15
|
+
var f, m, u, L;
|
|
16
|
+
return e + ((f = r[o]) != null && f.label && !((m = r[o]) != null && m.draft) ? 0 : 1) + (t && !((u = r[o]) != null && u.help && !((L = r[o]) != null && L.draft)) ? 1 : 0);
|
|
17
|
+
},
|
|
18
|
+
0
|
|
19
|
+
), h = (e, o) => n.setOverride("i18n", e, o, !0), x = (e, o, f) => h(
|
|
20
|
+
k(g(a.i18n), e, o, f),
|
|
21
|
+
`Translate the ${o === "label" ? "label" : "help text"} of ${c.label} (${l(e)})`
|
|
22
|
+
);
|
|
23
|
+
return /* @__PURE__ */ b(
|
|
24
|
+
A,
|
|
25
|
+
{
|
|
26
|
+
title: p ? `Translations · ${p} missing` : "Translations",
|
|
27
|
+
collapsible: !0,
|
|
28
|
+
defaultOpen: !1,
|
|
29
|
+
children: [
|
|
30
|
+
/* @__PURE__ */ b("p", { className: w, children: [
|
|
31
|
+
"Shown to people reading in that language. Empty uses the text above (",
|
|
32
|
+
l((i == null ? void 0 : i.base) ?? "en"),
|
|
33
|
+
")."
|
|
34
|
+
] }),
|
|
35
|
+
d.map((e) => {
|
|
36
|
+
var o, f, m;
|
|
37
|
+
return /* @__PURE__ */ b("div", { "data-translation-locale": e, className: "space-y-3", children: [
|
|
38
|
+
((o = r[e]) == null ? void 0 : o.draft) && /* @__PURE__ */ s(
|
|
39
|
+
O,
|
|
40
|
+
{
|
|
41
|
+
locale: e,
|
|
42
|
+
onApprove: () => n.setOverride(
|
|
43
|
+
"i18n",
|
|
44
|
+
S(g(a.i18n), e),
|
|
45
|
+
`Approve the ${l(e)} translation of ${c.label}`
|
|
46
|
+
)
|
|
47
|
+
}
|
|
48
|
+
),
|
|
49
|
+
/* @__PURE__ */ s(
|
|
50
|
+
$,
|
|
51
|
+
{
|
|
52
|
+
k: "field.i18n.label",
|
|
53
|
+
label: `Label (${l(e)})`,
|
|
54
|
+
effect: `What this form calls the field in ${l(e)}.`,
|
|
55
|
+
children: /* @__PURE__ */ s(
|
|
56
|
+
T,
|
|
57
|
+
{
|
|
58
|
+
ariaLabel: `Label in ${l(e)}`,
|
|
59
|
+
value: ((f = r[e]) == null ? void 0 : f.label) ?? "",
|
|
60
|
+
placeholder: y,
|
|
61
|
+
onChange: (u) => x(e, "label", u)
|
|
62
|
+
}
|
|
63
|
+
)
|
|
64
|
+
}
|
|
65
|
+
),
|
|
66
|
+
/* @__PURE__ */ s(
|
|
67
|
+
$,
|
|
68
|
+
{
|
|
69
|
+
k: "field.i18n.help",
|
|
70
|
+
label: `Help text (${l(e)})`,
|
|
71
|
+
effect: t ? "The line of help under the field." : "Shown only once the field has help.",
|
|
72
|
+
children: /* @__PURE__ */ s(
|
|
73
|
+
T,
|
|
74
|
+
{
|
|
75
|
+
ariaLabel: `Help text in ${l(e)}`,
|
|
76
|
+
value: ((m = r[e]) == null ? void 0 : m.help) ?? "",
|
|
77
|
+
placeholder: t,
|
|
78
|
+
onChange: (u) => x(e, "help", u)
|
|
79
|
+
}
|
|
80
|
+
)
|
|
81
|
+
}
|
|
82
|
+
)
|
|
83
|
+
] }, e);
|
|
84
|
+
})
|
|
85
|
+
]
|
|
86
|
+
}
|
|
87
|
+
);
|
|
88
|
+
}
|
|
89
|
+
function q({ group: n }) {
|
|
90
|
+
const c = j(), { data: a } = C(c.collection), v = (a == null ? void 0 : a.locales) ?? [];
|
|
91
|
+
if (!v.length || !["section", "tab", "metadata"].includes(n.type)) return null;
|
|
92
|
+
const i = n.label || E(n.key);
|
|
93
|
+
if (!(a != null && a.groups_supported))
|
|
94
|
+
return /* @__PURE__ */ s("p", { "data-setting": "group.i18n", className: w, children: "Section names can be translated once the database is updated (migration 465)." });
|
|
95
|
+
const d = g(n.i18n), r = (t, p, h = !1) => c.apply(
|
|
96
|
+
[
|
|
97
|
+
{
|
|
98
|
+
op: "group_update",
|
|
99
|
+
key: n.key,
|
|
100
|
+
patch: { i18n: t ? JSON.stringify(t) : null }
|
|
101
|
+
}
|
|
102
|
+
],
|
|
103
|
+
h ? { label: `Approve the ${l(p)} name of ${i}` } : { label: `Translate the name of ${i} (${l(p)})`, text: !0 }
|
|
104
|
+
), y = (t, p) => r(k(g(n.i18n), t, "label", p), t);
|
|
105
|
+
return /* @__PURE__ */ s(A, { title: "Translations", collapsible: !0, defaultOpen: !1, children: v.map((t) => {
|
|
106
|
+
var p, h;
|
|
107
|
+
return /* @__PURE__ */ b("div", { className: "space-y-2", children: [
|
|
108
|
+
((p = d[t]) == null ? void 0 : p.draft) && /* @__PURE__ */ s(O, { locale: t, onApprove: () => r(S(d, t), t, !0) }),
|
|
109
|
+
/* @__PURE__ */ s(
|
|
110
|
+
$,
|
|
111
|
+
{
|
|
112
|
+
k: "group.i18n.label",
|
|
113
|
+
label: `Name (${l(t)})`,
|
|
114
|
+
effect: `The heading people reading in ${l(t)} see. Empty uses the name above.`,
|
|
115
|
+
children: /* @__PURE__ */ s(
|
|
116
|
+
T,
|
|
117
|
+
{
|
|
118
|
+
ariaLabel: `Name in ${l(t)}`,
|
|
119
|
+
value: ((h = d[t]) == null ? void 0 : h.label) ?? "",
|
|
120
|
+
placeholder: i,
|
|
121
|
+
onChange: (x) => y(t, x)
|
|
122
|
+
}
|
|
123
|
+
)
|
|
124
|
+
}
|
|
125
|
+
)
|
|
126
|
+
] }, t);
|
|
127
|
+
}) });
|
|
128
|
+
}
|
|
129
|
+
function O({ locale: n, onApprove: c }) {
|
|
130
|
+
return /* @__PURE__ */ b(
|
|
131
|
+
"p",
|
|
132
|
+
{
|
|
133
|
+
"data-translation-draft": n,
|
|
134
|
+
className: "flex flex-wrap items-center gap-x-2 text-[12px] leading-snug text-amber-700 dark:text-amber-300",
|
|
135
|
+
children: [
|
|
136
|
+
"Suggested ",
|
|
137
|
+
l(n),
|
|
138
|
+
" text, not shown on records yet.",
|
|
139
|
+
/* @__PURE__ */ s(
|
|
140
|
+
"button",
|
|
141
|
+
{
|
|
142
|
+
type: "button",
|
|
143
|
+
"data-approve-translation": n,
|
|
144
|
+
onClick: c,
|
|
145
|
+
className: "font-medium underline",
|
|
146
|
+
children: "Approve"
|
|
147
|
+
}
|
|
148
|
+
)
|
|
149
|
+
]
|
|
150
|
+
}
|
|
151
|
+
);
|
|
152
|
+
}
|
|
153
|
+
export {
|
|
154
|
+
W as FieldTranslations,
|
|
155
|
+
q as GroupTranslations
|
|
156
|
+
};
|