@nivaro/react 0.2.54 → 0.2.55

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (150) hide show
  1. package/dist/full.css +1 -1
  2. package/dist/hooks/useSessionRecorder.js +99 -98
  3. package/dist/index.d.ts +339 -2
  4. package/dist/index.js +644 -618
  5. package/dist/layout-editor.d.ts +4 -0
  6. package/dist/shared/components/BackgroundRunOffer.js +117 -0
  7. package/dist/shared/components/BroadcastView.js +214 -213
  8. package/dist/shared/components/CollectionBrowserView.js +2592 -2695
  9. package/dist/shared/components/ItemEditForm.js +4066 -3832
  10. package/dist/shared/components/JobsTray.js +100 -55
  11. package/dist/shared/components/MyWorkView.js +91 -89
  12. package/dist/shared/components/NotificationBell.js +80 -79
  13. package/dist/shared/components/ProfileView.js +568 -520
  14. package/dist/shared/components/RecordCompare.js +254 -0
  15. package/dist/shared/components/RecordReadView.js +599 -552
  16. package/dist/shared/components/ReportView.js +578 -543
  17. package/dist/shared/components/RowPresence.js +91 -0
  18. package/dist/shared/components/WidgetSlot.js +474 -458
  19. package/dist/shared/components/ai/AiAnalyticsView.js +16 -6
  20. package/dist/shared/components/ai/AskPanel.js +139 -119
  21. package/dist/shared/components/ai/FirstWeekCard.js +126 -0
  22. package/dist/shared/components/bulk/BulkFieldUpdate.js +289 -0
  23. package/dist/shared/components/bulk/bulk-field-options.js +45 -0
  24. package/dist/shared/components/charts/CumulativeFlowChart.js +176 -0
  25. package/dist/shared/components/chat/ChannelArchive.js +326 -0
  26. package/dist/shared/components/chat/ChannelExtras.js +141 -121
  27. package/dist/shared/components/chat/ChatAnalyticsView.js +112 -110
  28. package/dist/shared/components/chat/ChatPanel.js +1695 -1733
  29. package/dist/shared/components/chat/Composer.js +357 -303
  30. package/dist/shared/components/chat/MessageActions.js +92 -0
  31. package/dist/shared/components/chat/MessageFormat.js +290 -264
  32. package/dist/shared/components/chat/OutboxBubbles.js +146 -0
  33. package/dist/shared/components/chat/RequestIdCard.js +135 -0
  34. package/dist/shared/components/chat/RoomHeaderMenu.js +202 -0
  35. package/dist/shared/components/chat/RoomParts.js +213 -274
  36. package/dist/shared/components/chat/ScreenClip.js +184 -0
  37. package/dist/shared/components/chat/chat-core.js +402 -483
  38. package/dist/shared/components/chat/chat-drafts.js +59 -0
  39. package/dist/shared/components/chat/chat-emoji.js +348 -0
  40. package/dist/shared/components/chat/chat-local-time.js +41 -0
  41. package/dist/shared/components/chat/chat-outbox.js +303 -0
  42. package/dist/shared/components/chat/chat-window.js +163 -0
  43. package/dist/shared/components/chat/huddle/HuddleControls.js +143 -0
  44. package/dist/shared/components/chat/huddle/HuddleStage.js +164 -0
  45. package/dist/shared/components/chat/huddle/huddle-store.js +342 -0
  46. package/dist/shared/components/chat/huddle/useHuddle.js +58 -0
  47. package/dist/shared/components/help-videos/api.js +76 -73
  48. package/dist/shared/components/item-edit/CatalogPickerField.js +113 -112
  49. package/dist/shared/components/item-edit/ChangeReasonDialog.js +13 -13
  50. package/dist/shared/components/item-edit/FieldAffordances.js +2 -2
  51. package/dist/shared/components/item-edit/FieldRenderer.js +248 -245
  52. package/dist/shared/components/item-edit/FieldRow.js +292 -279
  53. package/dist/shared/components/item-edit/GroupSection.js +698 -574
  54. package/dist/shared/components/item-edit/InlineTableField.js +3 -1
  55. package/dist/shared/components/item-edit/RelationCombobox.js +186 -176
  56. package/dist/shared/components/item-edit/entry/EntryStrip.js +54 -0
  57. package/dist/shared/components/item-edit/entry/entry-keys.js +27 -0
  58. package/dist/shared/components/item-edit/entry/useEntryKeyboard.js +70 -0
  59. package/dist/shared/components/item-edit/entry/useEntryMode.js +59 -0
  60. package/dist/shared/components/item-edit/form-structure-ui.js +105 -0
  61. package/dist/shared/components/item-edit/lazy-sections.js +36 -0
  62. package/dist/shared/components/item-edit/lock-why.js +39 -32
  63. package/dist/shared/components/item-edit/picker-miss.js +26 -0
  64. package/dist/shared/components/item-edit/placement-behaviour.js +196 -0
  65. package/dist/shared/components/item-edit/useFormUsageBeacon.js +51 -45
  66. package/dist/shared/components/layout-editor/AddPanel.js +134 -117
  67. package/dist/shared/components/layout-editor/ChangeNote.js +25 -24
  68. package/dist/shared/components/layout-editor/CollabParts.js +80 -75
  69. package/dist/shared/components/layout-editor/DesignNode.js +126 -120
  70. package/dist/shared/components/layout-editor/EditorCanvas.js +30 -27
  71. package/dist/shared/components/layout-editor/EditorTopBar.js +203 -192
  72. package/dist/shared/components/layout-editor/HistoryPanel.js +120 -104
  73. package/dist/shared/components/layout-editor/LayoutEditor.js +768 -671
  74. package/dist/shared/components/layout-editor/RestorePiece.js +143 -0
  75. package/dist/shared/components/layout-editor/StagedChip.js +22 -0
  76. package/dist/shared/components/layout-editor/StructureMenu.js +237 -186
  77. package/dist/shared/components/layout-editor/collab/FormFollowShare.js +149 -103
  78. package/dist/shared/components/layout-editor/collab/collab-api.js +29 -26
  79. package/dist/shared/components/layout-editor/dnd/LayoutDndProvider.js +81 -80
  80. package/dist/shared/components/layout-editor/dnd/node.js +69 -57
  81. package/dist/shared/components/layout-editor/draft-recovery.js +113 -43
  82. package/dist/shared/components/layout-editor/entry/PlacementPresets.js +149 -0
  83. package/dist/shared/components/layout-editor/entry/entry-editor-context.js +10 -0
  84. package/dist/shared/components/layout-editor/entry/presets.js +71 -0
  85. package/dist/shared/components/layout-editor/entry/tab-order.js +110 -0
  86. package/dist/shared/components/layout-editor/entry/theme-preview.js +37 -0
  87. package/dist/shared/components/layout-editor/grid-guides.js +142 -0
  88. package/dist/shared/components/layout-editor/inspector/BehaviourSettings.js +402 -0
  89. package/dist/shared/components/layout-editor/inspector/BulkInspector.js +61 -57
  90. package/dist/shared/components/layout-editor/inspector/GroupInspector.js +247 -151
  91. package/dist/shared/components/layout-editor/inspector/Inspector.js +176 -155
  92. package/dist/shared/components/layout-editor/inspector/LookTab.js +167 -116
  93. package/dist/shared/components/layout-editor/inspector/PickerMisses.js +129 -0
  94. package/dist/shared/components/layout-editor/inspector/PickerTab.js +84 -82
  95. package/dist/shared/components/layout-editor/inspector/RulesTab.js +66 -62
  96. package/dist/shared/components/layout-editor/inspector/kit.js +69 -68
  97. package/dist/shared/components/layout-editor/outputs/OutputsButton.js +254 -0
  98. package/dist/shared/components/layout-editor/outputs/help-sheet.js +154 -0
  99. package/dist/shared/components/layout-editor/outputs/output-api.js +61 -0
  100. package/dist/shared/components/layout-editor/overview/describe-conditions.js +6 -0
  101. package/dist/shared/components/layout-editor/overview/purpose.js +15 -13
  102. package/dist/shared/components/layout-editor/parity-keys.json.js +1 -1
  103. package/dist/shared/components/layout-editor/restore-piece.js +192 -0
  104. package/dist/shared/components/layout-editor/section-structure.js +241 -0
  105. package/dist/shared/components/layout-editor/settings/EntrySection.js +296 -0
  106. package/dist/shared/components/layout-editor/settings/FormSettings.js +41 -39
  107. package/dist/shared/components/layout-editor/settings/ResolveSettings.js +255 -0
  108. package/dist/shared/components/layout-editor/settings/ToolsSection.js +147 -111
  109. package/dist/shared/components/layout-editor/settings/WhoSection.js +29 -26
  110. package/dist/shared/components/layout-editor/settings/settings-registry.js +114 -17
  111. package/dist/shared/components/layout-editor/staged-api.js +64 -0
  112. package/dist/shared/components/layout-editor/structure-ops.js +81 -77
  113. package/dist/shared/components/layout-editor/testing/TestingPanels.js +65 -60
  114. package/dist/shared/components/layout-editor/testing/testing-model.js +198 -185
  115. package/dist/shared/components/layout-editor/toolbar-kit.js +11 -11
  116. package/dist/shared/components/layout-editor/usage/AbTestSection.js +355 -0
  117. package/dist/shared/components/layout-editor/usage/UsagePanel.js +144 -70
  118. package/dist/shared/components/layout-editor/usage/ab-api.js +86 -0
  119. package/dist/shared/components/layout-editor/usage/suggest-collapse.js +32 -0
  120. package/dist/shared/components/layout-editor/useLayoutDraft.js +25 -24
  121. package/dist/shared/components/notifications/NotificationAnalyticsView.js +148 -77
  122. package/dist/shared/components/panels/ErpFailureBanner.js +18 -17
  123. package/dist/shared/components/panels/ExternalRequestsChip.js +63 -62
  124. package/dist/shared/components/pipeline/PipelineEditorView.js +106 -104
  125. package/dist/shared/components/profile/AgentsPanel.js +479 -0
  126. package/dist/shared/components/queue/QueueWorklist.js +1026 -1040
  127. package/dist/shared/components/support/SupportAnalytics.js +171 -0
  128. package/dist/shared/components/support/SupportView.js +75 -73
  129. package/dist/shared/lib/background-runs.js +150 -0
  130. package/dist/shared/lib/delivery-ack.js +9 -0
  131. package/dist/shared/lib/entry-badge-style.js +13 -0
  132. package/dist/shared/lib/entry-config.js +71 -0
  133. package/dist/shared/lib/form-sections.js +64 -0
  134. package/dist/shared/lib/form-structure.js +99 -0
  135. package/dist/shared/lib/form-usage-beacon.js +101 -52
  136. package/dist/shared/lib/jobs-tray.js +25 -23
  137. package/dist/shared/lib/keyset-pager.js +37 -0
  138. package/dist/shared/lib/layout-ops.js +84 -82
  139. package/dist/shared/lib/layout-resolve.js +113 -0
  140. package/dist/shared/lib/placement-behaviour.js +144 -0
  141. package/dist/shared/lib/prefetch.js +149 -0
  142. package/dist/shared/lib/presence-hooks.js +199 -0
  143. package/dist/shared/lib/record-outbox.js +82 -81
  144. package/dist/shared/lib/replay-socket.js +93 -0
  145. package/dist/shared/lib/request-gate.js +51 -50
  146. package/dist/shared/lib/room-gaps.js +96 -0
  147. package/dist/shared/lib/search-log.js +27 -0
  148. package/dist/shared/lib/socket-realtime.js +101 -80
  149. package/dist/shared/lib/worker-socket.js +200 -0
  150. package/package.json +1 -1
@@ -1,40 +1,41 @@
1
- import { jsx as i, Fragment as K, jsxs as m } from "react/jsx-runtime";
2
- import { EyeOff as ke, Lock as xe, Pin as ye } from "lucide-react";
3
- import { isValidElement as ae, Fragment as Ne, cloneElement as De } from "react";
4
- import { cn as f, formatRelative as _e } from "../../lib/utils.js";
5
- import { useLayoutDesign as re, targetKey as we, isSelectedIn as $e } from "./design-context.js";
6
- import { useDesignDndNode as Ce, NO_DND as Te, useDesignDropBody as Re } from "./dnd/node.js";
7
- import { NoteMarker as je } from "./NoteMarker.js";
8
- import { FillChip as Fe } from "./usage/FillChip.js";
9
- const ee = (e, a) => {
1
+ import { jsx as i, Fragment as S, jsxs as m } from "react/jsx-runtime";
2
+ import { EyeOff as xe, Lock as ye, Pin as Ne } from "lucide-react";
3
+ import { isValidElement as re, Fragment as _e, cloneElement as De } from "react";
4
+ import { cn as f, formatRelative as we } from "../../lib/utils.js";
5
+ import { useLayoutDesign as oe, targetKey as Ce, isSelectedIn as $e } from "./design-context.js";
6
+ import { useDesignDndNode as Te, NO_DND as Re, useDesignDropBody as ze } from "./dnd/node.js";
7
+ import { ResizeHandle as je } from "./grid-guides.js";
8
+ import { NoteMarker as Fe } from "./NoteMarker.js";
9
+ import { FillChip as Me } from "./usage/FillChip.js";
10
+ const te = (e, a) => {
10
11
  typeof e == "function" ? e(a) : e && typeof e == "object" && (e.current = a);
11
12
  };
12
- function te(...e) {
13
+ function ne(...e) {
13
14
  const a = {};
14
15
  for (const o of e)
15
16
  for (const [r, d] of Object.entries(o)) {
16
17
  const c = a[r];
17
18
  d !== void 0 && (c === void 0 ? a[r] = d : r === "className" ? a[r] = `${c} ${d}` : r === "style" ? a[r] = { ...c, ...d } : r === "ref" ? a[r] = (n) => {
18
- ee(c, n), ee(d, n);
19
+ te(c, n), te(d, n);
19
20
  } : /^on[A-Z]/.test(r) && typeof c == "function" && typeof d == "function" ? a[r] = (...n) => {
20
21
  c(...n), d(...n);
21
22
  } : a[r] = d);
22
23
  }
23
24
  return a;
24
25
  }
25
- const Me = {
26
+ const Ae = {
26
27
  violet: "bg-violet-50 text-violet-800 ring-violet-200 dark:bg-violet-500/15 dark:text-violet-200 dark:ring-violet-500/30",
27
28
  emerald: "bg-emerald-50 text-emerald-800 ring-emerald-200 dark:bg-emerald-500/15 dark:text-emerald-200 dark:ring-emerald-500/30",
28
29
  amber: "bg-amber-50 text-amber-800 ring-amber-200 dark:bg-amber-500/15 dark:text-amber-200 dark:ring-amber-500/30",
29
30
  slate: "bg-slate-100 text-slate-700 ring-slate-200 dark:bg-slate-800 dark:text-slate-200 dark:ring-slate-700"
30
- }, Ae = "inline-block max-w-[260px] truncate rounded px-1 text-left text-[11px] ring-1", Ie = [
31
+ }, Ie = "inline-block max-w-[260px] truncate rounded px-1 text-left text-[11px] ring-1", Oe = [
31
32
  "data-[rule-dependent]:outline-dashed data-[rule-dependent]:outline-2 data-[rule-dependent]:outline-amber-400 dark:data-[rule-dependent]:outline-amber-400/80",
32
33
  "data-[rule-drives]:after:pointer-events-none data-[rule-drives]:after:absolute data-[rule-drives]:after:-bottom-2 data-[rule-drives]:after:right-1 data-[rule-drives]:after:z-10 data-[rule-drives]:after:rounded data-[rule-drives]:after:bg-amber-50 data-[rule-drives]:after:px-1 data-[rule-drives]:after:text-[11px] data-[rule-drives]:after:text-amber-800 data-[rule-drives]:after:ring-1 data-[rule-drives]:after:ring-amber-200 data-[rule-drives]:after:content-[attr(data-rule-drives)] dark:data-[rule-drives]:after:bg-[#413727] dark:data-[rule-drives]:after:text-amber-200 dark:data-[rule-drives]:after:ring-amber-500/30"
33
- ].join(" "), oe = {
34
+ ].join(" "), ie = {
34
35
  before: { top: -5, left: 0, right: 0, height: 3 },
35
36
  after: { bottom: -5, left: 0, right: 0, height: 3 }
36
37
  };
37
- function ze({
38
+ function Ee({
38
39
  target: e,
39
40
  children: a,
40
41
  inline: o,
@@ -42,66 +43,66 @@ function ze({
42
43
  pass: d,
43
44
  ...c
44
45
  }) {
45
- var G, W, H, U, V, Z, X, q, J, Q;
46
- const n = re(), p = (n == null ? void 0 : n.inheritedFrom(e)) ?? null, de = c["data-design-copy"] !== void 0, se = c["data-header-folded"] !== void 0, l = ((G = n == null ? void 0 : n.diffMark) == null ? void 0 : G.call(n, e)) ?? null, N = (l == null ? void 0 : l.kind) === "removed", D = !n || !!p || de || N, _ = Ce((n == null ? void 0 : n.dnd) ?? Te, e, { disabled: D, noDrop: se });
47
- if (!n) return /* @__PURE__ */ i(K, { children: a });
48
- const le = we(e), T = $e(n, e), s = ((W = n.roleMark) == null ? void 0 : W.call(n, e)) ?? null, R = ((H = n.marks) == null ? void 0 : H.call(n, e)) ?? [], b = ((U = n.overlay) == null ? void 0 : U.call(n, e)) ?? null, S = ((V = n.unsaved) == null ? void 0 : V.call(n, e)) ?? !1, v = ((Z = n.peers) == null ? void 0 : Z.call(n, e)) ?? [], ce = R.some((t) => t.highlight), L = ((X = n.note) == null ? void 0 : X.call(n, e)) ?? null, j = L ? /* @__PURE__ */ i(je, { note: L }) : null, F = D ? {} : _.props, ue = _.dragging, w = D ? null : _.slot, u = r && ae(a) ? a : null, pe = (u == null ? void 0 : u.props.className) ?? "", ge = /(^|\s)(absolute|fixed|sticky|relative)(\s|$)/.test(pe), me = f(
49
- !ge && "relative",
46
+ var G, H, U, V, Z, X, q, J, Q, Y;
47
+ const n = oe(), g = (n == null ? void 0 : n.inheritedFrom(e)) ?? null, se = c["data-design-copy"] !== void 0, le = c["data-header-folded"] !== void 0, l = ((G = n == null ? void 0 : n.diffMark) == null ? void 0 : G.call(n, e)) ?? null, _ = (l == null ? void 0 : l.kind) === "removed", v = !n || !!g || se || _, D = Te((n == null ? void 0 : n.dnd) ?? Re, e, { disabled: v, noDrop: le });
48
+ if (!n) return /* @__PURE__ */ i(S, { children: a });
49
+ const ce = Ce(e), w = $e(n, e), s = ((H = n.roleMark) == null ? void 0 : H.call(n, e)) ?? null, R = ((U = n.marks) == null ? void 0 : U.call(n, e)) ?? [], b = ((V = n.overlay) == null ? void 0 : V.call(n, e)) ?? null, L = ((Z = n.unsaved) == null ? void 0 : Z.call(n, e)) ?? !1, k = ((X = n.peers) == null ? void 0 : X.call(n, e)) ?? [], ue = R.some((t) => t.highlight), B = ((q = n.note) == null ? void 0 : q.call(n, e)) ?? null, z = B ? /* @__PURE__ */ i(Fe, { note: B }) : null, j = v ? {} : D.props, pe = D.dragging, C = v ? null : D.slot, p = r && re(a) ? a : null, ge = (p == null ? void 0 : p.props.className) ?? "", me = /(^|\s)(absolute|fixed|sticky|relative)(\s|$)/.test(ge), he = f(
50
+ !me && "relative",
50
51
  "cursor-pointer rounded-md outline-offset-2",
51
- !u && (o ? "inline-block" : "block"),
52
- T ? "outline outline-2 outline-nvr-cyan" : v.length > 0 ? `outline outline-2 ${v[0].outline}` : ce ? "outline-dashed outline-2 outline-violet-400 dark:outline-violet-400/70" : "hover:outline hover:outline-1 hover:outline-slate-300 dark:hover:outline-slate-600",
52
+ !p && (o ? "inline-block" : "block"),
53
+ w ? "outline outline-2 outline-nvr-cyan" : k.length > 0 ? `outline outline-2 ${k[0].outline}` : ue ? "outline-dashed outline-2 outline-violet-400 dark:outline-violet-400/70" : "hover:outline hover:outline-1 hover:outline-slate-300 dark:hover:outline-slate-600",
53
54
  b == null ? void 0 : b.className,
54
55
  "focus-visible:outline focus-visible:outline-2 focus-visible:outline-nvr-cyan",
55
- Ie,
56
+ Oe,
56
57
  // The section's "Changed by" shows while the pointer is over it.
57
58
  "[&:hover>[data-design-last-change]]:visible",
58
- ue && "opacity-40",
59
+ pe && "opacity-40",
59
60
  // Hidden for the previewed role: faint, its tags not.
60
61
  (s == null ? void 0 : s.kind) === "hidden" && "[&>:not([data-design-badges])]:opacity-40",
61
- l && Pe[l.kind],
62
- N && "cursor-default [&>:not([data-design-badges])]:opacity-40"
63
- ), he = (t) => {
64
- const g = t.target;
65
- if (g.closest("[data-design-target]") !== t.currentTarget) return;
66
- if (N) {
62
+ l && Ge[l.kind],
63
+ _ && "cursor-default [&>:not([data-design-badges])]:opacity-40"
64
+ ), fe = (t) => {
65
+ const u = t.target;
66
+ if (u.closest("[data-design-target]") !== t.currentTarget) return;
67
+ if (_) {
67
68
  t.preventDefault(), t.stopPropagation();
68
69
  return;
69
70
  }
70
71
  t.shiftKey || t.metaKey || t.ctrlKey ? n.onSelect(e, { additive: !0 }) : n.onSelect(e);
71
- const y = g.closest("[data-design-pass]");
72
- y && t.currentTarget.contains(y) || (t.preventDefault(), t.stopPropagation());
73
- }, fe = (t) => {
74
- t.key !== "Enter" || t.target !== t.currentTarget || N || t.currentTarget.tagName !== "BUTTON" && (t.preventDefault(), t.shiftKey ? n.onSelect(e, { additive: !0 }) : n.onSelect(e));
75
- }, k = c["data-design-tab"] !== void 0 || ((q = u == null ? void 0 : u.props) == null ? void 0 : q["data-design-tab"]) !== void 0, M = {
76
- "data-design-target": le,
77
- "data-selected": T ? "true" : void 0,
72
+ const N = u.closest("[data-design-pass]");
73
+ N && t.currentTarget.contains(N) || (t.preventDefault(), t.stopPropagation());
74
+ }, be = (t) => {
75
+ t.key !== "Enter" || t.target !== t.currentTarget || _ || t.currentTarget.tagName !== "BUTTON" && (t.preventDefault(), t.shiftKey ? n.onSelect(e, { additive: !0 }) : n.onSelect(e));
76
+ }, x = c["data-design-tab"] !== void 0 || ((J = p == null ? void 0 : p.props) == null ? void 0 : J["data-design-tab"]) !== void 0, F = {
77
+ "data-design-target": ce,
78
+ "data-selected": w ? "true" : void 0,
78
79
  "data-design-pass": d ? "" : void 0,
79
- "data-drop-slot": w ?? void 0,
80
+ "data-drop-slot": C ?? void 0,
80
81
  "data-role-mark": s == null ? void 0 : s.kind,
81
- "data-unsaved": S ? "" : void 0,
82
+ "data-unsaved": L ? "" : void 0,
82
83
  "data-diff": l == null ? void 0 : l.kind,
83
84
  // Locked nodes get no dnd attributes; they still take focus to be selected.
84
85
  // So do nodes drag and drop leaves out (a pinned section, #2628).
85
- ...D || !("tabIndex" in F) ? { role: "button", tabIndex: 0 } : {},
86
- ...k && p ? { "data-tip": `From ${p}` } : {},
87
- className: me,
88
- onClickCapture: he,
89
- onKeyDown: fe
90
- }, be = (s == null ? void 0 : s.kind) === "hidden" ? ke : xe, A = e.kind === "field" || e.kind === "header" ? ((J = n.fillRate) == null ? void 0 : J.call(n, e.field)) ?? null : null, x = e.kind === "group" && !k ? ((Q = n.lastChange) == null ? void 0 : Q.call(n, e)) ?? null : null, B = x && [x.by ? `by ${x.by}` : null, x.at ? _e(x.at) : null].filter(Boolean).join(" · ") || null, I = B && !l ? /* @__PURE__ */ m(
86
+ ...v || !("tabIndex" in j) ? { role: "button", tabIndex: 0 } : {},
87
+ ...x && g ? { "data-tip": `From ${g}` } : {},
88
+ className: he,
89
+ onClickCapture: fe,
90
+ onKeyDown: be
91
+ }, ke = (s == null ? void 0 : s.kind) === "hidden" ? xe : ye, M = e.kind === "field" || e.kind === "header" ? ((Q = n.fillRate) == null ? void 0 : Q.call(n, e.field)) ?? null : null, y = e.kind === "group" && !x ? ((Y = n.lastChange) == null ? void 0 : Y.call(n, e)) ?? null : null, P = y && [y.by ? `by ${y.by}` : null, y.at ? we(y.at) : null].filter(Boolean).join(" · ") || null, A = P && !l ? /* @__PURE__ */ m(
91
92
  "span",
92
93
  {
93
94
  "data-design-last-change": "",
94
95
  className: f(
95
96
  "pointer-events-none absolute -bottom-2 right-1 z-10 rounded bg-white px-1 text-[10.5px] text-slate-500 dark:bg-card dark:text-muted-foreground",
96
- !T && "invisible"
97
+ !w && "invisible"
97
98
  ),
98
99
  children: [
99
100
  "Changed ",
100
- B
101
+ P
101
102
  ]
102
103
  }
103
104
  ) : null, h = [];
104
- l && h.push({ rank: 0, text: Be(l), node: /* @__PURE__ */ i(ne, { diff: l }) }), s && h.push({
105
+ l && h.push({ rank: 0, text: We(l), node: /* @__PURE__ */ i(ae, { diff: l }) }), s && h.push({
105
106
  rank: 1,
106
107
  text: `${s.kind === "hidden" ? "Hidden" : "Read-only"} for ${s.role}`,
107
108
  node: /* @__PURE__ */ m(
@@ -110,7 +111,7 @@ function ze({
110
111
  "data-design-role-tag": s.kind,
111
112
  className: "inline-flex items-center gap-0.5 rounded bg-amber-50 px-1 text-[11px] text-amber-800 ring-1 ring-amber-200 dark:bg-amber-500/15 dark:text-amber-200 dark:ring-amber-500/30",
112
113
  children: [
113
- /* @__PURE__ */ i(be, { "aria-hidden": !0, className: "h-3 w-3" }),
114
+ /* @__PURE__ */ i(ke, { "aria-hidden": !0, className: "h-3 w-3" }),
114
115
  s.kind === "hidden" ? "Hidden" : "Read-only",
115
116
  " for ",
116
117
  s.role
@@ -121,19 +122,19 @@ function ze({
121
122
  rank: 1,
122
123
  text: "Who sees it",
123
124
  node: /* @__PURE__ */ i("span", { "data-design-pass": "", className: "pointer-events-auto", children: b.chip })
124
- }), R.forEach((t, g) => {
125
- const y = f(
126
- Ae,
125
+ }), R.forEach((t, u) => {
126
+ const N = f(
127
+ Ie,
127
128
  t.icon && "inline-flex items-center gap-0.5",
128
129
  t.onClick || t.tip ? "pointer-events-auto" : null,
129
130
  t.onClick && "hover:brightness-95",
130
- Me[t.tone]
131
- ), Y = /* @__PURE__ */ m(K, { children: [
132
- t.icon === "pin" && /* @__PURE__ */ i(ye, { "aria-hidden": !0, className: "h-3 w-3" }),
131
+ Ae[t.tone]
132
+ ), ee = /* @__PURE__ */ m(S, { children: [
133
+ t.icon === "pin" && /* @__PURE__ */ i(Ne, { "aria-hidden": !0, className: "h-3 w-3" }),
133
134
  t.text
134
135
  ] });
135
136
  h.push({
136
- rank: Ke(t),
137
+ rank: Le(t),
137
138
  text: t.text,
138
139
  node: t.onClick ? /* @__PURE__ */ i(
139
140
  "button",
@@ -143,51 +144,51 @@ function ze({
143
144
  "data-design-pass": "",
144
145
  "data-tip": t.tip,
145
146
  onClick: t.onClick,
146
- className: y,
147
- children: Y
147
+ className: N,
148
+ children: ee
148
149
  },
149
- `${g}:${t.text}`
150
+ `${u}:${t.text}`
150
151
  ) : /* @__PURE__ */ i(
151
152
  "span",
152
153
  {
153
154
  "data-design-mark": "",
154
155
  "data-tip": t.tip,
155
- className: y,
156
- children: Y
156
+ className: N,
157
+ children: ee
157
158
  },
158
- `${g}:${t.text}`
159
+ `${u}:${t.text}`
159
160
  )
160
161
  });
161
- }), p && h.push({
162
+ }), g && h.push({
162
163
  rank: 5,
163
- text: `from ${p}`,
164
+ text: `from ${g}`,
164
165
  node: /* @__PURE__ */ m("span", { className: "rounded bg-slate-100 px-1 text-[11px] text-slate-600 dark:bg-slate-800 dark:text-slate-300", children: [
165
166
  "from ",
166
- p
167
+ g
167
168
  ] })
168
169
  });
169
- const { shown: ve, rest: $ } = Se(h), P = R.length > 0 || b != null || v.length > 0, C = k && !l ? [...h.map((t) => t.text), ...v.map((t) => t.name)] : [];
170
- C.length > 0 && (M["data-tip"] = p && !s && !P ? `From ${p}` : C.join(" · "));
171
- const z = k && l ? /* @__PURE__ */ i("span", { "data-design-badges": "", className: "pointer-events-none absolute -top-2 right-0 z-10", children: /* @__PURE__ */ i(ne, { diff: l }) }) : C.length > 0 ? /* @__PURE__ */ i(
170
+ const { shown: ve, rest: $ } = Be(h), W = R.length > 0 || b != null || k.length > 0, T = x && !l ? [...h.map((t) => t.text), ...k.map((t) => t.name)] : [];
171
+ T.length > 0 && (F["data-tip"] = g && !s && !W ? `From ${g}` : T.join(" · "));
172
+ const I = x && l ? /* @__PURE__ */ i("span", { "data-design-badges": "", className: "pointer-events-none absolute -top-2 right-0 z-10", children: /* @__PURE__ */ i(ae, { diff: l }) }) : T.length > 0 ? /* @__PURE__ */ i(
172
173
  "span",
173
174
  {
174
175
  "data-design-badges": "",
175
176
  className: f(
176
177
  "pointer-events-none absolute left-1/2 top-1 z-10 h-1.5 w-1.5 -translate-x-1/2 rounded-full",
177
- p && !s && !P ? "bg-slate-500 dark:bg-slate-400" : "bg-violet-500 dark:bg-violet-400"
178
+ g && !s && !W ? "bg-slate-500 dark:bg-slate-400" : "bg-violet-500 dark:bg-violet-400"
178
179
  ),
179
- children: /* @__PURE__ */ i("span", { className: "sr-only", children: C.join(" · ") })
180
+ children: /* @__PURE__ */ i("span", { className: "sr-only", children: T.join(" · ") })
180
181
  }
181
- ) : h.length > 0 || v.length > 0 || A != null ? /* @__PURE__ */ m(
182
+ ) : h.length > 0 || k.length > 0 || M != null ? /* @__PURE__ */ m(
182
183
  "span",
183
184
  {
184
185
  "data-design-badges": "",
185
186
  className: "pointer-events-none absolute -top-2 right-1 z-10 flex items-center gap-1",
186
187
  children: [
187
- A != null && /* @__PURE__ */ i(Fe, { pct: A }),
188
- ve.map((t, g) => (
188
+ M != null && /* @__PURE__ */ i(Me, { pct: M }),
189
+ ve.map((t, u) => (
189
190
  // biome-ignore lint/suspicious/noArrayIndexKey: ranked tags of one node, rebuilt each render
190
- /* @__PURE__ */ i(Ne, { children: t.node }, g)
191
+ /* @__PURE__ */ i(_e, { children: t.node }, u)
191
192
  )),
192
193
  $.length > 0 && /* @__PURE__ */ m(
193
194
  "span",
@@ -201,7 +202,7 @@ function ze({
201
202
  ]
202
203
  }
203
204
  ),
204
- v.map((t) => /* @__PURE__ */ i(
205
+ k.map((t) => /* @__PURE__ */ i(
205
206
  "span",
206
207
  {
207
208
  "data-design-peer": t.id,
@@ -210,68 +211,73 @@ function ze({
210
211
  "pointer-events-auto inline-flex h-4 w-4 items-center justify-center rounded-full text-[9px] font-semibold ring-1",
211
212
  t.chip
212
213
  ),
213
- children: Le(t.name)
214
+ children: Pe(t.name)
214
215
  },
215
216
  t.id
216
217
  ))
217
218
  ]
218
219
  }
219
- ) : null, O = S ? /* @__PURE__ */ i(
220
+ ) : null, O = L ? /* @__PURE__ */ i(
220
221
  "span",
221
222
  {
222
223
  "data-unsaved-dot": "",
223
224
  className: f(
224
225
  "pointer-events-none absolute z-10 h-2 w-2 rounded-full bg-nvr-cyan ring-2 ring-white dark:ring-slate-900",
225
226
  // A step clips its corners away: the dot sits inside, before the arrow.
226
- k ? "right-4 top-1" : "-left-1 -top-1"
227
+ x ? "right-4 top-1" : "-left-1 -top-1"
227
228
  ),
228
229
  children: /* @__PURE__ */ i("span", { className: "sr-only", children: "unsaved change" })
229
230
  }
230
- ) : null, E = w ? /* @__PURE__ */ i(
231
+ ) : null, E = C ? /* @__PURE__ */ i(
231
232
  "span",
232
233
  {
233
234
  "aria-hidden": !0,
234
- "data-design-drop-indicator": w,
235
+ "data-design-drop-indicator": C,
235
236
  className: "pointer-events-none absolute z-30 rounded-full bg-nvr-cyan shadow-[0_0_0_2px_#fff] dark:shadow-[0_0_0_2px_#0f172a]",
236
- style: _.indicator ?? oe[w]
237
+ style: D.indicator ?? ie[C]
237
238
  }
238
- ) : null;
239
- if (u) {
240
- const { children: t, ...g } = u.props;
239
+ ) : null, K = w && !v && n.resizeWidth && (e.kind === "field" || e.kind === "slot") && e.group_key !== null ? /* @__PURE__ */ i(je, { onCommit: (t) => {
240
+ var u;
241
+ return (u = n.resizeWidth) == null ? void 0 : u.call(n, e, t);
242
+ } }) : null;
243
+ if (p) {
244
+ const { children: t, ...u } = p.props;
241
245
  return De(
242
- u,
246
+ p,
243
247
  // The child's own classes, style, ref and handlers are kept and merged.
244
- te(g, c, F, M),
245
- z || I || E || O || j ? /* @__PURE__ */ m(K, { children: [
248
+ ne(u, c, j, F),
249
+ I || A || E || O || z || K ? /* @__PURE__ */ m(S, { children: [
246
250
  O,
247
- z,
248
251
  I,
249
- j,
252
+ A,
253
+ z,
250
254
  E,
255
+ K,
251
256
  t
252
257
  ] }) : t
253
258
  );
254
259
  }
255
- return /* @__PURE__ */ m(o ? "span" : "div", { ...te(c, F, M), children: [
260
+ return /* @__PURE__ */ m(o ? "span" : "div", { ...ne(c, j, F), children: [
256
261
  O,
257
- z,
258
262
  I,
259
- j,
263
+ A,
264
+ z,
260
265
  E,
266
+ K,
261
267
  a
262
268
  ] });
263
269
  }
264
- function Oe(e, a, o, r = {}) {
270
+ function Ke(e, a, o, r = {}) {
265
271
  if (!e || o == null || o === !1) return o;
266
- const d = ae(o) ? o.key ?? void 0 : void 0;
267
- return /* @__PURE__ */ i(ze, { target: a, ...r, children: o }, d);
272
+ const d = re(o) ? o.key ?? void 0 : void 0;
273
+ return /* @__PURE__ */ i(Ee, { target: a, ...r, children: o }, d);
268
274
  }
269
- function Qe() {
270
- const e = re();
271
- return (a, o, r) => Oe(e, a, o, r);
275
+ function tt() {
276
+ const e = oe();
277
+ return (a, o, r) => Ke(e, a, o, r);
272
278
  }
273
- function Ye({ groupKey: e }) {
274
- const { ref: a, slot: o, indicator: r } = Re(e);
279
+ function nt({ groupKey: e }) {
280
+ const { ref: a, slot: o, indicator: r } = ze(e);
275
281
  return /* @__PURE__ */ i(
276
282
  "span",
277
283
  {
@@ -281,11 +287,11 @@ function Ye({ groupKey: e }) {
281
287
  "data-design-drop-body": e,
282
288
  "data-design-drop-indicator": o ?? void 0,
283
289
  className: "pointer-events-none absolute z-30 rounded-full bg-nvr-cyan shadow-[0_0_0_2px_#fff] dark:shadow-[0_0_0_2px_#0f172a]",
284
- style: o ? r ?? oe[o] : void 0
290
+ style: o ? r ?? ie[o] : void 0
285
291
  }
286
292
  );
287
293
  }
288
- function et() {
294
+ function at() {
289
295
  return /* @__PURE__ */ i(
290
296
  "div",
291
297
  {
@@ -295,30 +301,30 @@ function et() {
295
301
  }
296
302
  );
297
303
  }
298
- const Ee = 2;
299
- function Ke(e) {
304
+ const Se = 2;
305
+ function Le(e) {
300
306
  return e.kind === "preview" ? 1 : e.kind === "ai" ? 4 : e.kind === "loop" || e.highlight ? 2 : 3;
301
307
  }
302
- function Se(e, a = Ee) {
308
+ function Be(e, a = Se) {
303
309
  const o = e.map((r, d) => ({ c: r, i: d })).sort((r, d) => r.c.rank - d.c.rank || r.i - d.i).map((r) => r.c);
304
310
  return { shown: o.slice(0, a), rest: o.slice(a) };
305
311
  }
306
- function Le(e) {
312
+ function Pe(e) {
307
313
  return e.trim().split(/\s+/).filter(Boolean).slice(0, 2).map((o) => {
308
314
  var r;
309
315
  return ((r = o[0]) == null ? void 0 : r.toUpperCase()) ?? "";
310
316
  }).join("") || "?";
311
317
  }
312
- function Be(e) {
313
- const a = ie[e.kind].text;
318
+ function We(e) {
319
+ const a = de[e.kind].text;
314
320
  return e.kind === "moved" && e.detail ? `Moved ${e.detail}` : e.kind === "changed" && e.detail ? `${a}: ${e.detail}` : a;
315
321
  }
316
- const Pe = {
322
+ const Ge = {
317
323
  added: "ring-2 ring-emerald-500/70 dark:ring-emerald-400/60",
318
324
  moved: "ring-2 ring-amber-500/70 dark:ring-amber-400/60",
319
325
  changed: "ring-1 ring-violet-500/60 dark:ring-violet-400/50",
320
326
  removed: "ring-1 ring-rose-400/70 dark:ring-rose-400/50"
321
- }, ie = {
327
+ }, de = {
322
328
  added: {
323
329
  text: "Added",
324
330
  cls: "bg-emerald-50 text-emerald-800 ring-emerald-200 dark:bg-emerald-500/15 dark:text-emerald-200 dark:ring-emerald-500/30"
@@ -336,8 +342,8 @@ const Pe = {
336
342
  cls: "bg-rose-50 text-rose-800 ring-rose-200 line-through dark:bg-rose-500/15 dark:text-rose-200 dark:ring-rose-500/30"
337
343
  }
338
344
  };
339
- function ne({ diff: e }) {
340
- const a = ie[e.kind];
345
+ function ae({ diff: e }) {
346
+ const a = de[e.kind];
341
347
  return /* @__PURE__ */ m(
342
348
  "span",
343
349
  {
@@ -351,12 +357,12 @@ function ne({ diff: e }) {
351
357
  );
352
358
  }
353
359
  export {
354
- Ye as DesignDropBody,
355
- et as DesignDropZone,
356
- ze as DesignNode,
357
- Ee as MAX_NODE_TAGS,
358
- Oe as designWrap,
359
- Ke as markRank,
360
- Se as rankChips,
361
- Qe as useDesignWrap
360
+ nt as DesignDropBody,
361
+ at as DesignDropZone,
362
+ Ee as DesignNode,
363
+ Se as MAX_NODE_TAGS,
364
+ Ke as designWrap,
365
+ Le as markRank,
366
+ Be as rankChips,
367
+ tt as useDesignWrap
362
368
  };
@@ -1,11 +1,13 @@
1
- import { jsx as t } from "react/jsx-runtime";
2
- import { ItemEditForm as c } from "../ItemEditForm.js";
3
- import { RecordReadView as v } from "../RecordReadView.js";
4
- import { PdfCanvas as p } from "./canvases/PdfCanvas.js";
5
- import { TableColumnsCanvas as h } from "./canvases/TableColumnsCanvas.js";
6
- import { LayoutDesignContext as l } from "./design-context.js";
7
- import { useOverviewFields as f } from "./overview/overview-api.js";
8
- function x(e) {
1
+ import { jsx as r } from "react/jsx-runtime";
2
+ import { useMemo as p } from "react";
3
+ import { ItemEditForm as x } from "../ItemEditForm.js";
4
+ import { PlacementTextContext as h } from "../item-edit/placement-behaviour.js";
5
+ import { RecordReadView as C } from "../RecordReadView.js";
6
+ import { PdfCanvas as P } from "./canvases/PdfCanvas.js";
7
+ import { TableColumnsCanvas as w } from "./canvases/TableColumnsCanvas.js";
8
+ import { LayoutDesignContext as f } from "./design-context.js";
9
+ import { useOverviewFields as s } from "./overview/overview-api.js";
10
+ function T(e) {
9
11
  switch (e) {
10
12
  case "summary":
11
13
  case "detail":
@@ -18,36 +20,37 @@ function x(e) {
18
20
  return "item-edit-form";
19
21
  }
20
22
  }
21
- function w(e) {
22
- const { data: r = [] } = f(e.collection);
23
- return /* @__PURE__ */ t(h, { ...e, fields: r });
23
+ function F(e) {
24
+ const { data: t = [] } = s(e.collection);
25
+ return /* @__PURE__ */ r(w, { ...e, fields: t });
24
26
  }
25
- function y(e) {
26
- const { data: r = [] } = f(e.collection);
27
- return /* @__PURE__ */ t(p, { ...e, fields: r });
27
+ function b(e) {
28
+ const { data: t = [] } = s(e.collection);
29
+ return /* @__PURE__ */ r(P, { ...e, fields: t });
28
30
  }
29
- function E({
31
+ function N({
30
32
  collection: e,
31
- bundle: r,
32
- layout: n,
33
+ bundle: t,
34
+ layout: l,
33
35
  record: d,
34
- stateKey: m = null,
35
- design: a,
36
- apply: s,
36
+ stateKey: n = null,
37
+ roleId: m = null,
38
+ design: o,
39
+ apply: c,
37
40
  whenIdle: u
38
41
  }) {
39
- const o = x(String(r.layout.layout_type ?? "grouped"));
42
+ const a = T(String(t.layout.layout_type ?? "grouped")), v = p(() => ({ stateKey: n, roleId: m }), [n, m]);
40
43
  let i;
41
- return o === "item-edit-form" ? i = /* @__PURE__ */ t(
42
- c,
44
+ return a === "item-edit-form" ? i = /* @__PURE__ */ r(
45
+ x,
43
46
  {
44
47
  collection: e,
45
48
  documentTitle: !1,
46
- design: { layout: n, record: d, context: a, stateKey: m }
49
+ design: { layout: l, record: d, context: o, stateKey: n }
47
50
  }
48
- ) : o === "read-view" ? i = /* @__PURE__ */ t(v, { collection: e, design: { layout: n, record: d, context: a } }) : o === "pdf" ? i = /* @__PURE__ */ t(l.Provider, { value: a, children: /* @__PURE__ */ t(y, { bundle: r, collection: e, whenIdle: u }) }) : i = /* @__PURE__ */ t(l.Provider, { value: a, children: /* @__PURE__ */ t(w, { bundle: r, apply: s, collection: e }) }), /* @__PURE__ */ t("div", { "data-editor-canvas": "", "data-renderer": o, className: "flex min-h-full flex-col", children: i });
51
+ ) : a === "read-view" ? i = /* @__PURE__ */ r(C, { collection: e, design: { layout: l, record: d, context: o } }) : a === "pdf" ? i = /* @__PURE__ */ r(f.Provider, { value: o, children: /* @__PURE__ */ r(b, { bundle: t, collection: e, whenIdle: u }) }) : i = /* @__PURE__ */ r(f.Provider, { value: o, children: /* @__PURE__ */ r(F, { bundle: t, apply: c, collection: e }) }), /* @__PURE__ */ r("div", { "data-editor-canvas": "", "data-renderer": a, className: "flex min-h-full flex-col", children: /* @__PURE__ */ r(h.Provider, { value: v, children: i }) });
49
52
  }
50
53
  export {
51
- E as EditorCanvas,
52
- x as canvasRenderer
54
+ N as EditorCanvas,
55
+ T as canvasRenderer
53
56
  };