From 1baff3f8d738669933fe9ab9a5ddfb7d0d70fb0a Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Wed, 24 Feb 2021 20:15:04 +0000 Subject: [PATCH 01/20] Bump @types/chai from 4.2.14 to 4.2.15 Bumps [@types/chai](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/chai) from 4.2.14 to 4.2.15. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/chai) Signed-off-by: dependabot-preview[bot] --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 6ae064450d..e71f3b30a4 100644 --- a/package.json +++ b/package.json @@ -261,7 +261,7 @@ "xev": "2.0.1" }, "devDependencies": { - "@types/chai": "4.2.14", + "@types/chai": "4.2.15", "@types/fluent-ffmpeg": "2.1.16", "chai": "4.3.0", "cross-env": "7.0.3" diff --git a/yarn.lock b/yarn.lock index 86ce14eb61..42da09a74d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -492,10 +492,10 @@ dependencies: "@types/node" "*" -"@types/chai@4.2.14": - version "4.2.14" - resolved "https://registry.yarnpkg.com/@types/chai/-/chai-4.2.14.tgz#44d2dd0b5de6185089375d976b4ec5caf6861193" - integrity sha512-G+ITQPXkwTrslfG5L/BksmbLUA0M1iybEsmCWPqzSxsRRhJZimBKJkoMi8fr/CPygPTj4zO5pJH7I2/cm9M7SQ== +"@types/chai@4.2.15": + version "4.2.15" + resolved "https://registry.yarnpkg.com/@types/chai/-/chai-4.2.15.tgz#b7a6d263c2cecf44b6de9a051cf496249b154553" + integrity sha512-rYff6FI+ZTKAPkJUoyz7Udq3GaoDZnxYDEvdEdFZASiA7PoErltHezDishqQiSDWrGxvxmplH304jyzQmjp0AQ== "@types/cheerio@^0.22.10": version "0.22.18" From 0ee1021bcc56ec828fef5f09b411bfab888b0923 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Thu, 25 Feb 2021 20:14:19 +0000 Subject: [PATCH 02/20] Bump webpack from 5.23.0 to 5.24.2 Bumps [webpack](https://github.com/webpack/webpack) from 5.23.0 to 5.24.2. - [Release notes](https://github.com/webpack/webpack/releases) - [Commits](https://github.com/webpack/webpack/compare/v5.23.0...v5.24.2) Signed-off-by: dependabot-preview[bot] --- package.json | 2 +- yarn.lock | 50 ++++++++++---------------------------------------- 2 files changed, 11 insertions(+), 41 deletions(-) diff --git a/package.json b/package.json index e71f3b30a4..149a708b52 100644 --- a/package.json +++ b/package.json @@ -254,7 +254,7 @@ "vue-style-loader": "4.1.2", "vuedraggable": "4.0.1", "web-push": "3.4.4", - "webpack": "5.23.0", + "webpack": "5.24.2", "webpack-cli": "4.5.0", "websocket": "1.0.33", "ws": "7.4.3", diff --git a/yarn.lock b/yarn.lock index 42da09a74d..17b6adcac4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2140,17 +2140,7 @@ browserslist@^1.3.6, browserslist@^1.5.2, browserslist@^1.7.6: caniuse-db "^1.0.30000639" electron-to-chromium "^1.2.7" -browserslist@^4.0.0, browserslist@^4.14.5: - version "4.14.5" - resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.14.5.tgz#1c751461a102ddc60e40993639b709be7f2c4015" - integrity sha512-Z+vsCZIvCBvqLoYkBFTwEYH3v5MCQbsAjp50ERycpOjnPmolg1Gjy4+KaWWpm8QOJt9GHkhdqAl14NpCX73CWA== - dependencies: - caniuse-lite "^1.0.30001135" - electron-to-chromium "^1.3.571" - escalade "^3.1.0" - node-releases "^1.1.61" - -browserslist@^4.16.3: +browserslist@^4.0.0, browserslist@^4.14.5, browserslist@^4.16.3: version "4.16.3" resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.16.3.tgz#340aa46940d7db878748567c5dea24a48ddf3717" integrity sha512-vIyhWmIkULaq04Gt93txdh+j02yX/JzlyhLYbV3YQCn/zvES3JnY7TifHHvvr1w5hTDluNKMkV05cs4vy8Q7sw== @@ -2385,11 +2375,6 @@ caniuse-lite@^1.0.0: resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001048.tgz#4bb4f1bc2eb304e5e1154da80b93dee3f1cf447e" integrity sha512-g1iSHKVxornw0K8LG9LLdf+Fxnv7T1Z+mMsf0/YYLclQX4Cd522Ap0Lrw6NFqHgezit78dtyWxzlV2Xfc7vgRg== -caniuse-lite@^1.0.30001135: - version "1.0.30001142" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001142.tgz#a8518fdb5fee03ad95ac9f32a9a1e5999469c250" - integrity sha512-pDPpn9ankEpBFZXyCv2I4lh1v/ju+bqb78QfKf+w9XgDAFWBwSYPswXqprRdrgQWK0wQnpIbfwRjNHO1HWqvoQ== - caniuse-lite@^1.0.30001181: version "1.0.30001191" resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001191.tgz#bacb432b6701f690c8c5f7c680166b9a9f0843d9" @@ -3757,11 +3742,6 @@ electron-to-chromium@^1.2.7: resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.633.tgz#16dd5aec9de03894e8d14a1db4cda8a369b9b7fe" integrity sha512-bsVCsONiVX1abkWdH7KtpuDAhsQ3N3bjPYhROSAXE78roJKet0Y5wznA14JE9pzbwSZmSMAW6KiKYf1RvbTJkA== -electron-to-chromium@^1.3.571: - version "1.3.576" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.576.tgz#2e70234484e03d7c7e90310d7d79fd3775379c34" - integrity sha512-uSEI0XZ//5ic+0NdOqlxp0liCD44ck20OAGyLMSymIWTEAtHKVJi6JM18acOnRgUgX7Q65QqnI+sNncNvIy8ew== - electron-to-chromium@^1.3.649: version "1.3.672" resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.672.tgz#3a6e335016dab4bc584d5292adc4f98f54541f6a" @@ -3879,10 +3859,10 @@ es-abstract@^1.17.0-next.0, es-abstract@^1.17.0-next.1, es-abstract@^1.17.2, es- string.prototype.trimleft "^2.1.1" string.prototype.trimright "^2.1.1" -es-module-lexer@^0.3.26: - version "0.3.26" - resolved "https://registry.yarnpkg.com/es-module-lexer/-/es-module-lexer-0.3.26.tgz#7b507044e97d5b03b01d4392c74ffeb9c177a83b" - integrity sha512-Va0Q/xqtrss45hWzP8CZJwzGSZJjDM5/MJRE3IXXnUCcVLElR9BRaE9F62BopysASyc4nM3uwhSW7FFB9nlWAA== +es-module-lexer@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/es-module-lexer/-/es-module-lexer-0.4.0.tgz#21f4181cc8b7eee06855f1c59e6087c7bc4f77b0" + integrity sha512-iuEGihqqhKWFgh72Q/Jtch7V2t/ft8w8IPP2aEN8ArYKO+IWyo6hsi96hCdgyeEDQIV3InhYQ9BlwUFPGXrbEQ== es-to-primitive@^1.2.1: version "1.2.1" @@ -3934,11 +3914,6 @@ es6-weak-map@^2.0.1: es6-iterator "^2.0.3" es6-symbol "^3.1.1" -escalade@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.0.tgz#e8e2d7c7a8b76f6ee64c2181d6b8151441602d4e" - integrity sha512-mAk+hPSO8fLDkhV7V0dXazH5pDc6MrjBTPyD3VeKzxnVFjH1MIxbCdqGZB9O8+EwWakZs3ZCbDS4IpRt79V1ig== - escalade@^3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" @@ -7015,11 +6990,6 @@ node-object-hash@^1.2.0: resolved "https://registry.yarnpkg.com/node-object-hash/-/node-object-hash-1.4.2.tgz#385833d85b229902b75826224f6077be969a9e94" integrity sha512-UdS4swXs85fCGWWf6t6DMGgpN/vnlKeSGEQ7hJcrs7PBFoxoKLmibc3QRb7fwiYsjdL7PX8iI/TMSlZ90dgHhQ== -node-releases@^1.1.61: - version "1.1.61" - resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.1.61.tgz#707b0fca9ce4e11783612ba4a2fcba09047af16e" - integrity sha512-DD5vebQLg8jLCOzwupn954fbIiZht05DAZs0k2u8NStSe6h9XdsuIQL8hSRKYiU8WUQRznmSDrKGbv3ObOmC7g== - node-releases@^1.1.70: version "1.1.71" resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.1.71.tgz#cb1334b179896b1c89ecfdd4b725fb7bbdfc7dbb" @@ -11129,10 +11099,10 @@ webpack-sources@^2.1.1: source-list-map "^2.0.1" source-map "^0.6.1" -webpack@5.23.0: - version "5.23.0" - resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.23.0.tgz#9ed57e9a54b267b3549899271ad780cddc6ee316" - integrity sha512-RC6dwDuRxiU75F8XC4H08NtzUrMfufw5LDnO8dTtaKU2+fszEdySCgZhNwSBBn516iNaJbQI7T7OPHIgCwcJmg== +webpack@5.24.2: + version "5.24.2" + resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.24.2.tgz#33790dad631e8b639f4246d762e257720875fe54" + integrity sha512-uxxKYEY4kMNjP+D2Y+8aw5Vd7ar4pMuKCNemxV26ysr1nk0YDiQTylg9U3VZIdkmI0YHa0uC8ABxL+uGxGWWJg== dependencies: "@types/eslint-scope" "^3.7.0" "@types/estree" "^0.0.46" @@ -11143,7 +11113,7 @@ webpack@5.23.0: browserslist "^4.14.5" chrome-trace-event "^1.0.2" enhanced-resolve "^5.7.0" - es-module-lexer "^0.3.26" + es-module-lexer "^0.4.0" eslint-scope "^5.1.1" events "^3.2.0" glob-to-regexp "^0.4.1" From 377b0399a0dd7c8c557e547a17f18d97fb5e913b Mon Sep 17 00:00:00 2001 From: syuilo Date: Fri, 26 Feb 2021 18:06:48 +0900 Subject: [PATCH 03/20] fix migration script --- src/client/init.ts | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/client/init.ts b/src/client/init.ts index ce12849770..6a539a0e1d 100644 --- a/src/client/init.ts +++ b/src/client/init.ts @@ -15,16 +15,18 @@ if (localStorage.getItem('vuex') != null) { localStorage.setItem('accounts', JSON.stringify(vuex.device.accounts)); localStorage.setItem('miux:themes', JSON.stringify(vuex.device.themes)); - for (const [k, v] of Object.entries(vuex.device.userData)) { - localStorage.setItem('pizzax::base::' + k, JSON.stringify({ - widgets: v.widgets - })); - - if (v.deck) { - localStorage.setItem('pizzax::deck::' + k, JSON.stringify({ - columns: v.deck.columns, - layout: v.deck.layout, + if (vuex.device.userData) { + for (const [k, v] of Object.entries(vuex.device.userData)) { + localStorage.setItem('pizzax::base::' + k, JSON.stringify({ + widgets: v.widgets })); + + if (v.deck) { + localStorage.setItem('pizzax::deck::' + k, JSON.stringify({ + columns: v.deck.columns, + layout: v.deck.layout, + })); + } } } From 0921850a79b067627beaa9c7e46d4216979f8211 Mon Sep 17 00:00:00 2001 From: MeiMei <30769358+mei23@users.noreply.github.com> Date: Sat, 27 Feb 2021 01:29:29 +0900 Subject: [PATCH 04/20] Fix #7067 (#7267) --- src/client/widgets/server-metric/cpu-mem.vue | 4 ++-- src/client/widgets/server-metric/mem.vue | 6 +++--- src/daemons/server-stats.ts | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/client/widgets/server-metric/cpu-mem.vue b/src/client/widgets/server-metric/cpu-mem.vue index f1c31d7cdf..ad9e6a8b0f 100644 --- a/src/client/widgets/server-metric/cpu-mem.vue +++ b/src/client/widgets/server-metric/cpu-mem.vue @@ -120,7 +120,7 @@ export default defineComponent({ if (this.stats.length > 50) this.stats.shift(); const cpuPolylinePoints = this.stats.map((s, i) => [this.viewBoxX - ((this.stats.length - 1) - i), (1 - s.cpu) * this.viewBoxY]); - const memPolylinePoints = this.stats.map((s, i) => [this.viewBoxX - ((this.stats.length - 1) - i), (1 - (s.mem.used / this.meta.mem.total)) * this.viewBoxY]); + const memPolylinePoints = this.stats.map((s, i) => [this.viewBoxX - ((this.stats.length - 1) - i), (1 - (s.mem.active / this.meta.mem.total)) * this.viewBoxY]); this.cpuPolylinePoints = cpuPolylinePoints.map(xy => `${xy[0]},${xy[1]}`).join(' '); this.memPolylinePoints = memPolylinePoints.map(xy => `${xy[0]},${xy[1]}`).join(' '); @@ -133,7 +133,7 @@ export default defineComponent({ this.memHeadY = memPolylinePoints[memPolylinePoints.length - 1][1]; this.cpuP = (stats.cpu * 100).toFixed(0); - this.memP = (stats.mem.used / this.meta.mem.total * 100).toFixed(0); + this.memP = (stats.mem.active / this.meta.mem.total * 100).toFixed(0); }, onStatsLog(statsLog) { for (const stats of [...statsLog].reverse()) { diff --git a/src/client/widgets/server-metric/mem.vue b/src/client/widgets/server-metric/mem.vue index eab23c1be2..83aa71aa09 100644 --- a/src/client/widgets/server-metric/mem.vue +++ b/src/client/widgets/server-metric/mem.vue @@ -45,10 +45,10 @@ export default defineComponent({ }, methods: { onStats(stats) { - this.usage = stats.mem.used / this.meta.mem.total; + this.usage = stats.mem.active / this.meta.mem.total; this.total = this.meta.mem.total; - this.used = stats.mem.used; - this.free = this.meta.mem.total - stats.mem.used; + this.used = stats.mem.active; + this.free = this.meta.mem.total - stats.mem.active; }, bytes } diff --git a/src/daemons/server-stats.ts b/src/daemons/server-stats.ts index 57691fbc00..bc1da5eef6 100644 --- a/src/daemons/server-stats.ts +++ b/src/daemons/server-stats.ts @@ -28,7 +28,7 @@ export default function() { const stats = { cpu: roundCpu(cpu), mem: { - used: round(memStats.used), + used: round(memStats.used - memStats.buffers - memStats.cached), active: round(memStats.active), }, net: { From aba867ea14c5f3f151da7b27dedab63f5105b42c Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Fri, 26 Feb 2021 20:15:20 +0000 Subject: [PATCH 05/20] Bump nodemailer from 6.4.18 to 6.5.0 Bumps [nodemailer](https://github.com/nodemailer/nodemailer) from 6.4.18 to 6.5.0. - [Release notes](https://github.com/nodemailer/nodemailer/releases) - [Changelog](https://github.com/nodemailer/nodemailer/blob/master/CHANGELOG.md) - [Commits](https://github.com/nodemailer/nodemailer/compare/v6.4.18...v6.5.0) Signed-off-by: dependabot-preview[bot] --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 149a708b52..e2b8d8cca6 100644 --- a/package.json +++ b/package.json @@ -186,7 +186,7 @@ "multer": "1.4.2", "nested-property": "4.0.0", "node-fetch": "2.6.1", - "nodemailer": "6.4.18", + "nodemailer": "6.5.0", "object-assign-deep": "0.4.0", "os-utils": "0.0.14", "p-cancelable": "2.0.0", diff --git a/yarn.lock b/yarn.lock index 17b6adcac4..a2e691da4a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6995,10 +6995,10 @@ node-releases@^1.1.70: resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.1.71.tgz#cb1334b179896b1c89ecfdd4b725fb7bbdfc7dbb" integrity sha512-zR6HoT6LrLCRBwukmrVbHv0EpEQjksO6GmFcZQQuCAy139BEsoVKPYnf3jongYW83fAa1torLGYwxxky/p28sg== -nodemailer@6.4.18: - version "6.4.18" - resolved "https://registry.yarnpkg.com/nodemailer/-/nodemailer-6.4.18.tgz#2788c85792844fc17befda019031609017f4b9a1" - integrity sha512-ht9cXxQ+lTC+t00vkSIpKHIyM4aXIsQ1tcbQCn5IOnxYHi81W2XOaU66EQBFFpbtzLEBTC94gmkbD4mGZQzVpA== +nodemailer@6.5.0: + version "6.5.0" + resolved "https://registry.yarnpkg.com/nodemailer/-/nodemailer-6.5.0.tgz#d12c28d8d48778918e25f1999d97910231b175d9" + integrity sha512-Tm4RPrrIZbnqDKAvX+/4M+zovEReiKlEXWDzG4iwtpL9X34MJY+D5LnQPH/+eghe8DLlAVshHAJZAZWBGhkguw== nofilter@^2.0.0: version "2.0.0" From 06e817af597e7ee621bdeb370c72d7555482d943 Mon Sep 17 00:00:00 2001 From: syuilo Date: Sat, 27 Feb 2021 11:18:53 +0900 Subject: [PATCH 06/20] perf: use overflow: clip instead of hidden --- src/client/components/autocomplete.vue | 9 ++++--- src/client/components/channel-preview.vue | 3 ++- src/client/components/drive.file.vue | 3 ++- src/client/components/form/input.vue | 3 ++- src/client/components/form/link.vue | 3 ++- src/client/components/global/avatar.vue | 3 ++- .../global/misskey-flavored-markdown.vue | 3 ++- src/client/components/instance-stats.vue | 3 ++- src/client/components/instance-ticker.vue | 3 ++- src/client/components/media-banner.vue | 6 +++-- src/client/components/media-image.vue | 3 ++- src/client/components/media-list.vue | 3 ++- src/client/components/media-video.vue | 3 ++- src/client/components/note-detailed.vue | 6 +++-- src/client/components/note-header.vue | 6 +++-- src/client/components/note-preview.vue | 3 ++- src/client/components/note.vue | 9 ++++--- src/client/components/notification.vue | 6 +++-- src/client/components/poll.vue | 3 ++- src/client/components/post-form-attaches.vue | 3 ++- src/client/components/sidebar.vue | 3 ++- src/client/components/toast.vue | 3 ++- src/client/components/ui/button.vue | 6 +++-- src/client/components/ui/container.vue | 3 ++- src/client/components/ui/input.vue | 6 +++-- src/client/components/ui/menu.vue | 3 ++- src/client/components/ui/modal-window.vue | 6 +++-- src/client/components/ui/range.vue | 3 ++- src/client/components/ui/window.vue | 6 +++-- src/client/components/url-preview.vue | 6 +++-- src/client/components/user-info.vue | 3 ++- src/client/components/user-preview.vue | 3 ++- src/client/components/users-dialog.vue | 6 +++-- src/client/components/visibility-picker.vue | 3 ++- src/client/pages/about-misskey.vue | 2 +- src/client/pages/follow-requests.vue | 6 +++-- src/client/pages/instance/emojis.vue | 18 +++++++++----- src/client/pages/messaging/index.vue | 9 ++++--- .../messaging/messaging-room.message.vue | 9 ++++--- .../page-editor/page-editor.container.vue | 3 ++- src/client/pages/reversi/game.board.vue | 3 ++- src/client/pages/reversi/game.setting.vue | 3 ++- src/client/pages/settings/drive.vue | 3 ++- src/client/pages/settings/security.vue | 3 ++- src/client/pages/settings/theme.vue | 3 ++- src/client/pages/user/index.vue | 24 ++++++++++++------- src/client/pages/welcome.entrance.a.vue | 3 ++- src/client/pages/welcome.entrance.b.vue | 3 ++- src/client/pages/welcome.setup.vue | 3 ++- src/client/style.scss | 11 ++++++++- src/client/ui/_common_/header.vue | 3 ++- src/client/ui/_common_/upload.vue | 6 +++-- src/client/ui/chat/index.vue | 12 ++++++---- src/client/ui/chat/note-header.vue | 6 +++-- src/client/ui/chat/note-preview.vue | 3 ++- src/client/ui/chat/note.vue | 6 +++-- src/client/ui/deck/column.vue | 6 +++-- src/client/ui/visitor/header.vue | 6 +++-- src/client/widgets/calendar.vue | 3 ++- src/client/widgets/federation.vue | 9 ++++--- src/client/widgets/rss.vue | 3 ++- src/client/widgets/trends.vue | 9 ++++--- 62 files changed, 217 insertions(+), 105 deletions(-) diff --git a/src/client/components/autocomplete.vue b/src/client/components/autocomplete.vue index ae742610f7..1fe74adc66 100644 --- a/src/client/components/autocomplete.vue +++ b/src/client/components/autocomplete.vue @@ -401,7 +401,8 @@ export default defineComponent({ z-index: 65535; max-width: 100%; margin-top: calc(1em + 8px); - overflow: hidden; + overflow: hidden; // overflow: clip; をSafariが対応したら消す + overflow: clip; transition: top 0.1s ease, left 0.1s ease; > ol { @@ -418,7 +419,8 @@ export default defineComponent({ align-items: center; padding: 4px 12px; white-space: nowrap; - overflow: hidden; + overflow: hidden; // overflow: clip; をSafariが対応したら消す + overflow: clip; font-size: 0.9em; cursor: default; @@ -427,7 +429,8 @@ export default defineComponent({ } * { - overflow: hidden; + overflow: hidden; // overflow: clip; をSafariが対応したら消す + overflow: clip; text-overflow: ellipsis; } diff --git a/src/client/components/channel-preview.vue b/src/client/components/channel-preview.vue index e222ad7ae7..3e24774f52 100644 --- a/src/client/components/channel-preview.vue +++ b/src/client/components/channel-preview.vue @@ -66,7 +66,8 @@ export default defineComponent({ diff --git a/src/client/components/ui/button.vue b/src/client/components/ui/button.vue index 3901e8ae44..e98c5efcc0 100644 --- a/src/client/components/ui/button.vue +++ b/src/client/components/ui/button.vue @@ -124,7 +124,8 @@ export default defineComponent({ text-decoration: none; background: var(--buttonBg); border-radius: 999px; - overflow: hidden; + overflow: hidden; // overflow: clip; をSafariが対応したら消す + overflow: clip; &:not(:disabled):hover { background: var(--buttonHoverBg); @@ -212,7 +213,8 @@ export default defineComponent({ width: 100%; height: 100%; border-radius: 6px; - overflow: hidden; + overflow: hidden; // overflow: clip; をSafariが対応したら消す + overflow: clip; ::v-deep(div) { position: absolute; diff --git a/src/client/components/ui/container.vue b/src/client/components/ui/container.vue index c3353cca89..b9360e92fa 100644 --- a/src/client/components/ui/container.vue +++ b/src/client/components/ui/container.vue @@ -116,7 +116,8 @@ export default defineComponent({ .ukygtjoj { position: relative; - overflow: hidden; + overflow: hidden; // overflow: clip; をSafariが対応したら消す + overflow: clip; &.naked { background: transparent !important; diff --git a/src/client/components/ui/input.vue b/src/client/components/ui/input.vue index 1c5222f8f2..cea1ec1b7f 100644 --- a/src/client/components/ui/input.vue +++ b/src/client/components/ui/input.vue @@ -298,7 +298,8 @@ export default defineComponent({ transform: scale(.75); white-space: nowrap; width: 133%; - overflow: hidden; + overflow: hidden; // overflow: clip; をSafariが対応したら消す + overflow: clip; text-overflow: ellipsis; > .warning { @@ -354,7 +355,8 @@ export default defineComponent({ display: inline-block; min-width: 16px; max-width: 150px; - overflow: hidden; + overflow: hidden; // overflow: clip; をSafariが対応したら消す + overflow: clip; white-space: nowrap; text-overflow: ellipsis; } diff --git a/src/client/components/ui/menu.vue b/src/client/components/ui/menu.vue index c2033402e3..c9accf7c31 100644 --- a/src/client/components/ui/menu.vue +++ b/src/client/components/ui/menu.vue @@ -155,7 +155,8 @@ export default defineComponent({ font-size: 0.9em; line-height: 20px; text-align: center; - overflow: hidden; + overflow: hidden; // overflow: clip; をSafariが対応したら消す + overflow: clip; text-overflow: ellipsis; &.danger { diff --git a/src/client/components/ui/modal-window.vue b/src/client/components/ui/modal-window.vue index 2cdf961379..3965b537e5 100644 --- a/src/client/components/ui/modal-window.vue +++ b/src/client/components/ui/modal-window.vue @@ -89,7 +89,8 @@ export default defineComponent({ diff --git a/src/client/components/emoji-picker-window.vue b/src/client/components/emoji-picker-window.vue new file mode 100644 index 0000000000..fb6a5a9072 --- /dev/null +++ b/src/client/components/emoji-picker-window.vue @@ -0,0 +1,197 @@ + + + + + diff --git a/src/client/components/emoji-picker.vue b/src/client/components/emoji-picker.vue index 9a261ef83f..93530e16c8 100644 --- a/src/client/components/emoji-picker.vue +++ b/src/client/components/emoji-picker.vue @@ -1,93 +1,91 @@ + + diff --git a/src/client/components/emoji-picker.vue b/src/client/components/emoji-picker.vue index 93530e16c8..b11f0a62fa 100644 --- a/src/client/components/emoji-picker.vue +++ b/src/client/components/emoji-picker.vue @@ -28,7 +28,7 @@ -
+
- -
- -
-
{{ category || $ts.other }}
-
- -
-
- -
-
{{ category.name }}
-
- -
-
+
+
{{ $ts.customEmojis }}
+ +
+
+
{{ $ts.emoji }}
+ +
+
+
{{ $ts.tags }}
+ +
+
+
+ + + +
@@ -92,15 +86,20 @@ import { defineComponent, markRaw } from 'vue'; import { emojilist } from '../../misc/emojilist'; import { getStaticImageUrl } from '@/scripts/get-static-image-url'; -import { faAsterisk, faLeaf, faUtensils, faFutbol, faCity, faDice, faGlobe, faClock, faUser, faChevronDown } from '@fortawesome/free-solid-svg-icons'; +import { faAsterisk, faLeaf, faUtensils, faFutbol, faCity, faDice, faGlobe, faClock, faUser, faChevronDown, faShapes, faBicycle, faHashtag } from '@fortawesome/free-solid-svg-icons'; import { faHeart, faFlag, faLaugh } from '@fortawesome/free-regular-svg-icons'; import Particle from '@/components/particle.vue'; import * as os from '@/os'; import { isDeviceTouch } from '@/scripts/is-device-touch'; import { isMobile } from '@/scripts/is-mobile'; -import { emojiCategories } from '@/instance'; +import { emojiCategories, emojiTags } from '@/instance'; +import XSection from './emoji-picker.section.vue'; export default defineComponent({ + components: { + XSection + }, + props: { showPinned: { required: false, @@ -122,50 +121,17 @@ export default defineComponent({ height: this.asReactionPicker ? this.$store.state.reactionPickerHeight : 2, big: this.asReactionPicker ? isDeviceTouch : false, customEmojiCategories: emojiCategories, + emojiTags, customEmojis: this.$instance.emojis, - visibleCategories: {}, q: null, searchResultCustom: [], searchResultUnicode: [], - faGlobe, faClock, faChevronDown, - categories: [{ - name: 'face', - icon: faLaugh, - isActive: false - }, { - name: 'people', - icon: faUser, - isActive: false - }, { - name: 'animals_and_nature', - icon: faLeaf, - isActive: false - }, { - name: 'food_and_drink', - icon: faUtensils, - isActive: false - }, { - name: 'activity', - icon: faFutbol, - isActive: false - }, { - name: 'travel_and_places', - icon: faCity, - isActive: false - }, { - name: 'objects', - icon: faDice, - isActive: false - }, { - name: 'symbols', - icon: faHeart, - isActive: false - }, { - name: 'flags', - icon: faFlag, - isActive: false - }], - faAsterisk + tab: 'index', + showingCustomEmojis: false, + showingEmojis: false, + showingTags: false, + categories: ['face', 'people', 'animals_and_nature', 'food_and_drink', 'activity', 'travel_and_places', 'objects', 'symbols', 'flags'], + faGlobe, faClock, faChevronDown, faAsterisk, faLaugh, faUtensils, faLeaf, faShapes, faBicycle, faHashtag, }; }, @@ -342,7 +308,7 @@ export default defineComponent({ let recents = this.$store.state.recentlyUsedEmojis; recents = recents.filter((e: any) => e !== key); recents.unshift(key); - this.$store.set('recentlyUsedEmojis', recents.splice(0, 16)); + this.$store.set('recentlyUsedEmojis', recents.splice(0, 32)); } }, @@ -434,6 +400,22 @@ export default defineComponent({ } } + > .tabs { + display: flex; + display: none; + + > .tab { + flex: 1; + height: 38px; + border-top: solid 1px var(--divider); + + &.active { + border-top: solid 1px var(--accent); + color: var(--accent); + } + } + } + > .emojis { height: var(--height); overflow-y: auto; @@ -445,34 +427,43 @@ export default defineComponent({ display: none; } - > .index { - min-height: var(--height); - position: relative; - border-bottom: solid 1px var(--divider); - - > .arrow { - position: absolute; - bottom: 0; - left: 0; - width: 100%; - padding: 16px 0; - text-align: center; - opacity: 0.5; - pointer-events: none; + > div { + &:not(.index) { + padding: 4px 0 8px 0; + border-top: solid 1px var(--divider); + } + + > header { + /*position: sticky; + top: 0; + left: 0;*/ + height: 32px; + line-height: 32px; + z-index: 2; + padding: 0 8px; + font-size: 12px; } } - section { + ::v-deep(section) { > header { position: sticky; top: 0; left: 0; + height: 32px; + line-height: 32px; z-index: 1; - padding: 8px; + padding: 0 8px; font-size: 12px; + cursor: pointer; + + &:hover { + color: var(--accent); + } } > div { + position: relative; padding: $pad; > button { @@ -512,14 +503,6 @@ export default defineComponent({ display: none; } } - - &.unicode { - min-height: 384px; - } - - &.custom { - min-height: 64px; - } } } } diff --git a/src/client/instance.ts b/src/client/instance.ts index 89c0368599..bd6b1bd571 100644 --- a/src/client/instance.ts +++ b/src/client/instance.ts @@ -37,6 +37,16 @@ export const emojiCategories = computed(() => { return Array.from(categories); }); +export const emojiTags = computed(() => { + const tags = new Set(); + for (const emoji of instance.emojis) { + for (const tag of emoji.aliases) { + tags.add(tag); + } + } + return Array.from(tags); +}); + // このファイルに書きたくないけどここに書かないと何故かVeturが認識しない declare module '@vue/runtime-core' { interface ComponentCustomProperties { From 764a158cd7e112186cbf54cb77599bcd22ea7d69 Mon Sep 17 00:00:00 2001 From: syuilo Date: Sun, 28 Feb 2021 01:09:59 +0900 Subject: [PATCH 13/20] Resolve #7270 --- src/client/components/emoji-picker-dialog.vue | 9 ++++- src/client/components/emoji-picker.vue | 35 ++++++++---------- src/client/components/note-detailed.vue | 22 ++++------- src/client/components/note.vue | 22 ++++------- src/client/components/ui/modal.vue | 26 +++++++++---- src/client/os.ts | 37 +++++++++++++++++++ src/client/ui/chat/note.vue | 25 ++++--------- 7 files changed, 101 insertions(+), 75 deletions(-) diff --git a/src/client/components/emoji-picker-dialog.vue b/src/client/components/emoji-picker-dialog.vue index 177b5db44d..3450d219c3 100644 --- a/src/client/components/emoji-picker-dialog.vue +++ b/src/client/components/emoji-picker-dialog.vue @@ -1,6 +1,6 @@ @@ -16,6 +16,11 @@ export default defineComponent({ }, props: { + manualShowing: { + type: Boolean, + required: false, + default: null, + }, src: { required: false }, diff --git a/src/client/components/emoji-picker.vue b/src/client/components/emoji-picker.vue index b11f0a62fa..41e667dd98 100644 --- a/src/client/components/emoji-picker.vue +++ b/src/client/components/emoji-picker.vue @@ -54,23 +54,17 @@ -
+
{{ $ts.customEmojis }}
- + {{ category || $ts.other }}
-
+
{{ $ts.emoji }}
- + {{ category }}
-
+
{{ $ts.tags }}
- + {{ tag }}
@@ -127,9 +121,6 @@ export default defineComponent({ searchResultCustom: [], searchResultUnicode: [], tab: 'index', - showingCustomEmojis: false, - showingEmojis: false, - showingTags: false, categories: ['face', 'people', 'animals_and_nature', 'food_and_drink', 'activity', 'travel_and_places', 'objects', 'symbols', 'flags'], faGlobe, faClock, faChevronDown, faAsterisk, faLaugh, faUtensils, faLeaf, faShapes, faBicycle, faHashtag, }; @@ -279,14 +270,18 @@ export default defineComponent({ }, mounted() { - if (!isMobile && !isDeviceTouch) { - this.$refs.search.focus({ - preventScroll: true - }); - } + this.focus(); }, methods: { + focus() { + if (!isMobile && !isDeviceTouch) { + this.$refs.search.focus({ + preventScroll: true + }); + } + }, + getKey(emoji: any) { return typeof emoji === 'string' ? emoji : (emoji.char || `:${emoji.name}:`); }, diff --git a/src/client/components/note-detailed.vue b/src/client/components/note-detailed.vue index e1927133ae..7df87c6b01 100644 --- a/src/client/components/note-detailed.vue +++ b/src/client/components/note-detailed.vue @@ -523,20 +523,14 @@ export default defineComponent({ react(viaKeyboard = false) { pleaseLogin(); this.blur(); - os.popup(import('@/components/emoji-picker-dialog.vue'), { - src: this.$refs.reactButton, - asReactionPicker: true - }, { - done: reaction => { - if (reaction) { - os.api('notes/reactions/create', { - noteId: this.appearNote.id, - reaction: reaction - }); - } - this.focus(); - }, - }, 'closed'); + os.pickReaction(this.$refs.reactButton, reaction => { + os.api('notes/reactions/create', { + noteId: this.appearNote.id, + reaction: reaction + }); + }, () => { + this.focus(); + }); }, reactDirectly(reaction) { diff --git a/src/client/components/note.vue b/src/client/components/note.vue index 6af0668e2e..dab7643762 100644 --- a/src/client/components/note.vue +++ b/src/client/components/note.vue @@ -498,20 +498,14 @@ export default defineComponent({ react(viaKeyboard = false) { pleaseLogin(); this.blur(); - os.popup(import('@/components/emoji-picker-dialog.vue'), { - src: this.$refs.reactButton, - asReactionPicker: true - }, { - done: reaction => { - if (reaction) { - os.api('notes/reactions/create', { - noteId: this.appearNote.id, - reaction: reaction - }); - } - this.focus(); - }, - }, 'closed'); + os.pickReaction(this.$refs.reactButton, reaction => { + os.api('notes/reactions/create', { + noteId: this.appearNote.id, + reaction: reaction + }); + }, () => { + this.focus(); + }); }, reactDirectly(reaction) { diff --git a/src/client/components/ui/modal.vue b/src/client/components/ui/modal.vue index 405fa4aaa5..1c8ae63907 100644 --- a/src/client/components/ui/modal.vue +++ b/src/client/components/ui/modal.vue @@ -1,11 +1,13 @@