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