@ai-matrx/detail 0.1.177 → 0.1.178
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/CHANGELOG.md +15 -2
- package/dist/DetailLinked-57SRZLYJ.js +18 -0
- package/dist/DetailLinked-57SRZLYJ.js.map +1 -0
- package/dist/react.cjs +147 -103
- package/dist/react.cjs.map +1 -1
- package/dist/react.js +22 -13
- package/dist/react.js.map +1 -1
- package/package.json +13 -2
package/dist/react.js
CHANGED
|
@@ -714,13 +714,9 @@ function DetailActions({ core, optional = "inline" }) {
|
|
|
714
714
|
}
|
|
715
715
|
|
|
716
716
|
// src/react/DetailBody.tsx
|
|
717
|
-
import { useEffect as useEffect7, useRef as useRef6, useState as useState5 } from "react";
|
|
717
|
+
import { lazy, Suspense, useEffect as useEffect7, useRef as useRef6, useState as useState5 } from "react";
|
|
718
718
|
import { cn as cn3, ErrorActions as ErrorActions2, Skeleton } from "@ai-matrx/design-system";
|
|
719
|
-
import {
|
|
720
|
-
ASSOCIATION_TARGET_TYPES,
|
|
721
|
-
isEntityTypeToken
|
|
722
|
-
} from "@ai-matrx/associations";
|
|
723
|
-
import { AssociationCardGrid, PrimaryEntityProvider } from "@ai-matrx/associations/react";
|
|
719
|
+
import { ASSOCIATION_TARGET_TYPES } from "@ai-matrx/associations/contracts";
|
|
724
720
|
import { formatDurationMs } from "@ai-matrx/kit/format";
|
|
725
721
|
|
|
726
722
|
// src/format.ts
|
|
@@ -1161,18 +1157,28 @@ function LoadingFields({ core, label }) {
|
|
|
1161
1157
|
function isAssociationTarget(token) {
|
|
1162
1158
|
return ASSOCIATION_TARGET_TYPES.includes(token);
|
|
1163
1159
|
}
|
|
1160
|
+
var loadDetailLinked = () => import("./DetailLinked-57SRZLYJ.js");
|
|
1161
|
+
var DetailLinked = lazy(loadDetailLinked);
|
|
1164
1162
|
function AssociationsSection({ core }) {
|
|
1165
1163
|
const host = useDetailHost();
|
|
1166
1164
|
const token = core.entityToken;
|
|
1167
1165
|
if (!token || !isAssociationTarget(token) || !host.associations.canAnchor(token)) return null;
|
|
1168
1166
|
if (core.recordType?.associationTokens === null) return null;
|
|
1169
|
-
const wanted = core.recordType?.associationTokens ?? host.associations.defaultTokens
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1167
|
+
const wanted = (core.recordType?.associationTokens ?? host.associations.defaultTokens).filter(
|
|
1168
|
+
(t) => t !== token
|
|
1169
|
+
);
|
|
1170
|
+
if (wanted.length === 0) return null;
|
|
1171
|
+
const heading = /* @__PURE__ */ jsx3(SectionHeading, { icon: /* @__PURE__ */ jsx3(Link2Icon, { className: "h-3 w-3" }), children: "Linked" });
|
|
1172
|
+
return /* @__PURE__ */ jsx3(
|
|
1173
|
+
Suspense,
|
|
1174
|
+
{
|
|
1175
|
+
fallback: /* @__PURE__ */ jsxs3("section", { className: "space-y-2", "data-detail-section": "associations", "aria-busy": "true", children: [
|
|
1176
|
+
heading,
|
|
1177
|
+
/* @__PURE__ */ jsx3(Skeleton, { className: "h-16 w-full" })
|
|
1178
|
+
] }),
|
|
1179
|
+
children: /* @__PURE__ */ jsx3(DetailLinked, { token, id: core.ref.id, label: core.title, wanted, heading })
|
|
1180
|
+
}
|
|
1181
|
+
);
|
|
1176
1182
|
}
|
|
1177
1183
|
var ACTOR_COLUMNS = ["actor_id", "user_id", "person_id", "created_by_id"];
|
|
1178
1184
|
function HistorySection({ core }) {
|
|
@@ -1257,6 +1263,9 @@ function CustomFieldsPort({ core }) {
|
|
|
1257
1263
|
return /* @__PURE__ */ jsx3(Section, { token, id: core.ref.id });
|
|
1258
1264
|
}
|
|
1259
1265
|
function DetailBody({ core }) {
|
|
1266
|
+
useEffect7(() => {
|
|
1267
|
+
loadDetailLinked().catch(() => void 0);
|
|
1268
|
+
}, []);
|
|
1260
1269
|
const extra = core.recordType?.extraSections && core.frameCtx ? core.recordType.extraSections(core.row, core.frameCtx) : [];
|
|
1261
1270
|
const Frame = core.recordType?.Frame ?? null;
|
|
1262
1271
|
const body = (
|