@firecms/core 3.0.0-canary.240 → 3.0.0-canary.242
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 +21 -14
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +21 -14
- package/dist/index.umd.js.map +1 -1
- package/dist/types/firecms.d.ts +2 -1
- package/dist/types/navigation.d.ts +5 -0
- package/package.json +5 -5
- package/src/components/EntityCollectionView/EntityCollectionView.tsx +1 -0
- package/src/components/VirtualTable/VirtualTable.tsx +2 -1
- package/src/components/VirtualTable/fields/VirtualTableInput.tsx +0 -1
- package/src/core/FireCMS.tsx +7 -1
- package/src/form/field_bindings/MarkdownEditorFieldBinding.tsx +1 -1
- package/src/form/field_bindings/MultiSelectFieldBinding.tsx +2 -2
- package/src/form/field_bindings/ReadOnlyFieldBinding.tsx +1 -1
- package/src/form/field_bindings/ReferenceFieldBinding.tsx +1 -1
- package/src/form/field_bindings/SelectFieldBinding.tsx +3 -2
- package/src/hooks/useBuildNavigationController.tsx +1 -0
- package/src/preview/components/ImagePreview.tsx +2 -2
- package/src/preview/property_previews/StringPropertyPreview.tsx +1 -1
- package/src/types/firecms.tsx +2 -1
- package/src/types/navigation.ts +6 -0
package/dist/index.es.js
CHANGED
|
@@ -4923,7 +4923,7 @@ function ImagePreview(t0) {
|
|
|
4923
4923
|
}
|
|
4924
4924
|
let t7;
|
|
4925
4925
|
if ($[13] !== url) {
|
|
4926
|
-
t7 = navigator && /* @__PURE__ */ jsx(Tooltip, { asChild: true, title: "Copy url to clipboard", side: "bottom", children: /* @__PURE__ */ jsx(IconButton, { variant: "filled", size: "
|
|
4926
|
+
t7 = navigator && /* @__PURE__ */ jsx(Tooltip, { asChild: true, title: "Copy url to clipboard", side: "bottom", children: /* @__PURE__ */ jsx(IconButton, { variant: "filled", size: "smallest", onClick: (e) => {
|
|
4927
4927
|
e.stopPropagation();
|
|
4928
4928
|
e.preventDefault();
|
|
4929
4929
|
return navigator.clipboard.writeText(url);
|
|
@@ -4942,7 +4942,7 @@ function ImagePreview(t0) {
|
|
|
4942
4942
|
}
|
|
4943
4943
|
let t9;
|
|
4944
4944
|
if ($[16] !== url) {
|
|
4945
|
-
t9 = /* @__PURE__ */ jsx(Tooltip, { title: "Open image in new tab", side: "bottom", children: /* @__PURE__ */ jsx(IconButton, { className: "invisible group-hover:visible", variant: "filled", component: "a", href: url, rel: "noopener noreferrer", target: "_blank", size: "
|
|
4945
|
+
t9 = /* @__PURE__ */ jsx(Tooltip, { title: "Open image in new tab", side: "bottom", children: /* @__PURE__ */ jsx(IconButton, { className: "invisible group-hover:visible", variant: "filled", component: "a", href: url, rel: "noopener noreferrer", target: "_blank", size: "smallest", onClick: _temp$q, children: t8 }) });
|
|
4946
4946
|
$[16] = url;
|
|
4947
4947
|
$[17] = t9;
|
|
4948
4948
|
} else {
|
|
@@ -5701,7 +5701,7 @@ function StringPropertyPreview(t0) {
|
|
|
5701
5701
|
let t1;
|
|
5702
5702
|
if ($[17] !== size || $[18] !== value) {
|
|
5703
5703
|
const lines = value.split("\n");
|
|
5704
|
-
t1 = value && value.includes("\n") ? /* @__PURE__ */ jsx("div", { className: cls("overflow-x-scroll", size === "small" ? "text-sm" : ""), children: lines.map((str, index) => /* @__PURE__ */ jsxs(React__default.Fragment, { children: [
|
|
5704
|
+
t1 = value && value.includes("\n") ? /* @__PURE__ */ jsx("div", { className: cls("overflow-x-scroll overflow-hidden", size === "small" ? "text-sm" : ""), children: lines.map((str, index) => /* @__PURE__ */ jsxs(React__default.Fragment, { children: [
|
|
5705
5705
|
/* @__PURE__ */ jsx("span", { children: str }),
|
|
5706
5706
|
index !== lines.length - 1 && /* @__PURE__ */ jsx("br", {})
|
|
5707
5707
|
] }, `string_preview_${index}`)) }) : size === "small" ? /* @__PURE__ */ jsx("span", { className: "text-sm", children: value }) : /* @__PURE__ */ jsx(Fragment, { children: value });
|
|
@@ -7267,7 +7267,6 @@ function VirtualTableInput(props) {
|
|
|
7267
7267
|
width: "100%",
|
|
7268
7268
|
color: "unset",
|
|
7269
7269
|
fontWeight: "unset",
|
|
7270
|
-
lineHeight: 1.7142857,
|
|
7271
7270
|
fontSize: "unset",
|
|
7272
7271
|
fontFamily: "unset",
|
|
7273
7272
|
background: "unset",
|
|
@@ -10621,7 +10620,10 @@ const VirtualTable = React__default.memo(function VirtualTable2({
|
|
|
10621
10620
|
const debouncedScroll = useDebounceCallback(onScrollProp, 200);
|
|
10622
10621
|
useEffect(() => {
|
|
10623
10622
|
if (tableRef.current && initialScroll) {
|
|
10624
|
-
|
|
10623
|
+
const {
|
|
10624
|
+
scrollLeft
|
|
10625
|
+
} = tableRef.current;
|
|
10626
|
+
tableRef.current.scrollTo(scrollLeft, initialScroll);
|
|
10625
10627
|
}
|
|
10626
10628
|
}, [tableRef, initialScroll]);
|
|
10627
10629
|
useEffect(() => {
|
|
@@ -14948,7 +14950,7 @@ function SelectFieldBinding(t0) {
|
|
|
14948
14950
|
const t10 = property.validation?.required;
|
|
14949
14951
|
let t11;
|
|
14950
14952
|
if ($[13] !== property.name || $[14] !== t10 || $[15] !== t9) {
|
|
14951
|
-
t11 = /* @__PURE__ */ jsx(LabelWithIcon, { icon: t9, required: t10, title: property.name, className: "h-
|
|
14953
|
+
t11 = /* @__PURE__ */ jsx(LabelWithIcon, { icon: t9, required: t10, title: property.name, className: "h-8 text-text-secondary dark:text-text-secondary-dark ml-3.5 my-0" });
|
|
14952
14954
|
$[13] = property.name;
|
|
14953
14955
|
$[14] = t10;
|
|
14954
14956
|
$[15] = t9;
|
|
@@ -14967,7 +14969,7 @@ function SelectFieldBinding(t0) {
|
|
|
14967
14969
|
}
|
|
14968
14970
|
let t13;
|
|
14969
14971
|
if ($[20] !== disabled || $[21] !== handleClearClick || $[22] !== property.clearable) {
|
|
14970
|
-
t13 = property.clearable && !disabled && /* @__PURE__ */ jsx(IconButton, { onClick: handleClearClick, children: /* @__PURE__ */ jsx(CloseIcon, {}) });
|
|
14972
|
+
t13 = property.clearable && !disabled && /* @__PURE__ */ jsx(IconButton, { size: "small", onClick: handleClearClick, children: /* @__PURE__ */ jsx(CloseIcon, { size: "small" }) });
|
|
14971
14973
|
$[20] = disabled;
|
|
14972
14974
|
$[21] = handleClearClick;
|
|
14973
14975
|
$[22] = property.clearable;
|
|
@@ -15080,7 +15082,7 @@ function MultiSelectFieldBinding({
|
|
|
15080
15082
|
] }, enumKey);
|
|
15081
15083
|
}, [enumValues, setValue, value]);
|
|
15082
15084
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
15083
|
-
/* @__PURE__ */ jsx(MultiSelect, { className: "w-full mt-2", size, value: validValue ? value.map((v_0) => v_0
|
|
15085
|
+
/* @__PURE__ */ jsx(MultiSelect, { className: "w-full mt-2", size, value: validValue ? value.map((v_0) => v_0?.toString()) : [], disabled, modalPopover: true, label: /* @__PURE__ */ jsx(LabelWithIconAndTooltip, { propertyKey, icon: getIconForProperty(property, "small"), required: property.validation?.required, title: property.name, className: "h-8 text-text-secondary dark:text-text-secondary-dark ml-3.5" }), onValueChange: (updatedValue) => {
|
|
15084
15086
|
let newValue;
|
|
15085
15087
|
if (of && of?.dataType === "number") {
|
|
15086
15088
|
newValue = updatedValue ? updatedValue.map((e_1) => parseFloat(e_1)) : [];
|
|
@@ -16135,7 +16137,7 @@ function ReadOnlyFieldBinding(t0) {
|
|
|
16135
16137
|
}
|
|
16136
16138
|
let t1;
|
|
16137
16139
|
if ($[0] !== minimalistView || $[1] !== property || $[2] !== propertyKey) {
|
|
16138
|
-
t1 = !minimalistView && /* @__PURE__ */ jsx(LabelWithIconAndTooltip, { propertyKey, icon: getIconForProperty(property, "small"), required: property.validation?.required, title: property.name, className: "h-
|
|
16140
|
+
t1 = !minimalistView && /* @__PURE__ */ jsx(LabelWithIconAndTooltip, { propertyKey, icon: getIconForProperty(property, "small"), required: property.validation?.required, title: property.name, className: "h-8 text-text-secondary dark:text-text-secondary-dark ml-3.5" });
|
|
16139
16141
|
$[0] = minimalistView;
|
|
16140
16142
|
$[1] = property;
|
|
16141
16143
|
$[2] = propertyKey;
|
|
@@ -16257,7 +16259,7 @@ function ReferenceFieldBindingInternal({
|
|
|
16257
16259
|
referenceDialogController.open();
|
|
16258
16260
|
};
|
|
16259
16261
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
16260
|
-
!minimalistView && /* @__PURE__ */ jsx(LabelWithIconAndTooltip, { propertyKey, icon: getIconForProperty(property, "small"), required: property.validation?.required, title: property.name, className: "h-
|
|
16262
|
+
!minimalistView && /* @__PURE__ */ jsx(LabelWithIconAndTooltip, { propertyKey, icon: getIconForProperty(property, "small"), required: property.validation?.required, title: property.name, className: "h-8 text-text-secondary dark:text-text-secondary-dark ml-3.5" }),
|
|
16261
16263
|
!collection && /* @__PURE__ */ jsx(ErrorView, { error: "The specified collection does not exist. Check console" }),
|
|
16262
16264
|
collection && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
16263
16265
|
value && /* @__PURE__ */ jsx(ReferencePreview, { disabled: !property.path, previewProperties: property.previewProperties, hover: !disabled, size, onClick: disabled || isSubmitting ? void 0 : onEntryClick, reference: value, includeEntityLink: property.includeEntityLink, includeId: property.includeId }),
|
|
@@ -17950,7 +17952,7 @@ function MarkdownEditorFieldBinding({
|
|
|
17950
17952
|
}, ...editorProps });
|
|
17951
17953
|
if (minimalistView) return editor;
|
|
17952
17954
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
17953
|
-
/* @__PURE__ */ jsx(LabelWithIconAndTooltip, { propertyKey, icon: getIconForProperty(property, "small"), required: property.validation?.required, title: property.name, className: "h-
|
|
17955
|
+
/* @__PURE__ */ jsx(LabelWithIconAndTooltip, { propertyKey, icon: getIconForProperty(property, "small"), required: property.validation?.required, title: property.name, className: "h-8 text-text-secondary dark:text-text-secondary-dark ml-3.5" }),
|
|
17954
17956
|
/* @__PURE__ */ jsx("div", { className: cls("rounded-md", fieldBackgroundMixin, disabled ? fieldBackgroundDisabledMixin : fieldBackgroundHoverMixin), children: editor }),
|
|
17955
17957
|
/* @__PURE__ */ jsx(FieldHelperText, { includeDescription, showError, error, property })
|
|
17956
17958
|
] });
|
|
@@ -18918,7 +18920,7 @@ const EntityCollectionView = React__default.memo(function EntityCollectionView2(
|
|
|
18918
18920
|
deleteEntityClicked && /* @__PURE__ */ jsx(DeleteEntityDialog, { entityOrEntitiesToDelete: deleteEntityClicked, path: fullPath, collection, callbacks: collection.callbacks, open: Boolean(deleteEntityClicked), onEntityDelete: internalOnEntityDelete, onMultipleEntitiesDelete: internalOnMultipleEntitiesDelete, onClose: () => setDeleteEntityClicked(void 0) })
|
|
18919
18921
|
] });
|
|
18920
18922
|
}, (a, b) => {
|
|
18921
|
-
return equal(a.path, b.path) && equal(a.parentCollectionIds, b.parentCollectionIds) && equal(a.isSubCollection, b.isSubCollection) && equal(a.className, b.className) && equal(a.properties, b.properties) && equal(a.propertiesOrder, b.propertiesOrder) && equal(a.hideIdFromCollection, b.hideIdFromCollection) && equal(a.inlineEditing, b.inlineEditing) && equal(a.selectionEnabled, b.selectionEnabled) && equal(a.selectionController, b.selectionController) && equal(a.Actions, b.Actions) && equal(a.defaultSize, b.defaultSize) && equal(a.initialFilter, b.initialFilter) && equal(a.initialSort, b.initialSort) && equal(a.textSearchEnabled, b.textSearchEnabled) && equal(a.additionalFields, b.additionalFields) && equal(a.sideDialogWidth, b.sideDialogWidth) && equal(a.openEntityMode, b.openEntityMode) && equal(a.exportable, b.exportable) && equal(a.history, b.history) && equal(a.forceFilter, b.forceFilter);
|
|
18923
|
+
return equal(a.path, b.path) && equal(a.parentCollectionIds, b.parentCollectionIds) && equal(a.isSubCollection, b.isSubCollection) && equal(a.className, b.className) && equal(a.properties, b.properties) && equal(a.propertiesOrder, b.propertiesOrder) && equal(a.hideIdFromCollection, b.hideIdFromCollection) && equal(a.inlineEditing, b.inlineEditing) && equal(a.selectionEnabled, b.selectionEnabled) && equal(a.selectionController, b.selectionController) && equal(a.Actions, b.Actions) && equal(a.defaultSize, b.defaultSize) && equal(a.initialFilter, b.initialFilter) && equal(a.initialSort, b.initialSort) && equal(a.includeJsonView, b.includeJsonView) && equal(a.textSearchEnabled, b.textSearchEnabled) && equal(a.additionalFields, b.additionalFields) && equal(a.sideDialogWidth, b.sideDialogWidth) && equal(a.openEntityMode, b.openEntityMode) && equal(a.exportable, b.exportable) && equal(a.history, b.history) && equal(a.forceFilter, b.forceFilter);
|
|
18922
18924
|
});
|
|
18923
18925
|
function EntitiesCount({
|
|
18924
18926
|
fullPath,
|
|
@@ -20485,7 +20487,8 @@ function useBuildNavigationController(props) {
|
|
|
20485
20487
|
getParentReferencesFromPath: getAllParentReferencesForPath,
|
|
20486
20488
|
getParentCollectionIds,
|
|
20487
20489
|
convertIdsToPaths,
|
|
20488
|
-
navigate
|
|
20490
|
+
navigate,
|
|
20491
|
+
plugins
|
|
20489
20492
|
};
|
|
20490
20493
|
}
|
|
20491
20494
|
function encodePath(input) {
|
|
@@ -22424,7 +22427,7 @@ function FireCMS(props) {
|
|
|
22424
22427
|
authController,
|
|
22425
22428
|
storageSource,
|
|
22426
22429
|
dataSourceDelegate,
|
|
22427
|
-
plugins,
|
|
22430
|
+
plugins: pluginsProp,
|
|
22428
22431
|
onAnalyticsEvent,
|
|
22429
22432
|
propertyConfigs,
|
|
22430
22433
|
entityViews,
|
|
@@ -22432,6 +22435,10 @@ function FireCMS(props) {
|
|
|
22432
22435
|
navigationController,
|
|
22433
22436
|
apiKey
|
|
22434
22437
|
} = props;
|
|
22438
|
+
if (pluginsProp) {
|
|
22439
|
+
console.warn("The `plugins` prop is deprecated in the FireCMS component. You should pass your plugins to `useBuildNavigationController` instead.");
|
|
22440
|
+
}
|
|
22441
|
+
const plugins = navigationController.plugins ?? pluginsProp;
|
|
22435
22442
|
const sideDialogsController = useBuildSideDialogsController();
|
|
22436
22443
|
const sideEntityController = useBuildSideEntityController(navigationController, sideDialogsController, authController);
|
|
22437
22444
|
const pluginsLoading = plugins?.some((p) => p.loading) ?? false;
|