From 9fa6cff7e7cd1c262a66074835d97df32cef400f Mon Sep 17 00:00:00 2001 From: Hiroshiba Date: Mon, 26 Feb 2024 00:10:11 +0900 Subject: [PATCH 1/2] =?UTF-8?q?VueRouter=E3=81=AE=E4=BE=9D=E5=AD=98?= =?UTF-8?q?=E3=82=92=E5=A4=B1=E3=81=8F=E3=81=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...56\346\255\251\343\201\215\346\226\271.md" | 1 - package-lock.json | 3 +- package.json | 1 - src/components/App.vue | 64 +++++++++++-------- .../Menu/MenuBar/TitleBarEditorSwitcher.vue | 19 ++---- src/main.ts | 3 - src/router/index.ts | 21 ------ src/store/type.ts | 6 ++ src/store/ui.ts | 10 +++ 9 files changed, 60 insertions(+), 68 deletions(-) delete mode 100644 src/router/index.ts diff --git "a/docs/\343\202\263\343\203\274\343\203\211\343\201\256\346\255\251\343\201\215\346\226\271.md" "b/docs/\343\202\263\343\203\274\343\203\211\343\201\256\346\255\251\343\201\215\346\226\271.md" index a2400272f4..6b1bdf7d2d 100644 --- "a/docs/\343\202\263\343\203\274\343\203\211\343\201\256\346\255\251\343\201\215\346\226\271.md" +++ "b/docs/\343\202\263\343\203\274\343\203\211\343\201\256\346\255\251\343\201\215\346\226\271.md" @@ -88,7 +88,6 @@ TODO - styles ディレクトリ ・・・ CSS や SCSS などのディレクトリ。 - infrastructures ディレクトリ ・・・ UI 用のコードと UI 以外のコードを跨ぐときに一枚かませたいときのためのコードのディレクトリ。 - openapi ディレクトリ ・・・ エンジンの API を叩くためのコードのディレクトリ。OpenAPI で自動生成される。 - - router ディレクトリ ・・・ Vue Router 用のディレクトリ。 - helpers ディレクトリ ・・・ 便利な関数を置くディレクトリ。 - shared ディレクトリ ・・・ UI と Electron 両方から参照されるコードを置くディレクトリ。 - public diff --git a/package-lock.json b/package-lock.json index ff28cc026b..6f12d5d102 100644 --- a/package-lock.json +++ b/package-lock.json @@ -35,7 +35,6 @@ "tree-kill": "1.2.2", "uuid": "9.0.0", "vue": "3.2.45", - "vue-router": "4.0.8", "vuedraggable": "4.1.0", "vuex": "4.0.2", "zod": "3.22.4" @@ -12737,6 +12736,7 @@ "version": "4.0.8", "resolved": "https://registry.npmjs.org/vue-router/-/vue-router-4.0.8.tgz", "integrity": "sha512-42mWSQaH7CCBQDspQTHv63f34VEnZC20g9QNK4WJ/zW8SdIUeT6TQ2i/78fjF/pVBUPLBWrGhvB7uDnaz7O/pA==", + "optional": true, "dependencies": { "@vue/devtools-api": "^6.0.0-beta.10" }, @@ -22909,6 +22909,7 @@ "version": "4.0.8", "resolved": "https://registry.npmjs.org/vue-router/-/vue-router-4.0.8.tgz", "integrity": "sha512-42mWSQaH7CCBQDspQTHv63f34VEnZC20g9QNK4WJ/zW8SdIUeT6TQ2i/78fjF/pVBUPLBWrGhvB7uDnaz7O/pA==", + "optional": true, "requires": { "@vue/devtools-api": "^6.0.0-beta.10" } diff --git a/package.json b/package.json index f3860b7edb..527b661c69 100644 --- a/package.json +++ b/package.json @@ -62,7 +62,6 @@ "tree-kill": "1.2.2", "uuid": "9.0.0", "vue": "3.2.45", - "vue-router": "4.0.8", "vuedraggable": "4.1.0", "vuex": "4.0.2", "zod": "3.22.4" diff --git a/src/components/App.vue b/src/components/App.vue index 4d37e0d8aa..51943f0ecc 100644 --- a/src/components/App.vue +++ b/src/components/App.vue @@ -1,32 +1,37 @@ diff --git a/src/main.ts b/src/main.ts index 68b2870bce..4ccf1ac41f 100644 --- a/src/main.ts +++ b/src/main.ts @@ -2,7 +2,6 @@ import { createApp } from "vue"; import { createGtm } from "@gtm-support/vue-gtm"; import { Quasar, Dialog, Loading, Notify } from "quasar"; import iconSet from "quasar/icon-set/material-icons"; -import router from "./router"; import { store, storeKey } from "./store"; import { ipcMessageReceiver } from "./plugins/ipcMessageReceiverPlugin"; import { hotkeyPlugin } from "./plugins/hotkeyPlugin"; @@ -19,11 +18,9 @@ window.dataLayer = []; createApp(App) .use(store, storeKey) - .use(router) .use( createGtm({ id: import.meta.env.VITE_GTM_CONTAINER_ID ?? "GTM-DUMMY", - vueRouter: router, // NOTE: 最初はgtm.jsを読まず、プライバシーポリシーに同意後に読み込む enabled: false, }) diff --git a/src/router/index.ts b/src/router/index.ts deleted file mode 100644 index f0219be066..0000000000 --- a/src/router/index.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { createRouter, createWebHashHistory, RouteRecordRaw } from "vue-router"; -import SingEditor from "@/components/Sing/SingEditor.vue"; -import TalkEditor from "@/components/Talk/TalkEditor.vue"; - -const routes: Array = [ - { - path: "/talk", - component: TalkEditor, - }, - { - path: "/song", - component: SingEditor, - }, -]; - -const router = createRouter({ - history: createWebHashHistory(import.meta.env.BASE_URL), - routes, -}); - -export default router; diff --git a/src/store/type.ts b/src/store/type.ts index c283b26936..0f2df9fb0b 100644 --- a/src/store/type.ts +++ b/src/store/type.ts @@ -1506,6 +1506,7 @@ export type SettingStoreTypes = { */ export type UiStoreState = { + openedEditor: EditorType | undefined; // undefinedのときはどのエディタを開くか定まっていない uiLockCount: number; dialogLockCount: number; reloadingLock: boolean; @@ -1530,6 +1531,11 @@ export type UiStoreState = { }; export type UiStoreTypes = { + SET_OPENED_EDITOR: { + mutation: { editor: EditorType }; + action(palyoad: { editor: EditorType }): void; + }; + UI_LOCKED: { getter: boolean; }; diff --git a/src/store/ui.ts b/src/store/ui.ts index 42f14027eb..5f6faf4b24 100644 --- a/src/store/ui.ts +++ b/src/store/ui.ts @@ -45,6 +45,7 @@ export function withProgress( } export const uiStoreState: UiStoreState = { + openedEditor: undefined, uiLockCount: 0, dialogLockCount: 0, reloadingLock: false, @@ -69,6 +70,15 @@ export const uiStoreState: UiStoreState = { }; export const uiStore = createPartialStore({ + SET_OPENED_EDITOR: { + mutation(state, { editor }) { + state.openedEditor = editor; + }, + action({ commit }, { editor }) { + commit("SET_OPENED_EDITOR", { editor }); + }, + }, + UI_LOCKED: { getter(state) { return state.uiLockCount > 0; From 68cee6a8e0a8aee6518ccb7b87cb53ae4e1cb3a2 Mon Sep 17 00:00:00 2001 From: Hiroshiba Date: Mon, 26 Feb 2024 00:12:30 +0900 Subject: [PATCH 2/2] =?UTF-8?q?/talk=E3=81=AA=E3=81=A9=E3=82=92=E5=89=8A?= =?UTF-8?q?=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 4 ++-- src/background.ts | 1 - tests/e2e/navigators.ts | 4 ++-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 69ee5dd6d6..0ca108ab22 100644 --- a/README.md +++ b/README.md @@ -73,7 +73,7 @@ npm run electron:serve npm run browser:serve ``` -また、main ブランチのビルド結果がこちらにデプロイされています +また、main ブランチのビルド結果がこちらにデプロイされています 今はローカル PC 上で音声合成エンジンを起動する必要があります。 ## ビルド @@ -109,7 +109,7 @@ Playwright を使用しているためテストパターンを生成すること **ブラウザ版を起動している状態で**以下のコマンドを実行してください。 ```bash -npx playwright codegen http://localhost:5173/#/talk --viewport-size=800,600 +npx playwright codegen http://localhost:5173/ --viewport-size=800,600 ``` 詳細は [Playwright ドキュメントの Test generator](https://playwright.dev/docs/codegen-intro) を参照してください。 diff --git a/src/background.ts b/src/background.ts index 7f1e7c3c75..b6b4ed8659 100644 --- a/src/background.ts +++ b/src/background.ts @@ -471,7 +471,6 @@ async function loadUrl(obj: { projectFilePath?: string; }) { const fragment = - "#/talk" + `?isMultiEngineOffMode=${obj?.isMultiEngineOffMode ?? false}` + `&projectFilePath=${obj?.projectFilePath ?? ""}`; return win.loadURL(`${firstUrl}${fragment}`); diff --git a/tests/e2e/navigators.ts b/tests/e2e/navigators.ts index 6fe1c9aeef..09cf0385da 100644 --- a/tests/e2e/navigators.ts +++ b/tests/e2e/navigators.ts @@ -2,10 +2,10 @@ import { expect, Page } from "@playwright/test"; import { getNewestQuasarDialog, getQuasarMenu } from "./locators"; /** - * /#/talkに移動 + * 最初の画面に移動 */ export async function gotoHome({ page }: { page: Page }) { - const BASE_URL = "http://localhost:7357/#/talk"; + const BASE_URL = "http://localhost:7357/"; await page.setViewportSize({ width: 800, height: 600 }); await page.goto(BASE_URL); }