@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 +7 -7
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +7 -7
- package/dist/index.umd.js.map +1 -1
- package/package.json +5 -5
- package/src/components/EntityPreview.tsx +9 -5
- package/src/core/EntityEditView.tsx +2 -3
- package/src/preview/property_previews/MapPropertyPreview.tsx +1 -1
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@firecms/core",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "3.0.0-canary.
|
|
4
|
+
"version": "3.0.0-canary.162",
|
|
5
5
|
"description": "Awesome Firebase/Firestore-based headless open-source CMS",
|
|
6
6
|
"funding": {
|
|
7
7
|
"url": "https://github.com/sponsors/firecmsco"
|
|
@@ -50,9 +50,9 @@
|
|
|
50
50
|
"./package.json": "./package.json"
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
|
-
"@firecms/editor": "^3.0.0-canary.
|
|
54
|
-
"@firecms/formex": "^3.0.0-canary.
|
|
55
|
-
"@firecms/ui": "^3.0.0-canary.
|
|
53
|
+
"@firecms/editor": "^3.0.0-canary.162",
|
|
54
|
+
"@firecms/formex": "^3.0.0-canary.162",
|
|
55
|
+
"@firecms/ui": "^3.0.0-canary.162",
|
|
56
56
|
"@hello-pangea/dnd": "^17.0.0",
|
|
57
57
|
"@radix-ui/react-portal": "^1.1.2",
|
|
58
58
|
"clsx": "^2.1.1",
|
|
@@ -106,7 +106,7 @@
|
|
|
106
106
|
"dist",
|
|
107
107
|
"src"
|
|
108
108
|
],
|
|
109
|
-
"gitHead": "
|
|
109
|
+
"gitHead": "a1b322b8cdcd05a1598baefce37c89124d96cd79",
|
|
110
110
|
"publishConfig": {
|
|
111
111
|
"access": "public"
|
|
112
112
|
},
|
|
@@ -71,11 +71,15 @@ export function EntityPreview({
|
|
|
71
71
|
const titleProperty = getEntityTitlePropertyKey(resolvedCollection, customizationController.propertyConfigs);
|
|
72
72
|
const imagePropertyKey = getEntityImagePreviewPropertyKey(resolvedCollection);
|
|
73
73
|
const imageProperty = imagePropertyKey ? resolvedCollection.properties[imagePropertyKey] : undefined;
|
|
74
|
-
const usedImageProperty = "of" in imageProperty ? imageProperty.of : imageProperty;
|
|
74
|
+
const usedImageProperty = imageProperty && "of" in imageProperty ? imageProperty.of : imageProperty;
|
|
75
75
|
const restProperties = listProperties.filter(p => p !== titleProperty && p !== imagePropertyKey);
|
|
76
76
|
|
|
77
|
-
const imageValue = getValueInPath(entity.values, imagePropertyKey
|
|
78
|
-
const usedImageValue =
|
|
77
|
+
const imageValue = imagePropertyKey ? getValueInPath(entity.values, imagePropertyKey) : undefined;
|
|
78
|
+
const usedImageValue = imageProperty !== undefined ? ("of" in imageProperty
|
|
79
|
+
? ((imageValue ?? []).length > 0
|
|
80
|
+
? imageValue[0] : undefined)
|
|
81
|
+
: imageValue)
|
|
82
|
+
: undefined;
|
|
79
83
|
|
|
80
84
|
return <EntityPreviewContainer onClick={disabled ? undefined : onClick}
|
|
81
85
|
hover={disabled ? undefined : hover}
|
|
@@ -108,7 +112,7 @@ export function EntityPreview({
|
|
|
108
112
|
: <Skeleton/>)}
|
|
109
113
|
|
|
110
114
|
{titleProperty && (
|
|
111
|
-
<div className={"my-0.5 text-sm font-medium"}>
|
|
115
|
+
<div className={"truncate my-0.5 text-sm font-medium"}>
|
|
112
116
|
{
|
|
113
117
|
entity
|
|
114
118
|
? <PropertyPreview
|
|
@@ -129,7 +133,7 @@ export function EntityPreview({
|
|
|
129
133
|
|
|
130
134
|
return (
|
|
131
135
|
<div key={"ref_prev_" + key}
|
|
132
|
-
className={restProperties.length > 1 ? "my-0.5" : "my-0"}>
|
|
136
|
+
className={cls("truncate", restProperties.length > 1 ? "my-0.5" : "my-0")}>
|
|
133
137
|
{
|
|
134
138
|
entity
|
|
135
139
|
? <PropertyPreview
|
|
@@ -785,7 +785,7 @@ export function EntityEditViewInner<M extends Record<string, any>>({
|
|
|
785
785
|
})?.toString()}
|
|
786
786
|
</>;
|
|
787
787
|
return (
|
|
788
|
-
<div>
|
|
788
|
+
<div key={`additional_${key}`}>
|
|
789
789
|
<LabelWithIconAndTooltip
|
|
790
790
|
propertyKey={key}
|
|
791
791
|
icon={<NotesIcon size={"small"}/>}
|
|
@@ -808,8 +808,7 @@ export function EntityEditViewInner<M extends Record<string, any>>({
|
|
|
808
808
|
})
|
|
809
809
|
.filter(Boolean)}
|
|
810
810
|
|
|
811
|
-
</>
|
|
812
|
-
);
|
|
811
|
+
</>);
|
|
813
812
|
|
|
814
813
|
const disabled = formex.isSubmitting || (!modified && status === "existing");
|
|
815
814
|
const formRef = React.useRef<HTMLDivElement>(null);
|
|
@@ -127,7 +127,7 @@ export function KeyValuePreview({ value }: { value: any }) {
|
|
|
127
127
|
</div>
|
|
128
128
|
<div
|
|
129
129
|
className="flex-grow max-w-[75%]">
|
|
130
|
-
{childValue &&
|
|
130
|
+
{childValue && <Typography>
|
|
131
131
|
<ErrorBoundary>
|
|
132
132
|
{childValue.toString()}
|
|
133
133
|
</ErrorBoundary>
|