2022-05-24 20:34:28 +10:00
|
|
|
import { lazy } from "react";
|
|
|
|
|
import { IFieldConfig, FieldType } from "@src/components/fields/types";
|
2022-11-17 18:17:43 +11:00
|
|
|
import withRenderTableCell from "@src/components/Table/TableCell/withRenderTableCell";
|
2022-05-24 20:34:28 +10:00
|
|
|
|
|
|
|
|
import CodeIcon from "@mui/icons-material/Code";
|
2022-11-09 18:39:14 +11:00
|
|
|
import DisplayCell from "./DisplayCell";
|
2022-05-24 20:34:28 +10:00
|
|
|
|
2023-04-30 14:58:40 +05:30
|
|
|
import BasicContextMenuActions from "@src/components/Table/ContextMenu/BasicCellContextMenuActions";
|
|
|
|
|
|
2022-05-24 20:34:28 +10:00
|
|
|
const Settings = lazy(
|
2022-06-06 15:59:27 +10:00
|
|
|
() => import("./Settings" /* webpackChunkName: "Settings-Code" */)
|
2022-05-24 20:34:28 +10:00
|
|
|
);
|
|
|
|
|
|
|
|
|
|
const SideDrawerField = lazy(
|
|
|
|
|
() =>
|
|
|
|
|
import("./SideDrawerField" /* webpackChunkName: "SideDrawerField-Code" */)
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
export const config: IFieldConfig = {
|
|
|
|
|
type: FieldType.code,
|
|
|
|
|
name: "Code",
|
|
|
|
|
group: "Code",
|
|
|
|
|
dataType: "string",
|
|
|
|
|
initialValue: "",
|
|
|
|
|
initializable: true,
|
|
|
|
|
icon: <CodeIcon />,
|
|
|
|
|
description: "Raw code edited with the Monaco Editor.",
|
2022-11-17 18:17:43 +11:00
|
|
|
TableCell: withRenderTableCell(DisplayCell, SideDrawerField, "popover", {
|
2022-11-10 18:21:32 +11:00
|
|
|
popoverProps: {
|
|
|
|
|
anchorOrigin: { vertical: "top", horizontal: "center" },
|
|
|
|
|
PaperProps: { sx: { borderRadius: 1 } },
|
|
|
|
|
},
|
|
|
|
|
}),
|
2022-05-24 20:34:28 +10:00
|
|
|
SideDrawerField,
|
|
|
|
|
settings: Settings,
|
2023-04-30 14:58:40 +05:30
|
|
|
contextMenuActions: BasicContextMenuActions,
|
2024-02-01 16:45:51 +05:30
|
|
|
keywords: ["snippet", "block"]
|
2022-05-24 20:34:28 +10:00
|
|
|
};
|
|
|
|
|
export default config;
|