@firecms/core 3.0.0-canary.161 → 3.0.0-canary.162

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/index.umd.js CHANGED
@@ -5580,10 +5580,10 @@
5580
5580
  const titleProperty = getEntityTitlePropertyKey(resolvedCollection, customizationController.propertyConfigs);
5581
5581
  const imagePropertyKey = getEntityImagePreviewPropertyKey(resolvedCollection);
5582
5582
  const imageProperty = imagePropertyKey ? resolvedCollection.properties[imagePropertyKey] : void 0;
5583
- const usedImageProperty = "of" in imageProperty ? imageProperty.of : imageProperty;
5583
+ const usedImageProperty = imageProperty && "of" in imageProperty ? imageProperty.of : imageProperty;
5584
5584
  const restProperties = listProperties.filter((p) => p !== titleProperty && p !== imagePropertyKey);
5585
- const imageValue = getValueInPath(entity.values, imagePropertyKey);
5586
- const usedImageValue = "of" in imageProperty ? (imageValue ?? []).length > 0 ? imageValue[0] : void 0 : imageValue;
5585
+ const imageValue = imagePropertyKey ? getValueInPath(entity.values, imagePropertyKey) : void 0;
5586
+ const usedImageValue = imageProperty !== void 0 ? "of" in imageProperty ? (imageValue ?? []).length > 0 ? imageValue[0] : void 0 : imageValue : void 0;
5587
5587
  return /* @__PURE__ */ jsxRuntime.jsxs(EntityPreviewContainer, { onClick: disabled ? void 0 : onClick, hover: disabled ? void 0 : hover, size, children: [
5588
5588
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: ui.cls("flex w-10 h-10 ml-1 mr-2 shrink-0", size === "small" ? "my-0.5" : "m-2 self-start"), children: [
5589
5589
  usedImageProperty && usedImageValue && /* @__PURE__ */ jsxRuntime.jsx(PropertyPreview, { property: usedImageProperty, propertyKey: imagePropertyKey, size: "small", value: usedImageValue }),
@@ -5593,11 +5593,11 @@
5593
5593
  "maxWidth": "calc(100% - 96px)"
5594
5594
  }, children: [
5595
5595
  size !== "small" && includeId && (entity ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "block whitespace-nowrap overflow-hidden truncate", children: /* @__PURE__ */ jsxRuntime.jsx(ui.Typography, { variant: "caption", color: "disabled", className: "font-mono", children: entity.id }) }) : /* @__PURE__ */ jsxRuntime.jsx(ui.Skeleton, {})),
5596
- titleProperty && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "my-0.5 text-sm font-medium", children: entity ? /* @__PURE__ */ jsxRuntime.jsx(PropertyPreview, { propertyKey: titleProperty, value: getValueInPath(entity.values, titleProperty), property: resolvedCollection.properties[titleProperty], size: "large" }) : /* @__PURE__ */ jsxRuntime.jsx(SkeletonPropertyComponent, { property: resolvedCollection.properties[titleProperty], size: "large" }) }),
5596
+ titleProperty && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "truncate my-0.5 text-sm font-medium", children: entity ? /* @__PURE__ */ jsxRuntime.jsx(PropertyPreview, { propertyKey: titleProperty, value: getValueInPath(entity.values, titleProperty), property: resolvedCollection.properties[titleProperty], size: "large" }) : /* @__PURE__ */ jsxRuntime.jsx(SkeletonPropertyComponent, { property: resolvedCollection.properties[titleProperty], size: "large" }) }),
5597
5597
  restProperties && restProperties.map((key) => {
5598
5598
  const childProperty = resolvedCollection.properties[key];
5599
5599
  if (!childProperty) return null;
5600
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: restProperties.length > 1 ? "my-0.5" : "my-0", children: entity ? /* @__PURE__ */ jsxRuntime.jsx(PropertyPreview, { propertyKey: key, value: getValueInPath(entity.values, key), property: childProperty, size: "small" }) : /* @__PURE__ */ jsxRuntime.jsx(SkeletonPropertyComponent, { property: childProperty, size: "small" }) }, "ref_prev_" + key);
5600
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: ui.cls("truncate", restProperties.length > 1 ? "my-0.5" : "my-0"), children: entity ? /* @__PURE__ */ jsxRuntime.jsx(PropertyPreview, { propertyKey: key, value: getValueInPath(entity.values, key), property: childProperty, size: "small" }) : /* @__PURE__ */ jsxRuntime.jsx(SkeletonPropertyComponent, { property: childProperty, size: "small" }) }, "ref_prev_" + key);
5601
5601
  })
5602
5602
  ] }),
5603
5603
  entity && includeEntityLink && /* @__PURE__ */ jsxRuntime.jsx(ui.Tooltip, { title: `See details for ${entity.id}`, className: "shrink-0", children: /* @__PURE__ */ jsxRuntime.jsx(ui.IconButton, { color: "inherit", size: "medium", className: size !== "small" ? "self-start" : "", onClick: (e) => {
@@ -11575,7 +11575,7 @@
11575
11575
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
11576
11576
  /* @__PURE__ */ jsxRuntime.jsx(LabelWithIconAndTooltip, { propertyKey: key_0, icon: /* @__PURE__ */ jsxRuntime.jsx(ui.NotesIcon, { size: "small" }), title: additionalField.name, className: "text-text-secondary dark:text-text-secondary-dark ml-3.5" }),
11577
11577
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: ui.cls(ui.paperMixin, "min-h-14 p-4 md:p-6 overflow-x-scroll no-scrollbar"), children: /* @__PURE__ */ jsxRuntime.jsx(ErrorBoundary, { children: child }) })
11578
- ] });
11578
+ ] }, `additional_${key_0}`);
11579
11579
  }
11580
11580
  console.warn(`Property ${key_0} not found in collection ${resolvedCollection.name} in properties or additional fields. Skipping.`);
11581
11581
  return null;
@@ -15870,7 +15870,7 @@
15870
15870
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: ui.cls(ui.defaultBorderMixin, "last:border-b-0 border-b"), children: [
15871
15871
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-row pt-0.5 pb-0.5 gap-2", children: [
15872
15872
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "min-w-[140px] w-[25%] py-1", children: /* @__PURE__ */ jsxRuntime.jsx(ui.Typography, { variant: "caption", className: "font-mono break-words", color: "secondary", children: key }) }, `table-cell-title-${key}-${key}`),
15873
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-grow max-w-[75%]", children: childValue && "toString" in childValue && /* @__PURE__ */ jsxRuntime.jsx(ui.Typography, { children: /* @__PURE__ */ jsxRuntime.jsx(ErrorBoundary, { children: childValue.toString() }) }) })
15873
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-grow max-w-[75%]", children: childValue && /* @__PURE__ */ jsxRuntime.jsx(ui.Typography, { children: /* @__PURE__ */ jsxRuntime.jsx(ErrorBoundary, { children: childValue.toString() }) }) })
15874
15874
  ] }),
15875
15875
  typeof childValue === "object" && /* @__PURE__ */ jsxRuntime.jsx("div", { className: ui.cls(ui.defaultBorderMixin, "border-l pl-4"), children: /* @__PURE__ */ jsxRuntime.jsx(KeyValuePreview, { value: childValue }) })
15876
15876
  ] }, `map_preview_table_${key}}`);