@firecms/core 3.0.0-canary.109 → 3.0.0-canary.110
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/form/field_bindings/MarkdownEditorFieldBinding.d.ts +3 -1
- package/dist/index.es.js +20 -16
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +19 -15
- package/dist/index.umd.js.map +1 -1
- package/package.json +5 -5
- package/src/components/HomePage/SmallNavigationCard.tsx +1 -2
- package/src/core/DefaultAppBar.tsx +1 -1
- package/src/core/EntityEditView.tsx +34 -31
- package/src/core/SideDialogs.tsx +3 -0
- package/src/form/field_bindings/MarkdownEditorFieldBinding.tsx +8 -5
- package/src/form/field_bindings/StorageUploadFieldBinding.tsx +1 -3
- package/src/hooks/data/save.ts +0 -1
- package/src/internal/useBuildSideEntityController.tsx +4 -2
- package/src/internal/useUnsavedChangesDialog.tsx +3 -1
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { FieldProps } from "../../index";
|
|
2
|
+
import { FireCMSEditorProps } from "@firecms/editor";
|
|
2
3
|
interface MarkdownEditorFieldProps {
|
|
3
4
|
highlight?: {
|
|
4
5
|
from: number;
|
|
5
6
|
to: number;
|
|
6
7
|
};
|
|
8
|
+
editorProps?: Partial<FireCMSEditorProps>;
|
|
7
9
|
}
|
|
8
|
-
export declare function MarkdownEditorFieldBinding({ property, propertyKey, value, setValue, includeDescription, showError, error, minimalistView, isSubmitting, context, customProps,
|
|
10
|
+
export declare function MarkdownEditorFieldBinding({ property, propertyKey, value, setValue, includeDescription, showError, error, minimalistView, isSubmitting, context, customProps, }: FieldProps<string, MarkdownEditorFieldProps>): import("react/jsx-runtime").JSX.Element;
|
|
9
11
|
export {};
|
package/dist/index.es.js
CHANGED
|
@@ -4,7 +4,7 @@ import React__default, { useRef, useEffect, useContext, useCallback, useMemo, us
|
|
|
4
4
|
import { SnackbarProvider as SnackbarProvider$1, useSnackbar } from "notistack";
|
|
5
5
|
import hash from "object-hash";
|
|
6
6
|
import { useCreateFormex, Formex, setIn, Field, getIn, useFormex } from "@firecms/formex";
|
|
7
|
-
import { getColorSchemeForSeed, CHIP_COLORS, Tooltip, ErrorIcon, Typography, CircleIcon, FunctionsIcon, iconKeys, coolIconKeys, Icon, IconButton, ContentCopyIcon, OpenInNewIcon, DescriptionIcon, cls, Skeleton, Chip, defaultBorderMixin, KeyboardTabIcon, Checkbox, Markdown, TextareaAutosize, MultiSelect, MultiSelectItem, Select, SelectItem, BooleanSwitch, DateTimeField, paperMixin, ErrorOutlineIcon, EditIcon, RemoveCircleIcon, Menu, MoreVertIcon, MenuItem, CircularProgress, SearchBar, Badge, ArrowUpwardIcon, Popover, FilterListIcon, Button, AssignmentIcon, CenteredView, Label, TextField, ClearIcon, BooleanSwitchWithLabel, useOutsideAlerter, Dialog, DialogContent, DialogActions, FileCopyIcon, ArchiveIcon, DeleteIcon, AddIcon, ExpandablePanel, Card, ArrowForwardIcon, cardMixin, cardClickableMixin,
|
|
7
|
+
import { getColorSchemeForSeed, CHIP_COLORS, Tooltip, ErrorIcon, Typography, CircleIcon, FunctionsIcon, iconKeys, coolIconKeys, Icon, IconButton, ContentCopyIcon, OpenInNewIcon, DescriptionIcon, cls, Skeleton, Chip, defaultBorderMixin, KeyboardTabIcon, Checkbox, Markdown, TextareaAutosize, MultiSelect, MultiSelectItem, Select, SelectItem, BooleanSwitch, DateTimeField, paperMixin, ErrorOutlineIcon, EditIcon, RemoveCircleIcon, Menu, MoreVertIcon, MenuItem, CircularProgress, SearchBar, Badge, ArrowUpwardIcon, Popover, FilterListIcon, Button, AssignmentIcon, CenteredView, Label, TextField, ClearIcon, BooleanSwitchWithLabel, useOutsideAlerter, Dialog, DialogContent, DialogActions, FileCopyIcon, ArchiveIcon, DeleteIcon, AddIcon, ExpandablePanel, Card, ArrowForwardIcon, cardMixin, cardClickableMixin, StarIcon, StarBorderIcon, Collapse, Container, FilterListOffIcon, SearchIcon, LoadingButton, Avatar, DarkModeIcon, LightModeIcon, LogoutIcon, fieldBackgroundHoverMixin, HandleIcon, RemoveIcon, debounce, InfoIcon, CloseIcon, fieldBackgroundMixin, fieldBackgroundDisabledMixin, ArrowDropDownIcon, ShortTextIcon, SubjectIcon, FormatQuoteIcon, HttpIcon, EmailIcon, FlagIcon, ListIcon, ListAltIcon, NumbersIcon, FormatListNumberedIcon, UploadFileIcon, DriveFolderUploadIcon, LinkIcon, AddLinkIcon, ScheduleIcon, BallotIcon, RepeatIcon, ViewStreamIcon, NotesIcon, Tab, Tabs, Alert, Sheet, useLocaleConfig, MenuIcon, ChevronLeftIcon } from "@firecms/ui";
|
|
8
8
|
import equal from "react-fast-compare";
|
|
9
9
|
import { Link, useNavigate, useLocation, UNSAFE_NavigationContext, NavLink, Route, Routes } from "react-router-dom";
|
|
10
10
|
import { format } from "date-fns";
|
|
@@ -3601,7 +3601,6 @@ async function saveEntityWithCallbacks({
|
|
|
3601
3601
|
previousValues,
|
|
3602
3602
|
status
|
|
3603
3603
|
}).then((entity) => {
|
|
3604
|
-
console.log("Entity saved");
|
|
3605
3604
|
try {
|
|
3606
3605
|
if (callbacks?.onSaveSuccess) {
|
|
3607
3606
|
const resolvedCollection = resolveCollection({
|
|
@@ -11241,7 +11240,6 @@ function SmallNavigationCard({
|
|
|
11241
11240
|
className: cls(
|
|
11242
11241
|
cardMixin,
|
|
11243
11242
|
cardClickableMixin,
|
|
11244
|
-
focusedMixin,
|
|
11245
11243
|
"cursor-pointer flex flex-row items-center px-4 py-2 text-inherit dark:text-inherit visited:text-inherit visited:dark:text-inherit hover:text-inherit hover:dark:text-inherit "
|
|
11246
11244
|
),
|
|
11247
11245
|
to: url,
|
|
@@ -13218,7 +13216,7 @@ const DefaultAppBar = function DefaultAppBar2({
|
|
|
13218
13216
|
{
|
|
13219
13217
|
variant: "subtitle1",
|
|
13220
13218
|
noWrap: true,
|
|
13221
|
-
className: cls("
|
|
13219
|
+
className: cls("transition-all", drawerOpen ? "ml-2" : ""),
|
|
13222
13220
|
children: title
|
|
13223
13221
|
}
|
|
13224
13222
|
) : title
|
|
@@ -14411,7 +14409,6 @@ function FileDropComponent({
|
|
|
14411
14409
|
disabled ? fieldBackgroundDisabledMixin : fieldBackgroundHoverMixin,
|
|
14412
14410
|
dropZoneClasses,
|
|
14413
14411
|
multipleFilesSupported && internalValue.length ? "" : "flex",
|
|
14414
|
-
focusedMixin,
|
|
14415
14412
|
{
|
|
14416
14413
|
[nonActiveDropClasses]: !isDragActive,
|
|
14417
14414
|
[activeDropClasses]: isDragActive,
|
|
@@ -14478,7 +14475,7 @@ function FileDropComponent({
|
|
|
14478
14475
|
ref: provided.innerRef,
|
|
14479
14476
|
...provided.draggableProps,
|
|
14480
14477
|
...provided.dragHandleProps,
|
|
14481
|
-
className: cls(
|
|
14478
|
+
className: cls("rounded-md"),
|
|
14482
14479
|
style: {
|
|
14483
14480
|
...provided.draggableProps.style
|
|
14484
14481
|
},
|
|
@@ -16228,10 +16225,10 @@ function MarkdownEditorFieldBinding({
|
|
|
16228
16225
|
minimalistView,
|
|
16229
16226
|
isSubmitting,
|
|
16230
16227
|
context,
|
|
16231
|
-
customProps
|
|
16232
|
-
...props
|
|
16228
|
+
customProps
|
|
16233
16229
|
}) {
|
|
16234
16230
|
const highlight = customProps?.highlight;
|
|
16231
|
+
const editorProps = customProps?.editorProps;
|
|
16235
16232
|
const storageSource = useStorageSource();
|
|
16236
16233
|
const storage = property.storage;
|
|
16237
16234
|
const entityValues = context.values;
|
|
@@ -16302,7 +16299,8 @@ function MarkdownEditorFieldBinding({
|
|
|
16302
16299
|
throw new Error("Error uploading image");
|
|
16303
16300
|
}
|
|
16304
16301
|
return url;
|
|
16305
|
-
}
|
|
16302
|
+
},
|
|
16303
|
+
...editorProps
|
|
16306
16304
|
}
|
|
16307
16305
|
);
|
|
16308
16306
|
if (minimalistView)
|
|
@@ -17408,7 +17406,7 @@ function EntityEditViewInner({
|
|
|
17408
17406
|
sideEntityController.replace({
|
|
17409
17407
|
path,
|
|
17410
17408
|
entityId: updatedEntity.id,
|
|
17411
|
-
selectedSubPath: selectedTabRef.current,
|
|
17409
|
+
selectedSubPath: MAIN_TAB_VALUE === selectedTabRef.current ? void 0 : selectedTabRef.current,
|
|
17412
17410
|
updateUrl: true,
|
|
17413
17411
|
collection
|
|
17414
17412
|
});
|
|
@@ -17883,7 +17881,7 @@ function EntityEditViewInner({
|
|
|
17883
17881
|
)
|
|
17884
17882
|
] });
|
|
17885
17883
|
function buildForm() {
|
|
17886
|
-
let form = /* @__PURE__ */ jsxs(
|
|
17884
|
+
let form = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
17887
17885
|
pluginActions.length > 0 && /* @__PURE__ */ jsx(
|
|
17888
17886
|
"div",
|
|
17889
17887
|
{
|
|
@@ -17891,7 +17889,7 @@ function EntityEditViewInner({
|
|
|
17891
17889
|
children: pluginActions
|
|
17892
17890
|
}
|
|
17893
17891
|
),
|
|
17894
|
-
/* @__PURE__ */ jsxs("div", { className: "pt-12 pb-16 pl-8 pr-8 md:pl-10 md:pr-10", children: [
|
|
17892
|
+
/* @__PURE__ */ jsx("div", { className: "h-full overflow-auto", children: /* @__PURE__ */ jsxs("div", { className: "pt-12 pb-16 pl-8 pr-8 md:pl-10 md:pr-10", children: [
|
|
17895
17893
|
/* @__PURE__ */ jsxs(
|
|
17896
17894
|
"div",
|
|
17897
17895
|
{
|
|
@@ -17939,7 +17937,7 @@ function EntityEditViewInner({
|
|
|
17939
17937
|
),
|
|
17940
17938
|
/* @__PURE__ */ jsx("div", { className: "h-14" })
|
|
17941
17939
|
] })
|
|
17942
|
-
] })
|
|
17940
|
+
] }) })
|
|
17943
17941
|
] });
|
|
17944
17942
|
if (plugins) {
|
|
17945
17943
|
plugins.forEach((plugin) => {
|
|
@@ -18081,7 +18079,7 @@ function EntityEditViewInner({
|
|
|
18081
18079
|
role: "tabpanel",
|
|
18082
18080
|
hidden: !mainViewVisible,
|
|
18083
18081
|
id: `form_${path}`,
|
|
18084
|
-
className: " w-full",
|
|
18082
|
+
className: "relative w-full",
|
|
18085
18083
|
children: globalLoading ? /* @__PURE__ */ jsx(CircularProgressCenter, {}) : entityView
|
|
18086
18084
|
}
|
|
18087
18085
|
),
|
|
@@ -18180,8 +18178,10 @@ function UnsavedChangesDialog({
|
|
|
18180
18178
|
return /* @__PURE__ */ jsxs(
|
|
18181
18179
|
Dialog,
|
|
18182
18180
|
{
|
|
18181
|
+
onEscapeKeyDown: () => {
|
|
18182
|
+
handleCancel();
|
|
18183
|
+
},
|
|
18183
18184
|
open,
|
|
18184
|
-
onOpenChange: (open2) => open2 ? handleCancel() : handleOk(),
|
|
18185
18185
|
children: [
|
|
18186
18186
|
/* @__PURE__ */ jsxs(DialogContent, { children: [
|
|
18187
18187
|
/* @__PURE__ */ jsx(Typography, { variant: "h6", children: title }),
|
|
@@ -18246,6 +18246,7 @@ function SideDialogView({
|
|
|
18246
18246
|
const handleDrawerCloseOk = () => {
|
|
18247
18247
|
setBlocked(false);
|
|
18248
18248
|
setDrawerCloseRequested(false);
|
|
18249
|
+
console.log("handleDrawerCloseOk");
|
|
18249
18250
|
sideDialogsController.close();
|
|
18250
18251
|
panel?.onClose?.();
|
|
18251
18252
|
};
|
|
@@ -18253,9 +18254,11 @@ function SideDialogView({
|
|
|
18253
18254
|
setDrawerCloseRequested(false);
|
|
18254
18255
|
};
|
|
18255
18256
|
const onCloseRequest = (force) => {
|
|
18257
|
+
console.log("onCloseRequest", blocked, force);
|
|
18256
18258
|
if (blocked && !force) {
|
|
18257
18259
|
setDrawerCloseRequested(true);
|
|
18258
18260
|
} else {
|
|
18261
|
+
console.log("onCloseRequest closing");
|
|
18259
18262
|
sideDialogsController.close();
|
|
18260
18263
|
panel?.onClose?.();
|
|
18261
18264
|
}
|
|
@@ -18534,12 +18537,13 @@ const propsToSidePanel = (props, buildUrlCollectionPath, resolveAliasesFrom, sma
|
|
|
18534
18537
|
...props,
|
|
18535
18538
|
path: resolvedPath
|
|
18536
18539
|
};
|
|
18540
|
+
const entityViewWidth = getEntityViewWidth(props, smallLayout);
|
|
18537
18541
|
return {
|
|
18538
18542
|
key: `${props.path}/${props.entityId}`,
|
|
18539
18543
|
component: /* @__PURE__ */ jsx(EntitySidePanel, { ...resolvedPanelProps }),
|
|
18540
18544
|
urlPath: newPath,
|
|
18541
18545
|
parentUrlPath: buildUrlCollectionPath(collectionPath),
|
|
18542
|
-
width:
|
|
18546
|
+
width: entityViewWidth,
|
|
18543
18547
|
onClose: props.onClose
|
|
18544
18548
|
};
|
|
18545
18549
|
};
|