@firecms/core 3.0.0-canary.161 → 3.0.0-canary.163
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 +18 -18
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +18 -18
- package/dist/index.umd.js.map +1 -1
- package/package.json +5 -5
- package/src/components/EntityCollectionTable/EntityCollectionTable.tsx +2 -4
- package/src/components/EntityCollectionView/EntityCollectionView.tsx +1 -1
- package/src/components/EntityCollectionView/useSelectionController.tsx +5 -4
- package/src/components/EntityPreview.tsx +9 -5
- package/src/core/EntityEditView.tsx +2 -3
- package/src/preview/property_previews/MapPropertyPreview.tsx +1 -1
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) => {
|
|
@@ -8855,7 +8855,6 @@
|
|
|
8855
8855
|
const selectedEntities = (selectionController?.selectedEntities?.length > 0 ? selectionController?.selectedEntities : highlightedEntities)?.filter(Boolean);
|
|
8856
8856
|
const context = useFireCMSContext();
|
|
8857
8857
|
const [size, setSize] = React.useState(defaultSize ?? "m");
|
|
8858
|
-
const selectedEntityIds = selectedEntities?.map((e) => e.id);
|
|
8859
8858
|
const updateSize = React.useCallback((size_0) => {
|
|
8860
8859
|
if (onSizeChanged) onSizeChanged(size_0);
|
|
8861
8860
|
setSize(size_0);
|
|
@@ -8911,7 +8910,7 @@
|
|
|
8911
8910
|
context
|
|
8912
8911
|
})?.toString() });
|
|
8913
8912
|
return /* @__PURE__ */ jsxRuntime.jsx(EntityTableCell, { width, size, value: value_0, selected: false, disabled: true, align: "left", allowScroll: false, showExpandIcon: false, disabledTooltip: "This column can't be edited directly", children: /* @__PURE__ */ jsxRuntime.jsx(ErrorBoundary, { children: child }) }, `additional_table_cell_${entity_0.id}_${column_0.key}`);
|
|
8914
|
-
}, [size
|
|
8913
|
+
}, [size]);
|
|
8915
8914
|
const collectionColumns = (() => {
|
|
8916
8915
|
const columnsResult = propertiesToColumns({
|
|
8917
8916
|
properties,
|
|
@@ -8961,14 +8960,14 @@
|
|
|
8961
8960
|
} else {
|
|
8962
8961
|
throw Error("Internal: columns not mapped properly");
|
|
8963
8962
|
}
|
|
8964
|
-
} catch (
|
|
8965
|
-
console.error("Error rendering cell",
|
|
8966
|
-
return /* @__PURE__ */ jsxRuntime.jsx(EntityTableCell, { size, width: column_1.width, saved: false, value: null, align: "left", fullHeight: false, disabled: true, children: /* @__PURE__ */ jsxRuntime.jsx(ErrorView, { error:
|
|
8963
|
+
} catch (e) {
|
|
8964
|
+
console.error("Error rendering cell", e);
|
|
8965
|
+
return /* @__PURE__ */ jsxRuntime.jsx(EntityTableCell, { size, width: column_1.width, saved: false, value: null, align: "left", fullHeight: false, disabled: true, children: /* @__PURE__ */ jsxRuntime.jsx(ErrorView, { error: e }) });
|
|
8967
8966
|
}
|
|
8968
8967
|
}, [tableRowActionsBuilder, additionalCellRenderer, propertyCellRenderer, size]);
|
|
8969
8968
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { ref, style, className: ui.cls("h-full w-full flex flex-col bg-white dark:bg-surface-950", className), children: [
|
|
8970
8969
|
/* @__PURE__ */ jsxRuntime.jsx(CollectionTableToolbar, { onTextSearch: textSearchEnabled ? onTextSearch : void 0, textSearchLoading, onTextSearchClick: textSearchEnabled ? onTextSearchClick : void 0, size, onSizeChanged: updateSize, title, actionsStart, actions, loading: tableController.dataLoading }),
|
|
8971
|
-
/* @__PURE__ */ jsxRuntime.jsx(SelectableTable, { columns, size, inlineEditing, cellRenderer, onEntityClick, highlightedRow:
|
|
8970
|
+
/* @__PURE__ */ jsxRuntime.jsx(SelectableTable, { columns, size, inlineEditing, cellRenderer, onEntityClick, highlightedRow: (entity_1) => Boolean(selectedEntities?.find((e_0) => e_0.id === entity_1.id && e_0.path === entity_1.path)), tableController, onValueChange, onColumnResize, hoverRow, filterable, emptyComponent, endAdornment, AddColumnComponent })
|
|
8972
8971
|
] });
|
|
8973
8972
|
};
|
|
8974
8973
|
function useDataOrder({
|
|
@@ -9163,9 +9162,10 @@
|
|
|
9163
9162
|
const toggleEntitySelection = React.useCallback((entity, newSelectedState) => {
|
|
9164
9163
|
let newValue;
|
|
9165
9164
|
if (newSelectedState === void 0) {
|
|
9166
|
-
|
|
9165
|
+
const isSelected = Boolean(selectedEntities.find((e) => e.id === entity.id && e.path === entity.path));
|
|
9166
|
+
if (isSelected) {
|
|
9167
9167
|
onSelectionChange?.(entity, false);
|
|
9168
|
-
newValue = selectedEntities.filter((item) => item.id
|
|
9168
|
+
newValue = selectedEntities.filter((item) => !(item.id === entity.id && item.path === entity.path));
|
|
9169
9169
|
} else {
|
|
9170
9170
|
onSelectionChange?.(entity, true);
|
|
9171
9171
|
newValue = [...selectedEntities, entity];
|
|
@@ -9176,13 +9176,13 @@
|
|
|
9176
9176
|
newValue = [...selectedEntities, entity];
|
|
9177
9177
|
} else {
|
|
9178
9178
|
onSelectionChange?.(entity, false);
|
|
9179
|
-
newValue = selectedEntities.filter((item_0) => item_0.id
|
|
9179
|
+
newValue = selectedEntities.filter((item_0) => !(item_0.id === entity.id && item_0.path === entity.path));
|
|
9180
9180
|
}
|
|
9181
9181
|
}
|
|
9182
9182
|
setSelectedEntities(newValue);
|
|
9183
9183
|
}, [selectedEntities]);
|
|
9184
9184
|
const isEntitySelected = React.useCallback((entity_0) => {
|
|
9185
|
-
return selectedEntities.
|
|
9185
|
+
return Boolean(selectedEntities.find((e_0) => e_0.id === entity_0.id && e_0.path === entity_0.path));
|
|
9186
9186
|
}, [selectedEntities]);
|
|
9187
9187
|
return {
|
|
9188
9188
|
selectedEntities,
|
|
@@ -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;
|
|
@@ -12392,7 +12392,7 @@
|
|
|
12392
12392
|
width: width_0,
|
|
12393
12393
|
frozen
|
|
12394
12394
|
}) => {
|
|
12395
|
-
const isSelected = usedSelectionController.selectedEntities.
|
|
12395
|
+
const isSelected = Boolean(usedSelectionController.selectedEntities.find((e_1) => e_1.id == entity_6.id && e_1.path == entity_6.path));
|
|
12396
12396
|
const actions_0 = getActionsForEntity({
|
|
12397
12397
|
entity: entity_6,
|
|
12398
12398
|
customEntityActions: collection.entityActions
|
|
@@ -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 &&
|
|
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}}`);
|