@firecms/core 3.0.0-canary.145 → 3.0.0-canary.146

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
@@ -2794,22 +2794,23 @@
2794
2794
  }
2795
2795
  return Math.abs(hash2);
2796
2796
  }
2797
- function getIcon(iconKey, className) {
2797
+ function getIcon(iconKey, className, color) {
2798
2798
  if (!iconKey) return void 0;
2799
2799
  iconKey = slugify(iconKey);
2800
2800
  if (!(iconKey in iconKeysMap)) {
2801
2801
  return void 0;
2802
2802
  }
2803
- return iconKey in iconKeysMap ? /* @__PURE__ */ jsxRuntime.jsx(ui.Icon, { iconKey, size: "medium", className }) : void 0;
2803
+ return iconKey in iconKeysMap ? /* @__PURE__ */ jsxRuntime.jsx(ui.Icon, { iconKey, size: "medium", className, color }) : void 0;
2804
2804
  }
2805
2805
  const IconForView = React.memo(
2806
2806
  function IconForView2({
2807
2807
  collectionOrView,
2808
2808
  className,
2809
+ color,
2809
2810
  size = "medium"
2810
2811
  }) {
2811
2812
  if (!collectionOrView) return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, {});
2812
- const icon = getIcon(collectionOrView.icon, className);
2813
+ const icon = getIcon(collectionOrView.icon, className, color);
2813
2814
  if (collectionOrView?.icon && icon)
2814
2815
  return icon;
2815
2816
  let slugName = slugify(("singularName" in collectionOrView ? collectionOrView.singularName : void 0) ?? collectionOrView.name);
@@ -2824,10 +2825,10 @@
2824
2825
  const iconsCount = ui.coolIconKeys.length;
2825
2826
  if (!key)
2826
2827
  key = ui.coolIconKeys[hashString(collectionOrView.path) % iconsCount];
2827
- return /* @__PURE__ */ jsxRuntime.jsx(ui.Icon, { iconKey: key, size, className });
2828
+ return /* @__PURE__ */ jsxRuntime.jsx(ui.Icon, { iconKey: key, size, className, color });
2828
2829
  },
2829
2830
  (prevProps, nextProps) => {
2830
- return equal(prevProps.collectionOrView?.icon, nextProps.collectionOrView?.icon);
2831
+ return equal(prevProps.collectionOrView?.icon, nextProps.collectionOrView?.icon) && equal(prevProps.color, nextProps.color);
2831
2832
  }
2832
2833
  );
2833
2834
  const iconKeysMap = ui.iconKeys.reduce((acc, key) => {
@@ -5058,7 +5059,7 @@
5058
5059
  hover: disabled ? void 0 : hover,
5059
5060
  size,
5060
5061
  children: [
5061
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: ui.cls("flex w-10 h-10 mr-2 shrink-0", size === "smallest" ? "my-0.5" : "m-2 self-start"), children: [
5062
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: ui.cls("flex w-10 h-10 ml-1 mr-2 shrink-0", size === "smallest" ? "my-0.5" : "m-2 self-start"), children: [
5062
5063
  imageProperty && /* @__PURE__ */ jsxRuntime.jsx(
5063
5064
  PropertyPreview,
5064
5065
  {
@@ -5068,7 +5069,15 @@
5068
5069
  value: getValueInPath(entity.values, imagePropertyKey)
5069
5070
  }
5070
5071
  ),
5071
- !imageProperty && /* @__PURE__ */ jsxRuntime.jsx(IconForView, { collectionOrView: collection, size, className: "m-auto" })
5072
+ !imageProperty && /* @__PURE__ */ jsxRuntime.jsx(
5073
+ IconForView,
5074
+ {
5075
+ collectionOrView: collection,
5076
+ color: "primary",
5077
+ size,
5078
+ className: "m-auto p-1"
5079
+ }
5080
+ )
5072
5081
  ] }),
5073
5082
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col grow-1 w-full max-w-full m-1", children: [
5074
5083
  size !== "smallest" && includeId && (entity ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: `${size !== "medium" ? "block whitespace-nowrap overflow-hidden truncate" : ""}`, children: /* @__PURE__ */ jsxRuntime.jsx(
@@ -5307,22 +5316,20 @@
5307
5316
  EntityPreviewContainer,
5308
5317
  {
5309
5318
  className: ui.cls(
5310
- "px-4 py-2 text-sm font-medium flex items-center uppercase",
5319
+ "px-3 py-2 text-sm font-medium flex items-center",
5311
5320
  multiselect ? "gap-4" : "gap-6",
5312
- disabled ? "text-surface-accent-500" : "cursor-pointer text-surface-accent-700 dark:text-surface-accent-300 hover:bg-surface-accent-50 dark:hover:bg-surface-800 group-hover:bg-surface-accent-50 dark:group-hover:bg-surface-800"
5321
+ disabled ? "text-surface-accent-500" : "cursor-pointer text-text-secondary dark:text-text-secondary-dark hover:bg-surface-accent-50 dark:hover:bg-surface-800 group-hover:bg-surface-accent-50 dark:group-hover:bg-surface-800"
5313
5322
  ),
5314
5323
  onClick: handleOpen,
5315
5324
  size: "medium",
5316
5325
  children: [
5317
5326
  /* @__PURE__ */ jsxRuntime.jsx(
5318
- IconForView,
5327
+ ui.EditIcon,
5319
5328
  {
5320
5329
  size: "small",
5321
- collectionOrView: collection,
5322
- className: "text-surface-300 dark:text-surface-600"
5330
+ className: "ml-2 mr-1 text-surface-300 dark:text-surface-600"
5323
5331
  }
5324
5332
  ),
5325
- "Edit ",
5326
5333
  title
5327
5334
  ]
5328
5335
  }
@@ -13098,7 +13105,6 @@
13098
13105
  const refreshNavigation = React.useCallback(async () => {
13099
13106
  if (authController.initialLoading)
13100
13107
  return;
13101
- console.log("refresh", authController);
13102
13108
  console.debug("Refreshing navigation");
13103
13109
  try {
13104
13110
  const [resolvedCollections = [], resolvedViews, resolvedAdminViews = []] = await Promise.all(
@@ -13319,9 +13325,7 @@
13319
13325
  resolvedCollections = injectCollections(resolvedCollections ?? []);
13320
13326
  }
13321
13327
  resolvedCollections = applyPermissionsFunctionIfEmpty(resolvedCollections, collectionPermissions);
13322
- console.log("resolvedCollections 2", resolvedCollections, collectionPermissions);
13323
13328
  resolvedCollections = filterOutNotAllowedCollections(resolvedCollections, authController);
13324
- console.log("resolvedCollections 3", resolvedCollections, authController);
13325
13329
  return resolvedCollections;
13326
13330
  }
13327
13331
  async function resolveCMSViews(baseViews, authController, dataSource) {