@nivaro/react 0.3.142 → 0.3.144
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/full.css +1 -1
- package/dist/hooks/useSessionRecorder.js +1 -1
- package/dist/index.d.ts +5 -1
- package/dist/shared/components/CollectionBrowserView.js +1304 -1295
- package/dist/shared/components/layout-editor/DesignNode.js +181 -169
- package/dist/shared/components/layout-editor/LayoutEditor.js +334 -326
- package/dist/shared/components/layout-editor/explain/CanvasRules.js +72 -61
- package/package.json +1 -1
|
@@ -1,25 +1,25 @@
|
|
|
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 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
|
|
13
|
+
function oe(...e) {
|
|
14
14
|
const a = {};
|
|
15
|
-
for (const
|
|
16
|
-
for (const [
|
|
17
|
-
const c = a[
|
|
18
|
-
d !== void 0 && (c === void 0 ? a[
|
|
19
|
-
|
|
20
|
-
} : /^on[A-Z]/.test(
|
|
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[
|
|
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
|
-
},
|
|
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(" "),
|
|
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
|
|
38
|
+
function Ge({
|
|
39
39
|
target: e,
|
|
40
40
|
children: a,
|
|
41
|
-
inline:
|
|
42
|
-
asChild:
|
|
41
|
+
inline: o,
|
|
42
|
+
asChild: i,
|
|
43
43
|
pass: d,
|
|
44
44
|
...c
|
|
45
45
|
}) {
|
|
46
|
-
var
|
|
47
|
-
const n =
|
|
48
|
-
if (!n) return /* @__PURE__ */
|
|
49
|
-
const
|
|
50
|
-
!
|
|
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
|
-
!
|
|
57
|
-
|
|
58
|
-
|
|
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
|
-
|
|
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
|
-
|
|
66
|
+
fe && "opacity-40",
|
|
64
67
|
// Hidden for the previewed role: faint, its tags not.
|
|
65
|
-
(
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
),
|
|
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 (
|
|
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
|
|
77
|
-
|
|
78
|
-
},
|
|
79
|
-
t.key !== "Enter" || t.target !== t.currentTarget ||
|
|
80
|
-
},
|
|
81
|
-
"data-design-target":
|
|
82
|
-
"data-selected":
|
|
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":
|
|
85
|
-
"data-role-mark":
|
|
86
|
-
"data-unsaved":
|
|
87
|
-
"data-diff":
|
|
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
|
|
91
|
-
...
|
|
92
|
-
className:
|
|
93
|
-
onClickCapture:
|
|
94
|
-
onKeyDown:
|
|
95
|
-
},
|
|
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
|
-
|
|
104
|
+
!$ && "invisible"
|
|
102
105
|
),
|
|
103
106
|
children: [
|
|
104
107
|
"Changed ",
|
|
105
|
-
|
|
108
|
+
W
|
|
106
109
|
]
|
|
107
110
|
}
|
|
108
|
-
) : null,
|
|
109
|
-
|
|
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: `${
|
|
112
|
-
node: /* @__PURE__ */
|
|
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":
|
|
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__ */
|
|
119
|
-
|
|
121
|
+
/* @__PURE__ */ r(Ne, { "aria-hidden": !0, className: "h-3 w-3" }),
|
|
122
|
+
l.kind === "hidden" ? "Hidden" : "Read-only",
|
|
120
123
|
" for ",
|
|
121
|
-
|
|
124
|
+
l.role
|
|
122
125
|
]
|
|
123
126
|
}
|
|
124
127
|
)
|
|
125
|
-
}),
|
|
128
|
+
}), v && m.push({
|
|
126
129
|
rank: 1,
|
|
127
130
|
text: "Who sees it",
|
|
128
|
-
node: /* @__PURE__ */
|
|
129
|
-
}),
|
|
130
|
-
const
|
|
131
|
-
|
|
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
|
-
),
|
|
137
|
-
t.icon === "pin" && /* @__PURE__ */
|
|
138
|
-
t.icon === "person" && /* @__PURE__ */
|
|
139
|
-
t.icon === "link" && /* @__PURE__ */
|
|
140
|
-
t.
|
|
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
|
-
|
|
143
|
-
rank:
|
|
149
|
+
m.push({
|
|
150
|
+
rank: Ve(t),
|
|
144
151
|
text: t.text,
|
|
145
|
-
node: t.onClick ? /* @__PURE__ */
|
|
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:
|
|
160
|
+
className: D,
|
|
161
|
+
children: ne
|
|
155
162
|
},
|
|
156
163
|
`${u}:${t.text}`
|
|
157
|
-
) : /* @__PURE__ */
|
|
164
|
+
) : /* @__PURE__ */ r(
|
|
158
165
|
"span",
|
|
159
166
|
{
|
|
160
167
|
"data-design-mark": "",
|
|
161
168
|
"data-tip": t.tip,
|
|
162
|
-
className:
|
|
163
|
-
children:
|
|
169
|
+
className: D,
|
|
170
|
+
children: ne
|
|
164
171
|
},
|
|
165
172
|
`${u}:${t.text}`
|
|
166
173
|
)
|
|
167
174
|
});
|
|
168
|
-
}),
|
|
175
|
+
}), p && m.push({
|
|
169
176
|
rank: 5,
|
|
170
|
-
text: `from ${
|
|
171
|
-
node: /* @__PURE__ */
|
|
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
|
-
|
|
180
|
+
p
|
|
174
181
|
] })
|
|
175
182
|
});
|
|
176
|
-
const { shown:
|
|
177
|
-
|
|
178
|
-
const
|
|
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
|
-
|
|
191
|
+
p && !l && !G ? "bg-slate-500 dark:bg-slate-400" : "bg-violet-500 dark:bg-violet-400"
|
|
185
192
|
),
|
|
186
|
-
children: /* @__PURE__ */
|
|
193
|
+
children: /* @__PURE__ */ r("span", { className: "sr-only", children: O.join(" · ") })
|
|
187
194
|
}
|
|
188
|
-
) :
|
|
195
|
+
) : m.length > 0 || b.length > 0 || R != null ? /* @__PURE__ */ h(
|
|
189
196
|
"span",
|
|
190
197
|
{
|
|
191
198
|
"data-design-badges": "",
|
|
192
|
-
className:
|
|
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
|
-
|
|
195
|
-
|
|
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__ */
|
|
209
|
+
/* @__PURE__ */ r(Re, { children: t.node }, u)
|
|
198
210
|
)),
|
|
199
|
-
|
|
211
|
+
_.length > 0 && /* @__PURE__ */ h(
|
|
200
212
|
"span",
|
|
201
213
|
{
|
|
202
|
-
"data-design-more-tags":
|
|
203
|
-
"data-tip":
|
|
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
|
-
|
|
219
|
+
_.length
|
|
208
220
|
]
|
|
209
221
|
}
|
|
210
222
|
),
|
|
211
|
-
|
|
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:
|
|
232
|
+
children: qe(t.name)
|
|
221
233
|
},
|
|
222
234
|
t.id
|
|
223
235
|
))
|
|
224
236
|
]
|
|
225
237
|
}
|
|
226
|
-
) : null,
|
|
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
|
-
|
|
245
|
+
N ? "right-4 top-1" : "-left-1 -top-1"
|
|
234
246
|
),
|
|
235
|
-
children: /* @__PURE__ */
|
|
247
|
+
children: /* @__PURE__ */ r("span", { className: "sr-only", children: "unsaved change" })
|
|
236
248
|
}
|
|
237
|
-
) : null,
|
|
249
|
+
) : null, S = T ? /* @__PURE__ */ r(
|
|
238
250
|
"span",
|
|
239
251
|
{
|
|
240
252
|
"aria-hidden": !0,
|
|
241
|
-
"data-design-drop-indicator":
|
|
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 ??
|
|
244
|
-
children: k.merge && /* @__PURE__ */
|
|
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 =
|
|
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 (
|
|
261
|
-
const { children: t, ...u } =
|
|
262
|
-
return
|
|
263
|
-
|
|
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
|
-
|
|
266
|
-
|
|
267
|
-
O,
|
|
277
|
+
oe(u, c, z, A),
|
|
278
|
+
M || F || S || I || j || K ? /* @__PURE__ */ h(L, { children: [
|
|
268
279
|
I,
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
280
|
+
M,
|
|
281
|
+
F,
|
|
282
|
+
j,
|
|
283
|
+
S,
|
|
272
284
|
K,
|
|
273
285
|
t
|
|
274
286
|
] }) : t
|
|
275
287
|
);
|
|
276
288
|
}
|
|
277
|
-
return /* @__PURE__ */
|
|
278
|
-
O,
|
|
289
|
+
return /* @__PURE__ */ h(o ? "span" : "div", { ...oe(c, z, A), children: [
|
|
279
290
|
I,
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
291
|
+
M,
|
|
292
|
+
F,
|
|
293
|
+
j,
|
|
294
|
+
S,
|
|
283
295
|
K,
|
|
284
296
|
a
|
|
285
297
|
] });
|
|
286
298
|
}
|
|
287
|
-
function
|
|
288
|
-
if (!e ||
|
|
289
|
-
const d =
|
|
290
|
-
return /* @__PURE__ */
|
|
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
|
|
293
|
-
const e =
|
|
294
|
-
return (a,
|
|
304
|
+
function lt() {
|
|
305
|
+
const e = se();
|
|
306
|
+
return (a, o, i) => He(e, a, o, i);
|
|
295
307
|
}
|
|
296
|
-
function
|
|
297
|
-
const { ref: a, slot:
|
|
298
|
-
return /* @__PURE__ */
|
|
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: !
|
|
315
|
+
hidden: !o,
|
|
304
316
|
"data-design-drop-body": e,
|
|
305
|
-
"data-design-drop-indicator":
|
|
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:
|
|
319
|
+
style: o ? i ?? ce[o] : void 0
|
|
308
320
|
}
|
|
309
321
|
);
|
|
310
322
|
}
|
|
311
|
-
function
|
|
312
|
-
return /* @__PURE__ */
|
|
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
|
|
322
|
-
function
|
|
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
|
|
326
|
-
const
|
|
327
|
-
return { shown:
|
|
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
|
|
330
|
-
return e.trim().split(/\s+/).filter(Boolean).slice(0, 2).map((
|
|
331
|
-
var
|
|
332
|
-
return ((
|
|
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
|
|
336
|
-
const a =
|
|
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
|
|
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
|
-
},
|
|
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
|
|
363
|
-
const a =
|
|
364
|
-
return /* @__PURE__ */
|
|
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__ */
|
|
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
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
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
|
};
|