@nivaro/react 0.3.36 → 0.3.37
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/components/slots/CommentsSlot.js +44 -36
- package/dist/full.css +1 -1
- package/dist/hooks/useSessionRecorder.js +1 -1
- package/dist/index.d.ts +9 -1
- package/dist/shared/components/AgentBadge.js +26 -0
- package/dist/shared/components/AgentQuestionsCard.js +198 -0
- package/dist/shared/components/ItemEditForm.js +3329 -3263
- package/dist/shared/components/McpConnectionScope.js +480 -0
- package/dist/shared/components/MyWorkView.js +223 -208
- package/dist/shared/components/RecordReadView.js +620 -575
- package/dist/shared/components/chat/ChatPanel.js +683 -671
- package/dist/shared/components/imports/DownloadSampleButton.js +69 -0
- package/dist/shared/components/imports/ImportConsole.js +106 -104
- package/dist/shared/components/imports/RunDetailSheet.js +11 -10
- package/dist/shared/components/item-edit/FieldAffordances.js +32 -32
- package/dist/shared/components/item-edit/FormTour.js +279 -0
- package/dist/shared/components/item-edit/GroupSection.js +377 -360
- package/dist/shared/components/item-edit/PersonalDefaultControl.js +28 -28
- package/dist/shared/components/item-edit/entry/EntryStrip.js +30 -26
- package/dist/shared/components/item-edit/form-density.js +36 -0
- package/dist/shared/components/item-edit/useFormUsageBeacon.js +59 -46
- package/dist/shared/components/item-edit/usePersonalDefaults.js +312 -296
- package/dist/shared/components/layout-editor/AddPanel.js +349 -192
- package/dist/shared/components/layout-editor/DesignNode.js +126 -112
- package/dist/shared/components/layout-editor/EditorTopBar.js +123 -103
- package/dist/shared/components/layout-editor/LayoutEditor.js +829 -751
- package/dist/shared/components/layout-editor/PlaceTools.js +334 -0
- package/dist/shared/components/layout-editor/SlashInsert.js +252 -0
- package/dist/shared/components/layout-editor/StructureMenu.js +285 -242
- package/dist/shared/components/layout-editor/add-target.js +54 -43
- package/dist/shared/components/layout-editor/ai-forms/AiComposer.js +238 -155
- package/dist/shared/components/layout-editor/ai-forms/AiFormsButton.js +1 -1
- package/dist/shared/components/layout-editor/ai-forms/ai-forms-api.js +15 -12
- package/dist/shared/components/layout-editor/dnd/LayoutDndProvider.js +347 -189
- package/dist/shared/components/layout-editor/dnd/TrashZone.js +60 -32
- package/dist/shared/components/layout-editor/dnd/UndoChip.js +76 -0
- package/dist/shared/components/layout-editor/dnd/merge-drop.js +33 -0
- package/dist/shared/components/layout-editor/dnd/multi-drop.js +87 -0
- package/dist/shared/components/layout-editor/dnd/node.js +115 -105
- package/dist/shared/components/layout-editor/dnd/sensors.js +23 -0
- package/dist/shared/components/layout-editor/dnd/trash-drop.js +34 -28
- package/dist/shared/components/layout-editor/dnd/trash-links.js +97 -0
- package/dist/shared/components/layout-editor/even-row.js +86 -0
- package/dist/shared/components/layout-editor/field-list.js +99 -0
- package/dist/shared/components/layout-editor/format-painter.js +102 -0
- package/dist/shared/components/layout-editor/grid-guides.js +15 -13
- package/dist/shared/components/layout-editor/inspector/BehaviourSettings.js +150 -132
- package/dist/shared/components/layout-editor/inspector/BulkInspector.js +57 -53
- package/dist/shared/components/layout-editor/inspector/EvenRowAction.js +31 -0
- package/dist/shared/components/layout-editor/inspector/GroupInspector.js +154 -141
- package/dist/shared/components/layout-editor/inspector/Inspector.js +209 -178
- package/dist/shared/components/layout-editor/inspector/LookTab.js +106 -98
- package/dist/shared/components/layout-editor/inspector/RulesTab.js +38 -37
- package/dist/shared/components/layout-editor/inspector/kit.js +280 -223
- package/dist/shared/components/layout-editor/keyboard-move.js +15 -15
- package/dist/shared/components/layout-editor/lint/LabelStyle.js +201 -0
- package/dist/shared/components/layout-editor/lint/LintPanel.js +132 -84
- package/dist/shared/components/layout-editor/lint/lint-api.js +65 -28
- package/dist/shared/components/layout-editor/nav/NavTools.js +14 -12
- package/dist/shared/components/layout-editor/nav/ZoomControls.js +145 -0
- package/dist/shared/components/layout-editor/nav/useEditorNav.js +34 -32
- package/dist/shared/components/layout-editor/nav/view-prefs.js +100 -15
- package/dist/shared/components/layout-editor/outputs/LayoutFile.js +89 -0
- package/dist/shared/components/layout-editor/outputs/OutputsButton.js +272 -195
- package/dist/shared/components/layout-editor/outputs/layout-file-plan.js +176 -0
- package/dist/shared/components/layout-editor/outputs/output-api.js +71 -37
- package/dist/shared/components/layout-editor/overview/describe-conditions.js +16 -11
- package/dist/shared/components/layout-editor/overview/purpose.js +5 -5
- package/dist/shared/components/layout-editor/parity-keys.json.js +1 -1
- package/dist/shared/components/layout-editor/pin.js +37 -19
- package/dist/shared/components/layout-editor/place-clip.js +257 -0
- package/dist/shared/components/layout-editor/preview/PreviewModes.js +27 -26
- package/dist/shared/components/layout-editor/preview/PreviewPanes.js +148 -117
- package/dist/shared/components/layout-editor/preview/SampleRecord.js +113 -0
- package/dist/shared/components/layout-editor/preview/preview-model.js +79 -60
- package/dist/shared/components/layout-editor/preview/sample-record.js +105 -0
- package/dist/shared/components/layout-editor/removed-log.js +151 -0
- package/dist/shared/components/layout-editor/reuse/LibraryRows.js +109 -78
- package/dist/shared/components/layout-editor/reuse/linked-sections.js +373 -0
- package/dist/shared/components/layout-editor/revert-element.js +140 -0
- package/dist/shared/components/layout-editor/section-structure.js +193 -170
- package/dist/shared/components/layout-editor/settings/EntrySection.js +63 -45
- package/dist/shared/components/layout-editor/settings/LayoutSection.js +63 -32
- package/dist/shared/components/layout-editor/settings/ResolveSettings.js +179 -137
- package/dist/shared/components/layout-editor/settings/WhoSection.js +18 -17
- package/dist/shared/components/layout-editor/settings/settings-registry.js +24 -0
- package/dist/shared/components/layout-editor/shortcuts.js +21 -16
- package/dist/shared/components/layout-editor/structure-ops.js +221 -195
- package/dist/shared/components/layout-editor/usage/UsagePanel.js +133 -85
- package/dist/shared/components/layout-editor/usage/refusal-lens.js +130 -0
- package/dist/shared/components/layout-editor/usage/usage-api.js +12 -11
- package/dist/shared/components/panels/CommentPanel.js +47 -45
- package/dist/shared/components/panels/RevisionsPanel.js +66 -64
- package/dist/shared/components/panels/TaskPanel.js +395 -332
- package/dist/shared/components/profile/AgentsPanel.js +196 -147
- package/dist/shared/components/profile/ConnectionRollback.js +329 -0
- package/dist/shared/components/profile/MyDefaultsCard.js +526 -520
- package/dist/shared/lib/entry-config.js +22 -22
- package/dist/shared/lib/form-usage-beacon.js +91 -55
- package/dist/shared/lib/layout-lint.js +530 -284
- package/dist/shared/lib/layout-resolve.js +58 -44
- package/package.json +1 -1
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
import { jsxs as f, Fragment as _, jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import { useState as x, useRef as v, useEffect as N } from "react";
|
|
3
3
|
import { badgeClasses as b } from "../../../lib/entry-badge-style.js";
|
|
4
|
-
import { entryConfigOf as w, ENTRY_THRESHOLD_DEFAULT as S, sanitizeEntryConfig as
|
|
5
|
-
import { cn as
|
|
4
|
+
import { entryConfigOf as w, ENTRY_THRESHOLD_DEFAULT as S, sanitizeEntryConfig as T, ENTRY_THRESHOLD_MAX as E, ENTRY_BADGE_TAG_MAX as B, BADGE_COLORS as D } from "../../../lib/entry-config.js";
|
|
5
|
+
import { cn as h } from "../../../lib/utils.js";
|
|
6
6
|
import { useEntryEditor as A } from "../entry/entry-editor-context.js";
|
|
7
7
|
import { presetSummary as R, withPresets as O } from "../entry/presets.js";
|
|
8
|
-
import { Setting as d, Toggle as
|
|
9
|
-
function U(
|
|
8
|
+
import { Setting as d, Toggle as p, quietText as g, smallBtn as m, inputCls as k } from "./controls.js";
|
|
9
|
+
function U(n) {
|
|
10
10
|
var l;
|
|
11
|
-
const
|
|
12
|
-
const C =
|
|
13
|
-
(c ?
|
|
14
|
-
}, s = ((l =
|
|
11
|
+
const o = w(n.layout), u = A(), t = (e, a, c = !1) => {
|
|
12
|
+
const C = T({ ...o, ...e });
|
|
13
|
+
(c ? n.setText : n.set)({ entry_config: C }, a);
|
|
14
|
+
}, s = ((l = o.tab_order) == null ? void 0 : l.length) ?? 0, i = o.presets ?? [];
|
|
15
15
|
return /* @__PURE__ */ f(_, { children: [
|
|
16
16
|
/* @__PURE__ */ r(
|
|
17
17
|
d,
|
|
18
18
|
{
|
|
19
19
|
k: "layout.focus_first",
|
|
20
20
|
control: /* @__PURE__ */ r(
|
|
21
|
-
|
|
21
|
+
p,
|
|
22
22
|
{
|
|
23
23
|
label: "Start on the first empty required field",
|
|
24
|
-
checked:
|
|
24
|
+
checked: o.focus_first === !0,
|
|
25
25
|
onChange: (e) => t(
|
|
26
26
|
{ focus_first: e || void 0 },
|
|
27
27
|
e ? "Start on the first empty required field" : "Stop starting on a required field"
|
|
@@ -35,10 +35,10 @@ function U(o) {
|
|
|
35
35
|
{
|
|
36
36
|
k: "layout.enter_next",
|
|
37
37
|
control: /* @__PURE__ */ r(
|
|
38
|
-
|
|
38
|
+
p,
|
|
39
39
|
{
|
|
40
40
|
label: "Enter moves to the next field",
|
|
41
|
-
checked:
|
|
41
|
+
checked: o.enter_next === !0,
|
|
42
42
|
onChange: (e) => t(
|
|
43
43
|
{ enter_next: e || void 0 },
|
|
44
44
|
e ? "Make Enter move to the next field" : "Make Enter save again"
|
|
@@ -57,7 +57,7 @@ function U(o) {
|
|
|
57
57
|
{
|
|
58
58
|
type: "button",
|
|
59
59
|
"data-tab-order-start": "",
|
|
60
|
-
className:
|
|
60
|
+
className: m,
|
|
61
61
|
disabled: u.tabOrderActive,
|
|
62
62
|
onClick: u.startTabOrder,
|
|
63
63
|
children: s ? "Change order on the canvas" : "Set order on the canvas"
|
|
@@ -67,7 +67,7 @@ function U(o) {
|
|
|
67
67
|
"button",
|
|
68
68
|
{
|
|
69
69
|
type: "button",
|
|
70
|
-
className:
|
|
70
|
+
className: m,
|
|
71
71
|
onClick: () => t({ tab_order: void 0 }, "Clear the tab order"),
|
|
72
72
|
children: "Clear"
|
|
73
73
|
}
|
|
@@ -81,10 +81,10 @@ function U(o) {
|
|
|
81
81
|
{
|
|
82
82
|
k: "layout.adaptive_mode",
|
|
83
83
|
control: /* @__PURE__ */ r(
|
|
84
|
-
|
|
84
|
+
p,
|
|
85
85
|
{
|
|
86
86
|
label: "Guided steps for new people",
|
|
87
|
-
checked:
|
|
87
|
+
checked: o.adaptive === !0,
|
|
88
88
|
onChange: (e) => t(
|
|
89
89
|
{ adaptive: e || void 0 },
|
|
90
90
|
e ? "Show steps to new people" : "Stop switching between steps and tabs"
|
|
@@ -100,21 +100,39 @@ function U(o) {
|
|
|
100
100
|
control: /* @__PURE__ */ r(
|
|
101
101
|
F,
|
|
102
102
|
{
|
|
103
|
-
value:
|
|
103
|
+
value: o.adaptive_threshold ?? S,
|
|
104
104
|
label: "Records before tabs",
|
|
105
|
-
disabled:
|
|
105
|
+
disabled: o.adaptive !== !0,
|
|
106
106
|
onChange: (e) => t({ adaptive_threshold: e }, "Change records before tabs", !0),
|
|
107
|
-
onBlur:
|
|
107
|
+
onBlur: n.flush
|
|
108
108
|
}
|
|
109
109
|
)
|
|
110
110
|
}
|
|
111
111
|
),
|
|
112
|
+
/* @__PURE__ */ r(
|
|
113
|
+
d,
|
|
114
|
+
{
|
|
115
|
+
k: "layout.tour",
|
|
116
|
+
control: /* @__PURE__ */ r(
|
|
117
|
+
p,
|
|
118
|
+
{
|
|
119
|
+
label: "First-use tour",
|
|
120
|
+
checked: o.tour === !0,
|
|
121
|
+
onChange: (e) => t(
|
|
122
|
+
{ tour: e || void 0 },
|
|
123
|
+
e ? "Turn on the first-use tour" : "Turn off the first-use tour"
|
|
124
|
+
)
|
|
125
|
+
}
|
|
126
|
+
),
|
|
127
|
+
note: o.tour ? "Each section is a step: its name, its help text, or the fields it holds. Section help text reads best here." : void 0
|
|
128
|
+
}
|
|
129
|
+
),
|
|
112
130
|
/* @__PURE__ */ r(d, { k: "layout.badge", children: /* @__PURE__ */ r(
|
|
113
131
|
G,
|
|
114
132
|
{
|
|
115
|
-
config:
|
|
133
|
+
config: o,
|
|
116
134
|
onChange: (e, a) => t({ badge: e }, "Change the form badge", a),
|
|
117
|
-
onBlur:
|
|
135
|
+
onBlur: n.flush
|
|
118
136
|
}
|
|
119
137
|
) }),
|
|
120
138
|
/* @__PURE__ */ r(
|
|
@@ -122,10 +140,10 @@ function U(o) {
|
|
|
122
140
|
{
|
|
123
141
|
k: "layout.glossary",
|
|
124
142
|
control: /* @__PURE__ */ r(
|
|
125
|
-
|
|
143
|
+
p,
|
|
126
144
|
{
|
|
127
145
|
label: "Glossary tooltips in help text",
|
|
128
|
-
checked:
|
|
146
|
+
checked: o.glossary !== !1,
|
|
129
147
|
onChange: (e) => t(
|
|
130
148
|
{ glossary: e ? void 0 : !1 },
|
|
131
149
|
e ? "Turn on glossary tooltips" : "Turn off glossary tooltips"
|
|
@@ -142,7 +160,7 @@ function U(o) {
|
|
|
142
160
|
"button",
|
|
143
161
|
{
|
|
144
162
|
type: "button",
|
|
145
|
-
className:
|
|
163
|
+
className: m,
|
|
146
164
|
disabled: i.length === 0,
|
|
147
165
|
onClick: () => t({ presets: void 0 }, "Delete all presets"),
|
|
148
166
|
children: "Delete all"
|
|
@@ -155,20 +173,20 @@ function U(o) {
|
|
|
155
173
|
children: [
|
|
156
174
|
/* @__PURE__ */ f("span", { className: "min-w-0", children: [
|
|
157
175
|
/* @__PURE__ */ r("span", { className: "block truncate text-[12.5px] font-medium text-slate-800 dark:text-foreground", children: e.name }),
|
|
158
|
-
/* @__PURE__ */ r("span", { className:
|
|
176
|
+
/* @__PURE__ */ r("span", { className: h(g, "block truncate"), children: R(e) })
|
|
159
177
|
] }),
|
|
160
178
|
/* @__PURE__ */ r(
|
|
161
179
|
"button",
|
|
162
180
|
{
|
|
163
181
|
type: "button",
|
|
164
|
-
className:
|
|
182
|
+
className: m,
|
|
165
183
|
"aria-label": `Delete preset ${e.name}`,
|
|
166
184
|
onClick: () => {
|
|
167
185
|
var a;
|
|
168
186
|
return t(
|
|
169
187
|
{
|
|
170
188
|
presets: (a = O(
|
|
171
|
-
|
|
189
|
+
o,
|
|
172
190
|
i.filter((c) => c.id !== e.id)
|
|
173
191
|
)) == null ? void 0 : a.presets
|
|
174
192
|
},
|
|
@@ -187,45 +205,45 @@ function U(o) {
|
|
|
187
205
|
] });
|
|
188
206
|
}
|
|
189
207
|
function F({
|
|
190
|
-
value:
|
|
191
|
-
onChange:
|
|
208
|
+
value: n,
|
|
209
|
+
onChange: o,
|
|
192
210
|
onBlur: u,
|
|
193
211
|
label: t,
|
|
194
212
|
disabled: s
|
|
195
213
|
}) {
|
|
196
|
-
const [i, l] = x(String(
|
|
214
|
+
const [i, l] = x(String(n)), e = v(!1);
|
|
197
215
|
return N(() => {
|
|
198
|
-
e.current || l(String(
|
|
199
|
-
}, [
|
|
216
|
+
e.current || l(String(n));
|
|
217
|
+
}, [n]), /* @__PURE__ */ r(
|
|
200
218
|
"input",
|
|
201
219
|
{
|
|
202
220
|
type: "number",
|
|
203
221
|
min: 1,
|
|
204
|
-
max:
|
|
222
|
+
max: E,
|
|
205
223
|
"aria-label": t,
|
|
206
224
|
disabled: s,
|
|
207
225
|
value: i,
|
|
208
|
-
className:
|
|
226
|
+
className: h(k, "w-20"),
|
|
209
227
|
onFocus: () => {
|
|
210
228
|
e.current = !0;
|
|
211
229
|
},
|
|
212
230
|
onChange: (a) => {
|
|
213
231
|
l(a.target.value);
|
|
214
232
|
const c = Number(a.target.value);
|
|
215
|
-
Number.isFinite(c) && c >= 1 &&
|
|
233
|
+
Number.isFinite(c) && c >= 1 && o(c);
|
|
216
234
|
},
|
|
217
235
|
onBlur: () => {
|
|
218
|
-
e.current = !1, l(String(
|
|
236
|
+
e.current = !1, l(String(n)), u();
|
|
219
237
|
}
|
|
220
238
|
}
|
|
221
239
|
);
|
|
222
240
|
}
|
|
223
241
|
function G({
|
|
224
|
-
config:
|
|
225
|
-
onChange:
|
|
242
|
+
config: n,
|
|
243
|
+
onChange: o,
|
|
226
244
|
onBlur: u
|
|
227
245
|
}) {
|
|
228
|
-
const t =
|
|
246
|
+
const t = n.badge, [s, i] = x((t == null ? void 0 : t.tag) ?? ""), l = v(!1);
|
|
229
247
|
N(() => {
|
|
230
248
|
l.current || i((t == null ? void 0 : t.tag) ?? "");
|
|
231
249
|
}, [t == null ? void 0 : t.tag]);
|
|
@@ -240,12 +258,12 @@ function G({
|
|
|
240
258
|
placeholder: "Short tag, e.g. Sparing",
|
|
241
259
|
maxLength: B,
|
|
242
260
|
value: s,
|
|
243
|
-
className:
|
|
261
|
+
className: h(k, "min-w-0 flex-1"),
|
|
244
262
|
onFocus: () => {
|
|
245
263
|
l.current = !0;
|
|
246
264
|
},
|
|
247
265
|
onChange: (a) => {
|
|
248
|
-
i(a.target.value),
|
|
266
|
+
i(a.target.value), o(a.target.value.trim() ? { tag: a.target.value, color: e } : void 0, !0);
|
|
249
267
|
},
|
|
250
268
|
onBlur: () => {
|
|
251
269
|
l.current = !1, u();
|
|
@@ -256,7 +274,7 @@ function G({
|
|
|
256
274
|
"span",
|
|
257
275
|
{
|
|
258
276
|
"data-badge-preview": "",
|
|
259
|
-
className:
|
|
277
|
+
className: h(
|
|
260
278
|
"inline-flex h-5 shrink-0 items-center rounded-full px-2 text-[11px] font-medium",
|
|
261
279
|
b(t.color)
|
|
262
280
|
),
|
|
@@ -277,8 +295,8 @@ function G({
|
|
|
277
295
|
"aria-label": y(a),
|
|
278
296
|
"data-tip": s.trim() ? y(a) : "Type the badge text first",
|
|
279
297
|
disabled: !s.trim(),
|
|
280
|
-
onClick: () =>
|
|
281
|
-
className:
|
|
298
|
+
onClick: () => o({ tag: s, color: a }, !1),
|
|
299
|
+
className: h(
|
|
282
300
|
"h-5 w-5 rounded-full border transition-shadow disabled:cursor-not-allowed disabled:opacity-50",
|
|
283
301
|
b(a),
|
|
284
302
|
e === a && !!t && "ring-2 ring-nvr-cyan/60 ring-offset-1 ring-offset-white dark:ring-offset-card"
|
|
@@ -290,7 +308,7 @@ function G({
|
|
|
290
308
|
)
|
|
291
309
|
] });
|
|
292
310
|
}
|
|
293
|
-
const y = (
|
|
311
|
+
const y = (n) => n.charAt(0).toUpperCase() + n.slice(1);
|
|
294
312
|
export {
|
|
295
313
|
U as EntrySection
|
|
296
314
|
};
|
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { jsxs as f, Fragment as g, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { entryConfigOf as y, sanitizeEntryConfig as h } from "../../../lib/entry-config.js";
|
|
3
|
+
import { Setting as c, Segmented as b, quietText as m, PickList as _, Toggle as k } from "./controls.js";
|
|
4
|
+
import { changeLabel as v, toggleLabel as w } from "./section-props.js";
|
|
5
|
+
import { useFieldSources as C, numericFieldNames as L, fieldOptions as S } from "./settings-api.js";
|
|
5
6
|
import { ToggleSetting as u } from "./ToggleSetting.js";
|
|
6
|
-
function
|
|
7
|
-
const { layout:
|
|
8
|
-
return /* @__PURE__ */
|
|
9
|
-
/* @__PURE__ */
|
|
10
|
-
|
|
7
|
+
function D(e) {
|
|
8
|
+
const { layout: o } = e, a = o.tab_mode === "steps" ? "steps" : "tabs";
|
|
9
|
+
return /* @__PURE__ */ f(g, { children: [
|
|
10
|
+
/* @__PURE__ */ t(
|
|
11
|
+
c,
|
|
11
12
|
{
|
|
12
13
|
k: "layout.tab_mode",
|
|
13
|
-
control: /* @__PURE__ */
|
|
14
|
-
|
|
14
|
+
control: /* @__PURE__ */ t(
|
|
15
|
+
b,
|
|
15
16
|
{
|
|
16
17
|
ariaLabel: "Loose tabs show as",
|
|
17
18
|
value: a,
|
|
@@ -19,52 +20,82 @@ function F(e) {
|
|
|
19
20
|
{ value: "tabs", label: "Tabs" },
|
|
20
21
|
{ value: "steps", label: "Steps" }
|
|
21
22
|
],
|
|
22
|
-
onChange: (
|
|
23
|
+
onChange: (l) => e.set({ tab_mode: l }, v("layout.tab_mode"))
|
|
23
24
|
}
|
|
24
25
|
)
|
|
25
26
|
}
|
|
26
27
|
),
|
|
27
|
-
/* @__PURE__ */
|
|
28
|
-
/* @__PURE__ */
|
|
29
|
-
/* @__PURE__ */
|
|
28
|
+
/* @__PURE__ */ t(u, { k: "layout.validate_before_next", props: e }),
|
|
29
|
+
/* @__PURE__ */ t(u, { k: "layout.accordion_mode", props: e }),
|
|
30
|
+
/* @__PURE__ */ t(p, { ...e }),
|
|
31
|
+
/* @__PURE__ */ t(x, { ...e })
|
|
30
32
|
] });
|
|
31
33
|
}
|
|
32
|
-
function
|
|
33
|
-
const
|
|
34
|
-
return /* @__PURE__ */
|
|
35
|
-
|
|
34
|
+
function p(e) {
|
|
35
|
+
const o = y(e.layout), a = o.density === "compact" ? "compact" : "comfortable";
|
|
36
|
+
return /* @__PURE__ */ t(
|
|
37
|
+
c,
|
|
38
|
+
{
|
|
39
|
+
k: "layout.density",
|
|
40
|
+
control: /* @__PURE__ */ t(
|
|
41
|
+
b,
|
|
42
|
+
{
|
|
43
|
+
ariaLabel: "Density",
|
|
44
|
+
value: a,
|
|
45
|
+
options: [
|
|
46
|
+
{ value: "comfortable", label: "Comfortable" },
|
|
47
|
+
{ value: "compact", label: "Compact" }
|
|
48
|
+
],
|
|
49
|
+
onChange: (l) => e.set(
|
|
50
|
+
{
|
|
51
|
+
entry_config: h({
|
|
52
|
+
...o,
|
|
53
|
+
density: l === "compact" ? "compact" : void 0
|
|
54
|
+
})
|
|
55
|
+
},
|
|
56
|
+
l === "compact" ? "Make the form compact" : "Make the form comfortable"
|
|
57
|
+
)
|
|
58
|
+
}
|
|
59
|
+
)
|
|
60
|
+
}
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
function x(e) {
|
|
64
|
+
const { fields: o, columns: a, relations: l } = C(e.collection), i = L(e.collection, o, a, l), r = e.layout.row_order_field ? String(e.layout.row_order_field) : null, s = S(o, i);
|
|
65
|
+
return /* @__PURE__ */ t(
|
|
66
|
+
c,
|
|
36
67
|
{
|
|
37
68
|
k: "layout.row_order_field",
|
|
38
|
-
control: /* @__PURE__ */
|
|
39
|
-
|
|
69
|
+
control: /* @__PURE__ */ t(
|
|
70
|
+
k,
|
|
40
71
|
{
|
|
41
72
|
label: "Let people reorder rows",
|
|
42
73
|
checked: !!r,
|
|
43
74
|
disabled: !r && i.length === 0,
|
|
44
|
-
onChange: (
|
|
45
|
-
var
|
|
75
|
+
onChange: (n) => {
|
|
76
|
+
var d;
|
|
46
77
|
return e.set(
|
|
47
|
-
{ row_order_field:
|
|
48
|
-
w("layout.row_order_field",
|
|
78
|
+
{ row_order_field: n ? ((d = s[0]) == null ? void 0 : d.value) ?? null : null },
|
|
79
|
+
w("layout.row_order_field", n)
|
|
49
80
|
);
|
|
50
81
|
}
|
|
51
82
|
}
|
|
52
83
|
),
|
|
53
|
-
children: r ? /* @__PURE__ */
|
|
54
|
-
/* @__PURE__ */
|
|
55
|
-
/* @__PURE__ */
|
|
84
|
+
children: r ? /* @__PURE__ */ f("div", { className: "flex items-center gap-2", children: [
|
|
85
|
+
/* @__PURE__ */ t("span", { className: m, children: "Order is saved in" }),
|
|
86
|
+
/* @__PURE__ */ t(
|
|
56
87
|
_,
|
|
57
88
|
{
|
|
58
89
|
ariaLabel: "Order field",
|
|
59
90
|
value: r,
|
|
60
|
-
options:
|
|
61
|
-
onChange: (
|
|
91
|
+
options: s,
|
|
92
|
+
onChange: (n) => n && e.set({ row_order_field: n }, "Change the field rows are ordered by")
|
|
62
93
|
}
|
|
63
94
|
)
|
|
64
|
-
] }) : i.length === 0 ? /* @__PURE__ */
|
|
95
|
+
] }) : i.length === 0 ? /* @__PURE__ */ t("p", { className: m, children: "This collection has no number field to keep the order in." }) : null
|
|
65
96
|
}
|
|
66
97
|
);
|
|
67
98
|
}
|
|
68
99
|
export {
|
|
69
|
-
|
|
100
|
+
D as LayoutSection
|
|
70
101
|
};
|