@firecms/core 3.0.0-canary.145 → 3.0.0-canary.147
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 +20 -16
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +20 -16
- package/dist/index.umd.js.map +1 -1
- package/dist/types/auth.d.ts +0 -6
- package/dist/util/icons.d.ts +3 -1
- package/package.json +5 -5
- package/src/components/EntityCollectionTable/fields/TableReferenceField.tsx +6 -7
- package/src/components/EntityPreview.tsx +5 -3
- package/src/hooks/useBuildNavigationController.tsx +0 -3
- package/src/types/auth.tsx +0 -6
- package/src/util/icons.tsx +12 -8
package/dist/index.es.js
CHANGED
|
@@ -2790,22 +2790,23 @@ function hashString(str) {
|
|
|
2790
2790
|
}
|
|
2791
2791
|
return Math.abs(hash2);
|
|
2792
2792
|
}
|
|
2793
|
-
function getIcon(iconKey, className) {
|
|
2793
|
+
function getIcon(iconKey, className, color) {
|
|
2794
2794
|
if (!iconKey) return void 0;
|
|
2795
2795
|
iconKey = slugify(iconKey);
|
|
2796
2796
|
if (!(iconKey in iconKeysMap)) {
|
|
2797
2797
|
return void 0;
|
|
2798
2798
|
}
|
|
2799
|
-
return iconKey in iconKeysMap ? /* @__PURE__ */ jsx(Icon, { iconKey, size: "medium", className }) : void 0;
|
|
2799
|
+
return iconKey in iconKeysMap ? /* @__PURE__ */ jsx(Icon, { iconKey, size: "medium", className, color }) : void 0;
|
|
2800
2800
|
}
|
|
2801
2801
|
const IconForView = React__default.memo(
|
|
2802
2802
|
function IconForView2({
|
|
2803
2803
|
collectionOrView,
|
|
2804
2804
|
className,
|
|
2805
|
+
color,
|
|
2805
2806
|
size = "medium"
|
|
2806
2807
|
}) {
|
|
2807
2808
|
if (!collectionOrView) return /* @__PURE__ */ jsx(Fragment, {});
|
|
2808
|
-
const icon = getIcon(collectionOrView.icon, className);
|
|
2809
|
+
const icon = getIcon(collectionOrView.icon, className, color);
|
|
2809
2810
|
if (collectionOrView?.icon && icon)
|
|
2810
2811
|
return icon;
|
|
2811
2812
|
let slugName = slugify(("singularName" in collectionOrView ? collectionOrView.singularName : void 0) ?? collectionOrView.name);
|
|
@@ -2820,10 +2821,10 @@ const IconForView = React__default.memo(
|
|
|
2820
2821
|
const iconsCount = coolIconKeys.length;
|
|
2821
2822
|
if (!key)
|
|
2822
2823
|
key = coolIconKeys[hashString(collectionOrView.path) % iconsCount];
|
|
2823
|
-
return /* @__PURE__ */ jsx(Icon, { iconKey: key, size, className });
|
|
2824
|
+
return /* @__PURE__ */ jsx(Icon, { iconKey: key, size, className, color });
|
|
2824
2825
|
},
|
|
2825
2826
|
(prevProps, nextProps) => {
|
|
2826
|
-
return equal(prevProps.collectionOrView?.icon, nextProps.collectionOrView?.icon);
|
|
2827
|
+
return equal(prevProps.collectionOrView?.icon, nextProps.collectionOrView?.icon) && equal(prevProps.color, nextProps.color);
|
|
2827
2828
|
}
|
|
2828
2829
|
);
|
|
2829
2830
|
const iconKeysMap = iconKeys.reduce((acc, key) => {
|
|
@@ -5054,7 +5055,7 @@ function EntityPreview({
|
|
|
5054
5055
|
hover: disabled ? void 0 : hover,
|
|
5055
5056
|
size,
|
|
5056
5057
|
children: [
|
|
5057
|
-
/* @__PURE__ */ jsxs("div", { className: cls("flex w-10 h-10 mr-2 shrink-0", size === "smallest" ? "my-0.5" : "m-2 self-start"), children: [
|
|
5058
|
+
/* @__PURE__ */ jsxs("div", { className: cls("flex w-10 h-10 ml-1 mr-2 shrink-0", size === "smallest" ? "my-0.5" : "m-2 self-start"), children: [
|
|
5058
5059
|
imageProperty && /* @__PURE__ */ jsx(
|
|
5059
5060
|
PropertyPreview,
|
|
5060
5061
|
{
|
|
@@ -5064,7 +5065,15 @@ function EntityPreview({
|
|
|
5064
5065
|
value: getValueInPath(entity.values, imagePropertyKey)
|
|
5065
5066
|
}
|
|
5066
5067
|
),
|
|
5067
|
-
!imageProperty && /* @__PURE__ */ jsx(
|
|
5068
|
+
!imageProperty && /* @__PURE__ */ jsx(
|
|
5069
|
+
IconForView,
|
|
5070
|
+
{
|
|
5071
|
+
collectionOrView: collection,
|
|
5072
|
+
color: "primary",
|
|
5073
|
+
size,
|
|
5074
|
+
className: "m-auto p-1"
|
|
5075
|
+
}
|
|
5076
|
+
)
|
|
5068
5077
|
] }),
|
|
5069
5078
|
/* @__PURE__ */ jsxs("div", { className: "flex flex-col grow-1 w-full max-w-full m-1", children: [
|
|
5070
5079
|
size !== "smallest" && includeId && (entity ? /* @__PURE__ */ jsx("div", { className: `${size !== "medium" ? "block whitespace-nowrap overflow-hidden truncate" : ""}`, children: /* @__PURE__ */ jsx(
|
|
@@ -5303,22 +5312,20 @@ const TableReferenceFieldInternal = React__default.memo(
|
|
|
5303
5312
|
EntityPreviewContainer,
|
|
5304
5313
|
{
|
|
5305
5314
|
className: cls(
|
|
5306
|
-
"px-
|
|
5315
|
+
"px-3 py-2 text-sm font-medium flex items-center",
|
|
5307
5316
|
multiselect ? "gap-4" : "gap-6",
|
|
5308
|
-
disabled ? "text-surface-accent-500" : "cursor-pointer text-
|
|
5317
|
+
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"
|
|
5309
5318
|
),
|
|
5310
5319
|
onClick: handleOpen,
|
|
5311
5320
|
size: "medium",
|
|
5312
5321
|
children: [
|
|
5313
5322
|
/* @__PURE__ */ jsx(
|
|
5314
|
-
|
|
5323
|
+
EditIcon,
|
|
5315
5324
|
{
|
|
5316
5325
|
size: "small",
|
|
5317
|
-
|
|
5318
|
-
className: "text-surface-300 dark:text-surface-600"
|
|
5326
|
+
className: "ml-2 mr-1 text-surface-300 dark:text-surface-600"
|
|
5319
5327
|
}
|
|
5320
5328
|
),
|
|
5321
|
-
"Edit ",
|
|
5322
5329
|
title
|
|
5323
5330
|
]
|
|
5324
5331
|
}
|
|
@@ -13094,7 +13101,6 @@ function useBuildNavigationController(props) {
|
|
|
13094
13101
|
const refreshNavigation = useCallback(async () => {
|
|
13095
13102
|
if (authController.initialLoading)
|
|
13096
13103
|
return;
|
|
13097
|
-
console.log("refresh", authController);
|
|
13098
13104
|
console.debug("Refreshing navigation");
|
|
13099
13105
|
try {
|
|
13100
13106
|
const [resolvedCollections = [], resolvedViews, resolvedAdminViews = []] = await Promise.all(
|
|
@@ -13315,9 +13321,7 @@ async function resolveCollections(collections, collectionPermissions, authContro
|
|
|
13315
13321
|
resolvedCollections = injectCollections(resolvedCollections ?? []);
|
|
13316
13322
|
}
|
|
13317
13323
|
resolvedCollections = applyPermissionsFunctionIfEmpty(resolvedCollections, collectionPermissions);
|
|
13318
|
-
console.log("resolvedCollections 2", resolvedCollections, collectionPermissions);
|
|
13319
13324
|
resolvedCollections = filterOutNotAllowedCollections(resolvedCollections, authController);
|
|
13320
|
-
console.log("resolvedCollections 3", resolvedCollections, authController);
|
|
13321
13325
|
return resolvedCollections;
|
|
13322
13326
|
}
|
|
13323
13327
|
async function resolveCMSViews(baseViews, authController, dataSource) {
|