@nivaro/react 0.3.143 → 0.3.145

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