@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,65 @@
|
|
|
1
|
+
import { useRef as u, useEffect as h, useCallback as L } from "react";
|
|
2
|
+
import { useApiFetchConfig as F } from "../../context.js";
|
|
3
|
+
import { StepClock as R, onSectionUse as U, SectionTally as B, sessionEvent as H, queueFormUsage as q } from "../../lib/form-usage-beacon.js";
|
|
4
|
+
function V({
|
|
5
|
+
enabled: b,
|
|
6
|
+
layoutId: s,
|
|
7
|
+
collection: c,
|
|
8
|
+
itemId: d,
|
|
9
|
+
step: i
|
|
10
|
+
}) {
|
|
11
|
+
const l = F(), f = u(l);
|
|
12
|
+
f.current = l;
|
|
13
|
+
const v = u(i);
|
|
14
|
+
v.current = i;
|
|
15
|
+
const o = u(null), p = b && s != null && !!c;
|
|
16
|
+
return h(() => {
|
|
17
|
+
if (!p || s == null) return;
|
|
18
|
+
const n = () => typeof document > "u" || document.visibilityState !== "hidden", e = {
|
|
19
|
+
clock: new R(v.current, Date.now(), n()),
|
|
20
|
+
openSent: !1,
|
|
21
|
+
saved: !1,
|
|
22
|
+
elapsed: 0,
|
|
23
|
+
saveMs: null
|
|
24
|
+
};
|
|
25
|
+
o.current = e;
|
|
26
|
+
const r = new B(), D = U((t) => {
|
|
27
|
+
t.layoutId === s && t.collection === c && r.note(t.kind, t.key);
|
|
28
|
+
}), a = (t) => {
|
|
29
|
+
const { steps: E, total: S } = e.clock.take(Date.now());
|
|
30
|
+
e.elapsed += S;
|
|
31
|
+
const g = r.pending(), w = H({
|
|
32
|
+
layoutId: s,
|
|
33
|
+
collection: c,
|
|
34
|
+
item: d,
|
|
35
|
+
openSent: e.openSent,
|
|
36
|
+
saved: e.saved,
|
|
37
|
+
step: e.clock.currentStep,
|
|
38
|
+
steps: E,
|
|
39
|
+
total: S,
|
|
40
|
+
elapsed: e.elapsed,
|
|
41
|
+
final: t,
|
|
42
|
+
sections: g,
|
|
43
|
+
saveMs: e.saveMs
|
|
44
|
+
});
|
|
45
|
+
if (!w) return;
|
|
46
|
+
r.markSent(g), e.openSent = !0, e.saved = !1, e.saveMs = null;
|
|
47
|
+
const { apiBase: y, authHeaders: M, credentials: C } = f.current;
|
|
48
|
+
q(w, { apiBase: y, authHeaders: M, credentials: C });
|
|
49
|
+
}, m = () => {
|
|
50
|
+
document.visibilityState === "hidden" ? (a(!1), e.clock.pause(Date.now())) : e.clock.resume(Date.now());
|
|
51
|
+
}, k = () => a(!0);
|
|
52
|
+
return document.addEventListener("visibilitychange", m), window.addEventListener("pagehide", k), () => {
|
|
53
|
+
document.removeEventListener("visibilitychange", m), window.removeEventListener("pagehide", k), a(!0), D(), o.current === e && (o.current = null);
|
|
54
|
+
};
|
|
55
|
+
}, [p, s, c, d]), h(() => {
|
|
56
|
+
var n;
|
|
57
|
+
(n = o.current) == null || n.clock.step(i, Date.now());
|
|
58
|
+
}, [i]), { markSaved: L(() => {
|
|
59
|
+
const n = o.current;
|
|
60
|
+
n && (n.saved || (n.saveMs = n.elapsed + n.clock.peek(Date.now())), n.saved = !0);
|
|
61
|
+
}, []) };
|
|
62
|
+
}
|
|
63
|
+
export {
|
|
64
|
+
V as useFormUsageBeacon
|
|
65
|
+
};
|
|
@@ -1,17 +1,23 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useQuery as
|
|
3
|
-
import { Search as
|
|
4
|
-
import { useState as
|
|
5
|
-
import { useNivaroClient as
|
|
6
|
-
import { get as
|
|
7
|
-
import { HEADER_GROUP_KEY as
|
|
8
|
-
import { listLayoutSlots as
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
|
|
1
|
+
import { jsxs as d, jsx as o, Fragment as K } from "react/jsx-runtime";
|
|
2
|
+
import { useQuery as te } from "@tanstack/react-query";
|
|
3
|
+
import { Search as re, LayoutPanelTop as oe, Sigma as ae, Plus as Q, CopyPlus as ie, Check as ne } from "lucide-react";
|
|
4
|
+
import { useState as W, useMemo as Y } from "react";
|
|
5
|
+
import { useNivaroClient as se } from "../../context.js";
|
|
6
|
+
import { get as le } from "../../lib/commands.js";
|
|
7
|
+
import { HEADER_GROUP_KEY as R, isCanvasSlot as de } from "../../lib/layout-ops.js";
|
|
8
|
+
import { listLayoutSlots as ce } from "../../lib/layout-slots.js";
|
|
9
|
+
import { nextDisplayFormulaField as me } from "../../lib/placement-behaviour.js";
|
|
10
|
+
import { titleCase as $, cn as X } from "../../lib/utils.js";
|
|
11
|
+
import { sectionOp as ue, fieldSpot as j, slotSpot as pe, placeOp as z } from "./add-target.js";
|
|
12
|
+
import { MeaningSuggestions as _e } from "./ai-forms/MeaningSuggestions.js";
|
|
13
|
+
import { useAddDragSource as fe } from "./dnd/node.js";
|
|
14
|
+
import { useFormFields as ge } from "./inspect/inspect-api.js";
|
|
15
|
+
import { textMatcher as he } from "./nav/find.js";
|
|
16
|
+
import { useOverviewFields as xe } from "./overview/overview-api.js";
|
|
17
|
+
import { LibraryRows as ye } from "./reuse/LibraryRows.js";
|
|
18
|
+
import { slotName as O } from "./slot-names.js";
|
|
19
|
+
import { useFieldFillRates as ke, fillText as be } from "./usage/usage-api.js";
|
|
20
|
+
const we = [
|
|
15
21
|
"__pipeline__",
|
|
16
22
|
"__comments__",
|
|
17
23
|
"__tasks__",
|
|
@@ -21,7 +27,7 @@ const ue = [
|
|
|
21
27
|
"__owners__",
|
|
22
28
|
"__pdf__",
|
|
23
29
|
"__subtitle__"
|
|
24
|
-
],
|
|
30
|
+
], J = {
|
|
25
31
|
__pipeline__: "State track and actions",
|
|
26
32
|
__comments__: "Notes and replies",
|
|
27
33
|
__tasks__: "To-dos on this record",
|
|
@@ -31,19 +37,19 @@ const ue = [
|
|
|
31
37
|
__owners__: "Who owns it at each step",
|
|
32
38
|
__pdf__: "Generate and download a PDF",
|
|
33
39
|
__subtitle__: "A line of values under the title"
|
|
34
|
-
},
|
|
35
|
-
function
|
|
40
|
+
}, Ne = ["review_list", "rollup"];
|
|
41
|
+
function V(a) {
|
|
36
42
|
return {
|
|
37
|
-
widget_id:
|
|
38
|
-
input_bindings:
|
|
43
|
+
widget_id: a.id,
|
|
44
|
+
input_bindings: Ne.includes(a.widget_type) ? [{ key: "record_id", binding_type: "item_field", binding_value: "id" }] : []
|
|
39
45
|
};
|
|
40
46
|
}
|
|
41
|
-
function
|
|
42
|
-
const
|
|
43
|
-
if (
|
|
44
|
-
if (
|
|
45
|
-
if (
|
|
46
|
-
switch (
|
|
47
|
+
function ve(a) {
|
|
48
|
+
const n = a.interface ?? "";
|
|
49
|
+
if (n.includes("o2m") || n === "list-o2m" || n === "inline-grid") return "Grid";
|
|
50
|
+
if (n.includes("m2m") || n.includes("m2a")) return "Several records";
|
|
51
|
+
if (n.includes("m2o")) return "Record";
|
|
52
|
+
switch (a.type) {
|
|
47
53
|
case "string":
|
|
48
54
|
case "uuid":
|
|
49
55
|
return "Text";
|
|
@@ -66,129 +72,132 @@ function me(o) {
|
|
|
66
72
|
case "alias":
|
|
67
73
|
return "Group";
|
|
68
74
|
default:
|
|
69
|
-
return
|
|
75
|
+
return a.type ? $(a.type) : "";
|
|
70
76
|
}
|
|
71
77
|
}
|
|
72
|
-
const
|
|
73
|
-
function
|
|
74
|
-
return /* @__PURE__ */
|
|
75
|
-
/* @__PURE__ */
|
|
76
|
-
|
|
78
|
+
const Ce = "h-8 w-full rounded-md border border-slate-200 bg-white pl-7 pr-2.5 text-[12.5px] text-slate-800 outline-none placeholder:text-slate-400 focus:border-nvr-cyan dark:border-border dark:bg-background dark:text-foreground dark:placeholder:text-muted-foreground", N = "px-2 pb-1 pt-3 text-[11.5px] font-semibold text-slate-500 dark:text-muted-foreground";
|
|
79
|
+
function M({ children: a }) {
|
|
80
|
+
return /* @__PURE__ */ d("span", { className: "inline-flex shrink-0 items-center gap-0.5 text-[11px] font-medium text-[#0089ad] dark:text-nvr-cyan", children: [
|
|
81
|
+
/* @__PURE__ */ o(ne, { className: "h-3 w-3" }),
|
|
82
|
+
a
|
|
77
83
|
] });
|
|
78
84
|
}
|
|
79
|
-
function
|
|
80
|
-
title:
|
|
81
|
-
sub:
|
|
82
|
-
aside:
|
|
85
|
+
function y({
|
|
86
|
+
title: a,
|
|
87
|
+
sub: n,
|
|
88
|
+
aside: c,
|
|
83
89
|
onClick: u,
|
|
84
|
-
attrs:
|
|
85
|
-
extra:
|
|
86
|
-
drag:
|
|
90
|
+
attrs: l,
|
|
91
|
+
extra: g,
|
|
92
|
+
drag: _ = null
|
|
87
93
|
}) {
|
|
88
|
-
const
|
|
94
|
+
const p = fe(_), t = /* @__PURE__ */ d(
|
|
89
95
|
"button",
|
|
90
96
|
{
|
|
91
97
|
type: "button",
|
|
92
|
-
...
|
|
98
|
+
...p.props,
|
|
93
99
|
onClick: () => {
|
|
94
|
-
|
|
100
|
+
p.clickBlocked() || u();
|
|
95
101
|
},
|
|
96
|
-
...
|
|
97
|
-
className:
|
|
102
|
+
...l,
|
|
103
|
+
className: X(
|
|
98
104
|
"group flex w-full min-w-0 items-center gap-2 rounded-md px-2 py-1.5 text-left transition-colors hover:bg-muted",
|
|
99
|
-
|
|
105
|
+
p.dragging && "opacity-40"
|
|
100
106
|
),
|
|
101
107
|
children: [
|
|
102
|
-
/* @__PURE__ */
|
|
103
|
-
/* @__PURE__ */
|
|
104
|
-
|
|
108
|
+
/* @__PURE__ */ d("span", { className: "flex min-w-0 flex-1 flex-col", children: [
|
|
109
|
+
/* @__PURE__ */ o("span", { className: "truncate text-[12.5px] font-medium text-slate-900 dark:text-foreground", children: a }),
|
|
110
|
+
n && /* @__PURE__ */ o("span", { className: "truncate text-[11.5px] text-slate-500 dark:text-muted-foreground", children: n })
|
|
105
111
|
] }),
|
|
106
|
-
|
|
112
|
+
c
|
|
107
113
|
]
|
|
108
114
|
}
|
|
109
115
|
);
|
|
110
|
-
return
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
] }) :
|
|
116
|
+
return g ? /* @__PURE__ */ d("div", { className: "flex items-center gap-0.5", children: [
|
|
117
|
+
t,
|
|
118
|
+
g
|
|
119
|
+
] }) : t;
|
|
114
120
|
}
|
|
115
|
-
function
|
|
116
|
-
bundle:
|
|
117
|
-
collection:
|
|
118
|
-
selected:
|
|
121
|
+
function Ye({
|
|
122
|
+
bundle: a,
|
|
123
|
+
collection: n,
|
|
124
|
+
selected: c,
|
|
119
125
|
apply: u,
|
|
120
|
-
onSelect:
|
|
126
|
+
onSelect: l
|
|
121
127
|
}) {
|
|
122
|
-
const
|
|
128
|
+
const g = se(), [_, p] = W(""), [t, s] = W("form"), { data: h = [] } = xe(n), { data: D } = ke(n), { data: Z = [], error: T } = te({
|
|
123
129
|
queryKey: ["layout-editor", "widgets"],
|
|
124
|
-
queryFn: () =>
|
|
130
|
+
queryFn: () => g.request(le("/widgets-internal")).then((e) => e.data ?? []),
|
|
125
131
|
staleTime: 6e4,
|
|
126
132
|
retry: !1
|
|
127
|
-
}), [
|
|
133
|
+
}), [v, L] = W(null), f = he(_), P = Y(() => {
|
|
128
134
|
const e = /* @__PURE__ */ new Map();
|
|
129
|
-
for (const
|
|
135
|
+
for (const r of a.placements) e.set(r.field, [...e.get(r.field) ?? [], r]);
|
|
130
136
|
return e;
|
|
131
|
-
}, [
|
|
137
|
+
}, [a.placements]), C = (e) => (P.get(e) ?? []).find((r) => r.group_key !== R), E = (e) => (P.get(e) ?? []).find((r) => r.group_key === R), S = (e) => e.group_key === R ? { kind: "header", field: e.field } : {
|
|
132
138
|
kind: e.field.startsWith("__") ? "slot" : "field",
|
|
133
139
|
field: e.field,
|
|
134
140
|
group_key: e.group_key
|
|
135
|
-
},
|
|
136
|
-
const
|
|
137
|
-
u([
|
|
138
|
-
},
|
|
141
|
+
}, B = (e, r, i) => {
|
|
142
|
+
const m = t === "header" ? j(a, c, "header") : de({ field: e, group_key: null }) ? pe(a, c) : e === "__subtitle__" ? { group_key: null, index: 0 } : j(a, c);
|
|
143
|
+
u([z(e, m, i)], { label: `Add ${r}` }), l(S({ field: e, group_key: m.group_key }));
|
|
144
|
+
}, F = (e, r, i, m) => i ? null : {
|
|
139
145
|
field: e,
|
|
140
|
-
label:
|
|
141
|
-
patch:
|
|
142
|
-
to:
|
|
143
|
-
onAdded: (
|
|
144
|
-
const
|
|
145
|
-
(
|
|
146
|
+
label: r,
|
|
147
|
+
patch: m,
|
|
148
|
+
to: t,
|
|
149
|
+
onAdded: (w) => {
|
|
150
|
+
const x = w[0];
|
|
151
|
+
(x == null ? void 0 : x.op) === "place" && l(S({ field: e, group_key: x.group_key }));
|
|
146
152
|
}
|
|
147
|
-
},
|
|
148
|
-
|
|
149
|
-
const
|
|
150
|
-
|
|
151
|
-
},
|
|
152
|
-
var
|
|
153
|
-
const
|
|
154
|
-
if ((
|
|
155
|
-
const
|
|
156
|
-
|
|
153
|
+
}, A = (e, r, i) => {
|
|
154
|
+
L(null);
|
|
155
|
+
const m = t === "header" ? E(e) : C(e);
|
|
156
|
+
m ? l(S(m)) : B(e, r, i);
|
|
157
|
+
}, ee = (e, r) => {
|
|
158
|
+
var m;
|
|
159
|
+
const i = j(a, c);
|
|
160
|
+
if ((P.get(e) ?? []).some((w) => w.group_key === i.group_key)) {
|
|
161
|
+
const w = i.group_key === null ? "Ungrouped" : ((m = a.groups.find((x) => x.key === i.group_key)) == null ? void 0 : m.label) ?? i.group_key;
|
|
162
|
+
L({
|
|
157
163
|
field: e,
|
|
158
|
-
text: `${
|
|
164
|
+
text: `${r} is already in ${w}. Select another section first.`
|
|
159
165
|
});
|
|
160
166
|
return;
|
|
161
167
|
}
|
|
162
|
-
|
|
163
|
-
},
|
|
164
|
-
(
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
168
|
+
L(null), u([z(e, i)], { label: `Add another ${r}` }), l(S({ field: e, group_key: i.group_key }));
|
|
169
|
+
}, { data: G = [] } = ge(n), I = Y(
|
|
170
|
+
() => Se(a, G, h),
|
|
171
|
+
[a, G, h]
|
|
172
|
+
).filter((e) => f(e.title, e.field)).slice(0, 8), U = h.filter((e) => e.field && !e.field.startsWith("__")).map((e) => ({ ...e, title: e.label || $(e.field) })).filter((e) => f(e.title, e.field)).sort((e, r) => e.title.localeCompare(r.title)), q = [...we, ...ce().map((e) => `__ext_${e}__`)].filter(
|
|
173
|
+
(e) => t === "header" ? e === "__owners__" : !0
|
|
174
|
+
).filter((e) => f(O(e), J[e])), H = Z.filter((e) => f(e.name, e.widget_type)), k = ue(a, c), b = k.op === "group_create" ? k.label.replace(/^New /, "") : "";
|
|
175
|
+
return /* @__PURE__ */ d("div", { "data-editor-add": "", className: "flex flex-col px-2 pb-4", children: [
|
|
176
|
+
/* @__PURE__ */ d("div", { className: "sticky top-0 z-10 flex flex-col gap-2 bg-white px-1 pb-1 pt-2 dark:bg-card", children: [
|
|
177
|
+
/* @__PURE__ */ d("div", { className: "relative", children: [
|
|
178
|
+
/* @__PURE__ */ o(re, { className: "pointer-events-none absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-slate-400" }),
|
|
179
|
+
/* @__PURE__ */ o(
|
|
171
180
|
"input",
|
|
172
181
|
{
|
|
173
|
-
value:
|
|
174
|
-
onChange: (e) =>
|
|
182
|
+
value: _,
|
|
183
|
+
onChange: (e) => p(e.target.value),
|
|
175
184
|
placeholder: "Find a field, panel or widget",
|
|
176
185
|
"aria-label": "Find something to add",
|
|
177
|
-
className:
|
|
186
|
+
className: Ce
|
|
178
187
|
}
|
|
179
188
|
)
|
|
180
189
|
] }),
|
|
181
|
-
/* @__PURE__ */
|
|
182
|
-
/* @__PURE__ */
|
|
183
|
-
["form", "header"].map((e) => /* @__PURE__ */
|
|
190
|
+
/* @__PURE__ */ d("div", { className: "flex items-center gap-1 text-[12px] text-slate-500 dark:text-muted-foreground", children: [
|
|
191
|
+
/* @__PURE__ */ o("span", { className: "mr-1", children: "Add to" }),
|
|
192
|
+
["form", "header"].map((e) => /* @__PURE__ */ o(
|
|
184
193
|
"button",
|
|
185
194
|
{
|
|
186
195
|
type: "button",
|
|
187
|
-
"aria-pressed":
|
|
188
|
-
onClick: () =>
|
|
189
|
-
className:
|
|
196
|
+
"aria-pressed": t === e,
|
|
197
|
+
onClick: () => s(e),
|
|
198
|
+
className: X(
|
|
190
199
|
"rounded-md px-2 py-0.5 font-medium transition-colors",
|
|
191
|
-
|
|
200
|
+
t === e ? "bg-accent text-slate-900 dark:text-foreground" : "hover:bg-muted hover:text-slate-800 dark:hover:text-foreground"
|
|
192
201
|
),
|
|
193
202
|
children: e === "form" ? "Form" : "Header strip"
|
|
194
203
|
},
|
|
@@ -196,63 +205,106 @@ function Re({
|
|
|
196
205
|
))
|
|
197
206
|
] })
|
|
198
207
|
] }),
|
|
199
|
-
|
|
200
|
-
/* @__PURE__ */
|
|
201
|
-
/* @__PURE__ */
|
|
202
|
-
|
|
208
|
+
t === "form" && f(b, "section", "tab", "step") && /* @__PURE__ */ d(K, { children: [
|
|
209
|
+
/* @__PURE__ */ o("p", { className: N, children: "Layout" }),
|
|
210
|
+
/* @__PURE__ */ o(
|
|
211
|
+
y,
|
|
203
212
|
{
|
|
204
|
-
title:
|
|
205
|
-
sub: `A new ${
|
|
213
|
+
title: b.charAt(0).toUpperCase() + b.slice(1),
|
|
214
|
+
sub: `A new ${b.toLowerCase()} after the selection`,
|
|
206
215
|
attrs: { "data-add-section": "" },
|
|
207
|
-
aside: /* @__PURE__ */
|
|
216
|
+
aside: /* @__PURE__ */ o(oe, { className: "h-3.5 w-3.5 text-slate-400" }),
|
|
208
217
|
onClick: () => {
|
|
209
|
-
u([
|
|
218
|
+
u([k], { label: `Add ${b.toLowerCase()}` }), k.op === "group_create" && l({ kind: "group", key: k.key });
|
|
210
219
|
}
|
|
211
220
|
}
|
|
212
221
|
)
|
|
213
222
|
] }),
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
223
|
+
t === "form" && !["table", "file"].includes(String(a.layout.layout_type ?? "grouped")) && f("Display formula", "formula calculation remaining total") && /* @__PURE__ */ o(
|
|
224
|
+
y,
|
|
225
|
+
{
|
|
226
|
+
title: "Display formula",
|
|
227
|
+
sub: "A read-only figure worked out from fields on the form, never saved",
|
|
228
|
+
attrs: { "data-add-formula": "" },
|
|
229
|
+
aside: /* @__PURE__ */ o(ae, { className: "h-3.5 w-3.5 text-slate-400" }),
|
|
230
|
+
onClick: () => B(
|
|
231
|
+
me(a.placements.map((e) => e.field)),
|
|
232
|
+
"a display formula",
|
|
233
|
+
{
|
|
234
|
+
overrides: { label: "Formula", display_formula: { expr: "", format: "" } }
|
|
235
|
+
}
|
|
236
|
+
)
|
|
237
|
+
}
|
|
238
|
+
),
|
|
239
|
+
t === "form" && !_.trim() && /* @__PURE__ */ o(_e, { bundle: a, collection: n, apply: u }),
|
|
240
|
+
t === "form" && I.length > 0 && /* @__PURE__ */ d(K, { children: [
|
|
241
|
+
/* @__PURE__ */ o("p", { className: N, children: "On other forms" }),
|
|
242
|
+
I.map((e) => /* @__PURE__ */ o(
|
|
243
|
+
y,
|
|
244
|
+
{
|
|
245
|
+
title: e.title,
|
|
246
|
+
sub: `On ${e.count} of ${e.of} other forms · ${e.names.join(", ")}`,
|
|
247
|
+
attrs: { "data-add-suggested": e.field },
|
|
248
|
+
aside: /* @__PURE__ */ o(Q, { className: "h-3.5 w-3.5 shrink-0 text-slate-400 opacity-0 group-hover:opacity-100" }),
|
|
249
|
+
onClick: () => A(e.field, e.title),
|
|
250
|
+
drag: F(e.field, e.title, null)
|
|
251
|
+
},
|
|
252
|
+
e.field
|
|
253
|
+
))
|
|
254
|
+
] }),
|
|
255
|
+
t === "form" && /* @__PURE__ */ o(
|
|
256
|
+
ye,
|
|
257
|
+
{
|
|
258
|
+
bundle: a,
|
|
259
|
+
collection: n,
|
|
260
|
+
selected: c,
|
|
261
|
+
apply: u,
|
|
262
|
+
onSelect: l,
|
|
263
|
+
matches: f
|
|
264
|
+
}
|
|
265
|
+
),
|
|
266
|
+
/* @__PURE__ */ o("p", { className: N, children: "Fields" }),
|
|
267
|
+
U.map((e) => {
|
|
268
|
+
const r = t === "header" ? E(e.field) : C(e.field);
|
|
269
|
+
return /* @__PURE__ */ d("div", { children: [
|
|
270
|
+
/* @__PURE__ */ o(
|
|
271
|
+
y,
|
|
220
272
|
{
|
|
221
273
|
title: e.title,
|
|
222
|
-
sub: [e.field,
|
|
223
|
-
attrs: { "data-add-field": e.field, "data-on-form":
|
|
224
|
-
aside:
|
|
225
|
-
onClick: () =>
|
|
226
|
-
drag:
|
|
227
|
-
extra:
|
|
274
|
+
sub: [e.field, ve(e), D ? be(D.pct.get(e.field), D.total) : null].filter(Boolean).join(" · "),
|
|
275
|
+
attrs: { "data-add-field": e.field, "data-on-form": r ? "true" : void 0 },
|
|
276
|
+
aside: r ? /* @__PURE__ */ o(M, { children: t === "header" ? "in header" : "on this form" }) : /* @__PURE__ */ o(Q, { className: "h-3.5 w-3.5 shrink-0 text-slate-400 opacity-0 group-hover:opacity-100" }),
|
|
277
|
+
onClick: () => A(e.field, e.title),
|
|
278
|
+
drag: F(e.field, e.title, r),
|
|
279
|
+
extra: r && t === "form" ? /* @__PURE__ */ o(
|
|
228
280
|
"button",
|
|
229
281
|
{
|
|
230
282
|
type: "button",
|
|
231
283
|
"aria-label": `Add another copy of ${e.title}`,
|
|
232
284
|
"data-add-copy": e.field,
|
|
233
285
|
"data-tip": "Add another copy after the selection",
|
|
234
|
-
onClick: () =>
|
|
286
|
+
onClick: () => ee(e.field, e.title),
|
|
235
287
|
className: "inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-md text-slate-400 transition-colors hover:bg-muted hover:text-slate-700 dark:hover:text-foreground",
|
|
236
|
-
children: /* @__PURE__ */
|
|
288
|
+
children: /* @__PURE__ */ o(ie, { className: "h-3.5 w-3.5" })
|
|
237
289
|
}
|
|
238
290
|
) : null
|
|
239
291
|
}
|
|
240
292
|
),
|
|
241
|
-
(
|
|
293
|
+
(v == null ? void 0 : v.field) === e.field && /* @__PURE__ */ o(
|
|
242
294
|
"p",
|
|
243
295
|
{
|
|
244
296
|
role: "status",
|
|
245
297
|
"data-add-notice": "",
|
|
246
298
|
className: "px-2 pb-1 text-[11.5px] text-amber-700 dark:text-amber-300",
|
|
247
|
-
children:
|
|
299
|
+
children: v.text
|
|
248
300
|
}
|
|
249
301
|
)
|
|
250
302
|
] }, e.field);
|
|
251
303
|
}),
|
|
252
|
-
!
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
const
|
|
304
|
+
!U.length && /* @__PURE__ */ o("p", { className: "px-2 py-1.5 text-[12px] text-slate-500 dark:text-muted-foreground", children: "No fields match." }),
|
|
305
|
+
q.length > 0 && /* @__PURE__ */ o("p", { className: N, children: "Panels" }),
|
|
306
|
+
q.map((e) => {
|
|
307
|
+
const r = t === "header" ? E(e) : C(e), i = e === "__subtitle__" ? {
|
|
256
308
|
input_bindings: [
|
|
257
309
|
{
|
|
258
310
|
key: "__subtitle_config__",
|
|
@@ -261,41 +313,64 @@ function Re({
|
|
|
261
313
|
}
|
|
262
314
|
]
|
|
263
315
|
} : void 0;
|
|
264
|
-
return /* @__PURE__ */
|
|
265
|
-
|
|
316
|
+
return /* @__PURE__ */ o(
|
|
317
|
+
y,
|
|
266
318
|
{
|
|
267
|
-
title:
|
|
268
|
-
sub:
|
|
269
|
-
attrs: { "data-add-slot": e, "data-on-form":
|
|
270
|
-
aside:
|
|
271
|
-
onClick: () =>
|
|
272
|
-
drag: e === "__subtitle__" ? null :
|
|
319
|
+
title: O(e),
|
|
320
|
+
sub: J[e] ?? "Extension panel",
|
|
321
|
+
attrs: { "data-add-slot": e, "data-on-form": r ? "true" : void 0 },
|
|
322
|
+
aside: r ? /* @__PURE__ */ o(M, { children: "on this form" }) : null,
|
|
323
|
+
onClick: () => A(e, O(e), i),
|
|
324
|
+
drag: e === "__subtitle__" ? null : F(e, O(e), r)
|
|
273
325
|
},
|
|
274
326
|
e
|
|
275
327
|
);
|
|
276
328
|
}),
|
|
277
|
-
|
|
278
|
-
|
|
329
|
+
t === "form" && (H.length > 0 || T) && /* @__PURE__ */ o("p", { className: N, children: "Widgets" }),
|
|
330
|
+
t === "form" && T && /* @__PURE__ */ d("p", { role: "alert", className: "px-2 py-1.5 text-[12px] text-red-700 dark:text-red-300", children: [
|
|
279
331
|
"Widgets could not be loaded: ",
|
|
280
|
-
|
|
332
|
+
T.message
|
|
281
333
|
] }),
|
|
282
|
-
|
|
283
|
-
const
|
|
284
|
-
return /* @__PURE__ */
|
|
285
|
-
|
|
334
|
+
t === "form" && H.map((e) => {
|
|
335
|
+
const r = `__widget_${e.id}__`, i = C(r);
|
|
336
|
+
return /* @__PURE__ */ o(
|
|
337
|
+
y,
|
|
286
338
|
{
|
|
287
339
|
title: e.name,
|
|
288
|
-
sub:
|
|
289
|
-
attrs: { "data-add-widget": String(e.id), "data-on-form":
|
|
290
|
-
aside:
|
|
291
|
-
onClick: () =>
|
|
292
|
-
drag:
|
|
340
|
+
sub: $(e.widget_type),
|
|
341
|
+
attrs: { "data-add-widget": String(e.id), "data-on-form": i ? "true" : void 0 },
|
|
342
|
+
aside: i ? /* @__PURE__ */ o(M, { children: "on this form" }) : null,
|
|
343
|
+
onClick: () => A(r, e.name, V(e)),
|
|
344
|
+
drag: F(r, e.name, i, V(e))
|
|
293
345
|
},
|
|
294
346
|
e.id
|
|
295
347
|
);
|
|
296
348
|
})
|
|
297
349
|
] });
|
|
298
350
|
}
|
|
351
|
+
function Se(a, n, c) {
|
|
352
|
+
const u = String(a.layout.layout_type || "grouped"), l = n.filter(
|
|
353
|
+
(t) => Number(t.layout_id) !== Number(a.layout.id) && t.layout_type === u
|
|
354
|
+
);
|
|
355
|
+
if (!l.length) return [];
|
|
356
|
+
const g = new Set(
|
|
357
|
+
a.placements.filter((t) => t.group_key !== R).map((t) => t.field)
|
|
358
|
+
), _ = new Map(c.map((t) => [t.field, t])), p = /* @__PURE__ */ new Map();
|
|
359
|
+
for (const t of l)
|
|
360
|
+
for (const s of t.fields)
|
|
361
|
+
!g.has(s) && _.has(s) && p.set(s, [...p.get(s) ?? [], t.name]);
|
|
362
|
+
return [...p.entries()].map(([t, s]) => {
|
|
363
|
+
var h;
|
|
364
|
+
return {
|
|
365
|
+
field: t,
|
|
366
|
+
title: ((h = _.get(t)) == null ? void 0 : h.label) || $(t),
|
|
367
|
+
count: s.length,
|
|
368
|
+
of: l.length,
|
|
369
|
+
names: s.slice(0, 3).concat(s.length > 3 ? [`${s.length - 3} more`] : [])
|
|
370
|
+
};
|
|
371
|
+
}).sort((t, s) => s.count - t.count || t.title.localeCompare(s.title));
|
|
372
|
+
}
|
|
299
373
|
export {
|
|
300
|
-
|
|
374
|
+
Ye as AddPanel,
|
|
375
|
+
Se as otherFormSuggestions
|
|
301
376
|
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { jsxs as e, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { Shuffle as a } from "lucide-react";
|
|
3
|
+
import { cn as u } from "../../lib/utils.js";
|
|
4
|
+
import { barBtn as c } from "./toolbar-kit.js";
|
|
5
|
+
const i = "nvr-layout-structure-menu";
|
|
6
|
+
function s(t, r) {
|
|
7
|
+
t.dispatchEvent(new CustomEvent(i, { bubbles: !0, detail: { targets: r } }));
|
|
8
|
+
}
|
|
9
|
+
const p = () => typeof navigator < "u" && /Mac|iP(hone|ad)/.test(navigator.platform), l = () => p() ? "⌘D" : "Ctrl+D";
|
|
10
|
+
function b({
|
|
11
|
+
targets: t,
|
|
12
|
+
className: r
|
|
13
|
+
}) {
|
|
14
|
+
return /* @__PURE__ */ e(
|
|
15
|
+
"button",
|
|
16
|
+
{
|
|
17
|
+
type: "button",
|
|
18
|
+
"data-structure-open": "",
|
|
19
|
+
onClick: (n) => s(n.currentTarget, t),
|
|
20
|
+
"data-tip": `Duplicate (${l()}), wrap, unwrap, convert, copy rules, pin — or right-click it on the form`,
|
|
21
|
+
className: u(c, r),
|
|
22
|
+
children: [
|
|
23
|
+
/* @__PURE__ */ o(a, { className: "h-3.5 w-3.5 shrink-0" }),
|
|
24
|
+
"Arrange…"
|
|
25
|
+
]
|
|
26
|
+
}
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
export {
|
|
30
|
+
b as ArrangeButton,
|
|
31
|
+
i as STRUCTURE_MENU_EVENT,
|
|
32
|
+
l as duplicateKeys,
|
|
33
|
+
s as openStructureMenu
|
|
34
|
+
};
|