From 107e6b54fd5bac3a726457ac1ae046a9d96e5bf6 Mon Sep 17 00:00:00 2001 From: zyronon Date: Wed, 13 Sep 2023 18:57:00 +0800 Subject: [PATCH] chore: change --- components.d.ts | 1 + package.json | 3 +- pnpm-lock.yaml | 13 + src/App.vue | 4 +- src/components/BaseButton.vue | 18 +- src/components/Practice/AddArticle.vue | 338 +++++++++++++++++++ src/components/Practice/TypeArticle.vue | 14 +- src/components/Toolbar/TrabslateSetting.vue | 20 +- src/components/Toolbar/VolumeSetting.vue | 10 + src/hooks/{useSplitArticle.ts => article.ts} | 20 +- src/hooks/translate.ts | 122 +++++-- src/types.ts | 4 +- 12 files changed, 507 insertions(+), 60 deletions(-) create mode 100644 src/components/Practice/AddArticle.vue rename src/hooks/{useSplitArticle.ts => article.ts} (93%) diff --git a/components.d.ts b/components.d.ts index 7a7b6962..c0c2ad01 100644 --- a/components.d.ts +++ b/components.d.ts @@ -7,6 +7,7 @@ export {} declare module 'vue' { export interface GlobalComponents { + AddArticle: typeof import('./src/components/Practice/AddArticle.vue')['default'] Backgorund: typeof import('./src/components/Backgorund.vue')['default'] BaseButton: typeof import('./src/components/BaseButton.vue')['default'] ChapterDetail: typeof import('./src/components/ChapterDetail.vue')['default'] diff --git a/package.json b/package.json index 3582b136..a80bfe2b 100644 --- a/package.json +++ b/package.json @@ -17,6 +17,7 @@ "@opentranslate/baidu": "^1.4.2", "@opentranslate/translator": "^1.4.2", "axios": "^1.5.0", + "copy-to-clipboard": "^3.3.3", "element-plus": "^2.3.9", "hover.css": "^2.3.2", "localforage": "^1.10.0", @@ -28,7 +29,6 @@ "vue": "^3.3.4" }, "devDependencies": { - "tslib": "^2.6.2", "@iconify/vue": "^4.1.1", "@types/lodash-es": "^4.17.9", "@vitejs/plugin-vue": "^4.2.3", @@ -39,6 +39,7 @@ "husky": "^8.0.3", "rollup-plugin-visualizer": "^5.9.2", "sass": "^1.64.2", + "tslib": "^2.6.2", "typescript": "^5.2.0", "unplugin-auto-import": "^0.16.6", "unplugin-vue-components": "^0.25.2", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index a7647279..1f430dc3 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -14,6 +14,9 @@ dependencies: axios: specifier: ^1.5.0 version: 1.5.0 + copy-to-clipboard: + specifier: ^3.3.3 + version: 3.3.3 element-plus: specifier: ^2.3.9 version: 2.3.9(vue@3.3.4) @@ -1406,6 +1409,12 @@ packages: resolution: {integrity: sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==} dev: true + /copy-to-clipboard@3.3.3: + resolution: {integrity: sha512-2KV8NhB5JqC3ky0r9PMCAZKbUHSwtEo4CwCs0KXgruG43gX5PMqDEBbVU4OUzw2MuAWUfsuFmWvEKG5QRfSnJA==} + dependencies: + toggle-selection: 1.0.6 + dev: false + /cosmiconfig-typescript-loader@4.4.0(@types/node@20.4.7)(cosmiconfig@8.3.5)(ts-node@10.9.1)(typescript@5.2.2): resolution: {integrity: sha512-BabizFdC3wBHhbI4kJh0VkQP9GkBfoHPydD0COMce1nJ1kJAB3F2TmJ/I7diULBKtmEWSwEbuN/KDtgnmUUVmw==} engines: {node: '>=v14.21.3'} @@ -2796,6 +2805,10 @@ packages: is-number: 7.0.0 dev: true + /toggle-selection@1.0.6: + resolution: {integrity: sha512-BiZS+C1OS8g/q2RRbJmy59xpyghNBqrr6k5L/uKBGRsTfxmu3ffiRnd8mlGPUVayg8pvfi5urfnu8TU7DVOkLQ==} + dev: false + /tr46@0.0.3: resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==} dev: false diff --git a/src/App.vue b/src/App.vue index 599e73ae..c71d67b9 100644 --- a/src/App.vue +++ b/src/App.vue @@ -5,6 +5,7 @@ import {onMounted, watch} from "vue"; import {useBaseStore} from "@/stores/base.ts"; import {SaveKey} from "@/types.ts" import Practice from "@/components/Practice/Practice.vue" +import AddArticle from "@/components/Practice/AddArticle.vue"; const store = useBaseStore() // 查询当前系统主题颜色 @@ -33,7 +34,8 @@ onMounted(() => {