strapi-plugin-bulk-updater 1.6.3 → 1.6.4

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.
@@ -4338,6 +4338,263 @@ function getAllNestedValues(obj, path, availableAttributes) {
4338
4338
  }
4339
4339
  return [];
4340
4340
  }
4341
+ function getAvailableColumnsForCollection(col, selectedAttribute, searchAttribute) {
4342
+ const cols = [
4343
+ {
4344
+ key: "select",
4345
+ label: "Select",
4346
+ isPermanent: true,
4347
+ defaultVisible: true
4348
+ },
4349
+ {
4350
+ key: "identifier",
4351
+ label: "Identifier",
4352
+ sortable: !col.isSingleType,
4353
+ defaultVisible: true
4354
+ }
4355
+ ];
4356
+ const candidateAttrs = col.attributes || [];
4357
+ candidateAttrs.forEach((attr) => {
4358
+ if (attr === "name" || attr === "title" || attr === selectedAttribute || searchAttribute && attr === searchAttribute) {
4359
+ return;
4360
+ }
4361
+ let formattedLabel = attr;
4362
+ if (attr === "updated_at" || attr === "updatedAt") {
4363
+ formattedLabel = "Updated At";
4364
+ } else if (attr === "created_at" || attr === "createdAt") {
4365
+ formattedLabel = "Created At";
4366
+ } else if (attr === "published_at" || attr === "publishedAt") {
4367
+ formattedLabel = "Published At";
4368
+ } else {
4369
+ const bracketMatch = attr.match(/^([^.[]+)\[([^\]]+)\]\.(.+)$/);
4370
+ if (bracketMatch) {
4371
+ const root = bracketMatch[1].charAt(0).toUpperCase() + bracketMatch[1].slice(1);
4372
+ const comp = formatComponentName(bracketMatch[2]);
4373
+ const sub = bracketMatch[3].split(".").map((s) => s.charAt(0).toUpperCase() + s.slice(1)).join(" > ");
4374
+ formattedLabel = `${root} [${comp}] > ${sub}`;
4375
+ } else if (attr.includes(".")) {
4376
+ formattedLabel = attr.split(".").map((s) => s.charAt(0).toUpperCase() + s.slice(1)).join(" > ");
4377
+ } else {
4378
+ formattedLabel = attr.replace(/_/g, " ").replace(/\b\w/g, (l) => l.toUpperCase());
4379
+ }
4380
+ }
4381
+ cols.push({
4382
+ key: `attr_${attr}`,
4383
+ label: formattedLabel,
4384
+ sortable: !col.isSingleType,
4385
+ defaultVisible: ["department", "email", "location", "updated_at", "updatedAt"].includes(attr)
4386
+ });
4387
+ });
4388
+ const hasUpdatedAt = candidateAttrs.some((a) => a === "updatedAt" || a === "updated_at");
4389
+ const hasCreatedAt = candidateAttrs.some((a) => a === "createdAt" || a === "created_at");
4390
+ const hasPublishedAt = candidateAttrs.some((a) => a === "publishedAt" || a === "published_at");
4391
+ if (!hasUpdatedAt) {
4392
+ cols.push({
4393
+ key: "attr_updatedAt",
4394
+ label: "Updated At",
4395
+ sortable: !col.isSingleType,
4396
+ defaultVisible: false
4397
+ });
4398
+ }
4399
+ if (!hasCreatedAt) {
4400
+ cols.push({
4401
+ key: "attr_createdAt",
4402
+ label: "Created At",
4403
+ sortable: !col.isSingleType,
4404
+ defaultVisible: false
4405
+ });
4406
+ }
4407
+ if (!hasPublishedAt && col.draftAndPublish) {
4408
+ cols.push({
4409
+ key: "attr_publishedAt",
4410
+ label: "Published At",
4411
+ sortable: !col.isSingleType,
4412
+ defaultVisible: false
4413
+ });
4414
+ }
4415
+ if (searchAttribute && searchAttribute !== selectedAttribute) {
4416
+ let formattedSearchLabel = searchAttribute;
4417
+ const bracketMatch = searchAttribute.match(/^([^.[]+)\[([^\]]+)\]\.(.+)$/);
4418
+ if (bracketMatch) {
4419
+ const root = bracketMatch[1].charAt(0).toUpperCase() + bracketMatch[1].slice(1);
4420
+ const comp = formatComponentName(bracketMatch[2]);
4421
+ const sub = bracketMatch[3].split(".").map((s) => s.charAt(0).toUpperCase() + s.slice(1)).join(" > ");
4422
+ formattedSearchLabel = `${root} [${comp}] > ${sub}`;
4423
+ } else if (searchAttribute.includes(".")) {
4424
+ formattedSearchLabel = searchAttribute.split(".").map((s) => s.charAt(0).toUpperCase() + s.slice(1)).join(" > ");
4425
+ }
4426
+ cols.push({
4427
+ key: "search_attr",
4428
+ label: `Search: "${formattedSearchLabel}"`,
4429
+ sortable: !col.isSingleType && col.attributes.includes(searchAttribute),
4430
+ defaultVisible: true
4431
+ });
4432
+ }
4433
+ if (selectedAttribute && selectedAttribute.trim()) {
4434
+ let formattedTargetLabel = selectedAttribute;
4435
+ const bracketMatch = selectedAttribute.match(/^([^.[]+)\[([^\]]+)\]\.(.+)$/);
4436
+ if (bracketMatch) {
4437
+ const root = bracketMatch[1].charAt(0).toUpperCase() + bracketMatch[1].slice(1);
4438
+ const comp = formatComponentName(bracketMatch[2]);
4439
+ const sub = bracketMatch[3].split(".").map((s) => s.charAt(0).toUpperCase() + s.slice(1)).join(" > ");
4440
+ formattedTargetLabel = `${root} [${comp}] > ${sub}`;
4441
+ } else if (selectedAttribute.includes(".")) {
4442
+ formattedTargetLabel = selectedAttribute.split(".").map((s) => s.charAt(0).toUpperCase() + s.slice(1)).join(" > ");
4443
+ } else {
4444
+ formattedTargetLabel = selectedAttribute.replace(/_/g, " ").replace(/\b\w/g, (l) => l.toUpperCase());
4445
+ }
4446
+ cols.push({
4447
+ key: "current_attr",
4448
+ label: `Current Value: "${formattedTargetLabel}"`,
4449
+ sortable: !col.isSingleType && col.attributes.includes(selectedAttribute),
4450
+ defaultVisible: true
4451
+ });
4452
+ cols.push({
4453
+ key: "target_attr",
4454
+ label: `Target Updated Value: "${formattedTargetLabel}"`,
4455
+ sortable: !col.isSingleType && col.attributes.includes(selectedAttribute),
4456
+ defaultVisible: true
4457
+ });
4458
+ }
4459
+ cols.push({
4460
+ key: "status",
4461
+ label: "Status",
4462
+ sortable: false,
4463
+ defaultVisible: true
4464
+ });
4465
+ return cols;
4466
+ }
4467
+ function formatFullTooltipValue(val) {
4468
+ if (val === void 0 || val === null || val === "") {
4469
+ return "(empty / not set)";
4470
+ }
4471
+ if (typeof val === "boolean") {
4472
+ return String(val);
4473
+ }
4474
+ if (typeof val === "number") {
4475
+ return String(val);
4476
+ }
4477
+ if (val instanceof Date) {
4478
+ return isNaN(val.getTime()) ? "(invalid date)" : val.toISOString();
4479
+ }
4480
+ if (typeof val === "string") {
4481
+ return val;
4482
+ }
4483
+ if (Array.isArray(val)) {
4484
+ if (val.length === 0) return "(empty array)";
4485
+ try {
4486
+ return JSON.stringify(val, null, 2);
4487
+ } catch {
4488
+ return String(val);
4489
+ }
4490
+ }
4491
+ if (typeof val === "object") {
4492
+ if (val.isRelation && val.display) return val.display;
4493
+ try {
4494
+ return JSON.stringify(val, null, 2);
4495
+ } catch {
4496
+ return String(val);
4497
+ }
4498
+ }
4499
+ return String(val);
4500
+ }
4501
+ function getCellTooltipText(colDef, entry, colAttributes, selectedAttribute, searchAttribute, recordEdits) {
4502
+ if (!colDef || !entry) return void 0;
4503
+ switch (colDef.key) {
4504
+ case "select":
4505
+ return void 0;
4506
+ case "identifier": {
4507
+ const mainText = entry.name || entry.title || `Entry #${entry.id || entry.documentId}`;
4508
+ const parts = [String(mainText)];
4509
+ if (entry.documentId) parts.push(`Document ID: ${entry.documentId}`);
4510
+ if (entry.id && String(entry.id) !== String(entry.documentId)) parts.push(`ID: ${entry.id}`);
4511
+ if (entry.email) parts.push(`Email: ${entry.email}`);
4512
+ return parts.join("\n");
4513
+ }
4514
+ case "status": {
4515
+ if (selectedAttribute && colAttributes && !colAttributes.includes(selectedAttribute)) {
4516
+ return "Status: Ignored (absent in schema)";
4517
+ }
4518
+ return void 0;
4519
+ }
4520
+ case "current_attr": {
4521
+ if (!selectedAttribute) return void 0;
4522
+ const rootKey = selectedAttribute.split("[")[0].split(".")[0];
4523
+ const hasSchemaAttr = !colAttributes || colAttributes.includes(selectedAttribute) || colAttributes.includes(rootKey);
4524
+ if (!hasSchemaAttr) {
4525
+ return "Ignored (absent in schema)";
4526
+ }
4527
+ const matches = getAllNestedValues(entry, selectedAttribute, colAttributes);
4528
+ if (matches.length === 0) return "(empty / not set)";
4529
+ if (matches.length === 1 && !matches[0].componentUid && !matches[0].path.includes("[#")) {
4530
+ return formatFullTooltipValue(matches[0].value);
4531
+ }
4532
+ return matches.map((m) => {
4533
+ const compLabel = m.componentName ? `#${m.index} ${m.componentName}${m.componentId !== void 0 ? ` (id: ${m.componentId})` : ""}` : `#${m.index}`;
4534
+ const valStr = formatFullTooltipValue(m.value);
4535
+ return `${compLabel}: ${valStr}`;
4536
+ }).join("\n\n");
4537
+ }
4538
+ case "target_attr": {
4539
+ if (!selectedAttribute) return void 0;
4540
+ const rootKey = selectedAttribute.split("[")[0].split(".")[0];
4541
+ const hasSchemaAttr = !colAttributes || colAttributes.includes(selectedAttribute) || colAttributes.includes(rootKey);
4542
+ if (!hasSchemaAttr) {
4543
+ return "Ignored (absent in schema)";
4544
+ }
4545
+ if (recordEdits?.occurrences) {
4546
+ const occEntries = Object.entries(recordEdits.occurrences);
4547
+ if (occEntries.length > 0) {
4548
+ return occEntries.map(([occKey, editObj]) => {
4549
+ const valStr = formatFullTooltipValue(editObj?.value);
4550
+ return `Target [${occKey}]: ${valStr}${editObj?.validationError ? ` (Error: ${editObj.validationError})` : ""}`;
4551
+ }).join("\n\n");
4552
+ }
4553
+ }
4554
+ const matches = getAllNestedValues(entry, selectedAttribute, colAttributes);
4555
+ if (matches.length === 0) return "(empty / not set)";
4556
+ if (matches.length === 1 && !matches[0].componentUid && !matches[0].path.includes("[#")) {
4557
+ return formatFullTooltipValue(matches[0].value);
4558
+ }
4559
+ return matches.map((m) => {
4560
+ const compLabel = m.componentName ? `#${m.index} ${m.componentName}${m.componentId !== void 0 ? ` (id: ${m.componentId})` : ""}` : `#${m.index}`;
4561
+ const valStr = formatFullTooltipValue(m.value);
4562
+ return `${compLabel}: ${valStr}`;
4563
+ }).join("\n\n");
4564
+ }
4565
+ case "search_attr": {
4566
+ if (!searchAttribute) return void 0;
4567
+ const rootKey = searchAttribute.split("[")[0].split(".")[0];
4568
+ const hasSchemaAttr = !colAttributes || colAttributes.includes(searchAttribute) || colAttributes.includes(rootKey);
4569
+ if (!hasSchemaAttr) {
4570
+ return "Ignored (absent in schema)";
4571
+ }
4572
+ const matches = getAllNestedValues(entry, searchAttribute, colAttributes);
4573
+ if (matches.length === 0) return "(empty / not set)";
4574
+ if (matches.length === 1 && !matches[0].componentUid && !matches[0].path.includes("[#")) {
4575
+ return formatFullTooltipValue(matches[0].value);
4576
+ }
4577
+ return matches.map((m) => {
4578
+ const compLabel = m.componentName ? `#${m.index} ${m.componentName}${m.componentId !== void 0 ? ` (id: ${m.componentId})` : ""}` : `#${m.index}`;
4579
+ const valStr = formatFullTooltipValue(m.value);
4580
+ return `${compLabel}: ${valStr}`;
4581
+ }).join("\n\n");
4582
+ }
4583
+ default: {
4584
+ const attrName = colDef.key.replace("attr_", "");
4585
+ const matches = getAllNestedValues(entry, attrName, colAttributes);
4586
+ if (matches.length === 0) return "(empty / not set)";
4587
+ if (matches.length === 1 && !matches[0].componentUid && !matches[0].path.includes("[#")) {
4588
+ return formatFullTooltipValue(matches[0].value);
4589
+ }
4590
+ return matches.map((m) => {
4591
+ const compLabel = m.componentName ? `#${m.index} ${m.componentName}${m.componentId !== void 0 ? ` (id: ${m.componentId})` : ""}` : `#${m.index}`;
4592
+ const valStr = formatFullTooltipValue(m.value);
4593
+ return `${compLabel}: ${valStr}`;
4594
+ }).join("\n\n");
4595
+ }
4596
+ }
4597
+ }
4341
4598
  const DEFAULT_HEADING_ITEMS = [
4342
4599
  { value: "h1", label: "H1 - Main Page Title", maxAllowed: 1 },
4343
4600
  { value: "h2", label: "H2 - Primary Section Heading", maxAllowed: 3 },
@@ -5214,125 +5471,6 @@ const ComponentOccurrencesDrawer = React__default.memo(
5214
5471
  );
5215
5472
  }
5216
5473
  );
5217
- function getAvailableColumnsForCollection(col, selectedAttribute, searchAttribute) {
5218
- const cols = [
5219
- {
5220
- key: "select",
5221
- label: "Select",
5222
- isPermanent: true,
5223
- defaultVisible: true
5224
- },
5225
- {
5226
- key: "identifier",
5227
- label: "Identifier",
5228
- sortable: !col.isSingleType,
5229
- defaultVisible: true
5230
- }
5231
- ];
5232
- const candidateAttrs = col.attributes || [];
5233
- candidateAttrs.forEach((attr) => {
5234
- if (attr === "name" || attr === "title" || attr === selectedAttribute || searchAttribute && attr === searchAttribute) {
5235
- return;
5236
- }
5237
- let formattedLabel = attr;
5238
- if (attr === "updated_at" || attr === "updatedAt") {
5239
- formattedLabel = "Updated At";
5240
- } else if (attr === "created_at" || attr === "createdAt") {
5241
- formattedLabel = "Created At";
5242
- } else if (attr === "published_at" || attr === "publishedAt") {
5243
- formattedLabel = "Published At";
5244
- } else {
5245
- const bracketMatch = attr.match(/^([^.[]+)\[([^\]]+)\]\.(.+)$/);
5246
- if (bracketMatch) {
5247
- const root = bracketMatch[1].charAt(0).toUpperCase() + bracketMatch[1].slice(1);
5248
- const comp = formatComponentName(bracketMatch[2]);
5249
- const sub = bracketMatch[3].split(".").map((s) => s.charAt(0).toUpperCase() + s.slice(1)).join(" > ");
5250
- formattedLabel = `${root} [${comp}] > ${sub}`;
5251
- } else if (attr.includes(".")) {
5252
- formattedLabel = attr.split(".").map((s) => s.charAt(0).toUpperCase() + s.slice(1)).join(" > ");
5253
- } else {
5254
- formattedLabel = attr.replace(/_/g, " ").replace(/\b\w/g, (l) => l.toUpperCase());
5255
- }
5256
- }
5257
- cols.push({
5258
- key: `attr_${attr}`,
5259
- label: formattedLabel,
5260
- sortable: !col.isSingleType,
5261
- defaultVisible: ["department", "email", "location", "updated_at", "updatedAt"].includes(attr)
5262
- });
5263
- });
5264
- const hasUpdatedAt = candidateAttrs.some((a) => a === "updatedAt" || a === "updated_at");
5265
- const hasCreatedAt = candidateAttrs.some((a) => a === "createdAt" || a === "created_at");
5266
- const hasPublishedAt = candidateAttrs.some((a) => a === "publishedAt" || a === "published_at");
5267
- if (!hasUpdatedAt) {
5268
- cols.push({
5269
- key: "attr_updatedAt",
5270
- label: "Updated At",
5271
- sortable: !col.isSingleType,
5272
- defaultVisible: false
5273
- });
5274
- }
5275
- if (!hasCreatedAt) {
5276
- cols.push({
5277
- key: "attr_createdAt",
5278
- label: "Created At",
5279
- sortable: !col.isSingleType,
5280
- defaultVisible: false
5281
- });
5282
- }
5283
- if (!hasPublishedAt && col.draftAndPublish) {
5284
- cols.push({
5285
- key: "attr_publishedAt",
5286
- label: "Published At",
5287
- sortable: !col.isSingleType,
5288
- defaultVisible: false
5289
- });
5290
- }
5291
- if (searchAttribute && searchAttribute !== selectedAttribute) {
5292
- let formattedSearchLabel = searchAttribute;
5293
- const bracketMatch = searchAttribute.match(/^([^.[]+)\[([^\]]+)\]\.(.+)$/);
5294
- if (bracketMatch) {
5295
- const root = bracketMatch[1].charAt(0).toUpperCase() + bracketMatch[1].slice(1);
5296
- const comp = formatComponentName(bracketMatch[2]);
5297
- const sub = bracketMatch[3].split(".").map((s) => s.charAt(0).toUpperCase() + s.slice(1)).join(" > ");
5298
- formattedSearchLabel = `${root} [${comp}] > ${sub}`;
5299
- } else if (searchAttribute.includes(".")) {
5300
- formattedSearchLabel = searchAttribute.split(".").map((s) => s.charAt(0).toUpperCase() + s.slice(1)).join(" > ");
5301
- }
5302
- cols.push({
5303
- key: "search_attr",
5304
- label: `Search: "${formattedSearchLabel}"`,
5305
- sortable: !col.isSingleType && col.attributes.includes(searchAttribute),
5306
- defaultVisible: true
5307
- });
5308
- }
5309
- if (selectedAttribute && selectedAttribute.trim()) {
5310
- let formattedTargetLabel = selectedAttribute;
5311
- const bracketMatch = selectedAttribute.match(/^([^.[]+)\[([^\]]+)\]\.(.+)$/);
5312
- if (bracketMatch) {
5313
- const root = bracketMatch[1].charAt(0).toUpperCase() + bracketMatch[1].slice(1);
5314
- const comp = formatComponentName(bracketMatch[2]);
5315
- const sub = bracketMatch[3].split(".").map((s) => s.charAt(0).toUpperCase() + s.slice(1)).join(" > ");
5316
- formattedTargetLabel = `${root} [${comp}] > ${sub}`;
5317
- } else if (selectedAttribute.includes(".")) {
5318
- formattedTargetLabel = selectedAttribute.split(".").map((s) => s.charAt(0).toUpperCase() + s.slice(1)).join(" > ");
5319
- }
5320
- const targetLabel = searchAttribute && searchAttribute !== selectedAttribute ? `Update Target: "${formattedTargetLabel}"` : `Current "${formattedTargetLabel}"`;
5321
- cols.push({
5322
- key: "target_attr",
5323
- label: targetLabel,
5324
- sortable: !col.isSingleType && col.attributes.includes(selectedAttribute),
5325
- defaultVisible: true
5326
- });
5327
- }
5328
- cols.push({
5329
- key: "status",
5330
- label: "Status",
5331
- sortable: false,
5332
- defaultVisible: true
5333
- });
5334
- return cols;
5335
- }
5336
5474
  function getActiveSortLabel(currentSort, col) {
5337
5475
  const f = currentSort.field;
5338
5476
  const o = currentSort.order;
@@ -5462,7 +5600,7 @@ function renderHeaderCell(colDef, col, currentSort, selectedAttribute, searchAtt
5462
5600
  if (colDef.key === "select") {
5463
5601
  return /* @__PURE__ */ jsx(Th, { style: { width: 48 }, children: /* @__PURE__ */ jsx(Typography, { variant: "sigma", children: "Select" }) }, "select");
5464
5602
  }
5465
- const isCurrentSorted = colDef.key === "identifier" && (currentSort.field === "name" || currentSort.field === "title" || currentSort.field === "id") || colDef.key === "search_attr" && currentSort.field === searchAttribute || colDef.key === "target_attr" && currentSort.field === selectedAttribute || colDef.key.startsWith("attr_") && (currentSort.field === colDef.key.replace("attr_", "") || currentSort.field === "updatedAt" && colDef.key === "attr_updated_at" || currentSort.field === "updated_at" && colDef.key === "attr_updatedAt" || currentSort.field === "createdAt" && colDef.key === "attr_created_at" || currentSort.field === "created_at" && colDef.key === "attr_createdAt" || currentSort.field === "publishedAt" && colDef.key === "attr_published_at" || currentSort.field === "published_at" && colDef.key === "attr_publishedAt");
5603
+ const isCurrentSorted = colDef.key === "identifier" && (currentSort.field === "name" || currentSort.field === "title" || currentSort.field === "id") || colDef.key === "search_attr" && currentSort.field === searchAttribute || (colDef.key === "target_attr" || colDef.key === "current_attr") && currentSort.field === selectedAttribute || colDef.key.startsWith("attr_") && (currentSort.field === colDef.key.replace("attr_", "") || currentSort.field === "updatedAt" && colDef.key === "attr_updated_at" || currentSort.field === "updated_at" && colDef.key === "attr_updatedAt" || currentSort.field === "createdAt" && colDef.key === "attr_created_at" || currentSort.field === "created_at" && colDef.key === "attr_createdAt" || currentSort.field === "publishedAt" && colDef.key === "attr_published_at" || currentSort.field === "published_at" && colDef.key === "attr_publishedAt");
5466
5604
  const sortArrow = isCurrentSorted ? currentSort.order === "asc" ? "▲" : "▼" : "⇅";
5467
5605
  const handleClick = () => {
5468
5606
  if (!colDef.sortable) return;
@@ -5471,7 +5609,7 @@ function renderHeaderCell(colDef, col, currentSort, selectedAttribute, searchAtt
5471
5609
  onSort(col.uid, field);
5472
5610
  } else if (colDef.key === "search_attr") {
5473
5611
  onSort(col.uid, searchAttribute);
5474
- } else if (colDef.key === "target_attr") {
5612
+ } else if (colDef.key === "target_attr" || colDef.key === "current_attr") {
5475
5613
  onSort(col.uid, selectedAttribute);
5476
5614
  } else if (colDef.key.startsWith("attr_")) {
5477
5615
  onSort(col.uid, colDef.key.replace("attr_", ""));
@@ -5515,7 +5653,7 @@ function formatDisplayValue(val) {
5515
5653
  }
5516
5654
  return String(val);
5517
5655
  }
5518
- function renderCellContent(colDef, entry, col, selectedAttribute, searchAttribute, isMatch, hasAttr, isSelected, onToggleSelect, pendingBatches = [], isDzExpanded = false, onToggleExpandDz, filterQuery = "", gridCtx) {
5656
+ function renderCellContent(colDef, entry, col, selectedAttribute, searchAttribute, isMatch, hasAttr, isSelected, onToggleSelect, pendingBatches = [], isDzExpanded = false, onToggleExpandDz, filterQuery = "", gridCtx, cellTooltip) {
5519
5657
  switch (colDef.key) {
5520
5658
  case "select":
5521
5659
  return /* @__PURE__ */ jsx(
@@ -5567,6 +5705,7 @@ function renderCellContent(colDef, entry, col, selectedAttribute, searchAttribut
5567
5705
  return /* @__PURE__ */ jsx(
5568
5706
  Typography,
5569
5707
  {
5708
+ title: cellTooltip || displayStr,
5570
5709
  textColor: isUnset ? "neutral500" : "primary700",
5571
5710
  fontWeight: "semiBold",
5572
5711
  style: {
@@ -5585,9 +5724,11 @@ function renderCellContent(colDef, entry, col, selectedAttribute, searchAttribut
5585
5724
  return /* @__PURE__ */ jsx(Flex, { direction: "column", gap: 1, alignItems: "flex-start", style: { maxWidth: 320 }, children: matches.map((m) => {
5586
5725
  const displayStr = formatDisplayValue(m.value);
5587
5726
  const isMatchItem = qLower && displayStr.toLowerCase().includes(qLower);
5727
+ const occTooltip = `#${m.index} ${m.componentName || "Item"}${m.componentId !== void 0 ? ` (id: ${m.componentId})` : ""}: ${formatFullTooltipValue(m.value)}`;
5588
5728
  return /* @__PURE__ */ jsxs(
5589
5729
  Flex,
5590
5730
  {
5731
+ title: occTooltip,
5591
5732
  gap: 1,
5592
5733
  alignItems: "center",
5593
5734
  style: {
@@ -5607,6 +5748,7 @@ function renderCellContent(colDef, entry, col, selectedAttribute, searchAttribut
5607
5748
  Typography,
5608
5749
  {
5609
5750
  variant: "pi",
5751
+ title: occTooltip,
5610
5752
  fontWeight: isMatchItem ? "bold" : "normal",
5611
5753
  textColor: isMatchItem ? "success700" : "neutral800",
5612
5754
  style: {
@@ -5624,6 +5766,80 @@ function renderCellContent(colDef, entry, col, selectedAttribute, searchAttribut
5624
5766
  );
5625
5767
  }) });
5626
5768
  }
5769
+ case "current_attr": {
5770
+ if (selectedAttribute && !hasAttr) {
5771
+ return /* @__PURE__ */ jsx(Badge, { backgroundColor: "neutral200", textColor: "neutral600", children: "Ignored (absent in schema)" });
5772
+ }
5773
+ const matches = getAllNestedValues(entry, selectedAttribute, col?.attributes);
5774
+ if (matches.length === 0) {
5775
+ return /* @__PURE__ */ jsx(Typography, { textColor: "neutral500", style: { fontStyle: "italic" }, children: "(empty / not set)" });
5776
+ }
5777
+ if (matches.length === 1 && !matches[0].componentUid && !matches[0].path.includes("[#")) {
5778
+ const displayStr = formatDisplayValue(matches[0].value);
5779
+ const isUnset = displayStr === "(empty / not set)" || displayStr === "(empty / unlinked)";
5780
+ return /* @__PURE__ */ jsx(
5781
+ Typography,
5782
+ {
5783
+ title: cellTooltip || displayStr,
5784
+ textColor: isUnset ? "neutral500" : "neutral800",
5785
+ style: {
5786
+ fontStyle: isUnset ? "italic" : "normal",
5787
+ display: "inline-block",
5788
+ maxWidth: 260,
5789
+ overflow: "hidden",
5790
+ textOverflow: "ellipsis",
5791
+ whiteSpace: "nowrap"
5792
+ },
5793
+ children: displayStr
5794
+ }
5795
+ );
5796
+ }
5797
+ return /* @__PURE__ */ jsx(Flex, { direction: "column", gap: 1, alignItems: "flex-start", style: { maxWidth: 320 }, children: matches.map((m) => {
5798
+ const displayStr = formatDisplayValue(m.value);
5799
+ const occTooltip = `#${m.index} ${m.componentName || "Item"}${m.componentId !== void 0 ? ` (id: ${m.componentId})` : ""}: ${formatFullTooltipValue(m.value)}`;
5800
+ return /* @__PURE__ */ jsxs(
5801
+ Flex,
5802
+ {
5803
+ title: occTooltip,
5804
+ gap: 1,
5805
+ alignItems: "center",
5806
+ style: {
5807
+ backgroundColor: "rgba(0, 0, 0, 0.03)",
5808
+ padding: "2px 6px",
5809
+ borderRadius: 4
5810
+ },
5811
+ children: [
5812
+ /* @__PURE__ */ jsxs(Badge, { size: "S", backgroundColor: "neutral200", textColor: "neutral800", children: [
5813
+ "#",
5814
+ m.index,
5815
+ " ",
5816
+ m.componentName || "Item"
5817
+ ] }),
5818
+ m.componentId !== void 0 && /* @__PURE__ */ jsxs(Typography, { variant: "pi", textColor: "neutral500", style: { fontSize: "0.68rem" }, children: [
5819
+ "id:",
5820
+ m.componentId
5821
+ ] }),
5822
+ /* @__PURE__ */ jsx(
5823
+ Typography,
5824
+ {
5825
+ variant: "pi",
5826
+ title: occTooltip,
5827
+ textColor: "neutral800",
5828
+ style: {
5829
+ maxWidth: 200,
5830
+ overflow: "hidden",
5831
+ textOverflow: "ellipsis",
5832
+ whiteSpace: "nowrap"
5833
+ },
5834
+ children: displayStr
5835
+ }
5836
+ )
5837
+ ]
5838
+ },
5839
+ m.index
5840
+ );
5841
+ }) });
5842
+ }
5627
5843
  case "target_attr": {
5628
5844
  if (gridCtx?.gridEditMode) {
5629
5845
  if (selectedAttribute && !hasAttr) {
@@ -5717,6 +5933,7 @@ function renderCellContent(colDef, entry, col, selectedAttribute, searchAttribut
5717
5933
  return /* @__PURE__ */ jsx(
5718
5934
  Typography,
5719
5935
  {
5936
+ title: cellTooltip || displayStr,
5720
5937
  textColor: isUnset ? "neutral500" : "neutral800",
5721
5938
  style: {
5722
5939
  fontStyle: isUnset ? "italic" : "normal",
@@ -5732,9 +5949,11 @@ function renderCellContent(colDef, entry, col, selectedAttribute, searchAttribut
5732
5949
  }
5733
5950
  return /* @__PURE__ */ jsx(Flex, { direction: "column", gap: 1, alignItems: "flex-start", style: { maxWidth: 320 }, children: matches.map((m) => {
5734
5951
  const displayStr = formatDisplayValue(m.value);
5952
+ const occTooltip = `#${m.index} ${m.componentName || "Item"}${m.componentId !== void 0 ? ` (id: ${m.componentId})` : ""}: ${formatFullTooltipValue(m.value)}`;
5735
5953
  return /* @__PURE__ */ jsxs(
5736
5954
  Flex,
5737
5955
  {
5956
+ title: occTooltip,
5738
5957
  gap: 1,
5739
5958
  alignItems: "center",
5740
5959
  style: {
@@ -5747,12 +5966,17 @@ function renderCellContent(colDef, entry, col, selectedAttribute, searchAttribut
5747
5966
  "#",
5748
5967
  m.index,
5749
5968
  " ",
5750
- m.componentName
5969
+ m.componentName || "Item"
5970
+ ] }),
5971
+ m.componentId !== void 0 && /* @__PURE__ */ jsxs(Typography, { variant: "pi", textColor: "neutral500", style: { fontSize: "0.68rem" }, children: [
5972
+ "id:",
5973
+ m.componentId
5751
5974
  ] }),
5752
5975
  /* @__PURE__ */ jsx(
5753
5976
  Typography,
5754
5977
  {
5755
5978
  variant: "pi",
5979
+ title: occTooltip,
5756
5980
  textColor: "neutral800",
5757
5981
  style: {
5758
5982
  maxWidth: 200,
@@ -5790,6 +6014,7 @@ function renderCellContent(colDef, entry, col, selectedAttribute, searchAttribut
5790
6014
  return /* @__PURE__ */ jsx(
5791
6015
  Typography,
5792
6016
  {
6017
+ title: cellTooltip || (displayStr === "(empty / not set)" ? void 0 : displayStr),
5793
6018
  textColor: "neutral700",
5794
6019
  style: { maxWidth: 200, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" },
5795
6020
  children: displayStr === "(empty / not set)" ? "-" : displayStr
@@ -5798,9 +6023,11 @@ function renderCellContent(colDef, entry, col, selectedAttribute, searchAttribut
5798
6023
  }
5799
6024
  return /* @__PURE__ */ jsx(Flex, { direction: "column", gap: 1, alignItems: "flex-start", style: { maxWidth: 320 }, children: matches.map((m, mIdx) => {
5800
6025
  const displayStr = formatDisplayValue(m.value);
6026
+ const occTooltip = `#${m.index} ${m.componentName || "Item"}${m.componentId !== void 0 ? ` (id: ${m.componentId})` : ""}: ${formatFullTooltipValue(m.value)}`;
5801
6027
  return /* @__PURE__ */ jsxs(
5802
6028
  Flex,
5803
6029
  {
6030
+ title: occTooltip,
5804
6031
  gap: 1,
5805
6032
  alignItems: "center",
5806
6033
  style: {
@@ -5823,6 +6050,7 @@ function renderCellContent(colDef, entry, col, selectedAttribute, searchAttribut
5823
6050
  Typography,
5824
6051
  {
5825
6052
  variant: "pi",
6053
+ title: occTooltip,
5826
6054
  textColor: "neutral800",
5827
6055
  style: {
5828
6056
  maxWidth: 200,
@@ -6464,8 +6692,11 @@ const BulkUpdater = () => {
6464
6692
  if (selectedCollectionUid) {
6465
6693
  setCollectionColumnVisibility((prev) => {
6466
6694
  const existing = prev[selectedCollectionUid];
6467
- if (existing && !existing.includes("target_attr")) {
6468
- return { ...prev, [selectedCollectionUid]: [...existing, "target_attr"] };
6695
+ if (existing) {
6696
+ const next = [...existing];
6697
+ if (!next.includes("current_attr")) next.push("current_attr");
6698
+ if (!next.includes("target_attr")) next.push("target_attr");
6699
+ return { ...prev, [selectedCollectionUid]: next };
6469
6700
  }
6470
6701
  return prev;
6471
6702
  });
@@ -6547,6 +6778,18 @@ const BulkUpdater = () => {
6547
6778
  }
6548
6779
  setGridEdits({});
6549
6780
  setSelectedAttribute(newAttr);
6781
+ if (newAttr && selectedCollectionUid) {
6782
+ setCollectionColumnVisibility((prev) => {
6783
+ const existing = prev[selectedCollectionUid];
6784
+ if (existing) {
6785
+ const next = [...existing];
6786
+ if (!next.includes("current_attr")) next.push("current_attr");
6787
+ if (!next.includes("target_attr")) next.push("target_attr");
6788
+ return { ...prev, [selectedCollectionUid]: next };
6789
+ }
6790
+ return prev;
6791
+ });
6792
+ }
6550
6793
  try {
6551
6794
  if (newAttr) {
6552
6795
  localStorage.setItem(LAST_ATTR_KEY, newAttr);
@@ -7265,7 +7508,7 @@ const BulkUpdater = () => {
7265
7508
  if (c.key.startsWith("attr_")) {
7266
7509
  const attr = c.key.slice(5);
7267
7510
  if (!selectedDataAttrs.includes(attr)) selectedDataAttrs.push(attr);
7268
- } else if (c.key === "target_attr" && selectedAttribute) {
7511
+ } else if ((c.key === "target_attr" || c.key === "current_attr") && selectedAttribute) {
7269
7512
  if (!selectedDataAttrs.includes(selectedAttribute)) selectedDataAttrs.push(selectedAttribute);
7270
7513
  } else if (c.key === "search_attr" && searchAttribute) {
7271
7514
  if (!selectedDataAttrs.includes(searchAttribute)) selectedDataAttrs.push(searchAttribute);
@@ -8489,7 +8732,7 @@ const BulkUpdater = () => {
8489
8732
  if (c.key.startsWith("attr_")) {
8490
8733
  const attr = c.key.slice(5);
8491
8734
  if (!selectedDataAttrs.includes(attr)) selectedDataAttrs.push(attr);
8492
- } else if (c.key === "target_attr" && selectedAttribute) {
8735
+ } else if ((c.key === "target_attr" || c.key === "current_attr") && selectedAttribute) {
8493
8736
  if (!selectedDataAttrs.includes(selectedAttribute)) selectedDataAttrs.push(selectedAttribute);
8494
8737
  } else if (c.key === "search_attr" && searchAttribute) {
8495
8738
  if (!selectedDataAttrs.includes(searchAttribute)) selectedDataAttrs.push(searchAttribute);
@@ -8640,22 +8883,33 @@ const BulkUpdater = () => {
8640
8883
  backgroundColor: recordEdits ? "rgba(73, 69, 255, 0.10)" : isSelected ? "rgba(73, 69, 255, 0.14)" : isMatch ? "rgba(46, 213, 115, 0.08)" : void 0,
8641
8884
  boxShadow: isSelected ? "inset 3px 0 0 0 #4945ff" : isMatch ? "inset 3px 0 0 0 #2ed573" : void 0
8642
8885
  },
8643
- children: activeColumns.map((colDef) => /* @__PURE__ */ jsx(Td, { children: renderCellContent(
8644
- colDef,
8645
- entry,
8646
- col,
8647
- selectedAttribute,
8648
- searchAttribute,
8649
- isMatch,
8650
- hasAttr,
8651
- isSelected,
8652
- () => toggleEntry(col.uid, entry.documentId),
8653
- pendingBatches,
8654
- isDzExpanded,
8655
- onToggleExpandDz,
8656
- filterQuery,
8657
- gridCtx
8658
- ) }, colDef.key))
8886
+ children: activeColumns.map((colDef) => {
8887
+ const cellTooltip = getCellTooltipText(
8888
+ colDef,
8889
+ entry,
8890
+ col?.attributes,
8891
+ selectedAttribute,
8892
+ searchAttribute,
8893
+ recordEdits
8894
+ );
8895
+ return /* @__PURE__ */ jsx(Td, { title: cellTooltip, children: renderCellContent(
8896
+ colDef,
8897
+ entry,
8898
+ col,
8899
+ selectedAttribute,
8900
+ searchAttribute,
8901
+ isMatch,
8902
+ hasAttr,
8903
+ isSelected,
8904
+ () => toggleEntry(col.uid, entry.documentId),
8905
+ pendingBatches,
8906
+ isDzExpanded,
8907
+ onToggleExpandDz,
8908
+ filterQuery,
8909
+ gridCtx,
8910
+ cellTooltip
8911
+ ) }, colDef.key);
8912
+ })
8659
8913
  }
8660
8914
  ),
8661
8915
  isDzExpanded && expandableArrayFields.map((dzKey) => {
@@ -10270,13 +10524,15 @@ export {
10270
10524
  BulkUpdater as default,
10271
10525
  formatComponentName,
10272
10526
  formatDisplayValue,
10527
+ formatFullTooltipValue,
10273
10528
  getActiveSortLabel,
10274
10529
  getAllNestedValues,
10275
10530
  getAvailableColumnsForCollection,
10531
+ getCellTooltipText,
10276
10532
  getEntryLifecycleStatus,
10277
10533
  getNestedValue,
10278
10534
  getPropertyValue,
10279
10535
  getSortOptionsForCollection,
10280
10536
  parseDynamicZonePath
10281
10537
  };
10282
- //# sourceMappingURL=BulkUpdater-B7XefFd9.mjs.map
10538
+ //# sourceMappingURL=BulkUpdater-C670oEo7.mjs.map