Skip to content

Commit

Permalink
add clean button
Browse files Browse the repository at this point in the history
  • Loading branch information
zmh-program committed Oct 26, 2023
1 parent 741e7c4 commit 0b282df
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 8 deletions.
32 changes: 32 additions & 0 deletions app/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 11 additions & 6 deletions app/src/assets/editor.less
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,15 @@
}

.editor-toolbar {
display: grid;
grid-auto-flow: column;
align-items: flex-end;
gap: 4px;
width: max-content;
margin: 4px 0 4px auto;
display: flex;
width: 100%;
margin: 8px 0 4px;

& > * {
margin-right: 4px;

&:last-child {
margin-right: 0;
}
}
}
10 changes: 9 additions & 1 deletion app/src/components/EditorProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@ import {
DialogTitle,
DialogTrigger,
} from "./ui/dialog.tsx";
import { Maximize, Image, MenuSquare, PanelRight } from "lucide-react";
import {Maximize, Image, MenuSquare, PanelRight, XSquare} from "lucide-react";
import { useTranslation } from "react-i18next";
import "../assets/editor.less";
import { Textarea } from "./ui/textarea.tsx";
import Markdown from "./Markdown.tsx";
import { useEffect, useRef, useState } from "react";
import { Toggle } from "./ui/toggle.tsx";
import { mobile } from "../utils.ts";
import {Button} from "./ui/button.tsx";

type RichEditorProps = {
value: string;
Expand Down Expand Up @@ -64,6 +65,13 @@ function RichEditor({
return (
<div className={`editor-container`}>
<div className={`editor-toolbar`}>
<Button
variant={`outline`}
className={`h-8 w-8 p-0`}
onClick={() => value && onChange("")}
>
<XSquare className={`h-3.5 w-3.5`} />
</Button>
<div className={`grow`} />
<Toggle
variant={`outline`}
Expand Down
2 changes: 1 addition & 1 deletion app/src/conf.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import axios from "axios";
import { Model } from "./conversation/types.ts";

export const version = "3.5.17";
export const version = "3.5.18";
export const dev: boolean = window.location.hostname === "localhost";
export const deploy: boolean = true;
export let rest_api: string = "http://localhost:8094";
Expand Down

0 comments on commit 0b282df

Please sign in to comment.