@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,47 +1,127 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useQuery as
|
|
3
|
-
import { ExternalLink as
|
|
4
|
-
import { useState as
|
|
5
|
-
import { useNivaroClient as
|
|
6
|
-
import { get as
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
1
|
+
import { jsxs as h, Fragment as S, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { useQuery as L } from "@tanstack/react-query";
|
|
3
|
+
import { ExternalLink as T } from "lucide-react";
|
|
4
|
+
import { useState as _, useRef as I, useEffect as b, useMemo as A } from "react";
|
|
5
|
+
import { useNivaroClient as R } from "../../../context.js";
|
|
6
|
+
import { get as E } from "../../../lib/commands.js";
|
|
7
|
+
import { applyLayoutOps as O } from "../../../lib/layout-ops.js";
|
|
8
|
+
import { cn as g } from "../../../lib/utils.js";
|
|
9
|
+
import { AiTextTools as P } from "../ai-text/AiTextTools.js";
|
|
10
|
+
import { HistoryPanel as F } from "../HistoryPanel.js";
|
|
11
|
+
import { useLayoutEditorHost as N } from "../host.js";
|
|
12
|
+
import { LayoutOpsBlocks as q } from "../ops/LayoutOpsBlocks.js";
|
|
13
|
+
import { useRoleNames as H } from "../overview/overview-api.js";
|
|
14
|
+
import { tintCard as j, labelText as B } from "../panel-style.js";
|
|
15
|
+
import { RelationPicker as D } from "../pickers/relation-picker.js";
|
|
16
|
+
import { CostLimitSetting as U } from "../testing/CostLimitSetting.js";
|
|
17
|
+
import { humanizeOpError as z } from "../useLayoutDraft.js";
|
|
18
|
+
import { Setting as y, smallBtn as C, quietText as f, PickList as w, useSettingVisible as v, Segmented as M } from "./controls.js";
|
|
19
|
+
import { FreezeSetting as W } from "./ResolveSettings.js";
|
|
20
|
+
import { useRolePreview as G } from "./settings-api.js";
|
|
21
|
+
import { settingDef as k } from "./settings-registry.js";
|
|
22
|
+
function xe(e) {
|
|
23
|
+
const i = Number(e.layout.id);
|
|
24
|
+
return /* @__PURE__ */ h(S, { children: [
|
|
25
|
+
/* @__PURE__ */ t(J, { ...e }),
|
|
26
|
+
/* @__PURE__ */ t(Y, { ...e }),
|
|
27
|
+
/* @__PURE__ */ t(x, { k: "tool.describe", layoutId: i }),
|
|
28
|
+
/* @__PURE__ */ t(x, { k: "tool.ai_review", layoutId: i, bundle: e.bundle, apply: e.apply }),
|
|
29
|
+
/* @__PURE__ */ t(Z, { ...e }),
|
|
30
|
+
/* @__PURE__ */ t(U, { ...e }),
|
|
31
|
+
/* @__PURE__ */ t(ee, { layoutId: i }),
|
|
32
|
+
/* @__PURE__ */ t(Q, { ...e }),
|
|
33
|
+
/* @__PURE__ */ t(V, { ...e }),
|
|
34
|
+
/* @__PURE__ */ t(W, { ...e }),
|
|
35
|
+
/* @__PURE__ */ t(te, { layoutId: i }),
|
|
36
|
+
/* @__PURE__ */ t(
|
|
37
|
+
q,
|
|
38
|
+
{
|
|
39
|
+
collection: e.collection,
|
|
40
|
+
layoutId: i,
|
|
41
|
+
name: String(e.layout.name ?? "")
|
|
42
|
+
}
|
|
43
|
+
)
|
|
25
44
|
] });
|
|
26
45
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
46
|
+
const K = {
|
|
47
|
+
off: "Turn off Ask why on every save",
|
|
48
|
+
note: "Ask for a reason on every save",
|
|
49
|
+
note_ticket: "Ask for a reason and a ticket on every save"
|
|
50
|
+
};
|
|
51
|
+
function Q({ layout: e, set: i }) {
|
|
52
|
+
const a = e.change_note, r = a === "note" || a === "note_ticket" ? a : "off";
|
|
53
|
+
return /* @__PURE__ */ t(
|
|
54
|
+
y,
|
|
55
|
+
{
|
|
56
|
+
k: "layout.change_note",
|
|
57
|
+
control: /* @__PURE__ */ t(
|
|
58
|
+
M,
|
|
59
|
+
{
|
|
60
|
+
ariaLabel: "Ask why on every save",
|
|
61
|
+
value: r,
|
|
62
|
+
options: [
|
|
63
|
+
{ value: "off", label: "Off" },
|
|
64
|
+
{ value: "note", label: "Reason" },
|
|
65
|
+
{ value: "note_ticket", label: "Reason + ticket" }
|
|
66
|
+
],
|
|
67
|
+
onChange: (o) => i({ change_note: o === "off" ? null : o }, K[o])
|
|
68
|
+
}
|
|
69
|
+
),
|
|
70
|
+
note: r === "off" ? null : "Autosave stays off for this form: every save waits for its reason."
|
|
71
|
+
}
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
function V({ bundle: e, layout: i, set: a }) {
|
|
75
|
+
var c;
|
|
76
|
+
const r = A(
|
|
77
|
+
() => e.groups.filter(
|
|
78
|
+
(n) => n.parent_key === null && !n.key.startsWith("__") && (n.type === "section" || n.type === "container")
|
|
79
|
+
).sort((n, d) => n.sort - d.sort).map((n) => ({ value: n.key, label: n.label || n.key })),
|
|
80
|
+
[e.groups]
|
|
81
|
+
), o = typeof i.email_summary_group == "string" ? i.email_summary_group : null, s = (c = r.find((n) => n.value === o)) == null ? void 0 : c.label;
|
|
82
|
+
return /* @__PURE__ */ t(
|
|
83
|
+
y,
|
|
84
|
+
{
|
|
85
|
+
k: "layout.email_summary_group",
|
|
86
|
+
control: /* @__PURE__ */ t(
|
|
87
|
+
w,
|
|
88
|
+
{
|
|
89
|
+
ariaLabel: "Section for notification emails",
|
|
90
|
+
value: o,
|
|
91
|
+
options: o && !s ? [...r, { value: o, label: `Missing section (${o})` }] : r,
|
|
92
|
+
clearLabel: "None (header strip)",
|
|
93
|
+
placeholder: "None (header strip)",
|
|
94
|
+
emptyText: "This form has no sections yet",
|
|
95
|
+
onChange: (n) => {
|
|
96
|
+
var d;
|
|
97
|
+
return a(
|
|
98
|
+
{ email_summary_group: n },
|
|
99
|
+
n ? `Use ${((d = r.find((l) => l.value === n)) == null ? void 0 : d.label) ?? n} in emails` : "Use the header strip in emails"
|
|
100
|
+
);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
)
|
|
104
|
+
}
|
|
105
|
+
);
|
|
106
|
+
}
|
|
107
|
+
function J({ collection: e, layout: i }) {
|
|
108
|
+
const a = N(), [r, o] = _(null), s = i.slug ? String(i.slug) : null, c = r ? `${a.recordLink(e, r)}${s ? `?layout=${encodeURIComponent(s)}` : ""}` : null;
|
|
109
|
+
return /* @__PURE__ */ t(
|
|
30
110
|
y,
|
|
31
111
|
{
|
|
32
112
|
k: "tool.preview_record",
|
|
33
|
-
note:
|
|
34
|
-
children: /* @__PURE__ */
|
|
35
|
-
/* @__PURE__ */
|
|
36
|
-
|
|
113
|
+
note: s ? `The record opens pinned to this form (?layout=${s}).` : "Without a link name the record opens on whichever layout it resolves to.",
|
|
114
|
+
children: /* @__PURE__ */ h("div", { className: "flex flex-wrap items-center gap-1.5", children: [
|
|
115
|
+
/* @__PURE__ */ t("div", { className: "min-w-[180px] flex-1", children: /* @__PURE__ */ t(
|
|
116
|
+
D,
|
|
37
117
|
{
|
|
38
|
-
relatedCollection:
|
|
39
|
-
value:
|
|
40
|
-
onChange: (
|
|
118
|
+
relatedCollection: e,
|
|
119
|
+
value: r,
|
|
120
|
+
onChange: (n) => o(n == null || n === "" ? null : String(n)),
|
|
41
121
|
placeholder: "Pick a record…"
|
|
42
122
|
}
|
|
43
123
|
) }),
|
|
44
|
-
/* @__PURE__ */
|
|
124
|
+
/* @__PURE__ */ h(
|
|
45
125
|
"a",
|
|
46
126
|
{
|
|
47
127
|
href: c ?? void 0,
|
|
@@ -49,9 +129,9 @@ function H({ collection: t, layout: l }) {
|
|
|
49
129
|
rel: "noreferrer",
|
|
50
130
|
"aria-disabled": !c,
|
|
51
131
|
"data-layout-record-preview-open": !0,
|
|
52
|
-
className:
|
|
132
|
+
className: g(C, !c && "pointer-events-none opacity-40"),
|
|
53
133
|
children: [
|
|
54
|
-
/* @__PURE__ */
|
|
134
|
+
/* @__PURE__ */ t(T, { className: "h-3.5 w-3.5" }),
|
|
55
135
|
"Open in a new tab"
|
|
56
136
|
]
|
|
57
137
|
}
|
|
@@ -60,120 +140,150 @@ function H({ collection: t, layout: l }) {
|
|
|
60
140
|
}
|
|
61
141
|
);
|
|
62
142
|
}
|
|
63
|
-
function
|
|
64
|
-
var
|
|
65
|
-
if (
|
|
66
|
-
return `As ${
|
|
67
|
-
if (!
|
|
68
|
-
const
|
|
69
|
-
return
|
|
143
|
+
function X(e, i) {
|
|
144
|
+
var s;
|
|
145
|
+
if (e.role.admin_access)
|
|
146
|
+
return `As ${e.role.name}: admin — default layout, every field.`;
|
|
147
|
+
if (!e.can_read) return `As ${e.role.name}: cannot read ${i} at all.`;
|
|
148
|
+
const a = [`gets “${((s = e.layout) == null ? void 0 : s.name) ?? "no layout"}”`], r = e.hidden_fields.length, o = e.readonly_fields.length;
|
|
149
|
+
return r && a.push(`${r} field${r === 1 ? "" : "s"} hidden`), o && a.push(`${o} read-only`), e.can_update || a.push("cannot edit"), `As ${e.role.name}: ${a.join(" · ")}`;
|
|
70
150
|
}
|
|
71
|
-
function
|
|
72
|
-
collection:
|
|
73
|
-
onPreviewRole:
|
|
74
|
-
previewRoleId:
|
|
75
|
-
onPreviewRoleChange:
|
|
151
|
+
function Y({
|
|
152
|
+
collection: e,
|
|
153
|
+
onPreviewRole: i,
|
|
154
|
+
previewRoleId: a,
|
|
155
|
+
onPreviewRoleChange: r
|
|
76
156
|
}) {
|
|
77
|
-
const { data:
|
|
78
|
-
return
|
|
79
|
-
var
|
|
80
|
-
(
|
|
81
|
-
}, [
|
|
82
|
-
var
|
|
83
|
-
return (
|
|
84
|
-
}, []), /* @__PURE__ */
|
|
157
|
+
const { data: o = [] } = H(!0), [s, c] = _(null), n = r ? a ?? null : s, d = r ?? c, { data: l = null, isFetching: p } = G(e, n), m = I(i);
|
|
158
|
+
return m.current = i, b(() => {
|
|
159
|
+
var u;
|
|
160
|
+
(u = m.current) == null || u.call(m, n ? l : null);
|
|
161
|
+
}, [n, l]), b(() => () => {
|
|
162
|
+
var u;
|
|
163
|
+
return (u = m.current) == null ? void 0 : u.call(m, null);
|
|
164
|
+
}, []), /* @__PURE__ */ t(
|
|
85
165
|
y,
|
|
86
166
|
{
|
|
87
167
|
k: "tool.preview_as_role",
|
|
88
|
-
control: /* @__PURE__ */
|
|
89
|
-
|
|
168
|
+
control: /* @__PURE__ */ t(
|
|
169
|
+
w,
|
|
90
170
|
{
|
|
91
171
|
ariaLabel: "Preview as role",
|
|
92
|
-
value:
|
|
93
|
-
options: [...
|
|
172
|
+
value: n,
|
|
173
|
+
options: [...o].sort((u, $) => u.name.localeCompare($.name)).map((u) => ({ value: u.id, label: u.name })),
|
|
94
174
|
clearLabel: "Nobody (off)",
|
|
95
|
-
onChange:
|
|
175
|
+
onChange: d
|
|
96
176
|
}
|
|
97
177
|
),
|
|
98
|
-
children:
|
|
99
|
-
/* @__PURE__ */
|
|
178
|
+
children: n && /* @__PURE__ */ t("div", { "data-role-preview": !0, className: g(j, "p-3 text-[12px]"), children: p && !l ? /* @__PURE__ */ t("p", { className: f, children: "Checking…" }) : l ? /* @__PURE__ */ h(S, { children: [
|
|
179
|
+
/* @__PURE__ */ t(
|
|
100
180
|
"p",
|
|
101
181
|
{
|
|
102
|
-
className:
|
|
182
|
+
className: g(
|
|
103
183
|
"text-slate-700 dark:text-foreground",
|
|
104
|
-
!
|
|
184
|
+
!l.can_read && "text-[#9c2f47] dark:text-[#f08aa1]"
|
|
105
185
|
),
|
|
106
|
-
children:
|
|
186
|
+
children: X(l, e)
|
|
107
187
|
}
|
|
108
188
|
),
|
|
109
|
-
|
|
110
|
-
] }) : /* @__PURE__ */
|
|
189
|
+
l.note && /* @__PURE__ */ t("p", { className: g("mt-1", f), children: l.note })
|
|
190
|
+
] }) : /* @__PURE__ */ t("p", { className: f, children: "Could not preview this role." }) })
|
|
111
191
|
}
|
|
112
192
|
);
|
|
113
193
|
}
|
|
114
|
-
function
|
|
115
|
-
|
|
116
|
-
|
|
194
|
+
function x({
|
|
195
|
+
k: e,
|
|
196
|
+
layoutId: i,
|
|
197
|
+
bundle: a,
|
|
198
|
+
apply: r
|
|
199
|
+
}) {
|
|
200
|
+
var n, d;
|
|
201
|
+
const o = N(), s = A(
|
|
202
|
+
() => a && r ? {
|
|
203
|
+
bundle: a,
|
|
204
|
+
apply: r,
|
|
205
|
+
check: (l) => {
|
|
206
|
+
try {
|
|
207
|
+
return O(a, l), null;
|
|
208
|
+
} catch (p) {
|
|
209
|
+
return z(p instanceof Error ? p.message : String(p));
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
} : void 0,
|
|
213
|
+
[a, r]
|
|
214
|
+
), c = e === "tool.ai_review" ? (n = o.aiReviewSlot) == null ? void 0 : n.call(o, i, s) : (d = o.explainSlot) == null ? void 0 : d.call(o, {
|
|
117
215
|
kind: "config",
|
|
118
216
|
type: "layout",
|
|
119
|
-
id:
|
|
120
|
-
label: "Describe this
|
|
217
|
+
id: i,
|
|
218
|
+
label: "Describe this form"
|
|
121
219
|
});
|
|
122
|
-
return /* @__PURE__ */
|
|
220
|
+
return /* @__PURE__ */ t(y, { k: e, children: c ?? /* @__PURE__ */ t("p", { className: f, children: "Not offered in this app." }) });
|
|
221
|
+
}
|
|
222
|
+
function Z({ layout: e, bundle: i, collection: a, apply: r }) {
|
|
223
|
+
const o = N();
|
|
224
|
+
return /* @__PURE__ */ t(y, { k: "tool.ai_text", children: o.isAdmin && r ? /* @__PURE__ */ t(
|
|
225
|
+
P,
|
|
226
|
+
{
|
|
227
|
+
layoutId: Number(e.id),
|
|
228
|
+
bundle: i,
|
|
229
|
+
collection: a,
|
|
230
|
+
apply: r
|
|
231
|
+
}
|
|
232
|
+
) : /* @__PURE__ */ t("p", { className: f, children: "Not offered here: administrators only." }) });
|
|
123
233
|
}
|
|
124
|
-
function
|
|
125
|
-
var
|
|
126
|
-
const
|
|
127
|
-
if (!
|
|
128
|
-
const
|
|
129
|
-
return /* @__PURE__ */
|
|
130
|
-
/* @__PURE__ */
|
|
131
|
-
/* @__PURE__ */
|
|
132
|
-
/* @__PURE__ */
|
|
133
|
-
|
|
234
|
+
function ee({ layoutId: e }) {
|
|
235
|
+
var s, c;
|
|
236
|
+
const i = v("tool.version_history"), a = v("tool.version_diff"), r = v("tool.version_restore");
|
|
237
|
+
if (!i && !a && !r) return null;
|
|
238
|
+
const o = k("tool.version_history");
|
|
239
|
+
return /* @__PURE__ */ h("div", { "data-setting": "tool.version_history", className: "space-y-1.5", children: [
|
|
240
|
+
/* @__PURE__ */ t("p", { className: B, children: o == null ? void 0 : o.label }),
|
|
241
|
+
/* @__PURE__ */ t(F, { layoutId: e }),
|
|
242
|
+
/* @__PURE__ */ h("p", { className: f, children: [
|
|
243
|
+
o == null ? void 0 : o.effect,
|
|
134
244
|
" ",
|
|
135
|
-
(
|
|
245
|
+
(s = k("tool.version_diff")) == null ? void 0 : s.effect,
|
|
136
246
|
" ",
|
|
137
|
-
(c =
|
|
247
|
+
(c = k("tool.version_restore")) == null ? void 0 : c.effect
|
|
138
248
|
] })
|
|
139
249
|
] });
|
|
140
250
|
}
|
|
141
|
-
function
|
|
142
|
-
const
|
|
251
|
+
function te({ layoutId: e }) {
|
|
252
|
+
const i = R(), [a, r] = _(!1), { data: o, isFetching: s, isError: c, refetch: n } = L({
|
|
143
253
|
queryKey: ["layout-editor", "drift"],
|
|
144
|
-
queryFn: () =>
|
|
145
|
-
enabled:
|
|
254
|
+
queryFn: () => i.request(E("/collection-layouts/drift")).then((l) => Array.isArray(l == null ? void 0 : l.data) ? l.data : []),
|
|
255
|
+
enabled: a,
|
|
146
256
|
staleTime: 0
|
|
147
|
-
}),
|
|
148
|
-
return /* @__PURE__ */
|
|
257
|
+
}), d = o == null ? void 0 : o.find((l) => Number(l.layout_id) === e);
|
|
258
|
+
return /* @__PURE__ */ h(
|
|
149
259
|
y,
|
|
150
260
|
{
|
|
151
261
|
k: "tool.layout_drift",
|
|
152
|
-
control: /* @__PURE__ */
|
|
262
|
+
control: /* @__PURE__ */ t(
|
|
153
263
|
"button",
|
|
154
264
|
{
|
|
155
265
|
type: "button",
|
|
156
|
-
className:
|
|
157
|
-
disabled:
|
|
158
|
-
onClick: () =>
|
|
159
|
-
children:
|
|
266
|
+
className: C,
|
|
267
|
+
disabled: s,
|
|
268
|
+
onClick: () => a ? void n() : r(!0),
|
|
269
|
+
children: s ? "Checking…" : "Check now"
|
|
160
270
|
}
|
|
161
271
|
),
|
|
162
272
|
children: [
|
|
163
|
-
|
|
164
|
-
|
|
273
|
+
a && !s && c && /* @__PURE__ */ t("p", { className: "text-[12px] text-[#9c2f47] dark:text-[#f08aa1]", children: "The check failed." }),
|
|
274
|
+
a && o && !s && /* @__PURE__ */ t("div", { "data-layout-drift": !0, className: "text-[12px]", children: d ? /* @__PURE__ */ t("ul", { className: "space-y-1", children: d.warnings.map((l) => /* @__PURE__ */ t(
|
|
165
275
|
"li",
|
|
166
276
|
{
|
|
167
277
|
className: "rounded bg-[#fae6eb] px-1.5 py-1 text-[#9c2f47] dark:bg-[#3d1621] dark:text-[#f08aa1]",
|
|
168
|
-
children:
|
|
278
|
+
children: l
|
|
169
279
|
},
|
|
170
|
-
|
|
171
|
-
)) }) : /* @__PURE__ */
|
|
280
|
+
l
|
|
281
|
+
)) }) : /* @__PURE__ */ t("p", { className: f, children: "No drift: the form matches its last saved version." }) })
|
|
172
282
|
]
|
|
173
283
|
}
|
|
174
284
|
);
|
|
175
285
|
}
|
|
176
286
|
export {
|
|
177
|
-
|
|
178
|
-
|
|
287
|
+
xe as ToolsSection,
|
|
288
|
+
X as rolePreviewSummary
|
|
179
289
|
};
|