@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,172 +1,323 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { ChevronLeft as
|
|
3
|
-
import { useState as
|
|
4
|
-
import { useNivaroClient as
|
|
5
|
-
import { useDebounced as
|
|
6
|
-
import { useRelationOptions as
|
|
7
|
-
import { cn as
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
1
|
+
import { jsxs as n, jsx as e, Fragment as H } from "react/jsx-runtime";
|
|
2
|
+
import { ChevronLeft as re, Undo2 as oe, Redo2 as se, Wrench as le, Sparkles as de, History as ie, MoreHorizontal as ce, Save as Z, GitCompare as me, ChevronDown as J, Eye as F, X as he } from "lucide-react";
|
|
3
|
+
import { useState as D, useMemo as pe } from "react";
|
|
4
|
+
import { useNivaroClient as ue } from "../../context.js";
|
|
5
|
+
import { useDebounced as be } from "../../hooks/useDebounced.js";
|
|
6
|
+
import { useRelationOptions as xe } from "../../hooks/useRelationOptions.js";
|
|
7
|
+
import { cn as h } from "../../lib/utils.js";
|
|
8
|
+
import { useOverflowTip as ve } from "../TipLayer.js";
|
|
9
|
+
import { Popover as X, PopoverTrigger as Y, PopoverContent as q } from "../ui/popover.js";
|
|
10
|
+
import { SimpleSelect as ge } from "../ui/SimpleSelect.js";
|
|
11
|
+
import { AiChangeCheck as we } from "./ai/ChangeCheck.js";
|
|
12
|
+
import { ShareButton as fe, WatchButton as ke } from "./collab/FormFollowShare.js";
|
|
13
|
+
import { HistoryPanel as Ne } from "./HistoryPanel.js";
|
|
14
|
+
import { useRuleChoiceLabels as ye, useDisplayTemplate as Ce, useRoleNames as Se } from "./overview/overview-api.js";
|
|
15
|
+
import { rowPill as Oe, purposeSegments as Re, TYPE_USE as z, Pill as Pe, Sentence as Ae } from "./overview/purpose.js";
|
|
16
|
+
import { ScheduleChange as Te } from "./ScheduleChange.js";
|
|
17
|
+
import { barIconBtn as j, BarMenu as R, barIconOn as Be, MenuSeparator as E, ToolButton as _, barBtnOn as Le, barBtn as Ue } from "./toolbar-kit.js";
|
|
18
|
+
import { unsavedText as I } from "./UnsavedConfirm.js";
|
|
19
|
+
const Me = "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", G = "mb-1 block text-[11.5px] font-semibold text-slate-600 dark:text-muted-foreground", $e = `
|
|
20
|
+
[data-editor-topbar]{container-type:inline-size;container-name:letb}
|
|
21
|
+
@container letb (max-width: 1499px){[data-editor-topbar] [data-tb-sentence]{display:none}}
|
|
22
|
+
@container letb (max-width: 1399px){[data-editor-topbar] [data-tb-xwide]{display:none}}
|
|
23
|
+
@container letb (max-width: 1099px){[data-editor-topbar] [data-tb-wide],[data-editor-topbar] [data-tb-menu-label]{display:none}}
|
|
24
|
+
@container letb (min-width: 1100px){[data-editor-topbar] [data-tb-name]{min-width:140px}}
|
|
25
|
+
`;
|
|
26
|
+
function je({
|
|
27
|
+
draft: i,
|
|
28
|
+
onOpen: a
|
|
29
|
+
}) {
|
|
30
|
+
const { status: r, error: l } = i, s = i.unsavedCount ?? 0, d = s > 0 && (r === "idle" || r === "saved"), t = r === "saving" ? "Saving…" : r === "error" ? l ?? "Not saved" : r === "conflict" ? s > 0 ? "Not saved — someone else saved" : "Reloaded — someone else saved" : d ? I(s) : "Saved", c = /* @__PURE__ */ n(
|
|
17
31
|
"span",
|
|
18
32
|
{
|
|
19
33
|
role: "status",
|
|
20
|
-
"data-save-status":
|
|
21
|
-
"data-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
34
|
+
"data-save-status": r,
|
|
35
|
+
"data-unsaved": s,
|
|
36
|
+
"data-tip": (r === "error" || r === "conflict") && l ? l : d ? "Only you see these changes until you save (⌘S)" : void 0,
|
|
37
|
+
className: h(
|
|
38
|
+
"inline-flex max-w-[180px] shrink-0 items-center gap-1 whitespace-nowrap rounded-full px-2 py-px text-[11px] font-semibold",
|
|
39
|
+
r === "saving" && "bg-slate-100 text-slate-600 dark:bg-muted dark:text-muted-foreground",
|
|
40
|
+
(r === "saved" || r === "idle") && !d && "bg-emerald-50 text-emerald-700 dark:bg-emerald-500/15 dark:text-emerald-300",
|
|
41
|
+
d && "bg-nvr-cyan/10 text-slate-700 dark:text-foreground",
|
|
42
|
+
r === "error" && "bg-red-50 text-red-700 dark:bg-red-500/15 dark:text-red-300",
|
|
43
|
+
r === "conflict" && "bg-amber-50 text-amber-700 dark:bg-amber-500/15 dark:text-amber-300"
|
|
28
44
|
),
|
|
29
|
-
children:
|
|
45
|
+
children: [
|
|
46
|
+
d && /* @__PURE__ */ e("span", { "aria-hidden": !0, className: "h-1.5 w-1.5 shrink-0 rounded-full bg-nvr-cyan" }),
|
|
47
|
+
/* @__PURE__ */ e("span", { className: "min-w-0 truncate", children: t })
|
|
48
|
+
]
|
|
49
|
+
}
|
|
50
|
+
);
|
|
51
|
+
return !d || !a ? c : /* @__PURE__ */ e(
|
|
52
|
+
"button",
|
|
53
|
+
{
|
|
54
|
+
type: "button",
|
|
55
|
+
"data-unsaved-list-open": "",
|
|
56
|
+
"aria-label": `${I(s)} — list them`,
|
|
57
|
+
onClick: (b) => a(b.currentTarget),
|
|
58
|
+
className: "inline-flex rounded-full transition-opacity hover:opacity-80",
|
|
59
|
+
children: c
|
|
30
60
|
}
|
|
31
61
|
);
|
|
32
62
|
}
|
|
33
|
-
function
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
63
|
+
function Ee({
|
|
64
|
+
icon: i,
|
|
65
|
+
label: a,
|
|
66
|
+
hint: r,
|
|
67
|
+
on: l,
|
|
68
|
+
onChange: s,
|
|
69
|
+
data: d
|
|
70
|
+
}) {
|
|
71
|
+
return /* @__PURE__ */ n("div", { className: "flex items-start gap-2 text-[12.5px] text-slate-700 dark:text-foreground", children: [
|
|
72
|
+
/* @__PURE__ */ e("span", { className: "mt-0.5 text-slate-500 dark:text-muted-foreground", children: i }),
|
|
73
|
+
/* @__PURE__ */ n("span", { className: "flex min-w-0 flex-1 flex-col", children: [
|
|
74
|
+
/* @__PURE__ */ e("span", { className: "font-medium", children: a }),
|
|
75
|
+
/* @__PURE__ */ e("span", { className: "text-[11.5px] leading-snug text-slate-500 dark:text-muted-foreground", children: r })
|
|
76
|
+
] }),
|
|
77
|
+
/* @__PURE__ */ e(
|
|
78
|
+
"button",
|
|
79
|
+
{
|
|
80
|
+
type: "button",
|
|
81
|
+
role: "switch",
|
|
82
|
+
"aria-checked": l,
|
|
83
|
+
"aria-label": a,
|
|
84
|
+
onClick: () => s(!l),
|
|
85
|
+
...d,
|
|
86
|
+
className: h(
|
|
87
|
+
"relative mt-0.5 h-4 w-7 shrink-0 rounded-full transition-colors",
|
|
88
|
+
l ? "bg-nvr-cyan" : "bg-slate-300 dark:bg-white/35"
|
|
89
|
+
),
|
|
90
|
+
children: /* @__PURE__ */ e(
|
|
91
|
+
"span",
|
|
92
|
+
{
|
|
93
|
+
className: h(
|
|
94
|
+
"absolute left-0 top-0.5 h-3 w-3 rounded-full bg-white shadow-sm transition-transform",
|
|
95
|
+
l ? "translate-x-3.5" : "translate-x-0.5"
|
|
96
|
+
)
|
|
97
|
+
}
|
|
98
|
+
)
|
|
99
|
+
}
|
|
100
|
+
)
|
|
101
|
+
] });
|
|
102
|
+
}
|
|
103
|
+
function He({
|
|
104
|
+
collection: i,
|
|
105
|
+
value: a,
|
|
106
|
+
onChange: r,
|
|
107
|
+
showHidden: l,
|
|
108
|
+
onShowHidden: s,
|
|
109
|
+
extra: d
|
|
37
110
|
}) {
|
|
38
|
-
var
|
|
39
|
-
const
|
|
40
|
-
search:
|
|
111
|
+
var y, C, S, g;
|
|
112
|
+
const t = ue(), [c, b] = D(!1), [f, P] = D(""), A = be(f, 250), { data: x } = Ce(i, c), { data: u = [] } = Se(!0), { options: k, loading: T } = xe(c ? t : null, i, {
|
|
113
|
+
search: A,
|
|
41
114
|
limit: 8,
|
|
42
|
-
displayTemplate:
|
|
43
|
-
enabled:
|
|
44
|
-
}),
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
115
|
+
displayTemplate: x ?? null,
|
|
116
|
+
enabled: c && x !== void 0
|
|
117
|
+
}), v = ((y = u.find((o) => o.id === a.roleId)) == null ? void 0 : y.name) ?? null, N = ((C = u.find((o) => o.id === a.compareRoleId)) == null ? void 0 : C.name) ?? null, B = [
|
|
118
|
+
(S = a.record) == null ? void 0 : S.label,
|
|
119
|
+
N && v ? `${v} | ${N}` : v,
|
|
120
|
+
(g = a.state) == null ? void 0 : g.label,
|
|
121
|
+
a.values && Object.keys(a.values).length > 0 ? "What if" : null,
|
|
122
|
+
a.device && a.device !== "desktop" ? a.device === "phone" ? "Phone" : "Tablet" : null,
|
|
123
|
+
a.who ? "Who sees" : null
|
|
124
|
+
].filter(Boolean).join(" · ") || "No record";
|
|
125
|
+
return /* @__PURE__ */ n(X, { open: c, onOpenChange: b, children: [
|
|
126
|
+
/* @__PURE__ */ e(Y, { asChild: !0, children: /* @__PURE__ */ n(
|
|
48
127
|
"button",
|
|
49
128
|
{
|
|
50
129
|
type: "button",
|
|
51
|
-
className:
|
|
130
|
+
className: h(Ue, "min-w-[110px] max-w-[260px] shrink", c && Le),
|
|
52
131
|
"aria-label": "Preview as",
|
|
132
|
+
"data-preview-as": "",
|
|
53
133
|
"data-tip": "Show the form with a real record’s values, as a role sees it",
|
|
54
134
|
children: [
|
|
55
|
-
/* @__PURE__ */ e(
|
|
56
|
-
/* @__PURE__ */
|
|
135
|
+
/* @__PURE__ */ e(F, { className: "h-3.5 w-3.5 shrink-0" }),
|
|
136
|
+
/* @__PURE__ */ n("span", { className: "min-w-0 truncate", children: [
|
|
137
|
+
"Preview",
|
|
138
|
+
/* @__PURE__ */ n("span", { "data-tb-wide": "", children: [
|
|
139
|
+
":",
|
|
140
|
+
" ",
|
|
141
|
+
/* @__PURE__ */ e("span", { "data-preview-summary": "", className: "text-slate-500 dark:text-muted-foreground", children: B })
|
|
142
|
+
] })
|
|
143
|
+
] }),
|
|
144
|
+
l && /* @__PURE__ */ e(
|
|
145
|
+
"span",
|
|
146
|
+
{
|
|
147
|
+
"data-preview-hidden-on": "",
|
|
148
|
+
"aria-hidden": !0,
|
|
149
|
+
className: "h-1.5 w-1.5 shrink-0 rounded-full bg-nvr-cyan"
|
|
150
|
+
}
|
|
151
|
+
),
|
|
152
|
+
/* @__PURE__ */ e(J, { className: "h-3 w-3 shrink-0 text-slate-500 dark:text-muted-foreground" })
|
|
57
153
|
]
|
|
58
154
|
}
|
|
59
155
|
) }),
|
|
60
|
-
/* @__PURE__ */
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
{
|
|
67
|
-
|
|
68
|
-
"
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
156
|
+
/* @__PURE__ */ n(
|
|
157
|
+
q,
|
|
158
|
+
{
|
|
159
|
+
align: "end",
|
|
160
|
+
className: "max-h-[min(80vh,640px)] w-[320px] overflow-y-auto overscroll-contain p-3",
|
|
161
|
+
children: [
|
|
162
|
+
/* @__PURE__ */ e("p", { className: G, children: "Record" }),
|
|
163
|
+
a.record ? /* @__PURE__ */ n("span", { className: "inline-flex max-w-full items-center gap-1.5 rounded-full bg-nvr-cyan/10 px-2.5 py-1 text-[12px] font-medium text-slate-800 dark:text-foreground", children: [
|
|
164
|
+
/* @__PURE__ */ e("span", { className: "truncate", children: a.record.label }),
|
|
165
|
+
/* @__PURE__ */ e(
|
|
166
|
+
"button",
|
|
167
|
+
{
|
|
168
|
+
type: "button",
|
|
169
|
+
"aria-label": "Preview without a record",
|
|
170
|
+
onClick: () => r({ ...a, record: null }),
|
|
171
|
+
className: "text-slate-500 hover:text-slate-800 dark:text-muted-foreground dark:hover:text-foreground",
|
|
172
|
+
children: /* @__PURE__ */ e(he, { className: "h-3 w-3" })
|
|
173
|
+
}
|
|
174
|
+
)
|
|
175
|
+
] }) : /* @__PURE__ */ n(H, { children: [
|
|
176
|
+
/* @__PURE__ */ e(
|
|
177
|
+
"input",
|
|
178
|
+
{
|
|
179
|
+
value: f,
|
|
180
|
+
onChange: (o) => P(o.target.value),
|
|
181
|
+
placeholder: "Search records…",
|
|
182
|
+
"aria-label": "Search records",
|
|
183
|
+
className: Me
|
|
184
|
+
}
|
|
185
|
+
),
|
|
186
|
+
/* @__PURE__ */ n("div", { className: "mt-1 max-h-[220px] overflow-y-auto overscroll-contain", children: [
|
|
187
|
+
k.map((o) => /* @__PURE__ */ e(
|
|
188
|
+
"button",
|
|
189
|
+
{
|
|
190
|
+
type: "button",
|
|
191
|
+
onClick: () => r({ ...a, record: { id: String(o.id), label: o.label } }),
|
|
192
|
+
className: "block w-full truncate rounded px-2 py-1.5 text-left text-[12.5px] text-slate-700 hover:bg-muted dark:text-foreground",
|
|
193
|
+
children: o.label
|
|
194
|
+
},
|
|
195
|
+
String(o.id)
|
|
196
|
+
)),
|
|
197
|
+
!T && k.length === 0 && /* @__PURE__ */ e("p", { className: "px-2 py-1.5 text-[12px] text-slate-500 dark:text-muted-foreground", children: "No records match." })
|
|
198
|
+
] })
|
|
199
|
+
] }),
|
|
200
|
+
/* @__PURE__ */ e("p", { className: h(G, "mt-3"), children: "As a role" }),
|
|
201
|
+
/* @__PURE__ */ e(
|
|
202
|
+
ge,
|
|
88
203
|
{
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
204
|
+
value: a.roleId ?? "",
|
|
205
|
+
onChange: (o) => r({ ...a, roleId: o || null }),
|
|
206
|
+
ariaLabel: "Preview as role",
|
|
207
|
+
className: "h-8 text-[12.5px]",
|
|
208
|
+
options: [
|
|
209
|
+
{ value: "", label: "Any role" },
|
|
210
|
+
...u.map((o) => ({ value: o.id, label: o.name }))
|
|
211
|
+
]
|
|
212
|
+
}
|
|
213
|
+
),
|
|
214
|
+
/* @__PURE__ */ e("p", { className: "mt-2 text-[11.5px] leading-snug text-slate-500 dark:text-muted-foreground", children: "The form shows this record’s values, steps and rules. Nothing you do here changes the record." }),
|
|
215
|
+
/* @__PURE__ */ e("div", { className: "mt-3 border-t border-slate-100 pt-3 dark:border-border", children: /* @__PURE__ */ e(
|
|
216
|
+
Ee,
|
|
217
|
+
{
|
|
218
|
+
icon: /* @__PURE__ */ e(F, { className: "h-3.5 w-3.5" }),
|
|
219
|
+
label: "Show hidden",
|
|
220
|
+
hint: "Fields and sections the preview would hide, faintly, so you can select them",
|
|
221
|
+
on: l,
|
|
222
|
+
onChange: s,
|
|
223
|
+
data: { "data-show-hidden-switch": "" }
|
|
224
|
+
}
|
|
225
|
+
) }),
|
|
226
|
+
d
|
|
227
|
+
]
|
|
228
|
+
}
|
|
229
|
+
)
|
|
115
230
|
] });
|
|
116
231
|
}
|
|
117
|
-
function
|
|
118
|
-
collection:
|
|
119
|
-
layoutId:
|
|
120
|
-
layoutName:
|
|
121
|
-
layoutType:
|
|
122
|
-
row:
|
|
123
|
-
fields:
|
|
124
|
-
draft:
|
|
125
|
-
preview:
|
|
126
|
-
onPreview:
|
|
127
|
-
showHidden:
|
|
128
|
-
onShowHidden:
|
|
129
|
-
onBack:
|
|
130
|
-
backLabel:
|
|
232
|
+
function nt({
|
|
233
|
+
collection: i,
|
|
234
|
+
layoutId: a,
|
|
235
|
+
layoutName: r,
|
|
236
|
+
layoutType: l,
|
|
237
|
+
row: s,
|
|
238
|
+
fields: d,
|
|
239
|
+
draft: t,
|
|
240
|
+
preview: c,
|
|
241
|
+
onPreview: b,
|
|
242
|
+
showHidden: f,
|
|
243
|
+
onShowHidden: P,
|
|
244
|
+
onBack: A,
|
|
245
|
+
backLabel: x = "Forms",
|
|
246
|
+
view: u,
|
|
247
|
+
tools: k,
|
|
248
|
+
ai: T,
|
|
249
|
+
previewExtra: v,
|
|
250
|
+
problems: N,
|
|
251
|
+
more: B,
|
|
252
|
+
presence: y,
|
|
253
|
+
onOpenUnsaved: C,
|
|
254
|
+
onSelectField: S,
|
|
255
|
+
onShowOnCanvas: g,
|
|
256
|
+
onReviewChanges: o,
|
|
257
|
+
reviewing: K = !1,
|
|
258
|
+
testing: Q,
|
|
259
|
+
beforeSave: V
|
|
131
260
|
}) {
|
|
132
|
-
const [
|
|
133
|
-
|
|
261
|
+
const [L, U] = D(
|
|
262
|
+
() => typeof window < "u" && new URLSearchParams(window.location.search).get("history") === "1"
|
|
263
|
+
), p = t.unsavedCount ?? 0, M = s ? Oe(s) : null, ee = pe(() => s ? [s] : [], [s]), te = ye(i, d, ee), W = s ? Re(s, d, te) : z[l] ? [{ text: z[l] }] : [], O = !!t.save && !t.autosave, $ = O && p > 0, ae = ve(r);
|
|
264
|
+
return /* @__PURE__ */ n(
|
|
134
265
|
"header",
|
|
135
266
|
{
|
|
136
267
|
"data-editor-topbar": "",
|
|
137
|
-
className: "flex shrink-0 flex-
|
|
268
|
+
className: "flex shrink-0 flex-nowrap items-center gap-1.5 overflow-hidden border-b border-slate-200 bg-white px-3 py-2 dark:border-border dark:bg-card",
|
|
138
269
|
children: [
|
|
139
|
-
/* @__PURE__ */
|
|
270
|
+
/* @__PURE__ */ e("style", { children: $e }),
|
|
271
|
+
/* @__PURE__ */ n(
|
|
140
272
|
"button",
|
|
141
273
|
{
|
|
142
274
|
type: "button",
|
|
143
|
-
|
|
144
|
-
|
|
275
|
+
"aria-label": x,
|
|
276
|
+
"data-editor-back": "",
|
|
277
|
+
onClick: (m) => A(m.currentTarget),
|
|
278
|
+
className: "inline-flex h-8 shrink-0 items-center gap-0.5 rounded-md pl-1 pr-2 text-[12px] text-slate-500 transition-colors hover:bg-muted hover:text-slate-800 dark:text-muted-foreground dark:hover:text-foreground",
|
|
145
279
|
children: [
|
|
146
|
-
/* @__PURE__ */ e(
|
|
147
|
-
|
|
280
|
+
/* @__PURE__ */ e(re, { className: "h-4 w-4" }),
|
|
281
|
+
/* @__PURE__ */ e("span", { "data-tb-wide": "", children: x })
|
|
148
282
|
]
|
|
149
283
|
}
|
|
150
284
|
),
|
|
151
|
-
/* @__PURE__ */
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
285
|
+
/* @__PURE__ */ e(w, {}),
|
|
286
|
+
/* @__PURE__ */ n("div", { "data-tb-name": "", className: "flex min-w-[64px] flex-1 items-center gap-2", children: [
|
|
287
|
+
/* @__PURE__ */ e(
|
|
288
|
+
"h2",
|
|
289
|
+
{
|
|
290
|
+
ref: ae,
|
|
291
|
+
className: "min-w-0 truncate text-[14px] font-semibold text-slate-900 dark:text-foreground",
|
|
292
|
+
children: r
|
|
293
|
+
}
|
|
294
|
+
),
|
|
295
|
+
M && /* @__PURE__ */ e("span", { className: "shrink-0", children: /* @__PURE__ */ e(Pe, { tone: M.tone, children: M.text }) }),
|
|
296
|
+
W.length > 0 && /* @__PURE__ */ n(
|
|
297
|
+
"span",
|
|
298
|
+
{
|
|
299
|
+
"data-tb-sentence": "",
|
|
300
|
+
className: "min-w-0 truncate text-[12px] text-slate-500 dark:text-muted-foreground",
|
|
301
|
+
children: [
|
|
302
|
+
"· ",
|
|
303
|
+
/* @__PURE__ */ e(Ae, { segs: W, muted: !0 })
|
|
304
|
+
]
|
|
305
|
+
}
|
|
306
|
+
),
|
|
307
|
+
y
|
|
158
308
|
] }),
|
|
159
|
-
/* @__PURE__ */
|
|
309
|
+
/* @__PURE__ */ e(w, {}),
|
|
310
|
+
/* @__PURE__ */ n("div", { className: "flex shrink-0 items-center gap-0.5", children: [
|
|
160
311
|
/* @__PURE__ */ e(
|
|
161
312
|
"button",
|
|
162
313
|
{
|
|
163
314
|
type: "button",
|
|
164
315
|
"aria-label": "Undo",
|
|
165
|
-
className:
|
|
166
|
-
disabled: !
|
|
167
|
-
onClick:
|
|
168
|
-
"data-tip":
|
|
169
|
-
children: /* @__PURE__ */ e(
|
|
316
|
+
className: j,
|
|
317
|
+
disabled: !t.canUndo,
|
|
318
|
+
onClick: t.undo,
|
|
319
|
+
"data-tip": t.undoLabel ? `Undo ${t.undoLabel} (⌘Z)` : "Undo (⌘Z)",
|
|
320
|
+
children: /* @__PURE__ */ e(oe, { className: "h-4 w-4" })
|
|
170
321
|
}
|
|
171
322
|
),
|
|
172
323
|
/* @__PURE__ */ e(
|
|
@@ -174,68 +325,194 @@ function ue({
|
|
|
174
325
|
{
|
|
175
326
|
type: "button",
|
|
176
327
|
"aria-label": "Redo",
|
|
177
|
-
className:
|
|
178
|
-
disabled: !
|
|
179
|
-
onClick:
|
|
180
|
-
"data-tip":
|
|
181
|
-
children: /* @__PURE__ */ e(
|
|
328
|
+
className: j,
|
|
329
|
+
disabled: !t.canRedo,
|
|
330
|
+
onClick: t.redo,
|
|
331
|
+
"data-tip": t.redoLabel ? `Redo ${t.redoLabel} (⇧⌘Z)` : "Redo (⇧⌘Z)",
|
|
332
|
+
children: /* @__PURE__ */ e(se, { className: "h-4 w-4" })
|
|
182
333
|
}
|
|
183
334
|
)
|
|
184
335
|
] }),
|
|
185
|
-
/* @__PURE__ */
|
|
186
|
-
|
|
187
|
-
"
|
|
336
|
+
u && /* @__PURE__ */ n(H, { children: [
|
|
337
|
+
/* @__PURE__ */ e(w, {}),
|
|
338
|
+
/* @__PURE__ */ e("div", { className: "flex shrink-0 items-center gap-1", children: u })
|
|
339
|
+
] }),
|
|
340
|
+
/* @__PURE__ */ e(w, {}),
|
|
341
|
+
/* @__PURE__ */ e(
|
|
342
|
+
He,
|
|
188
343
|
{
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
344
|
+
collection: i,
|
|
345
|
+
value: c,
|
|
346
|
+
onChange: b,
|
|
347
|
+
showHidden: f,
|
|
348
|
+
onShowHidden: P,
|
|
349
|
+
extra: v
|
|
350
|
+
}
|
|
351
|
+
),
|
|
352
|
+
/* @__PURE__ */ e(
|
|
353
|
+
R,
|
|
354
|
+
{
|
|
355
|
+
label: "Tools",
|
|
356
|
+
icon: /* @__PURE__ */ e(le, { className: "h-3.5 w-3.5" }),
|
|
357
|
+
tip: "Arrange, find, outline, every form, form map and shortcuts",
|
|
358
|
+
children: k
|
|
359
|
+
}
|
|
360
|
+
),
|
|
361
|
+
/* @__PURE__ */ e(
|
|
362
|
+
R,
|
|
363
|
+
{
|
|
364
|
+
label: "AI",
|
|
365
|
+
icon: /* @__PURE__ */ e(de, { className: "h-3.5 w-3.5 text-nvr-cyan" }),
|
|
366
|
+
tip: "Rebuild, review and ask about this form with AI; type a change",
|
|
367
|
+
width: "w-[320px]",
|
|
368
|
+
children: T
|
|
369
|
+
}
|
|
370
|
+
),
|
|
371
|
+
N,
|
|
372
|
+
/* @__PURE__ */ n(X, { open: L, onOpenChange: U, children: [
|
|
373
|
+
/* @__PURE__ */ e(Y, { asChild: !0, children: /* @__PURE__ */ e(
|
|
374
|
+
"button",
|
|
375
|
+
{
|
|
376
|
+
type: "button",
|
|
377
|
+
className: h(j, L && Be),
|
|
378
|
+
"aria-label": "History",
|
|
379
|
+
"data-tip": "History: saved versions, this session’s steps, restore",
|
|
380
|
+
"data-editor-history": "",
|
|
381
|
+
children: /* @__PURE__ */ e(ie, { className: "h-4 w-4" })
|
|
382
|
+
}
|
|
383
|
+
) }),
|
|
384
|
+
/* @__PURE__ */ e(
|
|
385
|
+
q,
|
|
386
|
+
{
|
|
387
|
+
align: "end",
|
|
388
|
+
className: "max-h-[min(75vh,640px)] w-[460px] overflow-y-auto overscroll-contain p-3",
|
|
389
|
+
children: L && /* @__PURE__ */ e(
|
|
390
|
+
Ne,
|
|
196
391
|
{
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
children: /* @__PURE__ */ e(
|
|
207
|
-
"span",
|
|
208
|
-
{
|
|
209
|
-
className: g(
|
|
210
|
-
"absolute left-0 top-0.5 h-3 w-3 rounded-full bg-white transition-transform",
|
|
211
|
-
d ? "translate-x-3.5" : "translate-x-0.5"
|
|
212
|
-
)
|
|
213
|
-
}
|
|
214
|
-
)
|
|
392
|
+
layoutId: a,
|
|
393
|
+
onRestored: () => U(!1),
|
|
394
|
+
unsavedCount: p,
|
|
395
|
+
onDiscardUnsaved: t.discard,
|
|
396
|
+
session: t.session,
|
|
397
|
+
onJump: t.jump,
|
|
398
|
+
onShowOnCanvas: g ? (m, ne) => {
|
|
399
|
+
U(!1), g(m, ne);
|
|
400
|
+
} : void 0
|
|
215
401
|
}
|
|
216
402
|
)
|
|
403
|
+
}
|
|
404
|
+
)
|
|
405
|
+
] }),
|
|
406
|
+
/* @__PURE__ */ n(
|
|
407
|
+
R,
|
|
408
|
+
{
|
|
409
|
+
label: "More",
|
|
410
|
+
icon: /* @__PURE__ */ e(ce, { className: "h-4 w-4" }),
|
|
411
|
+
iconOnly: !0,
|
|
412
|
+
align: "end",
|
|
413
|
+
tip: "Test, share and watch this form, templates and download",
|
|
414
|
+
data: { "data-editor-more": "" },
|
|
415
|
+
children: [
|
|
416
|
+
Q,
|
|
417
|
+
/* @__PURE__ */ e(E, {}),
|
|
418
|
+
/* @__PURE__ */ e(fe, { layoutId: a, fields: d, onSelectField: S }),
|
|
419
|
+
/* @__PURE__ */ e(ke, { layoutId: a }),
|
|
420
|
+
/* @__PURE__ */ e(E, {}),
|
|
421
|
+
B
|
|
217
422
|
]
|
|
218
423
|
}
|
|
219
424
|
),
|
|
220
|
-
/* @__PURE__ */
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
425
|
+
/* @__PURE__ */ e(w, {}),
|
|
426
|
+
/* @__PURE__ */ e(je, { draft: t, onOpen: C }),
|
|
427
|
+
/* @__PURE__ */ n("div", { "data-save-split": "", className: "flex shrink-0 items-center", children: [
|
|
428
|
+
O && /* @__PURE__ */ n(
|
|
429
|
+
"button",
|
|
430
|
+
{
|
|
431
|
+
type: "button",
|
|
432
|
+
"data-editor-save": "",
|
|
433
|
+
disabled: p === 0,
|
|
434
|
+
onClick: () => {
|
|
435
|
+
var m;
|
|
436
|
+
return void ((m = t.save) == null ? void 0 : m.call(t));
|
|
437
|
+
},
|
|
438
|
+
"data-tip": p > 0 ? `Save ${I(p)} (⌘S)` : "Nothing to save",
|
|
439
|
+
className: h(
|
|
440
|
+
"inline-flex h-8 items-center gap-1.5 rounded-l-md px-3 text-[12.5px] font-medium transition-opacity disabled:pointer-events-none disabled:opacity-40",
|
|
441
|
+
p > 0 ? "bg-nvr-cyan text-white hover:opacity-90" : "border border-slate-200 text-slate-700 dark:border-border dark:text-foreground"
|
|
442
|
+
),
|
|
443
|
+
children: [
|
|
444
|
+
/* @__PURE__ */ e(Z, { className: "h-3.5 w-3.5" }),
|
|
445
|
+
"Save"
|
|
446
|
+
]
|
|
447
|
+
}
|
|
448
|
+
),
|
|
449
|
+
/* @__PURE__ */ n(
|
|
450
|
+
R,
|
|
227
451
|
{
|
|
452
|
+
label: "Save options",
|
|
453
|
+
icon: /* @__PURE__ */ e(J, { className: "h-3.5 w-3.5" }),
|
|
454
|
+
iconOnly: !0,
|
|
228
455
|
align: "end",
|
|
229
|
-
|
|
230
|
-
|
|
456
|
+
width: "w-[300px]",
|
|
457
|
+
tip: O ? "Review, check or schedule the changes; Autosave" : "Autosave",
|
|
458
|
+
className: h(
|
|
459
|
+
O ? "rounded-l-none border border-l-0 border-slate-200 dark:border-border" : "border border-slate-200 dark:border-border"
|
|
460
|
+
),
|
|
461
|
+
data: { "data-save-menu": "" },
|
|
462
|
+
children: [
|
|
463
|
+
o && $ && /* @__PURE__ */ e(
|
|
464
|
+
_,
|
|
465
|
+
{
|
|
466
|
+
label: "Review changes on canvas",
|
|
467
|
+
icon: /* @__PURE__ */ e(me, { className: "h-3.5 w-3.5" }),
|
|
468
|
+
hint: "Mark the unsaved changes on the form",
|
|
469
|
+
checked: K,
|
|
470
|
+
onClick: o,
|
|
471
|
+
data: { "data-editor-review": "" }
|
|
472
|
+
}
|
|
473
|
+
),
|
|
474
|
+
$ && V,
|
|
475
|
+
/* @__PURE__ */ e(we, { layoutId: a, draft: t }),
|
|
476
|
+
t.unsavedOps && t.discard && $ && /* @__PURE__ */ e(
|
|
477
|
+
Te,
|
|
478
|
+
{
|
|
479
|
+
collection: i,
|
|
480
|
+
layoutId: a,
|
|
481
|
+
draft: {
|
|
482
|
+
unsavedOps: t.unsavedOps,
|
|
483
|
+
discard: t.discard,
|
|
484
|
+
unsavedCount: p
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
),
|
|
488
|
+
t.setAutosave && /* @__PURE__ */ n(H, { children: [
|
|
489
|
+
/* @__PURE__ */ e(E, {}),
|
|
490
|
+
/* @__PURE__ */ e(
|
|
491
|
+
_,
|
|
492
|
+
{
|
|
493
|
+
label: "Autosave",
|
|
494
|
+
icon: /* @__PURE__ */ e(Z, { className: "h-3.5 w-3.5" }),
|
|
495
|
+
hint: t.autosave ? "Every change saves as you make it, until you close the editor" : "Off: changes wait for Save",
|
|
496
|
+
checked: !!t.autosave,
|
|
497
|
+
onClick: () => {
|
|
498
|
+
var m;
|
|
499
|
+
return (m = t.setAutosave) == null ? void 0 : m.call(t, !t.autosave);
|
|
500
|
+
},
|
|
501
|
+
data: { "data-autosave-switch": "" }
|
|
502
|
+
}
|
|
503
|
+
)
|
|
504
|
+
] })
|
|
505
|
+
]
|
|
231
506
|
}
|
|
232
507
|
)
|
|
233
|
-
] })
|
|
234
|
-
/* @__PURE__ */ e(V, { draft: n })
|
|
508
|
+
] })
|
|
235
509
|
]
|
|
236
510
|
}
|
|
237
511
|
);
|
|
238
512
|
}
|
|
513
|
+
function w() {
|
|
514
|
+
return /* @__PURE__ */ e("span", { "aria-hidden": !0, "data-tb-wide": "", className: "h-5 w-px shrink-0 bg-slate-200 dark:bg-border" });
|
|
515
|
+
}
|
|
239
516
|
export {
|
|
240
|
-
|
|
517
|
+
nt as EditorTopBar
|
|
241
518
|
};
|