From 1ac1a968b9edd801aa13e8dae56ca378744d9e2e Mon Sep 17 00:00:00 2001 From: syuilo Date: Thu, 30 Sep 2021 00:50:45 +0900 Subject: [PATCH] refactor components --- CONTRIBUTING.md | 4 + locales/ja-JP.yml | 2 + package.json | 6 +- src/client/components/abuse-report-window.vue | 2 +- src/client/components/cw-button.vue | 8 +- .../components/{form => debobigego}/base.vue | 24 +- .../{form => debobigego}/button.vue | 10 +- .../form.scss => debobigego/debobigego.scss} | 24 +- .../components/{form => debobigego}/group.vue | 26 +- .../components/{form => debobigego}/info.vue | 4 +- .../components/{ui => debobigego}/input.vue | 173 +++++------- .../{form => debobigego}/key-value-view.vue | 8 +- .../components/{form => debobigego}/link.vue | 8 +- .../{form => debobigego}/object-view.vue | 10 +- .../{form => debobigego}/pagination.vue | 2 +- src/client/components/debobigego/radios.vue | 112 ++++++++ src/client/components/debobigego/range.vue | 122 ++++++++ src/client/components/debobigego/select.vue | 145 ++++++++++ .../{form => debobigego}/suspense.vue | 12 +- src/client/components/debobigego/switch.vue | 132 +++++++++ src/client/components/debobigego/textarea.vue | 161 +++++++++++ .../components/{form => debobigego}/tuple.vue | 2 +- src/client/components/dialog.vue | 4 +- src/client/components/forgot-password.vue | 2 +- src/client/components/form-dialog.vue | 28 +- src/client/components/form/input.vue | 183 ++++++------ src/client/components/{ui => form}/radio.vue | 0 src/client/components/form/radios.vue | 88 ++---- src/client/components/form/range.vue | 141 +++++----- src/client/components/form/section.vue | 31 +++ src/client/components/form/select.vue | 247 ++++++++++++----- src/client/components/form/slot.vue | 50 ++++ src/client/components/form/switch.vue | 192 +++++++------ src/client/components/form/textarea.vue | 195 +++++++++---- src/client/components/instance-stats.vue | 2 +- src/client/components/note-detailed.vue | 2 +- src/client/components/note-preview.vue | 2 +- src/client/components/note.sub.vue | 2 +- src/client/components/note.vue | 2 +- .../notification-setting-window.vue | 2 +- .../components/page/page.number-input.vue | 2 +- src/client/components/page/page.post.vue | 2 +- .../components/page/page.radio-button.vue | 2 +- src/client/components/page/page.switch.vue | 2 +- .../components/page/page.text-input.vue | 2 +- .../components/page/page.textarea-input.vue | 2 +- src/client/components/page/page.textarea.vue | 2 +- src/client/components/poll-editor.vue | 6 +- src/client/components/sample.vue | 8 +- src/client/components/signin.vue | 10 +- src/client/components/signup.vue | 22 +- src/client/components/tab.vue | 8 +- .../components/taskmanager.api-window.vue | 2 +- src/client/components/taskmanager.vue | 2 +- .../components/token-generate-window.vue | 6 +- src/client/components/ui/button.vue | 8 - src/client/components/ui/radios.vue | 58 ---- src/client/components/ui/range.vue | 139 ---------- src/client/components/ui/select.vue | 262 ------------------ src/client/components/ui/switch.vue | 144 ---------- src/client/components/ui/textarea.vue | 254 ----------------- src/client/components/user-select-dialog.vue | 4 +- src/client/components/widgets.vue | 2 +- src/client/pages/about-misskey.vue | 14 +- src/client/pages/about.vue | 16 +- src/client/pages/advanced-theme-editor.vue | 30 +- src/client/pages/api-console.vue | 8 +- src/client/pages/channel-editor.vue | 4 +- src/client/pages/channels.vue | 2 +- src/client/pages/docs.vue | 4 +- src/client/pages/emojis.category.vue | 6 +- src/client/pages/explore.vue | 2 +- src/client/pages/federation.vue | 8 +- src/client/pages/gallery/edit.vue | 24 +- src/client/pages/gallery/index.vue | 4 +- src/client/pages/instance-info.vue | 28 +- src/client/pages/instance/abuses.vue | 8 +- src/client/pages/instance/ads.vue | 6 +- src/client/pages/instance/announcements.vue | 4 +- src/client/pages/instance/bot-protection.vue | 42 +-- src/client/pages/instance/database.vue | 10 +- src/client/pages/instance/email-settings.vue | 32 +-- .../pages/instance/emoji-edit-dialog.vue | 2 +- src/client/pages/instance/emojis.vue | 4 +- src/client/pages/instance/file-dialog.vue | 2 +- src/client/pages/instance/files-settings.vue | 20 +- src/client/pages/instance/files.vue | 4 +- src/client/pages/instance/index.vue | 12 +- src/client/pages/instance/instance-block.vue | 18 +- src/client/pages/instance/instance.vue | 4 +- .../pages/instance/integrations-discord.vue | 18 +- .../pages/instance/integrations-github.vue | 18 +- .../pages/instance/integrations-twitter.vue | 18 +- src/client/pages/instance/integrations.vue | 16 +- src/client/pages/instance/logs.vue | 6 +- src/client/pages/instance/metrics.vue | 22 +- src/client/pages/instance/object-storage.vue | 36 +-- src/client/pages/instance/other-settings.vue | 18 +- src/client/pages/instance/overview.vue | 24 +- src/client/pages/instance/proxy-account.vue | 16 +- src/client/pages/instance/queue.chart.vue | 6 +- src/client/pages/instance/queue.vue | 4 +- src/client/pages/instance/relays.vue | 10 +- src/client/pages/instance/security.vue | 16 +- src/client/pages/instance/service-worker.vue | 18 +- src/client/pages/instance/settings.vue | 38 +-- src/client/pages/instance/users.vue | 4 +- src/client/pages/mfm-cheat-sheet.vue | 2 +- src/client/pages/my-antennas/editor.vue | 10 +- src/client/pages/my-groups/index.vue | 2 +- .../page-editor/els/page-editor.el.button.vue | 6 +- .../page-editor/els/page-editor.el.canvas.vue | 2 +- .../els/page-editor.el.counter.vue | 2 +- .../page-editor/els/page-editor.el.if.vue | 4 +- .../page-editor/els/page-editor.el.note.vue | 4 +- .../els/page-editor.el.number-input.vue | 2 +- .../page-editor/els/page-editor.el.post.vue | 6 +- .../els/page-editor.el.radio-button.vue | 4 +- .../els/page-editor.el.section.vue | 2 +- .../page-editor/els/page-editor.el.switch.vue | 4 +- .../els/page-editor.el.text-input.vue | 2 +- .../els/page-editor.el.textarea-input.vue | 4 +- .../pages/page-editor/page-editor.blocks.vue | 13 +- .../page-editor/page-editor.script-block.vue | 94 +++---- src/client/pages/page-editor/page-editor.vue | 10 +- src/client/pages/pages.vue | 2 +- src/client/pages/reset-password.vue | 12 +- src/client/pages/reversi/game.setting.vue | 4 +- src/client/pages/room/room.vue | 2 +- src/client/pages/settings/2fa.vue | 10 +- src/client/pages/settings/account-info.vue | 10 +- src/client/pages/settings/accounts.vue | 15 +- src/client/pages/settings/api.vue | 11 +- src/client/pages/settings/apps.vue | 13 +- src/client/pages/settings/custom-css.vue | 15 +- src/client/pages/settings/deck.vue | 15 +- src/client/pages/settings/delete-account.vue | 11 +- src/client/pages/settings/drive.vue | 21 +- src/client/pages/settings/email-address.vue | 11 +- .../pages/settings/email-notification.vue | 21 +- src/client/pages/settings/email.vue | 15 +- .../pages/settings/experimental-features.vue | 10 +- src/client/pages/settings/general.vue | 61 ++-- src/client/pages/settings/import-export.vue | 9 +- src/client/pages/settings/index.link.vue | 97 +++++++ src/client/pages/settings/index.vue | 99 ++++--- src/client/pages/settings/integration.vue | 23 +- src/client/pages/settings/menu.vue | 15 +- src/client/pages/settings/mute-block.vue | 13 +- src/client/pages/settings/notifications.vue | 11 +- src/client/pages/settings/other.vue | 17 +- src/client/pages/settings/plugin.install.vue | 15 +- src/client/pages/settings/plugin.manage.vue | 21 +- src/client/pages/settings/plugin.vue | 9 +- src/client/pages/settings/privacy.vue | 29 +- src/client/pages/settings/profile.vue | 35 +-- src/client/pages/settings/reaction.vue | 19 +- src/client/pages/settings/registry.keys.vue | 13 +- src/client/pages/settings/registry.value.vue | 15 +- src/client/pages/settings/registry.vue | 13 +- src/client/pages/settings/security.vue | 15 +- src/client/pages/settings/sounds.vue | 15 +- src/client/pages/settings/theme.install.vue | 13 +- src/client/pages/settings/theme.manage.vue | 11 +- src/client/pages/settings/theme.vue | 27 +- src/client/pages/settings/update.vue | 15 +- src/client/pages/settings/word-mute.vue | 19 +- src/client/pages/test.vue | 8 +- src/client/pages/theme-editor.vue | 30 +- src/client/pages/user-ap-info.vue | 16 +- src/client/pages/user-info.vue | 26 +- src/client/pages/user/index.timeline.vue | 2 +- src/client/pages/welcome.setup.vue | 2 +- src/client/style.scss | 14 +- src/client/ui/_common_/sidebar.vue | 2 +- src/client/ui/chat/note-preview.vue | 2 +- src/client/ui/chat/note.sub.vue | 2 +- src/client/ui/chat/note.vue | 2 +- yarn.lock | 166 +++++------ 179 files changed, 2611 insertions(+), 2386 deletions(-) rename src/client/components/{form => debobigego}/base.vue (63%) rename src/client/components/{form => debobigego}/button.vue (77%) rename src/client/components/{form/form.scss => debobigego/debobigego.scss} (52%) rename src/client/components/{form => debobigego}/group.vue (57%) rename src/client/components/{form => debobigego}/info.vue (87%) rename src/client/components/{ui => debobigego}/input.vue (62%) rename src/client/components/{form => debobigego}/key-value-view.vue (78%) rename src/client/components/{form => debobigego}/link.vue (84%) rename src/client/components/{form => debobigego}/object-view.vue (88%) rename src/client/components/{form => debobigego}/pagination.vue (95%) create mode 100644 src/client/components/debobigego/radios.vue create mode 100644 src/client/components/debobigego/range.vue create mode 100644 src/client/components/debobigego/select.vue rename src/client/components/{form => debobigego}/suspense.vue (87%) create mode 100644 src/client/components/debobigego/switch.vue create mode 100644 src/client/components/debobigego/textarea.vue rename src/client/components/{form => debobigego}/tuple.vue (87%) rename src/client/components/{ui => form}/radio.vue (100%) create mode 100644 src/client/components/form/section.vue create mode 100644 src/client/components/form/slot.vue delete mode 100644 src/client/components/ui/radios.vue delete mode 100644 src/client/components/ui/range.vue delete mode 100644 src/client/components/ui/select.vue delete mode 100644 src/client/components/ui/switch.vue delete mode 100644 src/client/components/ui/textarea.vue create mode 100644 src/client/pages/settings/index.link.vue diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 72a7dc4b16..06154f1f44 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -177,6 +177,10 @@ npx ts-node ./node_modules/typeorm/cli.js migration:generate -n 変更の名前 ### JSONのimportに気を付けよう TypeScriptでjsonをimportすると、tscでコンパイルするときにそのjsonファイルも一緒にdistディレクトリに吐き出されてしまう。この挙動により、意図せずファイルの書き換えが発生することがあるので、jsonをimportするときは書き換えられても良いものかどうか確認すること。書き換えされて欲しくない場合は、importで読み込むのではなく、`fs.readFileSync`などの関数を使って読み込むようにすればよい。 +### コンポーネントのスタイル定義でmarginを持たせない +コンポーネント自身がmarginを設定するのは問題の元となることはよく知られている +marginはそのコンポーネントを使う側が設定する + ## その他 ### HTMLのクラス名で follow という単語は使わない 広告ブロッカーで誤ってブロックされる diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index f050ad4df8..f5f859b9ff 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -787,6 +787,8 @@ pubSub: "Pub/Subのアカウント" lastCommunication: "直近の通信" resolved: "解決済み" unresolved: "未解決" +itsOn: "オンになっています" +itsOff: "オフになっています" _accountDelete: accountDelete: "アカウントの削除" diff --git a/package.json b/package.json index 2d0c1cc5fc..9f37bea172 100644 --- a/package.json +++ b/package.json @@ -104,7 +104,7 @@ "@types/websocket": "1.0.4", "@types/ws": "7.4.7", "@typescript-eslint/parser": "4.31.2", - "@vue/compiler-sfc": "3.2.13", + "@vue/compiler-sfc": "3.2.19", "abort-controller": "3.0.0", "apexcharts": "3.28.3", "autobind-decorator": "2.4.0", @@ -233,7 +233,7 @@ "uuid": "8.3.2", "v-debounce": "0.1.2", "vanilla-tilt": "1.7.2", - "vue": "3.2.13", + "vue": "3.2.19", "vue-loader": "16.7.0", "vue-prism-editor": "2.0.0-alpha.2", "vue-router": "4.0.5", @@ -241,7 +241,7 @@ "vue-svg-loader": "0.17.0-beta.2", "vuedraggable": "4.0.1", "web-push": "3.4.5", - "webpack": "5.53.0", + "webpack": "5.54.0", "webpack-cli": "4.8.0", "websocket": "1.0.34", "ws": "8.2.2", diff --git a/src/client/components/abuse-report-window.vue b/src/client/components/abuse-report-window.vue index 266c0d566f..21a19385ae 100644 --- a/src/client/components/abuse-report-window.vue +++ b/src/client/components/abuse-report-window.vue @@ -25,7 +25,7 @@ diff --git a/src/client/components/debobigego/range.vue b/src/client/components/debobigego/range.vue new file mode 100644 index 0000000000..26fb0f37c6 --- /dev/null +++ b/src/client/components/debobigego/range.vue @@ -0,0 +1,122 @@ + + + + + diff --git a/src/client/components/debobigego/select.vue b/src/client/components/debobigego/select.vue new file mode 100644 index 0000000000..7a31371afc --- /dev/null +++ b/src/client/components/debobigego/select.vue @@ -0,0 +1,145 @@ + + + + + diff --git a/src/client/components/form/suspense.vue b/src/client/components/debobigego/suspense.vue similarity index 87% rename from src/client/components/form/suspense.vue rename to src/client/components/debobigego/suspense.vue index d04dc07624..e59e0ba12d 100644 --- a/src/client/components/form/suspense.vue +++ b/src/client/components/debobigego/suspense.vue @@ -1,15 +1,15 @@