@nivaro/react 0.3.0 → 0.3.1
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 +341 -0
- package/dist/index.js +764 -723
- package/dist/shared/components/ClientChaosToolbar.js +410 -0
- package/dist/shared/components/LoadErrorNote.js +49 -0
- package/dist/shared/components/PretendDown.js +258 -0
- package/dist/shared/components/ProfileView.js +54 -49
- package/dist/shared/components/QueryErrorState.js +16 -0
- package/dist/shared/components/ReportView.js +1351 -1338
- package/dist/shared/components/WidgetSlot.js +438 -418
- package/dist/shared/components/chaos/DeclareIncidentButton.js +72 -0
- package/dist/shared/components/chaos/DrillBanner.js +119 -0
- package/dist/shared/components/chaos/DrillTag.js +62 -0
- package/dist/shared/components/chaos/GameDayStrip.js +61 -0
- package/dist/shared/components/client-chaos-gate.js +51 -0
- package/dist/shared/components/integrations/console/SignalCard.js +172 -167
- package/dist/shared/components/layout-editor/EditorTopBar.js +108 -105
- package/dist/shared/components/layout-editor/LayoutEditor.js +514 -508
- package/dist/shared/components/notifications/NotificationAnalyticsView.js +18 -10
- package/dist/shared/components/pipeline/PipelineEditorView.js +495 -479
- package/dist/shared/components/pipeline/TeamsView.js +184 -169
- package/dist/shared/lib/client-chaos.js +359 -0
- package/dist/shared/lib/load-error.js +26 -0
- package/dist/shared/lib/socket-realtime.js +31 -30
- package/dist/shared/lib/worker-socket.js +108 -89
- package/package.json +1 -1
|
@@ -1,91 +1,92 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useQueryClient as
|
|
3
|
-
import { Percent as
|
|
4
|
-
import { useState as R, useEffect as
|
|
5
|
-
import { createPortal as
|
|
6
|
-
import { toast as
|
|
7
|
-
import { useNivaroClient as
|
|
8
|
-
import { get as
|
|
9
|
-
import { HEADER_GROUP_KEY as
|
|
10
|
-
import { activeFreeze as
|
|
11
|
-
import { useMyUserId as
|
|
1
|
+
import { jsxs as y, jsx as o, Fragment as ae } from "react/jsx-runtime";
|
|
2
|
+
import { useQueryClient as rr, useQuery as or } from "@tanstack/react-query";
|
|
3
|
+
import { Percent as nr, ListOrdered as ar, AlertTriangle as vt, Lock as sr, Plus as ir, BarChart3 as lr, LayoutGrid as dr, Table2 as cr, Grid3x3 as ur, Users as pr } from "lucide-react";
|
|
4
|
+
import { useState as R, useEffect as U, useMemo as b, useRef as j, useCallback as C } from "react";
|
|
5
|
+
import { createPortal as mr } from "react-dom";
|
|
6
|
+
import { toast as gt } from "sonner";
|
|
7
|
+
import { useNivaroClient as fr } from "../../context.js";
|
|
8
|
+
import { get as yr } from "../../lib/commands.js";
|
|
9
|
+
import { HEADER_GROUP_KEY as Pt, UNGROUPED_KEY as hr } from "../../lib/layout-ops.js";
|
|
10
|
+
import { activeFreeze as vr, dayWords as gr } from "../../lib/layout-resolve.js";
|
|
11
|
+
import { useMyUserId as kr } from "../../lib/presence-signals.js";
|
|
12
12
|
import { cn as G } from "../../lib/utils.js";
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
40
|
-
import {
|
|
41
|
-
import {
|
|
42
|
-
import {
|
|
43
|
-
import {
|
|
44
|
-
import {
|
|
45
|
-
import {
|
|
46
|
-
import {
|
|
47
|
-
import {
|
|
48
|
-
import {
|
|
49
|
-
import {
|
|
50
|
-
import {
|
|
51
|
-
import {
|
|
52
|
-
import {
|
|
13
|
+
import { usePretendDownScope as wr, LAYOUT_PRETEND_SCOPE as kt, layoutPretendDownOptions as br, PretendDownSection as xr } from "../PretendDown.js";
|
|
14
|
+
import { modalHostOf as Sr } from "../ui/popover.js";
|
|
15
|
+
import { Skeleton as wt } from "../ui/skeleton.js";
|
|
16
|
+
import { AddPanel as Cr } from "./AddPanel.js";
|
|
17
|
+
import { AutoArrangeButton as Tr } from "./AutoArrange.js";
|
|
18
|
+
import { AiToolsButton as Or } from "./ai/AiToolsButton.js";
|
|
19
|
+
import { pinsToMarks as Ar, mergeMarks as bt } from "./ai/ai-tools-api.js";
|
|
20
|
+
import { AiFormsButton as Pr } from "./ai-forms/AiFormsButton.js";
|
|
21
|
+
import { AskButton as Nr, AskPanel as Rr } from "./assist/AskPanel.js";
|
|
22
|
+
import { useAskThread as Lr } from "./assist/assist-api.js";
|
|
23
|
+
import { jumpToSetting as Er } from "./assist/jump.js";
|
|
24
|
+
import { ProposalsButton as Dr } from "./assist/ProposalsButton.js";
|
|
25
|
+
import { BulkChangesButton as Fr } from "./bulk/BulkChangesButton.js";
|
|
26
|
+
import { useMacroRecorder as Ir } from "./bulk/useMacroRecorder.js";
|
|
27
|
+
import { bundleToActiveLayout as Nt, previewForRole as Kr, roleMarker as _r } from "./bundle-to-active.js";
|
|
28
|
+
import { useCanvasCompare as Mr, CompareBanner as Br } from "./CanvasCompare.js";
|
|
29
|
+
import { changeNotePolicyOf as xt, changeNoteMeta as qr, changeNoteReady as Ur, ChangeNoteFields as $r, ChangeNoteSave as zr } from "./ChangeNote.js";
|
|
30
|
+
import { PresenceAvatars as Vr, DroppedBanner as Hr, RecoveryBanner as Wr, UnsavedList as jr } from "./CollabParts.js";
|
|
31
|
+
import { CommandPalette as Gr } from "./commands/CommandPalette.js";
|
|
32
|
+
import { nextSelection as Qr, targetKey as z } from "./design-context.js";
|
|
33
|
+
import { WIDTH_LABELS as Yr } from "./field-zones.js";
|
|
34
|
+
import { LayoutDndProvider as Jr, useLayoutDnd as Zr } from "./dnd/LayoutDndProvider.js";
|
|
35
|
+
import { NO_DND as Xr } from "./dnd/node.js";
|
|
36
|
+
import { useDraftRecovery as eo, stagedTip as to } from "./draft-recovery.js";
|
|
37
|
+
import { canvasRenderer as ro, EditorCanvas as oo } from "./EditorCanvas.js";
|
|
38
|
+
import { EditorTopBar as no } from "./EditorTopBar.js";
|
|
39
|
+
import { notesOf as ao, noteKey as so } from "./editor-notes.js";
|
|
40
|
+
import { EntryEditorContext as St } from "./entry/entry-editor-context.js";
|
|
41
|
+
import { useTabOrderEditor as io, TabOrderBar as lo } from "./entry/tab-order.js";
|
|
42
|
+
import { useAppIsDark as co, ThemePreviewTool as uo, previewThemeClass as po } from "./entry/theme-preview.js";
|
|
43
|
+
import { useRulesView as mo, explainMarks as fo, RulesToggle as yo, RuleLoopsBanner as ho } from "./explain/CanvasRules.js";
|
|
44
|
+
import { useDriverHover as vo } from "./explain/driver-hover.js";
|
|
45
|
+
import { useCanvasExplain as go, useDefaultGhosts as ko } from "./explain/use-explain.js";
|
|
46
|
+
import { FindReplaceButton as wo } from "./FindReplace.js";
|
|
47
|
+
import { OutputsButton as bo } from "./outputs/OutputsButton.js";
|
|
48
|
+
import { FormMapButton as xo } from "./FormMapButton.js";
|
|
49
|
+
import { useSectionChanges as So } from "./history-api.js";
|
|
50
|
+
import { useLayoutEditorHost as Co } from "./host.js";
|
|
51
|
+
import { overriddenTargets as To, overrideMark as Oo } from "./inheritance.js";
|
|
52
|
+
import { BulkInspector as Ao } from "./inspector/BulkInspector.js";
|
|
53
|
+
import { requestInspectorTab as Po } from "./inspector/tab-request.js";
|
|
53
54
|
import { isTyping as $e } from "./is-typing.js";
|
|
54
|
-
import { ARROW_DIRS as
|
|
55
|
-
import { LayoutsRail as
|
|
56
|
-
import { LintButton as
|
|
57
|
-
import { useLayoutLint as
|
|
58
|
-
import { FieldStateMatrix as
|
|
59
|
-
import { RoleSectionMatrix as
|
|
60
|
-
import { FindTool as
|
|
61
|
-
import { OutlinePanel as
|
|
62
|
-
import { useEditorNav as
|
|
63
|
-
import { COMPACT_ZOOM as
|
|
64
|
-
import { useLayoutOverview as
|
|
65
|
-
import { purposeSegments as
|
|
66
|
-
import { PlacementsTable as
|
|
67
|
-
import { segTrack as
|
|
68
|
-
import { useLayoutPresence as
|
|
69
|
-
import { PreviewModes as
|
|
70
|
-
import { PreviewPanes as
|
|
71
|
-
import { FormMoreMenu as
|
|
72
|
-
import { useRailCopy as
|
|
73
|
-
import { StagedByOthers as
|
|
74
|
-
import { StructureActions as
|
|
75
|
-
import { useRolePreview as
|
|
76
|
-
import { layoutKindOf as
|
|
77
|
-
import { useStagedDraft as
|
|
78
|
-
import { ImpactButton as
|
|
79
|
-
import { MenuSeparator as
|
|
80
|
-
import { unsavedText as
|
|
81
|
-
import { unsavedKeys as
|
|
82
|
-
import { UsagePanel as
|
|
83
|
-
import { useShowFillRates as
|
|
84
|
-
import { useLayoutDraft as
|
|
85
|
-
import { FormSettings as
|
|
86
|
-
import { Inspector as
|
|
87
|
-
function
|
|
88
|
-
|
|
55
|
+
import { ARROW_DIRS as No, altArrowMove as Ro } from "./keyboard-move.js";
|
|
56
|
+
import { LayoutsRail as Lo } from "./LayoutsRail.js";
|
|
57
|
+
import { LintButton as Eo, LintPanel as Do } from "./lint/LintPanel.js";
|
|
58
|
+
import { useLayoutLint as Fo } from "./lint/lint-api.js";
|
|
59
|
+
import { FieldStateMatrix as Io } from "./matrix/FieldStateMatrix.js";
|
|
60
|
+
import { RoleSectionMatrix as Ko } from "./matrix/RoleSectionMatrix.js";
|
|
61
|
+
import { FindTool as _o, OutlineTool as Mo, ViewTools as Bo, ShortcutsTool as qo } from "./nav/NavTools.js";
|
|
62
|
+
import { OutlinePanel as Uo } from "./nav/OutlinePanel.js";
|
|
63
|
+
import { useEditorNav as $o } from "./nav/useEditorNav.js";
|
|
64
|
+
import { COMPACT_ZOOM as zo } from "./nav/view-prefs.js";
|
|
65
|
+
import { useLayoutOverview as Vo, useOverviewFields as Ho, useInvalidateLayouts as Rt, useRuleChoiceLabels as Wo, useApproxRecordCount as jo } from "./overview/overview-api.js";
|
|
66
|
+
import { purposeSegments as Go, Sentence as Qo } from "./overview/purpose.js";
|
|
67
|
+
import { PlacementsTable as Yo } from "./PlacementsTable.js";
|
|
68
|
+
import { segTrack as Jo, amberStrip as Me, segOption as Zo } from "./panel-style.js";
|
|
69
|
+
import { useLayoutPresence as Xo, peersByTarget as en } from "./presence.js";
|
|
70
|
+
import { PreviewModes as tn } from "./preview/PreviewModes.js";
|
|
71
|
+
import { PreviewPanes as rn } from "./preview/PreviewPanes.js";
|
|
72
|
+
import { FormMoreMenu as on } from "./reuse/FormMoreMenu.js";
|
|
73
|
+
import { useRailCopy as nn } from "./reuse/useRailCopy.js";
|
|
74
|
+
import { StagedByOthers as an } from "./StagedChip.js";
|
|
75
|
+
import { StructureActions as sn, usePinMarks as ln } from "./StructureMenu.js";
|
|
76
|
+
import { useRolePreview as dn } from "./settings/settings-api.js";
|
|
77
|
+
import { layoutKindOf as cn } from "./settings/settings-registry.js";
|
|
78
|
+
import { useStagedDraft as un, useStagedWriter as pn } from "./staged-api.js";
|
|
79
|
+
import { ImpactButton as mn, TestingButton as fn } from "./testing/TestingPanels.js";
|
|
80
|
+
import { MenuSeparator as Ce, ToolButton as Ct } from "./toolbar-kit.js";
|
|
81
|
+
import { unsavedText as yn, UnsavedConfirm as hn } from "./UnsavedConfirm.js";
|
|
82
|
+
import { unsavedKeys as vn, targetFromKey as Tt, describeTarget as Ot } from "./unsaved-marks.js";
|
|
83
|
+
import { UsagePanel as gn } from "./usage/UsagePanel.js";
|
|
84
|
+
import { useShowFillRates as kn, useFieldFillRates as wn, usageTodayText as bn, useLayoutUsageToday as xn } from "./usage/usage-api.js";
|
|
85
|
+
import { useLayoutDraft as Sn, useLayoutBundle as Be, layoutDraftKeys as Cn, touchesOverview as Tn } from "./useLayoutDraft.js";
|
|
86
|
+
import { FormSettings as On } from "./settings/FormSettings.js";
|
|
87
|
+
import { Inspector as An } from "./inspector/Inspector.js";
|
|
88
|
+
function Pn(r) {
|
|
89
|
+
U(() => {
|
|
89
90
|
const l = (s) => {
|
|
90
91
|
if (!(s.metaKey || s.ctrlKey) || s.altKey) return;
|
|
91
92
|
const i = s.key.toLowerCase();
|
|
@@ -99,13 +100,13 @@ function Sn(r) {
|
|
|
99
100
|
return window.addEventListener("keydown", l), () => window.removeEventListener("keydown", l);
|
|
100
101
|
}, [r.undo, r.redo, r.autosave, r.flush, r.save]);
|
|
101
102
|
}
|
|
102
|
-
function
|
|
103
|
-
|
|
103
|
+
function Nn(r, l, s, i, m) {
|
|
104
|
+
U(() => {
|
|
104
105
|
const d = (c) => {
|
|
105
|
-
const v =
|
|
106
|
+
const v = No[c.key];
|
|
106
107
|
if (!v || !c.altKey || c.metaKey || c.ctrlKey || c.shiftKey || c.defaultPrevented || !r || l.length !== 1 || i.current || $e(c.target) || document.querySelector('[data-radix-popper-content-wrapper], [role="menu"]')) return;
|
|
107
108
|
c.preventDefault();
|
|
108
|
-
const p =
|
|
109
|
+
const p = Ro(r, l[0], v);
|
|
109
110
|
if (!p) return;
|
|
110
111
|
s(p.ops, { label: p.label }), m(p.next);
|
|
111
112
|
const u = z(p.next);
|
|
@@ -120,43 +121,43 @@ function Cn(r, l, s, i, m) {
|
|
|
120
121
|
return window.addEventListener("keydown", d), () => window.removeEventListener("keydown", d);
|
|
121
122
|
}, [r, l, s, i, m]);
|
|
122
123
|
}
|
|
123
|
-
function
|
|
124
|
+
function Rn(r) {
|
|
124
125
|
const l = r.status === "saving" || r.dirty;
|
|
125
|
-
|
|
126
|
+
U(() => {
|
|
126
127
|
if (!l) return;
|
|
127
128
|
const s = (i) => {
|
|
128
129
|
r.flush(), i.preventDefault(), i.returnValue = "";
|
|
129
130
|
};
|
|
130
131
|
return window.addEventListener("beforeunload", s), () => window.removeEventListener("beforeunload", s);
|
|
131
|
-
}, [l, r.flush]),
|
|
132
|
+
}, [l, r.flush]), U(() => {
|
|
132
133
|
const s = () => r.flush();
|
|
133
134
|
return window.addEventListener("pagehide", s), () => window.removeEventListener("pagehide", s);
|
|
134
135
|
}, [r.flush]);
|
|
135
136
|
}
|
|
136
|
-
function
|
|
137
|
-
const l =
|
|
137
|
+
function Ln(r) {
|
|
138
|
+
const l = rr(), s = Rt(r);
|
|
138
139
|
return C(
|
|
139
140
|
(i, m) => {
|
|
140
141
|
const d = Number(i.layout.id);
|
|
141
|
-
Number.isFinite(d) && l.invalidateQueries({ queryKey:
|
|
142
|
+
Number.isFinite(d) && l.invalidateQueries({ queryKey: Cn.versions(d) }), s({ lazy: !Tn(m) });
|
|
142
143
|
},
|
|
143
144
|
[l, s]
|
|
144
145
|
);
|
|
145
146
|
}
|
|
146
|
-
function
|
|
147
|
-
const s =
|
|
148
|
-
return
|
|
147
|
+
function En(r, l) {
|
|
148
|
+
const s = fr();
|
|
149
|
+
return or({
|
|
149
150
|
queryKey: ["layout-editor", "preview-record", r, l],
|
|
150
151
|
queryFn: () => s.request(
|
|
151
|
-
|
|
152
|
+
yr(`/items/${encodeURIComponent(r)}/${encodeURIComponent(String(l))}`)
|
|
152
153
|
).then((i) => i.data ?? null),
|
|
153
154
|
enabled: l != null,
|
|
154
155
|
staleTime: 3e4
|
|
155
156
|
});
|
|
156
157
|
}
|
|
157
|
-
function
|
|
158
|
+
function Dn(r, l) {
|
|
158
159
|
const s = j(l);
|
|
159
|
-
s.current = l,
|
|
160
|
+
s.current = l, U(() => {
|
|
160
161
|
if (!r) return;
|
|
161
162
|
let i = !1;
|
|
162
163
|
const m = (d) => {
|
|
@@ -182,17 +183,17 @@ function On(r, l) {
|
|
|
182
183
|
return document.addEventListener("click", m, !0), () => document.removeEventListener("click", m, !0);
|
|
183
184
|
}, [r]);
|
|
184
185
|
}
|
|
185
|
-
function
|
|
186
|
+
function qe(r, l, s = null) {
|
|
186
187
|
const i = (m) => {
|
|
187
|
-
if (r.kind === "group") return r.key ===
|
|
188
|
-
const d = r.kind === "header" ?
|
|
188
|
+
if (r.kind === "group") return r.key === hr || m.groups.some((c) => c.key === r.key);
|
|
189
|
+
const d = r.kind === "header" ? Pt : r.group_key;
|
|
189
190
|
return m.placements.some((c) => c.field === r.field && c.group_key === d);
|
|
190
191
|
};
|
|
191
192
|
return i(l) || s != null && i(s);
|
|
192
193
|
}
|
|
193
|
-
function
|
|
194
|
+
function Fn(r, l, s) {
|
|
194
195
|
const i = j(null), m = j(l);
|
|
195
|
-
return m.current = l,
|
|
196
|
+
return m.current = l, U(() => {
|
|
196
197
|
var v;
|
|
197
198
|
if (!r) return;
|
|
198
199
|
const d = document.activeElement;
|
|
@@ -205,7 +206,7 @@ function Rn(r, l, s) {
|
|
|
205
206
|
};
|
|
206
207
|
}, [r, s]), i;
|
|
207
208
|
}
|
|
208
|
-
function
|
|
209
|
+
function In({
|
|
209
210
|
collection: r,
|
|
210
211
|
bundle: l,
|
|
211
212
|
parent: s,
|
|
@@ -219,109 +220,109 @@ function Ln({
|
|
|
219
220
|
noDnd: g = !1,
|
|
220
221
|
record: Q,
|
|
221
222
|
selected: n,
|
|
222
|
-
selection:
|
|
223
|
+
selection: fe,
|
|
223
224
|
onSelect: t,
|
|
224
225
|
showHidden: E,
|
|
225
226
|
fold: te = null,
|
|
226
227
|
reveal: V = null,
|
|
227
|
-
apply:
|
|
228
|
-
whenIdle:
|
|
229
|
-
fillRate:
|
|
230
|
-
unsaved:
|
|
231
|
-
peers:
|
|
232
|
-
compare:
|
|
228
|
+
apply: P,
|
|
229
|
+
whenIdle: Te,
|
|
230
|
+
fillRate: ye,
|
|
231
|
+
unsaved: he,
|
|
232
|
+
peers: de,
|
|
233
|
+
compare: h,
|
|
233
234
|
lastChanges: L
|
|
234
235
|
}) {
|
|
235
|
-
const re =
|
|
236
|
-
() => s ?
|
|
236
|
+
const re = Zr(), I = g ? Xr : re, se = ro(String(l.layout.layout_type ?? "grouped")), ie = (se === "item-edit-form" || se === "read-view") && (h == null ? void 0 : h.diff.bundle) || l, M = b(() => Nt(ie, s), [ie, s]), Y = b(
|
|
237
|
+
() => s ? To(l, s) : null,
|
|
237
238
|
[l, s]
|
|
238
|
-
), H =
|
|
239
|
-
const
|
|
240
|
-
return
|
|
241
|
-
} : d, [
|
|
242
|
-
() =>
|
|
239
|
+
), H = b(() => Y != null && Y.size ? (k) => {
|
|
240
|
+
const O = Y.get(z(k)), ge = (d == null ? void 0 : d(k)) ?? [];
|
|
241
|
+
return O ? [...ge, Oo(O)] : ge;
|
|
242
|
+
} : d, [Y, d]), Oe = b(
|
|
243
|
+
() => Kr(M.active, i, E),
|
|
243
244
|
[M.active, i, E]
|
|
244
|
-
), { data:
|
|
245
|
-
() => i ?
|
|
246
|
-
[i,
|
|
247
|
-
),
|
|
245
|
+
), { data: K = null } = dn(r, i), J = b(
|
|
246
|
+
() => i ? _r(K) : void 0,
|
|
247
|
+
[i, K]
|
|
248
|
+
), N = b(() => ao(l), [l]), _ = b(
|
|
248
249
|
() => H && v ? (k) => [...H(k), ...v(k)] : H ?? v,
|
|
249
250
|
[H, v]
|
|
250
|
-
), B =
|
|
251
|
+
), B = ln(l, _), Ae = b(
|
|
251
252
|
() => ({
|
|
252
253
|
selected: n,
|
|
253
|
-
selection:
|
|
254
|
+
selection: fe,
|
|
254
255
|
onSelect: t,
|
|
255
256
|
showHidden: E,
|
|
256
257
|
inheritedFrom: (k) => M.inherited.get(z(k)) ?? null,
|
|
257
|
-
dnd:
|
|
258
|
-
roleMark:
|
|
258
|
+
dnd: I,
|
|
259
|
+
roleMark: J,
|
|
259
260
|
marks: B,
|
|
260
261
|
overlay: c,
|
|
261
|
-
fillRate:
|
|
262
|
+
fillRate: ye,
|
|
262
263
|
note: (k) => {
|
|
263
|
-
const
|
|
264
|
-
return
|
|
264
|
+
const O = so(k);
|
|
265
|
+
return O ? N.get(O) ?? null : null;
|
|
265
266
|
},
|
|
266
267
|
fold: te,
|
|
267
268
|
reveal: V,
|
|
268
|
-
unsaved:
|
|
269
|
-
peers:
|
|
270
|
-
diffMark:
|
|
269
|
+
unsaved: he,
|
|
270
|
+
peers: de,
|
|
271
|
+
diffMark: h ? (k) => h.diff.marks.get(z(k)) ?? null : void 0,
|
|
271
272
|
lastChange: L ? (k) => k.kind === "group" ? L[k.key] ?? null : null : void 0,
|
|
272
273
|
ghost: p,
|
|
273
|
-
resizeWidth: g ? void 0 : (k,
|
|
274
|
-
k.kind !== "field" && k.kind !== "slot" ||
|
|
274
|
+
resizeWidth: g ? void 0 : (k, O) => {
|
|
275
|
+
k.kind !== "field" && k.kind !== "slot" || P(
|
|
275
276
|
[
|
|
276
277
|
{
|
|
277
278
|
op: "update_placement",
|
|
278
279
|
at: { field: k.field, group_key: k.group_key },
|
|
279
|
-
patch: { col_span:
|
|
280
|
+
patch: { col_span: O === 12 ? null : O }
|
|
280
281
|
}
|
|
281
282
|
],
|
|
282
|
-
{ label: `Set the width to ${
|
|
283
|
+
{ label: `Set the width to ${Yr[O] ?? O}` }
|
|
283
284
|
);
|
|
284
285
|
}
|
|
285
286
|
}),
|
|
286
287
|
[
|
|
287
288
|
n,
|
|
288
|
-
|
|
289
|
+
fe,
|
|
289
290
|
t,
|
|
290
291
|
E,
|
|
291
292
|
M.inherited,
|
|
292
|
-
|
|
293
|
-
|
|
293
|
+
I,
|
|
294
|
+
J,
|
|
294
295
|
B,
|
|
295
296
|
c,
|
|
296
|
-
|
|
297
|
-
|
|
297
|
+
ye,
|
|
298
|
+
N,
|
|
298
299
|
te,
|
|
299
300
|
V,
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
301
|
+
he,
|
|
302
|
+
de,
|
|
303
|
+
h,
|
|
303
304
|
L,
|
|
304
305
|
p,
|
|
305
|
-
|
|
306
|
+
P,
|
|
306
307
|
g
|
|
307
308
|
]
|
|
308
|
-
), T =
|
|
309
|
+
), T = vo(u);
|
|
309
310
|
return /* @__PURE__ */ o("div", { ref: T, className: "flex min-h-full flex-col", children: /* @__PURE__ */ o(
|
|
310
|
-
|
|
311
|
+
oo,
|
|
311
312
|
{
|
|
312
313
|
collection: r,
|
|
313
314
|
bundle: ie,
|
|
314
|
-
layout:
|
|
315
|
+
layout: Oe,
|
|
315
316
|
record: Q,
|
|
316
317
|
stateKey: m,
|
|
317
318
|
roleId: i,
|
|
318
319
|
design: Ae,
|
|
319
|
-
apply:
|
|
320
|
-
whenIdle:
|
|
320
|
+
apply: P,
|
|
321
|
+
whenIdle: Te
|
|
321
322
|
}
|
|
322
323
|
) });
|
|
323
324
|
}
|
|
324
|
-
function
|
|
325
|
+
function Kn({
|
|
325
326
|
collection: r,
|
|
326
327
|
name: l,
|
|
327
328
|
row: s,
|
|
@@ -330,19 +331,19 @@ function Pn({
|
|
|
330
331
|
fields: d,
|
|
331
332
|
onDone: c
|
|
332
333
|
}) {
|
|
333
|
-
const v =
|
|
334
|
-
return g.length > 0 && typeof p == "number" && g.push({ text: ` (≈ ${p.toLocaleString()} ${p === 1 ? "record" : "records"})` }), u && g.push({ text: g.length > 0 ? `; ${u}` : u }), /* @__PURE__ */
|
|
334
|
+
const v = Wo(r, d, m), { data: p } = jo(r, s, m), u = bn(xn(i).data), g = s ? s.section === "forms" && (s.reason.kind === "default" || s.reason.kind === "fallback") ? [{ text: "used by every record no rule catches" }] : Go(s, d, v) : [];
|
|
335
|
+
return g.length > 0 && typeof p == "number" && g.push({ text: ` (≈ ${p.toLocaleString()} ${p === 1 ? "record" : "records"})` }), u && g.push({ text: g.length > 0 ? `; ${u}` : u }), /* @__PURE__ */ y(
|
|
335
336
|
"div",
|
|
336
337
|
{
|
|
337
338
|
"data-editing-banner": "",
|
|
338
339
|
className: "flex shrink-0 items-center gap-3 border-b border-nvr-cyan/30 bg-nvr-cyan/10 px-4 py-1.5 text-[12.5px] text-slate-700 dark:text-slate-200",
|
|
339
340
|
children: [
|
|
340
|
-
/* @__PURE__ */
|
|
341
|
+
/* @__PURE__ */ y("p", { className: "m-0 min-w-0 flex-1 truncate", children: [
|
|
341
342
|
"Editing ",
|
|
342
343
|
/* @__PURE__ */ o("b", { className: "font-semibold text-slate-900 dark:text-foreground", children: l }),
|
|
343
|
-
g.length > 0 && /* @__PURE__ */
|
|
344
|
+
g.length > 0 && /* @__PURE__ */ y(ae, { children: [
|
|
344
345
|
" — ",
|
|
345
|
-
/* @__PURE__ */ o(
|
|
346
|
+
/* @__PURE__ */ o(Qo, { segs: g, muted: !0 })
|
|
346
347
|
] })
|
|
347
348
|
] }),
|
|
348
349
|
/* @__PURE__ */ o(
|
|
@@ -358,8 +359,8 @@ function Pn({
|
|
|
358
359
|
}
|
|
359
360
|
);
|
|
360
361
|
}
|
|
361
|
-
function
|
|
362
|
-
const s = (i, m, d, c) => /* @__PURE__ */
|
|
362
|
+
function _n({ view: r, onView: l }) {
|
|
363
|
+
const s = (i, m, d, c) => /* @__PURE__ */ y(
|
|
363
364
|
"button",
|
|
364
365
|
{
|
|
365
366
|
type: "button",
|
|
@@ -368,37 +369,37 @@ function En({ view: r, onView: l }) {
|
|
|
368
369
|
"data-editor-view": i,
|
|
369
370
|
"data-tip": c,
|
|
370
371
|
onClick: () => l(i),
|
|
371
|
-
className: G(
|
|
372
|
+
className: G(Zo(r === i), "inline-flex items-center justify-center gap-1"),
|
|
372
373
|
children: [
|
|
373
374
|
/* @__PURE__ */ o(d, { className: "h-3.5 w-3.5 shrink-0" }),
|
|
374
375
|
/* @__PURE__ */ o("span", { "data-tb-xwide": "", children: m })
|
|
375
376
|
]
|
|
376
377
|
}
|
|
377
378
|
);
|
|
378
|
-
return /* @__PURE__ */
|
|
379
|
+
return /* @__PURE__ */ y(
|
|
379
380
|
"fieldset",
|
|
380
381
|
{
|
|
381
382
|
"aria-label": "Show the form as",
|
|
382
|
-
className: G("m-0 min-w-0 shrink-0 border-0",
|
|
383
|
+
className: G("m-0 min-w-0 shrink-0 border-0", Jo(4)),
|
|
383
384
|
children: [
|
|
384
|
-
s("canvas", "Canvas",
|
|
385
|
-
s("table", "Table",
|
|
385
|
+
s("canvas", "Canvas", dr, "The form as people see it"),
|
|
386
|
+
s("table", "Table", cr, "Every field as a row: label, section, width, rules"),
|
|
386
387
|
s(
|
|
387
388
|
"states",
|
|
388
389
|
"States",
|
|
389
|
-
|
|
390
|
+
ur,
|
|
390
391
|
"Every field by workflow state: editable, read-only, required"
|
|
391
392
|
),
|
|
392
|
-
s("roles", "Roles",
|
|
393
|
+
s("roles", "Roles", pr, "Every section by role: can edit, read-only, hidden")
|
|
393
394
|
]
|
|
394
395
|
}
|
|
395
396
|
);
|
|
396
397
|
}
|
|
397
|
-
const
|
|
398
|
+
const Ue = (r) => G(
|
|
398
399
|
"inline-flex h-7 items-center gap-1 rounded-md px-2.5 text-[12px] font-medium transition-colors",
|
|
399
400
|
r ? "bg-accent text-slate-900 dark:text-foreground" : "text-slate-500 hover:bg-muted hover:text-slate-800 dark:text-muted-foreground dark:hover:text-foreground"
|
|
400
401
|
);
|
|
401
|
-
function
|
|
402
|
+
function vs({
|
|
402
403
|
collection: r,
|
|
403
404
|
layoutId: l,
|
|
404
405
|
onBack: s,
|
|
@@ -408,83 +409,85 @@ function us({
|
|
|
408
409
|
portalContainer: c,
|
|
409
410
|
onDirtyChange: v
|
|
410
411
|
}) {
|
|
411
|
-
var
|
|
412
|
-
const p =
|
|
413
|
-
|
|
414
|
-
const Q =
|
|
412
|
+
var ut, pt, mt, ft, yt, ht;
|
|
413
|
+
const p = Co(), [u, g] = R(l);
|
|
414
|
+
U(() => g(l), [l]);
|
|
415
|
+
const Q = Ln(r), { draft: n, recorder: fe } = Ir(Sn(u, { onSaved: Q })), t = n.bundle, [E, te] = R("layouts"), [V, P] = R("inspector"), [Te, ye] = Lr(), [he, de] = R(null), [h, L] = R([]), re = h.length > 0 ? h[h.length - 1] : null, [I, se] = R("canvas"), [ve, ie] = R(!1), [M, Y] = kn(), { data: H } = wn(r, M), Oe = b(
|
|
415
416
|
() => M && H && H.total > 0 ? (e) => H.pct.get(e) ?? null : void 0,
|
|
416
417
|
[M, H]
|
|
417
|
-
), [
|
|
418
|
+
), [K, J] = R({
|
|
418
419
|
record: d ? { id: d, label: `#${d}` } : null,
|
|
419
420
|
roleId: null
|
|
420
|
-
}), { data:
|
|
421
|
+
}), { data: N } = Vo(r), { data: _ = [] } = Ho(r), B = N == null ? void 0 : N.rows.find((e) => e.layout_id === u), Ae = (t == null ? void 0 : t.layout.parent_layout_id) != null ? Number(t.layout.parent_layout_id) : null, { data: T = null } = Be(Ae), { data: k = null } = En(r, ((ut = K.record) == null ? void 0 : ut.id) ?? null), O = b(
|
|
421
422
|
() => t ? Nt(t, T).active : null,
|
|
422
423
|
[t, T]
|
|
423
|
-
)
|
|
424
|
-
|
|
424
|
+
);
|
|
425
|
+
wr(kt);
|
|
426
|
+
const ge = b(() => br(O), [O]), ke = Fo(r, t, T), { data: Lt } = Be(u), Z = Mr(t, Lt ?? null, n.unsavedCount, u), { data: Et } = So(u, t != null), [ze, Dt] = R([]), Ft = b(() => {
|
|
427
|
+
const e = Ar(ze), a = /* @__PURE__ */ new WeakMap();
|
|
425
428
|
return (f) => {
|
|
426
|
-
if (!f || !e) return
|
|
427
|
-
const
|
|
428
|
-
if (
|
|
429
|
-
const
|
|
430
|
-
return a.set(f,
|
|
429
|
+
if (!f || !e) return bt(f, e);
|
|
430
|
+
const w = a.get(f);
|
|
431
|
+
if (w) return w;
|
|
432
|
+
const F = bt(f, e);
|
|
433
|
+
return a.set(f, F), F;
|
|
431
434
|
};
|
|
432
|
-
}, [
|
|
433
|
-
|
|
434
|
-
const
|
|
435
|
-
const e =
|
|
436
|
-
...
|
|
437
|
-
...X ? { freeze_override:
|
|
435
|
+
}, [ze]), [ce, It] = mo(), we = go(r, O, ce), ue = ko(r, O, ce && !K.record), { data: le } = Be(u), X = vr(((pt = le == null ? void 0 : le.layout) == null ? void 0 : pt.conditions) ?? ((mt = t == null ? void 0 : t.layout) == null ? void 0 : mt.conditions)), D = xt(le == null ? void 0 : le.layout) ?? xt(t == null ? void 0 : t.layout) ?? (X ? "note" : null), [pe, Pe] = R({ reason: "", ticket: "" }), [Ve, He] = R(null), Ne = j(pe);
|
|
436
|
+
Ne.current = pe;
|
|
437
|
+
const We = C(async () => {
|
|
438
|
+
const e = D ? {
|
|
439
|
+
...qr(Ne.current),
|
|
440
|
+
...X ? { freeze_override: Ne.current.reason.trim() } : {}
|
|
438
441
|
} : void 0;
|
|
439
442
|
await n.save(e);
|
|
440
443
|
const a = n.unsavedOps().length === 0;
|
|
441
|
-
return a && e &&
|
|
442
|
-
}, [n.save, n.unsavedOps,
|
|
444
|
+
return a && e && Pe((f) => ({ ...f, reason: "" })), a;
|
|
445
|
+
}, [n.save, n.unsavedOps, D, X]), je = C(() => {
|
|
443
446
|
var e, a;
|
|
444
|
-
return
|
|
445
|
-
((e =
|
|
447
|
+
return D ? (n.unsavedOps().length > 0 && He(
|
|
448
|
+
((e = $.current) == null ? void 0 : e.querySelector("[data-editor-save]")) ?? ((a = $.current) == null ? void 0 : a.querySelector("[data-editor-topbar]")) ?? null
|
|
446
449
|
), Promise.resolve()) : n.save();
|
|
447
|
-
}, [
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
}, [
|
|
451
|
-
const
|
|
452
|
-
|
|
453
|
-
const
|
|
454
|
-
|
|
455
|
-
const
|
|
456
|
-
var
|
|
457
|
-
if (!
|
|
458
|
-
const
|
|
459
|
-
|
|
460
|
-
}, []),
|
|
461
|
-
|
|
450
|
+
}, [D, n.save, n.unsavedOps]);
|
|
451
|
+
U(() => {
|
|
452
|
+
D && n.autosave && n.setAutosave(!1);
|
|
453
|
+
}, [D, n.autosave, n.setAutosave]);
|
|
454
|
+
const Kt = D ? { ...n, save: je, setAutosave: void 0 } : n;
|
|
455
|
+
Pn(D ? { ...n, save: je } : n), Rn(n);
|
|
456
|
+
const $ = j(null), [_t, Ge] = R(null), Qe = j(n.dirty);
|
|
457
|
+
Qe.current = n.dirty;
|
|
458
|
+
const oe = C((e, a, f) => {
|
|
459
|
+
var F, me;
|
|
460
|
+
if (!Qe.current) return a();
|
|
461
|
+
const w = ((F = $.current) == null ? void 0 : F.querySelector("[data-editor-save]")) ?? ((me = $.current) == null ? void 0 : me.querySelector("[data-editor-topbar]")) ?? null;
|
|
462
|
+
Ge({ what: e, go: a, anchor: f ?? w });
|
|
463
|
+
}, []), Mt = We;
|
|
464
|
+
Dn(n.dirty, (e, a) => oe("leave this page", e, a)), U(() => {
|
|
462
465
|
v == null || v(n.dirty);
|
|
463
466
|
}, [n.dirty, v]);
|
|
464
|
-
const
|
|
465
|
-
|
|
467
|
+
const Ye = j(n.unsavedOps);
|
|
468
|
+
Ye.current = n.unsavedOps, U(
|
|
466
469
|
() => () => {
|
|
467
|
-
|
|
470
|
+
Ye.current().length > 0 && gt.warning("Unsaved form changes kept — open the form again to save or discard them");
|
|
468
471
|
},
|
|
469
472
|
[]
|
|
470
473
|
);
|
|
471
|
-
const Je =
|
|
474
|
+
const Je = Rt(r), Ze = C(() => {
|
|
472
475
|
const e = n.whenIdle();
|
|
473
476
|
e.then(() => Je()), s(e);
|
|
474
477
|
}, [n.whenIdle, Je, s]), Re = C(
|
|
475
|
-
(e) =>
|
|
476
|
-
[
|
|
478
|
+
(e) => oe(i === "overlay" ? "go back to the record" : "leave this form", Ze, e),
|
|
479
|
+
[oe, Ze, i]
|
|
477
480
|
);
|
|
478
|
-
|
|
479
|
-
if (!t ||
|
|
480
|
-
const e =
|
|
481
|
-
e.length !==
|
|
482
|
-
}, [
|
|
483
|
-
const
|
|
484
|
-
|
|
485
|
-
}, []),
|
|
486
|
-
L((f) =>
|
|
487
|
-
}, []),
|
|
481
|
+
U(() => {
|
|
482
|
+
if (!t || h.length === 0) return;
|
|
483
|
+
const e = h.filter((a) => qe(a, t, T));
|
|
484
|
+
e.length !== h.length && L(e);
|
|
485
|
+
}, [h, t, T]);
|
|
486
|
+
const ne = i === "overlay", [Le, Bt] = R(null), Ee = j(!1), qt = C((e) => {
|
|
487
|
+
Ee.current = e;
|
|
488
|
+
}, []), Ut = Fn(ne && Le != null, () => Re(), Ee), A = C((e, a) => {
|
|
489
|
+
L((f) => Qr(f, e, a)), P("inspector");
|
|
490
|
+
}, []), Xe = C((e) => L([e]), []), q = io(t, n.apply), $t = b(() => q.intercept(A), [q.intercept, A]), [De, zt] = R(!1), Fe = co(), Ie = b(
|
|
488
491
|
() => ({
|
|
489
492
|
tabOrderActive: q.active,
|
|
490
493
|
startTabOrder: () => {
|
|
@@ -492,188 +495,188 @@ function us({
|
|
|
492
495
|
}
|
|
493
496
|
}),
|
|
494
497
|
[q.active, q.start]
|
|
495
|
-
),
|
|
498
|
+
), et = C(
|
|
496
499
|
(e, a) => {
|
|
497
500
|
if (e.kind === "group") return A({ kind: "group", key: e.key });
|
|
498
501
|
if (e.kind === "tab") {
|
|
499
|
-
A(a), (a.kind === "field" || a.kind === "header") &&
|
|
502
|
+
A(a), (a.kind === "field" || a.kind === "header") && Po(a.field, e.tab);
|
|
500
503
|
return;
|
|
501
504
|
}
|
|
502
505
|
if (e.kind === "pipeline")
|
|
503
|
-
return
|
|
506
|
+
return oe(
|
|
504
507
|
"open the pipeline",
|
|
505
508
|
() => p.navigate(`/pipelines/${encodeURIComponent(e.id)}`)
|
|
506
509
|
);
|
|
507
|
-
|
|
510
|
+
oe(
|
|
508
511
|
"open the field rules",
|
|
509
512
|
() => p.navigate(`/data-model/${encodeURIComponent(r)}?tab=rules`)
|
|
510
513
|
);
|
|
511
514
|
},
|
|
512
|
-
[A,
|
|
513
|
-
),
|
|
515
|
+
[A, oe, p, r]
|
|
516
|
+
), Vt = b(() => {
|
|
514
517
|
const e = /* @__PURE__ */ new Map();
|
|
515
|
-
for (const [a, f] of
|
|
518
|
+
for (const [a, f] of ue)
|
|
516
519
|
(f.type === "boolean" || f.text.endsWith(" linked")) && e.set(a, f.text);
|
|
517
|
-
return
|
|
518
|
-
}, [
|
|
519
|
-
() =>
|
|
520
|
+
return fo(we, { chips: ce, ghostTags: e, open: et });
|
|
521
|
+
}, [we, ce, ue, et]), Ht = b(
|
|
522
|
+
() => ue.size > 0 ? (e) => {
|
|
520
523
|
var a;
|
|
521
|
-
return ((a =
|
|
524
|
+
return ((a = ue.get(e)) == null ? void 0 : a.text) ?? null;
|
|
522
525
|
} : void 0,
|
|
523
|
-
[
|
|
524
|
-
),
|
|
526
|
+
[ue]
|
|
527
|
+
), Wt = C(
|
|
525
528
|
(e) => {
|
|
526
|
-
const a = t == null ? void 0 : t.placements.find((
|
|
529
|
+
const a = t == null ? void 0 : t.placements.find((w) => w.field === e);
|
|
527
530
|
if (!a) return;
|
|
528
|
-
const f = a.group_key ===
|
|
531
|
+
const f = a.group_key === Pt ? { kind: "header", field: e } : { kind: "field", field: e, group_key: a.group_key };
|
|
529
532
|
A(f), requestAnimationFrame(
|
|
530
533
|
() => {
|
|
531
|
-
var
|
|
532
|
-
return (
|
|
534
|
+
var w, F;
|
|
535
|
+
return (F = (w = document.querySelector(`[data-layout-editor] [data-design-target="${CSS.escape(z(f))}"]`)) == null ? void 0 : w.scrollIntoView) == null ? void 0 : F.call(w, { block: "center" });
|
|
533
536
|
}
|
|
534
537
|
);
|
|
535
538
|
},
|
|
536
539
|
[t, A]
|
|
537
540
|
);
|
|
538
|
-
|
|
539
|
-
const Ke =
|
|
540
|
-
(e) => (
|
|
541
|
+
Nn(t, h, n.apply, Ee, Xe);
|
|
542
|
+
const Ke = Xo(u, re ? z(re) : null), tt = b(() => en(Ke), [Ke]), jt = C(
|
|
543
|
+
(e) => (tt.get(z(e)) ?? []).map((a) => ({
|
|
541
544
|
id: a.id,
|
|
542
545
|
name: a.name,
|
|
543
546
|
outline: a.tone.outline,
|
|
544
547
|
chip: a.tone.chip
|
|
545
548
|
})),
|
|
546
|
-
[
|
|
547
|
-
),
|
|
548
|
-
se("canvas"), L([e]),
|
|
549
|
+
[tt]
|
|
550
|
+
), rt = b(() => vn(n.unsavedSteps), [n.unsavedSteps]), Gt = C((e) => rt.has(z(e)), [rt]), [ot, be] = R(null), nt = C((e) => {
|
|
551
|
+
se("canvas"), L([e]), P("inspector"), requestAnimationFrame(() => {
|
|
549
552
|
var f;
|
|
550
553
|
const a = document.querySelector(
|
|
551
554
|
`[data-layout-editor] [data-design-target="${CSS.escape(z(e))}"]`
|
|
552
555
|
);
|
|
553
556
|
(f = a == null ? void 0 : a.scrollIntoView) == null || f.call(a, { block: "center" }), a == null || a.focus({ preventScroll: !0 });
|
|
554
557
|
});
|
|
555
|
-
}, []),
|
|
558
|
+
}, []), Qt = kr(), W = un(u), at = pn(), Yt = b(
|
|
556
559
|
() => {
|
|
557
560
|
var e, a;
|
|
558
561
|
return {
|
|
559
562
|
settled: W.isFetched || W.isError,
|
|
560
563
|
draft: ((e = W.data) == null ? void 0 : e.data) ?? null,
|
|
561
564
|
available: ((a = W.data) == null ? void 0 : a.available) ?? !W.isError,
|
|
562
|
-
writer:
|
|
565
|
+
writer: at
|
|
563
566
|
};
|
|
564
567
|
},
|
|
565
|
-
[W.isFetched, W.isError, W.data,
|
|
566
|
-
),
|
|
567
|
-
(e) =>
|
|
568
|
+
[W.isFetched, W.isError, W.data, at]
|
|
569
|
+
), xe = eo(n, u, Qt, Yt), Jt = C(
|
|
570
|
+
(e) => J((a) => a.roleId === e ? a : { ...a, roleId: e }),
|
|
568
571
|
[]
|
|
569
572
|
), ee = (e) => {
|
|
570
|
-
var
|
|
571
|
-
if (
|
|
572
|
-
const a = document.activeElement, f = a instanceof HTMLElement && ((
|
|
573
|
-
|
|
573
|
+
var w;
|
|
574
|
+
if (P("inspector"), e === u) return;
|
|
575
|
+
const a = document.activeElement, f = a instanceof HTMLElement && ((w = $.current) != null && w.contains(a)) ? a : null;
|
|
576
|
+
oe(
|
|
574
577
|
"open another form",
|
|
575
578
|
() => {
|
|
576
579
|
n.flush(), L([]), g(e), m == null || m(e);
|
|
577
580
|
},
|
|
578
581
|
f
|
|
579
582
|
);
|
|
580
|
-
},
|
|
581
|
-
(e) => t ?
|
|
583
|
+
}, Zt = nn(r, t, (N == null ? void 0 : N.rows) ?? [], ee), Xt = C(
|
|
584
|
+
(e) => t ? Er(e, {
|
|
582
585
|
bundle: t,
|
|
583
|
-
selection:
|
|
586
|
+
selection: h,
|
|
584
587
|
select: (a) => {
|
|
585
|
-
L([a]),
|
|
588
|
+
L([a]), P("inspector");
|
|
586
589
|
},
|
|
587
|
-
openSettings: () =>
|
|
590
|
+
openSettings: () => P("settings"),
|
|
588
591
|
openAddPanel: () => te("add"),
|
|
589
|
-
root:
|
|
592
|
+
root: $.current
|
|
590
593
|
}) : Promise.resolve({ ok: !1, message: "The form is still loading" }),
|
|
591
|
-
[t,
|
|
592
|
-
),
|
|
593
|
-
|
|
594
|
-
const
|
|
594
|
+
[t, h]
|
|
595
|
+
), st = j(ee);
|
|
596
|
+
st.current = ee;
|
|
597
|
+
const er = C(
|
|
595
598
|
(e) => {
|
|
596
599
|
if (e.kind === "record")
|
|
597
|
-
|
|
598
|
-
else if (e.kind === "layout")
|
|
600
|
+
J((a) => ({ ...a, record: { id: e.id, label: `#${e.id}` } }));
|
|
601
|
+
else if (e.kind === "layout") st.current(e.id);
|
|
599
602
|
else {
|
|
600
|
-
const a = t == null ? void 0 : t.placements.find((
|
|
601
|
-
if (!a) return
|
|
603
|
+
const a = t == null ? void 0 : t.placements.find((w) => w.field === e.field);
|
|
604
|
+
if (!a) return gt.info(`${e.label} is not on this form`);
|
|
602
605
|
const f = { kind: "field", field: a.field, group_key: a.group_key };
|
|
603
606
|
A(f), requestAnimationFrame(
|
|
604
607
|
() => {
|
|
605
|
-
var
|
|
606
|
-
return (
|
|
608
|
+
var w, F, me;
|
|
609
|
+
return (me = (F = (w = $.current) == null ? void 0 : w.querySelector(`[data-design-target="${CSS.escape(z(f))}"]`)) == null ? void 0 : F.scrollIntoView) == null ? void 0 : me.call(F, { block: "center" });
|
|
607
610
|
}
|
|
608
611
|
);
|
|
609
612
|
}
|
|
610
613
|
},
|
|
611
614
|
[t, A]
|
|
612
|
-
),
|
|
613
|
-
bodyRef:
|
|
615
|
+
), Se = String((t == null ? void 0 : t.layout.name) ?? (B == null ? void 0 : B.name) ?? ""), _e = String((t == null ? void 0 : t.layout.layout_type) ?? (B == null ? void 0 : B.layout_type) ?? "grouped"), x = _e !== "table" && _e !== "file", S = $o({
|
|
616
|
+
bodyRef: $,
|
|
614
617
|
bundle: t,
|
|
615
618
|
parent: T,
|
|
616
619
|
fields: _,
|
|
617
620
|
onSelect: A,
|
|
618
|
-
showHidden:
|
|
621
|
+
showHidden: ve,
|
|
619
622
|
setShowHidden: ie,
|
|
620
|
-
canvasShown: !(
|
|
621
|
-
}),
|
|
623
|
+
canvasShown: !(x && I === "table")
|
|
624
|
+
}), it = S.outlineOpen && !!t && x, lt = p.warning ?? (N == null ? void 0 : N.warning) ?? null, tr = ne ? {
|
|
622
625
|
role: "dialog",
|
|
623
626
|
"aria-modal": !0,
|
|
624
|
-
"aria-label": `Edit form ${
|
|
627
|
+
"aria-label": `Edit form ${Se}`,
|
|
625
628
|
tabIndex: -1
|
|
626
|
-
} : {},
|
|
629
|
+
} : {}, dt = /* @__PURE__ */ y(
|
|
627
630
|
"div",
|
|
628
631
|
{
|
|
629
632
|
ref: (e) => {
|
|
630
|
-
|
|
633
|
+
$.current = e, ne && (Ut.current = e);
|
|
631
634
|
},
|
|
632
635
|
"data-layout-editor": "",
|
|
633
636
|
"data-mode": i,
|
|
634
|
-
...
|
|
637
|
+
...tr,
|
|
635
638
|
className: G(
|
|
636
639
|
"flex min-h-0 flex-col bg-slate-50 outline-none dark:bg-background",
|
|
637
|
-
|
|
640
|
+
ne ? "fixed inset-0 z-[90]" : "flex-1"
|
|
638
641
|
),
|
|
639
642
|
children: [
|
|
640
643
|
/* @__PURE__ */ o(
|
|
641
|
-
|
|
644
|
+
no,
|
|
642
645
|
{
|
|
643
646
|
collection: r,
|
|
644
647
|
layoutId: u,
|
|
645
|
-
layoutName:
|
|
646
|
-
layoutType:
|
|
648
|
+
layoutName: Se,
|
|
649
|
+
layoutType: _e,
|
|
647
650
|
row: B,
|
|
648
651
|
fields: _,
|
|
649
|
-
draft:
|
|
650
|
-
preview:
|
|
651
|
-
onPreview:
|
|
652
|
-
showHidden:
|
|
652
|
+
draft: Kt,
|
|
653
|
+
preview: K,
|
|
654
|
+
onPreview: J,
|
|
655
|
+
showHidden: ve,
|
|
653
656
|
onShowHidden: ie,
|
|
654
657
|
onBack: Re,
|
|
655
|
-
backLabel:
|
|
658
|
+
backLabel: ne ? "Back to record" : "Forms",
|
|
656
659
|
onShowOnCanvas: Z.showVersion,
|
|
657
660
|
onReviewChanges: Z.toggleReview,
|
|
658
|
-
reviewing: ((
|
|
661
|
+
reviewing: ((ft = Z.compare) == null ? void 0 : ft.kind) === "unsaved",
|
|
659
662
|
onOpenUnsaved: be,
|
|
660
|
-
pendingTip:
|
|
661
|
-
presence: /* @__PURE__ */
|
|
663
|
+
pendingTip: to(xe.sync),
|
|
664
|
+
presence: /* @__PURE__ */ y(ae, { children: [
|
|
662
665
|
/* @__PURE__ */ o(
|
|
663
|
-
|
|
666
|
+
Vr,
|
|
664
667
|
{
|
|
665
668
|
peers: Ke,
|
|
666
669
|
describe: (e) => {
|
|
667
|
-
const a =
|
|
668
|
-
return a && t &&
|
|
670
|
+
const a = Tt(e);
|
|
671
|
+
return a && t && qe(a, t, T) ? Ot(a, t, _) : null;
|
|
669
672
|
},
|
|
670
673
|
onJump: (e) => {
|
|
671
|
-
const a =
|
|
672
|
-
a &&
|
|
674
|
+
const a = Tt(e);
|
|
675
|
+
a && nt(a);
|
|
673
676
|
}
|
|
674
677
|
}
|
|
675
678
|
),
|
|
676
|
-
/* @__PURE__ */ o(
|
|
679
|
+
/* @__PURE__ */ o(an, { others: ((yt = W.data) == null ? void 0 : yt.others) ?? [] })
|
|
677
680
|
] }),
|
|
678
681
|
onSelectField: (e) => {
|
|
679
682
|
var a;
|
|
@@ -683,84 +686,84 @@ function us({
|
|
|
683
686
|
group_key: ((a = t == null ? void 0 : t.placements.find((f) => f.field === e)) == null ? void 0 : a.group_key) ?? null
|
|
684
687
|
});
|
|
685
688
|
},
|
|
686
|
-
view: t &&
|
|
687
|
-
/* @__PURE__ */ o(
|
|
688
|
-
/* @__PURE__ */ o(
|
|
689
|
+
view: t && x ? /* @__PURE__ */ y(ae, { children: [
|
|
690
|
+
/* @__PURE__ */ o(_n, { view: I, onView: se }),
|
|
691
|
+
/* @__PURE__ */ o(yo, { on: ce, onChange: It })
|
|
689
692
|
] }) : null,
|
|
690
|
-
tools: /* @__PURE__ */
|
|
691
|
-
t &&
|
|
692
|
-
t && /* @__PURE__ */ o(
|
|
693
|
-
t &&
|
|
694
|
-
t &&
|
|
695
|
-
/* @__PURE__ */ o(
|
|
693
|
+
tools: /* @__PURE__ */ y(ae, { children: [
|
|
694
|
+
t && x && /* @__PURE__ */ o(Tr, { bundle: t, apply: n.apply }),
|
|
695
|
+
t && /* @__PURE__ */ o(_o, { find: S.find }),
|
|
696
|
+
t && x && /* @__PURE__ */ o(wo, { bundle: t, apply: n.apply, collection: r }),
|
|
697
|
+
t && x && /* @__PURE__ */ o(bo, { bundle: t, apply: n.apply, collection: r }),
|
|
698
|
+
/* @__PURE__ */ o(Ce, {}),
|
|
696
699
|
t && /* @__PURE__ */ o(
|
|
697
|
-
|
|
700
|
+
Mo,
|
|
698
701
|
{
|
|
699
|
-
outline:
|
|
700
|
-
open:
|
|
701
|
-
onToggle: () =>
|
|
702
|
+
outline: x ? {
|
|
703
|
+
open: S.outlineOpen,
|
|
704
|
+
onToggle: () => S.setOutlineOpen(!S.outlineOpen)
|
|
702
705
|
} : null
|
|
703
706
|
}
|
|
704
707
|
),
|
|
705
708
|
t && /* @__PURE__ */ o(
|
|
706
|
-
|
|
709
|
+
Bo,
|
|
707
710
|
{
|
|
708
|
-
view:
|
|
709
|
-
compact:
|
|
710
|
-
onCompact:
|
|
711
|
-
onExpandAll:
|
|
712
|
-
onCollapseAll:
|
|
711
|
+
view: x && I === "canvas" ? {
|
|
712
|
+
compact: S.compact,
|
|
713
|
+
onCompact: S.setCompact,
|
|
714
|
+
onExpandAll: S.expandAll,
|
|
715
|
+
onCollapseAll: S.collapseAll
|
|
713
716
|
} : null
|
|
714
717
|
}
|
|
715
718
|
),
|
|
716
|
-
t &&
|
|
717
|
-
|
|
719
|
+
t && x && /* @__PURE__ */ o(
|
|
720
|
+
Ct,
|
|
718
721
|
{
|
|
719
722
|
label: "Show how full each field is",
|
|
720
|
-
icon: /* @__PURE__ */ o(
|
|
723
|
+
icon: /* @__PURE__ */ o(nr, { className: "h-3.5 w-3.5" }),
|
|
721
724
|
hint: "The share of records with a value, on each field",
|
|
722
725
|
checked: M,
|
|
723
|
-
onClick: () =>
|
|
726
|
+
onClick: () => Y(!M),
|
|
724
727
|
data: { "data-editor-fill-toggle": "" }
|
|
725
728
|
}
|
|
726
729
|
),
|
|
727
|
-
t &&
|
|
728
|
-
|
|
730
|
+
t && x && /* @__PURE__ */ o(
|
|
731
|
+
Ct,
|
|
729
732
|
{
|
|
730
733
|
label: "Set the tab order",
|
|
731
|
-
icon: /* @__PURE__ */ o(
|
|
734
|
+
icon: /* @__PURE__ */ o(ar, { className: "h-3.5 w-3.5" }),
|
|
732
735
|
hint: "Click fields in the order Tab should visit them",
|
|
733
736
|
checked: q.active,
|
|
734
737
|
onClick: () => q.active ? q.cancel() : Ie.startTabOrder(),
|
|
735
738
|
data: { "data-editor-tab-order-toggle": "" }
|
|
736
739
|
}
|
|
737
740
|
),
|
|
738
|
-
t &&
|
|
739
|
-
|
|
741
|
+
t && x && /* @__PURE__ */ o(
|
|
742
|
+
uo,
|
|
740
743
|
{
|
|
741
|
-
on:
|
|
742
|
-
onChange:
|
|
744
|
+
on: De,
|
|
745
|
+
onChange: zt,
|
|
743
746
|
appDark: Fe,
|
|
744
|
-
disabled:
|
|
747
|
+
disabled: I !== "canvas"
|
|
745
748
|
}
|
|
746
749
|
),
|
|
747
|
-
/* @__PURE__ */ o(
|
|
750
|
+
/* @__PURE__ */ o(Ce, {}),
|
|
748
751
|
/* @__PURE__ */ o(
|
|
749
|
-
|
|
752
|
+
Fr,
|
|
750
753
|
{
|
|
751
754
|
collection: r,
|
|
752
755
|
layoutId: u,
|
|
753
756
|
dirty: n.dirty,
|
|
754
|
-
recorder:
|
|
757
|
+
recorder: fe
|
|
755
758
|
}
|
|
756
759
|
),
|
|
757
|
-
/* @__PURE__ */ o(
|
|
758
|
-
/* @__PURE__ */ o(
|
|
759
|
-
t && /* @__PURE__ */ o(
|
|
760
|
+
/* @__PURE__ */ o(xo, { bundle: t, collection: r }),
|
|
761
|
+
/* @__PURE__ */ o(Ce, {}),
|
|
762
|
+
t && /* @__PURE__ */ o(qo, { shortcuts: S.shortcuts })
|
|
760
763
|
] }),
|
|
761
|
-
ai: /* @__PURE__ */
|
|
762
|
-
t &&
|
|
763
|
-
|
|
764
|
+
ai: /* @__PURE__ */ y(ae, { children: [
|
|
765
|
+
t && x && /* @__PURE__ */ o(
|
|
766
|
+
Pr,
|
|
764
767
|
{
|
|
765
768
|
collection: r,
|
|
766
769
|
layoutId: u,
|
|
@@ -769,30 +772,30 @@ function us({
|
|
|
769
772
|
}
|
|
770
773
|
),
|
|
771
774
|
t && /* @__PURE__ */ o(
|
|
772
|
-
|
|
775
|
+
Or,
|
|
773
776
|
{
|
|
774
777
|
collection: r,
|
|
775
778
|
layoutId: u,
|
|
776
779
|
bundle: t,
|
|
777
780
|
apply: n.apply,
|
|
778
|
-
previewRecordShown:
|
|
779
|
-
onPins:
|
|
781
|
+
previewRecordShown: K.record != null,
|
|
782
|
+
onPins: Dt,
|
|
780
783
|
onSelect: A
|
|
781
784
|
}
|
|
782
785
|
),
|
|
783
|
-
/* @__PURE__ */ o(
|
|
786
|
+
/* @__PURE__ */ o(Ce, {}),
|
|
784
787
|
t && p.isAdmin && /* @__PURE__ */ o(
|
|
785
|
-
|
|
788
|
+
Nr,
|
|
786
789
|
{
|
|
787
790
|
active: V === "ask",
|
|
788
|
-
onClick: () =>
|
|
791
|
+
onClick: () => P((e) => e === "ask" ? "inspector" : "ask")
|
|
789
792
|
}
|
|
790
793
|
),
|
|
791
|
-
/* @__PURE__ */ o(
|
|
792
|
-
t && /* @__PURE__ */ o(
|
|
794
|
+
/* @__PURE__ */ o(Gr, { collection: r, layoutId: u, draft: n }),
|
|
795
|
+
t && /* @__PURE__ */ o(Dr, { layoutId: u, draft: n })
|
|
793
796
|
] }),
|
|
794
797
|
testing: t ? /* @__PURE__ */ o(
|
|
795
|
-
|
|
798
|
+
fn,
|
|
796
799
|
{
|
|
797
800
|
collection: r,
|
|
798
801
|
layoutId: u,
|
|
@@ -804,7 +807,7 @@ function us({
|
|
|
804
807
|
}
|
|
805
808
|
) : null,
|
|
806
809
|
beforeSave: t ? /* @__PURE__ */ o(
|
|
807
|
-
|
|
810
|
+
mn,
|
|
808
811
|
{
|
|
809
812
|
collection: r,
|
|
810
813
|
layoutId: u,
|
|
@@ -815,63 +818,66 @@ function us({
|
|
|
815
818
|
fields: _
|
|
816
819
|
}
|
|
817
820
|
) : null,
|
|
818
|
-
previewExtra: /* @__PURE__ */
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
821
|
+
previewExtra: /* @__PURE__ */ y(ae, { children: [
|
|
822
|
+
/* @__PURE__ */ o(
|
|
823
|
+
tn,
|
|
824
|
+
{
|
|
825
|
+
collection: r,
|
|
826
|
+
value: K,
|
|
827
|
+
onChange: J,
|
|
828
|
+
layout: O,
|
|
829
|
+
fields: _
|
|
830
|
+
}
|
|
831
|
+
),
|
|
832
|
+
/* @__PURE__ */ o(xr, { scope: kt, options: ge })
|
|
833
|
+
] }),
|
|
828
834
|
problems: t && /* @__PURE__ */ o(
|
|
829
|
-
|
|
835
|
+
Eo,
|
|
830
836
|
{
|
|
831
|
-
findings:
|
|
837
|
+
findings: ke.findings,
|
|
832
838
|
active: V === "checks",
|
|
833
|
-
onClick: () =>
|
|
839
|
+
onClick: () => P((e) => e === "checks" ? "inspector" : "checks")
|
|
834
840
|
}
|
|
835
841
|
),
|
|
836
842
|
more: /* @__PURE__ */ o(
|
|
837
|
-
|
|
843
|
+
on,
|
|
838
844
|
{
|
|
839
845
|
collection: r,
|
|
840
846
|
bundle: t,
|
|
841
|
-
previewRecord:
|
|
847
|
+
previewRecord: K.record,
|
|
842
848
|
onOpenLayout: ee
|
|
843
849
|
}
|
|
844
850
|
)
|
|
845
851
|
}
|
|
846
852
|
),
|
|
847
|
-
|
|
848
|
-
|
|
853
|
+
ne && /* @__PURE__ */ o(
|
|
854
|
+
Kn,
|
|
849
855
|
{
|
|
850
856
|
collection: r,
|
|
851
857
|
layoutId: u,
|
|
852
|
-
name:
|
|
858
|
+
name: Se,
|
|
853
859
|
row: B,
|
|
854
|
-
rows: (
|
|
860
|
+
rows: (N == null ? void 0 : N.rows) ?? [],
|
|
855
861
|
fields: _,
|
|
856
862
|
onDone: Re
|
|
857
863
|
}
|
|
858
864
|
),
|
|
859
|
-
n.status === "conflict" && n.dirty && /* @__PURE__ */
|
|
865
|
+
n.status === "conflict" && n.dirty && /* @__PURE__ */ y(
|
|
860
866
|
"div",
|
|
861
867
|
{
|
|
862
868
|
role: "alert",
|
|
863
869
|
"data-unsaved-conflict": "",
|
|
864
870
|
className: G(
|
|
865
871
|
"flex shrink-0 items-center gap-3 border-b px-4 py-1.5 text-[12.5px]",
|
|
866
|
-
|
|
872
|
+
Me
|
|
867
873
|
),
|
|
868
874
|
children: [
|
|
869
|
-
/* @__PURE__ */ o(
|
|
870
|
-
/* @__PURE__ */
|
|
875
|
+
/* @__PURE__ */ o(vt, { className: "h-3.5 w-3.5 shrink-0" }),
|
|
876
|
+
/* @__PURE__ */ y("p", { className: "m-0 min-w-0 flex-1", children: [
|
|
871
877
|
n.error ?? "Someone else saved this form",
|
|
872
878
|
". Save again to try once more, or reload their version."
|
|
873
879
|
] }),
|
|
874
|
-
/* @__PURE__ */
|
|
880
|
+
/* @__PURE__ */ y(
|
|
875
881
|
"button",
|
|
876
882
|
{
|
|
877
883
|
type: "button",
|
|
@@ -880,7 +886,7 @@ function us({
|
|
|
880
886
|
className: "inline-flex h-7 shrink-0 items-center rounded-md border border-amber-300 px-2.5 text-[12px] font-medium hover:bg-amber-100 dark:border-amber-500/40 dark:hover:bg-amber-500/15",
|
|
881
887
|
children: [
|
|
882
888
|
"Reload (discard my ",
|
|
883
|
-
|
|
889
|
+
yn(n.unsavedCount),
|
|
884
890
|
")"
|
|
885
891
|
]
|
|
886
892
|
}
|
|
@@ -888,62 +894,62 @@ function us({
|
|
|
888
894
|
]
|
|
889
895
|
}
|
|
890
896
|
),
|
|
891
|
-
/* @__PURE__ */ o(
|
|
897
|
+
/* @__PURE__ */ o(Hr, { labels: n.dropped, onDismiss: n.clearDropped }),
|
|
892
898
|
/* @__PURE__ */ o(
|
|
893
|
-
|
|
899
|
+
Wr,
|
|
894
900
|
{
|
|
895
|
-
state:
|
|
896
|
-
onRecover:
|
|
897
|
-
onDismiss:
|
|
901
|
+
state: xe.state,
|
|
902
|
+
onRecover: xe.recover,
|
|
903
|
+
onDismiss: xe.dismiss
|
|
898
904
|
}
|
|
899
905
|
),
|
|
900
|
-
|
|
906
|
+
lt && /* @__PURE__ */ y(
|
|
901
907
|
"div",
|
|
902
908
|
{
|
|
903
909
|
role: "note",
|
|
904
910
|
className: G(
|
|
905
911
|
"flex shrink-0 items-center gap-2 border-b px-4 py-1.5 text-[12.5px]",
|
|
906
|
-
|
|
912
|
+
Me
|
|
907
913
|
),
|
|
908
914
|
children: [
|
|
909
|
-
/* @__PURE__ */ o(
|
|
910
|
-
|
|
915
|
+
/* @__PURE__ */ o(vt, { className: "h-3.5 w-3.5 shrink-0" }),
|
|
916
|
+
lt
|
|
911
917
|
]
|
|
912
918
|
}
|
|
913
919
|
),
|
|
914
|
-
X && /* @__PURE__ */
|
|
920
|
+
X && /* @__PURE__ */ y(
|
|
915
921
|
"div",
|
|
916
922
|
{
|
|
917
923
|
role: "note",
|
|
918
924
|
"data-editor-frozen": X.until,
|
|
919
925
|
className: G(
|
|
920
926
|
"flex shrink-0 items-center gap-2 border-b px-4 py-1.5 text-[12.5px]",
|
|
921
|
-
|
|
927
|
+
Me
|
|
922
928
|
),
|
|
923
929
|
children: [
|
|
924
|
-
/* @__PURE__ */ o(
|
|
925
|
-
|
|
930
|
+
/* @__PURE__ */ o(sr, { className: "h-3.5 w-3.5 shrink-0" }),
|
|
931
|
+
At(X)
|
|
926
932
|
]
|
|
927
933
|
}
|
|
928
934
|
),
|
|
929
|
-
/* @__PURE__ */ o(
|
|
935
|
+
/* @__PURE__ */ o(ho, { explain: we, onShow: Wt }),
|
|
930
936
|
/* @__PURE__ */ o(
|
|
931
|
-
|
|
937
|
+
Jr,
|
|
932
938
|
{
|
|
933
939
|
bundle: t,
|
|
934
940
|
apply: n.apply,
|
|
935
|
-
onDragActive:
|
|
936
|
-
onDropOnLayout:
|
|
937
|
-
children: /* @__PURE__ */
|
|
938
|
-
/* @__PURE__ */
|
|
941
|
+
onDragActive: qt,
|
|
942
|
+
onDropOnLayout: Zt,
|
|
943
|
+
children: /* @__PURE__ */ y("div", { className: "flex min-h-0 flex-1 overflow-hidden", children: [
|
|
944
|
+
/* @__PURE__ */ y(
|
|
939
945
|
"aside",
|
|
940
946
|
{
|
|
941
947
|
className: G(
|
|
942
948
|
"flex w-[260px] shrink-0 flex-col border-r border-slate-200 bg-white dark:border-border dark:bg-card",
|
|
943
|
-
|
|
949
|
+
it && "hidden"
|
|
944
950
|
),
|
|
945
951
|
children: [
|
|
946
|
-
/* @__PURE__ */
|
|
952
|
+
/* @__PURE__ */ y(
|
|
947
953
|
"div",
|
|
948
954
|
{
|
|
949
955
|
role: "tablist",
|
|
@@ -957,41 +963,41 @@ function us({
|
|
|
957
963
|
role: "tab",
|
|
958
964
|
"aria-selected": E === "layouts",
|
|
959
965
|
"data-editor-tab": "layouts",
|
|
960
|
-
className:
|
|
966
|
+
className: Ue(E === "layouts"),
|
|
961
967
|
onClick: () => te("layouts"),
|
|
962
968
|
children: "Forms"
|
|
963
969
|
}
|
|
964
970
|
),
|
|
965
|
-
/* @__PURE__ */
|
|
971
|
+
/* @__PURE__ */ y(
|
|
966
972
|
"button",
|
|
967
973
|
{
|
|
968
974
|
type: "button",
|
|
969
975
|
role: "tab",
|
|
970
976
|
"aria-selected": E === "add",
|
|
971
977
|
"data-editor-tab": "add",
|
|
972
|
-
className:
|
|
978
|
+
className: Ue(E === "add"),
|
|
973
979
|
onClick: () => te("add"),
|
|
974
980
|
disabled: !t,
|
|
975
981
|
"data-tip": "Add a field, section, panel or widget after the selection",
|
|
976
982
|
children: [
|
|
977
|
-
/* @__PURE__ */ o(
|
|
983
|
+
/* @__PURE__ */ o(ir, { className: "h-3.5 w-3.5" }),
|
|
978
984
|
"Add"
|
|
979
985
|
]
|
|
980
986
|
}
|
|
981
987
|
),
|
|
982
|
-
/* @__PURE__ */
|
|
988
|
+
/* @__PURE__ */ y(
|
|
983
989
|
"button",
|
|
984
990
|
{
|
|
985
991
|
type: "button",
|
|
986
992
|
role: "tab",
|
|
987
993
|
"aria-selected": E === "usage",
|
|
988
994
|
"data-editor-tab": "usage",
|
|
989
|
-
className:
|
|
995
|
+
className: Ue(E === "usage"),
|
|
990
996
|
onClick: () => te("usage"),
|
|
991
997
|
disabled: !t,
|
|
992
998
|
"data-tip": "How this form is used and where it slows people down",
|
|
993
999
|
children: [
|
|
994
|
-
/* @__PURE__ */ o(
|
|
1000
|
+
/* @__PURE__ */ o(lr, { className: "h-3.5 w-3.5" }),
|
|
995
1001
|
"Usage"
|
|
996
1002
|
]
|
|
997
1003
|
}
|
|
@@ -1000,7 +1006,7 @@ function us({
|
|
|
1000
1006
|
}
|
|
1001
1007
|
),
|
|
1002
1008
|
/* @__PURE__ */ o("div", { className: "min-h-0 flex-1 overflow-y-auto", children: E === "add" && t ? /* @__PURE__ */ o(
|
|
1003
|
-
|
|
1009
|
+
Cr,
|
|
1004
1010
|
{
|
|
1005
1011
|
bundle: t,
|
|
1006
1012
|
collection: r,
|
|
@@ -1009,54 +1015,54 @@ function us({
|
|
|
1009
1015
|
onSelect: A
|
|
1010
1016
|
}
|
|
1011
1017
|
) : E === "usage" && t ? /* @__PURE__ */ o(
|
|
1012
|
-
|
|
1018
|
+
gn,
|
|
1013
1019
|
{
|
|
1014
1020
|
bundle: t,
|
|
1015
1021
|
collection: r,
|
|
1016
1022
|
fields: _,
|
|
1017
1023
|
apply: n.apply,
|
|
1018
1024
|
showFill: M,
|
|
1019
|
-
onShowFill:
|
|
1025
|
+
onShowFill: Y,
|
|
1020
1026
|
onOpenLayout: ee
|
|
1021
1027
|
}
|
|
1022
1028
|
) : /* @__PURE__ */ o(
|
|
1023
|
-
|
|
1029
|
+
Lo,
|
|
1024
1030
|
{
|
|
1025
1031
|
collection: r,
|
|
1026
1032
|
currentId: u,
|
|
1027
1033
|
onOpen: ee,
|
|
1028
1034
|
settingsOpen: V === "settings",
|
|
1029
|
-
onSettings: () =>
|
|
1035
|
+
onSettings: () => P("settings"),
|
|
1030
1036
|
dropTargets: !0
|
|
1031
1037
|
}
|
|
1032
1038
|
) })
|
|
1033
1039
|
]
|
|
1034
1040
|
}
|
|
1035
1041
|
),
|
|
1036
|
-
|
|
1042
|
+
it && t && /* @__PURE__ */ o(
|
|
1037
1043
|
"aside",
|
|
1038
1044
|
{
|
|
1039
1045
|
"data-editor-outline-panel": "",
|
|
1040
1046
|
className: "flex w-[260px] shrink-0 flex-col border-r border-slate-200 bg-white dark:border-border dark:bg-card",
|
|
1041
1047
|
children: /* @__PURE__ */ o(
|
|
1042
|
-
|
|
1048
|
+
Uo,
|
|
1043
1049
|
{
|
|
1044
1050
|
bundle: t,
|
|
1045
|
-
nodes:
|
|
1046
|
-
selection:
|
|
1047
|
-
onPick:
|
|
1048
|
-
onMoved:
|
|
1051
|
+
nodes: S.nodes,
|
|
1052
|
+
selection: h,
|
|
1053
|
+
onPick: S.selectAndReveal,
|
|
1054
|
+
onMoved: Xe,
|
|
1049
1055
|
apply: n.apply,
|
|
1050
|
-
onClose: () =>
|
|
1056
|
+
onClose: () => S.setOutlineOpen(!1)
|
|
1051
1057
|
}
|
|
1052
1058
|
)
|
|
1053
1059
|
}
|
|
1054
1060
|
),
|
|
1055
|
-
/* @__PURE__ */
|
|
1056
|
-
|
|
1057
|
-
Z.compare && (
|
|
1058
|
-
t &&
|
|
1059
|
-
|
|
1061
|
+
/* @__PURE__ */ y("main", { className: "min-w-0 flex-1 overflow-y-auto", children: [
|
|
1062
|
+
I === "canvas" && /* @__PURE__ */ o(lo, { editor: q }),
|
|
1063
|
+
Z.compare && (I === "canvas" || !x) && /* @__PURE__ */ o(Br, { compare: Z.compare, onClose: Z.close }),
|
|
1064
|
+
t && x && I === "states" ? /* @__PURE__ */ o(
|
|
1065
|
+
Io,
|
|
1060
1066
|
{
|
|
1061
1067
|
bundle: t,
|
|
1062
1068
|
parent: T,
|
|
@@ -1064,81 +1070,81 @@ function us({
|
|
|
1064
1070
|
apply: n.apply,
|
|
1065
1071
|
onSelect: A
|
|
1066
1072
|
}
|
|
1067
|
-
) : t &&
|
|
1068
|
-
|
|
1073
|
+
) : t && x && I === "roles" ? /* @__PURE__ */ o(
|
|
1074
|
+
Ko,
|
|
1069
1075
|
{
|
|
1070
1076
|
bundle: t,
|
|
1071
1077
|
parent: T,
|
|
1072
1078
|
apply: n.apply,
|
|
1073
1079
|
onSelect: A
|
|
1074
1080
|
}
|
|
1075
|
-
) : t &&
|
|
1076
|
-
|
|
1081
|
+
) : t && x && I === "table" ? /* @__PURE__ */ o(
|
|
1082
|
+
Yo,
|
|
1077
1083
|
{
|
|
1078
1084
|
bundle: t,
|
|
1079
1085
|
collection: r,
|
|
1080
1086
|
apply: n.apply,
|
|
1081
1087
|
flush: n.flush,
|
|
1082
|
-
selection:
|
|
1088
|
+
selection: h,
|
|
1083
1089
|
onSelect: A,
|
|
1084
1090
|
onSelection: L
|
|
1085
1091
|
}
|
|
1086
1092
|
) : t ? /* @__PURE__ */ o(
|
|
1087
1093
|
"div",
|
|
1088
1094
|
{
|
|
1089
|
-
"data-canvas-density":
|
|
1090
|
-
style:
|
|
1095
|
+
"data-canvas-density": S.compact && x ? "compact" : "normal",
|
|
1096
|
+
style: S.compact && x ? { zoom: zo } : void 0,
|
|
1091
1097
|
className: G(
|
|
1092
1098
|
"min-h-full",
|
|
1093
|
-
|
|
1094
|
-
|
|
1099
|
+
po(De, Fe),
|
|
1100
|
+
De && !Fe && "bg-background text-foreground"
|
|
1095
1101
|
),
|
|
1096
1102
|
children: /* @__PURE__ */ o(
|
|
1097
|
-
|
|
1103
|
+
rn,
|
|
1098
1104
|
{
|
|
1099
1105
|
collection: r,
|
|
1100
1106
|
bundle: t,
|
|
1101
1107
|
parent: T,
|
|
1102
|
-
preview:
|
|
1103
|
-
onPreview:
|
|
1108
|
+
preview: K,
|
|
1109
|
+
onPreview: J,
|
|
1104
1110
|
record: k,
|
|
1105
1111
|
fields: _,
|
|
1106
1112
|
renderPane: (e) => /* @__PURE__ */ o(
|
|
1107
|
-
|
|
1113
|
+
In,
|
|
1108
1114
|
{
|
|
1109
1115
|
collection: r,
|
|
1110
1116
|
bundle: t,
|
|
1111
1117
|
parent: T,
|
|
1112
1118
|
roleId: e.roleId,
|
|
1113
1119
|
stateKey: e.stateKey,
|
|
1114
|
-
marks:
|
|
1120
|
+
marks: Ft(e.marks),
|
|
1115
1121
|
overlay: q.overlay(e.overlay),
|
|
1116
|
-
ruleMarks:
|
|
1117
|
-
ghost:
|
|
1118
|
-
deps:
|
|
1122
|
+
ruleMarks: Vt,
|
|
1123
|
+
ghost: Ht,
|
|
1124
|
+
deps: we.deps,
|
|
1119
1125
|
noDnd: e.noDnd,
|
|
1120
1126
|
record: e.record,
|
|
1121
1127
|
selected: re,
|
|
1122
|
-
selection:
|
|
1123
|
-
onSelect:
|
|
1124
|
-
showHidden:
|
|
1125
|
-
fold:
|
|
1126
|
-
reveal:
|
|
1128
|
+
selection: h,
|
|
1129
|
+
onSelect: $t,
|
|
1130
|
+
showHidden: ve,
|
|
1131
|
+
fold: S.fold,
|
|
1132
|
+
reveal: S.reveal,
|
|
1127
1133
|
apply: n.apply,
|
|
1128
1134
|
whenIdle: n.whenIdle,
|
|
1129
|
-
fillRate:
|
|
1130
|
-
unsaved:
|
|
1131
|
-
peers:
|
|
1135
|
+
fillRate: Oe,
|
|
1136
|
+
unsaved: Gt,
|
|
1137
|
+
peers: jt,
|
|
1132
1138
|
compare: Z.compare,
|
|
1133
|
-
lastChanges: Z.compare ? void 0 :
|
|
1139
|
+
lastChanges: Z.compare ? void 0 : Et
|
|
1134
1140
|
}
|
|
1135
1141
|
)
|
|
1136
1142
|
}
|
|
1137
1143
|
)
|
|
1138
1144
|
}
|
|
1139
|
-
) : n.error ? /* @__PURE__ */ o("p", { className: "p-6 text-[13px] text-red-700 dark:text-red-300", children: n.error }) : /* @__PURE__ */
|
|
1140
|
-
/* @__PURE__ */ o(
|
|
1141
|
-
/* @__PURE__ */ o(
|
|
1145
|
+
) : n.error ? /* @__PURE__ */ o("p", { className: "p-6 text-[13px] text-red-700 dark:text-red-300", children: n.error }) : /* @__PURE__ */ y("div", { className: "flex flex-col gap-3 p-6", children: [
|
|
1146
|
+
/* @__PURE__ */ o(wt, { className: "h-10 w-full rounded-lg" }),
|
|
1147
|
+
/* @__PURE__ */ o(wt, { className: "h-48 w-full rounded-lg" })
|
|
1142
1148
|
] })
|
|
1143
1149
|
] }),
|
|
1144
1150
|
/* @__PURE__ */ o(
|
|
@@ -1147,54 +1153,54 @@ function us({
|
|
|
1147
1153
|
"data-editor-inspector": "",
|
|
1148
1154
|
className: "flex w-[344px] shrink-0 flex-col overflow-hidden border-l border-slate-200 bg-white dark:border-border dark:bg-card",
|
|
1149
1155
|
children: t && (V === "ask" ? /* @__PURE__ */ o(
|
|
1150
|
-
|
|
1156
|
+
Rr,
|
|
1151
1157
|
{
|
|
1152
1158
|
layoutId: u,
|
|
1153
|
-
layoutName:
|
|
1154
|
-
kind:
|
|
1159
|
+
layoutName: Se,
|
|
1160
|
+
kind: cn(t.layout),
|
|
1155
1161
|
bundle: t,
|
|
1156
|
-
thread:
|
|
1157
|
-
setThread:
|
|
1158
|
-
pending:
|
|
1159
|
-
onPendingTaken: () =>
|
|
1160
|
-
jump:
|
|
1161
|
-
onCite:
|
|
1162
|
-
recordId: ((
|
|
1162
|
+
thread: Te,
|
|
1163
|
+
setThread: ye,
|
|
1164
|
+
pending: he,
|
|
1165
|
+
onPendingTaken: () => de(null),
|
|
1166
|
+
jump: Xt,
|
|
1167
|
+
onCite: er,
|
|
1168
|
+
recordId: ((ht = K.record) == null ? void 0 : ht.id) ?? null
|
|
1163
1169
|
}
|
|
1164
1170
|
) : V === "checks" ? /* @__PURE__ */ o(
|
|
1165
|
-
|
|
1171
|
+
Do,
|
|
1166
1172
|
{
|
|
1167
|
-
findings:
|
|
1168
|
-
health:
|
|
1169
|
-
ready:
|
|
1173
|
+
findings: ke.findings,
|
|
1174
|
+
health: ke.health,
|
|
1175
|
+
ready: ke.ready,
|
|
1170
1176
|
onSelect: (e) => L([e]),
|
|
1171
1177
|
apply: n.apply,
|
|
1172
|
-
onOpenAiReview: p.aiReviewSlot ? () =>
|
|
1178
|
+
onOpenAiReview: p.aiReviewSlot ? () => P("settings") : void 0
|
|
1173
1179
|
}
|
|
1174
1180
|
) : V === "settings" ? /* @__PURE__ */ o(
|
|
1175
|
-
|
|
1181
|
+
On,
|
|
1176
1182
|
{
|
|
1177
1183
|
bundle: t,
|
|
1178
1184
|
apply: n.apply,
|
|
1179
1185
|
flush: n.flush,
|
|
1180
1186
|
collection: r,
|
|
1181
|
-
previewRoleId:
|
|
1182
|
-
onPreviewRoleChange:
|
|
1187
|
+
previewRoleId: K.roleId,
|
|
1188
|
+
onPreviewRoleChange: Jt,
|
|
1183
1189
|
onAskWhere: p.isAdmin ? (e) => {
|
|
1184
|
-
|
|
1190
|
+
de(e), P("ask");
|
|
1185
1191
|
} : void 0
|
|
1186
1192
|
}
|
|
1187
|
-
) :
|
|
1188
|
-
|
|
1193
|
+
) : h.length > 1 ? /* @__PURE__ */ o(
|
|
1194
|
+
Ao,
|
|
1189
1195
|
{
|
|
1190
1196
|
bundle: t,
|
|
1191
|
-
selection:
|
|
1197
|
+
selection: h,
|
|
1192
1198
|
apply: n.apply,
|
|
1193
1199
|
collection: r,
|
|
1194
1200
|
onSelection: L
|
|
1195
1201
|
}
|
|
1196
1202
|
) : /* @__PURE__ */ o(
|
|
1197
|
-
|
|
1203
|
+
An,
|
|
1198
1204
|
{
|
|
1199
1205
|
bundle: t,
|
|
1200
1206
|
target: re,
|
|
@@ -1202,7 +1208,7 @@ function us({
|
|
|
1202
1208
|
flush: n.flush,
|
|
1203
1209
|
collection: r,
|
|
1204
1210
|
openLayout: ee,
|
|
1205
|
-
onSelect:
|
|
1211
|
+
onSelect: S.selectAndReveal
|
|
1206
1212
|
}
|
|
1207
1213
|
))
|
|
1208
1214
|
}
|
|
@@ -1211,53 +1217,53 @@ function us({
|
|
|
1211
1217
|
}
|
|
1212
1218
|
),
|
|
1213
1219
|
/* @__PURE__ */ o(
|
|
1214
|
-
|
|
1220
|
+
sn,
|
|
1215
1221
|
{
|
|
1216
1222
|
bundle: t,
|
|
1217
|
-
selection:
|
|
1223
|
+
selection: h,
|
|
1218
1224
|
apply: n.apply,
|
|
1219
1225
|
onSelection: L,
|
|
1220
|
-
rootRef:
|
|
1226
|
+
rootRef: $
|
|
1221
1227
|
}
|
|
1222
1228
|
),
|
|
1223
1229
|
/* @__PURE__ */ o(
|
|
1224
|
-
|
|
1230
|
+
hn,
|
|
1225
1231
|
{
|
|
1226
|
-
request:
|
|
1232
|
+
request: _t,
|
|
1227
1233
|
count: n.unsavedCount,
|
|
1228
|
-
onSave:
|
|
1234
|
+
onSave: Mt,
|
|
1229
1235
|
onDiscard: n.discard,
|
|
1230
|
-
onKeep: () =>
|
|
1231
|
-
note:
|
|
1232
|
-
canSave:
|
|
1236
|
+
onKeep: () => Ge(null),
|
|
1237
|
+
note: D ? /* @__PURE__ */ o($r, { policy: D, value: pe, onChange: Pe }) : void 0,
|
|
1238
|
+
canSave: Ur(D, pe)
|
|
1233
1239
|
}
|
|
1234
1240
|
),
|
|
1235
|
-
|
|
1236
|
-
|
|
1241
|
+
D && Ve && /* @__PURE__ */ o(
|
|
1242
|
+
zr,
|
|
1237
1243
|
{
|
|
1238
1244
|
open: !0,
|
|
1239
|
-
anchor:
|
|
1240
|
-
policy:
|
|
1241
|
-
intro: X ?
|
|
1245
|
+
anchor: Ve,
|
|
1246
|
+
policy: D,
|
|
1247
|
+
intro: X ? At(X) : void 0,
|
|
1242
1248
|
count: n.unsavedCount,
|
|
1243
|
-
value:
|
|
1244
|
-
onChange:
|
|
1245
|
-
onSave:
|
|
1246
|
-
onClose: () =>
|
|
1249
|
+
value: pe,
|
|
1250
|
+
onChange: Pe,
|
|
1251
|
+
onSave: We,
|
|
1252
|
+
onClose: () => He(null)
|
|
1247
1253
|
}
|
|
1248
1254
|
),
|
|
1249
|
-
|
|
1250
|
-
|
|
1255
|
+
ot && /* @__PURE__ */ o(
|
|
1256
|
+
jr,
|
|
1251
1257
|
{
|
|
1252
|
-
anchor:
|
|
1258
|
+
anchor: ot,
|
|
1253
1259
|
steps: n.unsavedSteps,
|
|
1254
|
-
exists: (e) => !!t &&
|
|
1255
|
-
describe: (e) =>
|
|
1260
|
+
exists: (e) => !!t && qe(e, t, T),
|
|
1261
|
+
describe: (e) => Ot(e, t, _),
|
|
1256
1262
|
onJump: (e) => {
|
|
1257
|
-
be(null),
|
|
1263
|
+
be(null), nt(e);
|
|
1258
1264
|
},
|
|
1259
1265
|
onSettings: () => {
|
|
1260
|
-
be(null),
|
|
1266
|
+
be(null), P("settings");
|
|
1261
1267
|
},
|
|
1262
1268
|
onClose: () => be(null)
|
|
1263
1269
|
}
|
|
@@ -1265,20 +1271,20 @@ function us({
|
|
|
1265
1271
|
]
|
|
1266
1272
|
}
|
|
1267
1273
|
);
|
|
1268
|
-
if (!
|
|
1269
|
-
return /* @__PURE__ */ o(
|
|
1270
|
-
const
|
|
1271
|
-
return /* @__PURE__ */
|
|
1272
|
-
/* @__PURE__ */ o("span", { ref:
|
|
1273
|
-
/* @__PURE__ */ o(
|
|
1274
|
+
if (!ne)
|
|
1275
|
+
return /* @__PURE__ */ o(St.Provider, { value: Ie, children: dt });
|
|
1276
|
+
const ct = c ?? (Le ? Sr(Le) ?? document.body : null);
|
|
1277
|
+
return /* @__PURE__ */ y(ae, { children: [
|
|
1278
|
+
/* @__PURE__ */ o("span", { ref: Bt, hidden: !0, "data-layout-editor-marker": "" }),
|
|
1279
|
+
/* @__PURE__ */ o(St.Provider, { value: Ie, children: ct && mr(dt, ct) })
|
|
1274
1280
|
] });
|
|
1275
1281
|
}
|
|
1276
|
-
function
|
|
1282
|
+
function At(r) {
|
|
1277
1283
|
const l = r.reason.trim() ? `: ${r.reason.trim()}` : "";
|
|
1278
|
-
return `Frozen until ${
|
|
1284
|
+
return `Frozen until ${gr(r.until)}${l}. Saving asks for an override note, kept in History.`;
|
|
1279
1285
|
}
|
|
1280
1286
|
export {
|
|
1281
|
-
|
|
1287
|
+
vs as LayoutEditor,
|
|
1282
1288
|
$e as isTyping,
|
|
1283
|
-
|
|
1289
|
+
qe as targetExists
|
|
1284
1290
|
};
|