From 5e40239bdcc435b0bbbe41267ca01db300caaee1 Mon Sep 17 00:00:00 2001 From: Evan Date: Sun, 4 Jun 2023 13:46:41 +0800 Subject: [PATCH 01/11] Update issue templates (#23) --- .github/ISSUE_TEMPLATE/bug_report.md | 71 ++++++++++++++++ .../ISSUE_TEMPLATE/pull_request_template.md | 84 +++++++++++++++++++ 2 files changed, 155 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md create mode 100644 .github/ISSUE_TEMPLATE/pull_request_template.md diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 00000000..b04d1c68 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,71 @@ +--- +name: Bug report +about: Create a report to help us improve +title: '' +labels: '' +assignees: '' + +--- + +name: Bug Report +description: File a bug report +title: "[Bug]: " +labels: ["bug", "triage"] +assignees: + - octocat +body: + - type: markdown + attributes: + value: | + Thanks for taking the time to fill out this bug report! + - type: input + id: contact + attributes: + label: Contact Details + description: How can we get in touch with you if we need more info? + placeholder: ex. email@example.com + validations: + required: false + - type: textarea + id: what-happened + attributes: + label: What happened? + description: Also tell us, what did you expect to happen? + placeholder: Tell us what you see! + value: "A bug happened!" + validations: + required: true + - type: dropdown + id: version + attributes: + label: Version + description: What version of our software are you running? + options: + - 1.0.2 (Default) + - 1.0.3 (Edge) + validations: + required: true + - type: dropdown + id: browsers + attributes: + label: What browsers are you seeing the problem on? + multiple: true + options: + - Firefox + - Chrome + - Safari + - Microsoft Edge + - type: textarea + id: logs + attributes: + label: Relevant log output + description: Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks. + render: shell + - type: checkboxes + id: terms + attributes: + label: Code of Conduct + description: By submitting this issue, you agree to follow our [Code of Conduct](https://example.com) + options: + - label: I agree to follow this project's Code of Conduct + required: true diff --git a/.github/ISSUE_TEMPLATE/pull_request_template.md b/.github/ISSUE_TEMPLATE/pull_request_template.md new file mode 100644 index 00000000..0bbafd1d --- /dev/null +++ b/.github/ISSUE_TEMPLATE/pull_request_template.md @@ -0,0 +1,84 @@ +--- +name: PULL_REQUEST_TEMPLATE +about: PR 模板 +title: "[Feat]" +labels: '' +assignees: Evansy + +--- + + + +### 🤔 这个变动的性质是? + +- [ ] 新特性提交 +- [ ] 日常 bug 修复 +- [ ] 站点、文档改进 +- [ ] 演示代码改进 +- [ ] 组件样式/交互改进 +- [ ] TypeScript 定义更新 +- [ ] 包体积优化 +- [ ] 性能优化 +- [ ] 功能增强 +- [ ] 国际化改进 +- [ ] 重构 +- [ ] 代码风格优化 +- [ ] 测试用例 +- [ ] 分支合并 +- [ ] 工作流程 +- [ ] 其他改动(是关于什么的改动?) + +### 🔗 相关 Issue + + + +### 💡 需求背景和解决方案 + + + +### 📝 更新日志 + + + +| 语言 | 更新描述 | +| ------- | -------- | +| 🇺🇸 英文 | | +| 🇨🇳 中文 | | + +### ☑️ 请求合并前的自查清单 + +⚠️ 请自检并全部**勾选全部选项**。⚠️ + +- [ ] 文档已补充或无须补充 +- [ ] 代码演示已提供或无须提供 +- [ ] TypeScript 定义已补充或无须补充 +- [ ] Changelog 已提供或无须提供 + +--- + + + +### 🚀 概述 + +copilot:summary + +### 🔍 实现细节 + +copilot:walkthrough From f9b5b519636373dbcebcb5f7aab26141364d683a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=A7=E8=A1=A5?= <38815121+AuYuHui@users.noreply.github.com> Date: Sun, 4 Jun 2023 21:47:42 +0800 Subject: [PATCH 02/11] =?UTF-8?q?feat:=20=E5=8F=B3=E9=94=AE=E8=8F=9C?= =?UTF-8?q?=E5=8D=95=E5=A4=8D=E5=88=B6=E6=96=87=E6=9C=AC=E5=86=85=E5=AE=B9?= =?UTF-8?q?=20(#26)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: 右键菜单复制文本内容 * fix: 修复未登录前emoji标签可输入 * fix: 聊天操作显示时滚动可能会超出列表 * fix: 移动端 msgOption, 宽度太小溢出 --- package.json | 1 + pnpm-lock.yaml | 15 +++++++++- src/main.ts | 1 + src/utils/copy.ts | 19 +++++++++++++ src/views/Home/components/ChatBox/index.vue | 7 ++++- .../components/ChatList/MsgItem/index.vue | 28 +++++++++++++++---- 6 files changed, 64 insertions(+), 7 deletions(-) create mode 100644 src/utils/copy.ts diff --git a/package.json b/package.json index 6dd2b056..c5984095 100644 --- a/package.json +++ b/package.json @@ -21,6 +21,7 @@ "dependencies": { "@alova/scene-vue": "^1.0.4", "@element-plus/icons-vue": "^2.1.0", + "@imengyu/vue3-context-menu": "^1.2.10", "alova": "^2.3.0", "dayjs": "^1.11.7", "dompurify": "^3.0.3", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index baf1a6bc..ce86b788 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1,4 +1,8 @@ -lockfileVersion: '6.0' +lockfileVersion: '6.1' + +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false dependencies: '@alova/scene-vue': @@ -7,6 +11,9 @@ dependencies: '@element-plus/icons-vue': specifier: ^2.1.0 version: registry.npmmirror.com/@element-plus/icons-vue@2.1.0(vue@3.2.47) + '@imengyu/vue3-context-menu': + specifier: ^1.2.10 + version: registry.npmmirror.com/@imengyu/vue3-context-menu@1.2.10 alova: specifier: ^2.3.0 version: registry.npmmirror.com/alova@2.3.0 @@ -1166,6 +1173,12 @@ packages: - supports-color dev: true + registry.npmmirror.com/@imengyu/vue3-context-menu@1.2.10: + resolution: {integrity: sha512-L+qIoqcewQ8SPk2PMvsaMD9HWxFouij0JAqYwn19Fz7giqz0rLpWMf9aJRpQ3ysOySEKPdilg8dLYYB96QmGHA==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/@imengyu/vue3-context-menu/-/vue3-context-menu-1.2.10.tgz} + name: '@imengyu/vue3-context-menu' + version: 1.2.10 + dev: false + registry.npmmirror.com/@jridgewell/gen-mapping@0.3.3: resolution: {integrity: sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz} name: '@jridgewell/gen-mapping' diff --git a/src/main.ts b/src/main.ts index b96be10f..f08fd7a0 100644 --- a/src/main.ts +++ b/src/main.ts @@ -2,6 +2,7 @@ import { createApp } from 'vue' import dayjs from 'dayjs' import 'dayjs/locale/zh-cn' import weekday from 'dayjs/plugin/weekday' +import '@imengyu/vue3-context-menu/lib/vue3-context-menu.css' // import 'element-plus/dist/index.css' import { createPinia } from 'pinia' diff --git a/src/utils/copy.ts b/src/utils/copy.ts new file mode 100644 index 00000000..456f2fa1 --- /dev/null +++ b/src/utils/copy.ts @@ -0,0 +1,19 @@ +export function copyToClip(text: string) { + return new Promise((resolve, reject) => { + try { + const input: HTMLTextAreaElement = document.createElement('textarea') + input.setAttribute('readonly', 'readonly') + input.value = text + input.style.zIndex = '-1' + document.body.appendChild(input) + input.select() + if (document.execCommand('copy')) + document.execCommand('copy') + document.body.removeChild(input) + resolve(text) + } + catch (error) { + reject(error) + } + }) +} diff --git a/src/views/Home/components/ChatBox/index.vue b/src/views/Home/components/ChatBox/index.vue index 7f1c2bcf..b666b9c5 100644 --- a/src/views/Home/components/ChatBox/index.vue +++ b/src/views/Home/components/ChatBox/index.vue @@ -140,7 +140,12 @@ const insertText = (emoji: string) => { diff --git a/src/views/Home/components/ChatList/MsgItem/index.vue b/src/views/Home/components/ChatList/MsgItem/index.vue index 24403db8..b72c3a41 100644 --- a/src/views/Home/components/ChatList/MsgItem/index.vue +++ b/src/views/Home/components/ChatList/MsgItem/index.vue @@ -1,13 +1,14 @@