chore: remove unused dependencies

pull/2843/head
Steven 1 year ago
parent 932f636d84
commit 8db90a040c

@ -12,8 +12,7 @@
"@emotion/react": "^11.11.3",
"@emotion/styled": "^11.11.0",
"@matejmazur/react-katex": "^3.1.3",
"@mui/base": "5.0.0-beta.32",
"@mui/joy": "5.0.0-beta.23",
"@mui/joy": "5.0.0-beta.24",
"@reduxjs/toolkit": "^1.9.7",
"axios": "^1.6.7",
"classnames": "^2.5.1",
@ -23,10 +22,7 @@
"i18next-browser-languagedetector": "^7.2.0",
"katex": "^0.16.9",
"lodash-es": "^4.17.21",
"long": "^5.2.3",
"lucide-react": "^0.309.0",
"nice-grpc-web": "^3.3.2",
"protobufjs": "^7.2.6",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-hot-toast": "^2.4.1",
@ -59,8 +55,11 @@
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-react": "^7.33.2",
"less": "^4.2.0",
"long": "^5.2.3",
"nice-grpc-web": "^3.3.2",
"postcss": "^8.4.33",
"prettier": "^3.2.4",
"protobufjs": "^7.2.6",
"typescript": "^5.3.3",
"vite": "^5.0.12"
},

@ -17,12 +17,9 @@ dependencies:
'@matejmazur/react-katex':
specifier: ^3.1.3
version: 3.1.3(katex@0.16.9)(react@18.2.0)
'@mui/base':
specifier: 5.0.0-beta.32
version: 5.0.0-beta.32(@types/react@18.2.48)(react-dom@18.2.0)(react@18.2.0)
'@mui/joy':
specifier: 5.0.0-beta.23
version: 5.0.0-beta.23(@emotion/react@11.11.3)(@emotion/styled@11.11.0)(@types/react@18.2.48)(react-dom@18.2.0)(react@18.2.0)
specifier: 5.0.0-beta.24
version: 5.0.0-beta.24(@emotion/react@11.11.3)(@emotion/styled@11.11.0)(@types/react@18.2.48)(react-dom@18.2.0)(react@18.2.0)
'@reduxjs/toolkit':
specifier: ^1.9.7
version: 1.9.7(react-redux@8.1.3)(react@18.2.0)
@ -50,18 +47,9 @@ dependencies:
lodash-es:
specifier: ^4.17.21
version: 4.17.21
long:
specifier: ^5.2.3
version: 5.2.3
lucide-react:
specifier: ^0.309.0
version: 0.309.0(react@18.2.0)
nice-grpc-web:
specifier: ^3.3.2
version: 3.3.2(ws@8.16.0)
protobufjs:
specifier: ^7.2.6
version: 7.2.6
react:
specifier: ^18.2.0
version: 18.2.0
@ -154,12 +142,21 @@ devDependencies:
less:
specifier: ^4.2.0
version: 4.2.0
long:
specifier: ^5.2.3
version: 5.2.3
nice-grpc-web:
specifier: ^3.3.2
version: 3.3.2(ws@8.16.0)
postcss:
specifier: ^8.4.33
version: 8.4.33
prettier:
specifier: ^3.2.4
version: 3.2.4
protobufjs:
specifier: ^7.2.6
version: 7.2.6
typescript:
specifier: ^5.3.3
version: 5.3.3
@ -963,8 +960,8 @@ packages:
react: 18.2.0
dev: false
/@mui/base@5.0.0-beta.32(@types/react@18.2.48)(react-dom@18.2.0)(react@18.2.0):
resolution: {integrity: sha512-4VptvYeLUYMJhZapWBkD50GmKfOc0XT381KJcTK3ncZYIl8MdBhpR6l8jOyeP5cixUPBJhstjrnmQEAHjCLriw==}
/@mui/base@5.0.0-beta.33(@types/react@18.2.48)(react-dom@18.2.0)(react@18.2.0):
resolution: {integrity: sha512-WcSpoJUw/UYHXpvgtl4HyMar2Ar97illUpqiS/X1gtSBp6sdDW6kB2BJ9OlVQ+Kk/RL2GDp/WHA9sbjAYV35ow==}
engines: {node: '>=12.0.0'}
peerDependencies:
'@types/react': ^17.0.0 || ^18.0.0
@ -990,8 +987,8 @@ packages:
resolution: {integrity: sha512-0aoWS4qvk1uzm9JBs83oQmIMIQeTBUeqqu8u+3uo2tMznrB5fIKqQVCbCgq+4Tm4jG+5F7dIvnjvQ2aV7UKtdw==}
dev: false
/@mui/joy@5.0.0-beta.23(@emotion/react@11.11.3)(@emotion/styled@11.11.0)(@types/react@18.2.48)(react-dom@18.2.0)(react@18.2.0):
resolution: {integrity: sha512-Yik+eMYGuZ4ccYYREsaz3TT/h932Hp+tKkQQ1JuRbPtE7EA1zW4ZaO9MuIuMt1/CnmVsPiXnE52A7ElBHCz9uQ==}
/@mui/joy@5.0.0-beta.24(@emotion/react@11.11.3)(@emotion/styled@11.11.0)(@types/react@18.2.48)(react-dom@18.2.0)(react@18.2.0):
resolution: {integrity: sha512-cKlIW56GsKKo9cVm+6pzNS+s4ch3r/SX/Zq5DA10I/TSuW9O5ptIOqeSs+WYpkyAzIoPkCpEXCPR/vGHpOt6MA==}
engines: {node: '>=12.0.0'}
peerDependencies:
'@emotion/react': ^11.5.0
@ -1010,7 +1007,7 @@ packages:
'@babel/runtime': 7.23.9
'@emotion/react': 11.11.3(@types/react@18.2.48)(react@18.2.0)
'@emotion/styled': 11.11.0(@emotion/react@11.11.3)(@types/react@18.2.48)(react@18.2.0)
'@mui/base': 5.0.0-beta.32(@types/react@18.2.48)(react-dom@18.2.0)(react@18.2.0)
'@mui/base': 5.0.0-beta.33(@types/react@18.2.48)(react-dom@18.2.0)(react@18.2.0)
'@mui/core-downloads-tracker': 5.15.6
'@mui/system': 5.15.6(@emotion/react@11.11.3)(@emotion/styled@11.11.0)(@types/react@18.2.48)(react@18.2.0)
'@mui/types': 7.2.13(@types/react@18.2.48)
@ -1156,46 +1153,46 @@ packages:
/@protobufjs/aspromise@1.1.2:
resolution: {integrity: sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ==}
dev: false
dev: true
/@protobufjs/base64@1.1.2:
resolution: {integrity: sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==}
dev: false
dev: true
/@protobufjs/codegen@2.0.4:
resolution: {integrity: sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==}
dev: false
dev: true
/@protobufjs/eventemitter@1.1.0:
resolution: {integrity: sha512-j9ednRT81vYJ9OfVuXG6ERSTdEL1xVsNgqpkxMsbIabzSo3goCjDIveeGv5d03om39ML71RdmrGNjG5SReBP/Q==}
dev: false
dev: true
/@protobufjs/fetch@1.1.0:
resolution: {integrity: sha512-lljVXpqXebpsijW71PZaCYeIcE5on1w5DlQy5WH6GLbFryLUrBD4932W/E2BSpfRJWseIL4v/KPgBFxDOIdKpQ==}
dependencies:
'@protobufjs/aspromise': 1.1.2
'@protobufjs/inquire': 1.1.0
dev: false
dev: true
/@protobufjs/float@1.0.2:
resolution: {integrity: sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ==}
dev: false
dev: true
/@protobufjs/inquire@1.1.0:
resolution: {integrity: sha512-kdSefcPdruJiFMVSbn801t4vFK7KB/5gd2fYvrxhuJYg8ILrmn9SKSX2tZdV6V+ksulWqS7aXjBcRXl3wHoD9Q==}
dev: false
dev: true
/@protobufjs/path@1.1.2:
resolution: {integrity: sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA==}
dev: false
dev: true
/@protobufjs/pool@1.1.0:
resolution: {integrity: sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw==}
dev: false
dev: true
/@protobufjs/utf8@1.1.0:
resolution: {integrity: sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==}
dev: false
dev: true
/@reduxjs/toolkit@1.9.7(react-redux@8.1.3)(react@18.2.0):
resolution: {integrity: sha512-t7v8ZPxhhKgOKtU+uyJT13lu4vL7az5aFi4IdoDs/eS548edn2M8Ik9h8fxgvMjGoAUVFSt6ZC1P5cWmQ014QQ==}
@ -1411,6 +1408,7 @@ packages:
resolution: {integrity: sha512-GPmeN1C3XAyV5uybAf4cMLWT9fDWcmQhZVtMFu7OR32WjrqGG+Wnk2V1d0bmtUyE/Zy1QJ9BxyiTih9z8Oks8A==}
dependencies:
undici-types: 5.26.5
dev: true
/@types/parse-json@4.0.2:
resolution: {integrity: sha512-dISoDXWWQwUquiKsyZ4Ng+HX2KsPL7LyHKHQwgGFEA3IaKac4Obd+h2a/a6waisAoepJlBcx9paWqjA8/HVjCw==}
@ -1612,7 +1610,7 @@ packages:
/abort-controller-x@0.4.3:
resolution: {integrity: sha512-VtUwTNU8fpMwvWGn4xE93ywbogTYsuT+AUxAXOeelbXuQVIwNmC5YLeho9sH4vZ4ITW8414TTAOG1nW6uIVHCA==}
dev: false
dev: true
/acorn-jsx@5.3.2(acorn@8.11.3):
resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==}
@ -2962,7 +2960,7 @@ packages:
ws: '*'
dependencies:
ws: 8.16.0
dev: false
dev: true
/iterator.prototype@1.1.2:
resolution: {integrity: sha512-DR33HMMr8EzwuRL8Y9D3u2BMj8+RqSE850jfGu59kS7tbmPLzGkZmVSfyCFSDxuZiEY6Rzt3T2NA/qU+NwVj1w==}
@ -2994,7 +2992,7 @@ packages:
/js-base64@3.7.6:
resolution: {integrity: sha512-NPrWuHFxFUknr1KqJRDgUQPexQF0uIJWjeT+2KjEePhitQxQEx5EJBG1lVn5/hc8aLycTpXrDOgPQ6Zq+EDiTA==}
dev: false
dev: true
/js-cookie@2.2.1:
resolution: {integrity: sha512-HvdH2LzI/EAZcUwA8+0nKNtWHqS+ZmijLA30RwZA0bo7ToCckjK5MkGhjED9KoRcXO6BaGI3I9UIzSA1FKFPOQ==}
@ -3122,7 +3120,7 @@ packages:
/long@5.2.3:
resolution: {integrity: sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q==}
dev: false
dev: true
/loose-envify@1.4.0:
resolution: {integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==}
@ -3272,7 +3270,7 @@ packages:
resolution: {integrity: sha512-7RNWbls5kAL1QVUOXvBsv1uO0wPQK3lHv+cY1gwkTzirnG1Nop4cBJZubpgziNbaVc/bl9QJcyvsf/NQxa3rjQ==}
dependencies:
ts-error: 1.0.6
dev: false
dev: true
/nice-grpc-web@3.3.2(ws@8.16.0):
resolution: {integrity: sha512-qetU+H6y6jVvI5NZdtTls9UdqdCNwhr4UxqL5SfH6v8ISxucxDVPRYxnZaoZyWjMRvRgAKiQDIMu0bB0oedD0A==}
@ -3283,7 +3281,7 @@ packages:
nice-grpc-common: 2.0.2
transitivePeerDependencies:
- ws
dev: false
dev: true
/node-releases@2.0.14:
resolution: {integrity: sha512-y10wOWt8yZpqXmOgRo77WaHEmhYQYGNA6y421PKsKYWEK8aW+cqAphborZDhqfyKrbZEN92CN1X2KbafY2s7Yw==}
@ -3577,7 +3575,7 @@ packages:
'@protobufjs/utf8': 1.1.0
'@types/node': 20.11.7
long: 5.2.3
dev: false
dev: true
/proxy-from-env@1.1.0:
resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==}
@ -4243,7 +4241,7 @@ packages:
/ts-error@1.0.6:
resolution: {integrity: sha512-tLJxacIQUM82IR7JO1UUkKlYuUTmoY9HBJAmNWFzheSlDS5SPMcNIepejHJa4BpPQLAcbRhRf3GDJzyj6rbKvA==}
dev: false
dev: true
/ts-interface-checker@0.1.13:
resolution: {integrity: sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==}
@ -4319,6 +4317,7 @@ packages:
/undici-types@5.26.5:
resolution: {integrity: sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==}
dev: true
/update-browserslist-db@1.0.13(browserslist@4.22.3):
resolution: {integrity: sha512-xebP81SNcPuNpPP3uzeW1NYXxI3rxyJzF3pD6sH4jE7o/IX+WtSpwnVU+qIsDPyk0d3hmFQ7mjqc6AtV604hbg==}
@ -4484,7 +4483,7 @@ packages:
optional: true
utf-8-validate:
optional: true
dev: false
dev: true
/yallist@3.1.1:
resolution: {integrity: sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==}

@ -1,6 +1,6 @@
import { ClickAwayListener } from "@mui/base/ClickAwayListener";
import { Dropdown, IconButton, Menu, MenuButton } from "@mui/joy";
import { useEffect, useState } from "react";
import { useEffect, useRef, useState } from "react";
import useClickAway from "react-use/lib/useClickAway";
import Icon from "@/components/Icon";
import OverflowTip from "@/components/kit/OverflowTip";
import { useTagStore } from "@/store/module";
@ -14,6 +14,7 @@ const TagSelector = (props: Props) => {
const { editorRef } = props;
const tagStore = useTagStore();
const [open, setOpen] = useState(false);
const containerRef = useRef<HTMLDivElement>(null);
const tags = tagStore.state.tags;
useEffect(() => {
@ -26,6 +27,10 @@ const TagSelector = (props: Props) => {
})();
}, []);
useClickAway(containerRef, () => {
setOpen(false);
});
const handleTagClick = (tag: string) => {
editorRef.current?.insertText(`#${tag} `);
};
@ -42,12 +47,8 @@ const TagSelector = (props: Props) => {
>
<Icon.Hash className="w-5 h-5 mx-auto" />
</MenuButton>
<Menu className="relative text-sm" size="sm" placement="bottom-start">
<ClickAwayListener
onClickAway={() => {
setOpen(false);
}}
>
<Menu className="relative text-sm" component="div" size="sm" placement="bottom-start">
<div ref={containerRef}>
{tags.length > 0 ? (
<div className="flex-row justify-start items-start flex-wrap px-1 max-w-[12rem] h-auto max-h-48 overflow-y-auto font-mono">
{tags.map((tag) => {
@ -63,11 +64,11 @@ const TagSelector = (props: Props) => {
})}
</div>
) : (
<p className="italic mx-1" onClick={(e) => e.stopPropagation()}>
<p className="italic mx-2" onClick={(e) => e.stopPropagation()}>
No tag found
</p>
)}
</ClickAwayListener>
</div>
</Menu>
</Dropdown>
);

Loading…
Cancel
Save