strapi-plugin-bulk-updater 1.6.10 → 1.6.11

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.
Files changed (25) hide show
  1. package/dist/_chunks/{BulkUpdater-BY8IXT4R.js → BulkUpdater-BSlEEUTV.js} +292 -115
  2. package/dist/_chunks/BulkUpdater-BSlEEUTV.js.map +1 -0
  3. package/dist/_chunks/{BulkUpdater-DISkZC1Y.mjs → BulkUpdater-CFStXO-q.mjs} +294 -117
  4. package/dist/_chunks/BulkUpdater-CFStXO-q.mjs.map +1 -0
  5. package/dist/_chunks/{SettingsPage-vH-eanBJ.js → SettingsPage-BgEO2BNP.js} +2 -2
  6. package/dist/_chunks/{SettingsPage-vH-eanBJ.js.map → SettingsPage-BgEO2BNP.js.map} +1 -1
  7. package/dist/_chunks/{SettingsPage-D9vD1BKo.mjs → SettingsPage-BrfS4_qy.mjs} +2 -2
  8. package/dist/_chunks/{SettingsPage-D9vD1BKo.mjs.map → SettingsPage-BrfS4_qy.mjs.map} +1 -1
  9. package/dist/_chunks/{ValidationRulesTab-DdwR3lWq.mjs → ValidationRulesTab-BslJyrBj.mjs} +2 -2
  10. package/dist/_chunks/{ValidationRulesTab-DdwR3lWq.mjs.map → ValidationRulesTab-BslJyrBj.mjs.map} +1 -1
  11. package/dist/_chunks/{ValidationRulesTab-r6S-ZFDp.js → ValidationRulesTab-Cs0YDlMx.js} +2 -2
  12. package/dist/_chunks/{ValidationRulesTab-r6S-ZFDp.js.map → ValidationRulesTab-Cs0YDlMx.js.map} +1 -1
  13. package/dist/_chunks/{index-AXTojFac.mjs → index-4eNIGyGu.mjs} +3 -3
  14. package/dist/_chunks/{index-AXTojFac.mjs.map → index-4eNIGyGu.mjs.map} +1 -1
  15. package/dist/_chunks/{index-aoOgZpZE.js → index-CjR6IZqM.js} +3 -3
  16. package/dist/_chunks/{index-aoOgZpZE.js.map → index-CjR6IZqM.js.map} +1 -1
  17. package/dist/admin/index.js +1 -1
  18. package/dist/admin/index.mjs +1 -1
  19. package/dist/server/index.js +135 -12
  20. package/dist/server/index.js.map +1 -1
  21. package/dist/server/index.mjs +135 -12
  22. package/dist/server/index.mjs.map +1 -1
  23. package/package.json +1 -1
  24. package/dist/_chunks/BulkUpdater-BY8IXT4R.js.map +0 -1
  25. package/dist/_chunks/BulkUpdater-DISkZC1Y.mjs.map +0 -1
@@ -5,7 +5,7 @@ const React = require("react");
5
5
  const admin = require("@strapi/strapi/admin");
6
6
  const designSystem = require("@strapi/design-system");
7
7
  const icons = require("@strapi/icons");
8
- const ValidationRulesTab = require("./ValidationRulesTab-r6S-ZFDp.js");
8
+ const ValidationRulesTab = require("./ValidationRulesTab-Cs0YDlMx.js");
9
9
  const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
10
10
  const React__default = /* @__PURE__ */ _interopDefault(React);
11
11
  function parseCsvRows(csvText) {
@@ -537,6 +537,113 @@ function areClientValuesEqual(a, b) {
537
537
  }
538
538
  return String(na) === String(nb);
539
539
  }
540
+ const relationLabelRegistry = /* @__PURE__ */ new Map();
541
+ function registerRelationLabel(key, label) {
542
+ if (key !== void 0 && key !== null && label && typeof label === "string" && label.trim()) {
543
+ relationLabelRegistry.set(String(key).trim(), label.trim());
544
+ }
545
+ }
546
+ function registerRelationOptions(options) {
547
+ if (Array.isArray(options)) {
548
+ for (const opt of options) {
549
+ if (opt && opt.label) {
550
+ if (opt.documentId) registerRelationLabel(opt.documentId, opt.label);
551
+ if (opt.id !== void 0 && opt.id !== null) registerRelationLabel(opt.id, opt.label);
552
+ }
553
+ }
554
+ }
555
+ }
556
+ function getCachedRelationLabel(key) {
557
+ if (key === void 0 || key === null) return void 0;
558
+ return relationLabelRegistry.get(String(key).trim());
559
+ }
560
+ function resolveEntityLabel(item, options) {
561
+ if (item === void 0 || item === null) return "";
562
+ if (typeof item !== "object") {
563
+ const s = String(item).trim();
564
+ if (options && Array.isArray(options)) {
565
+ const match = options.find((o) => o.documentId === s || String(o.id) === s);
566
+ if (match?.label) return match.label.trim();
567
+ }
568
+ const cached = getCachedRelationLabel(s);
569
+ if (cached) return cached;
570
+ return s;
571
+ }
572
+ if (item.label && typeof item.label === "string" && item.label.trim()) {
573
+ return item.label.trim();
574
+ }
575
+ const candidateFields = [
576
+ "name",
577
+ "title",
578
+ "authorName",
579
+ "label",
580
+ "heading",
581
+ "subject",
582
+ "fullName",
583
+ "username",
584
+ "email",
585
+ "slug"
586
+ ];
587
+ for (const field of candidateFields) {
588
+ if (item[field] !== void 0 && item[field] !== null && String(item[field]).trim() !== "") {
589
+ const resolved = String(item[field]).trim();
590
+ if (item.documentId) registerRelationLabel(item.documentId, resolved);
591
+ if (item.id !== void 0 && item.id !== null) registerRelationLabel(item.id, resolved);
592
+ return resolved;
593
+ }
594
+ }
595
+ if (item.firstname || item.lastname) {
596
+ const fn = [item.firstname, item.lastname].filter(Boolean).join(" ").trim();
597
+ if (fn) {
598
+ if (item.documentId) registerRelationLabel(item.documentId, fn);
599
+ if (item.id !== void 0 && item.id !== null) registerRelationLabel(item.id, fn);
600
+ return fn;
601
+ }
602
+ }
603
+ const systemKeys = /* @__PURE__ */ new Set([
604
+ "id",
605
+ "documentId",
606
+ "createdAt",
607
+ "updatedAt",
608
+ "publishedAt",
609
+ "locale",
610
+ "createdBy",
611
+ "updatedBy",
612
+ "__component",
613
+ "isRelation",
614
+ "relationType",
615
+ "targetUid",
616
+ "targetDisplayName",
617
+ "isMulti",
618
+ "mode",
619
+ "documentIds"
620
+ ]);
621
+ for (const [k, v] of Object.entries(item)) {
622
+ if (!systemKeys.has(k) && typeof v === "string" && v.trim() !== "") {
623
+ const resolved = v.trim();
624
+ if (item.documentId) registerRelationLabel(item.documentId, resolved);
625
+ if (item.id !== void 0 && item.id !== null) registerRelationLabel(item.id, resolved);
626
+ return resolved;
627
+ }
628
+ }
629
+ if (item.documentId) {
630
+ if (options && Array.isArray(options)) {
631
+ const match = options.find((o) => o.documentId === item.documentId);
632
+ if (match?.label) return match.label.trim();
633
+ }
634
+ const cached = getCachedRelationLabel(item.documentId);
635
+ if (cached) return cached;
636
+ }
637
+ if (item.id !== void 0 && item.id !== null) {
638
+ if (options && Array.isArray(options)) {
639
+ const match = options.find((o) => String(o.id) === String(item.id));
640
+ if (match?.label) return match.label.trim();
641
+ }
642
+ const cached = getCachedRelationLabel(item.id);
643
+ if (cached) return cached;
644
+ }
645
+ return item.documentId || (item.id !== void 0 && item.id !== null ? `Entry #${item.id}` : JSON.stringify(item));
646
+ }
540
647
  function extractRelationEditCommand(rawVal, currentDisplayVal, isMulti = false) {
541
648
  if (rawVal && typeof rawVal === "object" && !Array.isArray(rawVal) && rawVal.mode) {
542
649
  return {
@@ -549,14 +656,14 @@ function extractRelationEditCommand(rawVal, currentDisplayVal, isMulti = false)
549
656
  return {
550
657
  mode: "set",
551
658
  documentIds: rawVal.map((r) => r?.documentId).filter(Boolean),
552
- label: rawVal.map((r) => r?.name || r?.title || r?.email || r?.documentId).filter(Boolean).join(", ")
659
+ label: rawVal.map((r) => resolveEntityLabel(r)).filter(Boolean).join(", ")
553
660
  };
554
661
  }
555
662
  if (rawVal && typeof rawVal === "object" && rawVal.documentId) {
556
663
  return {
557
664
  mode: "set",
558
665
  documentIds: [rawVal.documentId],
559
- label: rawVal.name || rawVal.title || rawVal.email || rawVal.documentId
666
+ label: resolveEntityLabel(rawVal)
560
667
  };
561
668
  }
562
669
  if (typeof rawVal === "string") {
@@ -850,7 +957,10 @@ function getAllNestedValues(obj, path, availableAttributes) {
850
957
  rootTarget.forEach((item, idx) => {
851
958
  if (!item || typeof item !== "object") return;
852
959
  if (parsed.targetIndex !== void 0 && idx !== parsed.targetIndex) return;
853
- if (parsed.targetComponentUid && item.__component !== parsed.targetComponentUid) return;
960
+ const itemComp = item.__component;
961
+ const targetComp = parsed.targetComponentUid;
962
+ const compMatches = !targetComp || itemComp === targetComp || itemComp && (itemComp.toLowerCase() === targetComp.toLowerCase() || itemComp.split(".")[1]?.toLowerCase() === targetComp.toLowerCase() || itemComp.toLowerCase().replace(/[-_]/g, "") === targetComp.toLowerCase().replace(/[-_]/g, ""));
963
+ if (!compMatches) return;
854
964
  const subPath = tail.join(".");
855
965
  const scopedPath = item.__component ? `${head}[${item.__component}].${subPath}` : "";
856
966
  const isSupported = availableAttributes ? availableAttributes.includes(scopedPath) : false;
@@ -905,6 +1015,66 @@ function getAllNestedValues(obj, path, availableAttributes) {
905
1015
  }
906
1016
  return [];
907
1017
  }
1018
+ function formatAttributeHeaderLabel(attr) {
1019
+ if (!attr) return "";
1020
+ if (attr === "updated_at" || attr === "updatedAt") return "Updated At";
1021
+ if (attr === "created_at" || attr === "createdAt") return "Created At";
1022
+ if (attr === "published_at" || attr === "publishedAt") return "Published At";
1023
+ const bracketMatch = attr.match(/^([^.[]+)\[([^\]]+)\](?:\.(.+))?$/);
1024
+ if (bracketMatch) {
1025
+ const root = bracketMatch[1].replace(/_/g, " ").replace(/\b\w/g, (l) => l.toUpperCase());
1026
+ const comp = formatComponentName(bracketMatch[2]);
1027
+ const sub = bracketMatch[3] ? bracketMatch[3].split(".").map((s) => s.replace(/_/g, " ").replace(/\b\w/g, (l) => l.toUpperCase())).join(" > ") : "";
1028
+ return sub ? `${root} [${comp}] > ${sub}` : `${root} [${comp}]`;
1029
+ }
1030
+ if (attr.includes(".")) {
1031
+ return attr.split(".").map((s) => s.replace(/_/g, " ").replace(/\b\w/g, (l) => l.toUpperCase())).join(" > ");
1032
+ }
1033
+ return attr.replace(/_/g, " ").replace(/\b\w/g, (l) => l.toUpperCase());
1034
+ }
1035
+ function resolveEffectiveRelationMeta(attr, colRelations, globalRelationsMeta) {
1036
+ if (!attr) return void 0;
1037
+ const rels = colRelations;
1038
+ if (rels) {
1039
+ if (rels[attr]) return rels[attr];
1040
+ const norm = attr.toLowerCase().replace(/[-_ /]/g, "");
1041
+ for (const k of Object.keys(rels)) {
1042
+ if (k.toLowerCase().replace(/[-_ /]/g, "") === norm) return rels[k];
1043
+ }
1044
+ for (const k of Object.keys(rels)) {
1045
+ if (k.startsWith(`${attr}.`) || k.toLowerCase().startsWith(`${attr.toLowerCase()}.`)) {
1046
+ return rels[k];
1047
+ }
1048
+ }
1049
+ const attrLeaf = attr.includes(".") ? attr.split(".").pop() : "";
1050
+ for (const [k, rel] of Object.entries(rels)) {
1051
+ const bracketMatch = k.match(/\[([^\]]+)\](?:\.(.+))?/);
1052
+ if (bracketMatch) {
1053
+ const compUid = bracketMatch[1];
1054
+ const compClean = compUid.includes(".") ? compUid.split(".")[1] : compUid;
1055
+ const normComp = compClean.toLowerCase().replace(/[-_ /]/g, "");
1056
+ const subPath = bracketMatch[2] || "";
1057
+ const normSub = subPath.toLowerCase().replace(/[-_ /]/g, "");
1058
+ if (normComp === norm || compUid.toLowerCase() === attr.toLowerCase() || compClean.toLowerCase() === attr.toLowerCase() || attrLeaf && normSub === attrLeaf.toLowerCase().replace(/[-_ /]/g, "") && (norm.includes(normComp) || attr.toLowerCase().includes(compUid.toLowerCase()))) {
1059
+ return rel;
1060
+ }
1061
+ }
1062
+ }
1063
+ for (const [k, rel] of Object.entries(rels)) {
1064
+ if (k.endsWith(`.${attr}`) || k.toLowerCase().endsWith(`.${attr.toLowerCase()}`)) {
1065
+ return rel;
1066
+ }
1067
+ }
1068
+ }
1069
+ if (globalRelationsMeta) {
1070
+ if (globalRelationsMeta[attr]) return globalRelationsMeta[attr];
1071
+ const norm = attr.toLowerCase().replace(/[-_ /]/g, "");
1072
+ for (const k of Object.keys(globalRelationsMeta)) {
1073
+ if (k.toLowerCase().replace(/[-_ /]/g, "") === norm) return globalRelationsMeta[k];
1074
+ }
1075
+ }
1076
+ return void 0;
1077
+ }
908
1078
  function getAvailableColumnsForCollection(col, selectedAttribute, searchAttribute) {
909
1079
  const cols = [
910
1080
  {
@@ -925,26 +1095,7 @@ function getAvailableColumnsForCollection(col, selectedAttribute, searchAttribut
925
1095
  if (attr === "name" || attr === "title" || attr === selectedAttribute || searchAttribute && attr === searchAttribute) {
926
1096
  return;
927
1097
  }
928
- let formattedLabel = attr;
929
- if (attr === "updated_at" || attr === "updatedAt") {
930
- formattedLabel = "Updated At";
931
- } else if (attr === "created_at" || attr === "createdAt") {
932
- formattedLabel = "Created At";
933
- } else if (attr === "published_at" || attr === "publishedAt") {
934
- formattedLabel = "Published At";
935
- } else {
936
- const bracketMatch = attr.match(/^([^.[]+)\[([^\]]+)\]\.(.+)$/);
937
- if (bracketMatch) {
938
- const root = bracketMatch[1].charAt(0).toUpperCase() + bracketMatch[1].slice(1);
939
- const comp = formatComponentName(bracketMatch[2]);
940
- const sub = bracketMatch[3].split(".").map((s) => s.charAt(0).toUpperCase() + s.slice(1)).join(" > ");
941
- formattedLabel = `${root} [${comp}] > ${sub}`;
942
- } else if (attr.includes(".")) {
943
- formattedLabel = attr.split(".").map((s) => s.charAt(0).toUpperCase() + s.slice(1)).join(" > ");
944
- } else {
945
- formattedLabel = attr.replace(/_/g, " ").replace(/\b\w/g, (l) => l.toUpperCase());
946
- }
947
- }
1098
+ const formattedLabel = formatAttributeHeaderLabel(attr);
948
1099
  cols.push({
949
1100
  key: `attr_${attr}`,
950
1101
  label: formattedLabel,
@@ -980,16 +1131,7 @@ function getAvailableColumnsForCollection(col, selectedAttribute, searchAttribut
980
1131
  });
981
1132
  }
982
1133
  if (searchAttribute && searchAttribute !== selectedAttribute) {
983
- let formattedSearchLabel = searchAttribute;
984
- const bracketMatch = searchAttribute.match(/^([^.[]+)\[([^\]]+)\]\.(.+)$/);
985
- if (bracketMatch) {
986
- const root = bracketMatch[1].charAt(0).toUpperCase() + bracketMatch[1].slice(1);
987
- const comp = formatComponentName(bracketMatch[2]);
988
- const sub = bracketMatch[3].split(".").map((s) => s.charAt(0).toUpperCase() + s.slice(1)).join(" > ");
989
- formattedSearchLabel = `${root} [${comp}] > ${sub}`;
990
- } else if (searchAttribute.includes(".")) {
991
- formattedSearchLabel = searchAttribute.split(".").map((s) => s.charAt(0).toUpperCase() + s.slice(1)).join(" > ");
992
- }
1134
+ const formattedSearchLabel = formatAttributeHeaderLabel(searchAttribute);
993
1135
  cols.push({
994
1136
  key: "search_attr",
995
1137
  label: `Search: "${formattedSearchLabel}"`,
@@ -998,18 +1140,7 @@ function getAvailableColumnsForCollection(col, selectedAttribute, searchAttribut
998
1140
  });
999
1141
  }
1000
1142
  if (selectedAttribute && selectedAttribute.trim()) {
1001
- let formattedTargetLabel = selectedAttribute;
1002
- const bracketMatch = selectedAttribute.match(/^([^.[]+)\[([^\]]+)\]\.(.+)$/);
1003
- if (bracketMatch) {
1004
- const root = bracketMatch[1].charAt(0).toUpperCase() + bracketMatch[1].slice(1);
1005
- const comp = formatComponentName(bracketMatch[2]);
1006
- const sub = bracketMatch[3].split(".").map((s) => s.charAt(0).toUpperCase() + s.slice(1)).join(" > ");
1007
- formattedTargetLabel = `${root} [${comp}] > ${sub}`;
1008
- } else if (selectedAttribute.includes(".")) {
1009
- formattedTargetLabel = selectedAttribute.split(".").map((s) => s.charAt(0).toUpperCase() + s.slice(1)).join(" > ");
1010
- } else {
1011
- formattedTargetLabel = selectedAttribute.replace(/_/g, " ").replace(/\b\w/g, (l) => l.toUpperCase());
1012
- }
1143
+ const formattedTargetLabel = formatAttributeHeaderLabel(selectedAttribute);
1013
1144
  cols.push({
1014
1145
  key: "current_attr",
1015
1146
  label: `Current Value: "${formattedTargetLabel}"`,
@@ -1125,18 +1256,21 @@ function formatFullTooltipValue(val) {
1125
1256
  return isNaN(val.getTime()) ? "(invalid date)" : val.toISOString();
1126
1257
  }
1127
1258
  if (typeof val === "string") {
1259
+ const cached = getCachedRelationLabel(val);
1260
+ if (cached) return cached;
1128
1261
  return val;
1129
1262
  }
1130
1263
  if (Array.isArray(val)) {
1131
1264
  if (val.length === 0) return "(empty array)";
1132
- try {
1133
- return JSON.stringify(val, null, 2);
1134
- } catch {
1135
- return String(val);
1136
- }
1265
+ return val.map(
1266
+ (item) => typeof item === "object" && item !== null ? resolveEntityLabel(item) : getCachedRelationLabel(item) || String(item)
1267
+ ).join(", ");
1137
1268
  }
1138
1269
  if (typeof val === "object") {
1139
1270
  if (val.isRelation && val.display) return val.display;
1271
+ if (val.documentId || val.authorName || val.name || val.title) {
1272
+ return resolveEntityLabel(val);
1273
+ }
1140
1274
  try {
1141
1275
  return JSON.stringify(val, null, 2);
1142
1276
  } catch {
@@ -1151,7 +1285,7 @@ function getCellTooltipText(colDef, entry, colAttributes, selectedAttribute, sea
1151
1285
  case "select":
1152
1286
  return void 0;
1153
1287
  case "identifier": {
1154
- const mainText = entry.name || entry.title || `Entry #${entry.id || entry.documentId}`;
1288
+ const mainText = resolveEntityLabel(entry) || `Entry #${entry.id || entry.documentId}`;
1155
1289
  const parts = [String(mainText)];
1156
1290
  if (entry.documentId) parts.push(`Document ID: ${entry.documentId}`);
1157
1291
  if (entry.id && String(entry.id) !== String(entry.documentId)) parts.push(`ID: ${entry.id}`);
@@ -1488,19 +1622,28 @@ function CsvManagerTab() {
1488
1622
  }
1489
1623
  };
1490
1624
  const getAttrDepth = (attr) => attributesMeta[attr]?.depth ?? (attr.includes(".") ? attr.split(".").length - 1 : 0);
1625
+ const getEffectiveRelMeta = React.useCallback(
1626
+ (attr) => {
1627
+ return resolveEffectiveRelationMeta(attr, selectedCol?.relations, relationsMeta);
1628
+ },
1629
+ [selectedCol, relationsMeta]
1630
+ );
1491
1631
  React.useEffect(() => {
1492
- if (searchAttribute && relationsMeta[searchAttribute]) {
1493
- fetchSearchRelationOptions(relationsMeta[searchAttribute].targetUid);
1632
+ const activeRel = getEffectiveRelMeta(searchAttribute);
1633
+ if (searchAttribute && activeRel) {
1634
+ fetchSearchRelationOptions(activeRel.targetUid);
1494
1635
  } else {
1495
1636
  setSearchRelationOptions([]);
1496
1637
  }
1497
- }, [searchAttribute, relationsMeta]);
1638
+ }, [searchAttribute, getEffectiveRelMeta]);
1498
1639
  const fetchSearchRelationOptions = async (targetUid) => {
1499
1640
  try {
1500
1641
  setSearchRelationOptionsLoading(true);
1501
1642
  const res = await get(`/bulk-updater/relation-options?targetUid=${encodeURIComponent(targetUid)}`);
1502
1643
  if (res.data && res.data.success) {
1503
- setSearchRelationOptions(res.data.options || []);
1644
+ const opts = res.data.options || [];
1645
+ setSearchRelationOptions(opts);
1646
+ registerRelationOptions(opts);
1504
1647
  }
1505
1648
  } catch {
1506
1649
  setSearchRelationOptions([]);
@@ -2187,12 +2330,16 @@ function CsvManagerTab() {
2187
2330
  }
2188
2331
  },
2189
2332
  children: (selectedCol?.attributes || []).map((attr) => {
2190
- const rel = relationsMeta[attr];
2333
+ const rel = getEffectiveRelMeta(attr);
2191
2334
  const depth = getAttrDepth(attr);
2335
+ const friendlyLabel = formatAttributeHeaderLabel(attr);
2192
2336
  const badgeText = rel ? `relation ${rel.targetDisplayName}` : depth > 0 ? `L${depth} component` : "";
2193
- const textValue = badgeText ? `${attr} ${badgeText}` : attr;
2337
+ const textValue = `${attr} ${friendlyLabel} ${badgeText}`.trim();
2194
2338
  return /* @__PURE__ */ jsxRuntime.jsx(designSystem.ComboboxOption, { value: attr, textValue, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { justifyContent: "space-between", alignItems: "center", width: "100%", gap: 2, children: [
2195
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "omega", fontWeight: attr === searchAttribute ? "bold" : "regular", children: attr }),
2339
+ /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { children: [
2340
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "omega", fontWeight: attr === searchAttribute ? "bold" : "regular", children: friendlyLabel !== attr ? friendlyLabel : attr }),
2341
+ friendlyLabel !== attr && /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", textColor: "neutral500", display: "block", children: attr })
2342
+ ] }),
2196
2343
  rel ? /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Badge, { backgroundColor: "secondary100", textColor: "secondary700", size: "S", children: [
2197
2344
  "relation ➔ ",
2198
2345
  rel.targetDisplayName
@@ -2228,11 +2375,11 @@ function CsvManagerTab() {
2228
2375
  ] }),
2229
2376
  (filterOperator === "equals" || filterOperator === "contains" || filterOperator === "starts_with") && /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { style: { flex: 1, minWidth: 200 }, children: [
2230
2377
  /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", fontWeight: "bold", textColor: "neutral800", marginBottom: 1, display: "block", children: searchAttribute ? `Value for "${searchAttribute}"` : "Value to match" }),
2231
- searchAttribute && relationsMeta[searchAttribute] ? /* @__PURE__ */ jsxRuntime.jsx(
2378
+ searchAttribute && getEffectiveRelMeta(searchAttribute) ? /* @__PURE__ */ jsxRuntime.jsx(
2232
2379
  designSystem.Combobox,
2233
2380
  {
2234
2381
  autocomplete: { type: "list", filter: "contains" },
2235
- placeholder: searchRelationOptionsLoading ? "Loading entities..." : `Search & pick ${relationsMeta[searchAttribute].targetDisplayName} or type text...`,
2382
+ placeholder: searchRelationOptionsLoading ? "Loading entities..." : `Search & pick ${getEffectiveRelMeta(searchAttribute).targetDisplayName} or type text...`,
2236
2383
  value: filterQuery,
2237
2384
  onClear: () => setFilterQuery(""),
2238
2385
  onChange: (val) => {
@@ -5935,7 +6082,7 @@ function renderHeaderCell(colDef, col, currentSort, selectedAttribute, searchAtt
5935
6082
  colDef.key
5936
6083
  );
5937
6084
  }
5938
- function formatDisplayValue(val) {
6085
+ function formatDisplayValue(val, options) {
5939
6086
  if (val === void 0 || val === null || val === "") {
5940
6087
  return "(empty / not set)";
5941
6088
  }
@@ -5951,16 +6098,16 @@ function formatDisplayValue(val) {
5951
6098
  if (Array.isArray(val)) {
5952
6099
  if (val.length === 0) return "(empty / unlinked)";
5953
6100
  return val.map(
5954
- (item) => typeof item === "object" && item !== null ? item.name || item.title || item.email || item.username || item.documentId || item.id : String(item)
6101
+ (item) => typeof item === "object" && item !== null ? resolveEntityLabel(item, options) : resolveEntityLabel(item, options)
5955
6102
  ).join(", ");
5956
6103
  }
5957
6104
  if (typeof val === "object" && val !== null) {
5958
6105
  if (val.isRelation && val.display) return val.display;
5959
- return val.name || val.title || val.email || val.username || val.documentId || val.id || JSON.stringify(val);
6106
+ return resolveEntityLabel(val, options);
5960
6107
  }
5961
- return String(val);
6108
+ return resolveEntityLabel(val, options);
5962
6109
  }
5963
- function renderCellContent(colDef, entry, col, selectedAttribute, searchAttribute, isMatch, hasAttr, isSelected, onToggleSelect, pendingBatches = [], isDzExpanded = false, onToggleExpandDz, filterQuery = "", gridCtx, cellTooltip) {
6110
+ function renderCellContent(colDef, entry, col, selectedAttribute, searchAttribute, isMatch, hasAttr, isSelected, onToggleSelect, pendingBatches = [], isDzExpanded = false, onToggleExpandDz, filterQuery = "", gridCtx, cellTooltip, searchRelOptions, relationOptions) {
5964
6111
  switch (colDef.key) {
5965
6112
  case "select":
5966
6113
  return /* @__PURE__ */ jsxRuntime.jsx(
@@ -5971,7 +6118,7 @@ function renderCellContent(colDef, entry, col, selectedAttribute, searchAttribut
5971
6118
  }
5972
6119
  );
5973
6120
  case "identifier": {
5974
- const mainText = entry.name || entry.title || `Entry #${entry.id || entry.documentId}`;
6121
+ const mainText = entry.name || entry.title || entry.authorName || resolveEntityLabel(entry, searchRelOptions) || `Entry #${entry.id || entry.documentId}`;
5975
6122
  const dzField = Object.keys(entry).find(
5976
6123
  (k) => Array.isArray(entry[k]) && entry[k].length > 0 && entry[k].some((item) => item && item.__component)
5977
6124
  );
@@ -6007,7 +6154,7 @@ function renderCellContent(colDef, entry, col, selectedAttribute, searchAttribut
6007
6154
  return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { textColor: "neutral500", style: { fontStyle: "italic" }, children: "(empty / not set)" });
6008
6155
  }
6009
6156
  if (matches.length === 1 && !matches[0].componentUid) {
6010
- const displayStr = formatDisplayValue(matches[0].value);
6157
+ const displayStr = formatDisplayValue(matches[0].value, searchRelOptions);
6011
6158
  const isUnset = displayStr === "(empty / not set)" || displayStr === "(empty / unlinked)";
6012
6159
  return /* @__PURE__ */ jsxRuntime.jsx(
6013
6160
  designSystem.Typography,
@@ -6029,7 +6176,7 @@ function renderCellContent(colDef, entry, col, selectedAttribute, searchAttribut
6029
6176
  }
6030
6177
  const qLower = (filterQuery || "").trim().toLowerCase();
6031
6178
  return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { direction: "column", gap: 1, alignItems: "flex-start", style: { maxWidth: 320 }, children: matches.map((m) => {
6032
- const displayStr = formatDisplayValue(m.value);
6179
+ const displayStr = formatDisplayValue(m.value, searchRelOptions);
6033
6180
  const isMatchItem = qLower && displayStr.toLowerCase().includes(qLower);
6034
6181
  const occTooltip = `#${m.index} ${m.componentName || "Item"}${m.componentId !== void 0 ? ` (id: ${m.componentId})` : ""}: ${formatFullTooltipValue(m.value)}`;
6035
6182
  return /* @__PURE__ */ jsxRuntime.jsxs(
@@ -6081,8 +6228,9 @@ function renderCellContent(colDef, entry, col, selectedAttribute, searchAttribut
6081
6228
  if (matches.length === 0) {
6082
6229
  return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { textColor: "neutral500", style: { fontStyle: "italic" }, children: "(empty / not set)" });
6083
6230
  }
6231
+ const activeRelOpts = gridCtx?.relationOptions || relationOptions || searchRelOptions;
6084
6232
  if (matches.length === 1 && !matches[0].componentUid && !matches[0].path.includes("[#")) {
6085
- const displayStr = formatDisplayValue(matches[0].value);
6233
+ const displayStr = formatDisplayValue(matches[0].value, activeRelOpts);
6086
6234
  const isUnset = displayStr === "(empty / not set)" || displayStr === "(empty / unlinked)";
6087
6235
  return /* @__PURE__ */ jsxRuntime.jsx(
6088
6236
  designSystem.Typography,
@@ -6102,7 +6250,7 @@ function renderCellContent(colDef, entry, col, selectedAttribute, searchAttribut
6102
6250
  );
6103
6251
  }
6104
6252
  return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { direction: "column", gap: 1, alignItems: "flex-start", style: { maxWidth: 320 }, children: matches.map((m) => {
6105
- const displayStr = formatDisplayValue(m.value);
6253
+ const displayStr = formatDisplayValue(m.value, activeRelOpts);
6106
6254
  const occTooltip = `#${m.index} ${m.componentName || "Item"}${m.componentId !== void 0 ? ` (id: ${m.componentId})` : ""}: ${formatFullTooltipValue(m.value)}`;
6107
6255
  return /* @__PURE__ */ jsxRuntime.jsxs(
6108
6256
  designSystem.Flex,
@@ -6234,8 +6382,9 @@ function renderCellContent(colDef, entry, col, selectedAttribute, searchAttribut
6234
6382
  if (matches.length === 0) {
6235
6383
  return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { textColor: "neutral500", style: { fontStyle: "italic" }, children: "(empty / not set)" });
6236
6384
  }
6385
+ const targetRelOpts = gridCtx?.relationOptions || relationOptions || searchRelOptions;
6237
6386
  if (matches.length === 1 && !matches[0].componentUid) {
6238
- const displayStr = formatDisplayValue(matches[0].value);
6387
+ const displayStr = formatDisplayValue(matches[0].value, targetRelOpts);
6239
6388
  const isUnset = displayStr === "(empty / not set)" || displayStr === "(empty / unlinked)";
6240
6389
  return /* @__PURE__ */ jsxRuntime.jsx(
6241
6390
  designSystem.Typography,
@@ -6255,7 +6404,7 @@ function renderCellContent(colDef, entry, col, selectedAttribute, searchAttribut
6255
6404
  );
6256
6405
  }
6257
6406
  return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { direction: "column", gap: 1, alignItems: "flex-start", style: { maxWidth: 320 }, children: matches.map((m) => {
6258
- const displayStr = formatDisplayValue(m.value);
6407
+ const displayStr = formatDisplayValue(m.value, targetRelOpts);
6259
6408
  const occTooltip = `#${m.index} ${m.componentName || "Item"}${m.componentId !== void 0 ? ` (id: ${m.componentId})` : ""}: ${formatFullTooltipValue(m.value)}`;
6260
6409
  return /* @__PURE__ */ jsxRuntime.jsxs(
6261
6410
  designSystem.Flex,
@@ -6316,8 +6465,9 @@ function renderCellContent(colDef, entry, col, selectedAttribute, searchAttribut
6316
6465
  if (matches.length === 0) {
6317
6466
  return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { textColor: "neutral500", style: { fontStyle: "italic" }, children: "-" });
6318
6467
  }
6468
+ const attrRelOpts = attrName === searchAttribute ? searchRelOptions : attrName === selectedAttribute ? gridCtx?.relationOptions || relationOptions : searchRelOptions || relationOptions;
6319
6469
  if (matches.length === 1 && !matches[0].componentUid && !matches[0].path.includes("[#")) {
6320
- const displayStr = formatDisplayValue(matches[0].value);
6470
+ const displayStr = formatDisplayValue(matches[0].value, attrRelOpts);
6321
6471
  return /* @__PURE__ */ jsxRuntime.jsx(
6322
6472
  designSystem.Typography,
6323
6473
  {
@@ -6329,7 +6479,7 @@ function renderCellContent(colDef, entry, col, selectedAttribute, searchAttribut
6329
6479
  );
6330
6480
  }
6331
6481
  return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { direction: "column", gap: 1, alignItems: "flex-start", style: { maxWidth: 320 }, children: matches.map((m, mIdx) => {
6332
- const displayStr = formatDisplayValue(m.value);
6482
+ const displayStr = formatDisplayValue(m.value, attrRelOpts);
6333
6483
  const occTooltip = `#${m.index} ${m.componentName || "Item"}${m.componentId !== void 0 ? ` (id: ${m.componentId})` : ""}: ${formatFullTooltipValue(m.value)}`;
6334
6484
  return /* @__PURE__ */ jsxRuntime.jsxs(
6335
6485
  designSystem.Flex,
@@ -6470,7 +6620,9 @@ const BulkUpdater = () => {
6470
6620
  setRelationOptionsLoading(true);
6471
6621
  const res = await get(`/bulk-updater/relation-options?targetUid=${encodeURIComponent(targetUid)}`);
6472
6622
  if (res.data && res.data.success) {
6473
- setRelationOptions(res.data.options || []);
6623
+ const opts = res.data.options || [];
6624
+ setRelationOptions(opts);
6625
+ registerRelationOptions(opts);
6474
6626
  }
6475
6627
  } catch {
6476
6628
  setRelationOptions([]);
@@ -6507,7 +6659,9 @@ const BulkUpdater = () => {
6507
6659
  setSearchRelationOptionsLoading(true);
6508
6660
  const res = await get(`/bulk-updater/relation-options?targetUid=${encodeURIComponent(targetUid)}`);
6509
6661
  if (res.data && res.data.success) {
6510
- setSearchRelationOptions(res.data.options || []);
6662
+ const opts = res.data.options || [];
6663
+ setSearchRelationOptions(opts);
6664
+ registerRelationOptions(opts);
6511
6665
  }
6512
6666
  } catch {
6513
6667
  setSearchRelationOptions([]);
@@ -6523,13 +6677,6 @@ const BulkUpdater = () => {
6523
6677
  const [gridFilterModifiedOnly, setGridFilterModifiedOnly] = React.useState(false);
6524
6678
  const [validationRules, setValidationRules] = React.useState([]);
6525
6679
  const effectiveSearchAttribute = searchAttribute || selectedAttribute;
6526
- React.useEffect(() => {
6527
- if (effectiveSearchAttribute && relationsMeta[effectiveSearchAttribute]) {
6528
- fetchSearchRelationOptions(relationsMeta[effectiveSearchAttribute].targetUid);
6529
- } else {
6530
- setSearchRelationOptions([]);
6531
- }
6532
- }, [effectiveSearchAttribute, relationsMeta]);
6533
6680
  const [filterOperator, setFilterOperator] = React.useState("none");
6534
6681
  const [filterQuery, setFilterQuery] = React.useState("");
6535
6682
  const [entrySearch, setEntrySearch] = React.useState("");
@@ -6940,10 +7087,24 @@ const BulkUpdater = () => {
6940
7087
  if (!collections.length || !selectedCollectionUid) return null;
6941
7088
  return collections.find((c) => c.uid === selectedCollectionUid) || null;
6942
7089
  }, [collections, selectedCollectionUid]);
7090
+ const getEffectiveRelMeta = React.useCallback(
7091
+ (attr) => {
7092
+ return resolveEffectiveRelationMeta(attr, selectedCol?.relations, relationsMeta);
7093
+ },
7094
+ [selectedCol, relationsMeta]
7095
+ );
7096
+ React.useEffect(() => {
7097
+ const activeRel = getEffectiveRelMeta(effectiveSearchAttribute);
7098
+ if (effectiveSearchAttribute && activeRel) {
7099
+ fetchSearchRelationOptions(activeRel.targetUid);
7100
+ } else {
7101
+ setSearchRelationOptions([]);
7102
+ }
7103
+ }, [effectiveSearchAttribute, getEffectiveRelMeta]);
6943
7104
  const activeAttrMeta = React.useMemo(() => {
6944
7105
  if (!selectedAttribute) return void 0;
6945
7106
  const base = selectedCol?.attributesMeta?.[selectedAttribute] || attributesMeta[selectedAttribute];
6946
- const relMeta = selectedCol?.relations?.[selectedAttribute] || relationsMeta[selectedAttribute];
7107
+ const relMeta = getEffectiveRelMeta(selectedAttribute);
6947
7108
  if (!base && !relMeta) return void 0;
6948
7109
  if (relMeta && (!base || !base.isRelation)) {
6949
7110
  return {
@@ -6954,7 +7115,7 @@ const BulkUpdater = () => {
6954
7115
  };
6955
7116
  }
6956
7117
  return base;
6957
- }, [selectedAttribute, selectedCol, attributesMeta, relationsMeta]);
7118
+ }, [selectedAttribute, selectedCol, attributesMeta, getEffectiveRelMeta]);
6958
7119
  const totalDirtyRecordsCount = React.useMemo(() => Object.keys(gridEdits).length, [gridEdits]);
6959
7120
  const totalDirtyCellsCount = React.useMemo(
6960
7121
  () => Object.values(gridEdits).reduce(
@@ -6970,7 +7131,7 @@ const BulkUpdater = () => {
6970
7131
  const handleGridCellCommit = React__default.default.useCallback(
6971
7132
  (entry, colUid, occ, newValue, validationError) => {
6972
7133
  const key = `${colUid}${KEY_SEP}${entry.documentId}`;
6973
- const recordLabel = entry.name || entry.title || entry.email || `Entry #${entry.id || entry.documentId}`;
7134
+ const recordLabel = entry.name || entry.title || entry.authorName || entry.email || `Entry #${entry.id || entry.documentId}`;
6974
7135
  setGridEdits((prev) => {
6975
7136
  const existingRec = prev[key] || {
6976
7137
  uid: colUid,
@@ -7149,8 +7310,9 @@ const BulkUpdater = () => {
7149
7310
  }
7150
7311
  setSelectedRelationDocId("");
7151
7312
  setAttributeValue("");
7152
- if (newAttr && relationsMeta[newAttr]) {
7153
- fetchRelationOptions(relationsMeta[newAttr].targetUid);
7313
+ const relForNewAttr = getEffectiveRelMeta(newAttr);
7314
+ if (newAttr && relForNewAttr) {
7315
+ fetchRelationOptions(relForNewAttr.targetUid);
7154
7316
  } else {
7155
7317
  setRelationOptions([]);
7156
7318
  }
@@ -7175,12 +7337,16 @@ const BulkUpdater = () => {
7175
7337
  ] }) });
7176
7338
  }
7177
7339
  return depthFilteredAttributes.map((attr) => {
7178
- const rel = relationsMeta[attr];
7340
+ const rel = getEffectiveRelMeta(attr);
7179
7341
  const depth = getAttrDepth(attr);
7342
+ const friendlyLabel = formatAttributeHeaderLabel(attr);
7180
7343
  const badgeText = rel ? `relation ${rel.targetDisplayName}` : depth > 0 ? `L${depth} component` : "";
7181
- const textValue = badgeText ? `${attr} ${badgeText}` : attr;
7344
+ const textValue = `${attr} ${friendlyLabel} ${badgeText}`.trim();
7182
7345
  return /* @__PURE__ */ jsxRuntime.jsx(designSystem.ComboboxOption, { value: attr, textValue, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { justifyContent: "space-between", alignItems: "center", width: "100%", gap: 2, children: [
7183
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "omega", fontWeight: attr === selectedAttribute ? "bold" : "regular", children: attr }),
7346
+ /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { children: [
7347
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "omega", fontWeight: attr === selectedAttribute ? "bold" : "regular", children: friendlyLabel !== attr ? friendlyLabel : attr }),
7348
+ friendlyLabel !== attr && /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", textColor: "neutral500", display: "block", children: attr })
7349
+ ] }),
7184
7350
  rel ? /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Badge, { backgroundColor: "secondary100", textColor: "secondary700", size: "S", children: [
7185
7351
  "relation ➔ ",
7186
7352
  rel.targetDisplayName
@@ -7191,15 +7357,19 @@ const BulkUpdater = () => {
7191
7357
  ] }) : null
7192
7358
  ] }) }, attr);
7193
7359
  });
7194
- }, [depthFilteredAttributes, relationsMeta, selectedAttribute, componentDepth, attributesMeta]);
7360
+ }, [depthFilteredAttributes, getEffectiveRelMeta, selectedAttribute, componentDepth, attributesMeta]);
7195
7361
  const memoizedSearchComboboxOptions = React.useMemo(() => {
7196
7362
  return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: depthFilteredAttributes.map((attr) => {
7197
- const rel = relationsMeta[attr];
7363
+ const rel = getEffectiveRelMeta(attr);
7198
7364
  const depth = getAttrDepth(attr);
7365
+ const friendlyLabel = formatAttributeHeaderLabel(attr);
7199
7366
  const badgeText = rel ? `relation ${rel.targetDisplayName}` : depth > 0 ? `L${depth} component` : "";
7200
- const textValue = badgeText ? `${attr} ${badgeText}` : attr;
7367
+ const textValue = `${attr} ${friendlyLabel} ${badgeText}`.trim();
7201
7368
  return /* @__PURE__ */ jsxRuntime.jsx(designSystem.ComboboxOption, { value: attr, textValue, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { justifyContent: "space-between", alignItems: "center", width: "100%", gap: 2, children: [
7202
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "omega", fontWeight: attr === searchAttribute ? "bold" : "regular", children: attr }),
7369
+ /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { children: [
7370
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "omega", fontWeight: attr === searchAttribute ? "bold" : "regular", children: friendlyLabel !== attr ? friendlyLabel : attr }),
7371
+ friendlyLabel !== attr && /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", textColor: "neutral500", display: "block", children: attr })
7372
+ ] }),
7203
7373
  rel ? /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Badge, { backgroundColor: "secondary100", textColor: "secondary700", size: "S", children: [
7204
7374
  "relation ➔ ",
7205
7375
  rel.targetDisplayName
@@ -7210,7 +7380,7 @@ const BulkUpdater = () => {
7210
7380
  ] }) : null
7211
7381
  ] }) }, `search_${attr}`);
7212
7382
  }) });
7213
- }, [depthFilteredAttributes, relationsMeta, searchAttribute, selectedAttribute, componentDepth, attributesMeta]);
7383
+ }, [depthFilteredAttributes, getEffectiveRelMeta, searchAttribute, selectedAttribute, componentDepth, attributesMeta]);
7214
7384
  const handleSearchAttributeChange = (newAttr) => {
7215
7385
  const finalAttr = newAttr === "__default__" ? "" : newAttr;
7216
7386
  setSearchAttribute(finalAttr);
@@ -7313,6 +7483,7 @@ const BulkUpdater = () => {
7313
7483
  if (!obj || typeof obj !== "object") return false;
7314
7484
  if (testString(obj.name)) return true;
7315
7485
  if (testString(obj.title)) return true;
7486
+ if (testString(obj.authorName)) return true;
7316
7487
  if (testString(obj.email)) return true;
7317
7488
  if (testString(obj.username)) return true;
7318
7489
  if (testString(obj.documentId)) return true;
@@ -8570,13 +8741,13 @@ const BulkUpdater = () => {
8570
8741
  ]
8571
8742
  }
8572
8743
  ) }),
8573
- (filterOperator === "equals" || filterOperator === "contains" || filterOperator === "starts_with") && /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { style: { flex: 1, minWidth: 200 }, children: effectiveSearchAttribute && relationsMeta[effectiveSearchAttribute] ? /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Field.Root, { children: [
8574
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: `Target ${relationsMeta[effectiveSearchAttribute].targetDisplayName} Relation` }),
8744
+ (filterOperator === "equals" || filterOperator === "contains" || filterOperator === "starts_with") && /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { style: { flex: 1, minWidth: 200 }, children: effectiveSearchAttribute && getEffectiveRelMeta(effectiveSearchAttribute) ? /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Field.Root, { children: [
8745
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: `Target ${getEffectiveRelMeta(effectiveSearchAttribute).targetDisplayName} Relation` }),
8575
8746
  /* @__PURE__ */ jsxRuntime.jsx(
8576
8747
  designSystem.Combobox,
8577
8748
  {
8578
8749
  autocomplete: { type: "list", filter: "contains" },
8579
- placeholder: searchRelationOptionsLoading ? "Loading entities..." : `Search & pick ${relationsMeta[effectiveSearchAttribute].targetDisplayName} or type text...`,
8750
+ placeholder: searchRelationOptionsLoading ? "Loading entities..." : `Search & pick ${getEffectiveRelMeta(effectiveSearchAttribute).targetDisplayName} or type text...`,
8580
8751
  value: filterQuery,
8581
8752
  onClear: () => setFilterQuery(""),
8582
8753
  onChange: (val) => {
@@ -9219,7 +9390,7 @@ const BulkUpdater = () => {
9219
9390
  recordEdits,
9220
9391
  relationOptions,
9221
9392
  relationOptionsLoading,
9222
- relationIsMulti: Boolean(relationsMeta[selectedAttribute]?.isMulti),
9393
+ relationIsMulti: Boolean(getEffectiveRelMeta(selectedAttribute)?.isMulti),
9223
9394
  validationRules,
9224
9395
  onCommitEdit: handleGridCellCommit,
9225
9396
  onResetEdit: handleGridCellReset
@@ -9257,7 +9428,9 @@ const BulkUpdater = () => {
9257
9428
  onToggleExpandDz,
9258
9429
  filterQuery,
9259
9430
  gridCtx,
9260
- cellTooltip
9431
+ cellTooltip,
9432
+ searchRelationOptions,
9433
+ relationOptions
9261
9434
  ) }, colDef.key);
9262
9435
  })
9263
9436
  }
@@ -9289,7 +9462,7 @@ const BulkUpdater = () => {
9289
9462
  recordEdits,
9290
9463
  relationOptions,
9291
9464
  relationOptionsLoading,
9292
- relationIsMulti: Boolean(relationsMeta[selectedAttribute]?.isMulti),
9465
+ relationIsMulti: Boolean(getEffectiveRelMeta(selectedAttribute)?.isMulti),
9293
9466
  validationRules,
9294
9467
  onToggleDzBlock: toggleDzBlock,
9295
9468
  onCommitEdit: handleGridCellCommit,
@@ -9482,28 +9655,28 @@ const BulkUpdater = () => {
9482
9655
  )
9483
9656
  ] })
9484
9657
  }
9485
- ) : relationsMeta[selectedAttribute] ? /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", gap: 1, style: { width: "100%" }, children: [
9658
+ ) : getEffectiveRelMeta(selectedAttribute) ? /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", gap: 1, style: { width: "100%" }, children: [
9486
9659
  /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 2, alignItems: "center", wrap: "wrap", children: [
9487
9660
  /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Typography, { variant: "pi", fontWeight: "bold", textColor: "neutral700", children: [
9488
9661
  "Target ",
9489
- relationsMeta[selectedAttribute].targetDisplayName,
9662
+ getEffectiveRelMeta(selectedAttribute).targetDisplayName,
9490
9663
  " Relation:"
9491
9664
  ] }),
9492
9665
  /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Badge, { backgroundColor: "secondary100", textColor: "secondary700", children: [
9493
- relationsMeta[selectedAttribute].relationType,
9666
+ getEffectiveRelMeta(selectedAttribute).relationType,
9494
9667
  " → ",
9495
- relationsMeta[selectedAttribute].targetDisplayName
9668
+ getEffectiveRelMeta(selectedAttribute).targetDisplayName
9496
9669
  ] }),
9497
- relationsMeta[selectedAttribute].isMulti && /* @__PURE__ */ jsxRuntime.jsx(designSystem.Badge, { backgroundColor: "primary100", textColor: "primary700", children: "Multi-Relation" })
9670
+ getEffectiveRelMeta(selectedAttribute).isMulti && /* @__PURE__ */ jsxRuntime.jsx(designSystem.Badge, { backgroundColor: "primary100", textColor: "primary700", children: "Multi-Relation" })
9498
9671
  ] }),
9499
9672
  /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 2, alignItems: "center", style: { width: "100%" }, children: [
9500
9673
  /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { style: { flex: 1, minWidth: 200 }, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Field.Root, { children: [
9501
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: `Choose ${relationsMeta[selectedAttribute].targetDisplayName}` }),
9674
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: `Choose ${getEffectiveRelMeta(selectedAttribute).targetDisplayName}` }),
9502
9675
  /* @__PURE__ */ jsxRuntime.jsxs(
9503
9676
  designSystem.Combobox,
9504
9677
  {
9505
9678
  autocomplete: { type: "list", filter: "contains" },
9506
- placeholder: relationOptionsLoading ? "Loading entities..." : `Search & pick ${relationsMeta[selectedAttribute].targetDisplayName}...`,
9679
+ placeholder: relationOptionsLoading ? "Loading entities..." : `Search & pick ${getEffectiveRelMeta(selectedAttribute).targetDisplayName}...`,
9507
9680
  value: selectedRelationDocId,
9508
9681
  onChange: (val) => {
9509
9682
  const docId = val ? String(val) : "";
@@ -9522,7 +9695,7 @@ const BulkUpdater = () => {
9522
9695
  }
9523
9696
  )
9524
9697
  ] }) }),
9525
- relationsMeta[selectedAttribute].isMulti && /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { style: { width: 170 }, children: /* @__PURE__ */ jsxRuntime.jsxs(
9698
+ getEffectiveRelMeta(selectedAttribute).isMulti && /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { style: { width: 170 }, children: /* @__PURE__ */ jsxRuntime.jsxs(
9526
9699
  designSystem.SingleSelect,
9527
9700
  {
9528
9701
  label: "Action Mode",
@@ -10221,8 +10394,8 @@ const BulkUpdater = () => {
10221
10394
  " heterogeneous edits across ",
10222
10395
  gridSerialized.targets.length,
10223
10396
  " records)"
10224
- ] }) : relationsMeta[selectedAttribute] ? /* @__PURE__ */ jsxRuntime.jsx("span", { children: selectedRelationDocId === "__clear__" ? /* @__PURE__ */ jsxRuntime.jsx(designSystem.Badge, { backgroundColor: "danger100", textColor: "danger700", children: "Clear / Unlink Relation" }) : /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Badge, { backgroundColor: "secondary100", textColor: "secondary700", children: [
10225
- relationsMeta[selectedAttribute].isMulti ? `[${relationMode.toUpperCase()}] ` : "",
10397
+ ] }) : getEffectiveRelMeta(selectedAttribute) ? /* @__PURE__ */ jsxRuntime.jsx("span", { children: selectedRelationDocId === "__clear__" ? /* @__PURE__ */ jsxRuntime.jsx(designSystem.Badge, { backgroundColor: "danger100", textColor: "danger700", children: "Clear / Unlink Relation" }) : /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Badge, { backgroundColor: "secondary100", textColor: "secondary700", children: [
10398
+ getEffectiveRelMeta(selectedAttribute).isMulti ? `[${relationMode.toUpperCase()}] ` : "",
10226
10399
  relationOptions.find((o) => o.documentId === selectedRelationDocId)?.label || selectedRelationDocId || "(none selected)"
10227
10400
  ] }) }) : useRegex ? /* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
10228
10401
  "Replace ",
@@ -10844,7 +11017,7 @@ const BulkUpdater = () => {
10844
11017
  editMode: gridEditMode ? "grid" : "common",
10845
11018
  publishOnApproval,
10846
11019
  lifecycleStats: selectedLifecycleStats,
10847
- targetValueDisplay: gridEditMode ? `Grid Editing (${gridSerialized.totalEditCount} edits across ${gridSerialized.targets.length} records)` : relationsMeta[selectedAttribute] ? selectedRelationDocId === "__clear__" ? "Clear / Unlink Relation" : relationOptions.find((o) => o.documentId === selectedRelationDocId)?.label || selectedRelationDocId || "(none)" : useRegex ? `Replace /${regexPattern}/g with "${attributeValue}"` : attributeValue
11020
+ targetValueDisplay: gridEditMode ? `Grid Editing (${gridSerialized.totalEditCount} edits across ${gridSerialized.targets.length} records)` : getEffectiveRelMeta(selectedAttribute) ? selectedRelationDocId === "__clear__" ? "Clear / Unlink Relation" : relationOptions.find((o) => o.documentId === selectedRelationDocId)?.label || selectedRelationDocId || "(none)" : useRegex ? `Replace /${regexPattern}/g with "${attributeValue}"` : attributeValue
10848
11021
  }
10849
11022
  ),
10850
11023
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -10874,6 +11047,7 @@ const BulkUpdater = () => {
10874
11047
  );
10875
11048
  };
10876
11049
  exports.default = BulkUpdater;
11050
+ exports.formatAttributeHeaderLabel = formatAttributeHeaderLabel;
10877
11051
  exports.formatComponentName = formatComponentName;
10878
11052
  exports.formatDisplayValue = formatDisplayValue;
10879
11053
  exports.formatFullTooltipValue = formatFullTooltipValue;
@@ -10886,4 +11060,7 @@ exports.getNestedValue = getNestedValue;
10886
11060
  exports.getPropertyValue = getPropertyValue;
10887
11061
  exports.getSortOptionsForCollection = getSortOptionsForCollection;
10888
11062
  exports.parseDynamicZonePath = parseDynamicZonePath;
10889
- //# sourceMappingURL=BulkUpdater-BY8IXT4R.js.map
11063
+ exports.registerRelationOptions = registerRelationOptions;
11064
+ exports.resolveEffectiveRelationMeta = resolveEffectiveRelationMeta;
11065
+ exports.resolveEntityLabel = resolveEntityLabel;
11066
+ //# sourceMappingURL=BulkUpdater-BSlEEUTV.js.map