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