mirror of
https://github.com/rowyio/rowy.git
synced 2025-12-29 00:16:39 +01:00
move fullScreenButton to be shared, remove md settings
This commit is contained in:
@@ -10,7 +10,7 @@ import { ResizeBottomRight } from "@src/assets/icons";
|
|||||||
import useMonacoCustomizations, {
|
import useMonacoCustomizations, {
|
||||||
IUseMonacoCustomizationsProps,
|
IUseMonacoCustomizationsProps,
|
||||||
} from "./useMonacoCustomizations";
|
} from "./useMonacoCustomizations";
|
||||||
import FullScreenButton from "./FullScreenButton";
|
import FullScreenButton from "@src/components/FullScreenButton";
|
||||||
import { spreadSx } from "@src/utils/ui";
|
import { spreadSx } from "@src/utils/ui";
|
||||||
|
|
||||||
export interface ICodeEditorProps
|
export interface ICodeEditorProps
|
||||||
@@ -73,6 +73,7 @@ export default function CodeEditor({
|
|||||||
return (
|
return (
|
||||||
<TrapFocus open={fullScreen}>
|
<TrapFocus open={fullScreen}>
|
||||||
<Box
|
<Box
|
||||||
|
component="div"
|
||||||
sx={[boxSx, ...spreadSx(containerProps?.sx)]}
|
sx={[boxSx, ...spreadSx(containerProps?.sx)]}
|
||||||
style={fullScreen ? { height: "100%" } : {}}
|
style={fullScreen ? { height: "100%" } : {}}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import { ResizeBottomRight } from "@src/assets/icons";
|
|||||||
import useMonacoCustomizations, {
|
import useMonacoCustomizations, {
|
||||||
IUseMonacoCustomizationsProps,
|
IUseMonacoCustomizationsProps,
|
||||||
} from "./useMonacoCustomizations";
|
} from "./useMonacoCustomizations";
|
||||||
import FullScreenButton from "./FullScreenButton";
|
import FullScreenButton from "@src/components/FullScreenButton";
|
||||||
import { spreadSx } from "@src/utils/ui";
|
import { spreadSx } from "@src/utils/ui";
|
||||||
|
|
||||||
export interface IDiffEditorProps
|
export interface IDiffEditorProps
|
||||||
@@ -64,6 +64,7 @@ export default function DiffEditor({
|
|||||||
return (
|
return (
|
||||||
<TrapFocus open={fullScreen}>
|
<TrapFocus open={fullScreen}>
|
||||||
<Box
|
<Box
|
||||||
|
component="div"
|
||||||
sx={[boxSx, ...spreadSx(containerProps?.sx)]}
|
sx={[boxSx, ...spreadSx(containerProps?.sx)]}
|
||||||
style={fullScreen ? { height: "100%" } : {}}
|
style={fullScreen ? { height: "100%" } : {}}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -1,41 +0,0 @@
|
|||||||
import { ISettingsProps } from "@src/components/fields/types";
|
|
||||||
import MultiSelect from "@rowy/multiselect";
|
|
||||||
|
|
||||||
const languages = [
|
|
||||||
"javascript",
|
|
||||||
"typescript",
|
|
||||||
"json",
|
|
||||||
"html",
|
|
||||||
"css",
|
|
||||||
"scss",
|
|
||||||
"shell",
|
|
||||||
"yaml",
|
|
||||||
"xml",
|
|
||||||
"ruby",
|
|
||||||
"python",
|
|
||||||
"php",
|
|
||||||
"markdown",
|
|
||||||
"rust",
|
|
||||||
"csharp",
|
|
||||||
"cpp",
|
|
||||||
"c",
|
|
||||||
"java",
|
|
||||||
"go",
|
|
||||||
"plaintext",
|
|
||||||
];
|
|
||||||
|
|
||||||
export default function Settings({ config, onChange }: ISettingsProps) {
|
|
||||||
return (
|
|
||||||
<MultiSelect
|
|
||||||
searchable
|
|
||||||
multiple={false}
|
|
||||||
options={languages}
|
|
||||||
value={config.language ?? "javascript"}
|
|
||||||
onChange={(value) => {
|
|
||||||
onChange("language")(value);
|
|
||||||
}}
|
|
||||||
label="Language"
|
|
||||||
labelPlural="languages"
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -6,10 +6,6 @@ import { Markdown as MarkdownIcon } from "@src/assets/icons";
|
|||||||
import BasicCell from "./BasicCell";
|
import BasicCell from "./BasicCell";
|
||||||
import withSideDrawerEditor from "@src/components/Table/editors/withSideDrawerEditor";
|
import withSideDrawerEditor from "@src/components/Table/editors/withSideDrawerEditor";
|
||||||
|
|
||||||
const Settings = lazy(
|
|
||||||
() => import("./Settings" /* webpackChunkName: "Settings-markdown" */)
|
|
||||||
);
|
|
||||||
|
|
||||||
const SideDrawerField = lazy(
|
const SideDrawerField = lazy(
|
||||||
() =>
|
() =>
|
||||||
import(
|
import(
|
||||||
@@ -29,6 +25,5 @@ export const config: IFieldConfig = {
|
|||||||
TableCell: withBasicCell(BasicCell),
|
TableCell: withBasicCell(BasicCell),
|
||||||
TableEditor: withSideDrawerEditor(BasicCell),
|
TableEditor: withSideDrawerEditor(BasicCell),
|
||||||
SideDrawerField,
|
SideDrawerField,
|
||||||
settings: Settings,
|
|
||||||
};
|
};
|
||||||
export default config;
|
export default config;
|
||||||
|
|||||||
Reference in New Issue
Block a user