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