@nivaro/react 0.2.53 → 0.2.54
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/full.css +1 -1
- package/dist/hooks/useSessionRecorder.js +1 -1
- package/dist/index.d.ts +113 -2
- package/dist/layout-editor.d.ts +248 -2
- package/dist/shared/components/FormWhatsNew.js +60 -0
- package/dist/shared/components/ItemEditForm.js +4058 -3942
- package/dist/shared/components/RecordReadView.js +219 -211
- package/dist/shared/components/TipLayer.js +27 -27
- package/dist/shared/components/help-videos/api.js +51 -41
- package/dist/shared/components/help-videos/editor/DetailsTab.js +147 -130
- package/dist/shared/components/item-edit/FieldAffordances.js +7 -6
- package/dist/shared/components/item-edit/FieldRow.js +353 -304
- package/dist/shared/components/item-edit/FormHelpVideoButton.js +59 -0
- package/dist/shared/components/item-edit/GroupSection.js +419 -396
- package/dist/shared/components/item-edit/HeaderTools.js +59 -56
- package/dist/shared/components/item-edit/LayoutContentBlock.js +47 -24
- package/dist/shared/components/item-edit/lock-why.js +87 -0
- package/dist/shared/components/item-edit/useFormUsageBeacon.js +59 -0
- package/dist/shared/components/layout-editor/AddPanel.js +204 -146
- package/dist/shared/components/layout-editor/ArrangeButton.js +34 -0
- package/dist/shared/components/layout-editor/AutoArrange.js +86 -0
- package/dist/shared/components/layout-editor/CanvasCompare.js +79 -0
- package/dist/shared/components/layout-editor/ChangeNote.js +146 -0
- package/dist/shared/components/layout-editor/CollabParts.js +170 -0
- package/dist/shared/components/layout-editor/DesignNode.js +304 -115
- package/dist/shared/components/layout-editor/EditorCanvas.js +21 -20
- package/dist/shared/components/layout-editor/EditorTopBar.js +452 -175
- package/dist/shared/components/layout-editor/FindReplace.js +188 -0
- package/dist/shared/components/layout-editor/FormMapButton.js +141 -0
- package/dist/shared/components/layout-editor/HistoryPanel.js +234 -109
- package/dist/shared/components/layout-editor/LayoutEditor.js +1101 -307
- package/dist/shared/components/layout-editor/LayoutsRail.js +94 -67
- package/dist/shared/components/layout-editor/NoteMarker.js +38 -0
- package/dist/shared/components/layout-editor/PlacementsTable.js +187 -0
- package/dist/shared/components/layout-editor/ScheduleChange.js +106 -0
- package/dist/shared/components/layout-editor/SessionHistory.js +84 -0
- package/dist/shared/components/layout-editor/StructureMenu.js +413 -0
- package/dist/shared/components/layout-editor/UnsavedConfirm.js +103 -0
- package/dist/shared/components/layout-editor/ai/AiToolsButton.js +625 -0
- package/dist/shared/components/layout-editor/ai/ChangeCheck.js +153 -0
- package/dist/shared/components/layout-editor/ai/ai-tools-api.js +80 -0
- package/dist/shared/components/layout-editor/ai/assist-ops.js +38 -0
- package/dist/shared/components/layout-editor/ai/autofill-ops.js +73 -0
- package/dist/shared/components/layout-editor/ai/canvas-capture.js +41 -0
- package/dist/shared/components/layout-editor/ai-forms/AiComposer.js +271 -0
- package/dist/shared/components/layout-editor/ai-forms/AiFormsButton.js +182 -0
- package/dist/shared/components/layout-editor/ai-forms/MeaningSuggestions.js +109 -0
- package/dist/shared/components/layout-editor/ai-forms/SlimPanel.js +170 -0
- package/dist/shared/components/layout-editor/ai-forms/ai-forms-api.js +40 -0
- package/dist/shared/components/layout-editor/ai-forms/pending.js +25 -0
- package/dist/shared/components/layout-editor/ai-forms/plan.js +263 -0
- package/dist/shared/components/layout-editor/ai-rules/AiAskPopover.js +160 -0
- package/dist/shared/components/layout-editor/ai-rules/CascadeWriter.js +175 -0
- package/dist/shared/components/layout-editor/ai-rules/FieldRuleWriter.js +97 -0
- package/dist/shared/components/layout-editor/ai-rules/RuleWriter.js +94 -0
- package/dist/shared/components/layout-editor/ai-rules/ValidationSuggest.js +153 -0
- package/dist/shared/components/layout-editor/ai-rules/api.js +6 -0
- package/dist/shared/components/layout-editor/ai-text/AiTextTools.js +383 -0
- package/dist/shared/components/layout-editor/ai-text/text-ops.js +125 -0
- package/dist/shared/components/layout-editor/assist/AskPanel.js +278 -0
- package/dist/shared/components/layout-editor/assist/ExplainDiff.js +93 -0
- package/dist/shared/components/layout-editor/assist/ProposalsButton.js +150 -0
- package/dist/shared/components/layout-editor/assist/assist-api.js +63 -0
- package/dist/shared/components/layout-editor/assist/jump.js +142 -0
- package/dist/shared/components/layout-editor/assist/settings-index.js +118 -0
- package/dist/shared/components/layout-editor/auto-arrange.js +101 -0
- package/dist/shared/components/layout-editor/bulk/BulkChangesButton.js +221 -0
- package/dist/shared/components/layout-editor/bulk/BulkRun.js +237 -0
- package/dist/shared/components/layout-editor/bulk/MacrosPanel.js +230 -0
- package/dist/shared/components/layout-editor/bulk/bulk-api.js +65 -0
- package/dist/shared/components/layout-editor/bulk/field-labels.js +22 -0
- package/dist/shared/components/layout-editor/bulk/macro-record.js +142 -0
- package/dist/shared/components/layout-editor/bulk/useMacroRecorder.js +65 -0
- package/dist/shared/components/layout-editor/bundle-to-active.js +1 -0
- package/dist/shared/components/layout-editor/canvas-diff.js +157 -0
- package/dist/shared/components/layout-editor/collab/FormFollowShare.js +342 -0
- package/dist/shared/components/layout-editor/collab/collab-api.js +77 -0
- package/dist/shared/components/layout-editor/commands/CommandPalette.js +221 -0
- package/dist/shared/components/layout-editor/commands/intents.js +214 -0
- package/dist/shared/components/layout-editor/commands/parse.js +242 -0
- package/dist/shared/components/layout-editor/design-context.js +26 -6
- package/dist/shared/components/layout-editor/dnd/LayoutDndProvider.js +179 -163
- package/dist/shared/components/layout-editor/dnd/collision.js +25 -23
- package/dist/shared/components/layout-editor/dnd/rail-drop.js +56 -0
- package/dist/shared/components/layout-editor/draft-recovery.js +61 -0
- package/dist/shared/components/layout-editor/editor-notes.js +78 -0
- package/dist/shared/components/layout-editor/editors/swap-config.js +1 -0
- package/dist/shared/components/layout-editor/explain/CanvasRules.js +142 -0
- package/dist/shared/components/layout-editor/explain/default-ghosts.js +81 -0
- package/dist/shared/components/layout-editor/explain/driver-hover.js +62 -0
- package/dist/shared/components/layout-editor/explain/field-sources.js +246 -0
- package/dist/shared/components/layout-editor/explain/rule-graph.js +215 -0
- package/dist/shared/components/layout-editor/explain/use-explain.js +132 -0
- package/dist/shared/components/layout-editor/field-zones.js +116 -0
- package/dist/shared/components/layout-editor/form-map.js +138 -0
- package/dist/shared/components/layout-editor/history-api.js +87 -0
- package/dist/shared/components/layout-editor/inheritance.js +55 -0
- package/dist/shared/components/layout-editor/inspect/inspect-api.js +66 -0
- package/dist/shared/components/layout-editor/inspect/picker-preview.js +48 -0
- package/dist/shared/components/layout-editor/inspect/width-fit.js +87 -0
- package/dist/shared/components/layout-editor/inspector/AiFillSetting.js +85 -0
- package/dist/shared/components/layout-editor/inspector/Breadcrumb.js +36 -0
- package/dist/shared/components/layout-editor/inspector/BulkInspector.js +175 -0
- package/dist/shared/components/layout-editor/inspector/ColumnFit.js +112 -0
- package/dist/shared/components/layout-editor/inspector/GroupInspector.js +146 -92
- package/dist/shared/components/layout-editor/inspector/HelpTab.js +174 -0
- package/dist/shared/components/layout-editor/inspector/Inspector.js +256 -175
- package/dist/shared/components/layout-editor/inspector/LookTab.js +46 -40
- package/dist/shared/components/layout-editor/inspector/OverrideNotice.js +61 -0
- package/dist/shared/components/layout-editor/inspector/PickerPreview.js +134 -0
- package/dist/shared/components/layout-editor/inspector/PickerTab.js +167 -141
- package/dist/shared/components/layout-editor/inspector/RulesTab.js +175 -128
- package/dist/shared/components/layout-editor/inspector/Translations.js +156 -0
- package/dist/shared/components/layout-editor/inspector/kit.js +3 -3
- package/dist/shared/components/layout-editor/inspector/tab-request.js +21 -0
- package/dist/shared/components/layout-editor/is-typing.js +9 -0
- package/dist/shared/components/layout-editor/keyboard-move.js +66 -0
- package/dist/shared/components/layout-editor/lint/LintPanel.js +190 -0
- package/dist/shared/components/layout-editor/lint/lint-api.js +52 -0
- package/dist/shared/components/layout-editor/load-error.js +37 -0
- package/dist/shared/components/layout-editor/matrix/FieldStateMatrix.js +305 -0
- package/dist/shared/components/layout-editor/matrix/MatrixGrid.js +181 -0
- package/dist/shared/components/layout-editor/matrix/RoleSectionMatrix.js +147 -0
- package/dist/shared/components/layout-editor/matrix/matrix-api.js +48 -0
- package/dist/shared/components/layout-editor/matrix/role-matrix.js +36 -0
- package/dist/shared/components/layout-editor/matrix/state-matrix.js +145 -0
- package/dist/shared/components/layout-editor/nav/FindPanel.js +109 -0
- package/dist/shared/components/layout-editor/nav/NavTools.js +114 -0
- package/dist/shared/components/layout-editor/nav/OutlinePanel.js +228 -0
- package/dist/shared/components/layout-editor/nav/ShortcutSheet.js +31 -0
- package/dist/shared/components/layout-editor/nav/find.js +20 -0
- package/dist/shared/components/layout-editor/nav/tree.js +142 -0
- package/dist/shared/components/layout-editor/nav/useEditorNav.js +101 -0
- package/dist/shared/components/layout-editor/nav/view-prefs.js +34 -0
- package/dist/shared/components/layout-editor/ops/ChangeRequestsPanel.js +143 -0
- package/dist/shared/components/layout-editor/ops/DependencyDiagram.js +179 -0
- package/dist/shared/components/layout-editor/ops/LayoutOpsBlocks.js +92 -0
- package/dist/shared/components/layout-editor/ops/PromotePanel.js +287 -0
- package/dist/shared/components/layout-editor/ops/ops-api.js +122 -0
- package/dist/shared/components/layout-editor/overview/OverviewActions.js +15 -3
- package/dist/shared/components/layout-editor/overview/describe-conditions.js +18 -14
- package/dist/shared/components/layout-editor/overview/overview-api.js +105 -88
- package/dist/shared/components/layout-editor/panel-style.js +8 -7
- package/dist/shared/components/layout-editor/parity-keys.json.js +4 -0
- package/dist/shared/components/layout-editor/pin.js +25 -0
- package/dist/shared/components/layout-editor/presence.js +111 -0
- package/dist/shared/components/layout-editor/preview/PreviewModes.js +224 -0
- package/dist/shared/components/layout-editor/preview/PreviewPanes.js +262 -0
- package/dist/shared/components/layout-editor/preview/preview-api.js +57 -0
- package/dist/shared/components/layout-editor/preview/preview-model.js +157 -0
- package/dist/shared/components/layout-editor/reuse/FieldMapStep.js +70 -0
- package/dist/shared/components/layout-editor/reuse/FormMoreMenu.js +127 -0
- package/dist/shared/components/layout-editor/reuse/LibraryRows.js +150 -0
- package/dist/shared/components/layout-editor/reuse/NewFormStart.js +20 -0
- package/dist/shared/components/layout-editor/reuse/SectionReuseActions.js +291 -0
- package/dist/shared/components/layout-editor/reuse/field-match.js +77 -0
- package/dist/shared/components/layout-editor/reuse/reuse-api.js +73 -0
- package/dist/shared/components/layout-editor/reuse/seed.js +13 -0
- package/dist/shared/components/layout-editor/reuse/useFormFromRecord.js +43 -0
- package/dist/shared/components/layout-editor/reuse/useRailCopy.js +34 -0
- package/dist/shared/components/layout-editor/settings/FormSettings.js +123 -103
- package/dist/shared/components/layout-editor/settings/InheritanceSection.js +1 -1
- package/dist/shared/components/layout-editor/settings/ToolsSection.js +174 -100
- package/dist/shared/components/layout-editor/settings/WhoSection.js +136 -100
- package/dist/shared/components/layout-editor/settings/controls.js +8 -8
- package/dist/shared/components/layout-editor/settings/settings-registry.js +35 -11
- package/dist/shared/components/layout-editor/shortcuts.js +88 -0
- package/dist/shared/components/layout-editor/show-when.js +35 -0
- package/dist/shared/components/layout-editor/slot-names.js +4 -3
- package/dist/shared/components/layout-editor/structure-ops.js +399 -0
- package/dist/shared/components/layout-editor/testing/CostLimitSetting.js +42 -0
- package/dist/shared/components/layout-editor/testing/TestingPanels.js +551 -0
- package/dist/shared/components/layout-editor/testing/testing-api.js +67 -0
- package/dist/shared/components/layout-editor/testing/testing-model.js +393 -0
- package/dist/shared/components/layout-editor/testing/use-record-check.js +44 -0
- package/dist/shared/components/layout-editor/toolbar-kit.js +242 -0
- package/dist/shared/components/layout-editor/unsaved-marks.js +72 -0
- package/dist/shared/components/layout-editor/usage/FillChip.js +27 -0
- package/dist/shared/components/layout-editor/usage/UsagePanel.js +158 -0
- package/dist/shared/components/layout-editor/usage/suggest-sections.js +55 -0
- package/dist/shared/components/layout-editor/usage/usage-api.js +104 -0
- package/dist/shared/components/layout-editor/useLayoutDraft.js +573 -307
- package/dist/shared/components/support/SuggestFormChange.js +143 -0
- package/dist/shared/lib/ai-fill.js +37 -0
- package/dist/shared/lib/form-usage-beacon.js +84 -0
- package/dist/shared/lib/layout-i18n.js +66 -0
- package/dist/shared/lib/layout-lint.js +490 -0
- package/dist/shared/lib/layout-ops.js +110 -106
- package/dist/shared/lib/screenshot.js +54 -28
- package/dist/shared/lib/visible-when.js +34 -0
- package/package.json +1 -1
|
@@ -1,83 +1,110 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { SlidersHorizontal as
|
|
3
|
-
import { useMemo as
|
|
4
|
-
import { cn as
|
|
5
|
-
import { Skeleton as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
1
|
+
import { jsxs as i, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { SlidersHorizontal as b } from "lucide-react";
|
|
3
|
+
import { useMemo as v } from "react";
|
|
4
|
+
import { cn as x } from "../../lib/utils.js";
|
|
5
|
+
import { Skeleton as y } from "../ui/skeleton.js";
|
|
6
|
+
import { useRailDrop as k } from "./dnd/rail-drop.js";
|
|
7
|
+
import { useLayoutOverview as N, useOverviewFields as _, useRuleChoiceLabels as S } from "./overview/overview-api.js";
|
|
8
|
+
import { Sentence as L, purposeSegments as R, rowPill as C, Pill as w } from "./overview/purpose.js";
|
|
9
|
+
const F = [
|
|
9
10
|
{ id: "forms", title: "Forms" },
|
|
10
11
|
{ id: "link_only", title: "Link only" },
|
|
11
12
|
{ id: "other_views", title: "Other views" },
|
|
12
13
|
{ id: "unused", title: "Unused" }
|
|
13
|
-
],
|
|
14
|
-
function
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
], h = "px-2 pb-1 pt-3 text-[11.5px] font-semibold text-slate-500 dark:text-muted-foreground";
|
|
15
|
+
function j({
|
|
16
|
+
row: t,
|
|
17
|
+
current: o,
|
|
18
|
+
settingsOpen: m,
|
|
19
|
+
unused: d,
|
|
20
|
+
dropTarget: c,
|
|
17
21
|
onOpen: p,
|
|
18
|
-
|
|
19
|
-
onSettings: f
|
|
22
|
+
children: r
|
|
20
23
|
}) {
|
|
21
|
-
const
|
|
22
|
-
return /* @__PURE__ */
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
24
|
+
const a = k(t.layout_id, o || !c), u = o && !m, l = C(t);
|
|
25
|
+
return /* @__PURE__ */ i(
|
|
26
|
+
"button",
|
|
27
|
+
{
|
|
28
|
+
ref: a.ref,
|
|
29
|
+
type: "button",
|
|
30
|
+
"data-rail-layout": t.layout_id,
|
|
31
|
+
"data-rail-drop": a.over ? "over" : a.armed ? "armed" : void 0,
|
|
32
|
+
"aria-current": o ? "page" : void 0,
|
|
33
|
+
onClick: () => p(t.layout_id),
|
|
34
|
+
className: x(
|
|
35
|
+
"flex flex-col gap-px rounded-md px-2 py-1.5 text-left transition-colors",
|
|
36
|
+
u ? "bg-accent" : "hover:bg-muted",
|
|
37
|
+
o && m && "bg-muted",
|
|
38
|
+
a.armed && "outline-dashed outline-1 -outline-offset-1 outline-slate-300 dark:outline-border",
|
|
39
|
+
a.over && "bg-nvr-cyan/10 outline-nvr-cyan dark:outline-nvr-cyan"
|
|
40
|
+
),
|
|
41
|
+
children: [
|
|
42
|
+
/* @__PURE__ */ i(
|
|
43
|
+
"span",
|
|
44
|
+
{
|
|
45
|
+
className: x(
|
|
46
|
+
"flex min-w-0 items-center gap-1.5 text-[12.5px] font-semibold text-slate-900 dark:text-foreground",
|
|
47
|
+
d && "font-medium text-slate-500 dark:text-muted-foreground"
|
|
48
|
+
),
|
|
49
|
+
children: [
|
|
50
|
+
/* @__PURE__ */ e("span", { className: "truncate", children: t.name }),
|
|
51
|
+
l && /* @__PURE__ */ e(w, { tone: l.tone, children: l.text }),
|
|
52
|
+
a.over && /* @__PURE__ */ e("span", { className: "ml-auto shrink-0 text-[11px] font-medium text-[#0089ad] dark:text-nvr-cyan", children: "Copy here" })
|
|
53
|
+
]
|
|
54
|
+
}
|
|
55
|
+
),
|
|
56
|
+
r
|
|
57
|
+
]
|
|
58
|
+
}
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
function M({
|
|
62
|
+
collection: t,
|
|
63
|
+
currentId: o,
|
|
64
|
+
onOpen: m,
|
|
65
|
+
settingsOpen: d,
|
|
66
|
+
onSettings: c,
|
|
67
|
+
dropTargets: p = !1
|
|
68
|
+
}) {
|
|
69
|
+
const { data: r, isLoading: a } = N(t), { data: u = [] } = _(t), l = v(() => (r == null ? void 0 : r.rows) ?? [], [r]), g = S(t, u, l);
|
|
70
|
+
return /* @__PURE__ */ i("nav", { "data-editor-rail": "", "aria-label": "Forms", className: "flex flex-col gap-0.5 px-2 pb-4", children: [
|
|
71
|
+
a && [0, 1, 2].map((n) => /* @__PURE__ */ e(y, { className: "mx-2 mt-3 h-9 rounded-md" }, n)),
|
|
72
|
+
F.map((n) => {
|
|
73
|
+
const f = l.filter((s) => s.section === n.id);
|
|
74
|
+
return f.length ? /* @__PURE__ */ i("div", { className: "flex flex-col gap-0.5", children: [
|
|
75
|
+
/* @__PURE__ */ e("p", { className: h, children: n.title }),
|
|
76
|
+
f.map((s) => /* @__PURE__ */ e(
|
|
77
|
+
j,
|
|
78
|
+
{
|
|
79
|
+
row: s,
|
|
80
|
+
current: s.layout_id === o,
|
|
81
|
+
settingsOpen: d,
|
|
82
|
+
unused: n.id === "unused",
|
|
83
|
+
dropTarget: p,
|
|
84
|
+
onOpen: m,
|
|
85
|
+
children: /* @__PURE__ */ e("span", { className: "line-clamp-2 text-[12px] leading-snug text-slate-500 dark:text-muted-foreground [&_b]:font-medium [&_b]:text-slate-600 dark:[&_b]:text-muted-foreground", children: /* @__PURE__ */ e(L, { segs: R(s, u, g) }) })
|
|
86
|
+
},
|
|
87
|
+
s.layout_id
|
|
88
|
+
))
|
|
89
|
+
] }, n.id) : null;
|
|
63
90
|
}),
|
|
64
|
-
/* @__PURE__ */
|
|
65
|
-
/* @__PURE__ */
|
|
91
|
+
/* @__PURE__ */ e("p", { className: h, children: "Form settings" }),
|
|
92
|
+
/* @__PURE__ */ i(
|
|
66
93
|
"button",
|
|
67
94
|
{
|
|
68
95
|
type: "button",
|
|
69
96
|
"data-rail-settings": "",
|
|
70
|
-
"aria-pressed":
|
|
71
|
-
onClick:
|
|
72
|
-
className:
|
|
97
|
+
"aria-pressed": d,
|
|
98
|
+
onClick: c,
|
|
99
|
+
className: x(
|
|
73
100
|
"flex items-start gap-2 rounded-md px-2 py-1.5 text-left transition-colors",
|
|
74
|
-
|
|
101
|
+
d ? "bg-accent" : "hover:bg-muted"
|
|
75
102
|
),
|
|
76
103
|
children: [
|
|
77
|
-
/* @__PURE__ */
|
|
78
|
-
/* @__PURE__ */
|
|
79
|
-
/* @__PURE__ */
|
|
80
|
-
/* @__PURE__ */
|
|
104
|
+
/* @__PURE__ */ e(b, { className: "mt-0.5 h-3.5 w-3.5 shrink-0 text-slate-500 dark:text-muted-foreground" }),
|
|
105
|
+
/* @__PURE__ */ i("span", { className: "flex flex-col gap-px", children: [
|
|
106
|
+
/* @__PURE__ */ e("span", { className: "text-[12.5px] font-medium text-slate-900 dark:text-foreground", children: "Steps, buttons, panels…" }),
|
|
107
|
+
/* @__PURE__ */ e("span", { className: "text-[12px] text-slate-500 dark:text-muted-foreground", children: "Who gets this form and how it behaves" })
|
|
81
108
|
] })
|
|
82
109
|
]
|
|
83
110
|
}
|
|
@@ -85,5 +112,5 @@ function O({
|
|
|
85
112
|
] });
|
|
86
113
|
}
|
|
87
114
|
export {
|
|
88
|
-
|
|
115
|
+
M as LayoutsRail
|
|
89
116
|
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { jsxs as r, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { StickyNote as s } from "lucide-react";
|
|
3
|
+
import { useState as o } from "react";
|
|
4
|
+
import { Popover as n, PopoverTrigger as l, PopoverContent as m } from "../ui/popover.js";
|
|
5
|
+
import { noteByline as d } from "./editor-notes.js";
|
|
6
|
+
function h({ note: t }) {
|
|
7
|
+
const [a, i] = o(!1);
|
|
8
|
+
return /* @__PURE__ */ r(n, { open: a, onOpenChange: i, children: [
|
|
9
|
+
/* @__PURE__ */ e(l, { asChild: !0, children: /* @__PURE__ */ e(
|
|
10
|
+
"button",
|
|
11
|
+
{
|
|
12
|
+
type: "button",
|
|
13
|
+
"data-design-pass": "",
|
|
14
|
+
"data-editor-note-marker": "",
|
|
15
|
+
"aria-label": "Note for editors",
|
|
16
|
+
"data-tip": t.text.length > 80 ? `${t.text.slice(0, 80)}…` : t.text,
|
|
17
|
+
className: "absolute -top-2 left-1 z-20 inline-flex h-5 w-5 items-center justify-center rounded bg-amber-100 text-amber-700 shadow-sm ring-1 ring-amber-300 transition-colors hover:bg-amber-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan dark:bg-amber-500/20 dark:text-amber-200 dark:ring-amber-500/40 dark:hover:bg-amber-500/30",
|
|
18
|
+
children: /* @__PURE__ */ e(s, { "aria-hidden": !0, className: "h-3 w-3" })
|
|
19
|
+
}
|
|
20
|
+
) }),
|
|
21
|
+
/* @__PURE__ */ r(
|
|
22
|
+
m,
|
|
23
|
+
{
|
|
24
|
+
align: "start",
|
|
25
|
+
side: "top",
|
|
26
|
+
className: "w-[280px] space-y-2 border-amber-200 bg-amber-50 p-3 dark:border-amber-500/30 dark:bg-[#2a2414]",
|
|
27
|
+
children: [
|
|
28
|
+
/* @__PURE__ */ e("p", { className: "whitespace-pre-wrap text-[12.5px] leading-snug text-slate-800 dark:text-amber-50", children: t.text }),
|
|
29
|
+
/* @__PURE__ */ e("p", { className: "text-[11.5px] text-slate-500 dark:text-amber-200/70", children: d(t) }),
|
|
30
|
+
/* @__PURE__ */ e("p", { className: "text-[11.5px] text-slate-500 dark:text-amber-200/70", children: "Only people editing this form see this note." })
|
|
31
|
+
]
|
|
32
|
+
}
|
|
33
|
+
)
|
|
34
|
+
] });
|
|
35
|
+
}
|
|
36
|
+
export {
|
|
37
|
+
h as NoteMarker
|
|
38
|
+
};
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
import { jsxs as c, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as K } from "react";
|
|
3
|
+
import { UNGROUPED_KEY as W } from "../../lib/layout-ops.js";
|
|
4
|
+
import { cn as N } from "../../lib/utils.js";
|
|
5
|
+
import { Checkbox as M } from "../ui/checkbox.js";
|
|
6
|
+
import { SimpleSelect as F } from "../ui/SimpleSelect.js";
|
|
7
|
+
import { targetKey as b } from "./design-context.js";
|
|
8
|
+
import { fieldZones as P, zoneItems as R, targetOfKey as D, keyOf as q, isFieldRow as U, moveToZoneOps as Z, widthOps as Y, WIDTH_LABELS as I, widthOf as J, flagOps as Q, flagOn as V, GRID_WIDTHS as X } from "./field-zones.js";
|
|
9
|
+
import { useFocusBuffer as ee } from "./focus-buffer.js";
|
|
10
|
+
import { useCollectionMeta as te } from "./inspector/field-context.js";
|
|
11
|
+
import { describeField as E, readOverrides as re, withOverride as ae } from "./inspector/model.js";
|
|
12
|
+
import { slotName as le } from "./slot-names.js";
|
|
13
|
+
const oe = "h-7 w-full min-w-[120px] rounded-md border border-transparent bg-transparent px-2 text-[12.5px] text-slate-800 outline-none placeholder:text-slate-400 hover:border-slate-200 focus:border-nvr-cyan focus:bg-white dark:text-foreground dark:placeholder:text-muted-foreground dark:hover:border-border dark:focus:bg-background", H = "h-7 w-full gap-1 rounded-md border-transparent bg-transparent px-2 text-[12.5px] shadow-none hover:border-slate-200 focus:ring-0 focus:ring-offset-0 dark:hover:border-border", T = "h-4 w-4 rounded border-slate-300 data-[state=checked]:border-nvr-cyan data-[state=checked]:bg-nvr-cyan data-[state=checked]:text-white dark:border-slate-600 [&_svg]:h-3 [&_svg]:w-3", f = "sticky top-0 z-10 border-b border-slate-200 bg-slate-50 px-2 py-2 text-left text-[11.5px] font-semibold text-slate-600 dark:border-border dark:bg-card dark:text-muted-foreground", y = (o) => o ?? W, _ = [
|
|
14
|
+
{ k: "required", label: "Required", on: "Make {n} required", off: "Make {n} optional" },
|
|
15
|
+
{ k: "readonly", label: "Read-only", on: "Make {n} read-only", off: "Make {n} editable" },
|
|
16
|
+
{ k: "hidden", label: "Hidden", on: "Hide {n}", off: "Show {n}" }
|
|
17
|
+
];
|
|
18
|
+
function ne({
|
|
19
|
+
row: o,
|
|
20
|
+
placeholder: v,
|
|
21
|
+
name: i,
|
|
22
|
+
apply: S,
|
|
23
|
+
flush: m
|
|
24
|
+
}) {
|
|
25
|
+
const h = re(o), O = typeof h.label == "string" ? h.label : "", r = ee(O, m);
|
|
26
|
+
return /* @__PURE__ */ e(
|
|
27
|
+
"input",
|
|
28
|
+
{
|
|
29
|
+
"aria-label": `Label of ${i}`,
|
|
30
|
+
value: r.value,
|
|
31
|
+
placeholder: v,
|
|
32
|
+
onChange: (d) => {
|
|
33
|
+
const u = d.target.value;
|
|
34
|
+
r.set(u), S(
|
|
35
|
+
[
|
|
36
|
+
{
|
|
37
|
+
op: "update_placement",
|
|
38
|
+
at: q(o),
|
|
39
|
+
patch: { overrides: ae(o, "label", u === "" ? void 0 : u) }
|
|
40
|
+
}
|
|
41
|
+
],
|
|
42
|
+
{ label: `Rename ${i}`, text: !0 }
|
|
43
|
+
);
|
|
44
|
+
},
|
|
45
|
+
onKeyDown: (d) => {
|
|
46
|
+
d.key === "Enter" && m();
|
|
47
|
+
},
|
|
48
|
+
...r.props,
|
|
49
|
+
className: oe
|
|
50
|
+
}
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
function ge({
|
|
54
|
+
bundle: o,
|
|
55
|
+
collection: v,
|
|
56
|
+
apply: i,
|
|
57
|
+
flush: S,
|
|
58
|
+
selection: m,
|
|
59
|
+
onSelect: h,
|
|
60
|
+
onSelection: O
|
|
61
|
+
}) {
|
|
62
|
+
const { data: r } = te(v), d = K(() => P(o), [o]), u = K(() => new Set(m.map(b)), [m]), G = (t) => E(t.field, (r == null ? void 0 : r.fields) ?? [], (r == null ? void 0 : r.relations) ?? [], null), j = d.map((t) => ({ value: y(t.key), label: t.label })), z = X.map((t) => ({ value: String(t), label: I[t] })), $ = d.reduce((t, s) => t + R(o, s.key).length, 0), A = (t, s) => {
|
|
63
|
+
t.target.closest('input, button, [role="combobox"], [role="checkbox"]') || (t.shiftKey || t.metaKey || t.ctrlKey ? h(s, { additive: !0 }) : h(s));
|
|
64
|
+
};
|
|
65
|
+
return /* @__PURE__ */ c("div", { "data-placements-table": "", className: "flex min-h-full flex-col p-4", children: [
|
|
66
|
+
/* @__PURE__ */ c("p", { className: "mb-2 text-[12px] text-slate-500 dark:text-muted-foreground", children: [
|
|
67
|
+
$,
|
|
68
|
+
" ",
|
|
69
|
+
$ === 1 ? "item" : "items",
|
|
70
|
+
" on this form. Shift- or ⌘-click rows to select several; the panel on the right changes them together.",
|
|
71
|
+
o.layout.parent_layout_id != null && " Fields that come from the parent form are not listed."
|
|
72
|
+
] }),
|
|
73
|
+
/* @__PURE__ */ e("div", { className: "overflow-x-auto rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card", children: /* @__PURE__ */ c("table", { className: "w-full border-collapse text-[12.5px]", children: [
|
|
74
|
+
/* @__PURE__ */ e("thead", { children: /* @__PURE__ */ c("tr", { children: [
|
|
75
|
+
/* @__PURE__ */ e("th", { className: N(f, "w-8"), children: /* @__PURE__ */ e("span", { className: "sr-only", children: "Selected" }) }),
|
|
76
|
+
/* @__PURE__ */ e("th", { className: f, children: "Field" }),
|
|
77
|
+
/* @__PURE__ */ e("th", { className: f, children: "Label on this form" }),
|
|
78
|
+
/* @__PURE__ */ e("th", { className: f, children: "Section" }),
|
|
79
|
+
/* @__PURE__ */ e("th", { className: N(f, "w-[92px]"), children: "Width" }),
|
|
80
|
+
_.map((t) => /* @__PURE__ */ e("th", { className: N(f, "w-[76px] text-center"), children: t.label }, t.k))
|
|
81
|
+
] }) }),
|
|
82
|
+
d.map((t) => {
|
|
83
|
+
const s = R(o, t.key);
|
|
84
|
+
return s.length === 0 ? null : /* @__PURE__ */ c("tbody", { "data-table-zone": y(t.key), children: [
|
|
85
|
+
/* @__PURE__ */ e("tr", { children: /* @__PURE__ */ c(
|
|
86
|
+
"td",
|
|
87
|
+
{
|
|
88
|
+
colSpan: 5 + _.length,
|
|
89
|
+
className: "border-b border-slate-100 bg-slate-50/60 px-3 py-1.5 text-[12px] font-semibold text-slate-700 dark:border-border/60 dark:bg-muted/40 dark:text-foreground",
|
|
90
|
+
children: [
|
|
91
|
+
t.label,
|
|
92
|
+
/* @__PURE__ */ e("span", { className: "ml-1.5 font-normal text-slate-400 dark:text-muted-foreground", children: s.length })
|
|
93
|
+
]
|
|
94
|
+
}
|
|
95
|
+
) }),
|
|
96
|
+
s.map((a) => {
|
|
97
|
+
const p = D(q(a)), k = u.has(b(p)), B = G(a), C = U(a), n = C ? E(a.field, (r == null ? void 0 : r.fields) ?? [], (r == null ? void 0 : r.relations) ?? [], a).label : a.label_override ?? le(a.field);
|
|
98
|
+
return /* @__PURE__ */ c(
|
|
99
|
+
"tr",
|
|
100
|
+
{
|
|
101
|
+
"data-table-row": b(p),
|
|
102
|
+
"aria-selected": k,
|
|
103
|
+
onClick: (l) => A(l, p),
|
|
104
|
+
className: N(
|
|
105
|
+
"cursor-pointer border-b border-slate-100 last:border-0 dark:border-border/60",
|
|
106
|
+
k ? "bg-accent" : "hover:bg-muted"
|
|
107
|
+
),
|
|
108
|
+
children: [
|
|
109
|
+
/* @__PURE__ */ e("td", { className: "px-2 py-1", children: /* @__PURE__ */ e(
|
|
110
|
+
M,
|
|
111
|
+
{
|
|
112
|
+
checked: k,
|
|
113
|
+
"aria-label": `Select ${n}`,
|
|
114
|
+
onCheckedChange: () => h(p, { additive: !0 }),
|
|
115
|
+
className: T
|
|
116
|
+
}
|
|
117
|
+
) }),
|
|
118
|
+
/* @__PURE__ */ c("td", { className: "max-w-[220px] px-2 py-1", children: [
|
|
119
|
+
/* @__PURE__ */ e("span", { className: "block truncate font-medium text-slate-800 dark:text-foreground", children: n }),
|
|
120
|
+
/* @__PURE__ */ e("span", { className: "block truncate font-mono text-[11px] text-slate-400 dark:text-muted-foreground", children: a.field })
|
|
121
|
+
] }),
|
|
122
|
+
/* @__PURE__ */ e("td", { className: "px-1 py-1", children: C ? /* @__PURE__ */ e(
|
|
123
|
+
ne,
|
|
124
|
+
{
|
|
125
|
+
row: a,
|
|
126
|
+
name: n,
|
|
127
|
+
placeholder: B.label,
|
|
128
|
+
apply: i,
|
|
129
|
+
flush: S
|
|
130
|
+
}
|
|
131
|
+
) : /* @__PURE__ */ e("span", { className: "px-2 text-slate-400", children: "—" }) }),
|
|
132
|
+
/* @__PURE__ */ e("td", { className: "min-w-[150px] px-1 py-1", children: /* @__PURE__ */ e(
|
|
133
|
+
F,
|
|
134
|
+
{
|
|
135
|
+
ariaLabel: `Section of ${n}`,
|
|
136
|
+
value: y(a.group_key),
|
|
137
|
+
options: j,
|
|
138
|
+
className: H,
|
|
139
|
+
onChange: (l) => {
|
|
140
|
+
var L;
|
|
141
|
+
const x = l === W ? null : l, w = Z(o, [a], x);
|
|
142
|
+
w.ops.length && (i(w.ops, {
|
|
143
|
+
label: `Move ${n} to ${(L = d.find((g) => g.key === x)) == null ? void 0 : L.label}`
|
|
144
|
+
}), k && O(
|
|
145
|
+
m.map(
|
|
146
|
+
(g) => b(g) === b(p) ? D(w.moved[0]) : g
|
|
147
|
+
)
|
|
148
|
+
));
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
) }),
|
|
152
|
+
/* @__PURE__ */ e("td", { className: "px-1 py-1", children: /* @__PURE__ */ e(
|
|
153
|
+
F,
|
|
154
|
+
{
|
|
155
|
+
ariaLabel: `Width of ${n}`,
|
|
156
|
+
value: String(J(a)),
|
|
157
|
+
options: z,
|
|
158
|
+
className: H,
|
|
159
|
+
onChange: (l) => i(Y([a], Number(l)), {
|
|
160
|
+
label: `Set the width of ${n} to ${I[Number(l)]}`
|
|
161
|
+
})
|
|
162
|
+
}
|
|
163
|
+
) }),
|
|
164
|
+
_.map((l) => /* @__PURE__ */ e("td", { className: "px-2 py-1 text-center", children: C || l.k === "hidden" ? /* @__PURE__ */ e(
|
|
165
|
+
M,
|
|
166
|
+
{
|
|
167
|
+
checked: V(a, l.k),
|
|
168
|
+
"aria-label": `${l.label}: ${n}`,
|
|
169
|
+
onCheckedChange: (x) => i(Q([a], l.k, x === !0), {
|
|
170
|
+
label: (x === !0 ? l.on : l.off).replace("{n}", n)
|
|
171
|
+
}),
|
|
172
|
+
className: T
|
|
173
|
+
}
|
|
174
|
+
) : /* @__PURE__ */ e("span", { className: "text-slate-400", children: "—" }) }, l.k))
|
|
175
|
+
]
|
|
176
|
+
},
|
|
177
|
+
b(p)
|
|
178
|
+
);
|
|
179
|
+
})
|
|
180
|
+
] }, y(t.key));
|
|
181
|
+
})
|
|
182
|
+
] }) })
|
|
183
|
+
] });
|
|
184
|
+
}
|
|
185
|
+
export {
|
|
186
|
+
ge as PlacementsTable
|
|
187
|
+
};
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { jsxs as a, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { CalendarClock as A } from "lucide-react";
|
|
3
|
+
import { useState as u } from "react";
|
|
4
|
+
import { toast as g } from "sonner";
|
|
5
|
+
import { formatDateTime as N } from "../../lib/utils.js";
|
|
6
|
+
import { Popover as D, PopoverContent as _ } from "../ui/popover.js";
|
|
7
|
+
import { toLocalInput as x, useLayoutSchedules as L, useScheduleActions as j, fromLocalInput as b } from "./history-api.js";
|
|
8
|
+
import { ToolButton as O, barBtn as P } from "./toolbar-kit.js";
|
|
9
|
+
import { unsavedText as T } from "./UnsavedConfirm.js";
|
|
10
|
+
import { useLayoutBundle as $, parseSaveFailure as B } from "./useLayoutDraft.js";
|
|
11
|
+
const y = "h-8 w-full rounded-md border border-slate-200 bg-white px-2.5 text-[12.5px] text-slate-800 outline-none placeholder:text-slate-400 focus:border-nvr-cyan dark:border-border dark:bg-background dark:text-foreground dark:placeholder:text-muted-foreground", v = "mb-1 block text-[11.5px] font-semibold text-slate-600 dark:text-muted-foreground";
|
|
12
|
+
function F(o = /* @__PURE__ */ new Date()) {
|
|
13
|
+
const n = new Date(o);
|
|
14
|
+
return n.setDate(n.getDate() + 1), n.setHours(9, 0, 0, 0), n;
|
|
15
|
+
}
|
|
16
|
+
function W(o) {
|
|
17
|
+
return N(o.run_at);
|
|
18
|
+
}
|
|
19
|
+
function R({
|
|
20
|
+
collection: o,
|
|
21
|
+
layoutId: n,
|
|
22
|
+
draft: s
|
|
23
|
+
}) {
|
|
24
|
+
const [h, r] = u(!1), [l, w] = u(() => x(F())), [p, m] = u(""), { data: d } = $(n), { data: k = [] } = L(o, h), { create: i } = j(o), f = k.filter((e) => e.layout_id === n && e.status === "pending"), c = s.unsavedCount, C = () => {
|
|
25
|
+
const e = b(l);
|
|
26
|
+
!e || !d || i.mutate(
|
|
27
|
+
{ layoutId: n, ops: s.unsavedOps(), base_rev: d.rev, run_at: e, note: p },
|
|
28
|
+
{
|
|
29
|
+
onSuccess: () => {
|
|
30
|
+
s.discard(), r(!1), m(""), g.success(`Scheduled for ${N(e)}`);
|
|
31
|
+
},
|
|
32
|
+
onError: (S) => g.error(B(S, "Not scheduled").message)
|
|
33
|
+
}
|
|
34
|
+
);
|
|
35
|
+
};
|
|
36
|
+
return /* @__PURE__ */ a(D, { open: h, onOpenChange: r, children: [
|
|
37
|
+
/* @__PURE__ */ t(
|
|
38
|
+
O,
|
|
39
|
+
{
|
|
40
|
+
popover: !0,
|
|
41
|
+
onOpen: () => r(!0),
|
|
42
|
+
label: "Schedule…",
|
|
43
|
+
icon: /* @__PURE__ */ t(A, { className: "h-3.5 w-3.5" }),
|
|
44
|
+
tip: "Apply these changes at a later time instead of now",
|
|
45
|
+
hint: "Apply these changes at a later time",
|
|
46
|
+
disabled: c === 0,
|
|
47
|
+
data: { "data-editor-schedule": "" }
|
|
48
|
+
}
|
|
49
|
+
),
|
|
50
|
+
/* @__PURE__ */ a(_, { align: "end", className: "w-[320px] p-3", "data-schedule-popover": "", children: [
|
|
51
|
+
/* @__PURE__ */ a("p", { className: "mb-2 text-[12.5px] text-slate-700 dark:text-foreground", children: [
|
|
52
|
+
"Apply your ",
|
|
53
|
+
T(c),
|
|
54
|
+
" later. They leave the editor now and nobody sees them until then."
|
|
55
|
+
] }),
|
|
56
|
+
/* @__PURE__ */ t("label", { className: v, htmlFor: "layout-schedule-when", children: "When" }),
|
|
57
|
+
/* @__PURE__ */ t(
|
|
58
|
+
"input",
|
|
59
|
+
{
|
|
60
|
+
id: "layout-schedule-when",
|
|
61
|
+
type: "datetime-local",
|
|
62
|
+
value: l,
|
|
63
|
+
min: x(/* @__PURE__ */ new Date()),
|
|
64
|
+
onChange: (e) => w(e.target.value),
|
|
65
|
+
className: y
|
|
66
|
+
}
|
|
67
|
+
),
|
|
68
|
+
/* @__PURE__ */ t("label", { className: `${v} mt-2`, htmlFor: "layout-schedule-note", children: "Note (optional)" }),
|
|
69
|
+
/* @__PURE__ */ t(
|
|
70
|
+
"input",
|
|
71
|
+
{
|
|
72
|
+
id: "layout-schedule-note",
|
|
73
|
+
value: p,
|
|
74
|
+
maxLength: 255,
|
|
75
|
+
placeholder: "e.g. New fields for the April release",
|
|
76
|
+
onChange: (e) => m(e.target.value),
|
|
77
|
+
className: y
|
|
78
|
+
}
|
|
79
|
+
),
|
|
80
|
+
/* @__PURE__ */ t("p", { className: "mt-2 text-[11.5px] leading-snug text-slate-500 dark:text-muted-foreground", children: "If someone changes this layout before then, your changes still apply when they fit. If one no longer fits, nothing is applied and you are told." }),
|
|
81
|
+
f.length > 0 && /* @__PURE__ */ a("p", { className: "mt-2 text-[11.5px] text-slate-600 dark:text-slate-300", children: [
|
|
82
|
+
"Already scheduled for this form:",
|
|
83
|
+
" ",
|
|
84
|
+
f.map((e) => `${W(e)} (${e.created_by_name ?? "an admin"})`).join(", ")
|
|
85
|
+
] }),
|
|
86
|
+
/* @__PURE__ */ a("div", { className: "mt-3 flex justify-end gap-2", children: [
|
|
87
|
+
/* @__PURE__ */ t("button", { type: "button", className: P, onClick: () => r(!1), children: "Cancel" }),
|
|
88
|
+
/* @__PURE__ */ t(
|
|
89
|
+
"button",
|
|
90
|
+
{
|
|
91
|
+
type: "button",
|
|
92
|
+
"data-schedule-confirm": "",
|
|
93
|
+
disabled: i.isPending || !b(l) || !d || c === 0,
|
|
94
|
+
onClick: C,
|
|
95
|
+
className: "inline-flex h-8 items-center rounded-md bg-nvr-cyan px-3 text-[12.5px] font-medium text-white transition-opacity hover:opacity-90 disabled:opacity-50",
|
|
96
|
+
children: i.isPending ? "Scheduling…" : "Schedule"
|
|
97
|
+
}
|
|
98
|
+
)
|
|
99
|
+
] })
|
|
100
|
+
] })
|
|
101
|
+
] });
|
|
102
|
+
}
|
|
103
|
+
export {
|
|
104
|
+
R as ScheduleChange,
|
|
105
|
+
W as scheduleWhen
|
|
106
|
+
};
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { jsxs as n, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { cn as o } from "../../lib/utils.js";
|
|
3
|
+
function p({
|
|
4
|
+
session: c,
|
|
5
|
+
onJump: r
|
|
6
|
+
}) {
|
|
7
|
+
const { done: e, undone: d } = c;
|
|
8
|
+
if (e.length === 0 && d.length === 0) return null;
|
|
9
|
+
const i = "flex w-full items-center gap-2 rounded px-2 py-1 text-left text-[12px] transition-colors hover:bg-muted";
|
|
10
|
+
return /* @__PURE__ */ n("section", { "data-session-history": "", "aria-label": "This session", children: [
|
|
11
|
+
/* @__PURE__ */ t("p", { className: "mb-1 text-[11px] font-semibold text-slate-600 dark:text-slate-300", children: "This session" }),
|
|
12
|
+
/* @__PURE__ */ n("ol", { className: "max-h-56 space-y-px overflow-y-auto", children: [
|
|
13
|
+
/* @__PURE__ */ t("li", { children: /* @__PURE__ */ n(
|
|
14
|
+
"button",
|
|
15
|
+
{
|
|
16
|
+
type: "button",
|
|
17
|
+
"data-session-step": "start",
|
|
18
|
+
disabled: e.length === 0,
|
|
19
|
+
"aria-current": e.length === 0 ? "step" : void 0,
|
|
20
|
+
onClick: () => r(-e.length),
|
|
21
|
+
className: o(
|
|
22
|
+
i,
|
|
23
|
+
"text-slate-500 dark:text-slate-400",
|
|
24
|
+
e.length === 0 && "bg-accent font-medium text-slate-900 dark:text-foreground"
|
|
25
|
+
),
|
|
26
|
+
"data-tip": "The layout as it was when you opened it (or since the last reload)",
|
|
27
|
+
children: [
|
|
28
|
+
/* @__PURE__ */ t("span", { className: "min-w-0 flex-1", children: "Start of session" }),
|
|
29
|
+
e.length === 0 && /* @__PURE__ */ t("span", { className: "shrink-0 text-[10.5px]", children: "now" })
|
|
30
|
+
]
|
|
31
|
+
}
|
|
32
|
+
) }),
|
|
33
|
+
e.map((s, a) => {
|
|
34
|
+
const l = a === e.length - 1;
|
|
35
|
+
return (
|
|
36
|
+
// biome-ignore lint/suspicious/noArrayIndexKey: steps are positional
|
|
37
|
+
/* @__PURE__ */ t("li", { children: /* @__PURE__ */ n(
|
|
38
|
+
"button",
|
|
39
|
+
{
|
|
40
|
+
type: "button",
|
|
41
|
+
"data-session-step": a,
|
|
42
|
+
"data-step-state": s.state,
|
|
43
|
+
"aria-current": l ? "step" : void 0,
|
|
44
|
+
disabled: l,
|
|
45
|
+
onClick: () => r(-(e.length - 1 - a)),
|
|
46
|
+
className: o(
|
|
47
|
+
i,
|
|
48
|
+
"text-slate-700 dark:text-slate-200",
|
|
49
|
+
l && "bg-accent font-medium text-slate-900 dark:text-foreground"
|
|
50
|
+
),
|
|
51
|
+
children: [
|
|
52
|
+
/* @__PURE__ */ t("span", { className: "min-w-0 flex-1 truncate", children: s.label }),
|
|
53
|
+
s.state === "unsaved" && /* @__PURE__ */ t("span", { className: "shrink-0 rounded bg-nvr-cyan/10 px-1 text-[10.5px] text-slate-700 dark:text-foreground", children: "unsaved" }),
|
|
54
|
+
s.state === "saving" && /* @__PURE__ */ t("span", { className: "shrink-0 text-[10.5px] text-slate-500 dark:text-slate-400", children: "saving…" }),
|
|
55
|
+
s.state === "saved" && /* @__PURE__ */ t("span", { className: "shrink-0 text-[10.5px] text-slate-400 dark:text-slate-500", children: "saved" }),
|
|
56
|
+
l && /* @__PURE__ */ t("span", { className: "shrink-0 text-[10.5px] text-slate-500 dark:text-slate-400", children: "now" })
|
|
57
|
+
]
|
|
58
|
+
}
|
|
59
|
+
) }, `d${a}`)
|
|
60
|
+
);
|
|
61
|
+
}),
|
|
62
|
+
d.map((s, a) => (
|
|
63
|
+
// biome-ignore lint/suspicious/noArrayIndexKey: steps are positional
|
|
64
|
+
/* @__PURE__ */ t("li", { children: /* @__PURE__ */ n(
|
|
65
|
+
"button",
|
|
66
|
+
{
|
|
67
|
+
type: "button",
|
|
68
|
+
"data-session-undone": a,
|
|
69
|
+
onClick: () => r(a + 1),
|
|
70
|
+
className: o(i, "text-slate-400 dark:text-slate-500"),
|
|
71
|
+
"data-tip": "Undone: click to redo up to here",
|
|
72
|
+
children: [
|
|
73
|
+
/* @__PURE__ */ t("span", { className: "min-w-0 flex-1 truncate line-through decoration-slate-300 dark:decoration-slate-600", children: s.label }),
|
|
74
|
+
/* @__PURE__ */ t("span", { className: "shrink-0 text-[10.5px]", children: "undone" })
|
|
75
|
+
]
|
|
76
|
+
}
|
|
77
|
+
) }, `u${a}`)
|
|
78
|
+
))
|
|
79
|
+
] })
|
|
80
|
+
] });
|
|
81
|
+
}
|
|
82
|
+
export {
|
|
83
|
+
p as SessionHistory
|
|
84
|
+
};
|