@nivaro/react 0.3.35 → 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 +13 -4
- 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 -572
- 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 +80 -63
- 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 +146 -131
- package/dist/shared/components/layout-editor/EditorCanvas.js +25 -17
- package/dist/shared/components/layout-editor/EditorTopBar.js +268 -206
- package/dist/shared/components/layout-editor/LayoutEditor.js +810 -731
- 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 +379 -185
- package/dist/shared/components/layout-editor/dnd/TrashZone.js +96 -0
- 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/rail-drop.js +4 -4
- package/dist/shared/components/layout-editor/dnd/sensors.js +23 -0
- package/dist/shared/components/layout-editor/dnd/trash-drop.js +58 -0
- 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/panel-frame.js +1 -1
- package/dist/shared/components/layout-editor/parity-keys.json.js +1 -1
- package/dist/shared/components/layout-editor/personal-default-marks.js +40 -0
- 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 +149 -118
- 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,339 +1,352 @@
|
|
|
1
|
-
import { jsxs as y, jsx 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 {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import { useDraftRecovery as
|
|
38
|
-
import { canvasRenderer as
|
|
39
|
-
import { EditorTopBar as
|
|
40
|
-
import { notesOf as
|
|
41
|
-
import { EntryEditorContext as
|
|
42
|
-
import { useTabOrderEditor as
|
|
43
|
-
import { useAppIsDark as
|
|
44
|
-
import { useRulesView as
|
|
45
|
-
import { useDriverHover as
|
|
46
|
-
import {
|
|
47
|
-
import {
|
|
48
|
-
import {
|
|
49
|
-
import { FormMapButton as
|
|
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
|
-
|
|
90
|
-
|
|
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(() => {
|
|
91
102
|
const i = (s) => {
|
|
92
103
|
if (!(s.metaKey || s.ctrlKey) || s.altKey) return;
|
|
93
104
|
const l = s.key.toLowerCase();
|
|
94
105
|
if (l === "s" && !s.shiftKey) {
|
|
95
|
-
s.preventDefault(),
|
|
106
|
+
s.preventDefault(), o.autosave ? o.flush() : o.save();
|
|
96
107
|
return;
|
|
97
108
|
}
|
|
98
109
|
const m = l === "z" && s.shiftKey || l === "y" && !s.shiftKey;
|
|
99
|
-
l !== "z" && !m ||
|
|
110
|
+
l !== "z" && !m || Ze(s.target) || (s.preventDefault(), m ? o.redo() : o.undo());
|
|
100
111
|
};
|
|
101
112
|
return window.addEventListener("keydown", i), () => window.removeEventListener("keydown", i);
|
|
102
|
-
}, [
|
|
113
|
+
}, [o.undo, o.redo, o.autosave, o.flush, o.save]);
|
|
103
114
|
}
|
|
104
|
-
function
|
|
105
|
-
|
|
106
|
-
const d = (
|
|
107
|
-
const v =
|
|
108
|
-
if (!v || !
|
|
109
|
-
|
|
110
|
-
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);
|
|
111
122
|
if (!p) return;
|
|
112
123
|
s(p.ops, { label: p.label }), m(p.next);
|
|
113
|
-
const
|
|
124
|
+
const c = $(p.next);
|
|
114
125
|
requestAnimationFrame(() => {
|
|
115
|
-
var
|
|
126
|
+
var Z;
|
|
116
127
|
const g = document.querySelector(
|
|
117
|
-
`[data-layout-editor] [data-design-target="${CSS.escape(
|
|
128
|
+
`[data-layout-editor] [data-design-target="${CSS.escape(c)}"]`
|
|
118
129
|
);
|
|
119
|
-
g == null || g.focus({ preventScroll: !0 }), (
|
|
130
|
+
g == null || g.focus({ preventScroll: !0 }), (Z = g == null ? void 0 : g.scrollIntoView) == null || Z.call(g, { block: "nearest" });
|
|
120
131
|
});
|
|
121
132
|
};
|
|
122
133
|
return window.addEventListener("keydown", d), () => window.removeEventListener("keydown", d);
|
|
123
|
-
}, [
|
|
134
|
+
}, [o, i, s, l, m]);
|
|
124
135
|
}
|
|
125
|
-
function
|
|
126
|
-
const i =
|
|
127
|
-
|
|
136
|
+
function ua(o) {
|
|
137
|
+
const i = o.status === "saving" || o.dirty;
|
|
138
|
+
Uo(i, "Layout changes"), B(() => {
|
|
128
139
|
if (!i) return;
|
|
129
140
|
const s = (l) => {
|
|
130
|
-
|
|
141
|
+
o.flush(), l.preventDefault(), l.returnValue = "";
|
|
131
142
|
};
|
|
132
143
|
return window.addEventListener("beforeunload", s), () => window.removeEventListener("beforeunload", s);
|
|
133
|
-
}, [i,
|
|
134
|
-
const s = () =>
|
|
144
|
+
}, [i, o.flush]), B(() => {
|
|
145
|
+
const s = () => o.flush();
|
|
135
146
|
return window.addEventListener("pagehide", s), () => window.removeEventListener("pagehide", s);
|
|
136
|
-
}, [
|
|
147
|
+
}, [o.flush]);
|
|
137
148
|
}
|
|
138
|
-
function
|
|
139
|
-
const i =
|
|
140
|
-
return
|
|
149
|
+
function pa(o) {
|
|
150
|
+
const i = xo(), s = Wt(o);
|
|
151
|
+
return T(
|
|
141
152
|
(l, m) => {
|
|
142
153
|
const d = Number(l.layout.id);
|
|
143
|
-
Number.isFinite(d) && i.invalidateQueries({ queryKey:
|
|
154
|
+
Number.isFinite(d) && i.invalidateQueries({ queryKey: aa.versions(d) }), s({ lazy: !sa(m) });
|
|
144
155
|
},
|
|
145
156
|
[i, s]
|
|
146
157
|
);
|
|
147
158
|
}
|
|
148
|
-
function
|
|
149
|
-
const s =
|
|
150
|
-
return
|
|
151
|
-
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],
|
|
152
163
|
queryFn: () => s.request(
|
|
153
|
-
|
|
164
|
+
Ko(`/items/${encodeURIComponent(o)}/${encodeURIComponent(String(i))}`)
|
|
154
165
|
).then((l) => l.data ?? null),
|
|
155
166
|
enabled: i != null,
|
|
156
167
|
staleTime: 3e4
|
|
157
168
|
});
|
|
158
169
|
}
|
|
159
|
-
function
|
|
160
|
-
const s =
|
|
161
|
-
s.current = i,
|
|
162
|
-
if (!
|
|
170
|
+
function fa(o, i) {
|
|
171
|
+
const s = z(i);
|
|
172
|
+
s.current = i, B(() => {
|
|
173
|
+
if (!o) return;
|
|
163
174
|
let l = !1;
|
|
164
175
|
const m = (d) => {
|
|
165
|
-
var p,
|
|
176
|
+
var p, c;
|
|
166
177
|
if (l || d.defaultPrevented || d.button !== 0 || d.metaKey || d.ctrlKey || d.shiftKey || d.altKey) return;
|
|
167
|
-
const
|
|
168
|
-
if (!
|
|
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;
|
|
169
180
|
let v;
|
|
170
181
|
try {
|
|
171
|
-
v = new URL(
|
|
182
|
+
v = new URL(u.href, window.location.href);
|
|
172
183
|
} catch {
|
|
173
184
|
return;
|
|
174
185
|
}
|
|
175
186
|
v.origin === window.location.origin && v.pathname + v.search !== window.location.pathname + window.location.search && (d.preventDefault(), d.stopPropagation(), s.current(() => {
|
|
176
187
|
l = !0;
|
|
177
188
|
try {
|
|
178
|
-
|
|
189
|
+
u.click();
|
|
179
190
|
} finally {
|
|
180
191
|
l = !1;
|
|
181
192
|
}
|
|
182
|
-
},
|
|
193
|
+
}, u));
|
|
183
194
|
};
|
|
184
195
|
return document.addEventListener("click", m, !0), () => document.removeEventListener("click", m, !0);
|
|
185
|
-
}, [
|
|
196
|
+
}, [o]);
|
|
186
197
|
}
|
|
187
|
-
function
|
|
198
|
+
function je(o, i, s = null) {
|
|
188
199
|
const l = (m) => {
|
|
189
|
-
if (
|
|
190
|
-
const d =
|
|
191
|
-
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);
|
|
192
203
|
};
|
|
193
204
|
return l(i) || s != null && l(s);
|
|
194
205
|
}
|
|
195
|
-
function
|
|
196
|
-
const l =
|
|
197
|
-
return m.current = i,
|
|
206
|
+
function ha(o, i, s) {
|
|
207
|
+
const l = z(null), m = z(i);
|
|
208
|
+
return m.current = i, B(() => {
|
|
198
209
|
var v;
|
|
199
|
-
if (!
|
|
210
|
+
if (!o) return;
|
|
200
211
|
const d = document.activeElement;
|
|
201
212
|
(v = l.current) == null || v.focus();
|
|
202
|
-
const
|
|
203
|
-
p.key !== "Escape" || p.defaultPrevented || s.current ||
|
|
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());
|
|
204
215
|
};
|
|
205
|
-
return document.addEventListener("keydown",
|
|
206
|
-
document.removeEventListener("keydown",
|
|
216
|
+
return document.addEventListener("keydown", u), () => {
|
|
217
|
+
document.removeEventListener("keydown", u), d != null && d.isConnected && d.focus();
|
|
207
218
|
};
|
|
208
|
-
}, [
|
|
219
|
+
}, [o, s]), l;
|
|
209
220
|
}
|
|
210
|
-
function
|
|
211
|
-
collection:
|
|
221
|
+
function ya({
|
|
222
|
+
collection: o,
|
|
212
223
|
bundle: i,
|
|
213
224
|
parent: s,
|
|
214
225
|
roleId: l,
|
|
215
226
|
stateKey: m = null,
|
|
216
227
|
marks: d,
|
|
217
|
-
overlay:
|
|
228
|
+
overlay: u,
|
|
218
229
|
ruleMarks: v,
|
|
219
230
|
ghost: p,
|
|
220
|
-
deps:
|
|
231
|
+
deps: c,
|
|
221
232
|
noDnd: g = !1,
|
|
222
|
-
record:
|
|
223
|
-
selected:
|
|
224
|
-
selection:
|
|
225
|
-
onSelect:
|
|
226
|
-
showHidden:
|
|
227
|
-
fold:
|
|
228
|
-
reveal:
|
|
229
|
-
apply:
|
|
230
|
-
whenIdle:
|
|
231
|
-
fillRate:
|
|
232
|
-
unsaved:
|
|
233
|
-
peers:
|
|
234
|
-
compare:
|
|
235
|
-
lastChanges:
|
|
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
|
|
236
247
|
}) {
|
|
237
|
-
const
|
|
238
|
-
() => 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,
|
|
239
250
|
[i, s]
|
|
240
|
-
),
|
|
241
|
-
const
|
|
242
|
-
return
|
|
243
|
-
} : d, [
|
|
244
|
-
() =>
|
|
245
|
-
[
|
|
246
|
-
), { data:
|
|
247
|
-
() => l ?
|
|
248
|
-
[l,
|
|
249
|
-
),
|
|
250
|
-
() =>
|
|
251
|
-
[
|
|
252
|
-
),
|
|
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(
|
|
253
264
|
() => ({
|
|
254
|
-
selected:
|
|
255
|
-
selection:
|
|
256
|
-
onSelect:
|
|
257
|
-
showHidden:
|
|
258
|
-
inheritedFrom: (
|
|
259
|
-
dnd:
|
|
260
|
-
roleMark:
|
|
261
|
-
marks:
|
|
262
|
-
overlay:
|
|
263
|
-
fillRate:
|
|
264
|
-
note: (
|
|
265
|
-
const
|
|
266
|
-
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;
|
|
267
278
|
},
|
|
268
|
-
fold:
|
|
269
|
-
reveal:
|
|
270
|
-
unsaved:
|
|
271
|
-
peers:
|
|
272
|
-
diffMark:
|
|
273
|
-
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,
|
|
274
285
|
ghost: p,
|
|
275
|
-
|
|
276
|
-
|
|
286
|
+
locked: L.locked,
|
|
287
|
+
resizeWidth: g ? void 0 : (f, K) => {
|
|
288
|
+
f.kind !== "field" && f.kind !== "slot" || t(
|
|
277
289
|
[
|
|
278
290
|
{
|
|
279
291
|
op: "update_placement",
|
|
280
|
-
at: { field:
|
|
281
|
-
patch: { col_span:
|
|
292
|
+
at: { field: f.field, group_key: f.group_key },
|
|
293
|
+
patch: { col_span: K === 12 ? null : K }
|
|
282
294
|
}
|
|
283
295
|
],
|
|
284
|
-
{ label: `Set the width to ${
|
|
296
|
+
{ label: `Set the width to ${Wr[K] ?? K}` }
|
|
285
297
|
);
|
|
286
298
|
}
|
|
287
299
|
}),
|
|
288
300
|
[
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
301
|
+
be,
|
|
302
|
+
we,
|
|
303
|
+
xe,
|
|
304
|
+
le,
|
|
305
|
+
R.inherited,
|
|
306
|
+
pe,
|
|
307
|
+
me,
|
|
295
308
|
J,
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
R,
|
|
309
|
+
u,
|
|
310
|
+
re,
|
|
311
|
+
ne,
|
|
312
|
+
n,
|
|
313
|
+
Se,
|
|
314
|
+
U,
|
|
315
|
+
N,
|
|
316
|
+
Q,
|
|
317
|
+
ue,
|
|
306
318
|
p,
|
|
307
|
-
|
|
319
|
+
L.locked,
|
|
320
|
+
t,
|
|
308
321
|
g
|
|
309
322
|
]
|
|
310
|
-
),
|
|
311
|
-
return /* @__PURE__ */
|
|
312
|
-
|
|
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,
|
|
313
326
|
{
|
|
314
|
-
collection:
|
|
315
|
-
bundle:
|
|
316
|
-
layout:
|
|
317
|
-
record:
|
|
327
|
+
collection: o,
|
|
328
|
+
bundle: W,
|
|
329
|
+
layout: Le,
|
|
330
|
+
record: Z,
|
|
318
331
|
stateKey: m,
|
|
319
332
|
roleId: l,
|
|
320
|
-
design:
|
|
321
|
-
apply:
|
|
322
|
-
whenIdle:
|
|
333
|
+
design: A,
|
|
334
|
+
apply: t,
|
|
335
|
+
whenIdle: q
|
|
323
336
|
}
|
|
324
337
|
) });
|
|
325
338
|
}
|
|
326
|
-
function
|
|
327
|
-
collection:
|
|
339
|
+
function va({
|
|
340
|
+
collection: o,
|
|
328
341
|
name: i,
|
|
329
342
|
row: s,
|
|
330
343
|
layoutId: l,
|
|
331
344
|
rows: m,
|
|
332
345
|
fields: d,
|
|
333
|
-
onDone:
|
|
346
|
+
onDone: u
|
|
334
347
|
}) {
|
|
335
|
-
const v =
|
|
336
|
-
return g.length > 0 && typeof p == "number" && g.push({ text: ` (≈ ${p.toLocaleString()} ${p === 1 ? "record" : "records"})` }),
|
|
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(
|
|
337
350
|
"div",
|
|
338
351
|
{
|
|
339
352
|
"data-editing-banner": "",
|
|
@@ -341,17 +354,17 @@ function _n({
|
|
|
341
354
|
children: [
|
|
342
355
|
/* @__PURE__ */ y("p", { className: "m-0 min-w-0 flex-1 truncate", children: [
|
|
343
356
|
"Editing ",
|
|
344
|
-
/* @__PURE__ */
|
|
345
|
-
g.length > 0 && /* @__PURE__ */ y(
|
|
357
|
+
/* @__PURE__ */ r("b", { className: "font-semibold text-slate-900 dark:text-foreground", children: i }),
|
|
358
|
+
g.length > 0 && /* @__PURE__ */ y(ie, { children: [
|
|
346
359
|
" — ",
|
|
347
|
-
/* @__PURE__ */
|
|
360
|
+
/* @__PURE__ */ r(xn, { segs: g, muted: !0 })
|
|
348
361
|
] })
|
|
349
362
|
] }),
|
|
350
|
-
/* @__PURE__ */
|
|
363
|
+
/* @__PURE__ */ r(
|
|
351
364
|
"button",
|
|
352
365
|
{
|
|
353
366
|
type: "button",
|
|
354
|
-
onClick: (
|
|
367
|
+
onClick: (Z) => u(Z.currentTarget),
|
|
355
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",
|
|
356
369
|
children: "Done"
|
|
357
370
|
}
|
|
@@ -360,20 +373,20 @@ function _n({
|
|
|
360
373
|
}
|
|
361
374
|
);
|
|
362
375
|
}
|
|
363
|
-
function
|
|
364
|
-
const s = (l, m, d,
|
|
376
|
+
function ga({ view: o, onView: i }) {
|
|
377
|
+
const s = (l, m, d, u) => /* @__PURE__ */ y(
|
|
365
378
|
"button",
|
|
366
379
|
{
|
|
367
380
|
type: "button",
|
|
368
|
-
"aria-pressed":
|
|
381
|
+
"aria-pressed": o === l,
|
|
369
382
|
"aria-label": m,
|
|
370
383
|
"data-editor-view": l,
|
|
371
|
-
"data-tip":
|
|
384
|
+
"data-tip": u,
|
|
372
385
|
onClick: () => i(l),
|
|
373
|
-
className: G(
|
|
386
|
+
className: G(Cn(o === l), "inline-flex items-center justify-center gap-1"),
|
|
374
387
|
children: [
|
|
375
|
-
/* @__PURE__ */
|
|
376
|
-
/* @__PURE__ */
|
|
388
|
+
/* @__PURE__ */ r(d, { className: "h-3.5 w-3.5 shrink-0" }),
|
|
389
|
+
/* @__PURE__ */ r("span", { "data-tb-xwide": "", children: m })
|
|
377
390
|
]
|
|
378
391
|
}
|
|
379
392
|
);
|
|
@@ -381,486 +394,532 @@ function Mn({ view: r, onView: i }) {
|
|
|
381
394
|
"fieldset",
|
|
382
395
|
{
|
|
383
396
|
"aria-label": "Show the form as",
|
|
384
|
-
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)),
|
|
385
398
|
children: [
|
|
386
|
-
s("canvas", "Canvas",
|
|
387
|
-
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"),
|
|
388
401
|
s(
|
|
389
402
|
"states",
|
|
390
403
|
"States",
|
|
391
|
-
|
|
404
|
+
Eo,
|
|
392
405
|
"Every field by workflow state: editable, read-only, required"
|
|
393
406
|
),
|
|
394
|
-
s("roles", "Roles",
|
|
407
|
+
s("roles", "Roles", Io, "Every section by role: can edit, read-only, hidden")
|
|
395
408
|
]
|
|
396
409
|
}
|
|
397
410
|
);
|
|
398
411
|
}
|
|
399
|
-
const
|
|
412
|
+
const Ge = (o) => G(
|
|
400
413
|
"inline-flex h-7 items-center gap-1 rounded-md px-2.5 text-[12px] font-medium transition-colors",
|
|
401
|
-
|
|
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"
|
|
402
415
|
);
|
|
403
|
-
function
|
|
404
|
-
collection:
|
|
416
|
+
function ci({
|
|
417
|
+
collection: o,
|
|
405
418
|
layoutId: i,
|
|
406
419
|
onBack: s,
|
|
407
420
|
mode: l,
|
|
408
421
|
onLayoutChange: m,
|
|
409
422
|
previewRecordId: d = null,
|
|
410
|
-
portalContainer:
|
|
423
|
+
portalContainer: u,
|
|
411
424
|
onDirtyChange: v
|
|
412
425
|
}) {
|
|
413
|
-
var
|
|
414
|
-
const p =
|
|
415
|
-
|
|
416
|
-
const
|
|
417
|
-
() =>
|
|
418
|
-
[
|
|
419
|
-
), [
|
|
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({
|
|
420
433
|
record: d ? { id: d, label: `#${d}` } : null,
|
|
421
434
|
roleId: null
|
|
422
|
-
}), { data:
|
|
423
|
-
() => t ?
|
|
424
|
-
[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]
|
|
425
438
|
);
|
|
426
|
-
|
|
427
|
-
const
|
|
428
|
-
const e =
|
|
429
|
-
return (
|
|
430
|
-
if (!
|
|
431
|
-
const
|
|
432
|
-
if (
|
|
433
|
-
const
|
|
434
|
-
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;
|
|
435
448
|
};
|
|
436
|
-
}, [
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
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() } : {}
|
|
442
459
|
} : void 0;
|
|
443
460
|
await n.save(e);
|
|
444
461
|
const a = n.unsavedOps().length === 0;
|
|
445
|
-
return a && e &&
|
|
446
|
-
}, [n.save, n.unsavedOps,
|
|
462
|
+
return a && e && Ae((h) => ({ ...h, reason: "" })), a;
|
|
463
|
+
}, [n.save, n.unsavedOps, I, te]), ot = T(() => {
|
|
447
464
|
var e, a;
|
|
448
|
-
return
|
|
449
|
-
((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
|
|
450
467
|
), Promise.resolve()) : n.save();
|
|
451
|
-
}, [
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
}, [
|
|
455
|
-
const
|
|
456
|
-
|
|
457
|
-
const
|
|
458
|
-
|
|
459
|
-
const
|
|
460
|
-
var
|
|
461
|
-
if (!
|
|
462
|
-
const
|
|
463
|
-
|
|
464
|
-
}, []),
|
|
465
|
-
|
|
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(() => {
|
|
466
483
|
v == null || v(n.dirty);
|
|
467
484
|
}, [n.dirty, v]);
|
|
468
|
-
const
|
|
469
|
-
|
|
485
|
+
const at = z(n.unsavedOps);
|
|
486
|
+
at.current = n.unsavedOps, B(
|
|
470
487
|
() => () => {
|
|
471
|
-
|
|
488
|
+
at.current().length > 0 && Et.warning("Unsaved form changes kept — open the form again to save or discard them");
|
|
472
489
|
},
|
|
473
490
|
[]
|
|
474
491
|
);
|
|
475
|
-
const
|
|
492
|
+
const st = Wt(o), it = T(() => {
|
|
476
493
|
const e = n.whenIdle();
|
|
477
|
-
e.then(() =>
|
|
478
|
-
}, [n.whenIdle,
|
|
479
|
-
(e) =>
|
|
480
|
-
[
|
|
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]
|
|
481
498
|
);
|
|
482
|
-
|
|
483
|
-
if (!t ||
|
|
484
|
-
const e =
|
|
485
|
-
e.length !==
|
|
486
|
-
}, [
|
|
487
|
-
const
|
|
488
|
-
|
|
489
|
-
}, []),
|
|
490
|
-
|
|
491
|
-
}, []),
|
|
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(
|
|
492
509
|
() => ({
|
|
493
|
-
tabOrderActive:
|
|
510
|
+
tabOrderActive: _.active,
|
|
494
511
|
startTabOrder: () => {
|
|
495
|
-
|
|
512
|
+
V("canvas"), _.start();
|
|
496
513
|
}
|
|
497
514
|
}),
|
|
498
|
-
[
|
|
499
|
-
),
|
|
515
|
+
[_.active, _.start]
|
|
516
|
+
), dt = T(
|
|
500
517
|
(e, a) => {
|
|
501
|
-
if (e.kind === "group") return
|
|
518
|
+
if (e.kind === "group") return P({ kind: "group", key: e.key });
|
|
502
519
|
if (e.kind === "tab") {
|
|
503
|
-
|
|
520
|
+
P(a), (a.kind === "field" || a.kind === "header") && Qr(a.field, e.tab);
|
|
504
521
|
return;
|
|
505
522
|
}
|
|
506
523
|
if (e.kind === "pipeline")
|
|
507
|
-
return
|
|
524
|
+
return ae(
|
|
508
525
|
"open the pipeline",
|
|
509
526
|
() => p.navigate(`/pipelines/${encodeURIComponent(e.id)}`)
|
|
510
527
|
);
|
|
511
|
-
|
|
528
|
+
ae(
|
|
512
529
|
"open the field rules",
|
|
513
|
-
() => p.navigate(`/data-model/${encodeURIComponent(
|
|
530
|
+
() => p.navigate(`/data-model/${encodeURIComponent(o)}?tab=rules`)
|
|
514
531
|
);
|
|
515
532
|
},
|
|
516
|
-
[
|
|
517
|
-
),
|
|
533
|
+
[P, ae, p, o]
|
|
534
|
+
), ao = w(() => {
|
|
518
535
|
const e = /* @__PURE__ */ new Map();
|
|
519
|
-
for (const [a,
|
|
520
|
-
(
|
|
521
|
-
return
|
|
522
|
-
}, [
|
|
523
|
-
() =>
|
|
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) => {
|
|
524
541
|
var a;
|
|
525
|
-
return ((a =
|
|
542
|
+
return ((a = ye.get(e)) == null ? void 0 : a.text) ?? null;
|
|
526
543
|
} : void 0,
|
|
527
|
-
[
|
|
528
|
-
),
|
|
544
|
+
[ye]
|
|
545
|
+
), io = T(
|
|
529
546
|
(e) => {
|
|
530
|
-
const a = t == null ? void 0 : t.placements.find((
|
|
547
|
+
const a = t == null ? void 0 : t.placements.find((S) => S.field === e);
|
|
531
548
|
if (!a) return;
|
|
532
|
-
const
|
|
533
|
-
|
|
549
|
+
const h = a.group_key === zt ? { kind: "header", field: e } : { kind: "field", field: e, group_key: a.group_key };
|
|
550
|
+
P(h), requestAnimationFrame(
|
|
534
551
|
() => {
|
|
535
|
-
var
|
|
536
|
-
return (
|
|
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" });
|
|
537
554
|
}
|
|
538
555
|
);
|
|
539
556
|
},
|
|
540
|
-
[t,
|
|
557
|
+
[t, P]
|
|
541
558
|
);
|
|
542
|
-
|
|
543
|
-
const
|
|
544
|
-
(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) => ({
|
|
545
568
|
id: a.id,
|
|
546
569
|
name: a.name,
|
|
547
570
|
outline: a.tone.outline,
|
|
548
571
|
chip: a.tone.chip
|
|
549
572
|
})),
|
|
550
|
-
[
|
|
551
|
-
),
|
|
552
|
-
|
|
553
|
-
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;
|
|
554
577
|
const a = document.querySelector(
|
|
555
|
-
`[data-layout-editor] [data-design-target="${CSS.escape(
|
|
578
|
+
`[data-layout-editor] [data-design-target="${CSS.escape($(e))}"]`
|
|
556
579
|
);
|
|
557
|
-
(
|
|
580
|
+
(h = a == null ? void 0 : a.scrollIntoView) == null || h.call(a, { block: "center" }), a == null || a.focus({ preventScroll: !0 });
|
|
558
581
|
});
|
|
559
|
-
}, []),
|
|
582
|
+
}, []), fo = qo(), j = Vn(c), ft = Hn(), ho = w(
|
|
560
583
|
() => {
|
|
561
584
|
var e, a;
|
|
562
585
|
return {
|
|
563
|
-
settled:
|
|
564
|
-
draft: ((e =
|
|
565
|
-
available: ((a =
|
|
566
|
-
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
|
|
567
590
|
};
|
|
568
591
|
},
|
|
569
|
-
[
|
|
570
|
-
),
|
|
592
|
+
[j.isFetched, j.isError, j.data, ft]
|
|
593
|
+
), Pe = xr(n, c, fo, ho), yo = T(
|
|
571
594
|
(e) => J((a) => a.roleId === e ? a : { ...a, roleId: e }),
|
|
572
595
|
[]
|
|
573
|
-
),
|
|
574
|
-
var
|
|
575
|
-
if (
|
|
576
|
-
const a = document.activeElement,
|
|
577
|
-
|
|
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(
|
|
578
601
|
"open another form",
|
|
579
602
|
() => {
|
|
580
|
-
n.flush(),
|
|
603
|
+
n.flush(), F([]), g(e), m == null || m(e);
|
|
581
604
|
},
|
|
582
|
-
|
|
605
|
+
h
|
|
583
606
|
);
|
|
584
|
-
},
|
|
585
|
-
(e) => t ?
|
|
607
|
+
}, vo = _n(o, t, (A == null ? void 0 : A.rows) ?? [], oe), go = T(
|
|
608
|
+
(e) => t ? er(e, {
|
|
586
609
|
bundle: t,
|
|
587
|
-
selection:
|
|
610
|
+
selection: b,
|
|
588
611
|
select: (a) => {
|
|
589
|
-
|
|
612
|
+
F([a]), N("inspector");
|
|
590
613
|
},
|
|
591
|
-
openSettings: () =>
|
|
592
|
-
openAddPanel: () =>
|
|
593
|
-
root:
|
|
614
|
+
openSettings: () => N("settings"),
|
|
615
|
+
openAddPanel: () => re("add"),
|
|
616
|
+
root: M.current
|
|
594
617
|
}) : Promise.resolve({ ok: !1, message: "The form is still loading" }),
|
|
595
|
-
[t,
|
|
596
|
-
),
|
|
597
|
-
|
|
598
|
-
const
|
|
618
|
+
[t, b]
|
|
619
|
+
), ht = z(oe);
|
|
620
|
+
ht.current = oe;
|
|
621
|
+
const ko = T(
|
|
599
622
|
(e) => {
|
|
600
623
|
if (e.kind === "record")
|
|
601
|
-
J((a) => ({ ...a, record: { id: e.id, label: `#${e.id}` } }));
|
|
602
|
-
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);
|
|
603
626
|
else {
|
|
604
|
-
const a = t == null ? void 0 : t.placements.find((
|
|
605
|
-
if (!a) return
|
|
606
|
-
const
|
|
607
|
-
|
|
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(
|
|
608
631
|
() => {
|
|
609
|
-
var
|
|
610
|
-
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" });
|
|
611
634
|
}
|
|
612
635
|
);
|
|
613
636
|
}
|
|
614
637
|
},
|
|
615
|
-
[t,
|
|
616
|
-
),
|
|
617
|
-
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,
|
|
618
641
|
bundle: t,
|
|
619
|
-
parent:
|
|
620
|
-
fields:
|
|
621
|
-
onSelect:
|
|
622
|
-
showHidden:
|
|
623
|
-
setShowHidden:
|
|
624
|
-
canvasShown: !(
|
|
625
|
-
}),
|
|
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 ? {
|
|
626
673
|
role: "dialog",
|
|
627
674
|
"aria-modal": !0,
|
|
628
|
-
"aria-label": `Edit form ${
|
|
675
|
+
"aria-label": `Edit form ${ge}`,
|
|
629
676
|
tabIndex: -1
|
|
630
|
-
} : {},
|
|
677
|
+
} : {}, wo = /* @__PURE__ */ y(
|
|
631
678
|
"div",
|
|
632
679
|
{
|
|
633
680
|
ref: (e) => {
|
|
634
|
-
|
|
681
|
+
M.current = e, se && (oo.current = e);
|
|
635
682
|
},
|
|
636
683
|
"data-layout-editor": "",
|
|
637
684
|
"data-mode": l,
|
|
638
|
-
...
|
|
685
|
+
...bo,
|
|
639
686
|
className: G(
|
|
640
687
|
"flex min-h-0 flex-col bg-slate-50 outline-none dark:bg-background",
|
|
641
|
-
|
|
688
|
+
se ? "fixed inset-0 z-[90]" : "flex-1"
|
|
642
689
|
),
|
|
643
690
|
children: [
|
|
644
|
-
/* @__PURE__ */
|
|
645
|
-
|
|
691
|
+
/* @__PURE__ */ r(
|
|
692
|
+
Cr,
|
|
646
693
|
{
|
|
647
|
-
collection:
|
|
648
|
-
layoutId:
|
|
649
|
-
layoutName:
|
|
650
|
-
layoutType:
|
|
651
|
-
row:
|
|
652
|
-
fields:
|
|
653
|
-
draft:
|
|
654
|
-
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,
|
|
655
702
|
onPreview: J,
|
|
656
|
-
showHidden:
|
|
657
|
-
onShowHidden:
|
|
658
|
-
onBack:
|
|
659
|
-
backLabel:
|
|
660
|
-
onShowOnCanvas:
|
|
661
|
-
onReviewChanges:
|
|
662
|
-
reviewing: ((
|
|
663
|
-
onOpenUnsaved:
|
|
664
|
-
pendingTip:
|
|
665
|
-
presence: /* @__PURE__ */ y(
|
|
666
|
-
/* @__PURE__ */
|
|
667
|
-
|
|
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,
|
|
668
715
|
{
|
|
669
|
-
peers:
|
|
716
|
+
peers: Be,
|
|
670
717
|
describe: (e) => {
|
|
671
|
-
const a =
|
|
672
|
-
return a && t &&
|
|
718
|
+
const a = Bt(e);
|
|
719
|
+
return a && t && je(a, t, C) ? qt(a, t, E) : null;
|
|
673
720
|
},
|
|
674
721
|
onJump: (e) => {
|
|
675
|
-
const a =
|
|
676
|
-
a &&
|
|
722
|
+
const a = Bt(e);
|
|
723
|
+
a && mt(a);
|
|
677
724
|
}
|
|
678
725
|
}
|
|
679
726
|
),
|
|
680
|
-
/* @__PURE__ */
|
|
727
|
+
/* @__PURE__ */ r(qn, { others: ((Ot = j.data) == null ? void 0 : Ot.others) ?? [] })
|
|
681
728
|
] }),
|
|
682
729
|
onSelectField: (e) => {
|
|
683
730
|
var a;
|
|
684
|
-
return
|
|
731
|
+
return P({
|
|
685
732
|
kind: "field",
|
|
686
733
|
field: e,
|
|
687
|
-
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
|
|
688
735
|
});
|
|
689
736
|
},
|
|
690
|
-
view: t &&
|
|
691
|
-
/* @__PURE__ */
|
|
692
|
-
/* @__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 })
|
|
693
740
|
] }) : null,
|
|
694
|
-
tools: /* @__PURE__ */ y(
|
|
695
|
-
t &&
|
|
696
|
-
t && /* @__PURE__ */
|
|
697
|
-
t &&
|
|
698
|
-
t &&
|
|
699
|
-
/* @__PURE__ */
|
|
700
|
-
t && /* @__PURE__ */
|
|
701
|
-
|
|
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,
|
|
702
749
|
{
|
|
703
|
-
outline:
|
|
704
|
-
open:
|
|
705
|
-
onToggle: () =>
|
|
750
|
+
outline: k ? {
|
|
751
|
+
open: x.outlineOpen,
|
|
752
|
+
onToggle: () => x.setOutlineOpen(!x.outlineOpen)
|
|
706
753
|
} : null
|
|
707
754
|
}
|
|
708
755
|
),
|
|
709
|
-
t && /* @__PURE__ */
|
|
710
|
-
|
|
756
|
+
t && /* @__PURE__ */ r(
|
|
757
|
+
dn,
|
|
711
758
|
{
|
|
712
|
-
view:
|
|
713
|
-
compact:
|
|
714
|
-
onCompact:
|
|
715
|
-
onExpandAll:
|
|
716
|
-
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
|
|
717
765
|
} : null
|
|
718
766
|
}
|
|
719
767
|
),
|
|
720
|
-
t &&
|
|
721
|
-
|
|
768
|
+
t && k && /* @__PURE__ */ r(
|
|
769
|
+
Ve,
|
|
722
770
|
{
|
|
723
771
|
label: "Show how full each field is",
|
|
724
|
-
icon: /* @__PURE__ */
|
|
772
|
+
icon: /* @__PURE__ */ r(Lo, { className: "h-3.5 w-3.5" }),
|
|
725
773
|
hint: "The share of records with a value, on each field",
|
|
726
|
-
checked:
|
|
727
|
-
onClick: () =>
|
|
774
|
+
checked: H,
|
|
775
|
+
onClick: () => me(!H),
|
|
728
776
|
data: { "data-editor-fill-toggle": "" }
|
|
729
777
|
}
|
|
730
778
|
),
|
|
731
|
-
t &&
|
|
732
|
-
|
|
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,
|
|
733
792
|
{
|
|
734
793
|
label: "Set the tab order",
|
|
735
|
-
icon: /* @__PURE__ */
|
|
794
|
+
icon: /* @__PURE__ */ r(Co, { className: "h-3.5 w-3.5" }),
|
|
736
795
|
hint: "Click fields in the order Tab should visit them",
|
|
737
|
-
checked:
|
|
738
|
-
onClick: () =>
|
|
796
|
+
checked: _.active,
|
|
797
|
+
onClick: () => _.active ? _.cancel() : _e.startTabOrder(),
|
|
739
798
|
data: { "data-editor-tab-order-toggle": "" }
|
|
740
799
|
}
|
|
741
800
|
),
|
|
742
|
-
t &&
|
|
743
|
-
|
|
801
|
+
t && k && /* @__PURE__ */ r(
|
|
802
|
+
Er,
|
|
744
803
|
{
|
|
745
|
-
on:
|
|
746
|
-
onChange:
|
|
747
|
-
appDark:
|
|
748
|
-
disabled:
|
|
804
|
+
on: Ke,
|
|
805
|
+
onChange: no,
|
|
806
|
+
appDark: Me,
|
|
807
|
+
disabled: R !== "canvas"
|
|
749
808
|
}
|
|
750
809
|
),
|
|
751
|
-
/* @__PURE__ */
|
|
752
|
-
/* @__PURE__ */
|
|
753
|
-
|
|
810
|
+
/* @__PURE__ */ r(Re, {}),
|
|
811
|
+
/* @__PURE__ */ r(
|
|
812
|
+
or,
|
|
754
813
|
{
|
|
755
|
-
collection:
|
|
756
|
-
layoutId:
|
|
814
|
+
collection: o,
|
|
815
|
+
layoutId: c,
|
|
757
816
|
dirty: n.dirty,
|
|
758
|
-
recorder:
|
|
817
|
+
recorder: we
|
|
759
818
|
}
|
|
760
819
|
),
|
|
761
|
-
/* @__PURE__ */
|
|
762
|
-
/* @__PURE__ */
|
|
763
|
-
t && /* @__PURE__ */
|
|
820
|
+
/* @__PURE__ */ r($r, { bundle: t, collection: o }),
|
|
821
|
+
/* @__PURE__ */ r(Re, {}),
|
|
822
|
+
t && /* @__PURE__ */ r(cn, { shortcuts: x.shortcuts })
|
|
764
823
|
] }),
|
|
765
|
-
ai: /* @__PURE__ */ y(
|
|
766
|
-
t &&
|
|
767
|
-
|
|
824
|
+
ai: /* @__PURE__ */ y(ie, { children: [
|
|
825
|
+
t && k && /* @__PURE__ */ r(
|
|
826
|
+
Qo,
|
|
768
827
|
{
|
|
769
|
-
collection:
|
|
770
|
-
layoutId:
|
|
828
|
+
collection: o,
|
|
829
|
+
layoutId: c,
|
|
771
830
|
draft: n,
|
|
772
|
-
onOpenLayout:
|
|
831
|
+
onOpenLayout: oe
|
|
773
832
|
}
|
|
774
833
|
),
|
|
775
|
-
t && /* @__PURE__ */
|
|
776
|
-
|
|
834
|
+
t && /* @__PURE__ */ r(
|
|
835
|
+
Go,
|
|
777
836
|
{
|
|
778
|
-
collection:
|
|
779
|
-
layoutId:
|
|
837
|
+
collection: o,
|
|
838
|
+
layoutId: c,
|
|
780
839
|
bundle: t,
|
|
781
840
|
apply: n.apply,
|
|
782
|
-
previewRecordShown:
|
|
783
|
-
onPins:
|
|
784
|
-
onSelect:
|
|
841
|
+
previewRecordShown: L.record != null,
|
|
842
|
+
onPins: Gt,
|
|
843
|
+
onSelect: P
|
|
785
844
|
}
|
|
786
845
|
),
|
|
787
|
-
/* @__PURE__ */
|
|
788
|
-
t && p.isAdmin && /* @__PURE__ */
|
|
789
|
-
|
|
846
|
+
/* @__PURE__ */ r(Re, {}),
|
|
847
|
+
t && p.isAdmin && /* @__PURE__ */ r(
|
|
848
|
+
Yo,
|
|
790
849
|
{
|
|
791
|
-
active:
|
|
792
|
-
onClick: () =>
|
|
850
|
+
active: U === "ask",
|
|
851
|
+
onClick: () => N((e) => e === "ask" ? "inspector" : "ask")
|
|
793
852
|
}
|
|
794
853
|
),
|
|
795
|
-
/* @__PURE__ */
|
|
796
|
-
t && /* @__PURE__ */
|
|
854
|
+
/* @__PURE__ */ r(yr, { collection: o, layoutId: c, draft: n }),
|
|
855
|
+
t && /* @__PURE__ */ r(tr, { layoutId: c, draft: n })
|
|
797
856
|
] }),
|
|
798
|
-
testing: t ? /* @__PURE__ */
|
|
799
|
-
|
|
857
|
+
testing: t ? /* @__PURE__ */ r(
|
|
858
|
+
Gn,
|
|
800
859
|
{
|
|
801
|
-
collection:
|
|
802
|
-
layoutId:
|
|
860
|
+
collection: o,
|
|
861
|
+
layoutId: c,
|
|
803
862
|
bundle: t,
|
|
804
|
-
parent:
|
|
863
|
+
parent: C,
|
|
805
864
|
apply: n.apply,
|
|
806
865
|
dirty: n.dirty,
|
|
807
|
-
fields:
|
|
866
|
+
fields: E
|
|
808
867
|
}
|
|
809
868
|
) : null,
|
|
810
|
-
beforeSave: t ? /* @__PURE__ */
|
|
811
|
-
|
|
869
|
+
beforeSave: t ? /* @__PURE__ */ r(
|
|
870
|
+
jn,
|
|
812
871
|
{
|
|
813
|
-
collection:
|
|
814
|
-
layoutId:
|
|
872
|
+
collection: o,
|
|
873
|
+
layoutId: c,
|
|
815
874
|
bundle: t,
|
|
816
|
-
parent:
|
|
875
|
+
parent: C,
|
|
817
876
|
apply: n.apply,
|
|
818
877
|
dirty: n.dirty,
|
|
819
|
-
fields:
|
|
878
|
+
fields: E
|
|
820
879
|
}
|
|
821
880
|
) : null,
|
|
822
|
-
previewExtra: /* @__PURE__ */ y(
|
|
823
|
-
/* @__PURE__ */
|
|
824
|
-
|
|
881
|
+
previewExtra: /* @__PURE__ */ y(ie, { children: [
|
|
882
|
+
/* @__PURE__ */ r(
|
|
883
|
+
Nn,
|
|
825
884
|
{
|
|
826
|
-
collection:
|
|
827
|
-
value:
|
|
885
|
+
collection: o,
|
|
886
|
+
value: L,
|
|
828
887
|
onChange: J,
|
|
829
|
-
layout:
|
|
830
|
-
fields:
|
|
888
|
+
layout: fe,
|
|
889
|
+
fields: E
|
|
831
890
|
}
|
|
832
891
|
),
|
|
833
|
-
/* @__PURE__ */
|
|
892
|
+
/* @__PURE__ */ r(Wo, { scope: It, options: Ht })
|
|
834
893
|
] }),
|
|
835
|
-
problems: t && /* @__PURE__ */
|
|
836
|
-
|
|
894
|
+
problems: t && /* @__PURE__ */ r(
|
|
895
|
+
tn,
|
|
837
896
|
{
|
|
838
|
-
findings:
|
|
839
|
-
active:
|
|
840
|
-
onClick: () =>
|
|
897
|
+
findings: Te.findings,
|
|
898
|
+
active: U === "checks",
|
|
899
|
+
onClick: () => N((e) => e === "checks" ? "inspector" : "checks")
|
|
841
900
|
}
|
|
842
901
|
),
|
|
843
|
-
more: /* @__PURE__ */
|
|
844
|
-
|
|
902
|
+
more: /* @__PURE__ */ r(
|
|
903
|
+
Dn,
|
|
845
904
|
{
|
|
846
|
-
collection:
|
|
905
|
+
collection: o,
|
|
847
906
|
bundle: t,
|
|
848
|
-
previewRecord:
|
|
849
|
-
onOpenLayout:
|
|
907
|
+
previewRecord: L.record,
|
|
908
|
+
onOpenLayout: oe
|
|
850
909
|
}
|
|
851
910
|
)
|
|
852
911
|
}
|
|
853
912
|
),
|
|
854
|
-
|
|
855
|
-
|
|
913
|
+
se && /* @__PURE__ */ r(
|
|
914
|
+
va,
|
|
856
915
|
{
|
|
857
|
-
collection:
|
|
858
|
-
layoutId:
|
|
859
|
-
name:
|
|
860
|
-
row:
|
|
861
|
-
rows: (
|
|
862
|
-
fields:
|
|
863
|
-
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
|
|
864
923
|
}
|
|
865
924
|
),
|
|
866
925
|
n.status === "conflict" && n.dirty && /* @__PURE__ */ y(
|
|
@@ -870,10 +929,10 @@ function ks({
|
|
|
870
929
|
"data-unsaved-conflict": "",
|
|
871
930
|
className: G(
|
|
872
931
|
"flex shrink-0 items-center gap-3 border-b px-4 py-1.5 text-[12.5px]",
|
|
873
|
-
|
|
932
|
+
We
|
|
874
933
|
),
|
|
875
934
|
children: [
|
|
876
|
-
/* @__PURE__ */
|
|
935
|
+
/* @__PURE__ */ r(At, { className: "h-3.5 w-3.5 shrink-0" }),
|
|
877
936
|
/* @__PURE__ */ y("p", { className: "m-0 min-w-0 flex-1", children: [
|
|
878
937
|
n.error ?? "Someone else saved this form",
|
|
879
938
|
". Save again to try once more, or reload their version."
|
|
@@ -887,7 +946,7 @@ function ks({
|
|
|
887
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",
|
|
888
947
|
children: [
|
|
889
948
|
"Reload (discard my ",
|
|
890
|
-
|
|
949
|
+
Zn(n.unsavedCount),
|
|
891
950
|
")"
|
|
892
951
|
]
|
|
893
952
|
}
|
|
@@ -895,59 +954,62 @@ function ks({
|
|
|
895
954
|
]
|
|
896
955
|
}
|
|
897
956
|
),
|
|
898
|
-
/* @__PURE__ */
|
|
899
|
-
/* @__PURE__ */
|
|
900
|
-
|
|
957
|
+
/* @__PURE__ */ r(mr, { labels: n.dropped, onDismiss: n.clearDropped }),
|
|
958
|
+
/* @__PURE__ */ r(
|
|
959
|
+
fr,
|
|
901
960
|
{
|
|
902
|
-
state:
|
|
903
|
-
onRecover:
|
|
904
|
-
onDismiss:
|
|
961
|
+
state: Pe.state,
|
|
962
|
+
onRecover: Pe.recover,
|
|
963
|
+
onDismiss: Pe.dismiss
|
|
905
964
|
}
|
|
906
965
|
),
|
|
907
|
-
|
|
966
|
+
xt && /* @__PURE__ */ y(
|
|
908
967
|
"div",
|
|
909
968
|
{
|
|
910
969
|
role: "note",
|
|
911
970
|
className: G(
|
|
912
971
|
"flex shrink-0 items-center gap-2 border-b px-4 py-1.5 text-[12.5px]",
|
|
913
|
-
|
|
972
|
+
We
|
|
914
973
|
),
|
|
915
974
|
children: [
|
|
916
|
-
/* @__PURE__ */
|
|
917
|
-
|
|
975
|
+
/* @__PURE__ */ r(At, { className: "h-3.5 w-3.5 shrink-0" }),
|
|
976
|
+
xt
|
|
918
977
|
]
|
|
919
978
|
}
|
|
920
979
|
),
|
|
921
|
-
|
|
980
|
+
te && /* @__PURE__ */ y(
|
|
922
981
|
"div",
|
|
923
982
|
{
|
|
924
983
|
role: "note",
|
|
925
|
-
"data-editor-frozen":
|
|
984
|
+
"data-editor-frozen": te.until,
|
|
926
985
|
className: G(
|
|
927
986
|
"flex shrink-0 items-center gap-2 border-b px-4 py-1.5 text-[12.5px]",
|
|
928
|
-
|
|
987
|
+
We
|
|
929
988
|
),
|
|
930
989
|
children: [
|
|
931
|
-
/* @__PURE__ */
|
|
932
|
-
|
|
990
|
+
/* @__PURE__ */ r(Po, { className: "h-3.5 w-3.5 shrink-0" }),
|
|
991
|
+
Ut(te)
|
|
933
992
|
]
|
|
934
993
|
}
|
|
935
994
|
),
|
|
936
|
-
/* @__PURE__ */
|
|
937
|
-
/* @__PURE__ */
|
|
938
|
-
|
|
995
|
+
/* @__PURE__ */ r(Mr, { explain: ee, onShow: io }),
|
|
996
|
+
/* @__PURE__ */ r(
|
|
997
|
+
gr,
|
|
939
998
|
{
|
|
940
999
|
bundle: t,
|
|
941
1000
|
apply: n.apply,
|
|
942
|
-
onDragActive:
|
|
943
|
-
onDropOnLayout:
|
|
1001
|
+
onDragActive: to,
|
|
1002
|
+
onDropOnLayout: vo,
|
|
1003
|
+
selection: b,
|
|
1004
|
+
undo: uo,
|
|
1005
|
+
warnTrash: co,
|
|
944
1006
|
children: /* @__PURE__ */ y("div", { className: "flex min-h-0 flex-1 overflow-hidden", children: [
|
|
945
1007
|
/* @__PURE__ */ y(
|
|
946
1008
|
"aside",
|
|
947
1009
|
{
|
|
948
1010
|
className: G(
|
|
949
1011
|
"flex w-[260px] shrink-0 flex-col border-r border-slate-200 bg-white dark:border-border dark:bg-card",
|
|
950
|
-
|
|
1012
|
+
yt && "hidden"
|
|
951
1013
|
),
|
|
952
1014
|
children: [
|
|
953
1015
|
/* @__PURE__ */ y(
|
|
@@ -957,15 +1019,15 @@ function ks({
|
|
|
957
1019
|
"aria-label": "Left panel",
|
|
958
1020
|
className: "flex shrink-0 items-center gap-1 border-b border-slate-200 px-2 py-1.5 dark:border-border",
|
|
959
1021
|
children: [
|
|
960
|
-
/* @__PURE__ */
|
|
1022
|
+
/* @__PURE__ */ r(
|
|
961
1023
|
"button",
|
|
962
1024
|
{
|
|
963
1025
|
type: "button",
|
|
964
1026
|
role: "tab",
|
|
965
|
-
"aria-selected":
|
|
1027
|
+
"aria-selected": q === "layouts",
|
|
966
1028
|
"data-editor-tab": "layouts",
|
|
967
|
-
className:
|
|
968
|
-
onClick: () =>
|
|
1029
|
+
className: Ge(q === "layouts"),
|
|
1030
|
+
onClick: () => re("layouts"),
|
|
969
1031
|
children: "Forms"
|
|
970
1032
|
}
|
|
971
1033
|
),
|
|
@@ -974,14 +1036,14 @@ function ks({
|
|
|
974
1036
|
{
|
|
975
1037
|
type: "button",
|
|
976
1038
|
role: "tab",
|
|
977
|
-
"aria-selected":
|
|
1039
|
+
"aria-selected": q === "add",
|
|
978
1040
|
"data-editor-tab": "add",
|
|
979
|
-
className:
|
|
980
|
-
onClick: () =>
|
|
1041
|
+
className: Ge(q === "add"),
|
|
1042
|
+
onClick: () => re("add"),
|
|
981
1043
|
disabled: !t,
|
|
982
1044
|
"data-tip": "Add a field, section, panel or widget after the selection",
|
|
983
1045
|
children: [
|
|
984
|
-
/* @__PURE__ */
|
|
1046
|
+
/* @__PURE__ */ r(Ro, { className: "h-3.5 w-3.5" }),
|
|
985
1047
|
"Add"
|
|
986
1048
|
]
|
|
987
1049
|
}
|
|
@@ -991,14 +1053,14 @@ function ks({
|
|
|
991
1053
|
{
|
|
992
1054
|
type: "button",
|
|
993
1055
|
role: "tab",
|
|
994
|
-
"aria-selected":
|
|
1056
|
+
"aria-selected": q === "usage",
|
|
995
1057
|
"data-editor-tab": "usage",
|
|
996
|
-
className:
|
|
997
|
-
onClick: () =>
|
|
1058
|
+
className: Ge(q === "usage"),
|
|
1059
|
+
onClick: () => re("usage"),
|
|
998
1060
|
disabled: !t,
|
|
999
1061
|
"data-tip": "How this form is used and where it slows people down",
|
|
1000
1062
|
children: [
|
|
1001
|
-
/* @__PURE__ */
|
|
1063
|
+
/* @__PURE__ */ r(Oo, { className: "h-3.5 w-3.5" }),
|
|
1002
1064
|
"Usage"
|
|
1003
1065
|
]
|
|
1004
1066
|
}
|
|
@@ -1006,210 +1068,215 @@ function ks({
|
|
|
1006
1068
|
]
|
|
1007
1069
|
}
|
|
1008
1070
|
),
|
|
1009
|
-
/* @__PURE__ */
|
|
1010
|
-
|
|
1071
|
+
/* @__PURE__ */ r("div", { className: "min-h-0 flex-1 overflow-y-auto", children: q === "add" && t ? /* @__PURE__ */ r(
|
|
1072
|
+
Ho,
|
|
1011
1073
|
{
|
|
1012
1074
|
bundle: t,
|
|
1013
|
-
collection:
|
|
1014
|
-
selected:
|
|
1075
|
+
collection: o,
|
|
1076
|
+
selected: W,
|
|
1015
1077
|
apply: n.apply,
|
|
1016
|
-
onSelect:
|
|
1078
|
+
onSelect: P,
|
|
1079
|
+
removed: le.entries
|
|
1017
1080
|
}
|
|
1018
|
-
) :
|
|
1019
|
-
|
|
1081
|
+
) : q === "usage" && t ? /* @__PURE__ */ r(
|
|
1082
|
+
Xn,
|
|
1020
1083
|
{
|
|
1021
1084
|
bundle: t,
|
|
1022
|
-
collection:
|
|
1023
|
-
fields:
|
|
1085
|
+
collection: o,
|
|
1086
|
+
fields: E,
|
|
1024
1087
|
apply: n.apply,
|
|
1025
|
-
showFill:
|
|
1026
|
-
onShowFill:
|
|
1027
|
-
onOpenLayout:
|
|
1088
|
+
showFill: H,
|
|
1089
|
+
onShowFill: me,
|
|
1090
|
+
onOpenLayout: oe
|
|
1028
1091
|
}
|
|
1029
|
-
) : /* @__PURE__ */
|
|
1030
|
-
|
|
1092
|
+
) : /* @__PURE__ */ r(
|
|
1093
|
+
Xr,
|
|
1031
1094
|
{
|
|
1032
|
-
collection:
|
|
1033
|
-
currentId:
|
|
1034
|
-
onOpen:
|
|
1035
|
-
settingsOpen:
|
|
1036
|
-
onSettings: () =>
|
|
1095
|
+
collection: o,
|
|
1096
|
+
currentId: c,
|
|
1097
|
+
onOpen: oe,
|
|
1098
|
+
settingsOpen: U === "settings",
|
|
1099
|
+
onSettings: () => N("settings"),
|
|
1037
1100
|
dropTargets: !0
|
|
1038
1101
|
}
|
|
1039
1102
|
) })
|
|
1040
1103
|
]
|
|
1041
1104
|
}
|
|
1042
1105
|
),
|
|
1043
|
-
|
|
1106
|
+
yt && t && /* @__PURE__ */ r(
|
|
1044
1107
|
"aside",
|
|
1045
1108
|
{
|
|
1046
1109
|
"data-editor-outline-panel": "",
|
|
1047
1110
|
className: "flex w-[260px] shrink-0 flex-col border-r border-slate-200 bg-white dark:border-border dark:bg-card",
|
|
1048
|
-
children: /* @__PURE__ */
|
|
1049
|
-
|
|
1111
|
+
children: /* @__PURE__ */ r(
|
|
1112
|
+
un,
|
|
1050
1113
|
{
|
|
1051
1114
|
bundle: t,
|
|
1052
|
-
nodes:
|
|
1053
|
-
selection:
|
|
1054
|
-
onPick:
|
|
1055
|
-
onMoved:
|
|
1115
|
+
nodes: x.nodes,
|
|
1116
|
+
selection: b,
|
|
1117
|
+
onPick: x.selectAndReveal,
|
|
1118
|
+
onMoved: lt,
|
|
1056
1119
|
apply: n.apply,
|
|
1057
|
-
onClose: () =>
|
|
1120
|
+
onClose: () => x.setOutlineOpen(!1)
|
|
1058
1121
|
}
|
|
1059
1122
|
)
|
|
1060
1123
|
}
|
|
1061
1124
|
),
|
|
1062
|
-
/* @__PURE__ */ y("main", { className: "min-w-0 flex-1 overflow-y-auto", children: [
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
t &&
|
|
1066
|
-
|
|
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,
|
|
1067
1130
|
{
|
|
1068
1131
|
bundle: t,
|
|
1069
|
-
parent:
|
|
1070
|
-
collection:
|
|
1132
|
+
parent: C,
|
|
1133
|
+
collection: o,
|
|
1071
1134
|
apply: n.apply,
|
|
1072
|
-
onSelect:
|
|
1135
|
+
onSelect: P
|
|
1073
1136
|
}
|
|
1074
|
-
) : t &&
|
|
1075
|
-
|
|
1137
|
+
) : t && k && R === "roles" ? /* @__PURE__ */ r(
|
|
1138
|
+
an,
|
|
1076
1139
|
{
|
|
1077
1140
|
bundle: t,
|
|
1078
|
-
parent:
|
|
1141
|
+
parent: C,
|
|
1079
1142
|
apply: n.apply,
|
|
1080
|
-
onSelect:
|
|
1143
|
+
onSelect: P
|
|
1081
1144
|
}
|
|
1082
|
-
) : t &&
|
|
1083
|
-
|
|
1145
|
+
) : t && k && R === "table" ? /* @__PURE__ */ r(
|
|
1146
|
+
Sn,
|
|
1084
1147
|
{
|
|
1085
1148
|
bundle: t,
|
|
1086
|
-
collection:
|
|
1149
|
+
collection: o,
|
|
1087
1150
|
apply: n.apply,
|
|
1088
1151
|
flush: n.flush,
|
|
1089
|
-
selection:
|
|
1090
|
-
onSelect:
|
|
1091
|
-
onSelection:
|
|
1152
|
+
selection: b,
|
|
1153
|
+
onSelect: P,
|
|
1154
|
+
onSelection: F
|
|
1092
1155
|
}
|
|
1093
|
-
) : t ? /* @__PURE__ */
|
|
1156
|
+
) : t ? /* @__PURE__ */ r(
|
|
1094
1157
|
"div",
|
|
1095
1158
|
{
|
|
1096
|
-
"data-canvas-density":
|
|
1097
|
-
|
|
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,
|
|
1098
1162
|
className: G(
|
|
1099
|
-
"min-h-
|
|
1100
|
-
|
|
1101
|
-
|
|
1163
|
+
"flex min-h-0 flex-1 flex-col",
|
|
1164
|
+
Ir(Ke, Me),
|
|
1165
|
+
Ke && !Me && "bg-background text-foreground"
|
|
1102
1166
|
),
|
|
1103
|
-
children: /* @__PURE__ */
|
|
1104
|
-
|
|
1167
|
+
children: /* @__PURE__ */ r(
|
|
1168
|
+
An,
|
|
1105
1169
|
{
|
|
1106
|
-
collection:
|
|
1170
|
+
collection: o,
|
|
1107
1171
|
bundle: t,
|
|
1108
|
-
parent:
|
|
1109
|
-
preview:
|
|
1172
|
+
parent: C,
|
|
1173
|
+
preview: L,
|
|
1110
1174
|
onPreview: J,
|
|
1111
|
-
record:
|
|
1112
|
-
fields:
|
|
1113
|
-
renderPane: (e) => /* @__PURE__ */
|
|
1114
|
-
|
|
1175
|
+
record: L.sample ?? Vt,
|
|
1176
|
+
fields: E,
|
|
1177
|
+
renderPane: (e) => /* @__PURE__ */ r(
|
|
1178
|
+
ya,
|
|
1115
1179
|
{
|
|
1116
|
-
collection:
|
|
1180
|
+
collection: o,
|
|
1117
1181
|
bundle: t,
|
|
1118
|
-
parent:
|
|
1182
|
+
parent: C,
|
|
1119
1183
|
roleId: e.roleId,
|
|
1120
1184
|
stateKey: e.stateKey,
|
|
1121
|
-
marks:
|
|
1122
|
-
overlay:
|
|
1123
|
-
ruleMarks:
|
|
1124
|
-
ghost:
|
|
1125
|
-
deps:
|
|
1185
|
+
marks: Zt(e.marks),
|
|
1186
|
+
overlay: _.overlay(de.wrap(e.overlay)),
|
|
1187
|
+
ruleMarks: ao,
|
|
1188
|
+
ghost: so,
|
|
1189
|
+
deps: ee.deps,
|
|
1126
1190
|
noDnd: e.noDnd,
|
|
1127
1191
|
record: e.record,
|
|
1128
|
-
selected:
|
|
1129
|
-
selection:
|
|
1130
|
-
onSelect:
|
|
1131
|
-
showHidden:
|
|
1132
|
-
fold:
|
|
1133
|
-
reveal:
|
|
1192
|
+
selected: W,
|
|
1193
|
+
selection: b,
|
|
1194
|
+
onSelect: ro,
|
|
1195
|
+
showHidden: Y,
|
|
1196
|
+
fold: x.fold,
|
|
1197
|
+
reveal: x.reveal,
|
|
1134
1198
|
apply: n.apply,
|
|
1135
1199
|
whenIdle: n.whenIdle,
|
|
1136
|
-
fillRate:
|
|
1137
|
-
unsaved:
|
|
1138
|
-
peers:
|
|
1139
|
-
compare:
|
|
1140
|
-
lastChanges:
|
|
1200
|
+
fillRate: Ne,
|
|
1201
|
+
unsaved: mo,
|
|
1202
|
+
peers: po,
|
|
1203
|
+
compare: X.compare,
|
|
1204
|
+
lastChanges: X.compare ? void 0 : jt
|
|
1141
1205
|
}
|
|
1142
1206
|
)
|
|
1143
1207
|
}
|
|
1144
1208
|
)
|
|
1145
1209
|
}
|
|
1146
|
-
) : n.error ? /* @__PURE__ */
|
|
1147
|
-
/* @__PURE__ */
|
|
1148
|
-
/* @__PURE__ */
|
|
1149
|
-
] })
|
|
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 })
|
|
1150
1215
|
] }),
|
|
1151
|
-
/* @__PURE__ */
|
|
1216
|
+
/* @__PURE__ */ r(
|
|
1152
1217
|
"aside",
|
|
1153
1218
|
{
|
|
1154
1219
|
"data-editor-inspector": "",
|
|
1155
1220
|
className: "flex w-[344px] shrink-0 flex-col overflow-hidden border-l border-slate-200 bg-white dark:border-border dark:bg-card",
|
|
1156
|
-
children: t && (
|
|
1157
|
-
|
|
1221
|
+
children: t && (U === "ask" ? /* @__PURE__ */ r(
|
|
1222
|
+
Jo,
|
|
1158
1223
|
{
|
|
1159
|
-
layoutId:
|
|
1160
|
-
layoutName:
|
|
1161
|
-
kind:
|
|
1224
|
+
layoutId: c,
|
|
1225
|
+
layoutName: ge,
|
|
1226
|
+
kind: Wn(t.layout),
|
|
1162
1227
|
bundle: t,
|
|
1163
|
-
thread:
|
|
1164
|
-
setThread:
|
|
1165
|
-
pending:
|
|
1166
|
-
onPendingTaken: () =>
|
|
1167
|
-
jump:
|
|
1168
|
-
onCite:
|
|
1169
|
-
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
|
|
1170
1235
|
}
|
|
1171
|
-
) :
|
|
1172
|
-
|
|
1236
|
+
) : U === "checks" ? /* @__PURE__ */ r(
|
|
1237
|
+
on,
|
|
1173
1238
|
{
|
|
1174
|
-
findings:
|
|
1175
|
-
health:
|
|
1176
|
-
ready:
|
|
1177
|
-
onSelect: (e) =>
|
|
1239
|
+
findings: Te.findings,
|
|
1240
|
+
health: Te.health,
|
|
1241
|
+
ready: Te.ready,
|
|
1242
|
+
onSelect: (e) => F([e]),
|
|
1178
1243
|
apply: n.apply,
|
|
1179
|
-
onOpenAiReview: p.aiReviewSlot ? () =>
|
|
1244
|
+
onOpenAiReview: p.aiReviewSlot ? () => N("settings") : void 0,
|
|
1245
|
+
onTurnOff: Qe.onTurnOff,
|
|
1246
|
+
styleSettings: Qe.settings
|
|
1180
1247
|
}
|
|
1181
|
-
) :
|
|
1182
|
-
|
|
1248
|
+
) : U === "settings" ? /* @__PURE__ */ r(
|
|
1249
|
+
ia,
|
|
1183
1250
|
{
|
|
1184
1251
|
bundle: t,
|
|
1185
1252
|
apply: n.apply,
|
|
1186
1253
|
flush: n.flush,
|
|
1187
|
-
collection:
|
|
1188
|
-
previewRoleId:
|
|
1189
|
-
onPreviewRoleChange:
|
|
1254
|
+
collection: o,
|
|
1255
|
+
previewRoleId: L.roleId,
|
|
1256
|
+
onPreviewRoleChange: yo,
|
|
1190
1257
|
onAskWhere: p.isAdmin ? (e) => {
|
|
1191
|
-
|
|
1258
|
+
pe(e), N("ask");
|
|
1192
1259
|
} : void 0
|
|
1193
1260
|
}
|
|
1194
|
-
) :
|
|
1195
|
-
|
|
1261
|
+
) : b.length > 1 ? /* @__PURE__ */ r(
|
|
1262
|
+
Zr,
|
|
1196
1263
|
{
|
|
1197
1264
|
bundle: t,
|
|
1198
|
-
selection:
|
|
1265
|
+
selection: b,
|
|
1199
1266
|
apply: n.apply,
|
|
1200
|
-
collection:
|
|
1201
|
-
onSelection:
|
|
1267
|
+
collection: o,
|
|
1268
|
+
onSelection: F
|
|
1202
1269
|
}
|
|
1203
|
-
) : /* @__PURE__ */
|
|
1204
|
-
|
|
1270
|
+
) : /* @__PURE__ */ r(
|
|
1271
|
+
la,
|
|
1205
1272
|
{
|
|
1206
1273
|
bundle: t,
|
|
1207
|
-
target:
|
|
1274
|
+
target: W,
|
|
1208
1275
|
apply: n.apply,
|
|
1209
1276
|
flush: n.flush,
|
|
1210
|
-
collection:
|
|
1211
|
-
openLayout:
|
|
1212
|
-
onSelect:
|
|
1277
|
+
collection: o,
|
|
1278
|
+
openLayout: oe,
|
|
1279
|
+
onSelect: x.selectAndReveal
|
|
1213
1280
|
}
|
|
1214
1281
|
))
|
|
1215
1282
|
}
|
|
@@ -1217,75 +1284,87 @@ function ks({
|
|
|
1217
1284
|
] })
|
|
1218
1285
|
}
|
|
1219
1286
|
),
|
|
1220
|
-
/* @__PURE__ */
|
|
1221
|
-
|
|
1287
|
+
/* @__PURE__ */ r(
|
|
1288
|
+
Un,
|
|
1222
1289
|
{
|
|
1223
1290
|
bundle: t,
|
|
1224
|
-
selection:
|
|
1291
|
+
selection: b,
|
|
1225
1292
|
apply: n.apply,
|
|
1226
|
-
onSelection:
|
|
1227
|
-
rootRef:
|
|
1293
|
+
onSelection: F,
|
|
1294
|
+
rootRef: M,
|
|
1295
|
+
extraItems: $e.menuItems
|
|
1228
1296
|
}
|
|
1229
1297
|
),
|
|
1230
|
-
/* @__PURE__ */
|
|
1231
|
-
|
|
1298
|
+
/* @__PURE__ */ r(
|
|
1299
|
+
Bn,
|
|
1232
1300
|
{
|
|
1233
|
-
|
|
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,
|
|
1234
1313
|
count: n.unsavedCount,
|
|
1235
|
-
onSave:
|
|
1314
|
+
onSave: Xt,
|
|
1236
1315
|
onDiscard: n.discard,
|
|
1237
|
-
onKeep: () =>
|
|
1238
|
-
note:
|
|
1239
|
-
canSave:
|
|
1316
|
+
onKeep: () => rt(null),
|
|
1317
|
+
note: I ? /* @__PURE__ */ r(cr, { policy: I, value: ve, onChange: Ae }) : void 0,
|
|
1318
|
+
canSave: dr(I, ve)
|
|
1240
1319
|
}
|
|
1241
1320
|
),
|
|
1242
|
-
|
|
1243
|
-
|
|
1321
|
+
I && Xe && /* @__PURE__ */ r(
|
|
1322
|
+
ur,
|
|
1244
1323
|
{
|
|
1245
1324
|
open: !0,
|
|
1246
|
-
anchor:
|
|
1247
|
-
policy:
|
|
1248
|
-
intro:
|
|
1325
|
+
anchor: Xe,
|
|
1326
|
+
policy: I,
|
|
1327
|
+
intro: te ? Ut(te) : void 0,
|
|
1249
1328
|
count: n.unsavedCount,
|
|
1250
|
-
value:
|
|
1251
|
-
onChange:
|
|
1252
|
-
onSave:
|
|
1253
|
-
onClose: () =>
|
|
1329
|
+
value: ve,
|
|
1330
|
+
onChange: Ae,
|
|
1331
|
+
onSave: tt,
|
|
1332
|
+
onClose: () => et(null)
|
|
1254
1333
|
}
|
|
1255
1334
|
),
|
|
1256
|
-
|
|
1257
|
-
|
|
1335
|
+
pt && /* @__PURE__ */ r(
|
|
1336
|
+
hr,
|
|
1258
1337
|
{
|
|
1259
|
-
anchor:
|
|
1338
|
+
anchor: pt,
|
|
1260
1339
|
steps: n.unsavedSteps,
|
|
1261
|
-
exists: (e) => !!t &&
|
|
1262
|
-
describe: (e) =>
|
|
1340
|
+
exists: (e) => !!t && je(e, t, C),
|
|
1341
|
+
describe: (e) => qt(e, t, E),
|
|
1263
1342
|
onJump: (e) => {
|
|
1264
|
-
|
|
1343
|
+
Ce(null), mt(e);
|
|
1265
1344
|
},
|
|
1266
1345
|
onSettings: () => {
|
|
1267
|
-
|
|
1346
|
+
Ce(null), N("settings");
|
|
1268
1347
|
},
|
|
1269
|
-
onClose: () =>
|
|
1348
|
+
onClose: () => Ce(null)
|
|
1270
1349
|
}
|
|
1271
1350
|
)
|
|
1272
1351
|
]
|
|
1273
1352
|
}
|
|
1274
|
-
);
|
|
1275
|
-
if (!
|
|
1276
|
-
return /* @__PURE__ */
|
|
1277
|
-
const
|
|
1278
|
-
return /* @__PURE__ */ y(
|
|
1279
|
-
/* @__PURE__ */
|
|
1280
|
-
/* @__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) }) })
|
|
1281
1360
|
] });
|
|
1282
1361
|
}
|
|
1283
|
-
function
|
|
1284
|
-
const i =
|
|
1285
|
-
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.`;
|
|
1286
1365
|
}
|
|
1287
1366
|
export {
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1367
|
+
ci as LayoutEditor,
|
|
1368
|
+
Ze as isTyping,
|
|
1369
|
+
je as targetExists
|
|
1291
1370
|
};
|