@nivaro/react 0.3.35 → 0.3.36
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 -4
- package/dist/shared/components/RecordReadView.js +88 -85
- package/dist/shared/components/item-edit/PersonalDefaultControl.js +77 -60
- package/dist/shared/components/layout-editor/DesignNode.js +79 -78
- package/dist/shared/components/layout-editor/EditorCanvas.js +25 -17
- package/dist/shared/components/layout-editor/EditorTopBar.js +230 -188
- package/dist/shared/components/layout-editor/LayoutEditor.js +370 -369
- package/dist/shared/components/layout-editor/dnd/LayoutDndProvider.js +218 -182
- package/dist/shared/components/layout-editor/dnd/TrashZone.js +68 -0
- package/dist/shared/components/layout-editor/dnd/rail-drop.js +4 -4
- package/dist/shared/components/layout-editor/dnd/trash-drop.js +52 -0
- package/dist/shared/components/layout-editor/inspector/kit.js +1 -1
- package/dist/shared/components/layout-editor/panel-frame.js +1 -1
- package/dist/shared/components/layout-editor/personal-default-marks.js +40 -0
- package/dist/shared/components/layout-editor/preview/PreviewPanes.js +2 -2
- package/package.json +1 -1
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import {
|
|
3
|
-
import { useState as
|
|
1
|
+
import { jsx as r, jsxs as o } from "react/jsx-runtime";
|
|
2
|
+
import { UserRound as v, UserRoundPlus as S, UserRoundPen as C, UserRoundX as U, Check as Y, Undo2 as E } from "lucide-react";
|
|
3
|
+
import { useState as F, Fragment as P, useInsertionEffect as I } from "react";
|
|
4
4
|
import { toast as c } from "sonner";
|
|
5
|
-
import { usePersonalDefaultsApi as
|
|
5
|
+
import { usePersonalDefaultsApi as D } from "./usePersonalDefaults.js";
|
|
6
6
|
function T(e) {
|
|
7
7
|
return e.applied && e.hasDefault ? "applied" : e.editable ? e.loaded ? e.failed && !e.hasDefault ? e.hasValue ? "offer" : null : e.hasDefault ? e.hasValue ? e.isDefault ? "saved" : "update" : "saved-empty" : e.hasValue ? "offer" : "reserve" : "reserve" : null;
|
|
8
8
|
}
|
|
9
|
-
function K(e,
|
|
10
|
-
return e != null && e.allowed(
|
|
9
|
+
function K(e, t, a) {
|
|
10
|
+
return e != null && e.allowed(t) ? T({
|
|
11
11
|
editable: a,
|
|
12
12
|
loaded: e.loaded,
|
|
13
|
-
hasValue: e.hasValue(
|
|
14
|
-
hasDefault: e.defaultFor(
|
|
15
|
-
isDefault: e.isDefault(
|
|
16
|
-
applied: e.applied(
|
|
13
|
+
hasValue: e.hasValue(t),
|
|
14
|
+
hasDefault: e.defaultFor(t) !== null,
|
|
15
|
+
isDefault: e.isDefault(t),
|
|
16
|
+
applied: e.applied(t),
|
|
17
17
|
failed: e.failed
|
|
18
18
|
}) : null;
|
|
19
19
|
}
|
|
20
|
-
function g(e,
|
|
21
|
-
var d,
|
|
20
|
+
function g(e, t) {
|
|
21
|
+
var d, l, f;
|
|
22
22
|
const a = e;
|
|
23
|
-
return ((
|
|
23
|
+
return ((l = (d = a == null ? void 0 : a.response) == null ? void 0 : d.data) == null ? void 0 : l.error) ?? ((f = a == null ? void 0 : a.data) == null ? void 0 : f.error) ?? (a == null ? void 0 : a.error) ?? (a == null ? void 0 : a.message) ?? t;
|
|
24
24
|
}
|
|
25
|
-
function R(e,
|
|
26
|
-
return e.clear(
|
|
25
|
+
function R(e, t) {
|
|
26
|
+
return e.clear(t).then(
|
|
27
27
|
(a) => (c.success(
|
|
28
28
|
"Your default was cleared",
|
|
29
29
|
a ? {
|
|
@@ -65,7 +65,7 @@ button[data-field-menu-trigger]{opacity:1}
|
|
|
65
65
|
}
|
|
66
66
|
`, N = "nvr-personal-default-css";
|
|
67
67
|
function L() {
|
|
68
|
-
|
|
68
|
+
I(() => {
|
|
69
69
|
if (typeof document > "u" || document.getElementById(N)) return;
|
|
70
70
|
const e = document.createElement("style");
|
|
71
71
|
e.id = N, e.textContent = A, document.head.appendChild(e);
|
|
@@ -73,7 +73,7 @@ function L() {
|
|
|
73
73
|
}
|
|
74
74
|
const y = 'relative inline-flex h-5 shrink-0 items-center gap-1 whitespace-nowrap rounded px-1 text-[10.5px] font-medium text-slate-500 transition-colors duration-150 before:absolute before:inset-x-0 before:-inset-y-0.5 before:content-[""] hover:bg-muted hover:text-slate-800 active:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-sky-600 disabled:cursor-not-allowed disabled:opacity-50 aria-expanded:bg-muted aria-expanded:text-slate-800 dark:text-muted-foreground dark:hover:text-foreground dark:focus-visible:ring-sky-300 dark:aria-expanded:text-foreground', V = "inline-flex h-5 shrink-0 items-center gap-1 whitespace-nowrap px-1 text-[10.5px] font-medium text-slate-500 dark:text-muted-foreground", $ = "inline-flex h-5 shrink-0 items-center gap-1 whitespace-nowrap rounded bg-sky-50 px-1.5 text-[10.5px] font-medium text-sky-800 dark:bg-sky-900/30 dark:text-sky-200";
|
|
75
75
|
function j() {
|
|
76
|
-
return /* @__PURE__ */
|
|
76
|
+
return /* @__PURE__ */ r(
|
|
77
77
|
"span",
|
|
78
78
|
{
|
|
79
79
|
"aria-hidden": !0,
|
|
@@ -82,127 +82,144 @@ function j() {
|
|
|
82
82
|
}
|
|
83
83
|
);
|
|
84
84
|
}
|
|
85
|
-
function
|
|
85
|
+
function W({
|
|
86
86
|
field: e,
|
|
87
|
-
label:
|
|
87
|
+
label: t,
|
|
88
88
|
state: a,
|
|
89
89
|
confirmOpen: d,
|
|
90
|
-
onConfirm:
|
|
91
|
-
onUndo:
|
|
90
|
+
onConfirm: l,
|
|
91
|
+
onUndo: f,
|
|
92
92
|
onCleared: h
|
|
93
93
|
}) {
|
|
94
94
|
L();
|
|
95
|
-
const
|
|
95
|
+
const s = D(), [x, k] = F(!1), i = t || e, b = a !== "saved-empty", m = /* @__PURE__ */ o(
|
|
96
96
|
"button",
|
|
97
97
|
{
|
|
98
98
|
type: "button",
|
|
99
99
|
"data-personal-default-clear": e,
|
|
100
|
-
"aria-label":
|
|
101
|
-
"data-tip":
|
|
100
|
+
"aria-label": b ? `Clear your saved default for ${i} (the field keeps its value)` : `Clear your saved default for ${i}`,
|
|
101
|
+
"data-tip": b ? "Forget your saved default — this field keeps its value" : "Forget your saved default",
|
|
102
102
|
"data-pd-action": !0,
|
|
103
103
|
tabIndex: -1,
|
|
104
|
-
disabled:
|
|
105
|
-
"aria-busy":
|
|
104
|
+
disabled: x || !s,
|
|
105
|
+
"aria-busy": x || void 0,
|
|
106
106
|
onClick: () => {
|
|
107
|
-
|
|
108
|
-
|
|
107
|
+
s && (k(!0), R(s, e).then((n) => {
|
|
108
|
+
k(!1), n && (h == null || h());
|
|
109
109
|
}));
|
|
110
110
|
},
|
|
111
111
|
className: y,
|
|
112
112
|
children: [
|
|
113
|
-
/* @__PURE__ */
|
|
114
|
-
/* @__PURE__ */
|
|
113
|
+
/* @__PURE__ */ r(U, { "data-pd-icon": !0, className: "h-3 w-3", "aria-hidden": !0 }),
|
|
114
|
+
/* @__PURE__ */ r("span", { "data-pd-label": !0, children: "Clear default" })
|
|
115
115
|
]
|
|
116
116
|
},
|
|
117
117
|
"clear"
|
|
118
|
-
),
|
|
118
|
+
), w = (n) => /* @__PURE__ */ o(
|
|
119
119
|
"button",
|
|
120
120
|
{
|
|
121
121
|
type: "button",
|
|
122
|
-
...
|
|
123
|
-
"aria-label":
|
|
122
|
+
...n === "make" ? { "data-personal-default-make": e } : { "data-personal-default-update": e },
|
|
123
|
+
"aria-label": n === "make" ? `Make this your default for ${i}` : `Update your saved default for ${i} to this value`,
|
|
124
124
|
"aria-haspopup": "dialog",
|
|
125
|
-
"aria-expanded": d ===
|
|
126
|
-
"data-tip":
|
|
125
|
+
"aria-expanded": d === n,
|
|
126
|
+
"data-tip": n === "make" ? "Start your new records with this value" : "Start your new records with this value instead",
|
|
127
127
|
"data-pd-action": !0,
|
|
128
128
|
tabIndex: -1,
|
|
129
|
-
onClick: (
|
|
129
|
+
onClick: (p) => l(p.currentTarget, n),
|
|
130
130
|
className: y,
|
|
131
131
|
children: [
|
|
132
|
-
|
|
133
|
-
/* @__PURE__ */
|
|
132
|
+
n === "make" ? /* @__PURE__ */ r(S, { className: "h-3 w-3", "aria-hidden": !0 }) : /* @__PURE__ */ r(C, { className: "h-3 w-3", "aria-hidden": !0 }),
|
|
133
|
+
/* @__PURE__ */ r("span", { "data-pd-primary": !0, children: n === "make" ? "Make default" : "Update default" })
|
|
134
134
|
]
|
|
135
135
|
},
|
|
136
|
-
|
|
136
|
+
n
|
|
137
137
|
);
|
|
138
138
|
let u = [];
|
|
139
|
-
return a === "offer" ? u = [
|
|
140
|
-
/* @__PURE__ */
|
|
139
|
+
return a === "offer" ? u = [w("make")] : a === "update" ? u = [w("update"), m] : a === "saved" || a === "saved-empty" ? u = [
|
|
140
|
+
/* @__PURE__ */ o(
|
|
141
141
|
"span",
|
|
142
142
|
{
|
|
143
143
|
"data-personal-default-saved": e,
|
|
144
144
|
"data-tip": a === "saved" ? "Your new records start with this value" : "You have a saved default for this field — new records start with it",
|
|
145
145
|
className: V,
|
|
146
146
|
children: [
|
|
147
|
-
a === "saved" ? /* @__PURE__ */
|
|
148
|
-
/* @__PURE__ */
|
|
149
|
-
/* @__PURE__ */
|
|
147
|
+
a === "saved" ? /* @__PURE__ */ r(Y, { className: "h-3 w-3 text-sky-700 dark:text-sky-300", "aria-hidden": !0 }) : /* @__PURE__ */ r(v, { className: "h-3 w-3", "aria-hidden": !0 }),
|
|
148
|
+
/* @__PURE__ */ r("span", { className: "sr-only", children: "Your default" }),
|
|
149
|
+
/* @__PURE__ */ r("span", { "data-pd-label": !0, "aria-hidden": !0, children: "Your default" })
|
|
150
150
|
]
|
|
151
151
|
},
|
|
152
152
|
"status"
|
|
153
153
|
),
|
|
154
154
|
m
|
|
155
155
|
] : a === "applied" && (u = [
|
|
156
|
-
/* @__PURE__ */
|
|
156
|
+
/* @__PURE__ */ o(
|
|
157
157
|
"span",
|
|
158
158
|
{
|
|
159
159
|
"data-personal-default": e,
|
|
160
160
|
"data-tip": "Filled in from your saved default",
|
|
161
161
|
className: $,
|
|
162
162
|
children: [
|
|
163
|
-
/* @__PURE__ */
|
|
164
|
-
/* @__PURE__ */
|
|
165
|
-
/* @__PURE__ */
|
|
163
|
+
/* @__PURE__ */ r(v, { className: "h-3 w-3", "aria-hidden": !0 }),
|
|
164
|
+
/* @__PURE__ */ r("span", { className: "sr-only", children: "Your default" }),
|
|
165
|
+
/* @__PURE__ */ r("span", { "data-pd-label": !0, "aria-hidden": !0, children: "Your default" })
|
|
166
166
|
]
|
|
167
167
|
},
|
|
168
168
|
"status"
|
|
169
169
|
),
|
|
170
|
-
/* @__PURE__ */
|
|
170
|
+
/* @__PURE__ */ o(
|
|
171
171
|
"button",
|
|
172
172
|
{
|
|
173
173
|
type: "button",
|
|
174
174
|
"data-personal-default-undo": e,
|
|
175
|
-
"aria-label": `Undo: empty ${
|
|
175
|
+
"aria-label": `Undo: empty ${i} (your saved default stays)`,
|
|
176
176
|
"data-tip": "Empty this field — your saved default stays",
|
|
177
177
|
"data-pd-action": !0,
|
|
178
|
-
onClick:
|
|
178
|
+
onClick: f,
|
|
179
179
|
className: y,
|
|
180
180
|
children: [
|
|
181
|
-
/* @__PURE__ */
|
|
182
|
-
/* @__PURE__ */
|
|
181
|
+
/* @__PURE__ */ r(E, { className: "h-3 w-3", "aria-hidden": !0 }),
|
|
182
|
+
/* @__PURE__ */ r("span", { "data-pd-label": !0, children: "Undo" })
|
|
183
183
|
]
|
|
184
184
|
},
|
|
185
185
|
"undo"
|
|
186
186
|
),
|
|
187
187
|
m
|
|
188
|
-
]), /* @__PURE__ */
|
|
188
|
+
]), /* @__PURE__ */ r(
|
|
189
189
|
"span",
|
|
190
190
|
{
|
|
191
191
|
"data-personal-default-slot": e,
|
|
192
192
|
"data-state": a,
|
|
193
|
-
"data-pd-new":
|
|
193
|
+
"data-pd-new": s != null && s.isNew ? "" : void 0,
|
|
194
194
|
"aria-hidden": a === "reserve" ? !0 : void 0,
|
|
195
195
|
className: "inline-flex shrink-0 items-center justify-end",
|
|
196
|
-
children: u.map((
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
] }, String(
|
|
196
|
+
children: u.map((n, p) => /* @__PURE__ */ o(P, { children: [
|
|
197
|
+
p > 0 && /* @__PURE__ */ r(j, {}),
|
|
198
|
+
n
|
|
199
|
+
] }, String(n.key ?? p)))
|
|
200
|
+
}
|
|
201
|
+
);
|
|
202
|
+
}
|
|
203
|
+
function X({ field: e }) {
|
|
204
|
+
const t = D();
|
|
205
|
+
if (!(t != null && t.allowed(e))) return null;
|
|
206
|
+
const a = t.loaded && t.isDefault(e), d = t.loaded && t.defaultFor(e) !== null, l = a ? "Your default: new records you start get this value." : d ? "You have your own default for this field, different from this value." : "You can save your own default for this field (Edit mode).";
|
|
207
|
+
return /* @__PURE__ */ r(
|
|
208
|
+
"span",
|
|
209
|
+
{
|
|
210
|
+
"data-personal-default-mark": a ? "mine" : d ? "saved" : "allowed",
|
|
211
|
+
"data-tip": l,
|
|
212
|
+
role: "img",
|
|
213
|
+
"aria-label": l,
|
|
214
|
+
className: a ? "ml-1.5 inline-flex align-middle text-cyan-700 dark:text-nvr-cyan" : "ml-1.5 inline-flex align-middle text-slate-500 dark:text-slate-400",
|
|
215
|
+
children: /* @__PURE__ */ r(v, { "aria-hidden": !0, className: "h-3 w-3", strokeWidth: 2.25 })
|
|
200
216
|
}
|
|
201
217
|
);
|
|
202
218
|
}
|
|
203
219
|
export {
|
|
204
220
|
A as PERSONAL_DEFAULT_CSS,
|
|
205
|
-
X as
|
|
221
|
+
X as PersonalDefaultMark,
|
|
222
|
+
W as PersonalDefaultSlot,
|
|
206
223
|
R as clearPersonalDefault,
|
|
207
224
|
K as personalDefaultSlotFor,
|
|
208
225
|
T as personalDefaultSlotState,
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { EyeOff as xe, Lock as ye, Pin as Ne } from "lucide-react";
|
|
3
|
-
import { isValidElement as re, Fragment as
|
|
4
|
-
import { cn as f, formatRelative as
|
|
5
|
-
import { useLayoutDesign as oe, targetKey as
|
|
6
|
-
import { useDesignDndNode as
|
|
7
|
-
import { ResizeHandle as
|
|
8
|
-
import { NoteMarker as
|
|
9
|
-
import { FillChip as
|
|
1
|
+
import { jsx as o, Fragment as S, jsxs as m } from "react/jsx-runtime";
|
|
2
|
+
import { EyeOff as xe, Lock as ye, Pin as Ne, UserRound as _e } from "lucide-react";
|
|
3
|
+
import { isValidElement as re, Fragment as De, cloneElement as we } from "react";
|
|
4
|
+
import { cn as f, formatRelative as Ce } from "../../lib/utils.js";
|
|
5
|
+
import { useLayoutDesign as oe, targetKey as $e, isSelectedIn as Te } from "./design-context.js";
|
|
6
|
+
import { useDesignDndNode as Re, NO_DND as ze, useDesignDropBody as je } from "./dnd/node.js";
|
|
7
|
+
import { ResizeHandle as Fe } from "./grid-guides.js";
|
|
8
|
+
import { NoteMarker as Me } from "./NoteMarker.js";
|
|
9
|
+
import { FillChip as Ae } from "./usage/FillChip.js";
|
|
10
10
|
const te = (e, a) => {
|
|
11
11
|
typeof e == "function" ? e(a) : e && typeof e == "object" && (e.current = a);
|
|
12
12
|
};
|
|
13
13
|
function ne(...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
|
te(c, n), te(d, n);
|
|
@@ -23,43 +23,43 @@ function ne(...e) {
|
|
|
23
23
|
}
|
|
24
24
|
return a;
|
|
25
25
|
}
|
|
26
|
-
const
|
|
26
|
+
const Ie = {
|
|
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
|
+
}, Oe = "inline-block max-w-[260px] truncate rounded px-1 text-left text-[11px] ring-1", Ee = [
|
|
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
34
|
].join(" "), ie = {
|
|
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 Ke({
|
|
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
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 =
|
|
48
|
-
if (!n) return /* @__PURE__ */
|
|
49
|
-
const ce =
|
|
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 = Re((n == null ? void 0 : n.dnd) ?? ze, e, { disabled: v, noDrop: le });
|
|
48
|
+
if (!n) return /* @__PURE__ */ o(S, { children: a });
|
|
49
|
+
const ce = $e(e), w = Te(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__ */ o(Me, { 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
50
|
!me && "relative",
|
|
51
51
|
"cursor-pointer rounded-md outline-offset-2",
|
|
52
|
-
!p && (
|
|
52
|
+
!p && (i ? "inline-block" : "block"),
|
|
53
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",
|
|
54
54
|
b == null ? void 0 : b.className,
|
|
55
55
|
"focus-visible:outline focus-visible:outline-2 focus-visible:outline-nvr-cyan",
|
|
56
|
-
|
|
56
|
+
Ee,
|
|
57
57
|
// The section's "Changed by" shows while the pointer is over it.
|
|
58
58
|
"[&:hover>[data-design-last-change]]:visible",
|
|
59
59
|
pe && "opacity-40",
|
|
60
60
|
// Hidden for the previewed role: faint, its tags not.
|
|
61
61
|
(s == null ? void 0 : s.kind) === "hidden" && "[&>:not([data-design-badges])]:opacity-40",
|
|
62
|
-
l &&
|
|
62
|
+
l && He[l.kind],
|
|
63
63
|
_ && "cursor-default [&>:not([data-design-badges])]:opacity-40"
|
|
64
64
|
), fe = (t) => {
|
|
65
65
|
const u = t.target;
|
|
@@ -88,7 +88,7 @@ function Ee({
|
|
|
88
88
|
className: he,
|
|
89
89
|
onClickCapture: fe,
|
|
90
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 ?
|
|
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 ? Ce(y.at) : null].filter(Boolean).join(" · ") || null, A = P && !l ? /* @__PURE__ */ m(
|
|
92
92
|
"span",
|
|
93
93
|
{
|
|
94
94
|
"data-design-last-change": "",
|
|
@@ -102,7 +102,7 @@ function Ee({
|
|
|
102
102
|
]
|
|
103
103
|
}
|
|
104
104
|
) : null, h = [];
|
|
105
|
-
l && h.push({ rank: 0, text:
|
|
105
|
+
l && h.push({ rank: 0, text: Ge(l), node: /* @__PURE__ */ o(ae, { diff: l }) }), s && h.push({
|
|
106
106
|
rank: 1,
|
|
107
107
|
text: `${s.kind === "hidden" ? "Hidden" : "Read-only"} for ${s.role}`,
|
|
108
108
|
node: /* @__PURE__ */ m(
|
|
@@ -111,7 +111,7 @@ function Ee({
|
|
|
111
111
|
"data-design-role-tag": s.kind,
|
|
112
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",
|
|
113
113
|
children: [
|
|
114
|
-
/* @__PURE__ */
|
|
114
|
+
/* @__PURE__ */ o(ke, { "aria-hidden": !0, className: "h-3 w-3" }),
|
|
115
115
|
s.kind === "hidden" ? "Hidden" : "Read-only",
|
|
116
116
|
" for ",
|
|
117
117
|
s.role
|
|
@@ -121,22 +121,23 @@ function Ee({
|
|
|
121
121
|
}), b && h.push({
|
|
122
122
|
rank: 1,
|
|
123
123
|
text: "Who sees it",
|
|
124
|
-
node: /* @__PURE__ */
|
|
124
|
+
node: /* @__PURE__ */ o("span", { "data-design-pass": "", className: "pointer-events-auto", children: b.chip })
|
|
125
125
|
}), R.forEach((t, u) => {
|
|
126
126
|
const N = f(
|
|
127
|
-
|
|
127
|
+
Oe,
|
|
128
128
|
t.icon && "inline-flex items-center gap-0.5",
|
|
129
129
|
t.onClick || t.tip ? "pointer-events-auto" : null,
|
|
130
130
|
t.onClick && "hover:brightness-95",
|
|
131
|
-
|
|
131
|
+
Ie[t.tone]
|
|
132
132
|
), ee = /* @__PURE__ */ m(S, { children: [
|
|
133
|
-
t.icon === "pin" && /* @__PURE__ */
|
|
133
|
+
t.icon === "pin" && /* @__PURE__ */ o(Ne, { "aria-hidden": !0, className: "h-3 w-3" }),
|
|
134
|
+
t.icon === "person" && /* @__PURE__ */ o(_e, { "aria-hidden": !0, className: "h-3 w-3" }),
|
|
134
135
|
t.text
|
|
135
136
|
] });
|
|
136
137
|
h.push({
|
|
137
|
-
rank:
|
|
138
|
+
rank: Be(t),
|
|
138
139
|
text: t.text,
|
|
139
|
-
node: t.onClick ? /* @__PURE__ */
|
|
140
|
+
node: t.onClick ? /* @__PURE__ */ o(
|
|
140
141
|
"button",
|
|
141
142
|
{
|
|
142
143
|
type: "button",
|
|
@@ -148,7 +149,7 @@ function Ee({
|
|
|
148
149
|
children: ee
|
|
149
150
|
},
|
|
150
151
|
`${u}:${t.text}`
|
|
151
|
-
) : /* @__PURE__ */
|
|
152
|
+
) : /* @__PURE__ */ o(
|
|
152
153
|
"span",
|
|
153
154
|
{
|
|
154
155
|
"data-design-mark": "",
|
|
@@ -167,9 +168,9 @@ function Ee({
|
|
|
167
168
|
g
|
|
168
169
|
] })
|
|
169
170
|
});
|
|
170
|
-
const { shown: ve, rest: $ } =
|
|
171
|
+
const { shown: ve, rest: $ } = Pe(h), W = R.length > 0 || b != null || k.length > 0, T = x && !l ? [...h.map((t) => t.text), ...k.map((t) => t.name)] : [];
|
|
171
172
|
T.length > 0 && (F["data-tip"] = g && !s && !W ? `From ${g}` : T.join(" · "));
|
|
172
|
-
const I = x && l ? /* @__PURE__ */
|
|
173
|
+
const I = x && l ? /* @__PURE__ */ o("span", { "data-design-badges": "", className: "pointer-events-none absolute -top-2 right-0 z-10", children: /* @__PURE__ */ o(ae, { diff: l }) }) : T.length > 0 ? /* @__PURE__ */ o(
|
|
173
174
|
"span",
|
|
174
175
|
{
|
|
175
176
|
"data-design-badges": "",
|
|
@@ -177,7 +178,7 @@ function Ee({
|
|
|
177
178
|
"pointer-events-none absolute left-1/2 top-1 z-10 h-1.5 w-1.5 -translate-x-1/2 rounded-full",
|
|
178
179
|
g && !s && !W ? "bg-slate-500 dark:bg-slate-400" : "bg-violet-500 dark:bg-violet-400"
|
|
179
180
|
),
|
|
180
|
-
children: /* @__PURE__ */
|
|
181
|
+
children: /* @__PURE__ */ o("span", { className: "sr-only", children: T.join(" · ") })
|
|
181
182
|
}
|
|
182
183
|
) : h.length > 0 || k.length > 0 || M != null ? /* @__PURE__ */ m(
|
|
183
184
|
"span",
|
|
@@ -185,10 +186,10 @@ function Ee({
|
|
|
185
186
|
"data-design-badges": "",
|
|
186
187
|
className: "pointer-events-none absolute -top-2 right-1 z-10 flex items-center gap-1",
|
|
187
188
|
children: [
|
|
188
|
-
M != null && /* @__PURE__ */
|
|
189
|
+
M != null && /* @__PURE__ */ o(Ae, { pct: M }),
|
|
189
190
|
ve.map((t, u) => (
|
|
190
191
|
// biome-ignore lint/suspicious/noArrayIndexKey: ranked tags of one node, rebuilt each render
|
|
191
|
-
/* @__PURE__ */
|
|
192
|
+
/* @__PURE__ */ o(De, { children: t.node }, u)
|
|
192
193
|
)),
|
|
193
194
|
$.length > 0 && /* @__PURE__ */ m(
|
|
194
195
|
"span",
|
|
@@ -202,7 +203,7 @@ function Ee({
|
|
|
202
203
|
]
|
|
203
204
|
}
|
|
204
205
|
),
|
|
205
|
-
k.map((t) => /* @__PURE__ */
|
|
206
|
+
k.map((t) => /* @__PURE__ */ o(
|
|
206
207
|
"span",
|
|
207
208
|
{
|
|
208
209
|
"data-design-peer": t.id,
|
|
@@ -211,13 +212,13 @@ function Ee({
|
|
|
211
212
|
"pointer-events-auto inline-flex h-4 w-4 items-center justify-center rounded-full text-[9px] font-semibold ring-1",
|
|
212
213
|
t.chip
|
|
213
214
|
),
|
|
214
|
-
children:
|
|
215
|
+
children: We(t.name)
|
|
215
216
|
},
|
|
216
217
|
t.id
|
|
217
218
|
))
|
|
218
219
|
]
|
|
219
220
|
}
|
|
220
|
-
) : null, O = L ? /* @__PURE__ */
|
|
221
|
+
) : null, O = L ? /* @__PURE__ */ o(
|
|
221
222
|
"span",
|
|
222
223
|
{
|
|
223
224
|
"data-unsaved-dot": "",
|
|
@@ -226,9 +227,9 @@ function Ee({
|
|
|
226
227
|
// A step clips its corners away: the dot sits inside, before the arrow.
|
|
227
228
|
x ? "right-4 top-1" : "-left-1 -top-1"
|
|
228
229
|
),
|
|
229
|
-
children: /* @__PURE__ */
|
|
230
|
+
children: /* @__PURE__ */ o("span", { className: "sr-only", children: "unsaved change" })
|
|
230
231
|
}
|
|
231
|
-
) : null, E = C ? /* @__PURE__ */
|
|
232
|
+
) : null, E = C ? /* @__PURE__ */ o(
|
|
232
233
|
"span",
|
|
233
234
|
{
|
|
234
235
|
"aria-hidden": !0,
|
|
@@ -236,13 +237,13 @@ function Ee({
|
|
|
236
237
|
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
238
|
style: D.indicator ?? ie[C]
|
|
238
239
|
}
|
|
239
|
-
) : null, K = w && !v && n.resizeWidth && (e.kind === "field" || e.kind === "slot") && e.group_key !== null ? /* @__PURE__ */
|
|
240
|
+
) : null, K = w && !v && n.resizeWidth && (e.kind === "field" || e.kind === "slot") && e.group_key !== null ? /* @__PURE__ */ o(Fe, { onCommit: (t) => {
|
|
240
241
|
var u;
|
|
241
242
|
return (u = n.resizeWidth) == null ? void 0 : u.call(n, e, t);
|
|
242
243
|
} }) : null;
|
|
243
244
|
if (p) {
|
|
244
245
|
const { children: t, ...u } = p.props;
|
|
245
|
-
return
|
|
246
|
+
return we(
|
|
246
247
|
p,
|
|
247
248
|
// The child's own classes, style, ref and handlers are kept and merged.
|
|
248
249
|
ne(u, c, j, F),
|
|
@@ -257,7 +258,7 @@ function Ee({
|
|
|
257
258
|
] }) : t
|
|
258
259
|
);
|
|
259
260
|
}
|
|
260
|
-
return /* @__PURE__ */ m(
|
|
261
|
+
return /* @__PURE__ */ m(i ? "span" : "div", { ...ne(c, j, F), children: [
|
|
261
262
|
O,
|
|
262
263
|
I,
|
|
263
264
|
A,
|
|
@@ -267,32 +268,32 @@ function Ee({
|
|
|
267
268
|
a
|
|
268
269
|
] });
|
|
269
270
|
}
|
|
270
|
-
function
|
|
271
|
-
if (!e ||
|
|
272
|
-
const d = re(
|
|
273
|
-
return /* @__PURE__ */
|
|
271
|
+
function Se(e, a, i, r = {}) {
|
|
272
|
+
if (!e || i == null || i === !1) return i;
|
|
273
|
+
const d = re(i) ? i.key ?? void 0 : void 0;
|
|
274
|
+
return /* @__PURE__ */ o(Ke, { target: a, ...r, children: i }, d);
|
|
274
275
|
}
|
|
275
|
-
function
|
|
276
|
+
function nt() {
|
|
276
277
|
const e = oe();
|
|
277
|
-
return (a,
|
|
278
|
+
return (a, i, r) => Se(e, a, i, r);
|
|
278
279
|
}
|
|
279
|
-
function
|
|
280
|
-
const { ref: a, slot:
|
|
281
|
-
return /* @__PURE__ */
|
|
280
|
+
function at({ groupKey: e }) {
|
|
281
|
+
const { ref: a, slot: i, indicator: r } = je(e);
|
|
282
|
+
return /* @__PURE__ */ o(
|
|
282
283
|
"span",
|
|
283
284
|
{
|
|
284
285
|
ref: a,
|
|
285
286
|
"aria-hidden": !0,
|
|
286
|
-
hidden: !
|
|
287
|
+
hidden: !i,
|
|
287
288
|
"data-design-drop-body": e,
|
|
288
|
-
"data-design-drop-indicator":
|
|
289
|
+
"data-design-drop-indicator": i ?? void 0,
|
|
289
290
|
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:
|
|
291
|
+
style: i ? r ?? ie[i] : void 0
|
|
291
292
|
}
|
|
292
293
|
);
|
|
293
294
|
}
|
|
294
|
-
function
|
|
295
|
-
return /* @__PURE__ */
|
|
295
|
+
function rt() {
|
|
296
|
+
return /* @__PURE__ */ o(
|
|
296
297
|
"div",
|
|
297
298
|
{
|
|
298
299
|
"data-design-drop-zone": "",
|
|
@@ -301,25 +302,25 @@ function at() {
|
|
|
301
302
|
}
|
|
302
303
|
);
|
|
303
304
|
}
|
|
304
|
-
const
|
|
305
|
-
function
|
|
306
|
-
return e.kind === "preview" ? 1 : e.kind === "ai" ? 4 : e.kind === "loop" || e.highlight ? 2 : 3;
|
|
305
|
+
const Le = 2;
|
|
306
|
+
function Be(e) {
|
|
307
|
+
return e.kind === "preview" ? 1 : e.kind === "ai" ? 4 : e.kind === "loop" || e.kind === "personal" || e.highlight ? 2 : 3;
|
|
307
308
|
}
|
|
308
|
-
function
|
|
309
|
-
const
|
|
310
|
-
return { shown:
|
|
309
|
+
function Pe(e, a = Le) {
|
|
310
|
+
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);
|
|
311
|
+
return { shown: i.slice(0, a), rest: i.slice(a) };
|
|
311
312
|
}
|
|
312
|
-
function
|
|
313
|
-
return e.trim().split(/\s+/).filter(Boolean).slice(0, 2).map((
|
|
313
|
+
function We(e) {
|
|
314
|
+
return e.trim().split(/\s+/).filter(Boolean).slice(0, 2).map((i) => {
|
|
314
315
|
var r;
|
|
315
|
-
return ((r =
|
|
316
|
+
return ((r = i[0]) == null ? void 0 : r.toUpperCase()) ?? "";
|
|
316
317
|
}).join("") || "?";
|
|
317
318
|
}
|
|
318
|
-
function
|
|
319
|
+
function Ge(e) {
|
|
319
320
|
const a = de[e.kind].text;
|
|
320
321
|
return e.kind === "moved" && e.detail ? `Moved ${e.detail}` : e.kind === "changed" && e.detail ? `${a}: ${e.detail}` : a;
|
|
321
322
|
}
|
|
322
|
-
const
|
|
323
|
+
const He = {
|
|
323
324
|
added: "ring-2 ring-emerald-500/70 dark:ring-emerald-400/60",
|
|
324
325
|
moved: "ring-2 ring-amber-500/70 dark:ring-amber-400/60",
|
|
325
326
|
changed: "ring-1 ring-violet-500/60 dark:ring-violet-400/50",
|
|
@@ -351,18 +352,18 @@ function ae({ diff: e }) {
|
|
|
351
352
|
className: f("inline-flex items-center rounded px-1 text-[11px] ring-1", a.cls),
|
|
352
353
|
children: [
|
|
353
354
|
e.kind === "moved" && e.detail ? `Moved ${e.detail}` : a.text,
|
|
354
|
-
e.kind === "changed" && e.detail && /* @__PURE__ */
|
|
355
|
+
e.kind === "changed" && e.detail && /* @__PURE__ */ o("span", { className: "ml-1 max-w-[160px] truncate opacity-80", children: e.detail })
|
|
355
356
|
]
|
|
356
357
|
}
|
|
357
358
|
);
|
|
358
359
|
}
|
|
359
360
|
export {
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
361
|
+
at as DesignDropBody,
|
|
362
|
+
rt as DesignDropZone,
|
|
363
|
+
Ke as DesignNode,
|
|
364
|
+
Le as MAX_NODE_TAGS,
|
|
365
|
+
Se as designWrap,
|
|
366
|
+
Be as markRank,
|
|
367
|
+
Pe as rankChips,
|
|
368
|
+
nt as useDesignWrap
|
|
368
369
|
};
|