@nivaro/react 0.3.36 → 0.3.38

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.
Files changed (102) hide show
  1. package/dist/components/slots/CommentsSlot.js +44 -36
  2. package/dist/full.css +1 -1
  3. package/dist/hooks/useSessionRecorder.js +1 -1
  4. package/dist/index.d.ts +9 -1
  5. package/dist/shared/components/AgentBadge.js +26 -0
  6. package/dist/shared/components/AgentQuestionsCard.js +198 -0
  7. package/dist/shared/components/ItemEditForm.js +3329 -3263
  8. package/dist/shared/components/McpConnectionScope.js +480 -0
  9. package/dist/shared/components/MyWorkView.js +223 -208
  10. package/dist/shared/components/RecordReadView.js +620 -575
  11. package/dist/shared/components/chat/ChatPanel.js +683 -671
  12. package/dist/shared/components/imports/DownloadSampleButton.js +69 -0
  13. package/dist/shared/components/imports/ImportConsole.js +106 -104
  14. package/dist/shared/components/imports/RunDetailSheet.js +34 -32
  15. package/dist/shared/components/item-edit/FieldAffordances.js +32 -32
  16. package/dist/shared/components/item-edit/FormTour.js +279 -0
  17. package/dist/shared/components/item-edit/GroupSection.js +377 -360
  18. package/dist/shared/components/item-edit/PersonalDefaultControl.js +28 -28
  19. package/dist/shared/components/item-edit/entry/EntryStrip.js +30 -26
  20. package/dist/shared/components/item-edit/form-density.js +36 -0
  21. package/dist/shared/components/item-edit/useFormUsageBeacon.js +59 -46
  22. package/dist/shared/components/item-edit/usePersonalDefaults.js +312 -296
  23. package/dist/shared/components/layout-editor/AddPanel.js +349 -192
  24. package/dist/shared/components/layout-editor/DesignNode.js +126 -112
  25. package/dist/shared/components/layout-editor/EditorTopBar.js +123 -103
  26. package/dist/shared/components/layout-editor/LayoutEditor.js +829 -751
  27. package/dist/shared/components/layout-editor/PlaceTools.js +334 -0
  28. package/dist/shared/components/layout-editor/SlashInsert.js +252 -0
  29. package/dist/shared/components/layout-editor/StructureMenu.js +285 -242
  30. package/dist/shared/components/layout-editor/add-target.js +54 -43
  31. package/dist/shared/components/layout-editor/ai-forms/AiComposer.js +238 -155
  32. package/dist/shared/components/layout-editor/ai-forms/AiFormsButton.js +1 -1
  33. package/dist/shared/components/layout-editor/ai-forms/ai-forms-api.js +15 -12
  34. package/dist/shared/components/layout-editor/dnd/LayoutDndProvider.js +347 -189
  35. package/dist/shared/components/layout-editor/dnd/TrashZone.js +60 -32
  36. package/dist/shared/components/layout-editor/dnd/UndoChip.js +76 -0
  37. package/dist/shared/components/layout-editor/dnd/merge-drop.js +33 -0
  38. package/dist/shared/components/layout-editor/dnd/multi-drop.js +87 -0
  39. package/dist/shared/components/layout-editor/dnd/node.js +115 -105
  40. package/dist/shared/components/layout-editor/dnd/sensors.js +23 -0
  41. package/dist/shared/components/layout-editor/dnd/trash-drop.js +34 -28
  42. package/dist/shared/components/layout-editor/dnd/trash-links.js +97 -0
  43. package/dist/shared/components/layout-editor/even-row.js +86 -0
  44. package/dist/shared/components/layout-editor/field-list.js +99 -0
  45. package/dist/shared/components/layout-editor/format-painter.js +102 -0
  46. package/dist/shared/components/layout-editor/grid-guides.js +15 -13
  47. package/dist/shared/components/layout-editor/inspector/BehaviourSettings.js +150 -132
  48. package/dist/shared/components/layout-editor/inspector/BulkInspector.js +57 -53
  49. package/dist/shared/components/layout-editor/inspector/EvenRowAction.js +31 -0
  50. package/dist/shared/components/layout-editor/inspector/GroupInspector.js +154 -141
  51. package/dist/shared/components/layout-editor/inspector/Inspector.js +209 -178
  52. package/dist/shared/components/layout-editor/inspector/LookTab.js +106 -98
  53. package/dist/shared/components/layout-editor/inspector/RulesTab.js +38 -37
  54. package/dist/shared/components/layout-editor/inspector/kit.js +280 -223
  55. package/dist/shared/components/layout-editor/keyboard-move.js +15 -15
  56. package/dist/shared/components/layout-editor/lint/LabelStyle.js +201 -0
  57. package/dist/shared/components/layout-editor/lint/LintPanel.js +132 -84
  58. package/dist/shared/components/layout-editor/lint/lint-api.js +65 -28
  59. package/dist/shared/components/layout-editor/nav/NavTools.js +14 -12
  60. package/dist/shared/components/layout-editor/nav/ZoomControls.js +145 -0
  61. package/dist/shared/components/layout-editor/nav/useEditorNav.js +34 -32
  62. package/dist/shared/components/layout-editor/nav/view-prefs.js +100 -15
  63. package/dist/shared/components/layout-editor/outputs/LayoutFile.js +89 -0
  64. package/dist/shared/components/layout-editor/outputs/OutputsButton.js +272 -195
  65. package/dist/shared/components/layout-editor/outputs/layout-file-plan.js +176 -0
  66. package/dist/shared/components/layout-editor/outputs/output-api.js +71 -37
  67. package/dist/shared/components/layout-editor/overview/describe-conditions.js +16 -11
  68. package/dist/shared/components/layout-editor/overview/purpose.js +5 -5
  69. package/dist/shared/components/layout-editor/parity-keys.json.js +1 -1
  70. package/dist/shared/components/layout-editor/pin.js +37 -19
  71. package/dist/shared/components/layout-editor/place-clip.js +257 -0
  72. package/dist/shared/components/layout-editor/preview/PreviewModes.js +27 -26
  73. package/dist/shared/components/layout-editor/preview/PreviewPanes.js +148 -117
  74. package/dist/shared/components/layout-editor/preview/SampleRecord.js +113 -0
  75. package/dist/shared/components/layout-editor/preview/preview-model.js +79 -60
  76. package/dist/shared/components/layout-editor/preview/sample-record.js +105 -0
  77. package/dist/shared/components/layout-editor/removed-log.js +151 -0
  78. package/dist/shared/components/layout-editor/reuse/LibraryRows.js +109 -78
  79. package/dist/shared/components/layout-editor/reuse/linked-sections.js +373 -0
  80. package/dist/shared/components/layout-editor/revert-element.js +140 -0
  81. package/dist/shared/components/layout-editor/section-structure.js +193 -170
  82. package/dist/shared/components/layout-editor/settings/EntrySection.js +63 -45
  83. package/dist/shared/components/layout-editor/settings/LayoutSection.js +63 -32
  84. package/dist/shared/components/layout-editor/settings/ResolveSettings.js +179 -137
  85. package/dist/shared/components/layout-editor/settings/WhoSection.js +18 -17
  86. package/dist/shared/components/layout-editor/settings/settings-registry.js +24 -0
  87. package/dist/shared/components/layout-editor/shortcuts.js +21 -16
  88. package/dist/shared/components/layout-editor/structure-ops.js +221 -195
  89. package/dist/shared/components/layout-editor/usage/UsagePanel.js +133 -85
  90. package/dist/shared/components/layout-editor/usage/refusal-lens.js +130 -0
  91. package/dist/shared/components/layout-editor/usage/usage-api.js +12 -11
  92. package/dist/shared/components/panels/CommentPanel.js +47 -45
  93. package/dist/shared/components/panels/RevisionsPanel.js +66 -64
  94. package/dist/shared/components/panels/TaskPanel.js +395 -332
  95. package/dist/shared/components/profile/AgentsPanel.js +196 -147
  96. package/dist/shared/components/profile/ConnectionRollback.js +329 -0
  97. package/dist/shared/components/profile/MyDefaultsCard.js +526 -520
  98. package/dist/shared/lib/entry-config.js +22 -22
  99. package/dist/shared/lib/form-usage-beacon.js +91 -55
  100. package/dist/shared/lib/layout-lint.js +530 -284
  101. package/dist/shared/lib/layout-resolve.js +58 -44
  102. package/package.json +1 -1
@@ -1,28 +1,28 @@
1
- import { jsxs as h, jsx as a, Fragment as C } from "react/jsx-runtime";
1
+ import { jsxs as h, jsx as n, Fragment as C } from "react/jsx-runtime";
2
2
  import { X as S } from "lucide-react";
3
3
  import { useMemo as N } from "react";
4
- import { validateExpression as R } from "../../../lib/expression.js";
5
- import { displayFormulaOf as T, textRulesOf as O, counterOf as L, confirmChangeOf as M } from "../../../lib/placement-behaviour.js";
4
+ import { validateExpression as O } from "../../../lib/expression.js";
5
+ import { displayFormulaOf as R, textRulesOf as T, counterOf as M, confirmChangeOf as L } from "../../../lib/placement-behaviour.js";
6
6
  import { cn as F } from "../../../lib/utils.js";
7
- import { RoleConditionRow as A, PipelineStateConditionRow as $ } from "../editors/lock-conditions.js";
8
- import { useColumnFacts as P, columnOf as D } from "../inspect/inspect-api.js";
7
+ import { RoleConditionRow as P, PipelineStateConditionRow as $ } from "../editors/lock-conditions.js";
8
+ import { useColumnFacts as A, columnOf as D } from "../inspect/inspect-api.js";
9
9
  import { effectText as I, tintCard as W } from "../panel-style.js";
10
- import { isRelational as j } from "./applies.js";
11
- import { useFieldCtx as b } from "./field-context.js";
12
- import { useInspectorEnv as q, Setting as p, TextInput as _, TextArea as K, Segmented as k, DraftInput as E, AddButton as H, Toggle as v } from "./kit.js";
10
+ import { isRelational as K } from "./applies.js";
11
+ import { useFieldCtx as g } from "./field-context.js";
12
+ import { useInspectorEnv as j, Setting as p, TextInput as _, TextArea as q, Segmented as k, DraftInput as E, AddButton as H, Toggle as v } from "./kit.js";
13
13
  const U = "rounded p-0.5 text-slate-400 transition-colors hover:bg-muted hover:text-slate-700 dark:hover:text-foreground";
14
- function z(o) {
15
- if (j(o)) return !1;
16
- const s = o.iface ?? "";
17
- return ["string", "text", "richtext", "rich_text", "markdown", "wysiwyg"].includes(o.type) || /textarea|rich|wysiwyg|markdown/i.test(s);
14
+ function z(l) {
15
+ if (K(l)) return !1;
16
+ const s = l.iface ?? "";
17
+ return ["string", "text", "richtext", "rich_text", "markdown", "wysiwyg"].includes(l.type) || /textarea|rich|wysiwyg|markdown/i.test(s);
18
18
  }
19
- function w(o, s, r = {}) {
20
- const u = r.allowM2M === !0 && o.relKind === "M2M";
21
- return !s.startsWith("__") && !o.isPath && (u || o.type !== "alias" && o.relKind !== "M2M") && o.relKind !== "O2M" && o.computedType !== "virtual" && o.computedType !== "read";
19
+ function w(l, s, o = {}) {
20
+ const c = o.allowM2M === !0 && l.relKind === "M2M";
21
+ return !s.startsWith("__") && !l.isPath && (c || l.type !== "alias" && l.relKind !== "M2M") && l.relKind !== "O2M" && l.computedType !== "virtual" && l.computedType !== "read";
22
22
  }
23
- function le() {
24
- const o = b(), { ov: s, info: r, env: u, row: i } = o, c = r.label, d = O(s), f = (l, n, e) => o.setOverride("text_rules", l.length ? l : void 0, n, e), t = (l, n, e, m) => f(
25
- d.map((g, y) => y === l ? { ...g, ...n } : g),
23
+ function oe() {
24
+ const l = g(), { ov: s, info: o, env: c, row: i } = l, d = o.label, f = T(s), u = (r, a, e) => l.setOverride("text_rules", r.length ? r : void 0, a, e), t = (r, a, e, m) => u(
25
+ f.map((y, b) => b === r ? { ...y, ...a } : y),
26
26
  e,
27
27
  m
28
28
  );
@@ -33,92 +33,92 @@ function le() {
33
33
  label: "Label and help by state or role",
34
34
  effect: "Different words in a workflow state or for a role: “Requested date” becomes “Delivered date” once Completed. The first rule that matches wins; the record page, read view and PDF follow it.",
35
35
  children: [
36
- d.map((l, n) => /* @__PURE__ */ h(
36
+ f.map((r, a) => /* @__PURE__ */ h(
37
37
  "div",
38
38
  {
39
- "data-text-rule": n,
39
+ "data-text-rule": a,
40
40
  className: F(W, "space-y-2 px-2.5 py-2"),
41
41
  children: [
42
42
  /* @__PURE__ */ h("div", { className: "flex items-center gap-2", children: [
43
- /* @__PURE__ */ a("div", { className: "flex-1", children: /* @__PURE__ */ a(
43
+ /* @__PURE__ */ n("div", { className: "flex-1", children: /* @__PURE__ */ n(
44
44
  k,
45
45
  {
46
- value: l.type,
46
+ value: r.type,
47
47
  options: [
48
48
  { value: "pipeline_state", label: "In a state" },
49
49
  { value: "role", label: "For a role" }
50
50
  ],
51
51
  onChange: (e) => t(
52
- n,
52
+ a,
53
53
  e === "role" ? {
54
54
  type: "role",
55
55
  role_ids: [],
56
56
  state_keys: void 0,
57
57
  pipeline_id: void 0
58
58
  } : { type: "pipeline_state", state_keys: [], role_ids: void 0 },
59
- `Change when ${c} reads differently`
59
+ `Change when ${d} reads differently`
60
60
  )
61
61
  }
62
62
  ) }),
63
- /* @__PURE__ */ a(
63
+ /* @__PURE__ */ n(
64
64
  "button",
65
65
  {
66
66
  type: "button",
67
67
  "aria-label": "Remove this rule",
68
68
  "data-tip": "Remove this rule",
69
69
  className: U,
70
- onClick: () => f(
71
- d.filter((e, m) => m !== n),
72
- `Remove a label rule from ${c}`
70
+ onClick: () => u(
71
+ f.filter((e, m) => m !== a),
72
+ `Remove a label rule from ${d}`
73
73
  ),
74
- children: /* @__PURE__ */ a(S, { className: "h-3.5 w-3.5" })
74
+ children: /* @__PURE__ */ n(S, { className: "h-3.5 w-3.5" })
75
75
  }
76
76
  )
77
77
  ] }),
78
- l.type === "role" ? /* @__PURE__ */ a(
79
- A,
78
+ r.type === "role" ? /* @__PURE__ */ n(
79
+ P,
80
80
  {
81
- roleIds: l.role_ids ?? [],
82
- onRoleIdsChange: (e) => t(n, { role_ids: e }, `Change the roles for ${c}`)
81
+ roleIds: r.role_ids ?? [],
82
+ onRoleIdsChange: (e) => t(a, { role_ids: e }, `Change the roles for ${d}`)
83
83
  }
84
- ) : /* @__PURE__ */ a(
84
+ ) : /* @__PURE__ */ n(
85
85
  $,
86
86
  {
87
- collection: u.collection,
88
- pipelineId: l.pipeline_id,
89
- stateKeys: l.state_keys ?? [],
90
- onPipelineChange: (e) => t(n, { pipeline_id: e, state_keys: [] }, `Change the pipeline for ${c}`),
91
- onStateKeysChange: (e) => t(n, { state_keys: e }, `Change the states for ${c}`)
87
+ collection: c.collection,
88
+ pipelineId: r.pipeline_id,
89
+ stateKeys: r.state_keys ?? [],
90
+ onPipelineChange: (e) => t(a, { pipeline_id: e, state_keys: [] }, `Change the pipeline for ${d}`),
91
+ onStateKeysChange: (e) => t(a, { state_keys: e }, `Change the states for ${d}`)
92
92
  }
93
93
  ),
94
- /* @__PURE__ */ a(
94
+ /* @__PURE__ */ n(
95
95
  _,
96
96
  {
97
97
  ariaLabel: "Label in this case",
98
- value: l.label ?? "",
99
- placeholder: `Label (${c})`,
100
- onChange: (e) => t(n, { label: e || void 0 }, `Change a label rule of ${c}`, !0)
98
+ value: r.label ?? "",
99
+ placeholder: `Label (${d})`,
100
+ onChange: (e) => t(a, { label: e || void 0 }, `Change a label rule of ${d}`, !0)
101
101
  }
102
102
  ),
103
- /* @__PURE__ */ a(
103
+ /* @__PURE__ */ n(
104
104
  _,
105
105
  {
106
106
  ariaLabel: "Help text in this case",
107
- value: l.note ?? "",
107
+ value: r.note ?? "",
108
108
  placeholder: "Help text (unchanged when empty)",
109
- onChange: (e) => t(n, { note: e || void 0 }, `Change a help rule of ${c}`, !0)
109
+ onChange: (e) => t(a, { note: e || void 0 }, `Change a help rule of ${d}`, !0)
110
110
  }
111
111
  )
112
112
  ]
113
113
  },
114
- n
114
+ a
115
115
  )),
116
- /* @__PURE__ */ a(
116
+ /* @__PURE__ */ n(
117
117
  H,
118
118
  {
119
- onClick: () => f(
120
- [...d, { type: "pipeline_state", state_keys: [] }],
121
- `Add a label rule to ${c}`
119
+ onClick: () => u(
120
+ [...f, { type: "pipeline_state", state_keys: [] }],
121
+ `Add a label rule to ${d}`
122
122
  ),
123
123
  children: "+ Add a rule"
124
124
  }
@@ -128,25 +128,25 @@ function le() {
128
128
  );
129
129
  }
130
130
  function re() {
131
- const o = b(), { ov: s, info: r, env: u, row: i } = o, { data: c } = P(u.collection), d = D(c, i.field);
132
- if (!z(r) || i.field.startsWith("__")) return null;
133
- const f = r.label, t = L(s), l = (d == null ? void 0 : d.max_length) != null && d.max_length > 0 ? d.max_length : null, n = (e, m, g) => o.setOverride("counter", e, m, g);
131
+ const l = g(), { ov: s, info: o, env: c, row: i } = l, { data: d } = A(c.collection), f = D(d, i.field);
132
+ if (!z(o) || i.field.startsWith("__")) return null;
133
+ const u = o.label, t = M(s), r = (f == null ? void 0 : f.max_length) != null && f.max_length > 0 ? f.max_length : null, a = (e, m, y) => l.setOverride("counter", e, m, y);
134
134
  return /* @__PURE__ */ h("div", { "data-setting": "field.counter", className: "space-y-3", children: [
135
- /* @__PURE__ */ a(
135
+ /* @__PURE__ */ n(
136
136
  v,
137
137
  {
138
138
  k: "field.counter.on",
139
139
  label: "Counter and limit",
140
- effect: l ? `Counts as people type. The limit starts at the column size (${l.toLocaleString()} characters); past it the form will not save.` : "Counts as people type; past a limit the form will not save.",
140
+ effect: r ? `Counts as people type. The limit starts at the column size (${r.toLocaleString()} characters); past it the form will not save.` : "Counts as people type; past a limit the form will not save.",
141
141
  checked: !!t,
142
- onChange: (e) => n(
143
- e ? { unit: "characters", ...l ? { limit: l } : {} } : void 0,
144
- e ? `Count the characters of ${f}` : `Stop counting ${f}`
142
+ onChange: (e) => a(
143
+ e ? { unit: "characters", ...r ? { limit: r } : {} } : void 0,
144
+ e ? `Count the characters of ${u}` : `Stop counting ${u}`
145
145
  )
146
146
  }
147
147
  ),
148
148
  t && /* @__PURE__ */ h(C, { children: [
149
- /* @__PURE__ */ a(p, { k: "field.counter.unit", label: "Count", effect: "Characters or words.", children: /* @__PURE__ */ a(
149
+ /* @__PURE__ */ n(p, { k: "field.counter.unit", label: "Count", effect: "Characters or words.", children: /* @__PURE__ */ n(
150
150
  k,
151
151
  {
152
152
  value: t.unit,
@@ -154,33 +154,33 @@ function re() {
154
154
  { value: "characters", label: "Characters" },
155
155
  { value: "words", label: "Words" }
156
156
  ],
157
- onChange: (e) => n(
157
+ onChange: (e) => a(
158
158
  {
159
159
  unit: e,
160
- ...e === "words" ? {} : t.limit != null ? { limit: t.limit } : l ? { limit: l } : {}
160
+ ...e === "words" ? {} : t.limit != null ? { limit: t.limit } : r ? { limit: r } : {}
161
161
  },
162
- `Count the ${e} of ${f}`
162
+ `Count the ${e} of ${u}`
163
163
  )
164
164
  }
165
165
  ) }),
166
- /* @__PURE__ */ a(
166
+ /* @__PURE__ */ n(
167
167
  p,
168
168
  {
169
169
  k: "field.counter.limit",
170
170
  label: "Limit",
171
- effect: t.unit === "words" ? "Most words allowed. Empty counts without a limit." : `Most characters allowed. Empty counts without a limit${l ? `; the column holds ${l.toLocaleString()}` : ""}.`,
172
- children: /* @__PURE__ */ a(
171
+ effect: t.unit === "words" ? "Most words allowed. Empty counts without a limit." : `Most characters allowed. Empty counts without a limit${r ? `; the column holds ${r.toLocaleString()}` : ""}.`,
172
+ children: /* @__PURE__ */ n(
173
173
  _,
174
174
  {
175
175
  type: "number",
176
176
  ariaLabel: "Limit",
177
177
  value: t.limit == null ? "" : String(t.limit),
178
- placeholder: t.unit === "characters" && l ? String(l) : "No limit",
178
+ placeholder: t.unit === "characters" && r ? String(r) : "No limit",
179
179
  onChange: (e) => {
180
180
  const m = e === "" ? void 0 : Math.max(1, Math.floor(Number(e)));
181
- m !== void 0 && !Number.isFinite(m) || n(
181
+ m !== void 0 && !Number.isFinite(m) || a(
182
182
  { unit: t.unit, ...m ? { limit: m } : {} },
183
- `Set the limit of ${f}`,
183
+ `Set the limit of ${u}`,
184
184
  !0
185
185
  );
186
186
  }
@@ -192,11 +192,11 @@ function re() {
192
192
  ] });
193
193
  }
194
194
  function ie() {
195
- var c;
196
- const o = b(), { ov: s, info: r, row: u } = o;
197
- if (u.field.startsWith("__")) return null;
198
- const i = s.required === !0 || s.required === void 0 && !!((c = r.global) != null && c.required);
199
- return /* @__PURE__ */ a(
195
+ var d;
196
+ const l = g(), { ov: s, info: o, row: c } = l;
197
+ if (c.field.startsWith("__")) return null;
198
+ const i = s.required === !0 || s.required === void 0 && !!((d = o.global) != null && d.required);
199
+ return /* @__PURE__ */ n(
200
200
  v,
201
201
  {
202
202
  k: "field.recommended",
@@ -204,51 +204,51 @@ function ie() {
204
204
  effect: i ? "Required already wins; switch Required off to make this a recommendation." : "An amber marker and a reminder on save listing what is still empty. Saving is never blocked.",
205
205
  checked: s.recommended === !0 && !i,
206
206
  disabled: i,
207
- onChange: (d) => o.setOverride(
207
+ onChange: (f) => l.setOverride(
208
208
  "recommended",
209
- d ? !0 : void 0,
210
- d ? `Recommend ${r.label}` : `Stop recommending ${r.label}`
209
+ f ? !0 : void 0,
210
+ f ? `Recommend ${o.label}` : `Stop recommending ${o.label}`
211
211
  )
212
212
  }
213
213
  );
214
214
  }
215
215
  function se() {
216
- const o = b(), { ov: s, info: r, env: u, row: i } = o;
217
- if (!w(r, i.field)) return null;
218
- const c = r.label, d = M(s), f = s.confirm_change && typeof s.confirm_change == "object" ? s.confirm_change : {}, t = typeof f.pipeline_id == "string" ? f.pipeline_id : void 0, l = (n, e) => o.setOverride("confirm_change", n, e);
216
+ const l = g(), { ov: s, info: o, env: c, row: i } = l;
217
+ if (!w(o, i.field)) return null;
218
+ const d = o.label, f = L(s), u = s.confirm_change && typeof s.confirm_change == "object" ? s.confirm_change : {}, t = typeof u.pipeline_id == "string" ? u.pipeline_id : void 0, r = (a, e) => l.setOverride("confirm_change", a, e);
219
219
  return /* @__PURE__ */ h("div", { "data-setting": "field.confirm_change", className: "space-y-3", children: [
220
- /* @__PURE__ */ a(
220
+ /* @__PURE__ */ n(
221
221
  v,
222
222
  {
223
223
  k: "field.confirm_change.on",
224
224
  label: "Confirm changes on saved records",
225
225
  effect: "Changing it on an existing record asks “Are you sure?” and a short reason, kept with the change in the history. New records are not asked.",
226
- checked: !!d,
227
- onChange: (n) => l(
228
- n ? { state_keys: [] } : void 0,
229
- n ? `Confirm changes to ${c}` : `Stop confirming changes to ${c}`
226
+ checked: !!f,
227
+ onChange: (a) => r(
228
+ a ? { state_keys: [] } : void 0,
229
+ a ? `Confirm changes to ${d}` : `Stop confirming changes to ${d}`
230
230
  )
231
231
  }
232
232
  ),
233
- d && /* @__PURE__ */ a(
233
+ f && /* @__PURE__ */ n(
234
234
  p,
235
235
  {
236
236
  k: "field.confirm_change.states",
237
237
  label: "Only in these states",
238
- effect: d.state_keys.length ? "Asked only while the record is in a ticked state." : "No state ticked: asked in every state.",
239
- children: /* @__PURE__ */ a(
238
+ effect: f.state_keys.length ? "Asked only while the record is in a ticked state." : "No state ticked: asked in every state.",
239
+ children: /* @__PURE__ */ n(
240
240
  $,
241
241
  {
242
- collection: u.collection,
242
+ collection: c.collection,
243
243
  pipelineId: t,
244
- stateKeys: d.state_keys,
245
- onPipelineChange: (n) => l(
246
- { ...n ? { pipeline_id: n } : {}, state_keys: [] },
247
- `Change the pipeline that confirms ${c}`
244
+ stateKeys: f.state_keys,
245
+ onPipelineChange: (a) => r(
246
+ { ...a ? { pipeline_id: a } : {}, state_keys: [] },
247
+ `Change the pipeline that confirms ${d}`
248
248
  ),
249
- onStateKeysChange: (n) => l(
250
- { ...t ? { pipeline_id: t } : {}, state_keys: n },
251
- `Change the states that confirm ${c}`
249
+ onStateKeysChange: (a) => r(
250
+ { ...t ? { pipeline_id: t } : {}, state_keys: a },
251
+ `Change the states that confirm ${d}`
252
252
  )
253
253
  }
254
254
  )
@@ -257,35 +257,52 @@ function se() {
257
257
  ] });
258
258
  }
259
259
  function ce() {
260
- const o = b(), { ov: s, info: r, row: u } = o;
261
- return !w(r, u.field) || r.computedType ? null : /* @__PURE__ */ a(
260
+ const l = g(), { ov: s, info: o, row: c } = l;
261
+ return !w(o, c.field) || o.computedType ? null : /* @__PURE__ */ n(
262
262
  v,
263
263
  {
264
264
  k: "field.repeat_last",
265
265
  label: "Repeat last value",
266
266
  effect: "A “Repeat last” button beside the label fills in what this person entered on their previous record here.",
267
267
  checked: s.repeat_last === !0,
268
- onChange: (i) => o.setOverride(
268
+ onChange: (i) => l.setOverride(
269
269
  "repeat_last",
270
270
  i ? !0 : void 0,
271
- i ? `Offer to repeat the last ${r.label}` : `Stop offering to repeat ${r.label}`
271
+ i ? `Offer to repeat the last ${o.label}` : `Stop offering to repeat ${o.label}`
272
272
  )
273
273
  }
274
274
  );
275
275
  }
276
276
  function de() {
277
- const o = b(), { ov: s, info: r, row: u } = o;
278
- return !w(r, u.field, { allowM2M: !0 }) || r.computedType ? null : /* @__PURE__ */ a(
277
+ const l = g(), { ov: s, info: o, row: c } = l;
278
+ return !w(o, c.field, { allowM2M: !0 }) || o.computedType ? null : /* @__PURE__ */ n(
279
279
  v,
280
280
  {
281
281
  k: "field.personal_default",
282
282
  label: "Personal default",
283
283
  effect: "On this form, people can save their own starting value for this field, and new records start with it.",
284
284
  checked: s.personal_default === !0,
285
- onChange: (i) => o.setOverride(
285
+ onChange: (i) => l.setOverride(
286
286
  "personal_default",
287
287
  i ? !0 : void 0,
288
- i ? `Allow personal defaults for ${r.label}` : `Stop personal defaults for ${r.label}`
288
+ i ? `Allow personal defaults for ${o.label}` : `Stop personal defaults for ${o.label}`
289
+ )
290
+ }
291
+ );
292
+ }
293
+ function fe() {
294
+ const l = g(), { ov: s, info: o } = l;
295
+ return s.personal_default !== !0 ? null : /* @__PURE__ */ n(
296
+ v,
297
+ {
298
+ k: "field.personal_default_inline",
299
+ label: "Make default on the form",
300
+ effect: "People can save, update and clear their default right beside this field. Off: they manage it only on their profile (My defaults); the form still fills it in.",
301
+ checked: s.personal_default_inline !== !1,
302
+ onChange: (c) => l.setOverride(
303
+ "personal_default_inline",
304
+ c ? void 0 : !1,
305
+ c ? `Offer Make default on the form for ${o.label}` : `Keep ${o.label}'s default to the profile`
289
306
  )
290
307
  }
291
308
  );
@@ -298,11 +315,11 @@ const B = [
298
315
  { value: "percent", label: "Percent" }
299
316
  ];
300
317
  function ue({
301
- row: o,
318
+ row: l,
302
319
  fields: s
303
320
  }) {
304
- const r = q(), u = N(() => {
305
- const e = o.overrides;
321
+ const o = j(), c = N(() => {
322
+ const e = l.overrides;
306
323
  if (typeof e == "string")
307
324
  try {
308
325
  return JSON.parse(e) ?? {};
@@ -310,24 +327,24 @@ function ue({
310
327
  return {};
311
328
  }
312
329
  return e && typeof e == "object" ? e : {};
313
- }, [o.overrides]), i = T(u) ?? { expr: "", format: "", currency: null }, c = typeof u.label == "string" ? u.label : "", d = { field: o.field, group_key: o.group_key }, f = (e, m, g) => {
314
- const y = { ...u, ...e };
315
- for (const x of Object.keys(y)) y[x] === void 0 && delete y[x];
316
- r.apply([{ op: "update_placement", at: d, patch: { overrides: y } }], {
330
+ }, [l.overrides]), i = R(c) ?? { expr: "", format: "", currency: null }, d = typeof c.label == "string" ? c.label : "", f = { field: l.field, group_key: l.group_key }, u = (e, m, y) => {
331
+ const b = { ...c, ...e };
332
+ for (const x of Object.keys(b)) b[x] === void 0 && delete b[x];
333
+ o.apply([{ op: "update_placement", at: f, patch: { overrides: b } }], {
317
334
  label: m,
318
- text: g
335
+ text: y
319
336
  });
320
- }, t = i.expr.trim() ? R(i.expr, s) : null, l = new Set(
321
- r.bundle.placements.filter((e) => !e.field.startsWith("__")).map((e) => e.field)
322
- ), n = t != null && t.ok ? t.tokens.filter((e) => !l.has(e.split(".")[0])) : [];
337
+ }, t = i.expr.trim() ? O(i.expr, s) : null, r = new Set(
338
+ o.bundle.placements.filter((e) => !e.field.startsWith("__")).map((e) => e.field)
339
+ ), a = t != null && t.ok ? t.tokens.filter((e) => !r.has(e.split(".")[0])) : [];
323
340
  return /* @__PURE__ */ h("div", { className: "space-y-5", children: [
324
- /* @__PURE__ */ a(p, { k: "display_formula.label", label: "Label", effect: "What the form calls the value.", children: /* @__PURE__ */ a(
341
+ /* @__PURE__ */ n(p, { k: "display_formula.label", label: "Label", effect: "What the form calls the value.", children: /* @__PURE__ */ n(
325
342
  _,
326
343
  {
327
344
  ariaLabel: "Label",
328
- value: c,
345
+ value: d,
329
346
  placeholder: "Remaining",
330
- onChange: (e) => f({ label: e || void 0 }, "Rename the formula", !0)
347
+ onChange: (e) => u({ label: e || void 0 }, "Rename the formula", !0)
331
348
  }
332
349
  ) }),
333
350
  /* @__PURE__ */ h(
@@ -338,21 +355,21 @@ function ue({
338
355
  effect: /* @__PURE__ */ h(C, { children: [
339
356
  "Fields in double braces, for example",
340
357
  " ",
341
- /* @__PURE__ */ a("code", { className: "font-mono text-[11.5px]", children: "{{budget}} - {{committed}}" }),
358
+ /* @__PURE__ */ n("code", { className: "font-mono text-[11.5px]", children: "{{budget}} - {{committed}}" }),
342
359
  ". Worked out on the page from what is on the form; never saved."
343
360
  ] }),
344
361
  children: [
345
- /* @__PURE__ */ a(
346
- K,
362
+ /* @__PURE__ */ n(
363
+ q,
347
364
  {
348
365
  ariaLabel: "Formula",
349
366
  rows: 3,
350
367
  mono: !0,
351
368
  value: i.expr,
352
- onChange: (e) => f({ display_formula: { ...i, expr: e } }, "Change the formula", !0)
369
+ onChange: (e) => u({ display_formula: { ...i, expr: e } }, "Change the formula", !0)
353
370
  }
354
371
  ),
355
- t && !t.ok && /* @__PURE__ */ a(
372
+ t && !t.ok && /* @__PURE__ */ n(
356
373
  "p",
357
374
  {
358
375
  role: "alert",
@@ -364,31 +381,31 @@ function ue({
364
381
  (t == null ? void 0 : t.ok) && t.unknownTokens.length > 0 && /* @__PURE__ */ h("p", { "data-formula-unknown": "", className: "text-[12px] text-amber-700 dark:text-amber-300", children: [
365
382
  "Not fields of this collection:",
366
383
  " ",
367
- /* @__PURE__ */ a("span", { className: "font-mono", children: t.unknownTokens.join(", ") })
384
+ /* @__PURE__ */ n("span", { className: "font-mono", children: t.unknownTokens.join(", ") })
368
385
  ] }),
369
- (t == null ? void 0 : t.ok) && !t.unknownTokens.length && n.length > 0 && /* @__PURE__ */ h("p", { "data-formula-offform": "", className: I, children: [
386
+ (t == null ? void 0 : t.ok) && !t.unknownTokens.length && a.length > 0 && /* @__PURE__ */ h("p", { "data-formula-offform": "", className: I, children: [
370
387
  "Not on this form, so they read as empty here:",
371
388
  " ",
372
- /* @__PURE__ */ a("span", { className: "font-mono", children: n.join(", ") })
389
+ /* @__PURE__ */ n("span", { className: "font-mono", children: a.join(", ") })
373
390
  ] })
374
391
  ]
375
392
  }
376
393
  ),
377
- /* @__PURE__ */ a(p, { k: "display_formula.format", label: "Show as", effect: "How the number is written.", children: /* @__PURE__ */ a(
394
+ /* @__PURE__ */ n(p, { k: "display_formula.format", label: "Show as", effect: "How the number is written.", children: /* @__PURE__ */ n(
378
395
  k,
379
396
  {
380
397
  value: i.format,
381
398
  options: B,
382
- onChange: (e) => f({ display_formula: { ...i, format: e } }, "Change how the formula shows")
399
+ onChange: (e) => u({ display_formula: { ...i, format: e } }, "Change how the formula shows")
383
400
  }
384
401
  ) }),
385
- i.format === "currency" && /* @__PURE__ */ a(
402
+ i.format === "currency" && /* @__PURE__ */ n(
386
403
  p,
387
404
  {
388
405
  k: "display_formula.currency",
389
406
  label: "Currency",
390
407
  effect: "Three-letter code, for example USD.",
391
- children: /* @__PURE__ */ a(
408
+ children: /* @__PURE__ */ n(
392
409
  E,
393
410
  {
394
411
  ariaLabel: "Currency",
@@ -397,7 +414,7 @@ function ue({
397
414
  placeholder: "USD",
398
415
  onCommit: (e) => {
399
416
  const m = e.trim().toUpperCase();
400
- m && !/^[A-Z]{3}$/.test(m) || f(
417
+ m && !/^[A-Z]{3}$/.test(m) || u(
401
418
  { display_formula: { ...i, currency: m || null } },
402
419
  "Change the currency of the formula",
403
420
  !0
@@ -413,9 +430,10 @@ export {
413
430
  se as ConfirmChangeSetting,
414
431
  re as CounterSetting,
415
432
  ue as DisplayFormulaSettings,
433
+ fe as PersonalDefaultInlineToggle,
416
434
  de as PersonalDefaultToggle,
417
435
  ie as RecommendedToggle,
418
436
  ce as RepeatLastToggle,
419
- le as TextRulesSetting,
437
+ oe as TextRulesSetting,
420
438
  z as takesText
421
439
  };