@ai-matrx/records-ui 0.95.19 → 0.98.3

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/pickers.cjs CHANGED
@@ -4572,8 +4572,21 @@ function KindValueCell({
4572
4572
  return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: (0, import_design_system19.cn)("flex min-w-0 flex-wrap gap-1"), "data-records-kind-value": kv.kind, title: JSON.stringify(kv.value), children: named.length > 0 ? named.map((w, i) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_design_system19.Badge, { variant: "secondary", className: "px-1.5 py-0 text-[11px] font-normal", children: w }, `${w}-${i}`)) : /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_design_system19.Badge, { variant: "outline", className: "px-1.5 py-0 text-[11px] font-normal", children: kindLabel(kv.kind) }) });
4573
4573
  }
4574
4574
 
4575
- // src/values.tsx
4575
+ // src/formulaNames.ts
4576
4576
  var import_records14 = require("@ai-matrx/records");
4577
+ var FORMULA_INPUT_KEYS = "__formula_input_keys";
4578
+ function formulaSourceArchived(field, document2) {
4579
+ const keys = (field.config ?? {})[FORMULA_INPUT_KEYS];
4580
+ if (!Array.isArray(keys) || !document2) return null;
4581
+ for (const key of keys) {
4582
+ const state = (0, import_records14.sourceArchivedOf)(document2[String(key)]);
4583
+ if (state) return state;
4584
+ }
4585
+ return null;
4586
+ }
4587
+
4588
+ // src/values.tsx
4589
+ var import_records15 = require("@ai-matrx/records");
4577
4590
  var import_jsx_runtime23 = require("react/jsx-runtime");
4578
4591
  function statusMark(field, item, document2) {
4579
4592
  const mark = statusMarkOf(field, item, document2);
@@ -4627,7 +4640,7 @@ function SourceArchivedValue({ state }) {
4627
4640
  }
4628
4641
  var ABSENCE_WORDS = ABSENCE_WORD_LABEL;
4629
4642
  function renderValue(field, value, document2, labels, stillWaitingFor) {
4630
- const archivedSource = (0, import_records14.sourceArchivedOf)(value);
4643
+ const archivedSource = (0, import_records15.sourceArchivedOf)(value);
4631
4644
  if (archivedSource) return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(SourceArchivedValue, { state: archivedSource });
4632
4645
  const envelope = envelopeFor(document2, field.key);
4633
4646
  if (envelope?.absent) {
@@ -4638,6 +4651,8 @@ function renderValue(field, value, document2, labels, stillWaitingFor) {
4638
4651
  if (gone) {
4639
4652
  return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "text-xs italic text-muted-foreground", title: `It pointed at ${gone}`, children: "The record this pointed at no longer exists" });
4640
4653
  }
4654
+ const archivedInput = formulaSourceArchived(field, document2);
4655
+ if (archivedInput) return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(SourceArchivedValue, { state: archivedInput });
4641
4656
  const computed = computedEmptyOf(field, document2);
4642
4657
  if (computed?.sentence) return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "text-xs italic text-muted-foreground", children: computed.sentence });
4643
4658
  if (computed?.words) return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { "data-records-empty-why": computed.kind, children: computed.words });
@@ -4728,9 +4743,9 @@ function renderValue(field, value, document2, labels, stillWaitingFor) {
4728
4743
  }
4729
4744
  function scalarText(field, value, labels, stillWaitingFor) {
4730
4745
  if (value === null || value === void 0) return "\u2014";
4731
- if ((0, import_records14.sourceArchivedOf)(value)) return SOURCE_ARCHIVED_WORDS;
4746
+ if ((0, import_records15.sourceArchivedOf)(value)) return SOURCE_ARCHIVED_WORDS;
4732
4747
  if (isSignatureField(field)) return signatureWords(value) ?? "\u2014";
4733
- const newerWords = (0, import_records14.newerKindWords)(field, value);
4748
+ const newerWords = (0, import_records15.newerKindWords)(field, value);
4734
4749
  if (newerWords !== null) return newerWords;
4735
4750
  const kind = editorKindFor(field);
4736
4751
  if (kind === "entity_reference") return entityReferenceText(value);