@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
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import { jsx as t, jsxs as r, Fragment as v } from "react/jsx-runtime";
|
|
2
|
+
import { useQueryClient as N } from "@tanstack/react-query";
|
|
3
|
+
import { Loader2 as b, ExternalLink as w } from "lucide-react";
|
|
4
|
+
import { useState as p } from "react";
|
|
5
|
+
import { toast as x } from "sonner";
|
|
6
|
+
import { useNivaroClient as q } from "../../../context.js";
|
|
7
|
+
import { cn as y, formatRelative as C } from "../../../lib/utils.js";
|
|
8
|
+
import { useLayoutEditorHost as _ } from "../host.js";
|
|
9
|
+
import { LoadError as L } from "../load-error.js";
|
|
10
|
+
import { apiFailure as R } from "../overview/overview-api.js";
|
|
11
|
+
import { useChangeRequests as D, resolveChangeRequest as E, opsKeys as K } from "./ops-api.js";
|
|
12
|
+
const c = "inline-flex h-7 items-center gap-1 whitespace-nowrap rounded-md border border-slate-200 bg-white px-2 text-[12px] font-medium text-slate-700 transition-colors hover:bg-slate-50 disabled:opacity-50 dark:border-border dark:bg-card dark:text-foreground dark:hover:bg-muted";
|
|
13
|
+
function G({
|
|
14
|
+
collection: e,
|
|
15
|
+
layoutId: s,
|
|
16
|
+
className: m
|
|
17
|
+
}) {
|
|
18
|
+
const { data: l, isLoading: u, isError: n, refetch: i } = D(e), o = (l ?? []).filter((a) => a.layout_id === s), d = (l ?? []).filter((a) => a.layout_id !== s);
|
|
19
|
+
return /* @__PURE__ */ t("div", { className: y("space-y-2", m), "data-change-requests": s, children: u ? /* @__PURE__ */ t(b, { className: "h-3.5 w-3.5 animate-spin text-slate-400" }) : n ? /* @__PURE__ */ t(L, { what: "the suggested changes", onRetry: () => void i() }) : o.length === 0 && d.length === 0 ? /* @__PURE__ */ t(
|
|
20
|
+
"p",
|
|
21
|
+
{
|
|
22
|
+
className: "text-[12px] text-slate-500 dark:text-muted-foreground",
|
|
23
|
+
"data-change-requests-empty": !0,
|
|
24
|
+
children: "No suggested changes. People send them from a record’s More menu → Suggest a form change."
|
|
25
|
+
}
|
|
26
|
+
) : /* @__PURE__ */ r(v, { children: [
|
|
27
|
+
o.length === 0 && /* @__PURE__ */ t("p", { className: "text-[12px] text-slate-500 dark:text-muted-foreground", children: "None about this form." }),
|
|
28
|
+
o.map((a) => /* @__PURE__ */ t(f, { r: a, collection: e }, a.id)),
|
|
29
|
+
d.length > 0 && /* @__PURE__ */ r("details", { className: "group", children: [
|
|
30
|
+
/* @__PURE__ */ r("summary", { className: "cursor-pointer text-[12px] font-medium text-slate-600 dark:text-muted-foreground", children: [
|
|
31
|
+
d.length,
|
|
32
|
+
" about other forms of this collection"
|
|
33
|
+
] }),
|
|
34
|
+
/* @__PURE__ */ t("div", { className: "mt-1.5 space-y-2", children: d.map((a) => /* @__PURE__ */ t(f, { r: a, collection: e }, a.id)) })
|
|
35
|
+
] })
|
|
36
|
+
] }) });
|
|
37
|
+
}
|
|
38
|
+
function f({ r: e, collection: s }) {
|
|
39
|
+
const m = q(), l = N(), u = _(), [n, i] = p(null), [o, d] = p(""), [a, g] = p(!1), k = async () => {
|
|
40
|
+
if (n) {
|
|
41
|
+
g(!0);
|
|
42
|
+
try {
|
|
43
|
+
await E(m, e.id, n, o.trim()), x.success(
|
|
44
|
+
n === "accept" ? "Marked done — they were told" : "Declined — they were told"
|
|
45
|
+
), l.invalidateQueries({ queryKey: K.requests(s) }), l.invalidateQueries({ queryKey: ["support-tickets"] });
|
|
46
|
+
} catch (h) {
|
|
47
|
+
x.error(R(h, "Could not close the suggestion").message);
|
|
48
|
+
} finally {
|
|
49
|
+
g(!1);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
return /* @__PURE__ */ r(
|
|
54
|
+
"div",
|
|
55
|
+
{
|
|
56
|
+
className: "rounded-md border border-slate-200 bg-white p-2.5 text-[12.5px] dark:border-border dark:bg-card",
|
|
57
|
+
"data-change-request": e.id,
|
|
58
|
+
children: [
|
|
59
|
+
/* @__PURE__ */ t("p", { className: "whitespace-pre-wrap break-words text-slate-800 dark:text-foreground", children: e.message || e.title }),
|
|
60
|
+
/* @__PURE__ */ r("div", { className: "mt-1 flex flex-wrap items-center gap-x-2 gap-y-0.5 text-[11.5px] text-slate-500 dark:text-muted-foreground", children: [
|
|
61
|
+
e.field && /* @__PURE__ */ t("span", { className: "rounded bg-slate-100 px-1.5 py-px text-slate-700 dark:bg-white/10 dark:text-foreground", children: e.field_label ?? e.field }),
|
|
62
|
+
e.layout_name && e.layout_id != null && /* @__PURE__ */ r("span", { children: [
|
|
63
|
+
"on “",
|
|
64
|
+
e.layout_name,
|
|
65
|
+
"”"
|
|
66
|
+
] }),
|
|
67
|
+
/* @__PURE__ */ t("span", { children: e.requester_name ?? "Someone" }),
|
|
68
|
+
e.created_at && /* @__PURE__ */ t("span", { children: C(e.created_at) }),
|
|
69
|
+
/* @__PURE__ */ r(
|
|
70
|
+
"a",
|
|
71
|
+
{
|
|
72
|
+
href: u.recordLink(s, e.item),
|
|
73
|
+
target: "_blank",
|
|
74
|
+
rel: "noreferrer",
|
|
75
|
+
className: "inline-flex items-center gap-0.5 text-[#0089ad] hover:underline dark:text-nvr-cyan",
|
|
76
|
+
children: [
|
|
77
|
+
e.record_label,
|
|
78
|
+
/* @__PURE__ */ t(w, { className: "h-3 w-3" })
|
|
79
|
+
]
|
|
80
|
+
}
|
|
81
|
+
)
|
|
82
|
+
] }),
|
|
83
|
+
n ? /* @__PURE__ */ r("div", { className: "mt-2 space-y-1.5", children: [
|
|
84
|
+
/* @__PURE__ */ t(
|
|
85
|
+
"textarea",
|
|
86
|
+
{
|
|
87
|
+
value: o,
|
|
88
|
+
onChange: (h) => d(h.target.value),
|
|
89
|
+
rows: 2,
|
|
90
|
+
placeholder: n === "accept" ? "Optional: what changed" : "Optional: why not",
|
|
91
|
+
"aria-label": "Note to the requester",
|
|
92
|
+
className: "w-full rounded-md border border-slate-200 bg-white px-2 py-1.5 text-[12.5px] text-slate-900 outline-none focus:border-nvr-cyan dark:border-border dark:bg-background dark:text-foreground"
|
|
93
|
+
}
|
|
94
|
+
),
|
|
95
|
+
/* @__PURE__ */ r("div", { className: "flex gap-1.5", children: [
|
|
96
|
+
/* @__PURE__ */ r(
|
|
97
|
+
"button",
|
|
98
|
+
{
|
|
99
|
+
type: "button",
|
|
100
|
+
className: y(
|
|
101
|
+
c,
|
|
102
|
+
n === "accept" ? "border-nvr-cyan/60 bg-nvr-cyan/10 text-nvr-navy dark:text-nvr-cyan" : "border-red-200 text-red-700 dark:border-red-500/40 dark:text-red-300"
|
|
103
|
+
),
|
|
104
|
+
disabled: a,
|
|
105
|
+
onClick: () => void k(),
|
|
106
|
+
"data-change-request-confirm": n,
|
|
107
|
+
children: [
|
|
108
|
+
a && /* @__PURE__ */ t(b, { className: "h-3 w-3 animate-spin" }),
|
|
109
|
+
n === "accept" ? "Mark done and tell them" : "Decline and tell them"
|
|
110
|
+
]
|
|
111
|
+
}
|
|
112
|
+
),
|
|
113
|
+
/* @__PURE__ */ t("button", { type: "button", className: c, onClick: () => i(null), children: "Cancel" })
|
|
114
|
+
] })
|
|
115
|
+
] }) : /* @__PURE__ */ r("div", { className: "mt-2 flex gap-1.5", children: [
|
|
116
|
+
/* @__PURE__ */ t(
|
|
117
|
+
"button",
|
|
118
|
+
{
|
|
119
|
+
type: "button",
|
|
120
|
+
className: c,
|
|
121
|
+
onClick: () => i("accept"),
|
|
122
|
+
"data-change-request-accept": e.id,
|
|
123
|
+
children: "Accept"
|
|
124
|
+
}
|
|
125
|
+
),
|
|
126
|
+
/* @__PURE__ */ t(
|
|
127
|
+
"button",
|
|
128
|
+
{
|
|
129
|
+
type: "button",
|
|
130
|
+
className: c,
|
|
131
|
+
onClick: () => i("decline"),
|
|
132
|
+
"data-change-request-decline": e.id,
|
|
133
|
+
children: "Decline"
|
|
134
|
+
}
|
|
135
|
+
)
|
|
136
|
+
] })
|
|
137
|
+
]
|
|
138
|
+
}
|
|
139
|
+
);
|
|
140
|
+
}
|
|
141
|
+
export {
|
|
142
|
+
G as ChangeRequestsPanel
|
|
143
|
+
};
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
import { jsxs as a, jsx as o, Fragment as _ } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as M, useState as R, useCallback as B, useLayoutEffect as E } from "react";
|
|
3
|
+
import { cn as c } from "../../../lib/utils.js";
|
|
4
|
+
import { Skeleton as S } from "../../ui/skeleton.js";
|
|
5
|
+
import { LoadError as A } from "../load-error.js";
|
|
6
|
+
import { useLayoutDependencies as F } from "./ops-api.js";
|
|
7
|
+
const O = {
|
|
8
|
+
grouped: "Form",
|
|
9
|
+
summary: "Summary",
|
|
10
|
+
detail: "Drill-down",
|
|
11
|
+
file: "PDF",
|
|
12
|
+
addendum: "Addendum",
|
|
13
|
+
table: "Grid columns"
|
|
14
|
+
};
|
|
15
|
+
function v(t, r) {
|
|
16
|
+
return !r || r === "rename" ? !1 : t.breaks.includes(r);
|
|
17
|
+
}
|
|
18
|
+
function j(t, r) {
|
|
19
|
+
const s = t.length;
|
|
20
|
+
if (s === 0) return "Nothing stored here uses this form.";
|
|
21
|
+
const l = `${s} ${s === 1 ? "thing uses" : "things use"} this form`;
|
|
22
|
+
if (!r) return `${l}.`;
|
|
23
|
+
if (r === "rename")
|
|
24
|
+
return `${l}. Renaming keeps every one working: they find it by its id or link name.`;
|
|
25
|
+
const i = t.filter((m) => v(m, r)).length;
|
|
26
|
+
return i === 0 ? `${l}. None of them depends on what you are changing.` : `${i} of ${s} ${r === "slug" ? "find it by its link name and stop finding it when the link name changes" : r === "type" ? "expect this kind of layout and may stop working as another kind" : "stop working when it is deleted"}.`;
|
|
27
|
+
}
|
|
28
|
+
function H({
|
|
29
|
+
layoutId: t,
|
|
30
|
+
change: r,
|
|
31
|
+
className: s,
|
|
32
|
+
compact: l
|
|
33
|
+
}) {
|
|
34
|
+
const { data: i, isLoading: u, isError: m, refetch: h } = F(t);
|
|
35
|
+
return u ? /* @__PURE__ */ a("div", { className: c("space-y-2", s), "data-dependency-diagram": "loading", children: [
|
|
36
|
+
/* @__PURE__ */ o(S, { className: "h-4 w-2/3" }),
|
|
37
|
+
/* @__PURE__ */ o(S, { className: "h-20 w-full" })
|
|
38
|
+
] }) : m || !i ? /* @__PURE__ */ o(A, { what: "what uses this form", onRetry: () => void h(), className: s }) : /* @__PURE__ */ o(P, { data: i, change: r, className: s, compact: l });
|
|
39
|
+
}
|
|
40
|
+
function P({
|
|
41
|
+
data: t,
|
|
42
|
+
change: r,
|
|
43
|
+
className: s,
|
|
44
|
+
compact: l
|
|
45
|
+
}) {
|
|
46
|
+
const i = M(null), u = M(null), [m, h] = R([]), [w, z] = R({ w: 0, h: 0 }), L = t.groups.map((e) => ({ ...e, nodes: t.nodes.filter((n) => n.group === e.id) })).filter((e) => e.nodes.length > 0 || e.id === "extensions"), f = B(() => {
|
|
47
|
+
const e = i.current, n = u.current;
|
|
48
|
+
if (!e || !n) return;
|
|
49
|
+
const d = e.getBoundingClientRect(), p = n.getBoundingClientRect(), x = Math.floor(p.right - d.left), N = Math.floor(p.top - d.top + p.height / 2), g = [];
|
|
50
|
+
for (const k of e.querySelectorAll("[data-dep-node]")) {
|
|
51
|
+
const b = k.getBoundingClientRect(), y = Math.floor(b.left - d.left), $ = Math.floor(b.top - d.top + b.height / 2), D = Math.max(12, (y - x) / 2);
|
|
52
|
+
g.push({
|
|
53
|
+
key: k.dataset.depNode ?? String(g.length),
|
|
54
|
+
broken: k.dataset.broken === "true",
|
|
55
|
+
d: `M ${x} ${N} C ${x + D} ${N}, ${y - D} ${$}, ${y} ${$}`
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
h(g), z({ w: Math.floor(d.width), h: Math.floor(d.height) });
|
|
59
|
+
}, []);
|
|
60
|
+
E(() => {
|
|
61
|
+
f();
|
|
62
|
+
const e = i.current;
|
|
63
|
+
if (!e || typeof ResizeObserver > "u") return;
|
|
64
|
+
const n = new ResizeObserver(() => f());
|
|
65
|
+
return n.observe(e), () => n.disconnect();
|
|
66
|
+
}, [f, t, r]);
|
|
67
|
+
const C = t.nodes.filter((e) => v(e, r)).length;
|
|
68
|
+
return /* @__PURE__ */ a("div", { className: c("space-y-2", s), "data-dependency-diagram": t.layout.id, children: [
|
|
69
|
+
/* @__PURE__ */ o(
|
|
70
|
+
"p",
|
|
71
|
+
{
|
|
72
|
+
className: c(
|
|
73
|
+
"text-[12px]",
|
|
74
|
+
C ? "font-medium text-red-700 dark:text-red-300" : "text-slate-600 dark:text-muted-foreground"
|
|
75
|
+
),
|
|
76
|
+
"data-dependency-summary": !0,
|
|
77
|
+
children: j(t.nodes, r)
|
|
78
|
+
}
|
|
79
|
+
),
|
|
80
|
+
/* @__PURE__ */ a(
|
|
81
|
+
"div",
|
|
82
|
+
{
|
|
83
|
+
ref: i,
|
|
84
|
+
className: c(
|
|
85
|
+
"relative grid items-center",
|
|
86
|
+
l ? "grid-cols-[96px_1fr] gap-x-7" : "grid-cols-[minmax(120px,28%)_1fr] gap-x-12"
|
|
87
|
+
),
|
|
88
|
+
children: [
|
|
89
|
+
/* @__PURE__ */ o(
|
|
90
|
+
"svg",
|
|
91
|
+
{
|
|
92
|
+
"aria-hidden": "true",
|
|
93
|
+
className: "pointer-events-none absolute inset-0 overflow-visible",
|
|
94
|
+
width: w.w,
|
|
95
|
+
height: w.h,
|
|
96
|
+
children: m.map((e) => /* @__PURE__ */ o(
|
|
97
|
+
"path",
|
|
98
|
+
{
|
|
99
|
+
d: e.d,
|
|
100
|
+
fill: "none",
|
|
101
|
+
strokeWidth: e.broken ? 1.75 : 1.25,
|
|
102
|
+
strokeDasharray: e.key.startsWith("ext-unchecked") ? "3 3" : void 0,
|
|
103
|
+
className: e.broken ? "stroke-red-400 dark:stroke-red-400/80" : "stroke-slate-300 dark:stroke-slate-600"
|
|
104
|
+
},
|
|
105
|
+
e.key
|
|
106
|
+
))
|
|
107
|
+
}
|
|
108
|
+
),
|
|
109
|
+
/* @__PURE__ */ a(
|
|
110
|
+
"div",
|
|
111
|
+
{
|
|
112
|
+
ref: u,
|
|
113
|
+
className: "relative z-[1] rounded-lg border border-nvr-cyan/60 bg-nvr-cyan/10 px-2.5 py-2 text-[12px]",
|
|
114
|
+
"data-dep-source": !0,
|
|
115
|
+
children: [
|
|
116
|
+
/* @__PURE__ */ o("div", { className: "font-semibold leading-tight text-slate-900 dark:text-foreground", children: t.layout.name }),
|
|
117
|
+
/* @__PURE__ */ a("div", { className: "mt-0.5 text-[11px] text-slate-600 dark:text-muted-foreground", children: [
|
|
118
|
+
O[t.layout.layout_type] ?? t.layout.layout_type,
|
|
119
|
+
t.layout.slug ? /* @__PURE__ */ a(_, { children: [
|
|
120
|
+
" · ",
|
|
121
|
+
/* @__PURE__ */ o("code", { className: "font-mono", children: t.layout.slug })
|
|
122
|
+
] }) : null
|
|
123
|
+
] })
|
|
124
|
+
]
|
|
125
|
+
}
|
|
126
|
+
),
|
|
127
|
+
/* @__PURE__ */ o("div", { className: "relative z-[1] min-w-0 space-y-2.5 py-1", children: L.map((e) => /* @__PURE__ */ a("div", { "data-dep-lane": e.id, children: [
|
|
128
|
+
/* @__PURE__ */ o("div", { className: "mb-1 text-[11px] font-medium text-slate-500 dark:text-muted-foreground", children: e.label }),
|
|
129
|
+
/* @__PURE__ */ a("div", { className: "space-y-1", children: [
|
|
130
|
+
e.nodes.map((n) => {
|
|
131
|
+
const d = v(n, r);
|
|
132
|
+
return /* @__PURE__ */ a(
|
|
133
|
+
"div",
|
|
134
|
+
{
|
|
135
|
+
"data-dep-node": `${n.kind}:${n.id}`,
|
|
136
|
+
"data-broken": d,
|
|
137
|
+
className: c(
|
|
138
|
+
"rounded-md border px-2 py-1 text-[12px] leading-snug",
|
|
139
|
+
d ? "border-red-300 bg-red-50 text-red-900 dark:border-red-500/40 dark:bg-red-500/10 dark:text-red-200" : "border-slate-200 bg-white text-slate-700 dark:border-border dark:bg-card dark:text-foreground"
|
|
140
|
+
),
|
|
141
|
+
children: [
|
|
142
|
+
/* @__PURE__ */ o("span", { className: "break-words", children: n.label }),
|
|
143
|
+
/* @__PURE__ */ o(
|
|
144
|
+
"span",
|
|
145
|
+
{
|
|
146
|
+
className: c(
|
|
147
|
+
"ml-1.5 whitespace-nowrap text-[10.5px]",
|
|
148
|
+
d ? "text-red-700 dark:text-red-300" : "text-slate-400 dark:text-muted-foreground"
|
|
149
|
+
),
|
|
150
|
+
children: d ? "breaks" : `by ${n.by === "slug" ? "link name" : n.by === "id" ? "id" : "id or link name"}`
|
|
151
|
+
}
|
|
152
|
+
)
|
|
153
|
+
]
|
|
154
|
+
},
|
|
155
|
+
`${n.kind}:${n.id}`
|
|
156
|
+
);
|
|
157
|
+
}),
|
|
158
|
+
e.id === "extensions" && /* @__PURE__ */ o(
|
|
159
|
+
"div",
|
|
160
|
+
{
|
|
161
|
+
"data-dep-node": "ext-unchecked",
|
|
162
|
+
"data-broken": "false",
|
|
163
|
+
className: "rounded-md border border-dashed border-slate-300 px-2 py-1 text-[11.5px] text-slate-500 dark:border-border dark:text-muted-foreground",
|
|
164
|
+
children: t.extensions.note
|
|
165
|
+
}
|
|
166
|
+
)
|
|
167
|
+
] })
|
|
168
|
+
] }, e.id)) })
|
|
169
|
+
]
|
|
170
|
+
}
|
|
171
|
+
)
|
|
172
|
+
] });
|
|
173
|
+
}
|
|
174
|
+
export {
|
|
175
|
+
H as DependencyDiagram,
|
|
176
|
+
P as DependencyDiagramView,
|
|
177
|
+
v as breaksOn,
|
|
178
|
+
j as impactSentence
|
|
179
|
+
};
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { jsxs as l, Fragment as g, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { ChevronRight as x } from "lucide-react";
|
|
3
|
+
import { useState as p } from "react";
|
|
4
|
+
import { cn as h } from "../../../lib/utils.js";
|
|
5
|
+
import { labelText as b } from "../panel-style.js";
|
|
6
|
+
import { quietText as v } from "../settings/controls.js";
|
|
7
|
+
import { ChangeRequestsPanel as y } from "./ChangeRequestsPanel.js";
|
|
8
|
+
import { DependencyDiagram as k } from "./DependencyDiagram.js";
|
|
9
|
+
import { useChangeRequests as N } from "./ops-api.js";
|
|
10
|
+
import { PromotePanel as q } from "./PromotePanel.js";
|
|
11
|
+
function W({
|
|
12
|
+
collection: n,
|
|
13
|
+
layoutId: t,
|
|
14
|
+
name: i
|
|
15
|
+
}) {
|
|
16
|
+
const { data: o = [], isError: a } = N(n), s = o.filter((r) => r.layout_id === t).length;
|
|
17
|
+
return /* @__PURE__ */ l(g, { children: [
|
|
18
|
+
/* @__PURE__ */ e(
|
|
19
|
+
m,
|
|
20
|
+
{
|
|
21
|
+
id: "change_requests",
|
|
22
|
+
label: "Suggested changes · from people",
|
|
23
|
+
count: s,
|
|
24
|
+
effect: "What people asked to change on this form, from a record’s More menu.",
|
|
25
|
+
defaultOpen: s > 0 || a,
|
|
26
|
+
children: /* @__PURE__ */ e(y, { collection: n, layoutId: t })
|
|
27
|
+
}
|
|
28
|
+
),
|
|
29
|
+
/* @__PURE__ */ e(
|
|
30
|
+
m,
|
|
31
|
+
{
|
|
32
|
+
id: "dependencies",
|
|
33
|
+
label: "What relies on this form",
|
|
34
|
+
effect: "Queues, grids, links, forms, files and extension code that open this form.",
|
|
35
|
+
children: /* @__PURE__ */ e(k, { layoutId: t, compact: !0 })
|
|
36
|
+
}
|
|
37
|
+
),
|
|
38
|
+
/* @__PURE__ */ e(
|
|
39
|
+
m,
|
|
40
|
+
{
|
|
41
|
+
id: "promote",
|
|
42
|
+
label: "Compare with another environment",
|
|
43
|
+
effect: "Bring another environment’s copy of this form here, after seeing what changes.",
|
|
44
|
+
children: /* @__PURE__ */ e(q, { layoutId: t, layoutName: i })
|
|
45
|
+
}
|
|
46
|
+
)
|
|
47
|
+
] });
|
|
48
|
+
}
|
|
49
|
+
function m({
|
|
50
|
+
id: n,
|
|
51
|
+
label: t,
|
|
52
|
+
effect: i,
|
|
53
|
+
count: o,
|
|
54
|
+
defaultOpen: a,
|
|
55
|
+
children: s
|
|
56
|
+
}) {
|
|
57
|
+
const [r, c] = p(!!a), [d, f] = p(!1);
|
|
58
|
+
return a && !r && !d && (f(!0), c(!0)), /* @__PURE__ */ l("div", { "data-layout-tool": n, className: "space-y-1.5", children: [
|
|
59
|
+
/* @__PURE__ */ l(
|
|
60
|
+
"button",
|
|
61
|
+
{
|
|
62
|
+
type: "button",
|
|
63
|
+
"aria-expanded": r,
|
|
64
|
+
onClick: () => {
|
|
65
|
+
f(!0), c((u) => !u);
|
|
66
|
+
},
|
|
67
|
+
className: h(b, "flex w-full items-center gap-1 text-left"),
|
|
68
|
+
children: [
|
|
69
|
+
/* @__PURE__ */ e(
|
|
70
|
+
x,
|
|
71
|
+
{
|
|
72
|
+
className: h("h-3.5 w-3.5 shrink-0 transition-transform", r && "rotate-90")
|
|
73
|
+
}
|
|
74
|
+
),
|
|
75
|
+
t,
|
|
76
|
+
o ? /* @__PURE__ */ e(
|
|
77
|
+
"span",
|
|
78
|
+
{
|
|
79
|
+
className: "ml-1 rounded-full bg-nvr-cyan/10 px-1.5 text-[11px] font-semibold text-nvr-navy dark:text-nvr-cyan",
|
|
80
|
+
"data-count": !0,
|
|
81
|
+
children: o
|
|
82
|
+
}
|
|
83
|
+
) : null
|
|
84
|
+
]
|
|
85
|
+
}
|
|
86
|
+
),
|
|
87
|
+
r ? s : /* @__PURE__ */ e("p", { className: v, children: i })
|
|
88
|
+
] });
|
|
89
|
+
}
|
|
90
|
+
export {
|
|
91
|
+
W as LayoutOpsBlocks
|
|
92
|
+
};
|