@nivaro/react 0.3.36 → 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 +9 -1
- 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 -575
- 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 +28 -28
- 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 +126 -112
- package/dist/shared/components/layout-editor/EditorTopBar.js +123 -103
- package/dist/shared/components/layout-editor/LayoutEditor.js +829 -751
- 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 +347 -189
- package/dist/shared/components/layout-editor/dnd/TrashZone.js +60 -32
- 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/sensors.js +23 -0
- package/dist/shared/components/layout-editor/dnd/trash-drop.js +34 -28
- 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/parity-keys.json.js +1 -1
- 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 +148 -117
- 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,57 +1,64 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useSensors as
|
|
3
|
-
import { getEventCoordinates as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
1
|
+
import { jsx as S, jsxs as ae } from "react/jsx-runtime";
|
|
2
|
+
import { useSensors as Ue, useSensor as te, TouchSensor as _e, KeyboardSensor as ve, KeyboardCode as H, DndContext as Be, MeasuringStrategy as je, DragOverlay as He } from "@dnd-kit/core";
|
|
3
|
+
import { getEventCoordinates as ye } from "@dnd-kit/utilities";
|
|
4
|
+
import { Plus as Ge } from "lucide-react";
|
|
5
|
+
import { useState as I, useRef as E, useMemo as he, useCallback as G, useEffect as qe, createContext as Ye, useSyncExternalStore as be, useLayoutEffect as ze, useContext as Ve } from "react";
|
|
6
|
+
import { createPortal as ne } from "react-dom";
|
|
7
|
+
import { UNGROUPED_KEY as Ee } from "../../../lib/layout-ops.js";
|
|
8
|
+
import { targetKey as P } from "../design-context.js";
|
|
9
|
+
import { mergePlan as Fe, mergeBlocked as Xe } from "../section-structure.js";
|
|
10
|
+
import { typedKeyboardCoordinates as Ze, nodeData as L, dndRole as we } from "./collision.js";
|
|
11
|
+
import { mergeAwareCollision as Je, mergeIndicatorStyle as Qe } from "./merge-drop.js";
|
|
12
|
+
import { manyLabel as ke, carriedTargets as We, dropMany as et, copyAfterDrop as tt } from "./multi-drop.js";
|
|
13
|
+
import { DndStore as nt, DndStoreContext as rt, NO_DND as ot, IDLE as Ce } from "./node.js";
|
|
14
|
+
import { landsOnCanvas as Se, placeAfterDrop as at, orderAfterDrop as st, dropLabel as lt } from "./order.js";
|
|
15
|
+
import { railDropData as De, copyableGroup as xe, railAwareCollision as it } from "./rail-drop.js";
|
|
16
|
+
import { MousePointerSensor as ct, MOUSE_ACTIVATION as dt, TOUCH_ACTIVATION as ut } from "./sensors.js";
|
|
17
|
+
import { TrashZone as pt } from "./TrashZone.js";
|
|
18
|
+
import { trashAwareCollision as gt, TRASH_DROP_ID as se, trashDropData as F, trashPlan as re, trashPlanMany as $e } from "./trash-drop.js";
|
|
19
|
+
import { UndoChip as ft } from "./UndoChip.js";
|
|
20
|
+
const Oe = Ye(ot);
|
|
21
|
+
function Ht() {
|
|
22
|
+
return Ve(Oe);
|
|
17
23
|
}
|
|
18
|
-
const
|
|
19
|
-
function
|
|
20
|
-
var
|
|
21
|
-
if (
|
|
22
|
-
|
|
23
|
-
|
|
24
|
+
const X = 3, Z = 20;
|
|
25
|
+
function mt(g, n, o, d) {
|
|
26
|
+
var y, R;
|
|
27
|
+
if (g.merge) return Qe(((y = n.headerHeight) == null ? void 0 : y.call(n)) ?? 0);
|
|
28
|
+
if (g.body) {
|
|
29
|
+
const O = o - 2 * Z, r = d && O > 0 ? Math.min(d, O) : void 0, M = r ? { left: Z, width: r } : { left: Z, right: Z };
|
|
30
|
+
return g.side === "before" ? { top: (((R = n.headerHeight) == null ? void 0 : R.call(n)) ?? 0) + 4, height: X, ...M } : { bottom: 8, height: X, ...M };
|
|
24
31
|
}
|
|
25
|
-
if (
|
|
26
|
-
return { top: 0, bottom: 0, width:
|
|
27
|
-
const
|
|
32
|
+
if (g.axis === "x")
|
|
33
|
+
return { top: 0, bottom: 0, width: X, [g.side === "before" ? "left" : "right"]: -4 };
|
|
34
|
+
const m = n.role.kind === "item" && d && o ? Math.min(d, o) : void 0;
|
|
28
35
|
return {
|
|
29
|
-
[
|
|
30
|
-
height:
|
|
36
|
+
[g.side === "before" ? "top" : "bottom"]: -6,
|
|
37
|
+
height: X,
|
|
31
38
|
left: 0,
|
|
32
|
-
...
|
|
39
|
+
...m ? { width: m } : { right: 0 }
|
|
33
40
|
};
|
|
34
41
|
}
|
|
35
|
-
const
|
|
36
|
-
var o,
|
|
37
|
-
return ((
|
|
42
|
+
const yt = (g, n) => {
|
|
43
|
+
var o, d;
|
|
44
|
+
return ((d = (o = (g ?? []).find((m) => m.id === n)) == null ? void 0 : o.data) == null ? void 0 : d.hint) ?? null;
|
|
38
45
|
};
|
|
39
|
-
function
|
|
40
|
-
for (let n =
|
|
46
|
+
function Ae(g) {
|
|
47
|
+
for (let n = g; n && n !== document.documentElement; ) {
|
|
41
48
|
const o = getComputedStyle(n);
|
|
42
49
|
if (o.transform && o.transform !== "none" || o.perspective && o.perspective !== "none" || o.filter && o.filter !== "none" || /paint|layout|strict|content/.test(o.contain ?? "") || /transform|perspective|filter/.test(o.willChange ?? "")) {
|
|
43
|
-
const
|
|
44
|
-
return { x:
|
|
50
|
+
const m = n.getBoundingClientRect();
|
|
51
|
+
return { x: m.left + n.clientLeft - n.scrollLeft, y: m.top + n.clientTop - n.scrollTop };
|
|
45
52
|
}
|
|
46
53
|
n = n.parentElement;
|
|
47
54
|
}
|
|
48
55
|
return { x: 0, y: 0 };
|
|
49
56
|
}
|
|
50
|
-
function
|
|
51
|
-
const n =
|
|
57
|
+
function ht(g) {
|
|
58
|
+
const n = g.cloneNode(!0);
|
|
52
59
|
for (const o of [n, ...Array.from(n.querySelectorAll("*"))])
|
|
53
|
-
for (const
|
|
54
|
-
o.removeAttribute(
|
|
60
|
+
for (const d of ["data-design-target", "data-selected", "data-drop-slot", "id"])
|
|
61
|
+
o.removeAttribute(d);
|
|
55
62
|
if (n.classList.remove("opacity-40"), n.style.clipPath) {
|
|
56
63
|
n.style.clipPath = "none", n.style.transform = "none", n.style.overflow = "visible", n.style.borderRadius = "0", n.style.height = "100%";
|
|
57
64
|
for (const o of Array.from(n.querySelectorAll("*")))
|
|
@@ -62,217 +69,368 @@ function Nt(f) {
|
|
|
62
69
|
n.removeAttribute(o);
|
|
63
70
|
return n.removeAttribute("data-header-folded"), n.setAttribute("inert", ""), Object.assign(n.style, { margin: "0", width: "100%", opacity: "1", outline: "none" }), n;
|
|
64
71
|
}
|
|
65
|
-
const
|
|
66
|
-
function
|
|
67
|
-
|
|
72
|
+
const J = 320;
|
|
73
|
+
function bt({
|
|
74
|
+
node: g,
|
|
75
|
+
store: n,
|
|
76
|
+
count: o
|
|
77
|
+
}) {
|
|
78
|
+
const d = E(null), m = be(
|
|
79
|
+
n.subscribe,
|
|
80
|
+
G(() => n.state.overKey === se, [n]),
|
|
81
|
+
() => !1
|
|
82
|
+
), y = be(
|
|
68
83
|
n.subscribe,
|
|
69
|
-
|
|
84
|
+
G(() => n.state.copy, [n]),
|
|
70
85
|
() => !1
|
|
71
86
|
);
|
|
72
|
-
|
|
73
|
-
const
|
|
74
|
-
if (
|
|
75
|
-
return
|
|
76
|
-
}, [
|
|
87
|
+
ze(() => {
|
|
88
|
+
const O = d.current;
|
|
89
|
+
if (O)
|
|
90
|
+
return O.replaceChildren(ht(g)), () => O.replaceChildren();
|
|
91
|
+
}, [g]);
|
|
92
|
+
const R = o > 1 || y ? /* @__PURE__ */ ae(
|
|
93
|
+
"span",
|
|
94
|
+
{
|
|
95
|
+
"data-design-drag-badge": y ? "copy" : "count",
|
|
96
|
+
className: "absolute -right-2 -top-2 z-10 inline-flex h-6 min-w-6 items-center justify-center gap-0.5 rounded-full bg-nvr-cyan px-1.5 text-[11.5px] font-semibold text-white shadow-md ring-2 ring-white dark:ring-[#0f172a]",
|
|
97
|
+
children: [
|
|
98
|
+
y && /* @__PURE__ */ S(Ge, { "aria-hidden": !0, className: "h-3 w-3" }),
|
|
99
|
+
o > 1 ? o : y ? "Copy" : null
|
|
100
|
+
]
|
|
101
|
+
}
|
|
102
|
+
) : null;
|
|
103
|
+
return /* @__PURE__ */ ae(
|
|
77
104
|
"div",
|
|
78
105
|
{
|
|
79
|
-
ref: o,
|
|
80
106
|
"aria-hidden": !0,
|
|
81
107
|
"data-design-drag-preview": "",
|
|
82
|
-
"data-over-trash":
|
|
108
|
+
"data-over-trash": m ? "" : void 0,
|
|
109
|
+
"data-copy": y ? "" : void 0,
|
|
83
110
|
style: {
|
|
84
111
|
transformOrigin: "top left",
|
|
85
|
-
transform:
|
|
86
|
-
opacity:
|
|
112
|
+
transform: m ? "scale(0.4)" : void 0,
|
|
113
|
+
opacity: m ? 0.45 : void 0
|
|
87
114
|
},
|
|
88
|
-
className: "pointer-events-none h-full w-full cursor-grabbing
|
|
115
|
+
className: "pointer-events-none relative h-full w-full cursor-grabbing transition-[transform,opacity] duration-150 ease-out motion-reduce:transition-none",
|
|
116
|
+
children: [
|
|
117
|
+
o > 1 && /* @__PURE__ */ S("span", { className: "absolute inset-0 translate-x-1.5 translate-y-1.5 rounded-lg bg-white shadow-lg ring-1 ring-slate-900/10 dark:bg-card dark:ring-white/10" }),
|
|
118
|
+
/* @__PURE__ */ S(
|
|
119
|
+
"div",
|
|
120
|
+
{
|
|
121
|
+
ref: d,
|
|
122
|
+
className: "relative h-full w-full overflow-hidden rounded-lg bg-white shadow-xl ring-1 ring-slate-900/10 dark:bg-card dark:ring-white/10"
|
|
123
|
+
}
|
|
124
|
+
),
|
|
125
|
+
R,
|
|
126
|
+
y && /* @__PURE__ */ S("style", { children: "*{cursor:copy !important}" })
|
|
127
|
+
]
|
|
89
128
|
}
|
|
90
129
|
);
|
|
91
130
|
}
|
|
92
|
-
const
|
|
93
|
-
start: [
|
|
94
|
-
cancel: [
|
|
95
|
-
end: [
|
|
96
|
-
},
|
|
97
|
-
draggable: "Press space to pick this up. Use the arrow keys to choose where it goes, then space or enter to drop it, or escape to cancel."
|
|
131
|
+
const oe = { kind: "group", key: Ee }, wt = { droppable: { strategy: je.Always } }, kt = {
|
|
132
|
+
start: [H.Space],
|
|
133
|
+
cancel: [H.Esc],
|
|
134
|
+
end: [H.Space, H.Enter, H.Tab]
|
|
135
|
+
}, Ct = {
|
|
136
|
+
draggable: "Press space to pick this up. Use the arrow keys to choose where it goes, then space or enter to drop it, or escape to cancel. Hold Alt to copy instead of moving."
|
|
98
137
|
};
|
|
99
|
-
function
|
|
100
|
-
bundle:
|
|
138
|
+
function Gt({
|
|
139
|
+
bundle: g,
|
|
101
140
|
apply: n,
|
|
102
141
|
onDragActive: o,
|
|
103
|
-
onDropOnLayout:
|
|
104
|
-
|
|
142
|
+
onDropOnLayout: d,
|
|
143
|
+
selection: m,
|
|
144
|
+
undo: y,
|
|
145
|
+
warnTrash: R,
|
|
146
|
+
children: O
|
|
105
147
|
}) {
|
|
106
|
-
const [r] =
|
|
107
|
-
r.bundle =
|
|
108
|
-
const
|
|
109
|
-
|
|
110
|
-
const
|
|
111
|
-
|
|
112
|
-
const
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
148
|
+
const [r] = I(() => new nt());
|
|
149
|
+
r.bundle = g;
|
|
150
|
+
const M = E(n);
|
|
151
|
+
M.current = n;
|
|
152
|
+
const U = E(d);
|
|
153
|
+
U.current = d;
|
|
154
|
+
const le = E(m ?? []);
|
|
155
|
+
le.current = m ?? [];
|
|
156
|
+
const q = E(R);
|
|
157
|
+
q.current = R;
|
|
158
|
+
const Q = E(y);
|
|
159
|
+
Q.current = y;
|
|
160
|
+
const h = E([]), [Pe] = I(
|
|
161
|
+
() => gt(
|
|
162
|
+
Je(
|
|
163
|
+
it(
|
|
164
|
+
(e) => !!U.current && xe(r.bundle, e) != null
|
|
165
|
+
),
|
|
166
|
+
(e, t) => !r.state.copy && e.target.kind === "group" && t.target.kind === "group" && !!r.bundle && Xe(r.bundle, e.target.key, t.target.key) === null
|
|
116
167
|
),
|
|
117
|
-
(e) =>
|
|
168
|
+
(e) => re(r.bundle, e) != null
|
|
118
169
|
)
|
|
119
|
-
), [
|
|
170
|
+
), [Re] = I(() => ({
|
|
120
171
|
threshold: { x: 0.08, y: 0.15 },
|
|
121
172
|
acceleration: 12,
|
|
122
|
-
canScroll: () => r.state.overKey !==
|
|
123
|
-
})), [I,
|
|
173
|
+
canScroll: () => r.state.overKey !== se
|
|
174
|
+
})), [_, ie] = I(null), [w, W] = I(null), Ke = he(
|
|
124
175
|
() => ({
|
|
125
176
|
draggableProps: () => ({}),
|
|
126
|
-
isDragging: (e) => r.
|
|
127
|
-
dropSlot: (e) => r.state.overKey ===
|
|
128
|
-
dropIndicator: (e) => r.state.overKey ===
|
|
177
|
+
isDragging: (e) => r.isCarried(P(e)),
|
|
178
|
+
dropSlot: (e) => r.state.overKey === P(e) ? r.state.side : null,
|
|
179
|
+
dropIndicator: (e) => r.state.overKey === P(e) ? r.state.indicator : null
|
|
129
180
|
}),
|
|
130
181
|
[r]
|
|
131
|
-
),
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
182
|
+
), Le = Ue(
|
|
183
|
+
te(ct, { activationConstraint: dt }),
|
|
184
|
+
te(_e, { activationConstraint: ut }),
|
|
185
|
+
te(ve, {
|
|
186
|
+
coordinateGetter: Ze,
|
|
187
|
+
keyboardCodes: kt
|
|
136
188
|
})
|
|
137
|
-
), [
|
|
189
|
+
), [x, ce] = I(null), Y = G(
|
|
138
190
|
(e) => {
|
|
139
|
-
var
|
|
140
|
-
|
|
141
|
-
if (
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
return ((u = (p = i == null ? void 0 : i.querySelector("label, [data-header-label]")) == null ? void 0 : p.textContent) == null ? void 0 : u.replace(/\s*\*\s*$/, "").trim()) || (d.kind === "slot" ? "panel" : "field");
|
|
191
|
+
var s, c, l, p;
|
|
192
|
+
if (!e) return "this";
|
|
193
|
+
if (e.add) return e.add.label;
|
|
194
|
+
const t = e.target;
|
|
195
|
+
if (t.kind === "group")
|
|
196
|
+
return t.key === "__ungrouped__" ? "Ungrouped fields" : ((c = (s = r.bundle) == null ? void 0 : s.groups.find((f) => f.key === t.key)) == null ? void 0 : c.label) ?? "section";
|
|
197
|
+
const i = r.nodes.get(P(t));
|
|
198
|
+
return ((p = (l = i == null ? void 0 : i.querySelector("label, [data-header-label]")) == null ? void 0 : l.textContent) == null ? void 0 : p.replace(/\s*\*\s*$/, "").trim()) || (t.kind === "slot" ? "panel" : "field");
|
|
148
199
|
},
|
|
149
200
|
[r]
|
|
150
|
-
),
|
|
201
|
+
), K = G(
|
|
202
|
+
(e) => Y(L(e == null ? void 0 : e.data.current)),
|
|
203
|
+
[Y]
|
|
204
|
+
), k = G(
|
|
205
|
+
(e) => h.current.length > 1 ? ke(h.current, "move").replace(/^Move /, "") : K(e),
|
|
206
|
+
[K]
|
|
207
|
+
), Me = he(
|
|
151
208
|
() => ({
|
|
152
|
-
onDragStart: ({ active: e }) => `Picked up ${
|
|
153
|
-
onDragOver: ({ active: e, over: t }) => t &&
|
|
154
|
-
onDragEnd: ({ active: e, over: t }) => t &&
|
|
155
|
-
onDragCancel: ({ active: e }) => `Cancelled. ${
|
|
209
|
+
onDragStart: ({ active: e }) => `Picked up ${k(e)}.`,
|
|
210
|
+
onDragOver: ({ active: e, over: t }) => t && F(t.data.current) ? `${k(e)} is over Remove. Drop it to take it off this form.` : t && r.state.merge && r.state.overKey === String(t.id) ? `${k(e)} is over ${K(t)}. Drop it to join them.` : t ? `${k(e)} is over ${K(t)}${r.state.copy ? ". Dropping copies it" : ""}.` : `${k(e)} is not over a place it can go.`,
|
|
211
|
+
onDragEnd: ({ active: e, over: t }) => t && F(t.data.current) ? `Removed ${k(e)} from this form. Undo brings it back.` : t ? `Dropped ${k(e)} by ${K(t)}.` : `Dropped ${k(e)}.`,
|
|
212
|
+
onDragCancel: ({ active: e }) => `Cancelled. ${k(e)} stays where it was.`
|
|
156
213
|
}),
|
|
157
|
-
[
|
|
158
|
-
),
|
|
159
|
-
r.set(
|
|
160
|
-
},
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
214
|
+
[K, k, r]
|
|
215
|
+
), N = E(null), z = () => {
|
|
216
|
+
r.set(Ce), h.current = [], N.current = null, ce(null), ie(null), o == null || o(!1);
|
|
217
|
+
}, Ne = ({ active: e, activatorEvent: t }) => {
|
|
218
|
+
var T;
|
|
219
|
+
o == null || o(!0), W(null);
|
|
220
|
+
const i = L(e.data.current);
|
|
221
|
+
if (!i) return;
|
|
222
|
+
const a = P(i.target), s = r.bundle;
|
|
223
|
+
h.current = i.add ? [i.target] : We(s, le.current, i.target);
|
|
224
|
+
const c = h.current.length > 1, l = !i.add && !!(t != null && t.altKey);
|
|
225
|
+
r.set({
|
|
226
|
+
...Ce,
|
|
227
|
+
activeKey: a,
|
|
228
|
+
carried: c ? h.current.map(P) : null,
|
|
229
|
+
copy: l
|
|
230
|
+
});
|
|
231
|
+
const p = c ? $e(
|
|
232
|
+
s,
|
|
233
|
+
h.current.map((D) => {
|
|
234
|
+
const j = s ? we(s, D) : null;
|
|
235
|
+
return j ? { target: D, role: j } : null;
|
|
236
|
+
})
|
|
237
|
+
) : re(s, i);
|
|
238
|
+
ie(
|
|
239
|
+
p && s ? {
|
|
240
|
+
plan: p,
|
|
241
|
+
name: c ? k(e) : K(e),
|
|
242
|
+
warning: ((T = q.current) == null ? void 0 : T.call(q, s, p.ops)) ?? null
|
|
243
|
+
} : null
|
|
244
|
+
);
|
|
245
|
+
const f = r.nodes.get(a);
|
|
246
|
+
if (!f || typeof document > "u") return;
|
|
247
|
+
const C = f.closest("[role=dialog]") ?? document.body, b = Ae(C), u = f.getBoundingClientRect(), $ = ye(t), A = $ ? $.y - u.top : 0, V = u.height > J && A > J - 32 ? A - J / 2 : 0, B = ({ transform: D }) => ({
|
|
248
|
+
...D,
|
|
249
|
+
x: D.x - b.x,
|
|
250
|
+
y: D.y - b.y + V
|
|
174
251
|
});
|
|
175
|
-
|
|
176
|
-
},
|
|
252
|
+
ce({ node: f, host: C, height: Math.min(u.height, J), shift: B });
|
|
253
|
+
}, v = E({
|
|
177
254
|
bundle: null,
|
|
178
255
|
map: /* @__PURE__ */ new Map()
|
|
179
|
-
}),
|
|
180
|
-
const
|
|
181
|
-
if (!
|
|
182
|
-
|
|
183
|
-
const p = `${e.id}|${t.id}|${
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
256
|
+
}), de = (e, t, i) => {
|
|
257
|
+
const a = L(e.data.current), s = L(t == null ? void 0 : t.data.current), c = yt(i, t == null ? void 0 : t.id), l = r.bundle;
|
|
258
|
+
if (!a || !s || !c || !l || !t) return null;
|
|
259
|
+
v.current.bundle !== l && (v.current = { bundle: l, map: /* @__PURE__ */ new Map() });
|
|
260
|
+
const p = r.state.copy && !a.add ? "copy" : "move", f = h.current.length > 1, C = `${e.id}|${t.id}|${c.side}|${c.merge ? "join" : ""}|${p}|${f ? h.current.length : 1}`;
|
|
261
|
+
if (v.current.map.has(C)) return v.current.map.get(C) ?? null;
|
|
262
|
+
let b = [], u = "";
|
|
263
|
+
if (c.merge && a.target.kind === "group" && s.target.kind === "group") {
|
|
264
|
+
const A = Fe(l, a.target.key, s.target.key);
|
|
265
|
+
A.ok && (b = A.ops, u = A.label);
|
|
266
|
+
} else a.add ? (b = at(l, a.add.field, s.target, c.side, a.add.patch), u = `Add ${a.add.label}`) : f ? (b = et(l, h.current, s.target, c.side, p), u = ke(h.current, p)) : p === "copy" ? (b = tt(l, a.target, s.target, c.side), u = St(l, a.target, Y(a))) : (b = st(l, a.target, s.target, c.side), u = lt(l, a.target), Se(l, a.target, s.target) && !r.nodes.has(P(oe)) && (b = []));
|
|
267
|
+
const $ = { a, o: s, hint: c, ops: b, label: u };
|
|
268
|
+
return v.current.map.set(C, $), $;
|
|
269
|
+
}, ee = (e) => {
|
|
270
|
+
var u, $;
|
|
271
|
+
N.current = e;
|
|
272
|
+
const { active: t, over: i, collisions: a } = e;
|
|
273
|
+
if (i && F(i.data.current)) {
|
|
274
|
+
r.set({ overKey: se, side: null, indicator: null, merge: null });
|
|
190
275
|
return;
|
|
191
276
|
}
|
|
192
|
-
if (
|
|
193
|
-
r.set({ overKey: String(
|
|
277
|
+
if (i && De(i.data.current)) {
|
|
278
|
+
r.set({ overKey: String(i.id), side: null, indicator: null, merge: null });
|
|
194
279
|
return;
|
|
195
280
|
}
|
|
196
|
-
const
|
|
197
|
-
if (!
|
|
198
|
-
r.set({ overKey: null, side: null, indicator: null });
|
|
281
|
+
const s = de(t, i, a);
|
|
282
|
+
if (!s || s.ops.length === 0 || !i) {
|
|
283
|
+
r.set({ overKey: null, side: null, indicator: null, merge: null });
|
|
199
284
|
return;
|
|
200
285
|
}
|
|
201
|
-
let { o:
|
|
202
|
-
r.bundle &&
|
|
203
|
-
target:
|
|
204
|
-
role: { kind: "group", key:
|
|
286
|
+
let { o: c, hint: l } = s, p = String(i.id);
|
|
287
|
+
h.current.length <= 1 && !r.state.copy && !l.merge && r.bundle && Se(r.bundle, s.a.target, c.target) && (p = P(oe), c = {
|
|
288
|
+
target: oe,
|
|
289
|
+
role: { kind: "group", key: Ee, parent: null, body: !0 }
|
|
205
290
|
}, l = { side: l.side, axis: "y", body: !1 });
|
|
206
|
-
const
|
|
291
|
+
const C = ((u = r.nodes.get(p)) == null ? void 0 : u.getBoundingClientRect().width) ?? 0, b = (($ = t.rect.current.initial) == null ? void 0 : $.width) ?? null;
|
|
207
292
|
r.set({
|
|
208
|
-
overKey:
|
|
293
|
+
overKey: p,
|
|
209
294
|
side: l.side,
|
|
210
|
-
indicator:
|
|
295
|
+
indicator: mt(l, c, C, b),
|
|
296
|
+
merge: l.merge ? Y(c) : null
|
|
211
297
|
});
|
|
212
|
-
},
|
|
213
|
-
|
|
214
|
-
if (
|
|
215
|
-
|
|
216
|
-
|
|
298
|
+
}, ue = x != null || _ != null;
|
|
299
|
+
qe(() => {
|
|
300
|
+
if (!ue) return;
|
|
301
|
+
const e = (a) => {
|
|
302
|
+
if (!r.state.activeKey || r.state.copy === a) return;
|
|
303
|
+
const s = N.current ? L(N.current.active.data.current) : null;
|
|
304
|
+
s != null && s.add || (r.set({ copy: a }), N.current && ee(N.current));
|
|
305
|
+
}, t = (a) => {
|
|
306
|
+
a.key === "Alt" && (a.preventDefault(), e(a.type === "keydown"));
|
|
307
|
+
}, i = (a) => e(a.altKey);
|
|
308
|
+
return window.addEventListener("keydown", t, !0), window.addEventListener("keyup", t, !0), window.addEventListener("pointermove", i, !0), () => {
|
|
309
|
+
window.removeEventListener("keydown", t, !0), window.removeEventListener("keyup", t, !0), window.removeEventListener("pointermove", i, !0);
|
|
310
|
+
};
|
|
311
|
+
}, [ue, r]);
|
|
312
|
+
const Te = ({ active: e, over: t, collisions: i, activatorEvent: a, delta: s }) => {
|
|
313
|
+
var C, b;
|
|
314
|
+
if (F(t == null ? void 0 : t.data.current)) {
|
|
315
|
+
const u = r.bundle, A = h.current.length > 1 ? $e(
|
|
316
|
+
u,
|
|
317
|
+
h.current.map((fe) => {
|
|
318
|
+
const me = u ? we(u, fe) : null;
|
|
319
|
+
return me ? { target: fe, role: me } : null;
|
|
320
|
+
})
|
|
321
|
+
) : re(u, L(e.data.current)), V = k(e), B = r.nodes.get(String(e.id)), T = (B == null ? void 0 : B.closest("[role=dialog]")) ?? (typeof document > "u" ? null : document.body), D = ye(a);
|
|
322
|
+
if (z(), !A) return;
|
|
323
|
+
const j = `Remove ${V}`;
|
|
324
|
+
M.current(A.ops, { label: j }), Q.current && T && D && W({
|
|
325
|
+
label: V,
|
|
326
|
+
applied: j,
|
|
327
|
+
point: { x: D.x + s.x, y: D.y + s.y },
|
|
328
|
+
host: T,
|
|
329
|
+
origin: Ae(T),
|
|
330
|
+
armed: !1
|
|
331
|
+
});
|
|
217
332
|
return;
|
|
218
333
|
}
|
|
219
|
-
const
|
|
220
|
-
if (
|
|
221
|
-
const
|
|
222
|
-
|
|
334
|
+
const c = De(t == null ? void 0 : t.data.current);
|
|
335
|
+
if (c) {
|
|
336
|
+
const u = xe(r.bundle, L(e.data.current));
|
|
337
|
+
z(), u && ((C = U.current) == null || C.call(U, u, c.railLayoutId));
|
|
223
338
|
return;
|
|
224
339
|
}
|
|
225
|
-
const
|
|
226
|
-
if (
|
|
227
|
-
const
|
|
228
|
-
|
|
229
|
-
},
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
340
|
+
const l = de(e, t, i), p = r.bundle;
|
|
341
|
+
if (z(), !(l != null && l.ops.length) || !p) return;
|
|
342
|
+
const f = l.a.add;
|
|
343
|
+
M.current(l.ops, { label: l.label }), (b = f == null ? void 0 : f.onAdded) == null || b.call(f, l.ops);
|
|
344
|
+
}, pe = (y == null ? void 0 : y.label) ?? null;
|
|
345
|
+
w && !w.armed && pe === w.applied && (w.armed = !0);
|
|
346
|
+
const Ie = !!w && (!w.armed || pe === w.applied), ge = (e) => {
|
|
347
|
+
var a, s, c, l, p, f;
|
|
348
|
+
if ((s = (a = e.target) == null ? void 0 : a.closest) != null && s.call(a, "[data-design-resize]")) return;
|
|
349
|
+
const t = (l = (c = e.target) == null ? void 0 : c.closest) == null ? void 0 : l.call(c, "[data-design-target]");
|
|
350
|
+
if (!t) return;
|
|
351
|
+
const i = (p = r.activators.get(t)) == null ? void 0 : p();
|
|
352
|
+
(f = i == null ? void 0 : i[e.type === "touchstart" ? "onTouchStart" : "onPointerDown"]) == null || f.call(i, e);
|
|
234
353
|
};
|
|
235
|
-
return /* @__PURE__ */
|
|
236
|
-
|
|
354
|
+
return /* @__PURE__ */ S(rt.Provider, { value: r, children: /* @__PURE__ */ S(Oe.Provider, { value: Ke, children: /* @__PURE__ */ ae(
|
|
355
|
+
Be,
|
|
237
356
|
{
|
|
238
|
-
sensors:
|
|
239
|
-
collisionDetection:
|
|
240
|
-
measuring:
|
|
241
|
-
autoScroll:
|
|
242
|
-
accessibility: { announcements:
|
|
243
|
-
onDragStart:
|
|
244
|
-
onDragMove:
|
|
245
|
-
onDragOver:
|
|
246
|
-
onDragEnd:
|
|
247
|
-
onDragCancel:
|
|
357
|
+
sensors: Le,
|
|
358
|
+
collisionDetection: Pe,
|
|
359
|
+
measuring: wt,
|
|
360
|
+
autoScroll: Re,
|
|
361
|
+
accessibility: { announcements: Me, screenReaderInstructions: Ct },
|
|
362
|
+
onDragStart: Ne,
|
|
363
|
+
onDragMove: ee,
|
|
364
|
+
onDragOver: ee,
|
|
365
|
+
onDragEnd: Te,
|
|
366
|
+
onDragCancel: z,
|
|
248
367
|
children: [
|
|
249
|
-
/* @__PURE__ */
|
|
250
|
-
|
|
251
|
-
/* @__PURE__ */
|
|
252
|
-
|
|
368
|
+
/* @__PURE__ */ S("div", { className: "contents", onPointerDownCapture: ge, onTouchStartCapture: ge, children: O }),
|
|
369
|
+
x && ne(
|
|
370
|
+
/* @__PURE__ */ S(
|
|
371
|
+
He,
|
|
253
372
|
{
|
|
254
373
|
dropAnimation: null,
|
|
255
374
|
zIndex: 1e3,
|
|
256
|
-
modifiers: [
|
|
257
|
-
style: { height:
|
|
258
|
-
children: /* @__PURE__ */
|
|
375
|
+
modifiers: [x.shift],
|
|
376
|
+
style: { height: x.height },
|
|
377
|
+
children: /* @__PURE__ */ S(
|
|
378
|
+
bt,
|
|
379
|
+
{
|
|
380
|
+
node: x.node,
|
|
381
|
+
store: r,
|
|
382
|
+
count: Math.max(1, h.current.length)
|
|
383
|
+
}
|
|
384
|
+
)
|
|
385
|
+
}
|
|
386
|
+
),
|
|
387
|
+
x.host
|
|
388
|
+
),
|
|
389
|
+
_ && ne(
|
|
390
|
+
/* @__PURE__ */ S(
|
|
391
|
+
pt,
|
|
392
|
+
{
|
|
393
|
+
store: r,
|
|
394
|
+
plan: _.plan,
|
|
395
|
+
name: _.name,
|
|
396
|
+
warning: _.warning
|
|
259
397
|
}
|
|
260
398
|
),
|
|
261
|
-
|
|
399
|
+
(x == null ? void 0 : x.host) ?? document.body
|
|
262
400
|
),
|
|
263
|
-
|
|
264
|
-
/* @__PURE__ */
|
|
265
|
-
|
|
401
|
+
w && y && ne(
|
|
402
|
+
/* @__PURE__ */ S(
|
|
403
|
+
ft,
|
|
404
|
+
{
|
|
405
|
+
label: w.label,
|
|
406
|
+
point: w.point,
|
|
407
|
+
origin: w.origin,
|
|
408
|
+
stillUndoable: Ie,
|
|
409
|
+
onUndo: () => {
|
|
410
|
+
var e;
|
|
411
|
+
return (e = Q.current) == null ? void 0 : e.run();
|
|
412
|
+
},
|
|
413
|
+
onClose: () => W(null)
|
|
414
|
+
}
|
|
415
|
+
),
|
|
416
|
+
w.host
|
|
266
417
|
)
|
|
267
418
|
]
|
|
268
419
|
}
|
|
269
420
|
) }) });
|
|
270
421
|
}
|
|
422
|
+
function St(g, n, o) {
|
|
423
|
+
if (n.kind === "group") {
|
|
424
|
+
const d = g.groups.find((m) => m.key === n.key);
|
|
425
|
+
return `Copy ${(d == null ? void 0 : d.type) === "tab" ? "tab" : "section"} "${(d == null ? void 0 : d.label) || o}"`;
|
|
426
|
+
}
|
|
427
|
+
return `Copy ${o}`;
|
|
428
|
+
}
|
|
271
429
|
export {
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
430
|
+
Gt as LayoutDndProvider,
|
|
431
|
+
ot as NO_DND,
|
|
432
|
+
ht as designClone,
|
|
433
|
+
Ae as fixedOrigin,
|
|
434
|
+
mt as indicatorStyle,
|
|
435
|
+
Ht as useLayoutDnd
|
|
278
436
|
};
|