@nivaro/react 0.2.53 → 0.2.55
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 +452 -4
- package/dist/index.js +644 -618
- package/dist/layout-editor.d.ts +252 -2
- 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/FormWhatsNew.js +60 -0
- package/dist/shared/components/ItemEditForm.js +3968 -3618
- 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 +598 -543
- package/dist/shared/components/ReportView.js +578 -543
- package/dist/shared/components/RowPresence.js +91 -0
- package/dist/shared/components/TipLayer.js +27 -27
- 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 +80 -67
- package/dist/shared/components/help-videos/editor/DetailsTab.js +147 -130
- 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 +9 -8
- package/dist/shared/components/item-edit/FieldRenderer.js +248 -245
- package/dist/shared/components/item-edit/FieldRow.js +382 -320
- package/dist/shared/components/item-edit/FormHelpVideoButton.js +59 -0
- package/dist/shared/components/item-edit/GroupSection.js +786 -639
- package/dist/shared/components/item-edit/HeaderTools.js +59 -56
- package/dist/shared/components/item-edit/InlineTableField.js +3 -1
- package/dist/shared/components/item-edit/LayoutContentBlock.js +47 -24
- 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 +94 -0
- 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 +65 -0
- package/dist/shared/components/layout-editor/AddPanel.js +226 -151
- 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 +147 -0
- package/dist/shared/components/layout-editor/CollabParts.js +175 -0
- package/dist/shared/components/layout-editor/DesignNode.js +311 -116
- package/dist/shared/components/layout-editor/EditorCanvas.js +30 -26
- package/dist/shared/components/layout-editor/EditorTopBar.js +463 -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 +250 -109
- package/dist/shared/components/layout-editor/LayoutEditor.js +1196 -305
- 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/RestorePiece.js +143 -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/StagedChip.js +22 -0
- package/dist/shared/components/layout-editor/StructureMenu.js +464 -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 +388 -0
- package/dist/shared/components/layout-editor/collab/collab-api.js +80 -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 +181 -164
- package/dist/shared/components/layout-editor/dnd/collision.js +25 -23
- package/dist/shared/components/layout-editor/dnd/node.js +69 -57
- package/dist/shared/components/layout-editor/dnd/rail-drop.js +56 -0
- package/dist/shared/components/layout-editor/draft-recovery.js +131 -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/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/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/grid-guides.js +142 -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/BehaviourSettings.js +402 -0
- package/dist/shared/components/layout-editor/inspector/Breadcrumb.js +36 -0
- package/dist/shared/components/layout-editor/inspector/BulkInspector.js +179 -0
- package/dist/shared/components/layout-editor/inspector/ColumnFit.js +112 -0
- package/dist/shared/components/layout-editor/inspector/GroupInspector.js +291 -141
- package/dist/shared/components/layout-editor/inspector/HelpTab.js +174 -0
- package/dist/shared/components/layout-editor/inspector/Inspector.js +282 -180
- package/dist/shared/components/layout-editor/inspector/LookTab.js +166 -109
- package/dist/shared/components/layout-editor/inspector/OverrideNotice.js +61 -0
- package/dist/shared/components/layout-editor/inspector/PickerMisses.js +129 -0
- package/dist/shared/components/layout-editor/inspector/PickerPreview.js +134 -0
- package/dist/shared/components/layout-editor/inspector/PickerTab.js +146 -118
- package/dist/shared/components/layout-editor/inspector/RulesTab.js +162 -111
- package/dist/shared/components/layout-editor/inspector/Translations.js +156 -0
- package/dist/shared/components/layout-editor/inspector/kit.js +71 -70
- 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/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/OverviewActions.js +15 -3
- package/dist/shared/components/layout-editor/overview/describe-conditions.js +24 -14
- package/dist/shared/components/layout-editor/overview/overview-api.js +105 -88
- package/dist/shared/components/layout-editor/overview/purpose.js +15 -13
- 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/restore-piece.js +192 -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/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 +125 -103
- package/dist/shared/components/layout-editor/settings/InheritanceSection.js +1 -1
- package/dist/shared/components/layout-editor/settings/ResolveSettings.js +255 -0
- package/dist/shared/components/layout-editor/settings/ToolsSection.js +215 -105
- package/dist/shared/components/layout-editor/settings/WhoSection.js +139 -100
- package/dist/shared/components/layout-editor/settings/controls.js +8 -8
- package/dist/shared/components/layout-editor/settings/settings-registry.js +142 -21
- 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/staged-api.js +64 -0
- package/dist/shared/components/layout-editor/structure-ops.js +403 -0
- package/dist/shared/components/layout-editor/testing/CostLimitSetting.js +42 -0
- package/dist/shared/components/layout-editor/testing/TestingPanels.js +556 -0
- package/dist/shared/components/layout-editor/testing/testing-api.js +67 -0
- package/dist/shared/components/layout-editor/testing/testing-model.js +406 -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/AbTestSection.js +355 -0
- package/dist/shared/components/layout-editor/usage/FillChip.js +27 -0
- package/dist/shared/components/layout-editor/usage/UsagePanel.js +232 -0
- 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/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 -306
- 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/SuggestFormChange.js +143 -0
- package/dist/shared/components/support/SupportAnalytics.js +171 -0
- package/dist/shared/components/support/SupportView.js +75 -73
- package/dist/shared/lib/ai-fill.js +37 -0
- 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 +133 -0
- package/dist/shared/lib/jobs-tray.js +25 -23
- package/dist/shared/lib/keyset-pager.js +37 -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 +116 -110
- 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/screenshot.js +54 -28
- package/dist/shared/lib/search-log.js +27 -0
- package/dist/shared/lib/socket-realtime.js +101 -80
- package/dist/shared/lib/visible-when.js +34 -0
- package/dist/shared/lib/worker-socket.js +200 -0
- package/package.json +1 -1
|
@@ -1,43 +1,54 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useQueryClient as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { jsxs as s, jsx as a, Fragment as I } from "react/jsx-runtime";
|
|
2
|
+
import { useQueryClient as ee, useQuery as Q, useMutation as te } from "@tanstack/react-query";
|
|
3
|
+
import { Bookmark as D } from "lucide-react";
|
|
4
|
+
import { useState as h } from "react";
|
|
5
|
+
import { toast as G } from "sonner";
|
|
6
|
+
import { useNivaroClient as ae } from "../../context.js";
|
|
7
|
+
import { get as R, post as ne } from "../../lib/commands.js";
|
|
8
|
+
import { ExplainDiffButton as re } from "./assist/ExplainDiff.js";
|
|
9
|
+
import { useVersionNaming as se, fetchVersionBundle as oe } from "./history-api.js";
|
|
10
|
+
import { RestorePieceButton as ie } from "./RestorePiece.js";
|
|
11
|
+
import { SessionHistory as le } from "./SessionHistory.js";
|
|
12
|
+
import { slotName as de } from "./slot-names.js";
|
|
13
|
+
import { layoutDraftKeys as W, parseSaveFailure as V } from "./useLayoutDraft.js";
|
|
14
|
+
function ce(t) {
|
|
15
|
+
return /^before\b/i.test(t) ? t : `Before: ${t}`;
|
|
9
16
|
}
|
|
10
|
-
const
|
|
11
|
-
function
|
|
12
|
-
if (
|
|
13
|
-
if (typeof
|
|
14
|
-
const
|
|
15
|
-
return
|
|
17
|
+
const H = W.versions, me = W.bundle;
|
|
18
|
+
function N(t) {
|
|
19
|
+
if (t == null || t === "") return "empty";
|
|
20
|
+
if (typeof t == "object") {
|
|
21
|
+
const n = JSON.stringify(t);
|
|
22
|
+
return n.length > 60 ? `${n.slice(0, 57)}…` : n;
|
|
16
23
|
}
|
|
17
|
-
return String(
|
|
24
|
+
return String(t);
|
|
18
25
|
}
|
|
19
|
-
const
|
|
20
|
-
function
|
|
21
|
-
const
|
|
22
|
-
for (const
|
|
23
|
-
|
|
24
|
-
for (const
|
|
25
|
-
for (const
|
|
26
|
-
for (const
|
|
27
|
-
|
|
28
|
-
for (const
|
|
29
|
-
for (const
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
26
|
+
const O = (t) => t.map((n) => `${n.field} ${N(n.from)} → ${N(n.to)}`), F = (t) => t.startsWith("__") ? de(t) : t;
|
|
27
|
+
function ue(t) {
|
|
28
|
+
const n = [];
|
|
29
|
+
for (const r of t.layout)
|
|
30
|
+
n.push({ kind: "Form", text: `${r.field}: ${N(r.from)} → ${N(r.to)}` });
|
|
31
|
+
for (const r of t.groups.added) n.push({ kind: "Group added", text: r });
|
|
32
|
+
for (const r of t.groups.removed) n.push({ kind: "Group removed", text: r });
|
|
33
|
+
for (const r of t.groups.changed)
|
|
34
|
+
n.push({ kind: "Group", text: `${r.label}: ${O(r.changes).join(" · ")}` });
|
|
35
|
+
for (const r of t.assignments.added) n.push({ kind: "Field added", text: F(r) });
|
|
36
|
+
for (const r of t.assignments.removed)
|
|
37
|
+
n.push({ kind: "Field removed", text: F(r) });
|
|
38
|
+
for (const r of t.assignments.changed)
|
|
39
|
+
n.push({
|
|
40
|
+
kind: "Field",
|
|
41
|
+
text: `${F(r.label)}: ${O(r.changes).join(" · ")}`
|
|
42
|
+
});
|
|
43
|
+
return n;
|
|
33
44
|
}
|
|
34
|
-
function
|
|
35
|
-
const [
|
|
36
|
-
if (
|
|
37
|
-
return /* @__PURE__ */
|
|
38
|
-
const
|
|
39
|
-
return /* @__PURE__ */
|
|
40
|
-
|
|
45
|
+
function pe({ diff: t }) {
|
|
46
|
+
const [n, r] = h(!1);
|
|
47
|
+
if (t.total === 0)
|
|
48
|
+
return /* @__PURE__ */ a("p", { className: "mt-1 text-[12px] text-slate-500 dark:text-slate-400", children: "Nothing differs from that version. The form is exactly as it was saved." });
|
|
49
|
+
const l = ue(t), x = n ? l : l.slice(0, 12);
|
|
50
|
+
return /* @__PURE__ */ s("div", { className: "mt-1", children: [
|
|
51
|
+
t.warnings.map((o) => /* @__PURE__ */ a(
|
|
41
52
|
"p",
|
|
42
53
|
{
|
|
43
54
|
"data-layout-diff-warning": !0,
|
|
@@ -46,134 +57,264 @@ function Q({ diff: e }) {
|
|
|
46
57
|
},
|
|
47
58
|
o
|
|
48
59
|
)),
|
|
49
|
-
/* @__PURE__ */
|
|
50
|
-
|
|
60
|
+
/* @__PURE__ */ s("p", { className: "text-[12px] text-slate-500 dark:text-slate-400", children: [
|
|
61
|
+
t.total,
|
|
51
62
|
" change",
|
|
52
|
-
|
|
53
|
-
|
|
63
|
+
t.total === 1 ? "" : "s",
|
|
64
|
+
t.from.created_at ? ` since ${new Date(t.from.created_at).toLocaleString()}` : ""
|
|
54
65
|
] }),
|
|
55
|
-
/* @__PURE__ */
|
|
66
|
+
/* @__PURE__ */ a("ul", { className: "mt-1 space-y-0.5", children: x.map((o, c) => (
|
|
56
67
|
// biome-ignore lint/suspicious/noArrayIndexKey: ordered diff rows
|
|
57
|
-
/* @__PURE__ */
|
|
58
|
-
/* @__PURE__ */
|
|
59
|
-
/* @__PURE__ */
|
|
60
|
-
] },
|
|
68
|
+
/* @__PURE__ */ s("li", { className: "flex gap-2 text-[12px]", children: [
|
|
69
|
+
/* @__PURE__ */ a("span", { className: "w-24 shrink-0 text-[11px] text-slate-500 dark:text-slate-400", children: o.kind }),
|
|
70
|
+
/* @__PURE__ */ a("span", { className: "min-w-0 break-words text-slate-700 dark:text-slate-200", children: o.text })
|
|
71
|
+
] }, c)
|
|
61
72
|
)) }),
|
|
62
|
-
|
|
73
|
+
l.length > 12 && /* @__PURE__ */ a(
|
|
63
74
|
"button",
|
|
64
75
|
{
|
|
65
76
|
type: "button",
|
|
66
|
-
onClick: () =>
|
|
77
|
+
onClick: () => r((o) => !o),
|
|
67
78
|
className: "mt-1 text-[11px] text-slate-500 underline dark:text-slate-400",
|
|
68
|
-
children:
|
|
79
|
+
children: n ? "Show fewer" : `Show all ${l.length}`
|
|
69
80
|
}
|
|
70
81
|
)
|
|
71
82
|
] });
|
|
72
83
|
}
|
|
73
|
-
function
|
|
74
|
-
layoutId:
|
|
75
|
-
onRestored:
|
|
84
|
+
function _e({
|
|
85
|
+
layoutId: t,
|
|
86
|
+
onRestored: n,
|
|
87
|
+
unsavedCount: r = 0,
|
|
88
|
+
onDiscardUnsaved: l,
|
|
89
|
+
session: x,
|
|
90
|
+
onJump: o,
|
|
91
|
+
onShowOnCanvas: c,
|
|
92
|
+
bundle: _,
|
|
93
|
+
onApply: S,
|
|
94
|
+
fieldLabel: Y
|
|
76
95
|
}) {
|
|
77
|
-
const
|
|
78
|
-
queryKey:
|
|
79
|
-
queryFn: () =>
|
|
96
|
+
const g = ae(), k = ee(), [f, q] = h(null), [A, v] = h(null), { data: m = [], isLoading: z } = Q({
|
|
97
|
+
queryKey: H(t),
|
|
98
|
+
queryFn: () => g.request(R(`/collection-layouts/${t}/versions`)).then((e) => e.data ?? []),
|
|
80
99
|
staleTime: 0,
|
|
81
100
|
refetchOnMount: "always"
|
|
82
|
-
}),
|
|
83
|
-
queryKey: ["layout-editor", "version-diff",
|
|
84
|
-
queryFn: () =>
|
|
85
|
-
|
|
86
|
-
).then((
|
|
87
|
-
enabled:
|
|
101
|
+
}), u = f ?? (m.length > 0 ? "newest" : null), { data: p, isLoading: J } = Q({
|
|
102
|
+
queryKey: ["layout-editor", "version-diff", t, u],
|
|
103
|
+
queryFn: () => g.request(
|
|
104
|
+
R(`/collection-layouts/${t}/versions/${u}/diff`, { against: "current" })
|
|
105
|
+
).then((e) => e.data),
|
|
106
|
+
enabled: u != null,
|
|
88
107
|
staleTime: 0,
|
|
89
108
|
refetchOnMount: "always"
|
|
90
|
-
}),
|
|
91
|
-
mutationFn: (
|
|
109
|
+
}), b = te({
|
|
110
|
+
mutationFn: (e) => g.request(ne(`/collection-layouts/${t}/versions/${e}/restore`)),
|
|
92
111
|
onSuccess: () => {
|
|
93
|
-
|
|
112
|
+
v(null), l == null || l(), k.invalidateQueries({ queryKey: me(t) }), k.invalidateQueries({ queryKey: H(t) }), k.invalidateQueries({ queryKey: ["layout-editor", "version-diff", t] }), n == null || n();
|
|
94
113
|
}
|
|
95
|
-
}),
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
114
|
+
}), y = m.find((e) => e.id === f), { nameVersion: X, nameCurrent: Z } = se(t), [w, $] = h(null), [K, L] = h(""), [C, j] = h(null), B = (e, i = "") => {
|
|
115
|
+
$(e), L(i);
|
|
116
|
+
}, T = () => {
|
|
117
|
+
const e = w, i = K.trim();
|
|
118
|
+
if ($(null), e == null) return;
|
|
119
|
+
const P = { onError: (U) => G.error(V(U, "Not named").message) };
|
|
120
|
+
e === "current" ? i && Z.mutate(i, P) : X.mutate({ versionId: e, name: i || null }, P);
|
|
121
|
+
}, E = async (e) => {
|
|
122
|
+
if (c) {
|
|
123
|
+
j(e.id);
|
|
124
|
+
try {
|
|
125
|
+
const i = await oe(g, t, e.id);
|
|
126
|
+
c(i, e.name ? `“${e.name}” (v${e.version})` : `version ${e.version}`);
|
|
127
|
+
} catch (i) {
|
|
128
|
+
G.error(V(i, "That version could not be read").message);
|
|
129
|
+
} finally {
|
|
130
|
+
j(null);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}, M = /* @__PURE__ */ a(
|
|
134
|
+
"input",
|
|
135
|
+
{
|
|
136
|
+
autoFocus: !0,
|
|
137
|
+
"aria-label": "Version name",
|
|
138
|
+
value: K,
|
|
139
|
+
maxLength: 120,
|
|
140
|
+
placeholder: "e.g. Go-live baseline",
|
|
141
|
+
onChange: (e) => L(e.target.value),
|
|
142
|
+
onKeyDown: (e) => {
|
|
143
|
+
e.key === "Enter" && T(), e.key === "Escape" && (e.stopPropagation(), $(null));
|
|
144
|
+
},
|
|
145
|
+
onBlur: T,
|
|
146
|
+
className: "h-6 w-full min-w-0 rounded border border-nvr-cyan bg-white px-1.5 text-[12px] outline-none dark:bg-background dark:text-foreground"
|
|
147
|
+
}
|
|
148
|
+
), d = "rounded border border-slate-200 px-1.5 py-0.5 text-[11px] hover:bg-slate-50 dark:border-border dark:hover:bg-muted";
|
|
149
|
+
return /* @__PURE__ */ s("div", { className: "flex flex-col gap-2 text-[12px]", "data-layout-history": !0, children: [
|
|
150
|
+
x && o && /* @__PURE__ */ a(le, { session: x, onJump: o }),
|
|
151
|
+
m.length > 0 && /* @__PURE__ */ s("div", { className: "rounded-lg border border-slate-200 bg-slate-50 p-2 dark:border-border dark:bg-muted/40", children: [
|
|
152
|
+
/* @__PURE__ */ s("div", { className: "flex items-center justify-between gap-2", children: [
|
|
153
|
+
/* @__PURE__ */ a("p", { className: "text-[11px] font-semibold text-slate-600 dark:text-slate-300", children: f == null ? "What the last save changed" : `Version ${(y == null ? void 0 : y.version) ?? "?"} compared with now` }),
|
|
154
|
+
/* @__PURE__ */ s("span", { className: "flex items-center gap-2", children: [
|
|
155
|
+
c && p && p.total > 0 && /* @__PURE__ */ a(
|
|
156
|
+
"button",
|
|
157
|
+
{
|
|
158
|
+
type: "button",
|
|
159
|
+
"data-show-on-canvas": "",
|
|
160
|
+
disabled: C != null,
|
|
161
|
+
onClick: () => {
|
|
162
|
+
const e = y ?? m[0];
|
|
163
|
+
e && E(e);
|
|
164
|
+
},
|
|
165
|
+
"data-tip": "Mark what differs on the form itself: added, moved, changed, removed",
|
|
166
|
+
className: "text-[11px] text-slate-600 underline dark:text-slate-300",
|
|
167
|
+
children: "Show on canvas"
|
|
168
|
+
}
|
|
169
|
+
),
|
|
170
|
+
f != null && /* @__PURE__ */ a(
|
|
171
|
+
"button",
|
|
172
|
+
{
|
|
173
|
+
type: "button",
|
|
174
|
+
onClick: () => q(null),
|
|
175
|
+
className: "text-[11px] text-slate-500 underline dark:text-slate-400",
|
|
176
|
+
children: "Show last save"
|
|
177
|
+
}
|
|
178
|
+
)
|
|
179
|
+
] })
|
|
109
180
|
] }),
|
|
110
|
-
|
|
111
|
-
|
|
181
|
+
J && /* @__PURE__ */ a("p", { className: "mt-1 text-slate-500", children: "Comparing…" }),
|
|
182
|
+
p && /* @__PURE__ */ a(pe, { diff: p }),
|
|
183
|
+
p && p.total > 0 && u != null && /* @__PURE__ */ a(
|
|
184
|
+
re,
|
|
185
|
+
{
|
|
186
|
+
className: "mt-2",
|
|
187
|
+
a: { layout_id: t, version: u },
|
|
188
|
+
b: { layout_id: t, version: "current" }
|
|
189
|
+
},
|
|
190
|
+
String(u)
|
|
191
|
+
)
|
|
112
192
|
] }),
|
|
113
|
-
|
|
114
|
-
|
|
193
|
+
b.isError && /* @__PURE__ */ a("p", { className: "text-[12px] text-[#9c2f47] dark:text-[#f08aa1]", children: "Restore failed. Nothing was changed." }),
|
|
194
|
+
/* @__PURE__ */ a("div", { className: "flex items-center gap-2", "data-name-current": "", children: w === "current" ? M : /* @__PURE__ */ s(
|
|
195
|
+
"button",
|
|
196
|
+
{
|
|
197
|
+
type: "button",
|
|
198
|
+
onClick: () => B("current"),
|
|
199
|
+
"data-tip": "Keep the form as it is saved now, under a name, beyond the rolling 30 versions",
|
|
200
|
+
className: `${d} inline-flex items-center gap-1`,
|
|
201
|
+
children: [
|
|
202
|
+
/* @__PURE__ */ a(D, { className: "h-3 w-3" }),
|
|
203
|
+
"Name the saved form…"
|
|
204
|
+
]
|
|
205
|
+
}
|
|
206
|
+
) }),
|
|
207
|
+
z ? /* @__PURE__ */ a("p", { className: "text-slate-500", children: "Loading history…" }) : m.length === 0 ? /* @__PURE__ */ a("p", { className: "text-slate-500 dark:text-slate-400", children: "No versions yet. One is saved before every change." }) : /* @__PURE__ */ a("ul", { className: "max-h-64 space-y-1 overflow-y-auto", children: m.map((e) => /* @__PURE__ */ s(
|
|
115
208
|
"li",
|
|
116
209
|
{
|
|
117
210
|
className: "flex items-center justify-between gap-2 rounded border border-slate-100 px-2 py-1 dark:border-border/60",
|
|
118
211
|
children: [
|
|
119
|
-
/* @__PURE__ */
|
|
120
|
-
|
|
212
|
+
/* @__PURE__ */ s("span", { className: "min-w-0 flex-1", children: [
|
|
213
|
+
w === e.id ? M : e.name && /* @__PURE__ */ s(
|
|
214
|
+
"span",
|
|
215
|
+
{
|
|
216
|
+
"data-version-name": e.name,
|
|
217
|
+
"data-tip": "Named: kept beyond the rolling 30 versions",
|
|
218
|
+
className: "mr-1 inline-flex max-w-full items-center gap-0.5 rounded bg-slate-100 px-1 text-[11px] font-medium text-slate-700 dark:bg-muted dark:text-slate-200",
|
|
219
|
+
children: [
|
|
220
|
+
/* @__PURE__ */ a(D, { className: "h-3 w-3 shrink-0" }),
|
|
221
|
+
/* @__PURE__ */ a("span", { className: "truncate", children: e.name })
|
|
222
|
+
]
|
|
223
|
+
}
|
|
224
|
+
),
|
|
225
|
+
/* @__PURE__ */ s("span", { className: "font-medium", children: [
|
|
121
226
|
"v",
|
|
122
|
-
|
|
227
|
+
e.version
|
|
123
228
|
] }),
|
|
124
229
|
" ",
|
|
125
|
-
/* @__PURE__ */
|
|
126
|
-
|
|
127
|
-
new Date(
|
|
128
|
-
|
|
230
|
+
/* @__PURE__ */ s("span", { className: "text-slate-500 dark:text-slate-400", children: [
|
|
231
|
+
e.note ? `${ce(e.note)} · ` : "",
|
|
232
|
+
new Date(e.created_at).toLocaleString(),
|
|
233
|
+
e.created_by_name ? ` · ${e.created_by_name}` : ""
|
|
129
234
|
] })
|
|
130
235
|
] }),
|
|
131
|
-
/* @__PURE__ */
|
|
132
|
-
/* @__PURE__ */
|
|
236
|
+
/* @__PURE__ */ s("span", { className: "flex shrink-0 items-center gap-1", children: [
|
|
237
|
+
/* @__PURE__ */ a(
|
|
133
238
|
"button",
|
|
134
239
|
{
|
|
135
240
|
type: "button",
|
|
136
|
-
"data-
|
|
137
|
-
|
|
241
|
+
"data-version-name-edit": e.version,
|
|
242
|
+
onClick: () => B(e.id, e.name ?? ""),
|
|
243
|
+
"data-tip": e.name ? "Rename, or clear the name to let it be pruned again" : "Name this version so it is kept beyond the rolling 30",
|
|
244
|
+
className: d,
|
|
245
|
+
children: e.name ? "Rename" : "Name"
|
|
246
|
+
}
|
|
247
|
+
),
|
|
248
|
+
/* @__PURE__ */ a(
|
|
249
|
+
"button",
|
|
250
|
+
{
|
|
251
|
+
type: "button",
|
|
252
|
+
"data-tip": "See what differs from the form now",
|
|
253
|
+
"data-version-diff": e.version,
|
|
138
254
|
"data-setting": "tool.version_diff",
|
|
139
|
-
onClick: () =>
|
|
140
|
-
className: `${
|
|
255
|
+
onClick: () => q(e.id),
|
|
256
|
+
className: `${d} ${f === e.id ? "border-nvr-cyan text-nvr-navy dark:text-nvr-cyan" : ""}`,
|
|
141
257
|
children: "Compare"
|
|
142
258
|
}
|
|
143
259
|
),
|
|
144
|
-
|
|
145
|
-
|
|
260
|
+
c && /* @__PURE__ */ a(
|
|
261
|
+
"button",
|
|
262
|
+
{
|
|
263
|
+
type: "button",
|
|
264
|
+
"data-version-canvas": e.version,
|
|
265
|
+
disabled: C != null,
|
|
266
|
+
onClick: () => void E(e),
|
|
267
|
+
"data-tip": "Mark on the form what differs from this version",
|
|
268
|
+
className: d,
|
|
269
|
+
children: C === e.id ? "…" : "Canvas"
|
|
270
|
+
}
|
|
271
|
+
),
|
|
272
|
+
_ && S && /* @__PURE__ */ a(
|
|
273
|
+
ie,
|
|
274
|
+
{
|
|
275
|
+
layoutId: t,
|
|
276
|
+
version: e,
|
|
277
|
+
bundle: _,
|
|
278
|
+
onApply: S,
|
|
279
|
+
fieldLabel: Y,
|
|
280
|
+
onDone: n,
|
|
281
|
+
className: d
|
|
282
|
+
}
|
|
283
|
+
),
|
|
284
|
+
A === e.id ? /* @__PURE__ */ s(I, { children: [
|
|
285
|
+
/* @__PURE__ */ a(
|
|
146
286
|
"button",
|
|
147
287
|
{
|
|
148
288
|
type: "button",
|
|
149
|
-
"data-restore-confirm":
|
|
150
|
-
disabled:
|
|
151
|
-
onClick: () =>
|
|
289
|
+
"data-restore-confirm": e.id,
|
|
290
|
+
disabled: b.isPending,
|
|
291
|
+
onClick: () => b.mutate(e.id),
|
|
292
|
+
"data-tip": r > 0 ? `Your ${r} unsaved ${r === 1 ? "change is" : "changes are"} dropped` : void 0,
|
|
152
293
|
className: "rounded bg-nvr-cyan px-1.5 py-0.5 text-[11px] text-white disabled:opacity-60",
|
|
153
|
-
children:
|
|
294
|
+
children: b.isPending ? "Restoring…" : r > 0 ? "Restore, drop unsaved" : "Yes, restore"
|
|
154
295
|
}
|
|
155
296
|
),
|
|
156
|
-
/* @__PURE__ */
|
|
157
|
-
] }) : /* @__PURE__ */
|
|
297
|
+
/* @__PURE__ */ a("button", { type: "button", onClick: () => v(null), className: d, children: "Cancel" })
|
|
298
|
+
] }) : /* @__PURE__ */ a(
|
|
158
299
|
"button",
|
|
159
300
|
{
|
|
160
301
|
type: "button",
|
|
161
|
-
"data-restore":
|
|
302
|
+
"data-restore": e.id,
|
|
162
303
|
"data-setting": "tool.version_restore",
|
|
163
|
-
"data-tip": "Replace the
|
|
164
|
-
onClick: () =>
|
|
165
|
-
className:
|
|
304
|
+
"data-tip": "Replace the form with this version. The current one is kept as a version first.",
|
|
305
|
+
onClick: () => v(e.id),
|
|
306
|
+
className: d,
|
|
166
307
|
children: "Restore"
|
|
167
308
|
}
|
|
168
309
|
)
|
|
169
310
|
] })
|
|
170
311
|
]
|
|
171
312
|
},
|
|
172
|
-
|
|
313
|
+
e.id
|
|
173
314
|
)) })
|
|
174
315
|
] });
|
|
175
316
|
}
|
|
176
317
|
export {
|
|
177
|
-
|
|
178
|
-
|
|
318
|
+
_e as HistoryPanel,
|
|
319
|
+
ce as versionNoteLabel
|
|
179
320
|
};
|