@nivaro/react 0.3.35 → 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.
Files changed (106) 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 +13 -4
  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 -572
  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 +11 -10
  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 +80 -63
  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 +146 -131
  25. package/dist/shared/components/layout-editor/EditorCanvas.js +25 -17
  26. package/dist/shared/components/layout-editor/EditorTopBar.js +268 -206
  27. package/dist/shared/components/layout-editor/LayoutEditor.js +810 -731
  28. package/dist/shared/components/layout-editor/PlaceTools.js +334 -0
  29. package/dist/shared/components/layout-editor/SlashInsert.js +252 -0
  30. package/dist/shared/components/layout-editor/StructureMenu.js +285 -242
  31. package/dist/shared/components/layout-editor/add-target.js +54 -43
  32. package/dist/shared/components/layout-editor/ai-forms/AiComposer.js +238 -155
  33. package/dist/shared/components/layout-editor/ai-forms/AiFormsButton.js +1 -1
  34. package/dist/shared/components/layout-editor/ai-forms/ai-forms-api.js +15 -12
  35. package/dist/shared/components/layout-editor/dnd/LayoutDndProvider.js +379 -185
  36. package/dist/shared/components/layout-editor/dnd/TrashZone.js +96 -0
  37. package/dist/shared/components/layout-editor/dnd/UndoChip.js +76 -0
  38. package/dist/shared/components/layout-editor/dnd/merge-drop.js +33 -0
  39. package/dist/shared/components/layout-editor/dnd/multi-drop.js +87 -0
  40. package/dist/shared/components/layout-editor/dnd/node.js +115 -105
  41. package/dist/shared/components/layout-editor/dnd/rail-drop.js +4 -4
  42. package/dist/shared/components/layout-editor/dnd/sensors.js +23 -0
  43. package/dist/shared/components/layout-editor/dnd/trash-drop.js +58 -0
  44. package/dist/shared/components/layout-editor/dnd/trash-links.js +97 -0
  45. package/dist/shared/components/layout-editor/even-row.js +86 -0
  46. package/dist/shared/components/layout-editor/field-list.js +99 -0
  47. package/dist/shared/components/layout-editor/format-painter.js +102 -0
  48. package/dist/shared/components/layout-editor/grid-guides.js +15 -13
  49. package/dist/shared/components/layout-editor/inspector/BehaviourSettings.js +150 -132
  50. package/dist/shared/components/layout-editor/inspector/BulkInspector.js +57 -53
  51. package/dist/shared/components/layout-editor/inspector/EvenRowAction.js +31 -0
  52. package/dist/shared/components/layout-editor/inspector/GroupInspector.js +154 -141
  53. package/dist/shared/components/layout-editor/inspector/Inspector.js +209 -178
  54. package/dist/shared/components/layout-editor/inspector/LookTab.js +106 -98
  55. package/dist/shared/components/layout-editor/inspector/RulesTab.js +38 -37
  56. package/dist/shared/components/layout-editor/inspector/kit.js +280 -223
  57. package/dist/shared/components/layout-editor/keyboard-move.js +15 -15
  58. package/dist/shared/components/layout-editor/lint/LabelStyle.js +201 -0
  59. package/dist/shared/components/layout-editor/lint/LintPanel.js +132 -84
  60. package/dist/shared/components/layout-editor/lint/lint-api.js +65 -28
  61. package/dist/shared/components/layout-editor/nav/NavTools.js +14 -12
  62. package/dist/shared/components/layout-editor/nav/ZoomControls.js +145 -0
  63. package/dist/shared/components/layout-editor/nav/useEditorNav.js +34 -32
  64. package/dist/shared/components/layout-editor/nav/view-prefs.js +100 -15
  65. package/dist/shared/components/layout-editor/outputs/LayoutFile.js +89 -0
  66. package/dist/shared/components/layout-editor/outputs/OutputsButton.js +272 -195
  67. package/dist/shared/components/layout-editor/outputs/layout-file-plan.js +176 -0
  68. package/dist/shared/components/layout-editor/outputs/output-api.js +71 -37
  69. package/dist/shared/components/layout-editor/overview/describe-conditions.js +16 -11
  70. package/dist/shared/components/layout-editor/overview/purpose.js +5 -5
  71. package/dist/shared/components/layout-editor/panel-frame.js +1 -1
  72. package/dist/shared/components/layout-editor/parity-keys.json.js +1 -1
  73. package/dist/shared/components/layout-editor/personal-default-marks.js +40 -0
  74. package/dist/shared/components/layout-editor/pin.js +37 -19
  75. package/dist/shared/components/layout-editor/place-clip.js +257 -0
  76. package/dist/shared/components/layout-editor/preview/PreviewModes.js +27 -26
  77. package/dist/shared/components/layout-editor/preview/PreviewPanes.js +149 -118
  78. package/dist/shared/components/layout-editor/preview/SampleRecord.js +113 -0
  79. package/dist/shared/components/layout-editor/preview/preview-model.js +79 -60
  80. package/dist/shared/components/layout-editor/preview/sample-record.js +105 -0
  81. package/dist/shared/components/layout-editor/removed-log.js +151 -0
  82. package/dist/shared/components/layout-editor/reuse/LibraryRows.js +109 -78
  83. package/dist/shared/components/layout-editor/reuse/linked-sections.js +373 -0
  84. package/dist/shared/components/layout-editor/revert-element.js +140 -0
  85. package/dist/shared/components/layout-editor/section-structure.js +193 -170
  86. package/dist/shared/components/layout-editor/settings/EntrySection.js +63 -45
  87. package/dist/shared/components/layout-editor/settings/LayoutSection.js +63 -32
  88. package/dist/shared/components/layout-editor/settings/ResolveSettings.js +179 -137
  89. package/dist/shared/components/layout-editor/settings/WhoSection.js +18 -17
  90. package/dist/shared/components/layout-editor/settings/settings-registry.js +24 -0
  91. package/dist/shared/components/layout-editor/shortcuts.js +21 -16
  92. package/dist/shared/components/layout-editor/structure-ops.js +221 -195
  93. package/dist/shared/components/layout-editor/usage/UsagePanel.js +133 -85
  94. package/dist/shared/components/layout-editor/usage/refusal-lens.js +130 -0
  95. package/dist/shared/components/layout-editor/usage/usage-api.js +12 -11
  96. package/dist/shared/components/panels/CommentPanel.js +47 -45
  97. package/dist/shared/components/panels/RevisionsPanel.js +66 -64
  98. package/dist/shared/components/panels/TaskPanel.js +395 -332
  99. package/dist/shared/components/profile/AgentsPanel.js +196 -147
  100. package/dist/shared/components/profile/ConnectionRollback.js +329 -0
  101. package/dist/shared/components/profile/MyDefaultsCard.js +526 -520
  102. package/dist/shared/lib/entry-config.js +22 -22
  103. package/dist/shared/lib/form-usage-beacon.js +91 -55
  104. package/dist/shared/lib/layout-lint.js +530 -284
  105. package/dist/shared/lib/layout-resolve.js +58 -44
  106. package/package.json +1 -1
@@ -1,18 +1,19 @@
1
- import { jsxs as s, jsx as o, Fragment as L } from "react/jsx-runtime";
2
- import { X as R } from "lucide-react";
1
+ import { jsxs as a, jsx as o, Fragment as R } from "react/jsx-runtime";
2
+ import { X as L } from "lucide-react";
3
3
  import { useMemo as S } from "react";
4
4
  import { UNGROUPED_KEY as D } from "../../../lib/layout-ops.js";
5
- import { TipLayer as H } from "../../TipLayer.js";
6
- import { ArrangeButton as I } from "../ArrangeButton.js";
5
+ import { TipLayer as E } from "../../TipLayer.js";
6
+ import { ArrangeButton as H } from "../ArrangeButton.js";
7
7
  import { targetKey as N } from "../design-context.js";
8
- import { PlacementPresets as j } from "../entry/PlacementPresets.js";
9
- import { inPageOrder as z, selectedPlacements as B, fieldZones as E, isFieldRow as F, plural as g, widthOf as G, targetOfKey as O, keyOf as K, widthOps as U, GRID_WIDTHS as W, WIDTH_LABELS as $, flagOn as q, flagOps as A, moveToZoneOps as Z } from "../field-zones.js";
8
+ import { PlacementPresets as I } from "../entry/PlacementPresets.js";
9
+ import { inPageOrder as j, selectedPlacements as z, fieldZones as A, isFieldRow as B, plural as g, widthOf as F, targetOfKey as O, keyOf as G, widthOps as K, GRID_WIDTHS as U, WIDTH_LABELS as $, flagOn as W, flagOps as q, moveToZoneOps as Z } from "../field-zones.js";
10
10
  import { PanelHeader as V, PanelBody as X } from "../panel-frame.js";
11
11
  import { effectText as Y } from "../panel-style.js";
12
12
  import { slotName as J } from "../slot-names.js";
13
- import { useCollectionMeta as Q } from "./field-context.js";
14
- import { Setting as M, Segmented as ee, Toggle as te, Choice as oe } from "./kit.js";
15
- import { describeField as ne } from "./model.js";
13
+ import { EvenRowAction as Q } from "./EvenRowAction.js";
14
+ import { useCollectionMeta as ee } from "./field-context.js";
15
+ import { Setting as M, Segmented as te, Toggle as oe, Choice as ne } from "./kit.js";
16
+ import { describeField as re } from "./model.js";
16
17
  const le = [
17
18
  {
18
19
  k: "required",
@@ -36,32 +37,32 @@ const le = [
36
37
  effect: "Leaves them off this form; their values are kept."
37
38
  }
38
39
  ];
39
- function ve({
40
+ function ye({
40
41
  bundle: r,
41
- selection: f,
42
- apply: d,
42
+ selection: i,
43
+ apply: m,
43
44
  collection: _,
44
45
  onSelection: h
45
46
  }) {
46
- const { data: a } = Q(_), n = S(
47
- () => z(r, B(r, f)),
48
- [r, f]
49
- ), k = S(() => E(r), [r]), b = (e) => e.startsWith("__") ? J(e) : ne(
47
+ const { data: s } = ee(_), n = S(
48
+ () => j(r, z(r, i)),
49
+ [r, i]
50
+ ), k = S(() => A(r), [r]), b = (e) => e.startsWith("__") ? J(e) : re(
50
51
  e,
51
- (a == null ? void 0 : a.fields) ?? [],
52
- (a == null ? void 0 : a.relations) ?? [],
52
+ (s == null ? void 0 : s.fields) ?? [],
53
+ (s == null ? void 0 : s.relations) ?? [],
53
54
  n.find((t) => t.field === e) ?? null
54
- ).label, u = n.filter(F), m = f.length - n.length, p = g(n.length, "item"), x = new Set(n.map(G)), C = x.size === 1 ? String([...x][0]) : "", v = new Set(n.map((e) => e.group_key)), w = v.size === 1 ? P([...v][0] ?? null) : "", y = (e, t) => {
55
- e.length && d(e, { label: t });
55
+ ).label, u = n.filter(B), d = i.length - n.length, p = g(n.length, "item"), x = new Set(n.map(F)), C = x.size === 1 ? String([...x][0]) : "", v = new Set(n.map((e) => e.group_key)), w = v.size === 1 ? P([...v][0] ?? null) : "", y = (e, t) => {
56
+ e.length && m(e, { label: t });
56
57
  };
57
- return /* @__PURE__ */ s(
58
+ return /* @__PURE__ */ a(
58
59
  "div",
59
60
  {
60
61
  "data-inspector": "",
61
62
  "data-bulk-inspector": "",
62
63
  className: "flex h-full min-h-0 min-w-0 flex-col text-[12px]",
63
64
  children: [
64
- /* @__PURE__ */ o(H, {}),
65
+ /* @__PURE__ */ o(E, {}),
65
66
  /* @__PURE__ */ o(
66
67
  V,
67
68
  {
@@ -70,8 +71,8 @@ function ve({
70
71
  sub: "Shift- or ⌘-click to add or take out"
71
72
  }
72
73
  ),
73
- /* @__PURE__ */ s(X, { children: [
74
- /* @__PURE__ */ o("ul", { className: "flex flex-wrap gap-1.5", "aria-label": "Selected", children: n.map((e) => /* @__PURE__ */ s(
74
+ /* @__PURE__ */ a(X, { children: [
75
+ /* @__PURE__ */ o("ul", { className: "flex flex-wrap gap-1.5", "aria-label": "Selected", children: n.map((e) => /* @__PURE__ */ a(
75
76
  "li",
76
77
  {
77
78
  className: "inline-flex max-w-full items-center gap-1 rounded-full bg-nvr-cyan/10 py-0.5 pl-2.5 pr-1 text-[12px] font-medium text-slate-800 dark:text-foreground",
@@ -83,53 +84,56 @@ function ve({
83
84
  type: "button",
84
85
  "aria-label": `Take ${b(e.field)} out of the selection`,
85
86
  onClick: () => {
86
- const t = N(O(K(e)));
87
- h(f.filter((l) => N(l) !== t));
87
+ const t = N(O(G(e)));
88
+ h(i.filter((l) => N(l) !== t));
88
89
  },
89
90
  className: "inline-flex h-4 w-4 items-center justify-center rounded-full text-slate-500 hover:bg-nvr-cyan/20 hover:text-slate-800 dark:text-muted-foreground dark:hover:text-foreground",
90
- children: /* @__PURE__ */ o(R, { className: "h-3 w-3" })
91
+ children: /* @__PURE__ */ o(L, { className: "h-3 w-3" })
91
92
  }
92
93
  )
93
94
  ]
94
95
  },
95
96
  `${e.field}:${e.group_key ?? ""}`
96
97
  )) }),
97
- /* @__PURE__ */ s("div", { className: "flex flex-wrap items-center gap-2", children: [
98
- /* @__PURE__ */ o(I, { targets: f }),
99
- u.length > 0 && /* @__PURE__ */ o(j, { bundle: r, rows: u, apply: d })
98
+ /* @__PURE__ */ a("div", { className: "flex flex-wrap items-center gap-2", children: [
99
+ /* @__PURE__ */ o(H, { targets: i }),
100
+ u.length > 0 && /* @__PURE__ */ o(I, { bundle: r, rows: u, apply: m })
100
101
  ] }),
101
- m > 0 && /* @__PURE__ */ s("p", { className: Y, children: [
102
- g(m, "item"),
102
+ d > 0 && /* @__PURE__ */ a("p", { className: Y, children: [
103
+ g(d, "item"),
103
104
  " from the parent form ",
104
- m === 1 ? "is" : "are",
105
+ d === 1 ? "is" : "are",
105
106
  " left out: override ",
106
- m === 1 ? "it" : "them",
107
+ d === 1 ? "it" : "them",
107
108
  " on this form first."
108
109
  ] }),
109
- n.length > 0 && /* @__PURE__ */ s(L, { children: [
110
- /* @__PURE__ */ o(M, { k: "bulk.col_span", label: "Width", effect: "Share of the row each one takes.", children: /* @__PURE__ */ o(
111
- ee,
112
- {
113
- value: C,
114
- options: W.map((e) => ({ value: String(e), label: $[e] })),
115
- onChange: (e) => y(
116
- U(n, Number(e)),
117
- `Set the width of ${p} to ${$[Number(e)]}`
118
- )
119
- }
120
- ) }),
110
+ n.length > 0 && /* @__PURE__ */ a(R, { children: [
111
+ /* @__PURE__ */ a(M, { k: "bulk.col_span", label: "Width", effect: "Share of the row each one takes.", children: [
112
+ /* @__PURE__ */ o(
113
+ te,
114
+ {
115
+ value: C,
116
+ options: U.map((e) => ({ value: String(e), label: $[e] })),
117
+ onChange: (e) => y(
118
+ K(n, Number(e)),
119
+ `Set the width of ${p} to ${$[Number(e)]}`
120
+ )
121
+ }
122
+ ),
123
+ /* @__PURE__ */ o(Q, { bundle: r, targets: i, apply: m })
124
+ ] }),
121
125
  le.map((e) => {
122
126
  const t = e.k === "hidden" ? n : u;
123
127
  if (t.length === 0) return null;
124
- const l = t.filter((i) => q(i, e.k)).length, c = g(t.length, e.k === "hidden" ? "item" : "field");
128
+ const l = t.filter((f) => W(f, e.k)).length, c = g(t.length, e.k === "hidden" ? "item" : "field");
125
129
  return /* @__PURE__ */ o(
126
- te,
130
+ oe,
127
131
  {
128
132
  k: `bulk.${e.k}`,
129
133
  label: e.label,
130
134
  effect: l > 0 && l < t.length ? `${l} of ${t.length} now. ${e.effect}` : e.effect,
131
135
  checked: l === t.length,
132
- onChange: (i) => y(A(t, e.k, i), (i ? e.on : e.off).replace("{n}", c))
136
+ onChange: (f) => y(q(t, e.k, f), (f ? e.on : e.off).replace("{n}", c))
133
137
  },
134
138
  e.k
135
139
  );
@@ -141,7 +145,7 @@ function ve({
141
145
  label: "Section",
142
146
  effect: "Moves them to the end of that section, in the order they are on the form.",
143
147
  children: /* @__PURE__ */ o(
144
- oe,
148
+ ne,
145
149
  {
146
150
  ariaLabel: "Move to section",
147
151
  value: w,
@@ -151,8 +155,8 @@ function ve({
151
155
  ],
152
156
  onChange: (e) => {
153
157
  if (!e) return;
154
- const t = e === T ? null : e, l = k.find((i) => i.key === t), c = Z(r, n, t);
155
- c.ops.length && (d(c.ops, { label: `Move ${p} to ${(l == null ? void 0 : l.label) ?? "another section"}` }), h(c.moved.map(O)));
158
+ const t = e === T ? null : e, l = k.find((f) => f.key === t), c = Z(r, n, t);
159
+ c.ops.length && (m(c.ops, { label: `Move ${p} to ${(l == null ? void 0 : l.label) ?? "another section"}` }), h(c.moved.map(O)));
156
160
  }
157
161
  }
158
162
  )
@@ -175,5 +179,5 @@ function ve({
175
179
  }
176
180
  const T = D, P = (r) => r ?? T;
177
181
  export {
178
- ve as BulkInspector
182
+ ye as BulkInspector
179
183
  };
@@ -0,0 +1,31 @@
1
+ import { jsxs as h, jsx as c } from "react/jsx-runtime";
2
+ import { AlignHorizontalSpaceAround as p } from "lucide-react";
3
+ import { useMemo as i } from "react";
4
+ import { evenRowPlan as w, rowsToEven as f } from "../even-row.js";
5
+ import { WIDTH_LABELS as u } from "../field-zones.js";
6
+ function k({
7
+ bundle: t,
8
+ targets: o,
9
+ apply: l
10
+ }) {
11
+ const e = i(() => w(t, o), [t, o]), s = i(() => e.ok ? f(t, o) : [], [e, t, o]);
12
+ if (!e.ok) return null;
13
+ const r = s.filter((a) => a.members.length > 1), n = r.length === 1 ? r[0] : null, m = n ? `Even out this row (${n.members.length} at ${u[n.width] ?? n.width})` : `Even out their ${r.length} rows`;
14
+ return /* @__PURE__ */ h(
15
+ "button",
16
+ {
17
+ type: "button",
18
+ "data-even-row": "",
19
+ "data-tip": "Every field in the row gets the same width, filling the row",
20
+ onClick: () => l(e.ops, { label: e.label }),
21
+ className: "inline-flex items-center gap-1.5 text-[12px] font-medium text-sky-700 hover:underline dark:text-nvr-cyan",
22
+ children: [
23
+ /* @__PURE__ */ c(p, { className: "h-3.5 w-3.5" }),
24
+ m
25
+ ]
26
+ }
27
+ );
28
+ }
29
+ export {
30
+ k as EvenRowAction
31
+ };