@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,71 @@
|
|
|
1
|
+
import { sanitizeEntryConfig as a, ENTRY_PRESETS_MAX as p, PRESET_PARTS as h } from "../../../lib/entry-config.js";
|
|
2
|
+
import { readOverrides as l, withKey as _ } from "../inspector/model.js";
|
|
3
|
+
const k = {
|
|
4
|
+
width: "Width",
|
|
5
|
+
required: "Required",
|
|
6
|
+
help: "Help text",
|
|
7
|
+
placeholder: "Placeholder",
|
|
8
|
+
input: "Input and format",
|
|
9
|
+
lock: "Lock rule"
|
|
10
|
+
}, d = {
|
|
11
|
+
width: [],
|
|
12
|
+
required: ["required"],
|
|
13
|
+
help: ["note"],
|
|
14
|
+
placeholder: ["placeholder"],
|
|
15
|
+
input: ["interface", "options"],
|
|
16
|
+
lock: []
|
|
17
|
+
};
|
|
18
|
+
function y(n) {
|
|
19
|
+
const e = l(n);
|
|
20
|
+
return h.filter((t) => t === "width" ? n.col_span != null : t === "lock" ? !!n.lock_conditions : d[t].some((o) => e[o] !== void 0));
|
|
21
|
+
}
|
|
22
|
+
const g = () => `p${Date.now().toString(36)}${Math.random().toString(36).slice(2, 6)}`;
|
|
23
|
+
function P(n, e, t) {
|
|
24
|
+
const o = l(e), c = {};
|
|
25
|
+
for (const s of t) for (const i of d[s]) o[i] !== void 0 && (c[i] = o[i]);
|
|
26
|
+
const r = { id: g(), name: n.trim(), parts: [...t] };
|
|
27
|
+
return t.includes("width") && (r.col_span = e.col_span ?? null), Object.keys(c).length && (r.overrides = c), t.includes("lock") && (r.lock_conditions = e.lock_conditions ?? null), r;
|
|
28
|
+
}
|
|
29
|
+
function m(n, e) {
|
|
30
|
+
var r;
|
|
31
|
+
const t = {};
|
|
32
|
+
let o = l(e), c = !1;
|
|
33
|
+
for (const s of n.parts)
|
|
34
|
+
if (s === "width") {
|
|
35
|
+
const i = n.col_span ?? null;
|
|
36
|
+
(e.col_span ?? null) !== i && (t.col_span = i);
|
|
37
|
+
} else if (s === "lock") {
|
|
38
|
+
const i = n.lock_conditions ?? null;
|
|
39
|
+
(e.lock_conditions ?? null) !== i && (t.lock_conditions = i);
|
|
40
|
+
} else
|
|
41
|
+
for (const i of d[s]) {
|
|
42
|
+
const u = (r = n.overrides) == null ? void 0 : r[i], f = o == null ? void 0 : o[i];
|
|
43
|
+
JSON.stringify(u) !== JSON.stringify(f) && (o = _(o ?? {}, i, u), c = !0);
|
|
44
|
+
}
|
|
45
|
+
return c && (t.overrides = o), Object.keys(t).length ? t : null;
|
|
46
|
+
}
|
|
47
|
+
function E(n, e) {
|
|
48
|
+
const t = [];
|
|
49
|
+
for (const o of e) {
|
|
50
|
+
const c = m(n, o);
|
|
51
|
+
c && t.push({
|
|
52
|
+
op: "update_placement",
|
|
53
|
+
at: { field: o.field, group_key: o.group_key },
|
|
54
|
+
patch: c
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
return { ops: t, changed: t.length };
|
|
58
|
+
}
|
|
59
|
+
function R(n, e) {
|
|
60
|
+
return a({ ...n, presets: e.slice(0, p) });
|
|
61
|
+
}
|
|
62
|
+
const O = (n) => n.parts.length ? n.parts.map((e) => k[e]).join(", ") : "Nothing set";
|
|
63
|
+
export {
|
|
64
|
+
k as PART_LABEL,
|
|
65
|
+
P as capturePreset,
|
|
66
|
+
y as partsSet,
|
|
67
|
+
E as presetOps,
|
|
68
|
+
m as presetPatch,
|
|
69
|
+
O as presetSummary,
|
|
70
|
+
R as withPresets
|
|
71
|
+
};
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { jsx as l, jsxs as s } from "react/jsx-runtime";
|
|
2
|
+
import { Undo2 as N, X as C, Check as O } from "lucide-react";
|
|
3
|
+
import { useState as m, useCallback as d, useMemo as T } from "react";
|
|
4
|
+
import { entryConfigOf as j, sanitizeEntryConfig as _ } from "../../../lib/entry-config.js";
|
|
5
|
+
import { cn as f } from "../../../lib/utils.js";
|
|
6
|
+
function z(e, t) {
|
|
7
|
+
return e.includes(t) ? e.filter((r) => r !== t) : [...e, t];
|
|
8
|
+
}
|
|
9
|
+
function E(e, t) {
|
|
10
|
+
const r = j(e.layout);
|
|
11
|
+
return [{ op: "layout_update", patch: { entry_config: _({ ...r, tab_order: t.length ? t : void 0 }) } }];
|
|
12
|
+
}
|
|
13
|
+
function A(e, t) {
|
|
14
|
+
const [r, c] = m(!1), [i, u] = m([]), p = d(() => {
|
|
15
|
+
u([]), c(!0);
|
|
16
|
+
}, []), h = d(() => c(!1), []), x = d(() => {
|
|
17
|
+
c(!1), e && i.length > 0 && t(E(e, i), { label: "Set the tab order" });
|
|
18
|
+
}, [e, i, t]), g = d(() => u((a) => a.slice(0, -1)), []), k = d(
|
|
19
|
+
(a) => (n, o) => {
|
|
20
|
+
if (r && (n.kind === "field" || n.kind === "header")) {
|
|
21
|
+
const v = n.field;
|
|
22
|
+
u((w) => z(w, v));
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
a(n, o);
|
|
26
|
+
},
|
|
27
|
+
[r]
|
|
28
|
+
), b = T(() => new Map(i.map((a, n) => [a, n + 1])), [i]), y = d(
|
|
29
|
+
(a) => r ? (n) => {
|
|
30
|
+
if (n.kind !== "field" && n.kind !== "header") return (a == null ? void 0 : a(n)) ?? null;
|
|
31
|
+
const o = b.get(n.field);
|
|
32
|
+
return {
|
|
33
|
+
// Outlines, like the design shell's own: they sit outside the field (offset)
|
|
34
|
+
// instead of hugging its label, and a dashed one reads as "not yet".
|
|
35
|
+
className: f(
|
|
36
|
+
"cursor-pointer",
|
|
37
|
+
o ? "bg-nvr-cyan/[0.06] outline outline-2 outline-nvr-cyan" : "outline-dashed outline-1 outline-slate-300 dark:outline-slate-600"
|
|
38
|
+
),
|
|
39
|
+
chip: (
|
|
40
|
+
// An empty dashed ring on a field not numbered yet: a "Click" word on every
|
|
41
|
+
// field shouted over the form and collided with its other tags.
|
|
42
|
+
/* @__PURE__ */ l(
|
|
43
|
+
"span",
|
|
44
|
+
{
|
|
45
|
+
"data-tab-order-chip": o ?? "",
|
|
46
|
+
role: "img",
|
|
47
|
+
"data-tip": o ? "Click to take it out" : "Click to number it",
|
|
48
|
+
"aria-label": o ? `Tab stop ${o}` : "Not in the tab order yet",
|
|
49
|
+
className: f(
|
|
50
|
+
"inline-flex h-5 min-w-5 items-center justify-center rounded-full text-[11px] font-semibold tabular-nums",
|
|
51
|
+
o ? "bg-nvr-cyan px-1.5 text-white" : "border border-dashed border-slate-400 bg-white dark:border-slate-500 dark:bg-card"
|
|
52
|
+
),
|
|
53
|
+
children: o ?? null
|
|
54
|
+
}
|
|
55
|
+
)
|
|
56
|
+
)
|
|
57
|
+
};
|
|
58
|
+
} : a,
|
|
59
|
+
[r, b]
|
|
60
|
+
);
|
|
61
|
+
return { active: r, order: i, start: p, cancel: h, done: x, undoLast: g, intercept: k, overlay: y };
|
|
62
|
+
}
|
|
63
|
+
function B({ editor: e }) {
|
|
64
|
+
if (!e.active) return null;
|
|
65
|
+
const t = e.order.length, r = "inline-flex h-7 items-center gap-1 rounded-md border border-slate-200 bg-white px-2 text-[12px] font-medium text-slate-700 hover:bg-slate-50 disabled:opacity-40 dark:border-border dark:bg-card dark:text-foreground dark:hover:bg-muted";
|
|
66
|
+
return /* @__PURE__ */ s(
|
|
67
|
+
"div",
|
|
68
|
+
{
|
|
69
|
+
role: "status",
|
|
70
|
+
"data-tab-order-bar": "",
|
|
71
|
+
className: "sticky top-0 z-30 flex flex-wrap items-center gap-2 border-b border-nvr-cyan/40 bg-white px-4 py-2 text-[12.5px] text-slate-700 dark:bg-card dark:text-foreground",
|
|
72
|
+
children: [
|
|
73
|
+
/* @__PURE__ */ s("p", { className: "m-0 min-w-0 flex-1", children: [
|
|
74
|
+
/* @__PURE__ */ l("span", { className: "font-medium", children: "Tab order." }),
|
|
75
|
+
" Click fields in the order Tab should visit them.",
|
|
76
|
+
" ",
|
|
77
|
+
/* @__PURE__ */ l("span", { className: "text-slate-500 dark:text-muted-foreground", children: t === 0 ? "Fields you skip follow in page order." : `${t} numbered; click a number again to take it out.` })
|
|
78
|
+
] }),
|
|
79
|
+
/* @__PURE__ */ s("button", { type: "button", className: r, disabled: t === 0, onClick: e.undoLast, children: [
|
|
80
|
+
/* @__PURE__ */ l(N, { className: "h-3.5 w-3.5" }),
|
|
81
|
+
"Undo last"
|
|
82
|
+
] }),
|
|
83
|
+
/* @__PURE__ */ s("button", { type: "button", className: r, onClick: e.cancel, children: [
|
|
84
|
+
/* @__PURE__ */ l(C, { className: "h-3.5 w-3.5" }),
|
|
85
|
+
"Cancel"
|
|
86
|
+
] }),
|
|
87
|
+
/* @__PURE__ */ s(
|
|
88
|
+
"button",
|
|
89
|
+
{
|
|
90
|
+
type: "button",
|
|
91
|
+
"data-tab-order-done": "",
|
|
92
|
+
disabled: t === 0,
|
|
93
|
+
onClick: e.done,
|
|
94
|
+
className: "inline-flex h-7 items-center gap-1 rounded-md bg-nvr-cyan px-2.5 text-[12px] font-medium text-white hover:bg-nvr-cyan/90 disabled:opacity-40",
|
|
95
|
+
children: [
|
|
96
|
+
/* @__PURE__ */ l(O, { className: "h-3.5 w-3.5" }),
|
|
97
|
+
"Done"
|
|
98
|
+
]
|
|
99
|
+
}
|
|
100
|
+
)
|
|
101
|
+
]
|
|
102
|
+
}
|
|
103
|
+
);
|
|
104
|
+
}
|
|
105
|
+
export {
|
|
106
|
+
B as TabOrderBar,
|
|
107
|
+
E as tabOrderOps,
|
|
108
|
+
z as toggleInOrder,
|
|
109
|
+
A as useTabOrderEditor
|
|
110
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { Sun as s, Moon as i } from "lucide-react";
|
|
3
|
+
import { useState as c, useEffect as d } from "react";
|
|
4
|
+
import { ToolButton as m } from "../toolbar-kit.js";
|
|
5
|
+
const a = () => typeof document < "u" && document.documentElement.classList.contains("dark");
|
|
6
|
+
function f() {
|
|
7
|
+
const [e, r] = c(a);
|
|
8
|
+
return d(() => {
|
|
9
|
+
const t = new MutationObserver(() => r(a()));
|
|
10
|
+
return t.observe(document.documentElement, { attributes: !0, attributeFilter: ["class"] }), () => t.disconnect();
|
|
11
|
+
}, []), e;
|
|
12
|
+
}
|
|
13
|
+
const k = (e, r) => e && !r ? "dark" : "";
|
|
14
|
+
function w({
|
|
15
|
+
on: e,
|
|
16
|
+
onChange: r,
|
|
17
|
+
appDark: t,
|
|
18
|
+
disabled: n
|
|
19
|
+
}) {
|
|
20
|
+
return /* @__PURE__ */ o(
|
|
21
|
+
m,
|
|
22
|
+
{
|
|
23
|
+
label: "Preview in dark",
|
|
24
|
+
icon: e ? /* @__PURE__ */ o(s, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ o(i, { className: "h-3.5 w-3.5" }),
|
|
25
|
+
hint: t ? "The app is already dark. Switch the app to light to preview the form in dark." : "Show the canvas in the dark theme; the app stays as it is",
|
|
26
|
+
checked: e && !t,
|
|
27
|
+
disabled: n || t,
|
|
28
|
+
onClick: () => r(!e),
|
|
29
|
+
data: { "data-editor-theme-preview": "" }
|
|
30
|
+
}
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
export {
|
|
34
|
+
w as ThemePreviewTool,
|
|
35
|
+
k as previewThemeClass,
|
|
36
|
+
f as useAppIsDark
|
|
37
|
+
};
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { jsxs as u, jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import { GitBranch as b, AlertTriangle as w } from "lucide-react";
|
|
3
|
+
import { useState as p, useCallback as x } from "react";
|
|
4
|
+
import { cn as m } from "../../../lib/utils.js";
|
|
5
|
+
import { amberStrip as k } from "../panel-style.js";
|
|
6
|
+
import { loopSentence as g } from "./field-sources.js";
|
|
7
|
+
const y = {
|
|
8
|
+
required: "amber",
|
|
9
|
+
readonly: "slate",
|
|
10
|
+
hidden: "slate",
|
|
11
|
+
filled: "violet"
|
|
12
|
+
}, h = "nvr:layout-editor:rules-view";
|
|
13
|
+
function z() {
|
|
14
|
+
const [e, n] = p(() => {
|
|
15
|
+
try {
|
|
16
|
+
return window.localStorage.getItem(h) !== "off";
|
|
17
|
+
} catch {
|
|
18
|
+
return !0;
|
|
19
|
+
}
|
|
20
|
+
}), r = x((a) => {
|
|
21
|
+
n(a);
|
|
22
|
+
try {
|
|
23
|
+
window.localStorage.setItem(h, a ? "on" : "off");
|
|
24
|
+
} catch {
|
|
25
|
+
}
|
|
26
|
+
}, []);
|
|
27
|
+
return [e, r];
|
|
28
|
+
}
|
|
29
|
+
function j({ on: e, onChange: n }) {
|
|
30
|
+
return /* @__PURE__ */ u(
|
|
31
|
+
"button",
|
|
32
|
+
{
|
|
33
|
+
type: "button",
|
|
34
|
+
"aria-pressed": e,
|
|
35
|
+
"aria-label": "Rules",
|
|
36
|
+
"data-rules-view": e ? "on" : "off",
|
|
37
|
+
"data-tip": e ? "Hide the rule tags and default values on the canvas" : "Show why fields are required, read-only or hidden, section rules and default values",
|
|
38
|
+
onClick: () => n(!e),
|
|
39
|
+
className: m(
|
|
40
|
+
"inline-flex h-8 items-center gap-1 rounded-md px-2 text-[12px] font-medium transition-colors",
|
|
41
|
+
e ? "bg-accent text-slate-900 dark:text-foreground" : "text-slate-500 hover:bg-muted hover:text-slate-800 dark:text-muted-foreground dark:hover:text-foreground"
|
|
42
|
+
),
|
|
43
|
+
children: [
|
|
44
|
+
/* @__PURE__ */ l(b, { className: "h-3.5 w-3.5" }),
|
|
45
|
+
/* @__PURE__ */ l("span", { "data-tb-wide": "", children: "Rules" })
|
|
46
|
+
]
|
|
47
|
+
}
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
function E(e, n) {
|
|
51
|
+
var i;
|
|
52
|
+
const r = /* @__PURE__ */ new Map();
|
|
53
|
+
for (const o of e.loops) {
|
|
54
|
+
const t = g(o, e.describe, e.groupLabel);
|
|
55
|
+
for (const d of o.fields) r.set(d, [...r.get(d) ?? [], t]);
|
|
56
|
+
}
|
|
57
|
+
if (r.size > 0 || (((i = n.ghostTags) == null ? void 0 : i.size) ?? 0) > 0 || n.chips && (e.fieldChips.size > 0 || e.groupChips.size > 0))
|
|
58
|
+
return (o) => {
|
|
59
|
+
var f;
|
|
60
|
+
const t = [];
|
|
61
|
+
if (o.kind === "group") {
|
|
62
|
+
if (n.chips)
|
|
63
|
+
for (const s of e.groupChips.get(o.key) ?? [])
|
|
64
|
+
t.push({ text: s.text, tone: "slate", tip: s.tip, onClick: () => n.open(s.open, o) });
|
|
65
|
+
return t;
|
|
66
|
+
}
|
|
67
|
+
if (o.kind !== "field" && o.kind !== "header") return t;
|
|
68
|
+
const d = r.get(o.field);
|
|
69
|
+
if (d && t.push({
|
|
70
|
+
text: "Rule loop",
|
|
71
|
+
tone: "amber",
|
|
72
|
+
tip: d.join(" · "),
|
|
73
|
+
highlight: !0,
|
|
74
|
+
kind: "loop"
|
|
75
|
+
}), n.chips)
|
|
76
|
+
for (const s of e.fieldChips.get(o.field) ?? [])
|
|
77
|
+
t.push({
|
|
78
|
+
text: s.text,
|
|
79
|
+
tone: y[s.state],
|
|
80
|
+
tip: s.tip,
|
|
81
|
+
onClick: () => n.open(s.open, o)
|
|
82
|
+
});
|
|
83
|
+
const c = (f = n.ghostTags) == null ? void 0 : f.get(o.field);
|
|
84
|
+
return c && t.push({ text: c, tone: "slate", tip: "What a new record starts with" }), t;
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
function L({
|
|
88
|
+
explain: e,
|
|
89
|
+
onShow: n
|
|
90
|
+
}) {
|
|
91
|
+
const [r, a] = p(!1);
|
|
92
|
+
if (e.loops.length === 0) return null;
|
|
93
|
+
const i = e.loops.map((t) => ({
|
|
94
|
+
field: t.fields[0],
|
|
95
|
+
text: g(t, e.describe, e.groupLabel)
|
|
96
|
+
})), o = r ? i : i.slice(0, 1);
|
|
97
|
+
return /* @__PURE__ */ u(
|
|
98
|
+
"div",
|
|
99
|
+
{
|
|
100
|
+
role: "note",
|
|
101
|
+
"data-rule-loops": "",
|
|
102
|
+
className: m(
|
|
103
|
+
"flex shrink-0 items-start gap-2 border-b px-4 py-1.5 text-[12.5px]",
|
|
104
|
+
k
|
|
105
|
+
),
|
|
106
|
+
children: [
|
|
107
|
+
/* @__PURE__ */ l(w, { className: "mt-0.5 h-3.5 w-3.5 shrink-0" }),
|
|
108
|
+
/* @__PURE__ */ l("ul", { className: "m-0 min-w-0 flex-1 list-none space-y-0.5 p-0", children: o.map((t) => /* @__PURE__ */ u("li", { className: "flex min-w-0 items-baseline gap-2", children: [
|
|
109
|
+
/* @__PURE__ */ u("span", { className: "min-w-0", children: [
|
|
110
|
+
"Rule loop: ",
|
|
111
|
+
t.text,
|
|
112
|
+
"."
|
|
113
|
+
] }),
|
|
114
|
+
/* @__PURE__ */ l(
|
|
115
|
+
"button",
|
|
116
|
+
{
|
|
117
|
+
type: "button",
|
|
118
|
+
onClick: () => n(t.field),
|
|
119
|
+
className: "shrink-0 font-medium underline underline-offset-2 hover:no-underline",
|
|
120
|
+
children: "Show"
|
|
121
|
+
}
|
|
122
|
+
)
|
|
123
|
+
] }, t.text)) }),
|
|
124
|
+
i.length > 1 && /* @__PURE__ */ l(
|
|
125
|
+
"button",
|
|
126
|
+
{
|
|
127
|
+
type: "button",
|
|
128
|
+
onClick: () => a(!r),
|
|
129
|
+
className: "shrink-0 font-medium underline underline-offset-2 hover:no-underline",
|
|
130
|
+
children: r ? "Fewer" : `${i.length - 1} more`
|
|
131
|
+
}
|
|
132
|
+
)
|
|
133
|
+
]
|
|
134
|
+
}
|
|
135
|
+
);
|
|
136
|
+
}
|
|
137
|
+
export {
|
|
138
|
+
L as RuleLoopsBanner,
|
|
139
|
+
j as RulesToggle,
|
|
140
|
+
E as explainMarks,
|
|
141
|
+
z as useRulesView
|
|
142
|
+
};
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { fieldLabel as u } from "./field-sources.js";
|
|
2
|
+
import { asObj as i } from "./rule-graph.js";
|
|
3
|
+
function d(s) {
|
|
4
|
+
const t = {};
|
|
5
|
+
for (const [f, e] of Object.entries(i(s))) e !== void 0 && (t[f] = e);
|
|
6
|
+
return t;
|
|
7
|
+
}
|
|
8
|
+
function g(s, t) {
|
|
9
|
+
const f = [];
|
|
10
|
+
for (const [e, n] of Object.entries(s)) {
|
|
11
|
+
if (n == null || n === "") continue;
|
|
12
|
+
const o = t.filter(
|
|
13
|
+
(r) => r.trigger_field === e && (r.is_active === !0 || r.is_active === 1 || r.is_active == null)
|
|
14
|
+
).map((r) => r.target_field);
|
|
15
|
+
o.length > 0 && f.push({ field: e, value: n, targets: [...new Set(o)] });
|
|
16
|
+
}
|
|
17
|
+
return f;
|
|
18
|
+
}
|
|
19
|
+
function m(s) {
|
|
20
|
+
const t = [];
|
|
21
|
+
for (const f of s) {
|
|
22
|
+
const e = i(f.cross_record_defaults), n = typeof e.source_collection == "string" ? e.source_collection : "", o = i(e.field_map);
|
|
23
|
+
if (!n || Object.keys(o).length === 0) continue;
|
|
24
|
+
const r = typeof e.source_fk_field == "string" && e.source_fk_field ? e.source_fk_field : f.field;
|
|
25
|
+
t.push({
|
|
26
|
+
field: f.field,
|
|
27
|
+
source_collection: n,
|
|
28
|
+
fk: r,
|
|
29
|
+
field_map: Object.fromEntries(Object.entries(o).map(([c, l]) => [c, String(l)]))
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
return t;
|
|
33
|
+
}
|
|
34
|
+
function b(s, t) {
|
|
35
|
+
const f = {};
|
|
36
|
+
for (const [e, n] of Object.entries(s.field_map))
|
|
37
|
+
for (const o of n.split("||").map((r) => r.trim())) {
|
|
38
|
+
const r = t[o];
|
|
39
|
+
if (!(r == null || r === "" || typeof r == "object")) {
|
|
40
|
+
f[e] = r;
|
|
41
|
+
break;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
return f;
|
|
45
|
+
}
|
|
46
|
+
function j(s, t, f) {
|
|
47
|
+
const e = /* @__PURE__ */ new Map();
|
|
48
|
+
for (const [n, o] of Object.entries(s)) e.set(n, { value: o, via: "layout" });
|
|
49
|
+
for (const n of t)
|
|
50
|
+
for (const [o, r] of Object.entries(n))
|
|
51
|
+
r == null || r === "" ? e.delete(o) : e.set(o, { value: r, via: "rule" });
|
|
52
|
+
for (const n of f)
|
|
53
|
+
for (const [o, r] of Object.entries(n.values))
|
|
54
|
+
e.set(o, { value: r, via: "cross", from: n.from });
|
|
55
|
+
return e;
|
|
56
|
+
}
|
|
57
|
+
function a(s, t, f, e) {
|
|
58
|
+
var o;
|
|
59
|
+
if (t == null || t === "") return null;
|
|
60
|
+
if (Array.isArray(t)) return t.length === 0 ? null : `${t.length} linked`;
|
|
61
|
+
if (typeof t == "boolean" || f === "boolean") {
|
|
62
|
+
if (t === !0 || t === "true" || t === 1 || t === "1") return "Yes";
|
|
63
|
+
if (t === !1 || t === "false" || t === 0 || t === "0") return "No";
|
|
64
|
+
}
|
|
65
|
+
if (typeof t == "object") return null;
|
|
66
|
+
const n = String(t);
|
|
67
|
+
return ((o = e[s]) == null ? void 0 : o[n]) ?? n;
|
|
68
|
+
}
|
|
69
|
+
function y(s, t, f, e, n) {
|
|
70
|
+
const o = a(s, t.value, n, e);
|
|
71
|
+
return o == null ? null : t.via === "rule" ? `By rule: ${o}` : t.via === "cross" ? `From ${u(t.from ?? "", f)}: ${o}` : `Default: ${o}`;
|
|
72
|
+
}
|
|
73
|
+
export {
|
|
74
|
+
m as crossConfigs,
|
|
75
|
+
b as crossValues,
|
|
76
|
+
y as ghostText,
|
|
77
|
+
a as ghostValueText,
|
|
78
|
+
d as layoutDefaults,
|
|
79
|
+
j as mergeGhosts,
|
|
80
|
+
g as ruleTriggers
|
|
81
|
+
};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { useRef as b, useEffect as A } from "react";
|
|
2
|
+
import { dependentsOf as k } from "./rule-graph.js";
|
|
3
|
+
function E(t) {
|
|
4
|
+
const r = /^(?:field|header):([^:]+)/.exec(t);
|
|
5
|
+
return r ? r[1] : null;
|
|
6
|
+
}
|
|
7
|
+
const c = (t) => `"${t.replace(/["\\]/g, "\\$&")}"`;
|
|
8
|
+
function O(t) {
|
|
9
|
+
if (t.target.kind === "group")
|
|
10
|
+
return [`[data-design-target=${c(`group:${t.target.key}`)}]`];
|
|
11
|
+
const r = t.target.field;
|
|
12
|
+
return [
|
|
13
|
+
`[data-design-target^=${c(`field:${r}:`)}]`,
|
|
14
|
+
`[data-design-target=${c(`header:${r}`)}]`
|
|
15
|
+
];
|
|
16
|
+
}
|
|
17
|
+
const w = {
|
|
18
|
+
visibility: "shows",
|
|
19
|
+
skip: "skips",
|
|
20
|
+
cascade: "filters",
|
|
21
|
+
field_rule: "fills",
|
|
22
|
+
parent_cascade: "fills lines",
|
|
23
|
+
row_rule: "row rules"
|
|
24
|
+
};
|
|
25
|
+
function _(t) {
|
|
26
|
+
const r = b(null), f = b(t);
|
|
27
|
+
return f.current = t, A(() => {
|
|
28
|
+
const n = r.current;
|
|
29
|
+
if (!n) return;
|
|
30
|
+
let l = null;
|
|
31
|
+
const i = [], a = () => {
|
|
32
|
+
for (const o of i)
|
|
33
|
+
o.removeAttribute("data-rule-dependent"), o.removeAttribute("data-rule-drives");
|
|
34
|
+
i.length = 0, l = null;
|
|
35
|
+
}, g = (o) => {
|
|
36
|
+
var u, m;
|
|
37
|
+
const e = ((m = (u = o.target) == null ? void 0 : u.closest) == null ? void 0 : m.call(u, "[data-design-target]")) ?? null;
|
|
38
|
+
if (e === l || (a(), !e || !n.contains(e))) return;
|
|
39
|
+
const v = E(e.getAttribute("data-design-target") ?? "");
|
|
40
|
+
if (!v) return;
|
|
41
|
+
const d = k(f.current, v);
|
|
42
|
+
if (d.length === 0) return;
|
|
43
|
+
l = e;
|
|
44
|
+
const h = /* @__PURE__ */ new Set();
|
|
45
|
+
for (const $ of d)
|
|
46
|
+
for (const s of n.querySelectorAll(O($).join(",")))
|
|
47
|
+
s === e || h.has(s) || (h.add(s), s.setAttribute("data-rule-dependent", w[$.kind]), i.push(s));
|
|
48
|
+
e.setAttribute("data-rule-drives", `Controls ${d.length}`), i.push(e);
|
|
49
|
+
}, p = (o) => {
|
|
50
|
+
const e = o.relatedTarget;
|
|
51
|
+
(!e || !n.contains(e)) && a();
|
|
52
|
+
};
|
|
53
|
+
return n.addEventListener("pointerover", g), n.addEventListener("pointerout", p), () => {
|
|
54
|
+
n.removeEventListener("pointerover", g), n.removeEventListener("pointerout", p), a();
|
|
55
|
+
};
|
|
56
|
+
}, []), r;
|
|
57
|
+
}
|
|
58
|
+
export {
|
|
59
|
+
O as dependentSelectors,
|
|
60
|
+
E as fieldOfTargetKey,
|
|
61
|
+
_ as useDriverHover
|
|
62
|
+
};
|