@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
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
import { jsxs as a, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { CircleAlert as k, CheckCircle2 as h, Sparkles as w, Info as y, AlertTriangle as v, AlertCircle as C } from "lucide-react";
|
|
3
|
+
import { cn as c } from "../../../lib/utils.js";
|
|
4
|
+
import { PanelHeader as T, PanelBody as $ } from "../panel-frame.js";
|
|
5
|
+
import { groupTitle as b, effectText as x } from "../panel-style.js";
|
|
6
|
+
import { barBtnOn as I, barBtn as P } from "../toolbar-kit.js";
|
|
7
|
+
import { findingDesignTarget as B } from "./lint-api.js";
|
|
8
|
+
const j = [
|
|
9
|
+
{ severity: "error", title: "Errors" },
|
|
10
|
+
{ severity: "warn", title: "Warnings" },
|
|
11
|
+
{ severity: "info", title: "Tips" }
|
|
12
|
+
], A = {
|
|
13
|
+
error: C,
|
|
14
|
+
warn: v,
|
|
15
|
+
info: y
|
|
16
|
+
}, O = {
|
|
17
|
+
error: "text-red-600 dark:text-red-400",
|
|
18
|
+
warn: "text-amber-600 dark:text-amber-400",
|
|
19
|
+
info: "text-slate-500 dark:text-muted-foreground"
|
|
20
|
+
};
|
|
21
|
+
function S(e) {
|
|
22
|
+
return e >= 80 ? "bg-emerald-50 text-emerald-700 dark:bg-emerald-500/15 dark:text-emerald-300" : e >= 60 ? "bg-amber-50 text-amber-700 dark:bg-amber-500/15 dark:text-amber-300" : "bg-red-50 text-red-700 dark:bg-red-500/15 dark:text-red-300";
|
|
23
|
+
}
|
|
24
|
+
function f(e) {
|
|
25
|
+
const t = (n) => e.filter((s) => s.severity === n).length;
|
|
26
|
+
return { error: t("error"), warn: t("warn"), info: t("info") };
|
|
27
|
+
}
|
|
28
|
+
function G({
|
|
29
|
+
findings: e,
|
|
30
|
+
active: t,
|
|
31
|
+
onClick: n
|
|
32
|
+
}) {
|
|
33
|
+
const s = f(e), o = s.error + s.warn;
|
|
34
|
+
return /* @__PURE__ */ a(
|
|
35
|
+
"button",
|
|
36
|
+
{
|
|
37
|
+
type: "button",
|
|
38
|
+
onClick: n,
|
|
39
|
+
"aria-pressed": t,
|
|
40
|
+
"aria-label": `Problems: ${s.error} errors, ${s.warn} warnings`,
|
|
41
|
+
"data-editor-checks": "",
|
|
42
|
+
"data-tip": "Problems this form has: hidden required fields, missing cascade parents, empty steps, unreachable fields and accessibility",
|
|
43
|
+
className: c(P, "gap-1 px-2", t && I),
|
|
44
|
+
children: [
|
|
45
|
+
/* @__PURE__ */ r(
|
|
46
|
+
k,
|
|
47
|
+
{
|
|
48
|
+
className: c(
|
|
49
|
+
"h-3.5 w-3.5",
|
|
50
|
+
s.error > 0 ? "text-red-600 dark:text-red-400" : o > 0 ? "text-amber-600 dark:text-amber-400" : "text-slate-500 dark:text-muted-foreground"
|
|
51
|
+
)
|
|
52
|
+
}
|
|
53
|
+
),
|
|
54
|
+
o > 0 ? /* @__PURE__ */ r("span", { "data-checks-count": o, className: "tabular-nums", children: o }) : /* @__PURE__ */ r(h, { className: "h-3.5 w-3.5 text-emerald-600 dark:text-emerald-400" })
|
|
55
|
+
]
|
|
56
|
+
}
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
function E({
|
|
60
|
+
finding: e,
|
|
61
|
+
onSelect: t,
|
|
62
|
+
apply: n,
|
|
63
|
+
readOnly: s
|
|
64
|
+
}) {
|
|
65
|
+
const o = A[e.severity], i = B(e);
|
|
66
|
+
return /* @__PURE__ */ a(
|
|
67
|
+
"li",
|
|
68
|
+
{
|
|
69
|
+
"data-lint-finding": e.rule,
|
|
70
|
+
className: "rounded-md border border-slate-200 bg-white dark:border-border dark:bg-card",
|
|
71
|
+
children: [
|
|
72
|
+
/* @__PURE__ */ a(
|
|
73
|
+
"button",
|
|
74
|
+
{
|
|
75
|
+
type: "button",
|
|
76
|
+
disabled: !i,
|
|
77
|
+
onClick: () => i && t(i),
|
|
78
|
+
className: "flex w-full items-start gap-2 rounded-md px-2.5 py-2 text-left transition-colors hover:bg-muted disabled:cursor-default disabled:hover:bg-transparent",
|
|
79
|
+
"data-tip": i ? "Select it on the form" : void 0,
|
|
80
|
+
children: [
|
|
81
|
+
/* @__PURE__ */ r(o, { className: c("mt-0.5 h-3.5 w-3.5 shrink-0", O[e.severity]) }),
|
|
82
|
+
/* @__PURE__ */ r("span", { className: "min-w-0 text-[12.5px] leading-snug text-slate-700 dark:text-foreground", children: e.message })
|
|
83
|
+
]
|
|
84
|
+
}
|
|
85
|
+
),
|
|
86
|
+
e.fix && !s && /* @__PURE__ */ r("div", { className: "border-t border-slate-100 px-2.5 py-1.5 dark:border-border", children: /* @__PURE__ */ r(
|
|
87
|
+
"button",
|
|
88
|
+
{
|
|
89
|
+
type: "button",
|
|
90
|
+
"data-lint-fix": "",
|
|
91
|
+
onClick: () => e.fix && n(e.fix.ops, { label: e.fix.label }),
|
|
92
|
+
className: "inline-flex h-6 items-center rounded px-1.5 text-[12px] font-medium text-slate-700 transition-colors hover:bg-muted hover:text-slate-900 dark:text-foreground",
|
|
93
|
+
children: e.fix.label
|
|
94
|
+
}
|
|
95
|
+
) })
|
|
96
|
+
]
|
|
97
|
+
}
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
function J({
|
|
101
|
+
findings: e,
|
|
102
|
+
health: t,
|
|
103
|
+
ready: n,
|
|
104
|
+
onSelect: s,
|
|
105
|
+
apply: o,
|
|
106
|
+
onOpenAiReview: i,
|
|
107
|
+
readOnly: g = !1
|
|
108
|
+
}) {
|
|
109
|
+
const l = f(e), N = e.length === 0 ? n ? "Nothing to fix" : "Checking…" : [
|
|
110
|
+
l.error && `${l.error} ${l.error === 1 ? "problem" : "problems"}`,
|
|
111
|
+
l.warn && `${l.warn} ${l.warn === 1 ? "warning" : "warnings"}`,
|
|
112
|
+
l.info && `${l.info} ${l.info === 1 ? "suggestion" : "suggestions"}`
|
|
113
|
+
].filter(Boolean).join(" · ");
|
|
114
|
+
return /* @__PURE__ */ a("div", { "data-lint-panel": "", className: "flex min-h-0 flex-1 flex-col", children: [
|
|
115
|
+
/* @__PURE__ */ r(T, { eyebrow: "Form", title: "Problems", sub: N }),
|
|
116
|
+
/* @__PURE__ */ a($, { children: [
|
|
117
|
+
t && /* @__PURE__ */ a("section", { "aria-label": "Health", className: "space-y-1.5", children: [
|
|
118
|
+
/* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
|
|
119
|
+
/* @__PURE__ */ r("h3", { className: b, children: "Health" }),
|
|
120
|
+
/* @__PURE__ */ a(
|
|
121
|
+
"span",
|
|
122
|
+
{
|
|
123
|
+
"data-health-score": t.score,
|
|
124
|
+
className: c(
|
|
125
|
+
"rounded-full px-2 py-px text-[11.5px] font-semibold tabular-nums",
|
|
126
|
+
S(t.score)
|
|
127
|
+
),
|
|
128
|
+
children: [
|
|
129
|
+
t.score,
|
|
130
|
+
" / 100"
|
|
131
|
+
]
|
|
132
|
+
}
|
|
133
|
+
)
|
|
134
|
+
] }),
|
|
135
|
+
t.costs.length > 0 ? /* @__PURE__ */ r("ul", { className: "space-y-0.5", children: t.costs.map((d) => /* @__PURE__ */ a("li", { className: c(x, "flex justify-between gap-2"), children: [
|
|
136
|
+
/* @__PURE__ */ r("span", { children: d.label }),
|
|
137
|
+
/* @__PURE__ */ a("span", { className: "tabular-nums", children: [
|
|
138
|
+
"−",
|
|
139
|
+
d.points
|
|
140
|
+
] })
|
|
141
|
+
] }, d.label)) }) : /* @__PURE__ */ r("p", { className: x, children: "Nothing costs this form points." })
|
|
142
|
+
] }),
|
|
143
|
+
e.length === 0 && n && /* @__PURE__ */ a("p", { className: c(x, "flex items-center gap-1.5"), children: [
|
|
144
|
+
/* @__PURE__ */ r(h, { className: "h-3.5 w-3.5 text-emerald-600 dark:text-emerald-400" }),
|
|
145
|
+
"No problems found on this form."
|
|
146
|
+
] }),
|
|
147
|
+
j.map(({ severity: d, title: p }) => {
|
|
148
|
+
const u = e.filter((m) => m.severity === d);
|
|
149
|
+
return u.length === 0 ? null : /* @__PURE__ */ a("section", { "aria-label": p, className: "space-y-1.5", children: [
|
|
150
|
+
/* @__PURE__ */ a("h3", { className: b, children: [
|
|
151
|
+
p,
|
|
152
|
+
" ",
|
|
153
|
+
/* @__PURE__ */ r("span", { className: "font-normal text-slate-500 dark:text-muted-foreground", children: u.length })
|
|
154
|
+
] }),
|
|
155
|
+
/* @__PURE__ */ r("ul", { className: "space-y-1.5", children: u.map((m) => /* @__PURE__ */ r(
|
|
156
|
+
E,
|
|
157
|
+
{
|
|
158
|
+
finding: m,
|
|
159
|
+
onSelect: s,
|
|
160
|
+
apply: o,
|
|
161
|
+
readOnly: g
|
|
162
|
+
},
|
|
163
|
+
m.id
|
|
164
|
+
)) })
|
|
165
|
+
] }, d);
|
|
166
|
+
}),
|
|
167
|
+
i && /* @__PURE__ */ a("div", { className: "space-y-1", children: [
|
|
168
|
+
/* @__PURE__ */ r("p", { className: x, children: "These checks are counted, not guessed. The AI review also reads labels and help text." }),
|
|
169
|
+
/* @__PURE__ */ a(
|
|
170
|
+
"button",
|
|
171
|
+
{
|
|
172
|
+
type: "button",
|
|
173
|
+
onClick: i,
|
|
174
|
+
className: "inline-flex h-7 items-center gap-1.5 rounded-md px-1.5 text-[12px] font-medium text-slate-700 transition-colors hover:bg-muted hover:text-slate-900 dark:text-foreground",
|
|
175
|
+
children: [
|
|
176
|
+
/* @__PURE__ */ r(w, { className: "h-3.5 w-3.5" }),
|
|
177
|
+
"Open the AI review"
|
|
178
|
+
]
|
|
179
|
+
}
|
|
180
|
+
)
|
|
181
|
+
] })
|
|
182
|
+
] })
|
|
183
|
+
] });
|
|
184
|
+
}
|
|
185
|
+
export {
|
|
186
|
+
G as LintButton,
|
|
187
|
+
J as LintPanel,
|
|
188
|
+
f as lintCounts,
|
|
189
|
+
S as scoreTone
|
|
190
|
+
};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { useQuery as f } from "@tanstack/react-query";
|
|
2
|
+
import { useMemo as s } from "react";
|
|
3
|
+
import { useNivaroClient as c } from "../../../context.js";
|
|
4
|
+
import { get as d } from "../../../lib/commands.js";
|
|
5
|
+
import { mergeInherited as y, lintLayout as g, layoutHealth as p, EMPTY_LINT_CONTEXT as m } from "../../../lib/layout-lint.js";
|
|
6
|
+
const _ = {
|
|
7
|
+
context: (t) => ["layout-editor", "lint-context", t],
|
|
8
|
+
health: (t) => ["layout-editor", "health", t],
|
|
9
|
+
coverage: (t) => ["layout-editor", "coverage", t]
|
|
10
|
+
};
|
|
11
|
+
function k(t) {
|
|
12
|
+
if (!t || typeof t != "object") return null;
|
|
13
|
+
const e = t.data;
|
|
14
|
+
return e && typeof e == "object" ? e : t;
|
|
15
|
+
}
|
|
16
|
+
function h(t, e = !0) {
|
|
17
|
+
const n = c();
|
|
18
|
+
return f({
|
|
19
|
+
queryKey: _.context(t),
|
|
20
|
+
queryFn: async () => {
|
|
21
|
+
const r = k(
|
|
22
|
+
await n.request(d("/collection-layouts/lint-context", { collection: t }))
|
|
23
|
+
);
|
|
24
|
+
return {
|
|
25
|
+
fields: (r == null ? void 0 : r.fields) ?? [],
|
|
26
|
+
roles: (r == null ? void 0 : r.roles) ?? [],
|
|
27
|
+
requirements: (r == null ? void 0 : r.requirements) ?? []
|
|
28
|
+
};
|
|
29
|
+
},
|
|
30
|
+
enabled: e,
|
|
31
|
+
staleTime: 6e4,
|
|
32
|
+
retry: !1
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
function C(t, e, n = null) {
|
|
36
|
+
const { data: r, isSuccess: i, isError: o } = h(t, !!e);
|
|
37
|
+
return s(() => {
|
|
38
|
+
if (!e) return { findings: [], health: null, ready: !1 };
|
|
39
|
+
const a = r ?? m, u = y(e, n), l = g(u, a);
|
|
40
|
+
return { findings: l, health: p(u, l), ready: i || o };
|
|
41
|
+
}, [e, n, r, i, o]);
|
|
42
|
+
}
|
|
43
|
+
function E(t) {
|
|
44
|
+
const e = t.target;
|
|
45
|
+
return e.kind === "group" ? { kind: "group", key: e.key } : e.kind !== "field" ? null : e.group_key === "__header__" ? { kind: "header", field: e.field } : /^__.*__$/.test(e.field) ? { kind: "slot", field: e.field, group_key: e.group_key } : { kind: "field", field: e.field, group_key: e.group_key };
|
|
46
|
+
}
|
|
47
|
+
export {
|
|
48
|
+
E as findingDesignTarget,
|
|
49
|
+
_ as lintKeys,
|
|
50
|
+
C as useLayoutLint,
|
|
51
|
+
h as useLintContext
|
|
52
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { jsxs as a, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { cn as n } from "../../lib/utils.js";
|
|
3
|
+
function x({
|
|
4
|
+
what: e,
|
|
5
|
+
onRetry: r,
|
|
6
|
+
className: t
|
|
7
|
+
}) {
|
|
8
|
+
return /* @__PURE__ */ a(
|
|
9
|
+
"p",
|
|
10
|
+
{
|
|
11
|
+
role: "alert",
|
|
12
|
+
"data-load-error": "",
|
|
13
|
+
className: n(
|
|
14
|
+
"m-0 flex flex-wrap items-center gap-x-1.5 text-[12px] leading-snug text-red-700 dark:text-red-300",
|
|
15
|
+
t
|
|
16
|
+
),
|
|
17
|
+
children: [
|
|
18
|
+
"Could not load ",
|
|
19
|
+
e,
|
|
20
|
+
".",
|
|
21
|
+
/* @__PURE__ */ o(
|
|
22
|
+
"button",
|
|
23
|
+
{
|
|
24
|
+
type: "button",
|
|
25
|
+
"data-load-retry": "",
|
|
26
|
+
onClick: r,
|
|
27
|
+
className: "font-medium text-[#0089ad] hover:underline dark:text-nvr-cyan",
|
|
28
|
+
children: "Retry"
|
|
29
|
+
}
|
|
30
|
+
)
|
|
31
|
+
]
|
|
32
|
+
}
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
export {
|
|
36
|
+
x as LoadError
|
|
37
|
+
};
|
|
@@ -0,0 +1,305 @@
|
|
|
1
|
+
import { jsxs as h, jsx as r, Fragment as J } from "react/jsx-runtime";
|
|
2
|
+
import { useState as Q, useMemo as P } from "react";
|
|
3
|
+
import { toast as O } from "sonner";
|
|
4
|
+
import { HEADER_GROUP_KEY as _ } from "../../../lib/layout-ops.js";
|
|
5
|
+
import { cn as F } from "../../../lib/utils.js";
|
|
6
|
+
import { Skeleton as X } from "../../ui/skeleton.js";
|
|
7
|
+
import { targetOfKey as ee, keyOf as te, isFieldRow as T, fieldZones as re, zoneItems as oe } from "../field-zones.js";
|
|
8
|
+
import { resetPlacementOps as ne } from "../inheritance.js";
|
|
9
|
+
import { useCollectionMeta as le } from "../inspector/field-context.js";
|
|
10
|
+
import { overridePlacementOps as ae, describeField as se } from "../inspector/model.js";
|
|
11
|
+
import { LoadError as ie } from "../load-error.js";
|
|
12
|
+
import { useCollectionPipelines as de } from "../preview/preview-api.js";
|
|
13
|
+
import { useCellMenu as ce, MatrixMenu as me, matrixCorner as ue, matrixTh as H, matrixRowHead as he, InheritChip as fe, matrixCellTd as Z, MatrixCellButton as j, matrixZoneTd as we } from "./MatrixGrid.js";
|
|
14
|
+
import { useSaveRequirements as pe } from "./matrix-api.js";
|
|
15
|
+
import { CELL_KINDS as z, stateCell as K, movesFrom as be, everyStateValue as L, everyStateOps as ge, cellChange as xe } from "./state-matrix.js";
|
|
16
|
+
const x = {
|
|
17
|
+
normal: "Editable",
|
|
18
|
+
readonly: "Read-only",
|
|
19
|
+
required: "Required",
|
|
20
|
+
hidden: "Hidden"
|
|
21
|
+
}, S = {
|
|
22
|
+
normal: "normal",
|
|
23
|
+
readonly: "readonly",
|
|
24
|
+
required: "required",
|
|
25
|
+
hidden: "hidden"
|
|
26
|
+
}, D = "*", A = (o) => `${o.field}${o.group_key ?? ""}`;
|
|
27
|
+
function ye(o, a) {
|
|
28
|
+
const f = new Set((a == null ? void 0 : a.placements.map((n) => n.field)) ?? []), w = (n) => ({
|
|
29
|
+
row: n,
|
|
30
|
+
source: f.has(n.field) ? "override" : "own"
|
|
31
|
+
}), v = [], g = o.placements.filter((n) => n.group_key === _ && T(n)).sort((n, p) => n.sort - p.sort);
|
|
32
|
+
g.length && v.push({ key: _, label: "Header strip", rows: g.map(w) });
|
|
33
|
+
for (const n of re(o)) {
|
|
34
|
+
const p = oe(o, n.key).filter(T);
|
|
35
|
+
p.length && v.push({ key: n.key ?? "", label: n.label, rows: p.map(w) });
|
|
36
|
+
}
|
|
37
|
+
if (a) {
|
|
38
|
+
const n = new Set(o.placements.map((b) => b.field)), p = /* @__PURE__ */ new Set(), C = a.placements.filter((b) => !T(b) || n.has(b.field) || p.has(b.field) ? !1 : (p.add(b.field), !0));
|
|
39
|
+
C.length && v.push({
|
|
40
|
+
key: "parent",
|
|
41
|
+
label: `From ${String(a.layout.name ?? "the parent layout")}`,
|
|
42
|
+
rows: C.map((b) => ({ row: b, source: "inherited" }))
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
return v;
|
|
46
|
+
}
|
|
47
|
+
function Pe({
|
|
48
|
+
bundle: o,
|
|
49
|
+
parent: a,
|
|
50
|
+
collection: f,
|
|
51
|
+
apply: w,
|
|
52
|
+
onSelect: v
|
|
53
|
+
}) {
|
|
54
|
+
const { data: g } = le(f), {
|
|
55
|
+
data: n = [],
|
|
56
|
+
isLoading: p,
|
|
57
|
+
isError: C,
|
|
58
|
+
refetch: b
|
|
59
|
+
} = de(f, !0), [V, W] = Q(null), s = n.find((e) => e.id === V) ?? n[0] ?? null, k = (s == null ? void 0 : s.states) ?? [], N = (s == null ? void 0 : s.transitions) ?? [], I = pe(f), y = ce(), R = P(() => ye(o, a), [o, a]), q = String((a == null ? void 0 : a.layout.name) ?? "the parent layout"), E = (e) => se(e.field, (g == null ? void 0 : g.fields) ?? [], (g == null ? void 0 : g.relations) ?? [], e).label, l = P(() => {
|
|
60
|
+
if (!y.open) return null;
|
|
61
|
+
const e = y.open.lastIndexOf("|"), t = y.open.slice(0, e), d = y.open.slice(e + 1);
|
|
62
|
+
for (const c of R)
|
|
63
|
+
for (const m of c.rows)
|
|
64
|
+
if (A(m.row) === t && m.source !== "inherited")
|
|
65
|
+
return { row: m.row, state: d === D ? null : k.find((i) => i.key === d) };
|
|
66
|
+
return null;
|
|
67
|
+
}, [y.open, R, k]), Y = l ? l.state == null ? z.map((e) => ({
|
|
68
|
+
value: e,
|
|
69
|
+
label: x[e],
|
|
70
|
+
tone: S[e],
|
|
71
|
+
effect: e === "normal" ? "No rule of its own on this form" : e === "readonly" ? "Read-only on this form, in every state" : e === "required" ? "The form will not save without a value" : "Not shown on this form",
|
|
72
|
+
blocked: null
|
|
73
|
+
})) : (() => {
|
|
74
|
+
var m;
|
|
75
|
+
const e = l.state, t = K(l.row, e, N), d = be(N, e), c = d.length === 1 ? `"${(m = d[0]) == null ? void 0 : m.label}"` : `the ${d.length} moves out`;
|
|
76
|
+
return z.map((i) => {
|
|
77
|
+
const u = t.options[i];
|
|
78
|
+
return {
|
|
79
|
+
value: i,
|
|
80
|
+
label: x[i],
|
|
81
|
+
tone: S[i],
|
|
82
|
+
effect: i === "normal" ? `Editable in ${e.label}` : i === "readonly" ? `Locked while the record is in ${e.label}` : i === "required" ? L(l.row) === "required" ? "Required on every state" : `${c} will ask for it — saved to the ${(s == null ? void 0 : s.name) ?? ""} pipeline at once, for every form` : "",
|
|
83
|
+
blocked: u.ok ? null : u.why
|
|
84
|
+
};
|
|
85
|
+
});
|
|
86
|
+
})() : [], B = l ? l.state == null ? L(l.row) : K(l.row, l.state, N).value : null, G = async (e) => {
|
|
87
|
+
if (!l) return;
|
|
88
|
+
const t = E(l.row);
|
|
89
|
+
if (l.state == null) {
|
|
90
|
+
const m = ge(l.row, e);
|
|
91
|
+
m.length && w(m, { label: `${t}: ${x[e].toLowerCase()} on every state` });
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
if (!s) return;
|
|
95
|
+
const d = l.state, c = xe(l.row, d, s.id, N, e);
|
|
96
|
+
if (c && (c.ops.length && w(c.ops, { label: `${t}: ${x[e].toLowerCase()} in ${d.label}` }), c.requirements.length !== 0))
|
|
97
|
+
try {
|
|
98
|
+
await I(c.requirements);
|
|
99
|
+
const m = c.requirements.map((i) => `"${i.label}"`).join(", ");
|
|
100
|
+
O.success(
|
|
101
|
+
e === "required" ? `${m} now ${c.requirements.length === 1 ? "asks" : "ask"} for ${t}` : `${m} no longer ${c.requirements.length === 1 ? "asks" : "ask"} for ${t}`,
|
|
102
|
+
{
|
|
103
|
+
description: `Saved to the ${s.name} pipeline`,
|
|
104
|
+
action: {
|
|
105
|
+
label: "Undo",
|
|
106
|
+
onClick: () => void I(c.requirements, "before").catch(
|
|
107
|
+
(i) => O.error(U(i))
|
|
108
|
+
)
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
);
|
|
112
|
+
} catch (m) {
|
|
113
|
+
O.error(`The pipeline was not changed: ${U(m)}`);
|
|
114
|
+
}
|
|
115
|
+
}, M = R.reduce((e, t) => e + t.rows.length, 0);
|
|
116
|
+
return /* @__PURE__ */ h("div", { "data-field-state-matrix": "", className: "flex min-h-full flex-col gap-2 p-4", children: [
|
|
117
|
+
/* @__PURE__ */ h("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
118
|
+
/* @__PURE__ */ h("p", { className: "m-0 min-w-0 flex-1 text-[12px] text-slate-500 dark:text-muted-foreground", children: [
|
|
119
|
+
M,
|
|
120
|
+
" ",
|
|
121
|
+
M === 1 ? "field" : "fields",
|
|
122
|
+
" by workflow state. Read-only uses the field's Read-only when; Required asks for the value before the record leaves the state."
|
|
123
|
+
] }),
|
|
124
|
+
n.length > 1 && /* @__PURE__ */ r(
|
|
125
|
+
"fieldset",
|
|
126
|
+
{
|
|
127
|
+
"aria-label": "Pipeline",
|
|
128
|
+
className: "m-0 inline-flex h-8 items-center gap-0.5 rounded-md border-0 bg-slate-100 p-0.5 dark:bg-muted",
|
|
129
|
+
children: n.map((e) => /* @__PURE__ */ r(
|
|
130
|
+
"button",
|
|
131
|
+
{
|
|
132
|
+
type: "button",
|
|
133
|
+
"aria-pressed": e.id === (s == null ? void 0 : s.id),
|
|
134
|
+
onClick: () => W(e.id),
|
|
135
|
+
className: F(
|
|
136
|
+
"inline-flex h-7 items-center rounded px-2 text-[12px] font-medium transition-colors",
|
|
137
|
+
e.id === (s == null ? void 0 : s.id) ? "bg-white text-slate-900 shadow-sm dark:bg-background dark:text-foreground" : "text-slate-500 hover:text-slate-800 dark:text-muted-foreground dark:hover:text-foreground"
|
|
138
|
+
),
|
|
139
|
+
children: e.name
|
|
140
|
+
},
|
|
141
|
+
e.id
|
|
142
|
+
))
|
|
143
|
+
}
|
|
144
|
+
)
|
|
145
|
+
] }),
|
|
146
|
+
C ? /* @__PURE__ */ r(ie, { what: "the workflow states", onRetry: () => void b() }) : !p && !s && /* @__PURE__ */ r(
|
|
147
|
+
"p",
|
|
148
|
+
{
|
|
149
|
+
role: "note",
|
|
150
|
+
className: "m-0 rounded-md bg-slate-100 px-3 py-2 text-[12px] text-slate-600 dark:bg-muted dark:text-muted-foreground",
|
|
151
|
+
children: "No pipeline runs on this collection, so only Every state applies."
|
|
152
|
+
}
|
|
153
|
+
),
|
|
154
|
+
p ? /* @__PURE__ */ r(X, { className: "h-48 w-full rounded-lg" }) : /* @__PURE__ */ r(
|
|
155
|
+
me,
|
|
156
|
+
{
|
|
157
|
+
menu: y,
|
|
158
|
+
title: l ? `${E(l.row)} · ${l.state ? l.state.label : "Every state"}` : "",
|
|
159
|
+
choices: Y,
|
|
160
|
+
current: B,
|
|
161
|
+
onPick: (e) => void G(e),
|
|
162
|
+
children: /* @__PURE__ */ r("div", { className: "min-h-0 flex-1 overflow-auto rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card", children: /* @__PURE__ */ h("table", { className: "border-separate border-spacing-0 text-[12.5px]", children: [
|
|
163
|
+
/* @__PURE__ */ r("thead", { children: /* @__PURE__ */ h("tr", { children: [
|
|
164
|
+
/* @__PURE__ */ r("th", { className: ue, children: "Field" }),
|
|
165
|
+
/* @__PURE__ */ r(
|
|
166
|
+
"th",
|
|
167
|
+
{
|
|
168
|
+
className: F(H, "text-center"),
|
|
169
|
+
"data-tip": "The field on this form, whatever the state",
|
|
170
|
+
children: "Every state"
|
|
171
|
+
}
|
|
172
|
+
),
|
|
173
|
+
k.map((e) => /* @__PURE__ */ r(
|
|
174
|
+
"th",
|
|
175
|
+
{
|
|
176
|
+
className: F(H, "text-center"),
|
|
177
|
+
"data-matrix-state": e.key,
|
|
178
|
+
children: /* @__PURE__ */ h("span", { className: "inline-flex items-center gap-1.5", children: [
|
|
179
|
+
/* @__PURE__ */ r(
|
|
180
|
+
"span",
|
|
181
|
+
{
|
|
182
|
+
"aria-hidden": !0,
|
|
183
|
+
className: "h-2 w-2 shrink-0 rounded-full bg-slate-300 dark:bg-slate-600",
|
|
184
|
+
style: e.color ? { backgroundColor: e.color } : void 0
|
|
185
|
+
}
|
|
186
|
+
),
|
|
187
|
+
e.label
|
|
188
|
+
] })
|
|
189
|
+
},
|
|
190
|
+
e.key
|
|
191
|
+
))
|
|
192
|
+
] }) }),
|
|
193
|
+
/* @__PURE__ */ h("tbody", { children: [
|
|
194
|
+
R.map((e) => /* @__PURE__ */ r(
|
|
195
|
+
ve,
|
|
196
|
+
{
|
|
197
|
+
zone: e,
|
|
198
|
+
colSpan: k.length + 1,
|
|
199
|
+
render: (t) => {
|
|
200
|
+
const d = E(t.row), c = A(t.row), m = t.source === "inherited" ? `From ${q} — override it to change it here` : null, i = L(t.row);
|
|
201
|
+
return /* @__PURE__ */ h("tr", { "data-matrix-row": t.row.field, children: [
|
|
202
|
+
/* @__PURE__ */ h("th", { scope: "row", className: he, children: [
|
|
203
|
+
/* @__PURE__ */ r(
|
|
204
|
+
"button",
|
|
205
|
+
{
|
|
206
|
+
type: "button",
|
|
207
|
+
onClick: (u) => v(ee(te(t.row)), {
|
|
208
|
+
additive: u.shiftKey || u.metaKey || u.ctrlKey
|
|
209
|
+
}),
|
|
210
|
+
"data-tip": "Select it on the form",
|
|
211
|
+
className: "block max-w-full truncate text-left font-medium text-slate-800 hover:underline dark:text-foreground",
|
|
212
|
+
children: d
|
|
213
|
+
}
|
|
214
|
+
),
|
|
215
|
+
t.source !== "own" && a && /* @__PURE__ */ r(
|
|
216
|
+
fe,
|
|
217
|
+
{
|
|
218
|
+
kind: t.source === "inherited" ? "inherited" : "override",
|
|
219
|
+
parentName: q,
|
|
220
|
+
action: t.source === "inherited" ? "override" : "reset",
|
|
221
|
+
actionLabel: t.source === "inherited" ? `Override ${d} on this form` : `Reset ${d} to ${q}`,
|
|
222
|
+
actionTip: t.source === "inherited" ? "Copy it onto this form to change it here" : `Take ${q}'s placement of it again`,
|
|
223
|
+
onAction: () => t.source === "inherited" ? w(ae(o, a, t.row), {
|
|
224
|
+
label: `Override ${d} on this form`
|
|
225
|
+
}) : w(ne(o, t.row.field), {
|
|
226
|
+
label: `Reset ${d} to ${q}`
|
|
227
|
+
})
|
|
228
|
+
}
|
|
229
|
+
)
|
|
230
|
+
] }),
|
|
231
|
+
/* @__PURE__ */ r("td", { className: Z, children: /* @__PURE__ */ r(
|
|
232
|
+
j,
|
|
233
|
+
{
|
|
234
|
+
cellKey: `${c}|${D}`,
|
|
235
|
+
tone: S[i],
|
|
236
|
+
word: x[i],
|
|
237
|
+
tip: i === "normal" ? "No rule of its own" : `${x[i]} on every state`,
|
|
238
|
+
locked: m,
|
|
239
|
+
label: `${d}, every state: ${x[i]}`,
|
|
240
|
+
menu: y
|
|
241
|
+
}
|
|
242
|
+
) }),
|
|
243
|
+
k.map((u) => {
|
|
244
|
+
const $ = K(t.row, u, N);
|
|
245
|
+
return /* @__PURE__ */ r("td", { className: Z, children: /* @__PURE__ */ r(
|
|
246
|
+
j,
|
|
247
|
+
{
|
|
248
|
+
cellKey: `${c}|${u.key}`,
|
|
249
|
+
tone: S[$.value],
|
|
250
|
+
word: x[$.value],
|
|
251
|
+
tip: $.conflict ?? $.because,
|
|
252
|
+
conflict: $.conflict,
|
|
253
|
+
locked: m,
|
|
254
|
+
label: `${d} in ${u.label}: ${x[$.value]}`,
|
|
255
|
+
menu: y
|
|
256
|
+
}
|
|
257
|
+
) }, u.key);
|
|
258
|
+
})
|
|
259
|
+
] }, c);
|
|
260
|
+
}
|
|
261
|
+
},
|
|
262
|
+
e.key
|
|
263
|
+
)),
|
|
264
|
+
R.length === 0 && /* @__PURE__ */ r("tr", { children: /* @__PURE__ */ r(
|
|
265
|
+
"td",
|
|
266
|
+
{
|
|
267
|
+
colSpan: k.length + 2,
|
|
268
|
+
className: "px-3 py-6 text-center text-[12.5px] text-slate-500 dark:text-muted-foreground",
|
|
269
|
+
children: "No fields on this form yet."
|
|
270
|
+
}
|
|
271
|
+
) })
|
|
272
|
+
] })
|
|
273
|
+
] }) })
|
|
274
|
+
}
|
|
275
|
+
)
|
|
276
|
+
] });
|
|
277
|
+
}
|
|
278
|
+
function ve({
|
|
279
|
+
zone: o,
|
|
280
|
+
colSpan: a,
|
|
281
|
+
render: f
|
|
282
|
+
}) {
|
|
283
|
+
return /* @__PURE__ */ h(J, { children: [
|
|
284
|
+
/* @__PURE__ */ h("tr", { "data-matrix-zone": o.key, children: [
|
|
285
|
+
/* @__PURE__ */ r("td", { className: we, children: o.label }),
|
|
286
|
+
/* @__PURE__ */ r(
|
|
287
|
+
"td",
|
|
288
|
+
{
|
|
289
|
+
colSpan: a,
|
|
290
|
+
className: "border-b border-slate-200 bg-slate-100 dark:border-border dark:bg-muted"
|
|
291
|
+
}
|
|
292
|
+
)
|
|
293
|
+
] }),
|
|
294
|
+
o.rows.map(f)
|
|
295
|
+
] });
|
|
296
|
+
}
|
|
297
|
+
function U(o) {
|
|
298
|
+
var f, w;
|
|
299
|
+
const a = (w = (f = o == null ? void 0 : o.response) == null ? void 0 : f.data) == null ? void 0 : w.error;
|
|
300
|
+
return typeof a == "string" ? a : o instanceof Error ? o.message : "Something went wrong";
|
|
301
|
+
}
|
|
302
|
+
export {
|
|
303
|
+
Pe as FieldStateMatrix,
|
|
304
|
+
ye as matrixZones
|
|
305
|
+
};
|