This commit is contained in:
expdsn 2025-02-18 17:09:28 +08:00
parent f532a992e1
commit 0c08e7d230
4 changed files with 20 additions and 8707 deletions

View File

@ -5,17 +5,18 @@ import ImageUpload from '@/app/_ui/ImageUpload';
import { faArrowLeft, faRibbon } from '@fortawesome/free-solid-svg-icons'; import { faArrowLeft, faRibbon } from '@fortawesome/free-solid-svg-icons';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { BackTop, Button, Card, Col, DatePicker, Form, Grid, Input, InputNumber, message, Row, Select, Space, Upload } from 'antd'; import { BackTop, Button, Card, Col, DatePicker, Form, Grid, Input, InputNumber, message, Row, Select, Space, Upload } from 'antd';
import dynamic from 'next/dynamic';
import { useParams, useRouter } from 'next/navigation' import { useParams, useRouter } from 'next/navigation'
import { useState } from 'react';
// const MDEditor = dynamic(() => import('@uiw/react-md-editor'), { ssr: false });
import { MdEditor } from 'md-editor-rt';
import 'md-editor-rt/lib/style.css'; import 'md-editor-rt/lib/style.css';
import '@ant-design/v5-patch-for-react-19'; import '@ant-design/v5-patch-for-react-19';
import { mRequest } from '@/app/_lib/request'; import { mRequest } from '@/app/_lib/request';
import dayjs from 'dayjs'; import dayjs from 'dayjs';
import {Editor} from "@bytemd/react";
import gfm from '@bytemd/plugin-gfm'
const plugins = [
gfm(),
// Add more plugins here
]
export default function AddOrEdit({ editData }: { editData?: ArticleType | null }) { export default function AddOrEdit({ editData }: { editData?: ArticleType | null }) {
const router = useRouter() const router = useRouter()
console.log(editData); console.log(editData);
@ -148,7 +149,9 @@ export default function AddOrEdit({ editData }: { editData?: ArticleType | null
} }
]}> ]}>
{/* <MDEditor className='my-markdown ' /> */} {/* <MDEditor className='my-markdown ' /> */}
<MdEditor /> <Editor
plugins={plugins} value={''}
/>
</Form.Item> </Form.Item>
<Form.Item className="flex justify-end"> <Form.Item className="flex justify-end">

View File

@ -1,5 +1,5 @@
@import "tailwindcss"; @import "tailwindcss";
@import 'bytemd/dist/index.css';
:root { :root {
--background: #f9f9f9; --background: #f9f9f9;
--foreground: #171717; --foreground: #171717;

View File

@ -3,7 +3,7 @@
"version": "0.1.0", "version": "0.1.0",
"private": true, "private": true,
"scripts": { "scripts": {
"dev": "next dev", "dev": "next dev --turbopack",
"build": "next build", "build": "next build",
"pro-build": "node --max-old-space-size=1024 node_modules/next/dist/bin/next build", "pro-build": "node --max-old-space-size=1024 node_modules/next/dist/bin/next build",
"start": "next start", "start": "next start",
@ -12,6 +12,8 @@
"dependencies": { "dependencies": {
"@ant-design/icons": "^5.5.2", "@ant-design/icons": "^5.5.2",
"@ant-design/nextjs-registry": "^1.0.2", "@ant-design/nextjs-registry": "^1.0.2",
"@bytemd/plugin-gfm": "^1.22.0",
"@bytemd/react": "^1.22.0",
"@fortawesome/fontawesome-svg-core": "^6.7.2", "@fortawesome/fontawesome-svg-core": "^6.7.2",
"@fortawesome/free-solid-svg-icons": "^6.7.2", "@fortawesome/free-solid-svg-icons": "^6.7.2",
"@fortawesome/react-fontawesome": "^0.2.2", "@fortawesome/react-fontawesome": "^0.2.2",
@ -21,9 +23,9 @@
"ali-oss": "^6.22.0", "ali-oss": "^6.22.0",
"antd": "^5.23.2", "antd": "^5.23.2",
"bcrypt": "^5.1.1", "bcrypt": "^5.1.1",
"bytemd": "^1.22.0",
"clsx": "^2.1.1", "clsx": "^2.1.1",
"dayjs": "^1.11.13", "dayjs": "^1.11.13",
"icons": "link:@awesome.me/kit-KIT_CODE/icons",
"jose": "^5.9.6", "jose": "^5.9.6",
"jotai": "^2.11.1", "jotai": "^2.11.1",
"md-editor-rt": "^5.2.2", "md-editor-rt": "^5.2.2",
@ -49,5 +51,11 @@
"postcss": "^8.5.1", "postcss": "^8.5.1",
"tailwindcss": "^4.0.4", "tailwindcss": "^4.0.4",
"typescript": "^5" "typescript": "^5"
},
"pnpm": {
"onlyBuiltDependencies": [
"bcrypt",
"sharp"
]
} }
} }

File diff suppressed because it is too large Load Diff