From 7571e96bd037219088637fc3a2962f77d20a9727 Mon Sep 17 00:00:00 2001 From: Kainoa Kanter Date: Thu, 9 Feb 2023 22:48:25 +0000 Subject: [PATCH] feature/help_menu (#9587) Co-authored-by: ThatOneCalculator Reviewed-on: https://codeberg.org/calckey/calckey/pulls/9587 --- locales/en-US.yml | 17 ++++ package.json | 4 +- packages/client/package.json | 16 +-- packages/client/src/navbar.ts | 59 +++++++++++ packages/client/src/pages/apps.vue | 99 +++++++++++++++++++ packages/client/src/router.ts | 4 + .../src/ui/_common_/navbar-for-mobile.vue | 49 --------- packages/client/src/ui/_common_/navbar.vue | 65 ++---------- pnpm-lock.yaml | 67 ++++++++++++- 9 files changed, 263 insertions(+), 117 deletions(-) create mode 100644 packages/client/src/pages/apps.vue diff --git a/locales/en-US.yml b/locales/en-US.yml index d236419020..f43f01fb72 100644 --- a/locales/en-US.yml +++ b/locales/en-US.yml @@ -1786,3 +1786,20 @@ _deck: list: "List" mentions: "Mentions" direct: "Direct messages" +_apps: + apps: "Apps" + crossPlatform: "Cross platform" + mobile: "Mobile" + firstParty: "First party" + firstClass: "First class" + secondClass: "Second class" + thirdClass: "Third class" + free: "Free" + paid: "Paid" + pwa: "Install PWA" + kaiteki: "Kaiteki" + milktea: "Milktea" + subwayTooter: "Subway Tooter" + kimis: "Kimis" + theDesk: "TheDesk" + lesskey: "Lesskey" diff --git a/package.json b/package.json index f8c04778ba..963e3b94fd 100644 --- a/package.json +++ b/package.json @@ -1,12 +1,12 @@ { "name": "calckey", - "version": "13.1.3-beta", + "version": "13.1.3-beta8", "codename": "aqua", "repository": { "type": "git", "url": "https://codeberg.org/calckey/calckey.git" }, - "packageManager": "pnpm@7.26.3", + "packageManager": "pnpm@7.27.0", "private": true, "scripts": { "rebuild": "pnpm run clean && pnpm -r run build && pnpm run gulp", diff --git a/packages/client/package.json b/packages/client/package.json index c055e5c207..5a184dbc0f 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -7,12 +7,14 @@ "lint": "pnpm rome check \"src/**/*.{ts,vue}\"" }, "dependencies": { - + "@khmyznikov/pwa-install": "^0.2.0" }, "devDependencies": { + "@discordapp/twemoji": "14.0.2", "@rollup/plugin-alias": "3.1.9", "@rollup/plugin-json": "4.1.0", "@rollup/pluginutils": "^4.2.1", + "@syuilo/aiscript": "0.11.1", "@types/escape-regexp": "0.0.1", "@types/glob": "8.0.0", "@types/gulp": "4.0.10", @@ -26,13 +28,6 @@ "@types/uuid": "8.3.4", "@vitejs/plugin-vue": "4.0.0", "@vue/compiler-sfc": "3.2.45", - "cross-env": "7.0.3", - "cypress": "10.11.0", - "rollup": "3.9.1", - "start-server-and-test": "1.15.2", - "typescript": "4.9.4", - "@discordapp/twemoji": "14.0.2", - "@syuilo/aiscript": "0.11.1", "autobind-decorator": "2.4.0", "autosize": "5.0.2", "blurhash": "1.1.5", @@ -45,6 +40,8 @@ "chartjs-plugin-zoom": "1.2.1", "compare-versions": "5.0.3", "cropperjs": "2.0.0-beta.2", + "cross-env": "7.0.3", + "cypress": "10.11.0", "date-fns": "2.29.3", "escape-regexp": "0.0.1", "eventemitter3": "4.0.7", @@ -59,9 +56,11 @@ "punycode": "2.1.1", "querystring": "0.2.1", "rndstr": "1.0.0", + "rollup": "3.9.1", "s-age": "1.1.2", "sass": "1.57.1", "seedrandom": "3.0.5", + "start-server-and-test": "1.15.2", "strict-event-emitter-types": "2.0.0", "stringz": "2.1.0", "swiper": "^8.4.5", @@ -73,6 +72,7 @@ "tsc-alias": "1.8.2", "tsconfig-paths": "4.1.2", "twemoji-parser": "14.0.0", + "typescript": "4.9.4", "uuid": "9.0.0", "vanilla-tilt": "1.8.0", "vite": "^4.1.1", diff --git a/packages/client/src/navbar.ts b/packages/client/src/navbar.ts index 579247bf5e..5b116cee1b 100644 --- a/packages/client/src/navbar.ts +++ b/packages/client/src/navbar.ts @@ -5,6 +5,10 @@ import * as os from "@/os"; import { i18n } from "@/i18n"; import { ui } from "@/config"; import { unisonReload } from "@/scripts/unison-reload"; +import { defaultStore } from '@/store'; +import { instance } from '@/instance'; +import { host } from '@/config'; +import XTutorial from '@/components/MkTutorialDialog.vue'; export const navbarItemDef = reactive({ notifications: { @@ -144,4 +148,59 @@ export const navbarItemDef = reactive({ location.reload(); }, }, + help: { + title: "help", + icon: "ph-question-bold ph-lg", + action: (ev) => { + os.popupMenu([{ + text: instance.name ?? host, + type: 'label', + }, { + type: 'link', + text: i18n.ts.instanceInfo, + icon: 'ph-info-bold ph-lg', + to: '/about', + }, { + type: 'link', + text: i18n.ts.aboutMisskey, + icon: 'ph-lightbulb-bold ph-lg', + to: '/about-calckey', + }, { + type: 'link', + text: i18n.ts._apps.apps, + icon: 'ph-device-mobile-bold ph-lg', + to: '/apps', + }, { + type: 'button', + action: async () => { + defaultStore.set('tutorial', 0); + os.popup(XTutorial, {}, {}, 'closed'); + }, + text: i18n.ts.replayTutorial, + icon: 'ph-circle-wavy-question-bold ph-lg', + }, null, { + type: 'parent', + text: i18n.ts.developer, + icon: 'ph-code-bold ph-lg', + children: [{ + type: 'link', + to: '/api-console', + text: 'API Console', + icon: 'ph-terminal-window-bold ph-lg', + }, { + text: i18n.ts.document, + icon: 'ph-file-doc-bold ph-lg', + action: () => { + window.open('/api-doc', '_blank'); + }, + }, { + type: 'link', + to: '/scratchpad', + text: 'AiScript Scratchpad', + icon: 'ph-scribble-loop-bold ph-lg', + }] + }], ev.currentTarget ?? ev.target, + ); + }, + }, }); diff --git a/packages/client/src/pages/apps.vue b/packages/client/src/pages/apps.vue new file mode 100644 index 0000000000..d49b1c540a --- /dev/null +++ b/packages/client/src/pages/apps.vue @@ -0,0 +1,99 @@ + + + diff --git a/packages/client/src/router.ts b/packages/client/src/router.ts index bf87efec0f..48aad0820f 100644 --- a/packages/client/src/router.ts +++ b/packages/client/src/router.ts @@ -282,6 +282,10 @@ export const routes = [ path: "/about-calckey", component: page(() => import("./pages/about-calckey.vue")), }, + { + path: "/apps", + component: page(() => import("./pages/apps.vue")), + }, { path: "/theme-editor", component: page(() => import("./pages/theme-editor.vue")), diff --git a/packages/client/src/ui/_common_/navbar-for-mobile.vue b/packages/client/src/ui/_common_/navbar-for-mobile.vue index 5374e67c9b..663ffe0fa7 100644 --- a/packages/client/src/ui/_common_/navbar-for-mobile.vue +++ b/packages/client/src/ui/_common_/navbar-for-mobile.vue @@ -34,9 +34,6 @@ - @@ -44,12 +41,10 @@