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