@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,179 @@
|
|
|
1
|
+
import { jsxs as s, jsx as o, Fragment as L } from "react/jsx-runtime";
|
|
2
|
+
import { X as R } from "lucide-react";
|
|
3
|
+
import { useMemo as S } from "react";
|
|
4
|
+
import { UNGROUPED_KEY as D } from "../../../lib/layout-ops.js";
|
|
5
|
+
import { TipLayer as H } from "../../TipLayer.js";
|
|
6
|
+
import { ArrangeButton as I } from "../ArrangeButton.js";
|
|
7
|
+
import { targetKey as N } from "../design-context.js";
|
|
8
|
+
import { PlacementPresets as j } from "../entry/PlacementPresets.js";
|
|
9
|
+
import { inPageOrder as z, selectedPlacements as B, fieldZones as E, isFieldRow as F, plural as g, widthOf as G, targetOfKey as O, keyOf as K, widthOps as U, GRID_WIDTHS as W, WIDTH_LABELS as $, flagOn as q, flagOps as A, moveToZoneOps as Z } from "../field-zones.js";
|
|
10
|
+
import { PanelHeader as V, PanelBody as X } from "../panel-frame.js";
|
|
11
|
+
import { effectText as Y } from "../panel-style.js";
|
|
12
|
+
import { slotName as J } from "../slot-names.js";
|
|
13
|
+
import { useCollectionMeta as Q } from "./field-context.js";
|
|
14
|
+
import { Setting as M, Segmented as ee, Toggle as te, Choice as oe } from "./kit.js";
|
|
15
|
+
import { describeField as ne } from "./model.js";
|
|
16
|
+
const le = [
|
|
17
|
+
{
|
|
18
|
+
k: "required",
|
|
19
|
+
label: "Required",
|
|
20
|
+
on: "Make {n} required",
|
|
21
|
+
off: "Make {n} optional",
|
|
22
|
+
effect: "The form will not save without a value."
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
k: "readonly",
|
|
26
|
+
label: "Read-only",
|
|
27
|
+
on: "Make {n} read-only",
|
|
28
|
+
off: "Make {n} editable",
|
|
29
|
+
effect: "Shown but not editable on this form."
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
k: "hidden",
|
|
33
|
+
label: "Hidden",
|
|
34
|
+
on: "Hide {n}",
|
|
35
|
+
off: "Show {n}",
|
|
36
|
+
effect: "Leaves them off this form; their values are kept."
|
|
37
|
+
}
|
|
38
|
+
];
|
|
39
|
+
function ve({
|
|
40
|
+
bundle: r,
|
|
41
|
+
selection: f,
|
|
42
|
+
apply: d,
|
|
43
|
+
collection: _,
|
|
44
|
+
onSelection: h
|
|
45
|
+
}) {
|
|
46
|
+
const { data: a } = Q(_), n = S(
|
|
47
|
+
() => z(r, B(r, f)),
|
|
48
|
+
[r, f]
|
|
49
|
+
), k = S(() => E(r), [r]), b = (e) => e.startsWith("__") ? J(e) : ne(
|
|
50
|
+
e,
|
|
51
|
+
(a == null ? void 0 : a.fields) ?? [],
|
|
52
|
+
(a == null ? void 0 : a.relations) ?? [],
|
|
53
|
+
n.find((t) => t.field === e) ?? null
|
|
54
|
+
).label, u = n.filter(F), m = f.length - n.length, p = g(n.length, "item"), x = new Set(n.map(G)), C = x.size === 1 ? String([...x][0]) : "", v = new Set(n.map((e) => e.group_key)), w = v.size === 1 ? P([...v][0] ?? null) : "", y = (e, t) => {
|
|
55
|
+
e.length && d(e, { label: t });
|
|
56
|
+
};
|
|
57
|
+
return /* @__PURE__ */ s(
|
|
58
|
+
"div",
|
|
59
|
+
{
|
|
60
|
+
"data-inspector": "",
|
|
61
|
+
"data-bulk-inspector": "",
|
|
62
|
+
className: "flex h-full min-h-0 min-w-0 flex-col text-[12px]",
|
|
63
|
+
children: [
|
|
64
|
+
/* @__PURE__ */ o(H, {}),
|
|
65
|
+
/* @__PURE__ */ o(
|
|
66
|
+
V,
|
|
67
|
+
{
|
|
68
|
+
eyebrow: "Several selected",
|
|
69
|
+
title: `${p} selected`,
|
|
70
|
+
sub: "Shift- or ⌘-click to add or take out"
|
|
71
|
+
}
|
|
72
|
+
),
|
|
73
|
+
/* @__PURE__ */ s(X, { children: [
|
|
74
|
+
/* @__PURE__ */ o("ul", { className: "flex flex-wrap gap-1.5", "aria-label": "Selected", children: n.map((e) => /* @__PURE__ */ s(
|
|
75
|
+
"li",
|
|
76
|
+
{
|
|
77
|
+
className: "inline-flex max-w-full items-center gap-1 rounded-full bg-nvr-cyan/10 py-0.5 pl-2.5 pr-1 text-[12px] font-medium text-slate-800 dark:text-foreground",
|
|
78
|
+
children: [
|
|
79
|
+
/* @__PURE__ */ o("span", { className: "truncate", children: b(e.field) }),
|
|
80
|
+
/* @__PURE__ */ o(
|
|
81
|
+
"button",
|
|
82
|
+
{
|
|
83
|
+
type: "button",
|
|
84
|
+
"aria-label": `Take ${b(e.field)} out of the selection`,
|
|
85
|
+
onClick: () => {
|
|
86
|
+
const t = N(O(K(e)));
|
|
87
|
+
h(f.filter((l) => N(l) !== t));
|
|
88
|
+
},
|
|
89
|
+
className: "inline-flex h-4 w-4 items-center justify-center rounded-full text-slate-500 hover:bg-nvr-cyan/20 hover:text-slate-800 dark:text-muted-foreground dark:hover:text-foreground",
|
|
90
|
+
children: /* @__PURE__ */ o(R, { className: "h-3 w-3" })
|
|
91
|
+
}
|
|
92
|
+
)
|
|
93
|
+
]
|
|
94
|
+
},
|
|
95
|
+
`${e.field}:${e.group_key ?? ""}`
|
|
96
|
+
)) }),
|
|
97
|
+
/* @__PURE__ */ s("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
98
|
+
/* @__PURE__ */ o(I, { targets: f }),
|
|
99
|
+
u.length > 0 && /* @__PURE__ */ o(j, { bundle: r, rows: u, apply: d })
|
|
100
|
+
] }),
|
|
101
|
+
m > 0 && /* @__PURE__ */ s("p", { className: Y, children: [
|
|
102
|
+
g(m, "item"),
|
|
103
|
+
" from the parent form ",
|
|
104
|
+
m === 1 ? "is" : "are",
|
|
105
|
+
" left out: override ",
|
|
106
|
+
m === 1 ? "it" : "them",
|
|
107
|
+
" on this form first."
|
|
108
|
+
] }),
|
|
109
|
+
n.length > 0 && /* @__PURE__ */ s(L, { children: [
|
|
110
|
+
/* @__PURE__ */ o(M, { k: "bulk.col_span", label: "Width", effect: "Share of the row each one takes.", children: /* @__PURE__ */ o(
|
|
111
|
+
ee,
|
|
112
|
+
{
|
|
113
|
+
value: C,
|
|
114
|
+
options: W.map((e) => ({ value: String(e), label: $[e] })),
|
|
115
|
+
onChange: (e) => y(
|
|
116
|
+
U(n, Number(e)),
|
|
117
|
+
`Set the width of ${p} to ${$[Number(e)]}`
|
|
118
|
+
)
|
|
119
|
+
}
|
|
120
|
+
) }),
|
|
121
|
+
le.map((e) => {
|
|
122
|
+
const t = e.k === "hidden" ? n : u;
|
|
123
|
+
if (t.length === 0) return null;
|
|
124
|
+
const l = t.filter((i) => q(i, e.k)).length, c = g(t.length, e.k === "hidden" ? "item" : "field");
|
|
125
|
+
return /* @__PURE__ */ o(
|
|
126
|
+
te,
|
|
127
|
+
{
|
|
128
|
+
k: `bulk.${e.k}`,
|
|
129
|
+
label: e.label,
|
|
130
|
+
effect: l > 0 && l < t.length ? `${l} of ${t.length} now. ${e.effect}` : e.effect,
|
|
131
|
+
checked: l === t.length,
|
|
132
|
+
onChange: (i) => y(A(t, e.k, i), (i ? e.on : e.off).replace("{n}", c))
|
|
133
|
+
},
|
|
134
|
+
e.k
|
|
135
|
+
);
|
|
136
|
+
}),
|
|
137
|
+
/* @__PURE__ */ o(
|
|
138
|
+
M,
|
|
139
|
+
{
|
|
140
|
+
k: "bulk.move",
|
|
141
|
+
label: "Section",
|
|
142
|
+
effect: "Moves them to the end of that section, in the order they are on the form.",
|
|
143
|
+
children: /* @__PURE__ */ o(
|
|
144
|
+
oe,
|
|
145
|
+
{
|
|
146
|
+
ariaLabel: "Move to section",
|
|
147
|
+
value: w,
|
|
148
|
+
options: [
|
|
149
|
+
...w ? [] : [{ value: "", label: "Several sections" }],
|
|
150
|
+
...k.map((e) => ({ value: P(e.key), label: e.label }))
|
|
151
|
+
],
|
|
152
|
+
onChange: (e) => {
|
|
153
|
+
if (!e) return;
|
|
154
|
+
const t = e === T ? null : e, l = k.find((i) => i.key === t), c = Z(r, n, t);
|
|
155
|
+
c.ops.length && (d(c.ops, { label: `Move ${p} to ${(l == null ? void 0 : l.label) ?? "another section"}` }), h(c.moved.map(O)));
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
)
|
|
159
|
+
}
|
|
160
|
+
)
|
|
161
|
+
] }),
|
|
162
|
+
/* @__PURE__ */ o(
|
|
163
|
+
"button",
|
|
164
|
+
{
|
|
165
|
+
type: "button",
|
|
166
|
+
onClick: () => h([]),
|
|
167
|
+
className: "text-[12px] font-medium text-sky-700 hover:underline dark:text-nvr-cyan",
|
|
168
|
+
children: "Clear the selection"
|
|
169
|
+
}
|
|
170
|
+
)
|
|
171
|
+
] })
|
|
172
|
+
]
|
|
173
|
+
}
|
|
174
|
+
);
|
|
175
|
+
}
|
|
176
|
+
const T = D, P = (r) => r ?? T;
|
|
177
|
+
export {
|
|
178
|
+
ve as BulkInspector
|
|
179
|
+
};
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { jsxs as s, jsx as l, Fragment as j } from "react/jsx-runtime";
|
|
2
|
+
import { AlertTriangle as F, Ruler as R } from "lucide-react";
|
|
3
|
+
import { useContext as A, useState as L } from "react";
|
|
4
|
+
import { cn as O } from "../../../lib/utils.js";
|
|
5
|
+
import { useColumnFacts as V, columnOf as $, useValueLengths as P } from "../inspect/inspect-api.js";
|
|
6
|
+
import { fitWarnings as U, widthCheckApplies as D, widthVerdict as E, typeWords as G, SPAN_WORDS as i, capacityChars as q } from "../inspect/width-fit.js";
|
|
7
|
+
import { labelText as z, effectText as c, tintCard as B } from "../panel-style.js";
|
|
8
|
+
import { useFieldCtx as H } from "./field-context.js";
|
|
9
|
+
import { GlobalWriterContext as I } from "./kit.js";
|
|
10
|
+
import { asObject as J } from "./model.js";
|
|
11
|
+
const p = (d) => d.toLocaleString();
|
|
12
|
+
function le() {
|
|
13
|
+
var w, N;
|
|
14
|
+
const d = H(), { info: h, row: o, ov: m, env: r, globalOptions: v } = d, { data: C } = V(r.collection), a = $(C, o.field), f = (w = A(I)) == null ? void 0 : w.draft.options, T = String((f == null ? void 0 : f.input_mask) ?? v.input_mask ?? ""), b = J(r.bundle.layout.default_values), _ = typeof m.label == "string" && m.label ? m.label : h.label, S = r.layoutType !== "table", y = U({
|
|
15
|
+
column: a,
|
|
16
|
+
mask: T || null,
|
|
17
|
+
defaultValue: o.field in b ? b[o.field] : void 0,
|
|
18
|
+
label: m.label === "" ? null : _,
|
|
19
|
+
span: o.col_span,
|
|
20
|
+
layoutType: r.layoutType
|
|
21
|
+
}), g = S && !!a && D(h), [x, W] = L(!1), t = P(r.collection, o.field, x && g);
|
|
22
|
+
if (!a && !y.length) return null;
|
|
23
|
+
const u = o.col_span ?? 12, e = t.data ? E(u, t.data.p95) : null, k = (n) => d.setPlacement(
|
|
24
|
+
{ col_span: n === 12 ? null : n },
|
|
25
|
+
`Set the width of ${h.label} to ${i[n]}`
|
|
26
|
+
);
|
|
27
|
+
return /* @__PURE__ */ s("div", { "data-setting": "field.column_fit", className: "space-y-1.5", children: [
|
|
28
|
+
/* @__PURE__ */ s("div", { className: "flex min-h-5 items-center justify-between gap-3", children: [
|
|
29
|
+
/* @__PURE__ */ l("span", { className: z, children: "Stored as" }),
|
|
30
|
+
a && /* @__PURE__ */ l("span", { className: "font-mono text-[12px] text-slate-700 dark:text-foreground", children: G(a) })
|
|
31
|
+
] }),
|
|
32
|
+
/* @__PURE__ */ l("p", { "data-effect": "", className: c, children: (a == null ? void 0 : a.max_length) != null ? `The database keeps up to ${p(a.max_length)} characters.` : a ? "What the database column holds." : "This field has no column of its own." }),
|
|
33
|
+
y.map((n) => /* @__PURE__ */ s(
|
|
34
|
+
"p",
|
|
35
|
+
{
|
|
36
|
+
"data-fit-warning": n.key,
|
|
37
|
+
className: "flex items-start gap-1.5 text-[12px] leading-snug text-amber-700 dark:text-amber-300",
|
|
38
|
+
children: [
|
|
39
|
+
/* @__PURE__ */ l(F, { className: "mt-[2px] h-3 w-3 shrink-0" }),
|
|
40
|
+
n.text
|
|
41
|
+
]
|
|
42
|
+
},
|
|
43
|
+
n.key
|
|
44
|
+
)),
|
|
45
|
+
g && !x && /* @__PURE__ */ s(
|
|
46
|
+
"button",
|
|
47
|
+
{
|
|
48
|
+
type: "button",
|
|
49
|
+
"data-width-check": "",
|
|
50
|
+
onClick: () => W(!0),
|
|
51
|
+
className: "inline-flex items-center gap-1.5 text-[12px] font-medium text-sky-700 hover:underline dark:text-nvr-cyan",
|
|
52
|
+
children: [
|
|
53
|
+
/* @__PURE__ */ l(R, { className: "h-3.5 w-3.5" }),
|
|
54
|
+
"Check the width against stored values"
|
|
55
|
+
]
|
|
56
|
+
}
|
|
57
|
+
),
|
|
58
|
+
g && x && /* @__PURE__ */ l("div", { "data-width-result": "", className: O(B, "space-y-1.5 p-2.5"), children: t.isLoading ? /* @__PURE__ */ l("p", { className: c, children: "Reading the newest stored values…" }) : t.isError ? /* @__PURE__ */ l("p", { className: "text-[12px] text-red-700 dark:text-red-300", children: ((N = t.error) == null ? void 0 : N.message) || "The stored values could not be read." }) : !t.data || t.data.filled === 0 ? /* @__PURE__ */ l("p", { className: c, children: "No stored values to measure yet." }) : /* @__PURE__ */ s(j, { children: [
|
|
59
|
+
/* @__PURE__ */ s("p", { className: "text-[12px] leading-snug text-slate-700 dark:text-foreground", children: [
|
|
60
|
+
"95% of ",
|
|
61
|
+
p(t.data.filled),
|
|
62
|
+
t.data.capped ? " recent" : "",
|
|
63
|
+
" values are ",
|
|
64
|
+
p(t.data.p95),
|
|
65
|
+
" characters or fewer (longest ",
|
|
66
|
+
p(t.data.max),
|
|
67
|
+
"). ",
|
|
68
|
+
i[u] ?? u,
|
|
69
|
+
" width shows about ",
|
|
70
|
+
q(u),
|
|
71
|
+
"."
|
|
72
|
+
] }),
|
|
73
|
+
e != null && e.cut ? /* @__PURE__ */ s("p", { className: "text-[12px] leading-snug text-amber-700 dark:text-amber-300", children: [
|
|
74
|
+
"This width cuts them off.",
|
|
75
|
+
" ",
|
|
76
|
+
/* @__PURE__ */ s(
|
|
77
|
+
"button",
|
|
78
|
+
{
|
|
79
|
+
type: "button",
|
|
80
|
+
"data-width-apply": e.suggest,
|
|
81
|
+
onClick: () => k(e.suggest),
|
|
82
|
+
className: "font-medium underline",
|
|
83
|
+
children: [
|
|
84
|
+
"Use ",
|
|
85
|
+
i[e.suggest]
|
|
86
|
+
]
|
|
87
|
+
}
|
|
88
|
+
)
|
|
89
|
+
] }) : e != null && e.roomy ? /* @__PURE__ */ s("p", { className: c, children: [
|
|
90
|
+
i[e.suggest],
|
|
91
|
+
" would be enough.",
|
|
92
|
+
" ",
|
|
93
|
+
/* @__PURE__ */ s(
|
|
94
|
+
"button",
|
|
95
|
+
{
|
|
96
|
+
type: "button",
|
|
97
|
+
"data-width-apply": e.suggest,
|
|
98
|
+
onClick: () => k(e.suggest),
|
|
99
|
+
className: "font-medium text-sky-700 hover:underline dark:text-nvr-cyan",
|
|
100
|
+
children: [
|
|
101
|
+
"Use ",
|
|
102
|
+
i[e.suggest]
|
|
103
|
+
]
|
|
104
|
+
}
|
|
105
|
+
)
|
|
106
|
+
] }) : /* @__PURE__ */ l("p", { className: c, children: "The width fits them." })
|
|
107
|
+
] }) })
|
|
108
|
+
] });
|
|
109
|
+
}
|
|
110
|
+
export {
|
|
111
|
+
le as ColumnFit
|
|
112
|
+
};
|