@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.
- 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 +13 -4
- 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 -572
- 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 +80 -63
- 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 +146 -131
- package/dist/shared/components/layout-editor/EditorCanvas.js +25 -17
- package/dist/shared/components/layout-editor/EditorTopBar.js +268 -206
- package/dist/shared/components/layout-editor/LayoutEditor.js +810 -731
- 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 +379 -185
- package/dist/shared/components/layout-editor/dnd/TrashZone.js +96 -0
- 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/rail-drop.js +4 -4
- package/dist/shared/components/layout-editor/dnd/sensors.js +23 -0
- package/dist/shared/components/layout-editor/dnd/trash-drop.js +58 -0
- 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/panel-frame.js +1 -1
- package/dist/shared/components/layout-editor/parity-keys.json.js +1 -1
- package/dist/shared/components/layout-editor/personal-default-marks.js +40 -0
- 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 +149 -118
- 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,100 +1,102 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { EyeOff as
|
|
3
|
-
import { isValidElement as
|
|
4
|
-
import { cn as f, formatRelative as
|
|
5
|
-
import { useLayoutDesign as
|
|
6
|
-
import { useDesignDndNode as
|
|
7
|
-
import { ResizeHandle as
|
|
8
|
-
import { NoteMarker as
|
|
9
|
-
import { FillChip as
|
|
10
|
-
const
|
|
1
|
+
import { jsx as o, Fragment as L, jsxs as g } from "react/jsx-runtime";
|
|
2
|
+
import { EyeOff as ye, Lock as Ne, Pin as _e, UserRound as we, Link2 as De } from "lucide-react";
|
|
3
|
+
import { isValidElement as oe, Fragment as Ce, cloneElement as $e } from "react";
|
|
4
|
+
import { cn as f, formatRelative as Te } from "../../lib/utils.js";
|
|
5
|
+
import { useLayoutDesign as ie, targetKey as Re, isSelectedIn as ze } from "./design-context.js";
|
|
6
|
+
import { useDesignDndNode as je, NO_DND as Fe, useDesignDropBody as Me } from "./dnd/node.js";
|
|
7
|
+
import { ResizeHandle as Ae } from "./grid-guides.js";
|
|
8
|
+
import { NoteMarker as Ie } from "./NoteMarker.js";
|
|
9
|
+
import { FillChip as Oe } from "./usage/FillChip.js";
|
|
10
|
+
const ne = (e, a) => {
|
|
11
11
|
typeof e == "function" ? e(a) : e && typeof e == "object" && (e.current = a);
|
|
12
12
|
};
|
|
13
|
-
function
|
|
13
|
+
function ae(...e) {
|
|
14
14
|
const a = {};
|
|
15
|
-
for (const
|
|
16
|
-
for (const [r, d] of Object.entries(
|
|
15
|
+
for (const i of e)
|
|
16
|
+
for (const [r, d] of Object.entries(i)) {
|
|
17
17
|
const c = a[r];
|
|
18
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) => {
|
|
19
|
-
|
|
19
|
+
ne(c, n), ne(d, n);
|
|
20
20
|
} : /^on[A-Z]/.test(r) && typeof c == "function" && typeof d == "function" ? a[r] = (...n) => {
|
|
21
21
|
c(...n), d(...n);
|
|
22
22
|
} : a[r] = d);
|
|
23
23
|
}
|
|
24
24
|
return a;
|
|
25
25
|
}
|
|
26
|
-
const
|
|
26
|
+
const Ee = {
|
|
27
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",
|
|
28
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",
|
|
29
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",
|
|
30
30
|
slate: "bg-slate-100 text-slate-700 ring-slate-200 dark:bg-slate-800 dark:text-slate-200 dark:ring-slate-700"
|
|
31
|
-
},
|
|
31
|
+
}, Ke = "inline-block max-w-[260px] truncate rounded px-1 text-left text-[11px] ring-1", Le = [
|
|
32
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",
|
|
33
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"
|
|
34
|
-
].join(" "),
|
|
34
|
+
].join(" "), de = {
|
|
35
35
|
before: { top: -5, left: 0, right: 0, height: 3 },
|
|
36
36
|
after: { bottom: -5, left: 0, right: 0, height: 3 }
|
|
37
37
|
};
|
|
38
|
-
function
|
|
38
|
+
function Se({
|
|
39
39
|
target: e,
|
|
40
40
|
children: a,
|
|
41
|
-
inline:
|
|
41
|
+
inline: i,
|
|
42
42
|
asChild: r,
|
|
43
43
|
pass: d,
|
|
44
44
|
...c
|
|
45
45
|
}) {
|
|
46
|
-
var G, H, U, V, Z, X, q,
|
|
47
|
-
const n =
|
|
48
|
-
if (!n) return /* @__PURE__ */
|
|
49
|
-
const
|
|
50
|
-
!
|
|
46
|
+
var G, H, U, V, Z, J, X, q, Q, Y, ee;
|
|
47
|
+
const n = ie(), m = (n == null ? void 0 : n.inheritedFrom(e)) ?? null, le = c["data-design-copy"] !== void 0, ce = c["data-header-folded"] !== void 0, l = ((G = n == null ? void 0 : n.diffMark) == null ? void 0 : G.call(n, e)) ?? null, w = (l == null ? void 0 : l.kind) === "removed", x = !n || !!m || le || w || !!((H = n.locked) != null && H.call(n, e)), b = je((n == null ? void 0 : n.dnd) ?? Fe, e, { disabled: x, noDrop: ce });
|
|
48
|
+
if (!n) return /* @__PURE__ */ o(L, { children: a });
|
|
49
|
+
const ue = Re(e), D = ze(n, e), s = ((U = n.roleMark) == null ? void 0 : U.call(n, e)) ?? null, R = ((V = n.marks) == null ? void 0 : V.call(n, e)) ?? [], k = ((Z = n.overlay) == null ? void 0 : Z.call(n, e)) ?? null, S = ((J = n.unsaved) == null ? void 0 : J.call(n, e)) ?? !1, v = ((X = n.peers) == null ? void 0 : X.call(n, e)) ?? [], pe = R.some((t) => t.highlight), B = ((q = n.note) == null ? void 0 : q.call(n, e)) ?? null, z = B ? /* @__PURE__ */ o(Ie, { note: B }) : null, j = x ? {} : b.props, ge = b.dragging, C = x ? null : b.slot, p = r && oe(a) ? a : null, me = (p == null ? void 0 : p.props.className) ?? "", he = /(^|\s)(absolute|fixed|sticky|relative)(\s|$)/.test(me), fe = f(
|
|
50
|
+
!he && "relative",
|
|
51
51
|
"cursor-pointer rounded-md outline-offset-2",
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
52
|
+
// #3193: on touch a press-and-hold picks the node up — no callout, no text selection.
|
|
53
|
+
"touch-manipulation [-webkit-touch-callout:none] [@media(pointer:coarse)]:select-none",
|
|
54
|
+
!p && (i ? "inline-block" : "block"),
|
|
55
|
+
D ? "outline outline-2 outline-nvr-cyan" : v.length > 0 ? `outline outline-2 ${v[0].outline}` : pe ? "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",
|
|
56
|
+
k == null ? void 0 : k.className,
|
|
55
57
|
"focus-visible:outline focus-visible:outline-2 focus-visible:outline-nvr-cyan",
|
|
56
|
-
|
|
58
|
+
Le,
|
|
57
59
|
// The section's "Changed by" shows while the pointer is over it.
|
|
58
60
|
"[&:hover>[data-design-last-change]]:visible",
|
|
59
|
-
|
|
61
|
+
ge && "opacity-40",
|
|
60
62
|
// Hidden for the previewed role: faint, its tags not.
|
|
61
63
|
(s == null ? void 0 : s.kind) === "hidden" && "[&>:not([data-design-badges])]:opacity-40",
|
|
62
|
-
l &&
|
|
63
|
-
|
|
64
|
-
),
|
|
64
|
+
l && Ve[l.kind],
|
|
65
|
+
w && "cursor-default [&>:not([data-design-badges])]:opacity-40"
|
|
66
|
+
), be = (t) => {
|
|
65
67
|
const u = t.target;
|
|
66
68
|
if (u.closest("[data-design-target]") !== t.currentTarget) return;
|
|
67
|
-
if (
|
|
69
|
+
if (w) {
|
|
68
70
|
t.preventDefault(), t.stopPropagation();
|
|
69
71
|
return;
|
|
70
72
|
}
|
|
71
73
|
t.shiftKey || t.metaKey || t.ctrlKey ? n.onSelect(e, { additive: !0 }) : n.onSelect(e);
|
|
72
|
-
const
|
|
73
|
-
|
|
74
|
-
},
|
|
75
|
-
t.key !== "Enter" || t.target !== t.currentTarget ||
|
|
76
|
-
},
|
|
77
|
-
"data-design-target":
|
|
78
|
-
"data-selected":
|
|
74
|
+
const _ = u.closest("[data-design-pass]");
|
|
75
|
+
_ && t.currentTarget.contains(_) || (t.preventDefault(), t.stopPropagation());
|
|
76
|
+
}, ke = (t) => {
|
|
77
|
+
t.key !== "Enter" || t.target !== t.currentTarget || w || t.currentTarget.tagName !== "BUTTON" && (t.preventDefault(), t.shiftKey ? n.onSelect(e, { additive: !0 }) : n.onSelect(e));
|
|
78
|
+
}, y = c["data-design-tab"] !== void 0 || ((Q = p == null ? void 0 : p.props) == null ? void 0 : Q["data-design-tab"]) !== void 0, F = {
|
|
79
|
+
"data-design-target": ue,
|
|
80
|
+
"data-selected": D ? "true" : void 0,
|
|
79
81
|
"data-design-pass": d ? "" : void 0,
|
|
80
82
|
"data-drop-slot": C ?? void 0,
|
|
81
83
|
"data-role-mark": s == null ? void 0 : s.kind,
|
|
82
|
-
"data-unsaved":
|
|
84
|
+
"data-unsaved": S ? "" : void 0,
|
|
83
85
|
"data-diff": l == null ? void 0 : l.kind,
|
|
84
86
|
// Locked nodes get no dnd attributes; they still take focus to be selected.
|
|
85
87
|
// So do nodes drag and drop leaves out (a pinned section, #2628).
|
|
86
|
-
...
|
|
87
|
-
...
|
|
88
|
-
className:
|
|
89
|
-
onClickCapture:
|
|
90
|
-
onKeyDown:
|
|
91
|
-
},
|
|
88
|
+
...x || !("tabIndex" in j) ? { role: "button", tabIndex: 0 } : {},
|
|
89
|
+
...y && m ? { "data-tip": `From ${m}` } : {},
|
|
90
|
+
className: fe,
|
|
91
|
+
onClickCapture: be,
|
|
92
|
+
onKeyDown: ke
|
|
93
|
+
}, ve = (s == null ? void 0 : s.kind) === "hidden" ? ye : Ne, M = e.kind === "field" || e.kind === "header" ? ((Y = n.fillRate) == null ? void 0 : Y.call(n, e.field)) ?? null : null, N = e.kind === "group" && !y ? ((ee = n.lastChange) == null ? void 0 : ee.call(n, e)) ?? null : null, P = N && [N.by ? `by ${N.by}` : null, N.at ? Te(N.at) : null].filter(Boolean).join(" · ") || null, A = P && !l ? /* @__PURE__ */ g(
|
|
92
94
|
"span",
|
|
93
95
|
{
|
|
94
96
|
"data-design-last-change": "",
|
|
95
97
|
className: f(
|
|
96
98
|
"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",
|
|
97
|
-
!
|
|
99
|
+
!D && "invisible"
|
|
98
100
|
),
|
|
99
101
|
children: [
|
|
100
102
|
"Changed ",
|
|
@@ -102,41 +104,43 @@ function Ee({
|
|
|
102
104
|
]
|
|
103
105
|
}
|
|
104
106
|
) : null, h = [];
|
|
105
|
-
l && h.push({ rank: 0, text:
|
|
107
|
+
l && h.push({ rank: 0, text: Ue(l), node: /* @__PURE__ */ o(re, { diff: l }) }), s && h.push({
|
|
106
108
|
rank: 1,
|
|
107
109
|
text: `${s.kind === "hidden" ? "Hidden" : "Read-only"} for ${s.role}`,
|
|
108
|
-
node: /* @__PURE__ */
|
|
110
|
+
node: /* @__PURE__ */ g(
|
|
109
111
|
"span",
|
|
110
112
|
{
|
|
111
113
|
"data-design-role-tag": s.kind,
|
|
112
114
|
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",
|
|
113
115
|
children: [
|
|
114
|
-
/* @__PURE__ */
|
|
116
|
+
/* @__PURE__ */ o(ve, { "aria-hidden": !0, className: "h-3 w-3" }),
|
|
115
117
|
s.kind === "hidden" ? "Hidden" : "Read-only",
|
|
116
118
|
" for ",
|
|
117
119
|
s.role
|
|
118
120
|
]
|
|
119
121
|
}
|
|
120
122
|
)
|
|
121
|
-
}),
|
|
123
|
+
}), k && h.push({
|
|
122
124
|
rank: 1,
|
|
123
125
|
text: "Who sees it",
|
|
124
|
-
node: /* @__PURE__ */
|
|
126
|
+
node: /* @__PURE__ */ o("span", { "data-design-pass": "", className: "pointer-events-auto", children: k.chip })
|
|
125
127
|
}), R.forEach((t, u) => {
|
|
126
|
-
const
|
|
127
|
-
|
|
128
|
+
const _ = f(
|
|
129
|
+
Ke,
|
|
128
130
|
t.icon && "inline-flex items-center gap-0.5",
|
|
129
131
|
t.onClick || t.tip ? "pointer-events-auto" : null,
|
|
130
132
|
t.onClick && "hover:brightness-95",
|
|
131
|
-
|
|
132
|
-
),
|
|
133
|
-
t.icon === "pin" && /* @__PURE__ */
|
|
133
|
+
Ee[t.tone]
|
|
134
|
+
), te = /* @__PURE__ */ g(L, { children: [
|
|
135
|
+
t.icon === "pin" && /* @__PURE__ */ o(_e, { "aria-hidden": !0, className: "h-3 w-3" }),
|
|
136
|
+
t.icon === "person" && /* @__PURE__ */ o(we, { "aria-hidden": !0, className: "h-3 w-3" }),
|
|
137
|
+
t.icon === "link" && /* @__PURE__ */ o(De, { "aria-hidden": !0, className: "h-3 w-3" }),
|
|
134
138
|
t.text
|
|
135
139
|
] });
|
|
136
140
|
h.push({
|
|
137
|
-
rank:
|
|
141
|
+
rank: We(t),
|
|
138
142
|
text: t.text,
|
|
139
|
-
node: t.onClick ? /* @__PURE__ */
|
|
143
|
+
node: t.onClick ? /* @__PURE__ */ o(
|
|
140
144
|
"button",
|
|
141
145
|
{
|
|
142
146
|
type: "button",
|
|
@@ -144,53 +148,53 @@ function Ee({
|
|
|
144
148
|
"data-design-pass": "",
|
|
145
149
|
"data-tip": t.tip,
|
|
146
150
|
onClick: t.onClick,
|
|
147
|
-
className:
|
|
148
|
-
children:
|
|
151
|
+
className: _,
|
|
152
|
+
children: te
|
|
149
153
|
},
|
|
150
154
|
`${u}:${t.text}`
|
|
151
|
-
) : /* @__PURE__ */
|
|
155
|
+
) : /* @__PURE__ */ o(
|
|
152
156
|
"span",
|
|
153
157
|
{
|
|
154
158
|
"data-design-mark": "",
|
|
155
159
|
"data-tip": t.tip,
|
|
156
|
-
className:
|
|
157
|
-
children:
|
|
160
|
+
className: _,
|
|
161
|
+
children: te
|
|
158
162
|
},
|
|
159
163
|
`${u}:${t.text}`
|
|
160
164
|
)
|
|
161
165
|
});
|
|
162
|
-
}),
|
|
166
|
+
}), m && h.push({
|
|
163
167
|
rank: 5,
|
|
164
|
-
text: `from ${
|
|
165
|
-
node: /* @__PURE__ */
|
|
168
|
+
text: `from ${m}`,
|
|
169
|
+
node: /* @__PURE__ */ g("span", { className: "rounded bg-slate-100 px-1 text-[11px] text-slate-600 dark:bg-slate-800 dark:text-slate-300", children: [
|
|
166
170
|
"from ",
|
|
167
|
-
|
|
171
|
+
m
|
|
168
172
|
] })
|
|
169
173
|
});
|
|
170
|
-
const { shown:
|
|
171
|
-
T.length > 0 && (F["data-tip"] =
|
|
172
|
-
const I =
|
|
174
|
+
const { shown: xe, rest: $ } = Ge(h), W = R.length > 0 || k != null || v.length > 0, T = y && !l ? [...h.map((t) => t.text), ...v.map((t) => t.name)] : [];
|
|
175
|
+
T.length > 0 && (F["data-tip"] = m && !s && !W ? `From ${m}` : T.join(" · "));
|
|
176
|
+
const I = y && l ? /* @__PURE__ */ o("span", { "data-design-badges": "", className: "pointer-events-none absolute -top-2 right-0 z-10", children: /* @__PURE__ */ o(re, { diff: l }) }) : T.length > 0 ? /* @__PURE__ */ o(
|
|
173
177
|
"span",
|
|
174
178
|
{
|
|
175
179
|
"data-design-badges": "",
|
|
176
180
|
className: f(
|
|
177
181
|
"pointer-events-none absolute left-1/2 top-1 z-10 h-1.5 w-1.5 -translate-x-1/2 rounded-full",
|
|
178
|
-
|
|
182
|
+
m && !s && !W ? "bg-slate-500 dark:bg-slate-400" : "bg-violet-500 dark:bg-violet-400"
|
|
179
183
|
),
|
|
180
|
-
children: /* @__PURE__ */
|
|
184
|
+
children: /* @__PURE__ */ o("span", { className: "sr-only", children: T.join(" · ") })
|
|
181
185
|
}
|
|
182
|
-
) : h.length > 0 ||
|
|
186
|
+
) : h.length > 0 || v.length > 0 || M != null ? /* @__PURE__ */ g(
|
|
183
187
|
"span",
|
|
184
188
|
{
|
|
185
189
|
"data-design-badges": "",
|
|
186
190
|
className: "pointer-events-none absolute -top-2 right-1 z-10 flex items-center gap-1",
|
|
187
191
|
children: [
|
|
188
|
-
M != null && /* @__PURE__ */
|
|
189
|
-
|
|
192
|
+
M != null && /* @__PURE__ */ o(Oe, { pct: M }),
|
|
193
|
+
xe.map((t, u) => (
|
|
190
194
|
// biome-ignore lint/suspicious/noArrayIndexKey: ranked tags of one node, rebuilt each render
|
|
191
|
-
/* @__PURE__ */
|
|
195
|
+
/* @__PURE__ */ o(Ce, { children: t.node }, u)
|
|
192
196
|
)),
|
|
193
|
-
$.length > 0 && /* @__PURE__ */
|
|
197
|
+
$.length > 0 && /* @__PURE__ */ g(
|
|
194
198
|
"span",
|
|
195
199
|
{
|
|
196
200
|
"data-design-more-tags": $.length,
|
|
@@ -202,7 +206,7 @@ function Ee({
|
|
|
202
206
|
]
|
|
203
207
|
}
|
|
204
208
|
),
|
|
205
|
-
|
|
209
|
+
v.map((t) => /* @__PURE__ */ o(
|
|
206
210
|
"span",
|
|
207
211
|
{
|
|
208
212
|
"data-design-peer": t.id,
|
|
@@ -211,42 +215,53 @@ function Ee({
|
|
|
211
215
|
"pointer-events-auto inline-flex h-4 w-4 items-center justify-center rounded-full text-[9px] font-semibold ring-1",
|
|
212
216
|
t.chip
|
|
213
217
|
),
|
|
214
|
-
children:
|
|
218
|
+
children: He(t.name)
|
|
215
219
|
},
|
|
216
220
|
t.id
|
|
217
221
|
))
|
|
218
222
|
]
|
|
219
223
|
}
|
|
220
|
-
) : null, O =
|
|
224
|
+
) : null, O = S ? /* @__PURE__ */ o(
|
|
221
225
|
"span",
|
|
222
226
|
{
|
|
223
227
|
"data-unsaved-dot": "",
|
|
224
228
|
className: f(
|
|
225
229
|
"pointer-events-none absolute z-10 h-2 w-2 rounded-full bg-nvr-cyan ring-2 ring-white dark:ring-slate-900",
|
|
226
230
|
// A step clips its corners away: the dot sits inside, before the arrow.
|
|
227
|
-
|
|
231
|
+
y ? "right-4 top-1" : "-left-1 -top-1"
|
|
228
232
|
),
|
|
229
|
-
children: /* @__PURE__ */
|
|
233
|
+
children: /* @__PURE__ */ o("span", { className: "sr-only", children: "unsaved change" })
|
|
230
234
|
}
|
|
231
|
-
) : null, E = C ? /* @__PURE__ */
|
|
235
|
+
) : null, E = C ? /* @__PURE__ */ o(
|
|
232
236
|
"span",
|
|
233
237
|
{
|
|
234
238
|
"aria-hidden": !0,
|
|
235
239
|
"data-design-drop-indicator": C,
|
|
236
240
|
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]",
|
|
237
|
-
style:
|
|
241
|
+
style: b.indicator ?? de[C],
|
|
242
|
+
children: b.merge && /* @__PURE__ */ g(
|
|
243
|
+
"span",
|
|
244
|
+
{
|
|
245
|
+
"data-design-merge-label": "",
|
|
246
|
+
className: "absolute right-2 top-1/2 -translate-y-1/2 whitespace-nowrap rounded bg-nvr-cyan px-1.5 text-[11px] font-medium leading-5 text-white",
|
|
247
|
+
children: [
|
|
248
|
+
"Join into ",
|
|
249
|
+
b.merge
|
|
250
|
+
]
|
|
251
|
+
}
|
|
252
|
+
)
|
|
238
253
|
}
|
|
239
|
-
) : null, K =
|
|
254
|
+
) : null, K = D && !x && n.resizeWidth && (e.kind === "field" || e.kind === "slot") && e.group_key !== null ? /* @__PURE__ */ o(Ae, { onCommit: (t) => {
|
|
240
255
|
var u;
|
|
241
256
|
return (u = n.resizeWidth) == null ? void 0 : u.call(n, e, t);
|
|
242
257
|
} }) : null;
|
|
243
258
|
if (p) {
|
|
244
259
|
const { children: t, ...u } = p.props;
|
|
245
|
-
return
|
|
260
|
+
return $e(
|
|
246
261
|
p,
|
|
247
262
|
// The child's own classes, style, ref and handlers are kept and merged.
|
|
248
|
-
|
|
249
|
-
I || A || E || O || z || K ? /* @__PURE__ */
|
|
263
|
+
ae(u, c, j, F),
|
|
264
|
+
I || A || E || O || z || K ? /* @__PURE__ */ g(L, { children: [
|
|
250
265
|
O,
|
|
251
266
|
I,
|
|
252
267
|
A,
|
|
@@ -257,7 +272,7 @@ function Ee({
|
|
|
257
272
|
] }) : t
|
|
258
273
|
);
|
|
259
274
|
}
|
|
260
|
-
return /* @__PURE__ */
|
|
275
|
+
return /* @__PURE__ */ g(i ? "span" : "div", { ...ae(c, j, F), children: [
|
|
261
276
|
O,
|
|
262
277
|
I,
|
|
263
278
|
A,
|
|
@@ -267,32 +282,32 @@ function Ee({
|
|
|
267
282
|
a
|
|
268
283
|
] });
|
|
269
284
|
}
|
|
270
|
-
function
|
|
271
|
-
if (!e ||
|
|
272
|
-
const d =
|
|
273
|
-
return /* @__PURE__ */
|
|
285
|
+
function Be(e, a, i, r = {}) {
|
|
286
|
+
if (!e || i == null || i === !1) return i;
|
|
287
|
+
const d = oe(i) ? i.key ?? void 0 : void 0;
|
|
288
|
+
return /* @__PURE__ */ o(Se, { target: a, ...r, children: i }, d);
|
|
274
289
|
}
|
|
275
|
-
function
|
|
276
|
-
const e =
|
|
277
|
-
return (a,
|
|
290
|
+
function rt() {
|
|
291
|
+
const e = ie();
|
|
292
|
+
return (a, i, r) => Be(e, a, i, r);
|
|
278
293
|
}
|
|
279
|
-
function
|
|
280
|
-
const { ref: a, slot:
|
|
281
|
-
return /* @__PURE__ */
|
|
294
|
+
function ot({ groupKey: e }) {
|
|
295
|
+
const { ref: a, slot: i, indicator: r } = Me(e);
|
|
296
|
+
return /* @__PURE__ */ o(
|
|
282
297
|
"span",
|
|
283
298
|
{
|
|
284
299
|
ref: a,
|
|
285
300
|
"aria-hidden": !0,
|
|
286
|
-
hidden: !
|
|
301
|
+
hidden: !i,
|
|
287
302
|
"data-design-drop-body": e,
|
|
288
|
-
"data-design-drop-indicator":
|
|
303
|
+
"data-design-drop-indicator": i ?? void 0,
|
|
289
304
|
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]",
|
|
290
|
-
style:
|
|
305
|
+
style: i ? r ?? de[i] : void 0
|
|
291
306
|
}
|
|
292
307
|
);
|
|
293
308
|
}
|
|
294
|
-
function
|
|
295
|
-
return /* @__PURE__ */
|
|
309
|
+
function it() {
|
|
310
|
+
return /* @__PURE__ */ o(
|
|
296
311
|
"div",
|
|
297
312
|
{
|
|
298
313
|
"data-design-drop-zone": "",
|
|
@@ -301,30 +316,30 @@ function at() {
|
|
|
301
316
|
}
|
|
302
317
|
);
|
|
303
318
|
}
|
|
304
|
-
const
|
|
305
|
-
function
|
|
306
|
-
return e.kind === "preview" ? 1 : e.kind === "ai" ? 4 : e.kind === "loop" || e.highlight ? 2 : 3;
|
|
319
|
+
const Pe = 2;
|
|
320
|
+
function We(e) {
|
|
321
|
+
return e.kind === "preview" ? 1 : e.kind === "ai" ? 4 : e.kind === "loop" || e.kind === "personal" || e.highlight ? 2 : 3;
|
|
307
322
|
}
|
|
308
|
-
function
|
|
309
|
-
const
|
|
310
|
-
return { shown:
|
|
323
|
+
function Ge(e, a = Pe) {
|
|
324
|
+
const i = 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);
|
|
325
|
+
return { shown: i.slice(0, a), rest: i.slice(a) };
|
|
311
326
|
}
|
|
312
|
-
function
|
|
313
|
-
return e.trim().split(/\s+/).filter(Boolean).slice(0, 2).map((
|
|
327
|
+
function He(e) {
|
|
328
|
+
return e.trim().split(/\s+/).filter(Boolean).slice(0, 2).map((i) => {
|
|
314
329
|
var r;
|
|
315
|
-
return ((r =
|
|
330
|
+
return ((r = i[0]) == null ? void 0 : r.toUpperCase()) ?? "";
|
|
316
331
|
}).join("") || "?";
|
|
317
332
|
}
|
|
318
|
-
function
|
|
319
|
-
const a =
|
|
333
|
+
function Ue(e) {
|
|
334
|
+
const a = se[e.kind].text;
|
|
320
335
|
return e.kind === "moved" && e.detail ? `Moved ${e.detail}` : e.kind === "changed" && e.detail ? `${a}: ${e.detail}` : a;
|
|
321
336
|
}
|
|
322
|
-
const
|
|
337
|
+
const Ve = {
|
|
323
338
|
added: "ring-2 ring-emerald-500/70 dark:ring-emerald-400/60",
|
|
324
339
|
moved: "ring-2 ring-amber-500/70 dark:ring-amber-400/60",
|
|
325
340
|
changed: "ring-1 ring-violet-500/60 dark:ring-violet-400/50",
|
|
326
341
|
removed: "ring-1 ring-rose-400/70 dark:ring-rose-400/50"
|
|
327
|
-
},
|
|
342
|
+
}, se = {
|
|
328
343
|
added: {
|
|
329
344
|
text: "Added",
|
|
330
345
|
cls: "bg-emerald-50 text-emerald-800 ring-emerald-200 dark:bg-emerald-500/15 dark:text-emerald-200 dark:ring-emerald-500/30"
|
|
@@ -342,27 +357,27 @@ const Ge = {
|
|
|
342
357
|
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"
|
|
343
358
|
}
|
|
344
359
|
};
|
|
345
|
-
function
|
|
346
|
-
const a =
|
|
347
|
-
return /* @__PURE__ */
|
|
360
|
+
function re({ diff: e }) {
|
|
361
|
+
const a = se[e.kind];
|
|
362
|
+
return /* @__PURE__ */ g(
|
|
348
363
|
"span",
|
|
349
364
|
{
|
|
350
365
|
"data-design-diff-tag": e.kind,
|
|
351
366
|
className: f("inline-flex items-center rounded px-1 text-[11px] ring-1", a.cls),
|
|
352
367
|
children: [
|
|
353
368
|
e.kind === "moved" && e.detail ? `Moved ${e.detail}` : a.text,
|
|
354
|
-
e.kind === "changed" && e.detail && /* @__PURE__ */
|
|
369
|
+
e.kind === "changed" && e.detail && /* @__PURE__ */ o("span", { className: "ml-1 max-w-[160px] truncate opacity-80", children: e.detail })
|
|
355
370
|
]
|
|
356
371
|
}
|
|
357
372
|
);
|
|
358
373
|
}
|
|
359
374
|
export {
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
375
|
+
ot as DesignDropBody,
|
|
376
|
+
it as DesignDropZone,
|
|
377
|
+
Se as DesignNode,
|
|
378
|
+
Pe as MAX_NODE_TAGS,
|
|
379
|
+
Be as designWrap,
|
|
380
|
+
We as markRank,
|
|
381
|
+
Ge as rankChips,
|
|
382
|
+
rt as useDesignWrap
|
|
368
383
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useMemo as
|
|
3
|
-
import { ItemEditForm as
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as x } from "react";
|
|
3
|
+
import { ItemEditForm as p } from "../ItemEditForm.js";
|
|
4
4
|
import { PlacementTextContext as h } from "../item-edit/placement-behaviour.js";
|
|
5
5
|
import { RecordReadView as C } from "../RecordReadView.js";
|
|
6
6
|
import { PdfCanvas as P } from "./canvases/PdfCanvas.js";
|
|
@@ -21,34 +21,42 @@ function T(e) {
|
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
23
|
function F(e) {
|
|
24
|
-
const { data:
|
|
25
|
-
return /* @__PURE__ */
|
|
24
|
+
const { data: r = [] } = s(e.collection);
|
|
25
|
+
return /* @__PURE__ */ t(w, { ...e, fields: r });
|
|
26
26
|
}
|
|
27
27
|
function b(e) {
|
|
28
|
-
const { data:
|
|
29
|
-
return /* @__PURE__ */
|
|
28
|
+
const { data: r = [] } = s(e.collection);
|
|
29
|
+
return /* @__PURE__ */ t(P, { ...e, fields: r });
|
|
30
30
|
}
|
|
31
31
|
function N({
|
|
32
32
|
collection: e,
|
|
33
|
-
bundle:
|
|
33
|
+
bundle: r,
|
|
34
34
|
layout: l,
|
|
35
|
-
record:
|
|
35
|
+
record: m,
|
|
36
36
|
stateKey: n = null,
|
|
37
|
-
roleId:
|
|
38
|
-
design:
|
|
37
|
+
roleId: d = null,
|
|
38
|
+
design: a,
|
|
39
39
|
apply: c,
|
|
40
40
|
whenIdle: u
|
|
41
41
|
}) {
|
|
42
|
-
const
|
|
43
|
-
let
|
|
44
|
-
return
|
|
45
|
-
|
|
42
|
+
const i = T(String(r.layout.layout_type ?? "grouped")), v = x(() => ({ stateKey: n, roleId: d }), [n, d]);
|
|
43
|
+
let o;
|
|
44
|
+
return i === "item-edit-form" ? o = /* @__PURE__ */ t(
|
|
45
|
+
p,
|
|
46
46
|
{
|
|
47
47
|
collection: e,
|
|
48
48
|
documentTitle: !1,
|
|
49
|
-
design: { layout: l, record:
|
|
49
|
+
design: { layout: l, record: m, context: a, stateKey: n }
|
|
50
50
|
}
|
|
51
|
-
) :
|
|
51
|
+
) : i === "read-view" ? o = /* @__PURE__ */ t(C, { collection: e, design: { layout: l, record: m, context: a } }) : i === "pdf" ? o = /* @__PURE__ */ t(f.Provider, { value: a, children: /* @__PURE__ */ t(b, { bundle: r, collection: e, whenIdle: u }) }) : o = /* @__PURE__ */ t(f.Provider, { value: a, children: /* @__PURE__ */ t(F, { bundle: r, apply: c, collection: e }) }), /* @__PURE__ */ t(
|
|
52
|
+
"div",
|
|
53
|
+
{
|
|
54
|
+
"data-editor-canvas": "",
|
|
55
|
+
"data-renderer": i,
|
|
56
|
+
className: i === "item-edit-form" ? "flex min-h-0 flex-1 flex-col" : "flex flex-1 flex-col",
|
|
57
|
+
children: /* @__PURE__ */ t(h.Provider, { value: v, children: o })
|
|
58
|
+
}
|
|
59
|
+
);
|
|
52
60
|
}
|
|
53
61
|
export {
|
|
54
62
|
N as EditorCanvas,
|