@ai-matrx/detail 0.1.67 → 0.1.68

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 CHANGED
@@ -1,5 +1,14 @@
1
1
  # Changelog — @ai-matrx/detail
2
2
 
3
+ ## 0.1.68
4
+ ### Custom fields on every record view (lane 7 STANDARD-TABLES W5)
5
+
6
+ - `DetailHostPorts.customFields?: { Section: ComponentType<{ token; id }> }` — the host binds the
7
+ organization's custom-fields section once; `DetailBody` renders it after Fields for every record
8
+ with an `entityToken` (window, docked, page, and a peek that renders the body).
9
+ - Consumer action: bind `customFields.Section` in the host (matrx-frontend `DetailHost.tsx`). Optional;
10
+ an unbound host shows no section.
11
+
3
12
  ## 0.1.67
4
13
 
5
14
  Automatic changed-only republish (docs/metadata drift since the last tag — see
@@ -475,6 +475,23 @@ interface DetailHostPorts {
475
475
  row: DetailRow | null;
476
476
  }>;
477
477
  };
478
+ /**
479
+ * 🚨 CUSTOM FIELDS ON EVERY RECORD VIEW (lane 7 STANDARD-TABLES W5). The ONE
480
+ * place a window, a docked panel, the `/detail` page and a record peek get the
481
+ * organization's own fields for a standard record: the host binds its section
482
+ * once, and the body renders it after Fields whenever the record has an
483
+ * `entityToken`. The section is given only the token and the id — it reads the
484
+ * row's organization itself (never the active organization) and says in one
485
+ * line why it shows nothing, so it is never silently absent. A peek binds a
486
+ * compact section through a nested provider (providers merge). Optional: a
487
+ * host without custom fields binds nothing and the section is absent.
488
+ */
489
+ customFields?: {
490
+ Section: ComponentType<{
491
+ token: string;
492
+ id: string;
493
+ }>;
494
+ };
478
495
  notify: {
479
496
  error: (message: string) => void;
480
497
  success: (message: string) => void;
@@ -475,6 +475,23 @@ interface DetailHostPorts {
475
475
  row: DetailRow | null;
476
476
  }>;
477
477
  };
478
+ /**
479
+ * 🚨 CUSTOM FIELDS ON EVERY RECORD VIEW (lane 7 STANDARD-TABLES W5). The ONE
480
+ * place a window, a docked panel, the `/detail` page and a record peek get the
481
+ * organization's own fields for a standard record: the host binds its section
482
+ * once, and the body renders it after Fields whenever the record has an
483
+ * `entityToken`. The section is given only the token and the id — it reads the
484
+ * row's organization itself (never the active organization) and says in one
485
+ * line why it shows nothing, so it is never silently absent. A peek binds a
486
+ * compact section through a nested provider (providers merge). Optional: a
487
+ * host without custom fields binds nothing and the section is absent.
488
+ */
489
+ customFields?: {
490
+ Section: ComponentType<{
491
+ token: string;
492
+ id: string;
493
+ }>;
494
+ };
478
495
  notify: {
479
496
  error: (message: string) => void;
480
497
  success: (message: string) => void;
package/dist/react.cjs CHANGED
@@ -1453,6 +1453,13 @@ function HistorySection({ core }) {
1453
1453
  )) })
1454
1454
  ] });
1455
1455
  }
1456
+ function CustomFieldsPort({ core }) {
1457
+ const host = useDetailHost();
1458
+ const Section = host.customFields?.Section;
1459
+ const token = core.entityToken;
1460
+ if (!Section || !token) return null;
1461
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Section, { token, id: core.ref.id });
1462
+ }
1456
1463
  function DetailBody({ core }) {
1457
1464
  const extra = core.recordType?.extraSections && core.frameCtx ? core.recordType.extraSections(core.row, core.frameCtx) : [];
1458
1465
  const Frame = core.recordType?.Frame ?? null;
@@ -1466,6 +1473,7 @@ function DetailBody({ core }) {
1466
1473
  /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "space-y-6 p-4", children: [
1467
1474
  /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(FieldsSection, { core }),
1468
1475
  core.status === "ready" || core.status === "none" ? /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
1476
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(CustomFieldsPort, { core }),
1469
1477
  /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(AssociationsSection, { core }),
1470
1478
  /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(HistorySection, { core }),
1471
1479
  extra.map((section) => /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("section", { className: "space-y-2", "data-detail-section": section.id, children: [