@nivaro/react 0.2.52 → 0.2.54
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 +1 -1
- package/dist/index.d.ts +116 -2
- package/dist/layout-editor.d.ts +248 -2
- package/dist/shared/components/FormWhatsNew.js +60 -0
- package/dist/shared/components/ItemEditForm.js +3994 -3876
- package/dist/shared/components/RecordReadView.js +219 -211
- package/dist/shared/components/TipLayer.js +27 -27
- package/dist/shared/components/help-videos/api.js +51 -41
- package/dist/shared/components/help-videos/editor/DetailsTab.js +147 -130
- package/dist/shared/components/item-edit/FieldAffordances.js +7 -6
- package/dist/shared/components/item-edit/FieldRow.js +353 -304
- package/dist/shared/components/item-edit/FormHelpVideoButton.js +59 -0
- package/dist/shared/components/item-edit/GroupSection.js +419 -396
- package/dist/shared/components/item-edit/HeaderTools.js +59 -56
- package/dist/shared/components/item-edit/LayoutContentBlock.js +47 -24
- package/dist/shared/components/item-edit/lock-why.js +87 -0
- package/dist/shared/components/item-edit/useFormUsageBeacon.js +59 -0
- package/dist/shared/components/layout-editor/AddPanel.js +204 -146
- 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 +146 -0
- package/dist/shared/components/layout-editor/CollabParts.js +170 -0
- package/dist/shared/components/layout-editor/DesignNode.js +304 -115
- package/dist/shared/components/layout-editor/EditorCanvas.js +21 -20
- package/dist/shared/components/layout-editor/EditorTopBar.js +452 -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 +234 -109
- package/dist/shared/components/layout-editor/LayoutEditor.js +1101 -307
- 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/ScheduleChange.js +106 -0
- package/dist/shared/components/layout-editor/SessionHistory.js +84 -0
- package/dist/shared/components/layout-editor/StructureMenu.js +413 -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 +342 -0
- package/dist/shared/components/layout-editor/collab/collab-api.js +77 -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 +179 -163
- package/dist/shared/components/layout-editor/dnd/collision.js +25 -23
- package/dist/shared/components/layout-editor/dnd/rail-drop.js +56 -0
- package/dist/shared/components/layout-editor/draft-recovery.js +61 -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/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/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/Breadcrumb.js +36 -0
- package/dist/shared/components/layout-editor/inspector/BulkInspector.js +175 -0
- package/dist/shared/components/layout-editor/inspector/ColumnFit.js +112 -0
- package/dist/shared/components/layout-editor/inspector/GroupInspector.js +146 -92
- package/dist/shared/components/layout-editor/inspector/HelpTab.js +174 -0
- package/dist/shared/components/layout-editor/inspector/Inspector.js +256 -175
- package/dist/shared/components/layout-editor/inspector/LookTab.js +46 -40
- package/dist/shared/components/layout-editor/inspector/OverrideNotice.js +61 -0
- package/dist/shared/components/layout-editor/inspector/PickerPreview.js +134 -0
- package/dist/shared/components/layout-editor/inspector/PickerTab.js +167 -141
- package/dist/shared/components/layout-editor/inspector/RulesTab.js +175 -128
- package/dist/shared/components/layout-editor/inspector/Translations.js +156 -0
- package/dist/shared/components/layout-editor/inspector/kit.js +3 -3
- 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/overview/OverviewActions.js +15 -3
- package/dist/shared/components/layout-editor/overview/describe-conditions.js +18 -14
- package/dist/shared/components/layout-editor/overview/overview-api.js +105 -88
- 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/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/settings/FormSettings.js +123 -103
- package/dist/shared/components/layout-editor/settings/InheritanceSection.js +1 -1
- package/dist/shared/components/layout-editor/settings/ToolsSection.js +174 -100
- package/dist/shared/components/layout-editor/settings/WhoSection.js +136 -100
- package/dist/shared/components/layout-editor/settings/controls.js +8 -8
- package/dist/shared/components/layout-editor/settings/settings-registry.js +35 -11
- 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/structure-ops.js +399 -0
- package/dist/shared/components/layout-editor/testing/CostLimitSetting.js +42 -0
- package/dist/shared/components/layout-editor/testing/TestingPanels.js +551 -0
- package/dist/shared/components/layout-editor/testing/testing-api.js +67 -0
- package/dist/shared/components/layout-editor/testing/testing-model.js +393 -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/FillChip.js +27 -0
- package/dist/shared/components/layout-editor/usage/UsagePanel.js +158 -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 -307
- package/dist/shared/components/support/SuggestFormChange.js +143 -0
- package/dist/shared/lib/ai-fill.js +37 -0
- package/dist/shared/lib/form-usage-beacon.js +84 -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 +110 -106
- package/dist/shared/lib/screenshot.js +54 -28
- package/dist/shared/lib/visible-when.js +34 -0
- package/package.json +1 -1
|
@@ -1,25 +1,26 @@
|
|
|
1
|
-
import { jsx as r, jsxs as f, Fragment as
|
|
2
|
-
import { useQuery as B, useQueryClient as
|
|
3
|
-
import { Pencil as
|
|
4
|
-
import { useMemo as
|
|
5
|
-
import { DrilldownContext as
|
|
6
|
-
import { useDebounced as
|
|
1
|
+
import { jsx as r, jsxs as f, Fragment as fe } from "react/jsx-runtime";
|
|
2
|
+
import { useQuery as B, useQueryClient as xt } from "@tanstack/react-query";
|
|
3
|
+
import { Pencil as yt, ChevronDown as vt } from "lucide-react";
|
|
4
|
+
import { useMemo as pe, useRef as _t, useState as H, useEffect as he, useCallback as tt } from "react";
|
|
5
|
+
import { DrilldownContext as kt, useNivaroClient as qe, useApiFetchConfig as Nt, useDrilldown as nt } from "../context.js";
|
|
6
|
+
import { useDebounced as wt } from "../hooks/useDebounced.js";
|
|
7
7
|
import { get as J } from "../lib/commands.js";
|
|
8
|
-
import { useLiveRecord as
|
|
9
|
-
import { useRecordReader as
|
|
10
|
-
import { sanitizeHtml as
|
|
11
|
-
import { titleCase as
|
|
12
|
-
import { InboundRequestPopover as
|
|
13
|
-
import { FileM2MField as
|
|
14
|
-
import { useFieldTouches as
|
|
15
|
-
import { richTextToPlain as
|
|
16
|
-
import { UserChip as
|
|
17
|
-
import { DesignNode as
|
|
18
|
-
import { DesignCanvas as
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
|
|
8
|
+
import { useLiveRecord as St } from "../lib/live.js";
|
|
9
|
+
import { useRecordReader as $t } from "../lib/record-loader.js";
|
|
10
|
+
import { sanitizeHtml as qt } from "../lib/sanitize-html.js";
|
|
11
|
+
import { titleCase as je, formatRelative as $e } from "../lib/utils.js";
|
|
12
|
+
import { InboundRequestPopover as Ft } from "./integrations/InboundRequest.js";
|
|
13
|
+
import { FileM2MField as Ct } from "./item-edit/FilePickerField.js";
|
|
14
|
+
import { useFieldTouches as Ot } from "./item-edit/HeaderFreshness.js";
|
|
15
|
+
import { richTextToPlain as At } from "./item-edit/helpers.js";
|
|
16
|
+
import { UserChip as at } from "./item-edit/UserChip.js";
|
|
17
|
+
import { DesignNode as Rt } from "./layout-editor/DesignNode.js";
|
|
18
|
+
import { DesignCanvas as Tt } from "./layout-editor/design-canvas.js";
|
|
19
|
+
import { revealGroupKey as Dt } from "./layout-editor/design-context.js";
|
|
20
|
+
import { useRecordIntegrity as Lt, integrityByField as Kt } from "./panels/RecordIntegrityBanner.js";
|
|
21
|
+
import { SimpleSelectXs as lt } from "./ui/SimpleSelect.js";
|
|
22
|
+
import { WidgetSlot as It } from "./WidgetSlot.js";
|
|
23
|
+
const me = (n) => {
|
|
23
24
|
if (!n) return {};
|
|
24
25
|
if (typeof n == "object") return n;
|
|
25
26
|
try {
|
|
@@ -27,16 +28,16 @@ const ue = (n) => {
|
|
|
27
28
|
} catch {
|
|
28
29
|
return {};
|
|
29
30
|
}
|
|
30
|
-
},
|
|
31
|
+
}, it = (n) => {
|
|
31
32
|
const u = new Date(String(n));
|
|
32
33
|
return Number.isNaN(u.getTime()) ? String(n) : `${String(u.getMonth() + 1).padStart(2, "0")}/${String(u.getDate()).padStart(2, "0")}/${u.getFullYear()}`;
|
|
33
|
-
},
|
|
34
|
+
}, We = (n) => {
|
|
34
35
|
const u = Number(n);
|
|
35
36
|
return Number.isNaN(u) ? String(n) : `$${u.toLocaleString("en-US", { minimumFractionDigits: 2, maximumFractionDigits: 2 })}`;
|
|
36
|
-
},
|
|
37
|
+
}, Re = (n) => {
|
|
37
38
|
const u = Number(n);
|
|
38
39
|
return Number.isNaN(u) ? String(n) : u.toLocaleString("en-US");
|
|
39
|
-
}, ee = () => /* @__PURE__ */ r("span", { className: "text-slate-300 dark:text-slate-600", children: "—" }),
|
|
40
|
+
}, ee = () => /* @__PURE__ */ r("span", { className: "text-slate-300 dark:text-slate-600", children: "—" }), Pt = `
|
|
40
41
|
[data-read-board]{grid-template-columns:minmax(0,1fr)}
|
|
41
42
|
[data-read-dl]{grid-template-columns:repeat(2,minmax(0,1fr))}
|
|
42
43
|
@media (min-width:640px){[data-read-dl="full"]{grid-template-columns:repeat(3,minmax(0,1fr))}}
|
|
@@ -51,7 +52,7 @@ const ue = (n) => {
|
|
|
51
52
|
}
|
|
52
53
|
@media (min-width:1536px){[data-read-dl="full"]{grid-template-columns:repeat(6,minmax(0,1fr))}}
|
|
53
54
|
`;
|
|
54
|
-
function
|
|
55
|
+
function st({
|
|
55
56
|
value: n,
|
|
56
57
|
trueTone: u = "positive"
|
|
57
58
|
}) {
|
|
@@ -64,8 +65,8 @@ function at({
|
|
|
64
65
|
}
|
|
65
66
|
);
|
|
66
67
|
}
|
|
67
|
-
function
|
|
68
|
-
const k =
|
|
68
|
+
function jt({ collection: n, id: u }) {
|
|
69
|
+
const k = qe(), c = $t(), L = nt(), { data: N } = B({
|
|
69
70
|
queryKey: ["cbv-collection-meta", n],
|
|
70
71
|
queryFn: () => k.request(
|
|
71
72
|
J(`/collections/${n}`)
|
|
@@ -115,10 +116,10 @@ function It({ collection: n, id: u }) {
|
|
|
115
116
|
className: "text-left underline decoration-slate-300 underline-offset-2 transition-colors hover:text-[#007a99] hover:decoration-[#007a99] dark:decoration-slate-600 dark:hover:text-nvr-cyan dark:hover:decoration-nvr-cyan",
|
|
116
117
|
children: v
|
|
117
118
|
}
|
|
118
|
-
) : /* @__PURE__ */ r(
|
|
119
|
+
) : /* @__PURE__ */ r(fe, { children: v });
|
|
119
120
|
}
|
|
120
|
-
function
|
|
121
|
-
const u =
|
|
121
|
+
function Wt({ id: n }) {
|
|
122
|
+
const u = qe(), { apiBase: k } = Nt(), { data: c, isPending: L } = B({
|
|
122
123
|
queryKey: ["rrv-file-meta", String(n)],
|
|
123
124
|
queryFn: () => u.request(
|
|
124
125
|
J(`/files/${n}/meta`)
|
|
@@ -142,8 +143,8 @@ function Kt({ id: n }) {
|
|
|
142
143
|
}
|
|
143
144
|
);
|
|
144
145
|
}
|
|
145
|
-
const
|
|
146
|
-
function
|
|
146
|
+
const Ee = ({ collection: n, id: u }) => n === "nivaro_files" ? /* @__PURE__ */ r(Wt, { id: u }) : /* @__PURE__ */ r(jt, { collection: n, id: u });
|
|
147
|
+
function Et({
|
|
147
148
|
junction: n,
|
|
148
149
|
parentFk: u,
|
|
149
150
|
junctionField: k,
|
|
@@ -153,7 +154,7 @@ function Pt({
|
|
|
153
154
|
relation: w
|
|
154
155
|
}) {
|
|
155
156
|
var E;
|
|
156
|
-
const j =
|
|
157
|
+
const j = qe(), { data: v } = B({
|
|
157
158
|
queryKey: ["cbv-collection-meta", n],
|
|
158
159
|
queryFn: () => j.request(J(`/collections/${n}`)).then((p) => p.data),
|
|
159
160
|
staleTime: 10 * 6e4,
|
|
@@ -182,12 +183,12 @@ function Pt({
|
|
|
182
183
|
staleTime: 3e4,
|
|
183
184
|
retry: !1
|
|
184
185
|
}), q = C == null ? void 0 : C.map((p) => p.id), R = x ?? (W ? ((E = C == null ? void 0 : C.find((p) => p.collection)) == null ? void 0 : E.collection) ?? null : null), O = q == null ? void 0 : q.length;
|
|
185
|
-
return
|
|
186
|
+
return he(() => {
|
|
186
187
|
O !== void 0 && (L == null || L(O));
|
|
187
|
-
}, [O, L]),
|
|
188
|
+
}, [O, L]), he(() => {
|
|
188
189
|
R && (N == null || N(R));
|
|
189
190
|
}, [R, N]), v && !R && (!W || C) ? /* @__PURE__ */ r(ee, {}) : !q || !R ? /* @__PURE__ */ r("span", { className: "inline-block h-3.5 w-20 animate-pulse rounded bg-slate-100 dark:bg-[hsl(var(--nvr-skeleton))]" }) : q.length === 0 ? /* @__PURE__ */ r(ee, {}) : R === "nivaro_files" && w ? /* @__PURE__ */ r("div", { className: "mt-1", children: /* @__PURE__ */ r(
|
|
190
|
-
|
|
191
|
+
Ct,
|
|
191
192
|
{
|
|
192
193
|
relation: w,
|
|
193
194
|
parentId: c,
|
|
@@ -199,14 +200,14 @@ function Pt({
|
|
|
199
200
|
{
|
|
200
201
|
className: "inline-flex items-center whitespace-nowrap",
|
|
201
202
|
children: [
|
|
202
|
-
/* @__PURE__ */ r(
|
|
203
|
+
/* @__PURE__ */ r(Ee, { collection: y ?? R, id: p }),
|
|
203
204
|
A < q.length - 1 && /* @__PURE__ */ r("span", { className: "text-slate-300 dark:text-slate-600", children: "," })
|
|
204
205
|
]
|
|
205
206
|
},
|
|
206
207
|
`${y ?? R}:${p}`
|
|
207
208
|
)) });
|
|
208
209
|
}
|
|
209
|
-
function
|
|
210
|
+
function Mt({
|
|
210
211
|
collection: n,
|
|
211
212
|
fkField: u,
|
|
212
213
|
parentId: k,
|
|
@@ -215,7 +216,7 @@ function jt({
|
|
|
215
216
|
defaultPreset: N,
|
|
216
217
|
onCount: w
|
|
217
218
|
}) {
|
|
218
|
-
const j =
|
|
219
|
+
const j = qe(), v = nt(), h = (L ?? []).filter((t) => t && Array.isArray(t.columns)), [S, W] = H(
|
|
219
220
|
() => {
|
|
220
221
|
var t;
|
|
221
222
|
return h.length >= 2 ? ((t = h.find((a) => a.name === N)) == null ? void 0 : t.name) ?? h[0].name : "__all__";
|
|
@@ -254,11 +255,11 @@ function jt({
|
|
|
254
255
|
})),
|
|
255
256
|
staleTime: 5 * 6e4,
|
|
256
257
|
retry: !1
|
|
257
|
-
}), C = (x == null ? void 0 : x.cols) ?? [], q = !!(x != null && x.lineNo), R = S !== "__all__" ? h.find((t) => t.name === S) : null, O =
|
|
258
|
+
}), C = (x == null ? void 0 : x.cols) ?? [], q = !!(x != null && x.lineNo), R = S !== "__all__" ? h.find((t) => t.name === S) : null, O = pe(() => {
|
|
258
259
|
if (!R) return C;
|
|
259
260
|
const t = new Set(R.columns), a = C.filter((s) => t.has(s.field));
|
|
260
261
|
return a.length > 0 ? a : C;
|
|
261
|
-
}, [C, R]), [E, p] =
|
|
262
|
+
}, [C, R]), [E, p] = H(""), [y, A] = H(1), [V, ne] = H({}), ae = wt(V, 350), _ = pe(() => {
|
|
262
263
|
const t = [
|
|
263
264
|
{ path: [u], op: "_eq", value: k }
|
|
264
265
|
];
|
|
@@ -268,15 +269,15 @@ function jt({
|
|
|
268
269
|
t.push({ path: [a], op: s.op, value: D });
|
|
269
270
|
}
|
|
270
271
|
return JSON.stringify(t);
|
|
271
|
-
}, [ae, u, k]),
|
|
272
|
+
}, [ae, u, k]), Q = 25, {
|
|
272
273
|
data: M,
|
|
273
|
-
isLoading:
|
|
274
|
-
isFetching:
|
|
274
|
+
isLoading: ge,
|
|
275
|
+
isFetching: be
|
|
275
276
|
} = B({
|
|
276
277
|
queryKey: ["rrv-rows", n, u, k, E, q, y, _],
|
|
277
278
|
queryFn: () => j.request(
|
|
278
279
|
J(`/items/${n}`, {
|
|
279
|
-
limit:
|
|
280
|
+
limit: Q,
|
|
280
281
|
page: y,
|
|
281
282
|
...E ? { sort: E } : q ? { sort: "line_number" } : {},
|
|
282
283
|
conditions: _
|
|
@@ -285,11 +286,11 @@ function jt({
|
|
|
285
286
|
placeholderData: (t) => t,
|
|
286
287
|
staleTime: 3e4,
|
|
287
288
|
retry: !1
|
|
288
|
-
}), U = (M == null ? void 0 : M.data) ?? [], T = (M == null ? void 0 : M.total) ?? U.length,
|
|
289
|
-
|
|
290
|
-
M && !
|
|
291
|
-
}, [M,
|
|
292
|
-
const ie = O.filter((t) => t.field.includes(".")), z = U.map((t) => String(t.id)), { data:
|
|
289
|
+
}), U = (M == null ? void 0 : M.data) ?? [], T = (M == null ? void 0 : M.total) ?? U.length, xe = Object.values(ae).some((t) => !!(t != null && t.value.trim()));
|
|
290
|
+
he(() => {
|
|
291
|
+
M && !xe && (w == null || w(T));
|
|
292
|
+
}, [M, xe, T, w]);
|
|
293
|
+
const ie = O.filter((t) => t.field.includes(".")), z = U.map((t) => String(t.id)), { data: K } = B({
|
|
293
294
|
queryKey: [
|
|
294
295
|
"rrv-resolve-paths",
|
|
295
296
|
n,
|
|
@@ -304,15 +305,15 @@ function jt({
|
|
|
304
305
|
).then((t) => t.data ?? { rows: {}, targets: {} }).catch(() => ({ rows: {}, targets: {} })),
|
|
305
306
|
enabled: ie.length > 0 && z.length > 0,
|
|
306
307
|
staleTime: 3e4
|
|
307
|
-
}), Y = q && U.some((t) => t.line_number != null),
|
|
308
|
+
}), Y = q && U.some((t) => t.line_number != null), ye = Math.max(1, Math.ceil(T / Q)), se = (t, a, s) => {
|
|
308
309
|
A(1), ne((m) => {
|
|
309
310
|
const F = { ...m };
|
|
310
311
|
return s ? F[t] = { op: a, value: s } : delete F[t], F;
|
|
311
312
|
});
|
|
312
|
-
},
|
|
313
|
+
}, Te = (t) => {
|
|
313
314
|
A(1), p((a) => a === t ? `-${t}` : a === `-${t}` ? "" : t);
|
|
314
315
|
};
|
|
315
|
-
if (
|
|
316
|
+
if (ge)
|
|
316
317
|
return /* @__PURE__ */ r("div", { className: "space-y-1.5 py-2", children: [0, 1, 2].map((t) => /* @__PURE__ */ r(
|
|
317
318
|
"div",
|
|
318
319
|
{
|
|
@@ -322,20 +323,20 @@ function jt({
|
|
|
322
323
|
)) });
|
|
323
324
|
if (U.length === 0 && Object.keys(ae).length === 0)
|
|
324
325
|
return /* @__PURE__ */ r("p", { className: "py-3 text-[12px] text-slate-400", children: "No records" });
|
|
325
|
-
const
|
|
326
|
-
var D,
|
|
326
|
+
const ve = (t, a) => {
|
|
327
|
+
var D, G;
|
|
327
328
|
if (a.field.includes(".")) {
|
|
328
|
-
const te = (D =
|
|
329
|
-
if (!
|
|
329
|
+
const te = (D = K == null ? void 0 : K.rows[String(t.id)]) == null ? void 0 : D[a.field];
|
|
330
|
+
if (!K)
|
|
330
331
|
return /* @__PURE__ */ r("span", { className: "inline-block h-3 w-14 animate-pulse rounded bg-slate-100 dark:bg-[hsl(var(--nvr-skeleton))]" });
|
|
331
332
|
if (!te || te.value === "") return /* @__PURE__ */ r(ee, {});
|
|
332
|
-
const
|
|
333
|
-
return v &&
|
|
333
|
+
const ce = K.targets[a.field], le = (G = te.ids) == null ? void 0 : G[0];
|
|
334
|
+
return v && ce && le ? /* @__PURE__ */ r(
|
|
334
335
|
"button",
|
|
335
336
|
{
|
|
336
337
|
type: "button",
|
|
337
|
-
onClick: (
|
|
338
|
-
|
|
338
|
+
onClick: (Le) => {
|
|
339
|
+
Le.stopPropagation(), v.open({ collection: ce, itemId: String(le) });
|
|
339
340
|
},
|
|
340
341
|
className: "text-left underline decoration-slate-300 underline-offset-2 hover:text-[#007a99] dark:decoration-slate-600 dark:hover:text-nvr-cyan",
|
|
341
342
|
children: te.value
|
|
@@ -346,15 +347,15 @@ function jt({
|
|
|
346
347
|
if (s == null || s === "") return /* @__PURE__ */ r(ee, {});
|
|
347
348
|
const m = g(a.field);
|
|
348
349
|
if (m === "nivaro_users")
|
|
349
|
-
return /* @__PURE__ */ r("span", { className: "inline-block", children: /* @__PURE__ */ r(
|
|
350
|
-
if (m) return /* @__PURE__ */ r(
|
|
351
|
-
if (a.type === "boolean") return /* @__PURE__ */ r(
|
|
352
|
-
if (a.type === "decimal" || a.type === "float") return
|
|
353
|
-
if (a.type === "integer") return
|
|
354
|
-
if (a.type === "date" || a.type === "datetime" || a.type === "timestamp") return
|
|
350
|
+
return /* @__PURE__ */ r("span", { className: "inline-block", children: /* @__PURE__ */ r(at, { userId: String(s), size: "compact" }) });
|
|
351
|
+
if (m) return /* @__PURE__ */ r(Ee, { collection: m, id: s });
|
|
352
|
+
if (a.type === "boolean") return /* @__PURE__ */ r(st, { value: s });
|
|
353
|
+
if (a.type === "decimal" || a.type === "float") return We(s);
|
|
354
|
+
if (a.type === "integer") return Re(s);
|
|
355
|
+
if (a.type === "date" || a.type === "datetime" || a.type === "timestamp") return it(s);
|
|
355
356
|
const F = String(s);
|
|
356
357
|
return F.length > 48 ? `${F.slice(0, 48)}…` : F;
|
|
357
|
-
},
|
|
358
|
+
}, _e = (t) => ["decimal", "float", "integer"].includes(t.type ?? "") && !g(t.field) && !t.field.includes("."), Fe = (t) => {
|
|
358
359
|
const a = t.options;
|
|
359
360
|
if (!a) return {};
|
|
360
361
|
if (typeof a == "string")
|
|
@@ -365,17 +366,17 @@ function jt({
|
|
|
365
366
|
}
|
|
366
367
|
return a;
|
|
367
368
|
}, de = (t) => {
|
|
368
|
-
const a =
|
|
369
|
+
const a = Fe(t).aggregate;
|
|
369
370
|
return typeof a == "string" && ["sum", "avg", "min", "max", "count"].includes(a) ? a : null;
|
|
370
|
-
},
|
|
371
|
+
}, ke = O.some((t) => de(t)), De = (t) => {
|
|
371
372
|
const a = de(t);
|
|
372
373
|
if (!a) return null;
|
|
373
374
|
const s = U.map((D) => Number(D[t.field])).filter((D) => !Number.isNaN(D));
|
|
374
375
|
let m = null;
|
|
375
|
-
if (a === "count" ? m = U.length : s.length > 0 && (a === "sum" ? m = s.reduce((D,
|
|
376
|
-
const F =
|
|
377
|
-
return a === "count" || F === "int" ?
|
|
378
|
-
},
|
|
376
|
+
if (a === "count" ? m = U.length : s.length > 0 && (a === "sum" ? m = s.reduce((D, G) => D + G, 0) : a === "avg" ? m = s.reduce((D, G) => D + G, 0) / s.length : a === "min" ? m = Math.min(...s) : a === "max" && (m = Math.max(...s))), m === null) return "—";
|
|
377
|
+
const F = Fe(t).format;
|
|
378
|
+
return a === "count" || F === "int" ? Re(Math.round(m)) : F === "currency" || t.type === "decimal" || t.type === "float" ? We(m) : a === "avg" ? m.toFixed(2) : Re(m);
|
|
379
|
+
}, Ne = (t) => !g(t.field) && !t.field.includes("."), oe = (t) => g(t.field) || t.field.includes(".") ? null : t.type === "boolean" ? "bool" : ["integer", "decimal", "float"].includes(t.type ?? "") ? "num" : ["string", "text"].includes(t.type ?? "") ? "text" : null, Ce = O.some((t) => oe(t) != null);
|
|
379
380
|
return /* @__PURE__ */ f("div", { children: [
|
|
380
381
|
h.length >= 2 && /* @__PURE__ */ r("div", { className: "mb-1.5 flex flex-wrap items-center gap-1", "data-read-presets": !0, children: [
|
|
381
382
|
{ name: "__all__", label: "All" },
|
|
@@ -394,7 +395,7 @@ function jt({
|
|
|
394
395
|
/* @__PURE__ */ r(
|
|
395
396
|
"div",
|
|
396
397
|
{
|
|
397
|
-
className: `overflow-x-auto rounded-md border border-slate-200 dark:border-slate-700 ${
|
|
398
|
+
className: `overflow-x-auto rounded-md border border-slate-200 dark:border-slate-700 ${be && !ge ? "opacity-70" : ""}`,
|
|
398
399
|
children: /* @__PURE__ */ f("table", { className: "w-full", style: { fontVariantNumeric: "tabular-nums" }, children: [
|
|
399
400
|
/* @__PURE__ */ f("thead", { children: [
|
|
400
401
|
/* @__PURE__ */ f("tr", { className: "border-b border-slate-200 bg-slate-50 dark:border-slate-700 dark:bg-slate-800", children: [
|
|
@@ -404,18 +405,18 @@ function jt({
|
|
|
404
405
|
return /* @__PURE__ */ f(
|
|
405
406
|
"th",
|
|
406
407
|
{
|
|
407
|
-
onClick: () =>
|
|
408
|
-
className: `h-7 select-none whitespace-nowrap px-2.5 text-[9.5px] font-bold uppercase tracking-wider text-slate-500 dark:text-slate-400 ${
|
|
408
|
+
onClick: () => Ne(t) && Te(t.field),
|
|
409
|
+
className: `h-7 select-none whitespace-nowrap px-2.5 text-[9.5px] font-bold uppercase tracking-wider text-slate-500 dark:text-slate-400 ${_e(t) ? "text-right" : "text-left"} ${Ne(t) ? "cursor-pointer hover:text-slate-700 dark:hover:text-slate-200" : ""}`,
|
|
409
410
|
children: [
|
|
410
|
-
t.label ||
|
|
411
|
-
|
|
411
|
+
t.label || je(t.field),
|
|
412
|
+
Ne(t) && /* @__PURE__ */ r("span", { className: a ? "ml-0.5 text-[#00a5cc]" : "ml-0.5 text-slate-300", children: a ? E.startsWith("-") ? "▼" : "▲" : "⇅" })
|
|
412
413
|
]
|
|
413
414
|
},
|
|
414
415
|
t.field
|
|
415
416
|
);
|
|
416
417
|
})
|
|
417
418
|
] }),
|
|
418
|
-
|
|
419
|
+
Ce && /* @__PURE__ */ f("tr", { className: "border-b border-slate-200 bg-slate-50 dark:border-slate-700 dark:bg-slate-800", children: [
|
|
419
420
|
Y && /* @__PURE__ */ r("th", { className: "px-1.5 py-1" }),
|
|
420
421
|
O.map((t) => {
|
|
421
422
|
const a = oe(t), s = V[t.field];
|
|
@@ -432,7 +433,7 @@ function jt({
|
|
|
432
433
|
),
|
|
433
434
|
a === "num" && /* @__PURE__ */ f("span", { className: "flex items-center gap-0.5", children: [
|
|
434
435
|
/* @__PURE__ */ r(
|
|
435
|
-
|
|
436
|
+
lt,
|
|
436
437
|
{
|
|
437
438
|
value: (s == null ? void 0 : s.op) ?? "_eq",
|
|
438
439
|
onChange: (m) => se(t.field, m, (s == null ? void 0 : s.value) ?? ""),
|
|
@@ -456,7 +457,7 @@ function jt({
|
|
|
456
457
|
)
|
|
457
458
|
] }),
|
|
458
459
|
a === "bool" && /* @__PURE__ */ r(
|
|
459
|
-
|
|
460
|
+
lt,
|
|
460
461
|
{
|
|
461
462
|
value: (s == null ? void 0 : s.value) ?? "",
|
|
462
463
|
onChange: (m) => se(t.field, "_eq", m),
|
|
@@ -492,8 +493,8 @@ function jt({
|
|
|
492
493
|
O.map((a) => /* @__PURE__ */ r(
|
|
493
494
|
"td",
|
|
494
495
|
{
|
|
495
|
-
className: `whitespace-nowrap px-2.5 py-1.5 text-[12px] text-slate-700 dark:text-slate-200 ${
|
|
496
|
-
children:
|
|
496
|
+
className: `whitespace-nowrap px-2.5 py-1.5 text-[12px] text-slate-700 dark:text-slate-200 ${_e(a) ? "text-right" : ""}`,
|
|
497
|
+
children: ve(t, a)
|
|
497
498
|
},
|
|
498
499
|
a.field
|
|
499
500
|
))
|
|
@@ -502,7 +503,7 @@ function jt({
|
|
|
502
503
|
String(t.id)
|
|
503
504
|
))
|
|
504
505
|
] }),
|
|
505
|
-
|
|
506
|
+
ke && U.length > 0 && /* @__PURE__ */ r("tfoot", { children: /* @__PURE__ */ f(
|
|
506
507
|
"tr",
|
|
507
508
|
{
|
|
508
509
|
"data-read-grid-footer": !0,
|
|
@@ -514,10 +515,10 @@ function jt({
|
|
|
514
515
|
return /* @__PURE__ */ r(
|
|
515
516
|
"td",
|
|
516
517
|
{
|
|
517
|
-
className: `whitespace-nowrap px-2.5 py-1.5 ${
|
|
518
|
-
children: a && /* @__PURE__ */ f(
|
|
518
|
+
className: `whitespace-nowrap px-2.5 py-1.5 ${_e(t) ? "text-right" : ""}`,
|
|
519
|
+
children: a && /* @__PURE__ */ f(fe, { children: [
|
|
519
520
|
/* @__PURE__ */ r("span", { className: "mr-1 font-mono text-[10px] text-slate-400", children: a.toUpperCase() }),
|
|
520
|
-
/* @__PURE__ */ r("span", { className: "tabular-nums", children:
|
|
521
|
+
/* @__PURE__ */ r("span", { className: "tabular-nums", children: De(t) })
|
|
521
522
|
] })
|
|
522
523
|
},
|
|
523
524
|
t.field
|
|
@@ -529,11 +530,11 @@ function jt({
|
|
|
529
530
|
] })
|
|
530
531
|
}
|
|
531
532
|
),
|
|
532
|
-
T >
|
|
533
|
+
T > Q && /* @__PURE__ */ f("div", { className: "mt-1.5 flex items-center justify-between", children: [
|
|
533
534
|
/* @__PURE__ */ f("p", { className: "text-[11px] tabular-nums text-slate-400", children: [
|
|
534
|
-
((y - 1) *
|
|
535
|
+
((y - 1) * Q + 1).toLocaleString("en-US"),
|
|
535
536
|
"–",
|
|
536
|
-
Math.min(y *
|
|
537
|
+
Math.min(y * Q, T).toLocaleString("en-US"),
|
|
537
538
|
" of",
|
|
538
539
|
" ",
|
|
539
540
|
T.toLocaleString("en-US")
|
|
@@ -552,13 +553,13 @@ function jt({
|
|
|
552
553
|
/* @__PURE__ */ f("span", { className: "min-w-[48px] text-center text-[11px] tabular-nums text-slate-500", children: [
|
|
553
554
|
y,
|
|
554
555
|
" / ",
|
|
555
|
-
|
|
556
|
+
ye.toLocaleString("en-US")
|
|
556
557
|
] }),
|
|
557
558
|
/* @__PURE__ */ r(
|
|
558
559
|
"button",
|
|
559
560
|
{
|
|
560
561
|
type: "button",
|
|
561
|
-
disabled: y >=
|
|
562
|
+
disabled: y >= ye,
|
|
562
563
|
onClick: () => A((t) => t + 1),
|
|
563
564
|
className: "h-6 rounded px-2 text-[11px] text-slate-600 hover:bg-slate-100 disabled:opacity-30 dark:text-slate-300 dark:hover:bg-slate-800",
|
|
564
565
|
children: "Next →"
|
|
@@ -568,7 +569,7 @@ function jt({
|
|
|
568
569
|
] })
|
|
569
570
|
] });
|
|
570
571
|
}
|
|
571
|
-
function
|
|
572
|
+
function rt({
|
|
572
573
|
collection: n,
|
|
573
574
|
itemId: u,
|
|
574
575
|
layoutData: k,
|
|
@@ -580,8 +581,8 @@ function tt({
|
|
|
580
581
|
onEditSection: v,
|
|
581
582
|
gridCounts: h
|
|
582
583
|
}) {
|
|
583
|
-
var
|
|
584
|
-
const S =
|
|
584
|
+
var Ge;
|
|
585
|
+
const S = qe(), W = c ? c.record ?? {} : null, $ = !!(c != null && c.context.showHidden), g = c ? String(((Ge = c.record) == null ? void 0 : Ge.id) ?? "") : u ?? "", x = pe(
|
|
585
586
|
() => c ? {
|
|
586
587
|
...c.layout,
|
|
587
588
|
layout: c.layout.layout ?? { id: 0, name: "" }
|
|
@@ -591,19 +592,19 @@ function tt({
|
|
|
591
592
|
kind: "field",
|
|
592
593
|
field: e.field,
|
|
593
594
|
group_key: e.group_key ?? null
|
|
594
|
-
}), q = (e, l, i = !1) => c ? /* @__PURE__ */ r(
|
|
595
|
+
}), q = (e, l, i = !1) => c ? /* @__PURE__ */ r(Rt, { target: e, children: i ? /* @__PURE__ */ r("div", { "data-design-hidden": !0, className: "opacity-40", children: l }) : l }) : l, R = pe(
|
|
595
596
|
() => [
|
|
596
597
|
...new Set(
|
|
597
598
|
(c ? [] : (x == null ? void 0 : x.assignments) ?? []).map((e) => e.field).filter((e) => e && !e.startsWith("__") && !e.includes("."))
|
|
598
599
|
)
|
|
599
600
|
].sort(),
|
|
600
601
|
[x, c]
|
|
601
|
-
), { data: O } =
|
|
602
|
+
), { data: O } = Ot(n, g, R), E = (e) => {
|
|
602
603
|
const l = O == null ? void 0 : O[e];
|
|
603
604
|
if (!l) return null;
|
|
604
605
|
const i = l.via !== "user";
|
|
605
606
|
return l.caller && l.activity_id ? /* @__PURE__ */ r(
|
|
606
|
-
|
|
607
|
+
Ft,
|
|
607
608
|
{
|
|
608
609
|
activityId: l.activity_id,
|
|
609
610
|
callerName: l.caller.name,
|
|
@@ -615,14 +616,14 @@ function tt({
|
|
|
615
616
|
type: "button",
|
|
616
617
|
"data-field-touch": e,
|
|
617
618
|
"data-field-touch-caller": l.caller.key,
|
|
618
|
-
"data-tip": `Changed ${
|
|
619
|
-
"aria-label": `Changed ${
|
|
619
|
+
"data-tip": `Changed ${$e(l.at)} by ${l.caller.name} (through the API) — click for the request`,
|
|
620
|
+
"aria-label": `Changed ${$e(l.at)} by ${l.caller.name} through the API`,
|
|
620
621
|
className: "ml-1 inline-flex items-center gap-1 rounded-full bg-amber-50 px-1.5 align-middle text-[9.5px] font-medium leading-4 text-amber-800 hover:bg-amber-100 dark:bg-amber-400/10 dark:text-amber-300 dark:hover:bg-amber-400/20",
|
|
621
622
|
children: [
|
|
622
623
|
/* @__PURE__ */ r("span", { className: "h-1.5 w-1.5 rounded-full bg-amber-400", "aria-hidden": !0 }),
|
|
623
624
|
l.caller.name,
|
|
624
625
|
" · ",
|
|
625
|
-
|
|
626
|
+
$e(l.at)
|
|
626
627
|
]
|
|
627
628
|
}
|
|
628
629
|
)
|
|
@@ -631,14 +632,14 @@ function tt({
|
|
|
631
632
|
"span",
|
|
632
633
|
{
|
|
633
634
|
"data-field-touch": e,
|
|
634
|
-
"data-tip": `Changed ${
|
|
635
|
+
"data-tip": `Changed ${$e(l.at)} by ${l.who}${i ? ` · ${l.via}` : ""}`,
|
|
635
636
|
role: "img",
|
|
636
|
-
"aria-label": `Changed ${
|
|
637
|
+
"aria-label": `Changed ${$e(l.at)} by ${l.who}`,
|
|
637
638
|
className: `ml-1 inline-block h-1.5 w-1.5 rounded-full align-middle ${i ? "bg-amber-400" : "bg-slate-300 dark:bg-slate-600"}`
|
|
638
639
|
}
|
|
639
640
|
);
|
|
640
|
-
}, { data: p } =
|
|
641
|
-
() => w && (p != null && p.enabled) ?
|
|
641
|
+
}, { data: p } = Lt(n, g, !!w && !c), y = pe(
|
|
642
|
+
() => w && (p != null && p.enabled) ? Kt(p.findings) : null,
|
|
642
643
|
[w, p]
|
|
643
644
|
), A = ({ field: e }) => {
|
|
644
645
|
const l = y == null ? void 0 : y.get(e);
|
|
@@ -663,7 +664,7 @@ function tt({
|
|
|
663
664
|
).then((e) => e.data),
|
|
664
665
|
staleTime: 10 * 6e4,
|
|
665
666
|
retry: !1
|
|
666
|
-
}), ne =
|
|
667
|
+
}), ne = xt(), { data: ae } = B({
|
|
667
668
|
queryKey: ["rrv-record", n, g],
|
|
668
669
|
enabled: !c,
|
|
669
670
|
queryFn: () => S.request(J(`/items/${n}/${g}`)).then((e) => e.data),
|
|
@@ -675,22 +676,22 @@ function tt({
|
|
|
675
676
|
staleTime: 3e4,
|
|
676
677
|
retry: !1
|
|
677
678
|
}), _ = W ?? ae;
|
|
678
|
-
|
|
679
|
+
St(n, c ? null : g, (e) => {
|
|
679
680
|
e.aspectsOnly || e.deleted || (ne.invalidateQueries({ queryKey: ["rrv-record", n, g] }), ne.invalidateQueries({ queryKey: ["field-touch", n, g] }));
|
|
680
681
|
});
|
|
681
|
-
const
|
|
682
|
-
|
|
683
|
-
const e =
|
|
684
|
-
if (
|
|
682
|
+
const Q = _t(null), [M, ge] = H(() => /* @__PURE__ */ new Set());
|
|
683
|
+
he(() => {
|
|
684
|
+
const e = Q.current;
|
|
685
|
+
if (Q.current = _ ?? null, c || !e || !_ || e === _) return;
|
|
685
686
|
const l = Object.keys(_).filter(
|
|
686
687
|
(o) => !o.startsWith("__") && JSON.stringify(e[o]) !== JSON.stringify(_[o])
|
|
687
688
|
);
|
|
688
689
|
if (l.length === 0) return;
|
|
689
|
-
|
|
690
|
-
const i = setTimeout(() =>
|
|
690
|
+
ge(new Set(l));
|
|
691
|
+
const i = setTimeout(() => ge(/* @__PURE__ */ new Set()), 2400);
|
|
691
692
|
return () => clearTimeout(i);
|
|
692
693
|
}, [_, c]);
|
|
693
|
-
const
|
|
694
|
+
const be = (e) => M.has(e) ? " nvr-value-pulse-bg rounded-sm" : "", { data: U } = B({
|
|
694
695
|
queryKey: ["rrv-field-config", n, x.layout.id],
|
|
695
696
|
enabled: !c,
|
|
696
697
|
queryFn: () => S.request(
|
|
@@ -698,22 +699,22 @@ function tt({
|
|
|
698
699
|
).then((e) => e.data ?? []).catch(() => null),
|
|
699
700
|
staleTime: 5 * 6e4,
|
|
700
701
|
retry: !1
|
|
701
|
-
}), T =
|
|
702
|
+
}), T = pe(
|
|
702
703
|
() => new Map((U ?? (V == null ? void 0 : V.fields) ?? []).map((e) => [e.field, e])),
|
|
703
704
|
[U, V]
|
|
704
|
-
),
|
|
705
|
+
), xe = (V == null ? void 0 : V.relations) ?? [], ie = (e) => {
|
|
705
706
|
var l;
|
|
706
|
-
return ((l =
|
|
707
|
+
return ((l = xe.find(
|
|
707
708
|
(i) => i.many_collection === n && i.many_field === e && i.one_collection
|
|
708
709
|
)) == null ? void 0 : l.one_collection) ?? null;
|
|
709
|
-
}, z = (e) =>
|
|
710
|
+
}, z = (e) => xe.find(
|
|
710
711
|
(l) => l.one_collection === n && (l.one_field === e || l.many_collection === e)
|
|
711
|
-
) ?? null,
|
|
712
|
+
) ?? null, K = (e) => {
|
|
712
713
|
var l;
|
|
713
|
-
return !((e.is_visible === void 0 || e.is_visible) &&
|
|
714
|
+
return !((e.is_visible === void 0 || e.is_visible) && me(e.overrides).hidden !== !0 && !((l = T.get(e.field)) != null && l.hidden));
|
|
714
715
|
}, Y = x.assignments.filter(
|
|
715
|
-
(e) => !e.field.startsWith("__") && ($ || !
|
|
716
|
-
),
|
|
716
|
+
(e) => !e.field.startsWith("__") && ($ || !K(e))
|
|
717
|
+
), ye = x.assignments.filter(
|
|
717
718
|
(e) => e.field.startsWith("__widget_") && e.widget_id != null && ($ || e.is_visible === void 0 || !!e.is_visible)
|
|
718
719
|
), se = (e) => {
|
|
719
720
|
if (!e.input_bindings) return [];
|
|
@@ -722,13 +723,13 @@ function tt({
|
|
|
722
723
|
} catch {
|
|
723
724
|
return [];
|
|
724
725
|
}
|
|
725
|
-
},
|
|
726
|
+
}, Te = N || c ? x.assignments.filter(
|
|
726
727
|
(e) => e.field.startsWith("__") && !e.field.startsWith("__widget_") && ($ || e.is_visible === void 0 || !!e.is_visible)
|
|
727
|
-
).sort((e, l) => e.sort - l.sort) : [],
|
|
728
|
-
(i) => e === null ? i.group_key == null && l === "leading" ===
|
|
728
|
+
).sort((e, l) => e.sort - l.sort) : [], ve = ["__pipeline__", "__addendums__"], _e = new Set(ve), Fe = (e) => (N == null ? void 0 : N(e.field, e)) ?? (c ? /* @__PURE__ */ r("div", { className: "rounded-xl border border-dashed border-slate-300 bg-white px-5 py-3 text-[12px] font-medium text-slate-500 dark:border-slate-600 dark:bg-slate-900/40 dark:text-slate-400", children: e.label_override || je(e.field.replace(/^_+|_+$/g, "")) }) : null), de = (e, l = "trailing") => N || c ? Te.filter(
|
|
729
|
+
(i) => e === null ? i.group_key == null && l === "leading" === _e.has(i.field) : i.group_key === e
|
|
729
730
|
).sort(
|
|
730
|
-
(i, o) => l === "leading" && e === null ?
|
|
731
|
-
).map((i) => ({ key: i.field, a: i, node:
|
|
731
|
+
(i, o) => l === "leading" && e === null ? ve.indexOf(i.field) - ve.indexOf(o.field) : 0
|
|
732
|
+
).map((i) => ({ key: i.field, a: i, node: Fe(i) })).filter((i) => i.node != null) : [], ke = (e, l = "trailing") => {
|
|
732
733
|
const i = de(e, l);
|
|
733
734
|
return i.length === 0 ? null : /* @__PURE__ */ r(
|
|
734
735
|
"div",
|
|
@@ -738,24 +739,24 @@ function tt({
|
|
|
738
739
|
children: i.map((o) => /* @__PURE__ */ r("div", { children: q(
|
|
739
740
|
{ kind: "slot", field: o.a.field, group_key: o.a.group_key ?? null },
|
|
740
741
|
o.node,
|
|
741
|
-
|
|
742
|
+
K(o.a)
|
|
742
743
|
) }, o.key))
|
|
743
744
|
}
|
|
744
745
|
);
|
|
745
|
-
}, [
|
|
746
|
+
}, [De, Ne] = H({}), oe = (e) => $ || De[e] === !0, [Ce, t] = H({}), a = tt(
|
|
746
747
|
(e) => (l) => t((i) => i[e] === l ? i : { ...i, [e]: l }),
|
|
747
748
|
[]
|
|
748
|
-
), [s, m] =
|
|
749
|
+
), [s, m] = H({}), F = tt(
|
|
749
750
|
(e) => (l) => m((i) => i[e] === l ? i : { ...i, [e]: l }),
|
|
750
751
|
[]
|
|
751
752
|
), D = (e) => {
|
|
752
|
-
const l =
|
|
753
|
+
const l = ye.filter((o) => o.group_key === e).sort((o, b) => o.sort - b.sort);
|
|
753
754
|
if (l.length === 0) return null;
|
|
754
755
|
const i = l.some((o) => oe(o.field));
|
|
755
756
|
return /* @__PURE__ */ r("div", { className: i ? "mt-3 space-y-4" : "hidden", "data-read-widgets": !0, children: l.map((o) => /* @__PURE__ */ r("div", { hidden: !oe(o.field), children: q(
|
|
756
757
|
{ kind: "slot", field: o.field, group_key: o.group_key ?? null },
|
|
757
758
|
/* @__PURE__ */ r(
|
|
758
|
-
|
|
759
|
+
It,
|
|
759
760
|
{
|
|
760
761
|
widgetId: o.widget_id,
|
|
761
762
|
inputBindings: se(o),
|
|
@@ -764,40 +765,47 @@ function tt({
|
|
|
764
765
|
ready: !!_,
|
|
765
766
|
label: o.label_override ?? void 0,
|
|
766
767
|
defaultExpanded: o.default_expanded == null ? !0 : !!o.default_expanded,
|
|
767
|
-
onContentChange: (b) =>
|
|
768
|
-
(
|
|
768
|
+
onContentChange: (b) => Ne(
|
|
769
|
+
(I) => I[o.field] === b ? I : { ...I, [o.field]: b }
|
|
769
770
|
)
|
|
770
771
|
}
|
|
771
772
|
),
|
|
772
|
-
|
|
773
|
+
K(o)
|
|
773
774
|
) }, o.field)) });
|
|
774
|
-
},
|
|
775
|
+
}, G = [...x.groups].sort((e, l) => e.sort - l.sort).filter((e) => $ || e.visibility_mode !== "new_only"), [te, ce] = H(() => /* @__PURE__ */ new Set()), le = (e) => !e.is_collapsed || te.has(e.key), Le = (e) => ce((l) => {
|
|
775
776
|
const i = new Set(l);
|
|
776
777
|
return i.has(e) ? i.delete(e) : i.add(e), i;
|
|
777
|
-
}),
|
|
778
|
-
|
|
778
|
+
}), we = (c == null ? void 0 : c.context.fold) ?? null, Se = (c == null ? void 0 : c.context.reveal) ?? null;
|
|
779
|
+
he(() => {
|
|
780
|
+
we && ce(we.open ? new Set(x.groups.map((e) => e.key)) : /* @__PURE__ */ new Set());
|
|
781
|
+
}, [we == null ? void 0 : we.seq]), he(() => {
|
|
782
|
+
const e = Se ? Dt(Se.target) : null;
|
|
783
|
+
e && ce((l) => l.has(e) ? l : new Set(l).add(e));
|
|
784
|
+
}, [Se == null ? void 0 : Se.seq]);
|
|
785
|
+
const Ke = [];
|
|
786
|
+
for (const e of G) {
|
|
779
787
|
if (e.type === "container") {
|
|
780
|
-
for (const l of
|
|
781
|
-
|
|
788
|
+
for (const l of G.filter((i) => i.container_id != null && i.container_id === e.id))
|
|
789
|
+
Ke.push(l);
|
|
782
790
|
continue;
|
|
783
791
|
}
|
|
784
|
-
e.container_id == null &&
|
|
792
|
+
e.container_id == null && Ke.push(e);
|
|
785
793
|
}
|
|
786
|
-
const
|
|
794
|
+
const ue = (e) => {
|
|
787
795
|
var l;
|
|
788
796
|
return !!((l = z(e.field)) != null && l.junction_field);
|
|
789
|
-
},
|
|
797
|
+
}, Me = (e) => {
|
|
790
798
|
var i;
|
|
791
799
|
const l = String(
|
|
792
|
-
|
|
800
|
+
me(e.overrides).interface ?? ((i = T.get(e.field)) == null ? void 0 : i.interface) ?? ""
|
|
793
801
|
);
|
|
794
802
|
return /rich|wysiwyg|editorjs/i.test(l);
|
|
795
|
-
},
|
|
796
|
-
const l = T.get(e.field), i =
|
|
803
|
+
}, Ie = (e) => {
|
|
804
|
+
const l = T.get(e.field), i = me(e.overrides), o = z(e.field);
|
|
797
805
|
if (c && !g && (o != null && o.junction_field)) return /* @__PURE__ */ r(ee, {});
|
|
798
806
|
if (o != null && o.junction_field && o.many_collection && o.many_field)
|
|
799
807
|
return /* @__PURE__ */ r(
|
|
800
|
-
|
|
808
|
+
Et,
|
|
801
809
|
{
|
|
802
810
|
junction: o.many_collection,
|
|
803
811
|
parentFk: o.many_field,
|
|
@@ -808,29 +816,29 @@ function tt({
|
|
|
808
816
|
relation: o
|
|
809
817
|
}
|
|
810
818
|
);
|
|
811
|
-
const b = _ == null ? void 0 : _[e.field],
|
|
812
|
-
if (
|
|
813
|
-
return /* @__PURE__ */ r("span", { className: "inline-block", children: /* @__PURE__ */ r(
|
|
814
|
-
if (
|
|
819
|
+
const b = _ == null ? void 0 : _[e.field], I = ie(e.field);
|
|
820
|
+
if (I === "nivaro_users" && b != null)
|
|
821
|
+
return /* @__PURE__ */ r("span", { className: "inline-block", children: /* @__PURE__ */ r(at, { userId: String(b), size: "compact" }) });
|
|
822
|
+
if (I) return /* @__PURE__ */ r(Ee, { collection: I, id: b });
|
|
815
823
|
if (b == null || b === "") return /* @__PURE__ */ r(ee, {});
|
|
816
824
|
if ((l == null ? void 0 : l.type) === "boolean")
|
|
817
825
|
return /* @__PURE__ */ r(
|
|
818
|
-
|
|
826
|
+
st,
|
|
819
827
|
{
|
|
820
828
|
value: b,
|
|
821
829
|
trueTone: (i.options ?? {}).trueTone ?? "positive"
|
|
822
830
|
}
|
|
823
831
|
);
|
|
824
832
|
const P = i.options ?? {};
|
|
825
|
-
return
|
|
833
|
+
return Me(e) && typeof b == "string" ? /^\s*\{/.test(b) ? /* @__PURE__ */ r("div", { className: "whitespace-pre-wrap font-normal", children: At(b) }) : /* @__PURE__ */ r(
|
|
826
834
|
"div",
|
|
827
835
|
{
|
|
828
836
|
className: "rrv-prose font-normal leading-relaxed [&_a]:underline [&_h1]:text-[15px] [&_h1]:font-semibold [&_h2]:text-[14px] [&_h2]:font-semibold [&_h3]:font-semibold [&_li]:ml-4 [&_ol]:list-decimal [&_p]:my-1 [&_ul]:list-disc",
|
|
829
|
-
dangerouslySetInnerHTML: { __html:
|
|
837
|
+
dangerouslySetInnerHTML: { __html: qt(b) }
|
|
830
838
|
}
|
|
831
|
-
) : P.format === "currency" ? /* @__PURE__ */ r("span", { className: "tabular-nums", children:
|
|
832
|
-
},
|
|
833
|
-
const l =
|
|
839
|
+
) : P.format === "currency" ? /* @__PURE__ */ r("span", { className: "tabular-nums", children: We(b) }) : (l == null ? void 0 : l.type) === "decimal" || (l == null ? void 0 : l.type) === "float" ? /* @__PURE__ */ r("span", { className: "tabular-nums", children: Re(b) }) : (l == null ? void 0 : l.type) === "date" || (l == null ? void 0 : l.type) === "datetime" || (l == null ? void 0 : l.type) === "timestamp" ? it(b) : String(b);
|
|
840
|
+
}, dt = (e) => {
|
|
841
|
+
const l = me(e.overrides), i = z(e.field);
|
|
834
842
|
if (!(i != null && i.many_collection) || !i.many_field) return null;
|
|
835
843
|
if (c && !g) return /* @__PURE__ */ r("p", { className: "py-3 text-[12px] text-slate-400", children: "No records" });
|
|
836
844
|
const o = l.options ?? {}, b = (() => {
|
|
@@ -844,42 +852,42 @@ function tt({
|
|
|
844
852
|
return {};
|
|
845
853
|
}
|
|
846
854
|
return P;
|
|
847
|
-
})(),
|
|
855
|
+
})(), I = o.layout_id ?? null;
|
|
848
856
|
return /* @__PURE__ */ r(
|
|
849
|
-
|
|
857
|
+
Mt,
|
|
850
858
|
{
|
|
851
859
|
collection: i.many_collection,
|
|
852
860
|
fkField: i.many_field,
|
|
853
861
|
parentId: g,
|
|
854
|
-
layoutId:
|
|
862
|
+
layoutId: I,
|
|
855
863
|
presets: o.column_presets ?? b.column_presets,
|
|
856
864
|
defaultPreset: o.default_preset ?? b.default_preset ?? null,
|
|
857
865
|
onCount: a(e.field)
|
|
858
866
|
},
|
|
859
867
|
e.field
|
|
860
868
|
);
|
|
861
|
-
},
|
|
862
|
-
if (!_ ||
|
|
869
|
+
}, Oe = (e) => !!z(e.field) && !ue(e), ot = !!x.layout.hide_empty, Ue = Array.isArray(x.layout.header_fields) ? x.layout.header_fields.filter((e) => typeof e == "string") : [], ct = new Set(Ue), ut = (e) => {
|
|
870
|
+
if (!_ || ue(e)) return !1;
|
|
863
871
|
const l = _[e.field];
|
|
864
872
|
return l == null || l === "" || Array.isArray(l) && l.length === 0;
|
|
865
|
-
},
|
|
873
|
+
}, mt = (e) => Y.find((l) => l.field === e), Ae = (e) => {
|
|
866
874
|
var i;
|
|
867
|
-
const l =
|
|
868
|
-
return typeof l == "string" && l.trim() ? l : e.label_override || ((i = T.get(e.field)) == null ? void 0 : i.label) ||
|
|
869
|
-
},
|
|
870
|
-
const l = Y.filter((d) => d.group_key === e.key && !
|
|
875
|
+
const l = me(e.overrides).label;
|
|
876
|
+
return typeof l == "string" && l.trim() ? l : e.label_override || ((i = T.get(e.field)) == null ? void 0 : i.label) || je(e.field);
|
|
877
|
+
}, ft = (e) => {
|
|
878
|
+
const l = Y.filter((d) => d.group_key === e.key && !ct.has(d.field)).sort((d, Z) => d.sort - Z.sort), i = ye.filter((d) => d.group_key === e.key), o = de(e.key), b = l.length === 0 && i.length === 0 && o.length === 0;
|
|
871
879
|
if (b && !c) return null;
|
|
872
|
-
const
|
|
880
|
+
const I = (d) => ot && !$ && (Oe(d) || ue(d)) && ((h == null ? void 0 : h[d.field]) ?? Ce[d.field]) === 0, P = l.filter((d) => !Oe(d)), re = l.filter(Oe), ht = i.filter((d) => oe(d.field)), gt = l.filter((d) => !I(d)), bt = !b && gt.length === 0 && o.length === 0 && ht.length === 0, He = e.read_width === "full" || e.read_width === "half" || e.read_width === "third" ? e.read_width : re.length > 0 || i.length > 0 || o.length > 0 || P.length > 4 ? "full" : "half";
|
|
873
881
|
return /* @__PURE__ */ r(
|
|
874
882
|
"section",
|
|
875
883
|
{
|
|
876
|
-
hidden:
|
|
884
|
+
hidden: bt,
|
|
877
885
|
"data-read-section": e.key,
|
|
878
|
-
"data-read-width":
|
|
886
|
+
"data-read-width": He,
|
|
879
887
|
className: "min-w-0 rounded-xl border border-slate-200 bg-white dark:border-slate-700/60 dark:bg-slate-900/40",
|
|
880
888
|
children: q(
|
|
881
889
|
{ kind: "group", key: e.key },
|
|
882
|
-
/* @__PURE__ */ f(
|
|
890
|
+
/* @__PURE__ */ f(fe, { children: [
|
|
883
891
|
/* @__PURE__ */ f(
|
|
884
892
|
"h3",
|
|
885
893
|
{
|
|
@@ -889,7 +897,7 @@ function tt({
|
|
|
889
897
|
"button",
|
|
890
898
|
{
|
|
891
899
|
type: "button",
|
|
892
|
-
onClick: () =>
|
|
900
|
+
onClick: () => Le(e.key),
|
|
893
901
|
"aria-expanded": le(e),
|
|
894
902
|
className: "min-w-0 flex-1 text-left uppercase after:absolute after:inset-0 group-hover/rs:text-slate-700 dark:group-hover/rs:text-slate-200",
|
|
895
903
|
children: e.label
|
|
@@ -907,11 +915,11 @@ function tt({
|
|
|
907
915
|
title: `Edit ${e.label}`,
|
|
908
916
|
"aria-label": `Edit ${e.label}`,
|
|
909
917
|
className: "relative -my-1 rounded p-1 text-slate-400 opacity-0 transition-opacity hover:bg-slate-100 hover:text-slate-700 focus-visible:opacity-100 group-hover/rs:opacity-100 dark:hover:bg-white/5 dark:hover:text-slate-200 motion-reduce:transition-none",
|
|
910
|
-
children: /* @__PURE__ */ r(
|
|
918
|
+
children: /* @__PURE__ */ r(yt, { className: "h-3 w-3" })
|
|
911
919
|
}
|
|
912
920
|
),
|
|
913
921
|
e.is_collapsed && /* @__PURE__ */ r(
|
|
914
|
-
|
|
922
|
+
vt,
|
|
915
923
|
{
|
|
916
924
|
"aria-hidden": "true",
|
|
917
925
|
className: `pointer-events-none h-3.5 w-3.5 shrink-0 transition-transform group-hover/rs:text-slate-700 dark:group-hover/rs:text-slate-200 ${le(e) ? "" : "-rotate-90"}`
|
|
@@ -924,19 +932,19 @@ function tt({
|
|
|
924
932
|
P.length > 0 && // One column rhythm for the whole page: every section's facts sit
|
|
925
933
|
// on the same 2 / 3 / 4 / 6 tracks, so values line up card to
|
|
926
934
|
// card instead of each card auto-filling its own grid.
|
|
927
|
-
/* @__PURE__ */ r("dl", { className: "grid gap-x-6 gap-y-5", "data-read-dl":
|
|
928
|
-
var
|
|
929
|
-
if (
|
|
930
|
-
const
|
|
935
|
+
/* @__PURE__ */ r("dl", { className: "grid gap-x-6 gap-y-5", "data-read-dl": He, children: P.map((d) => {
|
|
936
|
+
var Xe, Ze, et;
|
|
937
|
+
if (I(d)) return null;
|
|
938
|
+
const Qe = !!(me(d.overrides).options ?? {}).emphasis, Pe = Me(d) || !!((Ze = (Xe = T.get(d.field)) == null ? void 0 : Xe.interface) != null && Ze.includes("rich-text")), ze = _ == null ? void 0 : _[d.field], Ye = !Pe && !ue(d) && !ie(d.field) && (String(((et = T.get(d.field)) == null ? void 0 : et.interface) ?? "").includes("textarea") || typeof ze == "string" && ze.length > 36);
|
|
931
939
|
return /* @__PURE__ */ r(
|
|
932
940
|
"div",
|
|
933
941
|
{
|
|
934
|
-
className: `min-w-0 ${
|
|
942
|
+
className: `min-w-0 ${Pe || ue(d) && (s[d.field] === "nivaro_files" || (Ce[d.field] ?? 0) > 3) ? "col-span-full" : Qe || Ye ? "col-span-2" : ""}`,
|
|
935
943
|
children: q(
|
|
936
944
|
C(d),
|
|
937
|
-
/* @__PURE__ */ f(
|
|
945
|
+
/* @__PURE__ */ f(fe, { children: [
|
|
938
946
|
/* @__PURE__ */ f("dt", { className: "text-[10px] font-semibold uppercase tracking-wide text-slate-400", children: [
|
|
939
|
-
|
|
947
|
+
Ae(d),
|
|
940
948
|
/* @__PURE__ */ r(A, { field: d.field }),
|
|
941
949
|
E(d.field)
|
|
942
950
|
] }),
|
|
@@ -946,12 +954,12 @@ function tt({
|
|
|
946
954
|
"data-replay-field": d.field,
|
|
947
955
|
"data-field-collection": n,
|
|
948
956
|
"data-remote-changed": M.has(d.field) || void 0,
|
|
949
|
-
className: `mt-1 min-w-0${
|
|
950
|
-
children: _ ?
|
|
957
|
+
className: `mt-1 min-w-0${be(d.field)} ${Qe ? "text-[17px] font-semibold tracking-[-0.01em] text-slate-900 dark:text-white" : `${ue(d) || Pe ? "" : Ye ? "line-clamp-3 break-words " : "truncate "}text-[13px] font-medium text-slate-800 dark:text-slate-100`}`,
|
|
958
|
+
children: _ ? Ie(d) : /* @__PURE__ */ r("span", { className: "inline-block h-3.5 w-20 animate-pulse rounded bg-slate-100 dark:bg-[hsl(var(--nvr-skeleton))]" })
|
|
951
959
|
}
|
|
952
960
|
)
|
|
953
961
|
] }),
|
|
954
|
-
|
|
962
|
+
K(d)
|
|
955
963
|
)
|
|
956
964
|
},
|
|
957
965
|
d.field
|
|
@@ -963,12 +971,12 @@ function tt({
|
|
|
963
971
|
"div",
|
|
964
972
|
{
|
|
965
973
|
className: P.length > 0 ? "mt-3" : "",
|
|
966
|
-
hidden:
|
|
974
|
+
hidden: I(d),
|
|
967
975
|
children: q(
|
|
968
976
|
C(d),
|
|
969
|
-
/* @__PURE__ */ f(
|
|
977
|
+
/* @__PURE__ */ f(fe, { children: [
|
|
970
978
|
(Z = y == null ? void 0 : y.get(d.field)) != null && Z.length ? /* @__PURE__ */ f("div", { className: "mb-1.5 flex items-center gap-1.5 text-[11px] font-medium text-amber-700 dark:text-amber-300", children: [
|
|
971
|
-
/* @__PURE__ */ r("span", { className: "uppercase tracking-wide", children:
|
|
979
|
+
/* @__PURE__ */ r("span", { className: "uppercase tracking-wide", children: Ae(d) }),
|
|
972
980
|
/* @__PURE__ */ r(A, { field: d.field }),
|
|
973
981
|
/* @__PURE__ */ f("span", { className: "font-normal text-amber-700/80 dark:text-amber-300/80", children: [
|
|
974
982
|
"— ",
|
|
@@ -978,16 +986,16 @@ function tt({
|
|
|
978
986
|
"; switch to Edit to fix"
|
|
979
987
|
] })
|
|
980
988
|
] }) : null,
|
|
981
|
-
(j ? j(d) : null) ??
|
|
989
|
+
(j ? j(d) : null) ?? dt(d)
|
|
982
990
|
] }),
|
|
983
|
-
|
|
991
|
+
K(d)
|
|
984
992
|
)
|
|
985
993
|
},
|
|
986
994
|
d.field
|
|
987
995
|
);
|
|
988
996
|
}),
|
|
989
997
|
D(e.key),
|
|
990
|
-
|
|
998
|
+
ke(e.key),
|
|
991
999
|
b && c && /* @__PURE__ */ r(
|
|
992
1000
|
"div",
|
|
993
1001
|
{
|
|
@@ -1003,14 +1011,14 @@ function tt({
|
|
|
1003
1011
|
},
|
|
1004
1012
|
e.key
|
|
1005
1013
|
);
|
|
1006
|
-
},
|
|
1014
|
+
}, Be = ke(null), pt = ke(null, "leading"), Ve = Ue.map((e) => mt(e)).filter((e) => !!e && !Oe(e)).filter((e) => $ || !ut(e)), [X, ...Je] = Ve;
|
|
1007
1015
|
return /* @__PURE__ */ f(
|
|
1008
1016
|
"div",
|
|
1009
1017
|
{
|
|
1010
1018
|
className: L ? "min-h-0 flex-1" : "min-h-0 flex-1 overflow-y-auto bg-slate-50/60 px-5 py-4 dark:bg-transparent",
|
|
1011
1019
|
children: [
|
|
1012
|
-
|
|
1013
|
-
|
|
1020
|
+
pt,
|
|
1021
|
+
Ve.length > 0 && /* @__PURE__ */ f(
|
|
1014
1022
|
"div",
|
|
1015
1023
|
{
|
|
1016
1024
|
"data-read-header": !0,
|
|
@@ -1020,7 +1028,7 @@ function tt({
|
|
|
1020
1028
|
{ kind: "header", field: X.field },
|
|
1021
1029
|
/* @__PURE__ */ f("div", { className: "min-w-0", children: [
|
|
1022
1030
|
/* @__PURE__ */ f("p", { className: "text-[10px] font-semibold uppercase tracking-wide text-slate-400", children: [
|
|
1023
|
-
|
|
1031
|
+
Ae(X),
|
|
1024
1032
|
/* @__PURE__ */ r(A, { field: X.field })
|
|
1025
1033
|
] }),
|
|
1026
1034
|
/* @__PURE__ */ r(
|
|
@@ -1028,18 +1036,18 @@ function tt({
|
|
|
1028
1036
|
{
|
|
1029
1037
|
"data-replay-field": X.field,
|
|
1030
1038
|
"data-field-collection": n,
|
|
1031
|
-
className: `truncate text-[22px] font-semibold leading-tight tracking-[-0.015em] text-slate-900 dark:text-white${
|
|
1032
|
-
children: _ ?
|
|
1039
|
+
className: `truncate text-[22px] font-semibold leading-tight tracking-[-0.015em] text-slate-900 dark:text-white${be(X.field)}`,
|
|
1040
|
+
children: _ ? Ie(X) : "…"
|
|
1033
1041
|
}
|
|
1034
1042
|
)
|
|
1035
1043
|
] }),
|
|
1036
|
-
|
|
1044
|
+
K(X)
|
|
1037
1045
|
),
|
|
1038
|
-
|
|
1046
|
+
Je.length > 0 && /* @__PURE__ */ r("dl", { className: "mt-3 flex flex-wrap gap-x-8 gap-y-2", children: Je.map((e) => /* @__PURE__ */ r("div", { className: "min-w-0", children: q(
|
|
1039
1047
|
{ kind: "header", field: e.field },
|
|
1040
|
-
/* @__PURE__ */ f(
|
|
1048
|
+
/* @__PURE__ */ f(fe, { children: [
|
|
1041
1049
|
/* @__PURE__ */ f("dt", { className: "text-[10px] font-semibold uppercase tracking-wide text-slate-400", children: [
|
|
1042
|
-
|
|
1050
|
+
Ae(e),
|
|
1043
1051
|
/* @__PURE__ */ r(A, { field: e.field }),
|
|
1044
1052
|
E(e.field)
|
|
1045
1053
|
] }),
|
|
@@ -1049,30 +1057,30 @@ function tt({
|
|
|
1049
1057
|
"data-replay-field": e.field,
|
|
1050
1058
|
"data-field-collection": n,
|
|
1051
1059
|
"data-remote-changed": M.has(e.field) || void 0,
|
|
1052
|
-
className: `mt-0.5 truncate text-[13px] font-medium text-slate-800 dark:text-slate-100${
|
|
1053
|
-
children: _ ?
|
|
1060
|
+
className: `mt-0.5 truncate text-[13px] font-medium text-slate-800 dark:text-slate-100${be(e.field)}`,
|
|
1061
|
+
children: _ ? Ie(e) : "…"
|
|
1054
1062
|
}
|
|
1055
1063
|
)
|
|
1056
1064
|
] }),
|
|
1057
|
-
|
|
1065
|
+
K(e)
|
|
1058
1066
|
) }, e.field)) })
|
|
1059
1067
|
]
|
|
1060
1068
|
}
|
|
1061
1069
|
),
|
|
1062
|
-
/* @__PURE__ */ r("style", { children:
|
|
1063
|
-
V ? /* @__PURE__ */ r("div", { className: "grid items-stretch gap-4", "data-read-board": !0, children:
|
|
1070
|
+
/* @__PURE__ */ r("style", { children: Pt }),
|
|
1071
|
+
V ? /* @__PURE__ */ r("div", { className: "grid items-stretch gap-4", "data-read-board": !0, children: Ke.map(ft) }) : /* @__PURE__ */ f("div", { className: "flex flex-col gap-4", "data-read-board-pending": !0, children: [
|
|
1064
1072
|
/* @__PURE__ */ r("div", { className: "h-32 animate-pulse rounded-xl bg-slate-100 dark:bg-[hsl(var(--nvr-skeleton))]" }),
|
|
1065
1073
|
/* @__PURE__ */ r("div", { className: "h-32 animate-pulse rounded-xl bg-slate-100 dark:bg-[hsl(var(--nvr-skeleton))]" }),
|
|
1066
1074
|
/* @__PURE__ */ r("div", { className: "h-56 animate-pulse rounded-xl bg-slate-100 dark:bg-[hsl(var(--nvr-skeleton))]" })
|
|
1067
1075
|
] }),
|
|
1068
|
-
|
|
1076
|
+
Be && /* @__PURE__ */ r("div", { className: "mt-4", children: Be })
|
|
1069
1077
|
]
|
|
1070
1078
|
}
|
|
1071
1079
|
);
|
|
1072
1080
|
}
|
|
1073
|
-
function
|
|
1074
|
-
return n.design ? /* @__PURE__ */ r(
|
|
1081
|
+
function fl(n) {
|
|
1082
|
+
return n.design ? /* @__PURE__ */ r(Tt, { design: n.design.context, onRefusedWrite: n.design.onRefusedWrite, children: /* @__PURE__ */ r(kt.Provider, { value: null, children: /* @__PURE__ */ r(rt, { ...n }) }) }) : /* @__PURE__ */ r(rt, { ...n });
|
|
1075
1083
|
}
|
|
1076
1084
|
export {
|
|
1077
|
-
|
|
1085
|
+
fl as RecordReadView
|
|
1078
1086
|
};
|