@nivaro/react 0.2.52 → 0.2.54
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 +1 -1
- package/dist/index.d.ts +116 -2
- package/dist/layout-editor.d.ts +248 -2
- package/dist/shared/components/FormWhatsNew.js +60 -0
- package/dist/shared/components/ItemEditForm.js +3994 -3876
- package/dist/shared/components/RecordReadView.js +219 -211
- package/dist/shared/components/TipLayer.js +27 -27
- package/dist/shared/components/help-videos/api.js +51 -41
- package/dist/shared/components/help-videos/editor/DetailsTab.js +147 -130
- package/dist/shared/components/item-edit/FieldAffordances.js +7 -6
- package/dist/shared/components/item-edit/FieldRow.js +353 -304
- package/dist/shared/components/item-edit/FormHelpVideoButton.js +59 -0
- package/dist/shared/components/item-edit/GroupSection.js +419 -396
- package/dist/shared/components/item-edit/HeaderTools.js +59 -56
- package/dist/shared/components/item-edit/LayoutContentBlock.js +47 -24
- package/dist/shared/components/item-edit/lock-why.js +87 -0
- package/dist/shared/components/item-edit/useFormUsageBeacon.js +59 -0
- package/dist/shared/components/layout-editor/AddPanel.js +204 -146
- 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 +146 -0
- package/dist/shared/components/layout-editor/CollabParts.js +170 -0
- package/dist/shared/components/layout-editor/DesignNode.js +304 -115
- package/dist/shared/components/layout-editor/EditorCanvas.js +21 -20
- package/dist/shared/components/layout-editor/EditorTopBar.js +452 -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 +234 -109
- package/dist/shared/components/layout-editor/LayoutEditor.js +1101 -307
- 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/ScheduleChange.js +106 -0
- package/dist/shared/components/layout-editor/SessionHistory.js +84 -0
- package/dist/shared/components/layout-editor/StructureMenu.js +413 -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 +342 -0
- package/dist/shared/components/layout-editor/collab/collab-api.js +77 -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 +179 -163
- package/dist/shared/components/layout-editor/dnd/collision.js +25 -23
- package/dist/shared/components/layout-editor/dnd/rail-drop.js +56 -0
- package/dist/shared/components/layout-editor/draft-recovery.js +61 -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/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/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/Breadcrumb.js +36 -0
- package/dist/shared/components/layout-editor/inspector/BulkInspector.js +175 -0
- package/dist/shared/components/layout-editor/inspector/ColumnFit.js +112 -0
- package/dist/shared/components/layout-editor/inspector/GroupInspector.js +146 -92
- package/dist/shared/components/layout-editor/inspector/HelpTab.js +174 -0
- package/dist/shared/components/layout-editor/inspector/Inspector.js +256 -175
- package/dist/shared/components/layout-editor/inspector/LookTab.js +46 -40
- package/dist/shared/components/layout-editor/inspector/OverrideNotice.js +61 -0
- package/dist/shared/components/layout-editor/inspector/PickerPreview.js +134 -0
- package/dist/shared/components/layout-editor/inspector/PickerTab.js +167 -141
- package/dist/shared/components/layout-editor/inspector/RulesTab.js +175 -128
- package/dist/shared/components/layout-editor/inspector/Translations.js +156 -0
- package/dist/shared/components/layout-editor/inspector/kit.js +3 -3
- 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/overview/OverviewActions.js +15 -3
- package/dist/shared/components/layout-editor/overview/describe-conditions.js +18 -14
- package/dist/shared/components/layout-editor/overview/overview-api.js +105 -88
- 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/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/settings/FormSettings.js +123 -103
- package/dist/shared/components/layout-editor/settings/InheritanceSection.js +1 -1
- package/dist/shared/components/layout-editor/settings/ToolsSection.js +174 -100
- package/dist/shared/components/layout-editor/settings/WhoSection.js +136 -100
- package/dist/shared/components/layout-editor/settings/controls.js +8 -8
- package/dist/shared/components/layout-editor/settings/settings-registry.js +35 -11
- 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/structure-ops.js +399 -0
- package/dist/shared/components/layout-editor/testing/CostLimitSetting.js +42 -0
- package/dist/shared/components/layout-editor/testing/TestingPanels.js +551 -0
- package/dist/shared/components/layout-editor/testing/testing-api.js +67 -0
- package/dist/shared/components/layout-editor/testing/testing-model.js +393 -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/FillChip.js +27 -0
- package/dist/shared/components/layout-editor/usage/UsagePanel.js +158 -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 -307
- package/dist/shared/components/support/SuggestFormChange.js +143 -0
- package/dist/shared/lib/ai-fill.js +37 -0
- package/dist/shared/lib/form-usage-beacon.js +84 -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 +110 -106
- package/dist/shared/lib/screenshot.js +54 -28
- package/dist/shared/lib/visible-when.js +34 -0
- package/package.json +1 -1
|
@@ -1,17 +1,22 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useQuery as
|
|
3
|
-
import { Search as
|
|
4
|
-
import { useState as
|
|
5
|
-
import { useNivaroClient as
|
|
6
|
-
import { get as
|
|
7
|
-
import { HEADER_GROUP_KEY as
|
|
8
|
-
import { listLayoutSlots as
|
|
9
|
-
import { titleCase as
|
|
10
|
-
import { sectionOp as
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
|
|
1
|
+
import { jsxs as d, jsx as o, Fragment as H } from "react/jsx-runtime";
|
|
2
|
+
import { useQuery as te } from "@tanstack/react-query";
|
|
3
|
+
import { Search as re, LayoutPanelTop as oe, Plus as K, CopyPlus as ae, Check as ne } from "lucide-react";
|
|
4
|
+
import { useState as W, useMemo as Q } from "react";
|
|
5
|
+
import { useNivaroClient as ie } from "../../context.js";
|
|
6
|
+
import { get as se } from "../../lib/commands.js";
|
|
7
|
+
import { HEADER_GROUP_KEY as A, isCanvasSlot as le } from "../../lib/layout-ops.js";
|
|
8
|
+
import { listLayoutSlots as de } from "../../lib/layout-slots.js";
|
|
9
|
+
import { titleCase as $, cn as V } from "../../lib/utils.js";
|
|
10
|
+
import { sectionOp as ce, fieldSpot as j, placeOp as Y, slotSpot as pe } from "./add-target.js";
|
|
11
|
+
import { MeaningSuggestions as ue } from "./ai-forms/MeaningSuggestions.js";
|
|
12
|
+
import { useAddDragSource as me } from "./dnd/node.js";
|
|
13
|
+
import { useFormFields as _e } from "./inspect/inspect-api.js";
|
|
14
|
+
import { textMatcher as ge } from "./nav/find.js";
|
|
15
|
+
import { useOverviewFields as fe } from "./overview/overview-api.js";
|
|
16
|
+
import { LibraryRows as he } from "./reuse/LibraryRows.js";
|
|
17
|
+
import { slotName as R } from "./slot-names.js";
|
|
18
|
+
import { useFieldFillRates as xe, fillText as ye } from "./usage/usage-api.js";
|
|
19
|
+
const ke = [
|
|
15
20
|
"__pipeline__",
|
|
16
21
|
"__comments__",
|
|
17
22
|
"__tasks__",
|
|
@@ -21,7 +26,7 @@ const ue = [
|
|
|
21
26
|
"__owners__",
|
|
22
27
|
"__pdf__",
|
|
23
28
|
"__subtitle__"
|
|
24
|
-
],
|
|
29
|
+
], z = {
|
|
25
30
|
__pipeline__: "State track and actions",
|
|
26
31
|
__comments__: "Notes and replies",
|
|
27
32
|
__tasks__: "To-dos on this record",
|
|
@@ -31,19 +36,19 @@ const ue = [
|
|
|
31
36
|
__owners__: "Who owns it at each step",
|
|
32
37
|
__pdf__: "Generate and download a PDF",
|
|
33
38
|
__subtitle__: "A line of values under the title"
|
|
34
|
-
},
|
|
35
|
-
function
|
|
39
|
+
}, be = ["review_list", "rollup"];
|
|
40
|
+
function J(a) {
|
|
36
41
|
return {
|
|
37
|
-
widget_id:
|
|
38
|
-
input_bindings:
|
|
42
|
+
widget_id: a.id,
|
|
43
|
+
input_bindings: be.includes(a.widget_type) ? [{ key: "record_id", binding_type: "item_field", binding_value: "id" }] : []
|
|
39
44
|
};
|
|
40
45
|
}
|
|
41
|
-
function
|
|
42
|
-
const i =
|
|
46
|
+
function Ne(a) {
|
|
47
|
+
const i = a.interface ?? "";
|
|
43
48
|
if (i.includes("o2m") || i === "list-o2m" || i === "inline-grid") return "Grid";
|
|
44
49
|
if (i.includes("m2m") || i.includes("m2a")) return "Several records";
|
|
45
50
|
if (i.includes("m2o")) return "Record";
|
|
46
|
-
switch (
|
|
51
|
+
switch (a.type) {
|
|
47
52
|
case "string":
|
|
48
53
|
case "uuid":
|
|
49
54
|
return "Text";
|
|
@@ -66,129 +71,132 @@ function me(o) {
|
|
|
66
71
|
case "alias":
|
|
67
72
|
return "Group";
|
|
68
73
|
default:
|
|
69
|
-
return
|
|
74
|
+
return a.type ? $(a.type) : "";
|
|
70
75
|
}
|
|
71
76
|
}
|
|
72
|
-
const
|
|
73
|
-
function
|
|
74
|
-
return /* @__PURE__ */
|
|
75
|
-
/* @__PURE__ */
|
|
76
|
-
|
|
77
|
+
const we = "h-8 w-full rounded-md border border-slate-200 bg-white pl-7 pr-2.5 text-[12.5px] text-slate-800 outline-none placeholder:text-slate-400 focus:border-nvr-cyan dark:border-border dark:bg-background dark:text-foreground dark:placeholder:text-muted-foreground", N = "px-2 pb-1 pt-3 text-[11.5px] font-semibold text-slate-500 dark:text-muted-foreground";
|
|
78
|
+
function M({ children: a }) {
|
|
79
|
+
return /* @__PURE__ */ d("span", { className: "inline-flex shrink-0 items-center gap-0.5 text-[11px] font-medium text-[#0089ad] dark:text-nvr-cyan", children: [
|
|
80
|
+
/* @__PURE__ */ o(ne, { className: "h-3 w-3" }),
|
|
81
|
+
a
|
|
77
82
|
] });
|
|
78
83
|
}
|
|
79
|
-
function
|
|
80
|
-
title:
|
|
84
|
+
function w({
|
|
85
|
+
title: a,
|
|
81
86
|
sub: i,
|
|
82
|
-
aside:
|
|
87
|
+
aside: c,
|
|
83
88
|
onClick: u,
|
|
84
|
-
attrs:
|
|
85
|
-
extra:
|
|
86
|
-
drag:
|
|
89
|
+
attrs: l,
|
|
90
|
+
extra: g,
|
|
91
|
+
drag: _ = null
|
|
87
92
|
}) {
|
|
88
|
-
const
|
|
93
|
+
const m = me(_), t = /* @__PURE__ */ d(
|
|
89
94
|
"button",
|
|
90
95
|
{
|
|
91
96
|
type: "button",
|
|
92
|
-
...
|
|
97
|
+
...m.props,
|
|
93
98
|
onClick: () => {
|
|
94
|
-
|
|
99
|
+
m.clickBlocked() || u();
|
|
95
100
|
},
|
|
96
|
-
...
|
|
97
|
-
className:
|
|
101
|
+
...l,
|
|
102
|
+
className: V(
|
|
98
103
|
"group flex w-full min-w-0 items-center gap-2 rounded-md px-2 py-1.5 text-left transition-colors hover:bg-muted",
|
|
99
|
-
|
|
104
|
+
m.dragging && "opacity-40"
|
|
100
105
|
),
|
|
101
106
|
children: [
|
|
102
|
-
/* @__PURE__ */
|
|
103
|
-
/* @__PURE__ */
|
|
104
|
-
i && /* @__PURE__ */
|
|
107
|
+
/* @__PURE__ */ d("span", { className: "flex min-w-0 flex-1 flex-col", children: [
|
|
108
|
+
/* @__PURE__ */ o("span", { className: "truncate text-[12.5px] font-medium text-slate-900 dark:text-foreground", children: a }),
|
|
109
|
+
i && /* @__PURE__ */ o("span", { className: "truncate text-[11.5px] text-slate-500 dark:text-muted-foreground", children: i })
|
|
105
110
|
] }),
|
|
106
|
-
|
|
111
|
+
c
|
|
107
112
|
]
|
|
108
113
|
}
|
|
109
114
|
);
|
|
110
|
-
return
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
] }) :
|
|
115
|
+
return g ? /* @__PURE__ */ d("div", { className: "flex items-center gap-0.5", children: [
|
|
116
|
+
t,
|
|
117
|
+
g
|
|
118
|
+
] }) : t;
|
|
114
119
|
}
|
|
115
|
-
function
|
|
116
|
-
bundle:
|
|
120
|
+
function He({
|
|
121
|
+
bundle: a,
|
|
117
122
|
collection: i,
|
|
118
|
-
selected:
|
|
123
|
+
selected: c,
|
|
119
124
|
apply: u,
|
|
120
|
-
onSelect:
|
|
125
|
+
onSelect: l
|
|
121
126
|
}) {
|
|
122
|
-
const
|
|
127
|
+
const g = ie(), [_, m] = W(""), [t, s] = W("form"), { data: f = [] } = fe(i), { data: T } = xe(i), { data: X = [], error: L } = te({
|
|
123
128
|
queryKey: ["layout-editor", "widgets"],
|
|
124
|
-
queryFn: () =>
|
|
129
|
+
queryFn: () => g.request(se("/widgets-internal")).then((e) => e.data ?? []),
|
|
125
130
|
staleTime: 6e4,
|
|
126
131
|
retry: !1
|
|
127
|
-
}), [
|
|
132
|
+
}), [v, D] = W(null), h = ge(_), P = Q(() => {
|
|
128
133
|
const e = /* @__PURE__ */ new Map();
|
|
129
|
-
for (const
|
|
134
|
+
for (const r of a.placements) e.set(r.field, [...e.get(r.field) ?? [], r]);
|
|
130
135
|
return e;
|
|
131
|
-
}, [
|
|
136
|
+
}, [a.placements]), C = (e) => (P.get(e) ?? []).find((r) => r.group_key !== A), E = (e) => (P.get(e) ?? []).find((r) => r.group_key === A), S = (e) => e.group_key === A ? { kind: "header", field: e.field } : {
|
|
132
137
|
kind: e.field.startsWith("__") ? "slot" : "field",
|
|
133
138
|
field: e.field,
|
|
134
139
|
group_key: e.group_key
|
|
135
|
-
},
|
|
136
|
-
const
|
|
137
|
-
u([
|
|
138
|
-
},
|
|
140
|
+
}, Z = (e, r, n) => {
|
|
141
|
+
const p = t === "header" ? j(a, c, "header") : le({ field: e, group_key: null }) ? pe(a, c) : e === "__subtitle__" ? { group_key: null, index: 0 } : j(a, c);
|
|
142
|
+
u([Y(e, p, n)], { label: `Add ${r}` }), l(S({ field: e, group_key: p.group_key }));
|
|
143
|
+
}, F = (e, r, n, p) => n ? null : {
|
|
139
144
|
field: e,
|
|
140
|
-
label:
|
|
141
|
-
patch:
|
|
142
|
-
to:
|
|
143
|
-
onAdded: (
|
|
144
|
-
const
|
|
145
|
-
(
|
|
145
|
+
label: r,
|
|
146
|
+
patch: p,
|
|
147
|
+
to: t,
|
|
148
|
+
onAdded: (b) => {
|
|
149
|
+
const x = b[0];
|
|
150
|
+
(x == null ? void 0 : x.op) === "place" && l(S({ field: e, group_key: x.group_key }));
|
|
146
151
|
}
|
|
147
|
-
},
|
|
148
|
-
|
|
149
|
-
const
|
|
150
|
-
|
|
151
|
-
},
|
|
152
|
-
var
|
|
153
|
-
const
|
|
154
|
-
if ((
|
|
155
|
-
const
|
|
156
|
-
|
|
152
|
+
}, O = (e, r, n) => {
|
|
153
|
+
D(null);
|
|
154
|
+
const p = t === "header" ? E(e) : C(e);
|
|
155
|
+
p ? l(S(p)) : Z(e, r, n);
|
|
156
|
+
}, ee = (e, r) => {
|
|
157
|
+
var p;
|
|
158
|
+
const n = j(a, c);
|
|
159
|
+
if ((P.get(e) ?? []).some((b) => b.group_key === n.group_key)) {
|
|
160
|
+
const b = n.group_key === null ? "Ungrouped" : ((p = a.groups.find((x) => x.key === n.group_key)) == null ? void 0 : p.label) ?? n.group_key;
|
|
161
|
+
D({
|
|
157
162
|
field: e,
|
|
158
|
-
text: `${
|
|
163
|
+
text: `${r} is already in ${b}. Select another section first.`
|
|
159
164
|
});
|
|
160
165
|
return;
|
|
161
166
|
}
|
|
162
|
-
|
|
163
|
-
},
|
|
164
|
-
(
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
167
|
+
D(null), u([Y(e, n)], { label: `Add another ${r}` }), l(S({ field: e, group_key: n.group_key }));
|
|
168
|
+
}, { data: B = [] } = _e(i), G = Q(
|
|
169
|
+
() => ve(a, B, f),
|
|
170
|
+
[a, B, f]
|
|
171
|
+
).filter((e) => h(e.title, e.field)).slice(0, 8), I = f.filter((e) => e.field && !e.field.startsWith("__")).map((e) => ({ ...e, title: e.label || $(e.field) })).filter((e) => h(e.title, e.field)).sort((e, r) => e.title.localeCompare(r.title)), U = [...ke, ...de().map((e) => `__ext_${e}__`)].filter(
|
|
172
|
+
(e) => t === "header" ? e === "__owners__" : !0
|
|
173
|
+
).filter((e) => h(R(e), z[e])), q = X.filter((e) => h(e.name, e.widget_type)), y = ce(a, c), k = y.op === "group_create" ? y.label.replace(/^New /, "") : "";
|
|
174
|
+
return /* @__PURE__ */ d("div", { "data-editor-add": "", className: "flex flex-col px-2 pb-4", children: [
|
|
175
|
+
/* @__PURE__ */ d("div", { className: "sticky top-0 z-10 flex flex-col gap-2 bg-white px-1 pb-1 pt-2 dark:bg-card", children: [
|
|
176
|
+
/* @__PURE__ */ d("div", { className: "relative", children: [
|
|
177
|
+
/* @__PURE__ */ o(re, { className: "pointer-events-none absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-slate-400" }),
|
|
178
|
+
/* @__PURE__ */ o(
|
|
171
179
|
"input",
|
|
172
180
|
{
|
|
173
|
-
value:
|
|
174
|
-
onChange: (e) =>
|
|
181
|
+
value: _,
|
|
182
|
+
onChange: (e) => m(e.target.value),
|
|
175
183
|
placeholder: "Find a field, panel or widget",
|
|
176
184
|
"aria-label": "Find something to add",
|
|
177
|
-
className:
|
|
185
|
+
className: we
|
|
178
186
|
}
|
|
179
187
|
)
|
|
180
188
|
] }),
|
|
181
|
-
/* @__PURE__ */
|
|
182
|
-
/* @__PURE__ */
|
|
183
|
-
["form", "header"].map((e) => /* @__PURE__ */
|
|
189
|
+
/* @__PURE__ */ d("div", { className: "flex items-center gap-1 text-[12px] text-slate-500 dark:text-muted-foreground", children: [
|
|
190
|
+
/* @__PURE__ */ o("span", { className: "mr-1", children: "Add to" }),
|
|
191
|
+
["form", "header"].map((e) => /* @__PURE__ */ o(
|
|
184
192
|
"button",
|
|
185
193
|
{
|
|
186
194
|
type: "button",
|
|
187
|
-
"aria-pressed":
|
|
188
|
-
onClick: () =>
|
|
189
|
-
className:
|
|
195
|
+
"aria-pressed": t === e,
|
|
196
|
+
onClick: () => s(e),
|
|
197
|
+
className: V(
|
|
190
198
|
"rounded-md px-2 py-0.5 font-medium transition-colors",
|
|
191
|
-
|
|
199
|
+
t === e ? "bg-accent text-slate-900 dark:text-foreground" : "hover:bg-muted hover:text-slate-800 dark:hover:text-foreground"
|
|
192
200
|
),
|
|
193
201
|
children: e === "form" ? "Form" : "Header strip"
|
|
194
202
|
},
|
|
@@ -196,63 +204,90 @@ function Re({
|
|
|
196
204
|
))
|
|
197
205
|
] })
|
|
198
206
|
] }),
|
|
199
|
-
|
|
200
|
-
/* @__PURE__ */
|
|
201
|
-
/* @__PURE__ */
|
|
202
|
-
|
|
207
|
+
t === "form" && h(k, "section", "tab", "step") && /* @__PURE__ */ d(H, { children: [
|
|
208
|
+
/* @__PURE__ */ o("p", { className: N, children: "Layout" }),
|
|
209
|
+
/* @__PURE__ */ o(
|
|
210
|
+
w,
|
|
203
211
|
{
|
|
204
|
-
title:
|
|
205
|
-
sub: `A new ${
|
|
212
|
+
title: k.charAt(0).toUpperCase() + k.slice(1),
|
|
213
|
+
sub: `A new ${k.toLowerCase()} after the selection`,
|
|
206
214
|
attrs: { "data-add-section": "" },
|
|
207
|
-
aside: /* @__PURE__ */
|
|
215
|
+
aside: /* @__PURE__ */ o(oe, { className: "h-3.5 w-3.5 text-slate-400" }),
|
|
208
216
|
onClick: () => {
|
|
209
|
-
u([
|
|
217
|
+
u([y], { label: `Add ${k.toLowerCase()}` }), y.op === "group_create" && l({ kind: "group", key: y.key });
|
|
210
218
|
}
|
|
211
219
|
}
|
|
212
220
|
)
|
|
213
221
|
] }),
|
|
214
|
-
/* @__PURE__ */
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
222
|
+
t === "form" && !_.trim() && /* @__PURE__ */ o(ue, { bundle: a, collection: i, apply: u }),
|
|
223
|
+
t === "form" && G.length > 0 && /* @__PURE__ */ d(H, { children: [
|
|
224
|
+
/* @__PURE__ */ o("p", { className: N, children: "On other forms" }),
|
|
225
|
+
G.map((e) => /* @__PURE__ */ o(
|
|
226
|
+
w,
|
|
227
|
+
{
|
|
228
|
+
title: e.title,
|
|
229
|
+
sub: `On ${e.count} of ${e.of} other forms · ${e.names.join(", ")}`,
|
|
230
|
+
attrs: { "data-add-suggested": e.field },
|
|
231
|
+
aside: /* @__PURE__ */ o(K, { className: "h-3.5 w-3.5 shrink-0 text-slate-400 opacity-0 group-hover:opacity-100" }),
|
|
232
|
+
onClick: () => O(e.field, e.title),
|
|
233
|
+
drag: F(e.field, e.title, null)
|
|
234
|
+
},
|
|
235
|
+
e.field
|
|
236
|
+
))
|
|
237
|
+
] }),
|
|
238
|
+
t === "form" && /* @__PURE__ */ o(
|
|
239
|
+
he,
|
|
240
|
+
{
|
|
241
|
+
bundle: a,
|
|
242
|
+
collection: i,
|
|
243
|
+
selected: c,
|
|
244
|
+
apply: u,
|
|
245
|
+
onSelect: l,
|
|
246
|
+
matches: h
|
|
247
|
+
}
|
|
248
|
+
),
|
|
249
|
+
/* @__PURE__ */ o("p", { className: N, children: "Fields" }),
|
|
250
|
+
I.map((e) => {
|
|
251
|
+
const r = t === "header" ? E(e.field) : C(e.field);
|
|
252
|
+
return /* @__PURE__ */ d("div", { children: [
|
|
253
|
+
/* @__PURE__ */ o(
|
|
254
|
+
w,
|
|
220
255
|
{
|
|
221
256
|
title: e.title,
|
|
222
|
-
sub: [e.field,
|
|
223
|
-
attrs: { "data-add-field": e.field, "data-on-form":
|
|
224
|
-
aside:
|
|
225
|
-
onClick: () =>
|
|
226
|
-
drag:
|
|
227
|
-
extra:
|
|
257
|
+
sub: [e.field, Ne(e), T ? ye(T.pct.get(e.field), T.total) : null].filter(Boolean).join(" · "),
|
|
258
|
+
attrs: { "data-add-field": e.field, "data-on-form": r ? "true" : void 0 },
|
|
259
|
+
aside: r ? /* @__PURE__ */ o(M, { children: t === "header" ? "in header" : "on this form" }) : /* @__PURE__ */ o(K, { className: "h-3.5 w-3.5 shrink-0 text-slate-400 opacity-0 group-hover:opacity-100" }),
|
|
260
|
+
onClick: () => O(e.field, e.title),
|
|
261
|
+
drag: F(e.field, e.title, r),
|
|
262
|
+
extra: r && t === "form" ? /* @__PURE__ */ o(
|
|
228
263
|
"button",
|
|
229
264
|
{
|
|
230
265
|
type: "button",
|
|
231
266
|
"aria-label": `Add another copy of ${e.title}`,
|
|
232
267
|
"data-add-copy": e.field,
|
|
233
268
|
"data-tip": "Add another copy after the selection",
|
|
234
|
-
onClick: () =>
|
|
269
|
+
onClick: () => ee(e.field, e.title),
|
|
235
270
|
className: "inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-md text-slate-400 transition-colors hover:bg-muted hover:text-slate-700 dark:hover:text-foreground",
|
|
236
|
-
children: /* @__PURE__ */
|
|
271
|
+
children: /* @__PURE__ */ o(ae, { className: "h-3.5 w-3.5" })
|
|
237
272
|
}
|
|
238
273
|
) : null
|
|
239
274
|
}
|
|
240
275
|
),
|
|
241
|
-
(
|
|
276
|
+
(v == null ? void 0 : v.field) === e.field && /* @__PURE__ */ o(
|
|
242
277
|
"p",
|
|
243
278
|
{
|
|
244
279
|
role: "status",
|
|
245
280
|
"data-add-notice": "",
|
|
246
281
|
className: "px-2 pb-1 text-[11.5px] text-amber-700 dark:text-amber-300",
|
|
247
|
-
children:
|
|
282
|
+
children: v.text
|
|
248
283
|
}
|
|
249
284
|
)
|
|
250
285
|
] }, e.field);
|
|
251
286
|
}),
|
|
252
|
-
!
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
const
|
|
287
|
+
!I.length && /* @__PURE__ */ o("p", { className: "px-2 py-1.5 text-[12px] text-slate-500 dark:text-muted-foreground", children: "No fields match." }),
|
|
288
|
+
U.length > 0 && /* @__PURE__ */ o("p", { className: N, children: "Panels" }),
|
|
289
|
+
U.map((e) => {
|
|
290
|
+
const r = t === "header" ? E(e) : C(e), n = e === "__subtitle__" ? {
|
|
256
291
|
input_bindings: [
|
|
257
292
|
{
|
|
258
293
|
key: "__subtitle_config__",
|
|
@@ -261,41 +296,64 @@ function Re({
|
|
|
261
296
|
}
|
|
262
297
|
]
|
|
263
298
|
} : void 0;
|
|
264
|
-
return /* @__PURE__ */
|
|
265
|
-
|
|
299
|
+
return /* @__PURE__ */ o(
|
|
300
|
+
w,
|
|
266
301
|
{
|
|
267
|
-
title:
|
|
268
|
-
sub:
|
|
269
|
-
attrs: { "data-add-slot": e, "data-on-form":
|
|
270
|
-
aside:
|
|
271
|
-
onClick: () =>
|
|
272
|
-
drag: e === "__subtitle__" ? null :
|
|
302
|
+
title: R(e),
|
|
303
|
+
sub: z[e] ?? "Extension panel",
|
|
304
|
+
attrs: { "data-add-slot": e, "data-on-form": r ? "true" : void 0 },
|
|
305
|
+
aside: r ? /* @__PURE__ */ o(M, { children: "on this form" }) : null,
|
|
306
|
+
onClick: () => O(e, R(e), n),
|
|
307
|
+
drag: e === "__subtitle__" ? null : F(e, R(e), r)
|
|
273
308
|
},
|
|
274
309
|
e
|
|
275
310
|
);
|
|
276
311
|
}),
|
|
277
|
-
|
|
278
|
-
|
|
312
|
+
t === "form" && (q.length > 0 || L) && /* @__PURE__ */ o("p", { className: N, children: "Widgets" }),
|
|
313
|
+
t === "form" && L && /* @__PURE__ */ d("p", { role: "alert", className: "px-2 py-1.5 text-[12px] text-red-700 dark:text-red-300", children: [
|
|
279
314
|
"Widgets could not be loaded: ",
|
|
280
|
-
|
|
315
|
+
L.message
|
|
281
316
|
] }),
|
|
282
|
-
|
|
283
|
-
const
|
|
284
|
-
return /* @__PURE__ */
|
|
285
|
-
|
|
317
|
+
t === "form" && q.map((e) => {
|
|
318
|
+
const r = `__widget_${e.id}__`, n = C(r);
|
|
319
|
+
return /* @__PURE__ */ o(
|
|
320
|
+
w,
|
|
286
321
|
{
|
|
287
322
|
title: e.name,
|
|
288
|
-
sub:
|
|
289
|
-
attrs: { "data-add-widget": String(e.id), "data-on-form":
|
|
290
|
-
aside:
|
|
291
|
-
onClick: () =>
|
|
292
|
-
drag:
|
|
323
|
+
sub: $(e.widget_type),
|
|
324
|
+
attrs: { "data-add-widget": String(e.id), "data-on-form": n ? "true" : void 0 },
|
|
325
|
+
aside: n ? /* @__PURE__ */ o(M, { children: "on this form" }) : null,
|
|
326
|
+
onClick: () => O(r, e.name, J(e)),
|
|
327
|
+
drag: F(r, e.name, n, J(e))
|
|
293
328
|
},
|
|
294
329
|
e.id
|
|
295
330
|
);
|
|
296
331
|
})
|
|
297
332
|
] });
|
|
298
333
|
}
|
|
334
|
+
function ve(a, i, c) {
|
|
335
|
+
const u = String(a.layout.layout_type || "grouped"), l = i.filter(
|
|
336
|
+
(t) => Number(t.layout_id) !== Number(a.layout.id) && t.layout_type === u
|
|
337
|
+
);
|
|
338
|
+
if (!l.length) return [];
|
|
339
|
+
const g = new Set(
|
|
340
|
+
a.placements.filter((t) => t.group_key !== A).map((t) => t.field)
|
|
341
|
+
), _ = new Map(c.map((t) => [t.field, t])), m = /* @__PURE__ */ new Map();
|
|
342
|
+
for (const t of l)
|
|
343
|
+
for (const s of t.fields)
|
|
344
|
+
!g.has(s) && _.has(s) && m.set(s, [...m.get(s) ?? [], t.name]);
|
|
345
|
+
return [...m.entries()].map(([t, s]) => {
|
|
346
|
+
var f;
|
|
347
|
+
return {
|
|
348
|
+
field: t,
|
|
349
|
+
title: ((f = _.get(t)) == null ? void 0 : f.label) || $(t),
|
|
350
|
+
count: s.length,
|
|
351
|
+
of: l.length,
|
|
352
|
+
names: s.slice(0, 3).concat(s.length > 3 ? [`${s.length - 3} more`] : [])
|
|
353
|
+
};
|
|
354
|
+
}).sort((t, s) => s.count - t.count || t.title.localeCompare(s.title));
|
|
355
|
+
}
|
|
299
356
|
export {
|
|
300
|
-
|
|
357
|
+
He as AddPanel,
|
|
358
|
+
ve as otherFormSuggestions
|
|
301
359
|
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { jsxs as e, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { Shuffle as a } from "lucide-react";
|
|
3
|
+
import { cn as u } from "../../lib/utils.js";
|
|
4
|
+
import { barBtn as c } from "./toolbar-kit.js";
|
|
5
|
+
const i = "nvr-layout-structure-menu";
|
|
6
|
+
function s(t, r) {
|
|
7
|
+
t.dispatchEvent(new CustomEvent(i, { bubbles: !0, detail: { targets: r } }));
|
|
8
|
+
}
|
|
9
|
+
const p = () => typeof navigator < "u" && /Mac|iP(hone|ad)/.test(navigator.platform), l = () => p() ? "⌘D" : "Ctrl+D";
|
|
10
|
+
function b({
|
|
11
|
+
targets: t,
|
|
12
|
+
className: r
|
|
13
|
+
}) {
|
|
14
|
+
return /* @__PURE__ */ e(
|
|
15
|
+
"button",
|
|
16
|
+
{
|
|
17
|
+
type: "button",
|
|
18
|
+
"data-structure-open": "",
|
|
19
|
+
onClick: (n) => s(n.currentTarget, t),
|
|
20
|
+
"data-tip": `Duplicate (${l()}), wrap, unwrap, convert, copy rules, pin — or right-click it on the form`,
|
|
21
|
+
className: u(c, r),
|
|
22
|
+
children: [
|
|
23
|
+
/* @__PURE__ */ o(a, { className: "h-3.5 w-3.5 shrink-0" }),
|
|
24
|
+
"Arrange…"
|
|
25
|
+
]
|
|
26
|
+
}
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
export {
|
|
30
|
+
b as ArrangeButton,
|
|
31
|
+
i as STRUCTURE_MENU_EVENT,
|
|
32
|
+
l as duplicateKeys,
|
|
33
|
+
s as openStructureMenu
|
|
34
|
+
};
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { jsxs as o, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { Rows3 as x } from "lucide-react";
|
|
3
|
+
import { useState as h, useMemo as w } from "react";
|
|
4
|
+
import { Popover as b, PopoverContent as k } from "../ui/popover.js";
|
|
5
|
+
import { Switch as y } from "../ui/switch.js";
|
|
6
|
+
import { planAutoArrange as v } from "./auto-arrange.js";
|
|
7
|
+
import { plural as p } from "./field-zones.js";
|
|
8
|
+
import { ToolButton as N } from "./toolbar-kit.js";
|
|
9
|
+
function A(e) {
|
|
10
|
+
const r = [];
|
|
11
|
+
return e.rowsAfter !== e.rowsBefore && r.push(`${e.rowsBefore} rows → ${e.rowsAfter}`), e.gapsBefore > e.gapsAfter && r.push(`${p(e.gapsBefore - e.gapsAfter, "gap")} closed`), e.moved && r.push(`${p(e.moved, "field")} ${e.moved === 1 ? "moves" : "move"}`), e.widened.length && r.push(`${p(e.widened.length, "field")} widened`), r.join(" · ");
|
|
12
|
+
}
|
|
13
|
+
function S({
|
|
14
|
+
bundle: e,
|
|
15
|
+
apply: r,
|
|
16
|
+
zone: s,
|
|
17
|
+
zoneLabel: u,
|
|
18
|
+
className: f
|
|
19
|
+
}) {
|
|
20
|
+
const [d, n] = h(!1), [l, g] = h(!0), a = w(
|
|
21
|
+
() => d ? v(e, { zone: s, widen: l }) : null,
|
|
22
|
+
[d, e, s, l]
|
|
23
|
+
), i = s === void 0, m = i ? "Auto-arrange the form" : `Auto-arrange ${u ?? "this section"}`;
|
|
24
|
+
return /* @__PURE__ */ o(b, { open: d, onOpenChange: n, children: [
|
|
25
|
+
/* @__PURE__ */ t(
|
|
26
|
+
N,
|
|
27
|
+
{
|
|
28
|
+
popover: !0,
|
|
29
|
+
onOpen: () => n(!0),
|
|
30
|
+
label: i ? "Auto-arrange" : "Auto-arrange fields",
|
|
31
|
+
icon: /* @__PURE__ */ t(x, { className: "h-3.5 w-3.5 shrink-0" }),
|
|
32
|
+
tip: "Pack fields into tidy rows by width and close the gaps",
|
|
33
|
+
hint: "Tidy rows by width, gaps closed",
|
|
34
|
+
className: f,
|
|
35
|
+
data: { "data-auto-arrange": i ? "form" : "section" }
|
|
36
|
+
}
|
|
37
|
+
),
|
|
38
|
+
/* @__PURE__ */ o(k, { align: "end", className: "w-[340px] p-3", "data-auto-arrange-plan": "", children: [
|
|
39
|
+
/* @__PURE__ */ t("p", { className: "text-[13px] font-semibold text-slate-900 dark:text-foreground", children: m }),
|
|
40
|
+
/* @__PURE__ */ t("p", { className: "mt-0.5 text-[12px] leading-snug text-slate-500 dark:text-muted-foreground", children: "Fills each row of the 12-column grid, pulling a later field up when it fits. Undo puts everything back." }),
|
|
41
|
+
/* @__PURE__ */ o("div", { className: "mt-3 flex items-center justify-between gap-3 text-[12.5px] text-slate-700 dark:text-foreground", children: [
|
|
42
|
+
"Widen fields to fill rows",
|
|
43
|
+
/* @__PURE__ */ t(
|
|
44
|
+
y,
|
|
45
|
+
{
|
|
46
|
+
checked: l,
|
|
47
|
+
onCheckedChange: g,
|
|
48
|
+
"aria-label": "Widen fields to fill rows",
|
|
49
|
+
className: "h-[18px] w-8 border-0 data-[state=checked]:bg-nvr-cyan data-[state=unchecked]:bg-slate-300 dark:data-[state=unchecked]:bg-slate-600 [&>span]:mx-0.5 [&>span]:h-3.5 [&>span]:w-3.5 [&>span]:bg-white [&>span]:shadow-sm [&>span]:data-[state=checked]:translate-x-3.5"
|
|
50
|
+
}
|
|
51
|
+
)
|
|
52
|
+
] }),
|
|
53
|
+
/* @__PURE__ */ t("div", { className: "mt-3 border-t border-slate-100 pt-2.5 dark:border-border", children: a && a.zones.length > 0 ? /* @__PURE__ */ t("ul", { className: "space-y-1.5", "aria-label": "What changes", children: a.zones.map((c) => /* @__PURE__ */ o("li", { className: "text-[12.5px] leading-snug", children: [
|
|
54
|
+
/* @__PURE__ */ t("span", { className: "font-medium text-slate-800 dark:text-foreground", children: c.label }),
|
|
55
|
+
/* @__PURE__ */ t("span", { className: "block text-slate-500 dark:text-muted-foreground", children: A(c) })
|
|
56
|
+
] }, c.key ?? "")) }) : /* @__PURE__ */ t("p", { className: "text-[12.5px] text-slate-500 dark:text-muted-foreground", children: a && a.checked === 0 ? "There are no fields to arrange here." : "Every row is already tidy." }) }),
|
|
57
|
+
/* @__PURE__ */ o("div", { className: "mt-3 flex justify-end gap-2", children: [
|
|
58
|
+
/* @__PURE__ */ t(
|
|
59
|
+
"button",
|
|
60
|
+
{
|
|
61
|
+
type: "button",
|
|
62
|
+
onClick: () => n(!1),
|
|
63
|
+
className: "h-7 rounded-md px-2.5 text-[12px] font-medium text-slate-600 hover:bg-muted dark:text-muted-foreground",
|
|
64
|
+
children: "Cancel"
|
|
65
|
+
}
|
|
66
|
+
),
|
|
67
|
+
/* @__PURE__ */ t(
|
|
68
|
+
"button",
|
|
69
|
+
{
|
|
70
|
+
type: "button",
|
|
71
|
+
"data-auto-arrange-apply": "",
|
|
72
|
+
disabled: !a || a.ops.length === 0,
|
|
73
|
+
onClick: () => {
|
|
74
|
+
a != null && a.ops.length && (r(a.ops, { label: m }), n(!1));
|
|
75
|
+
},
|
|
76
|
+
className: "h-7 rounded-md bg-nvr-cyan px-3 text-[12px] font-medium text-white transition-opacity hover:opacity-90 disabled:opacity-40",
|
|
77
|
+
children: "Arrange"
|
|
78
|
+
}
|
|
79
|
+
)
|
|
80
|
+
] })
|
|
81
|
+
] })
|
|
82
|
+
] });
|
|
83
|
+
}
|
|
84
|
+
export {
|
|
85
|
+
S as AutoArrangeButton
|
|
86
|
+
};
|