diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 00000000..dd84ea78 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,38 @@ +--- +name: Bug report +about: Create a report to help us improve +title: '' +labels: '' +assignees: '' + +--- + +**Describe the bug** +A clear and concise description of what the bug is. + +**To Reproduce** +Steps to reproduce the behavior: +1. Go to '...' +2. Click on '....' +3. Scroll down to '....' +4. See error + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Screenshots** +If applicable, add screenshots to help explain your problem. + +**Desktop (please complete the following information):** + - OS: [e.g. iOS] + - Browser [e.g. chrome, safari] + - Version [e.g. 22] + +**Smartphone (please complete the following information):** + - Device: [e.g. iPhone6] + - OS: [e.g. iOS8.1] + - Browser [e.g. stock browser, safari] + - Version [e.g. 22] + +**Additional context** +Add any other context about the problem here. diff --git a/README.md b/README.md index db514c4b..c78a79d7 100644 --- a/README.md +++ b/README.md @@ -79,10 +79,13 @@ It's been **more than 15 years**. And here I am. Building a Mastodon web client. -## Alternative clients +## Alternative web clients - [Pinafore](https://pinafore.social/) +- [Soapbox](https://fe.soapbox.pub/) - [Elk](https://m.webtoo.ls/@elk) +- [Mastodeck](https://mastodeck.com/) +- - [More...](https://github.com/tleb/awesome-mastodon#clients) ## License diff --git a/package-lock.json b/package-lock.json index 2f718061..53bac186 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,13 +8,14 @@ "name": "phanpy", "version": "0.1.0", "dependencies": { - "@github/relative-time-element": "~4.1.5", "@github/text-expander-element": "~2.3.0", + "dayjs": "~1.11.7", + "dayjs-twitter": "~0.5.0", "fast-blurhash": "~1.1.2", "history": "~5.3.0", "iconify-icon": "~1.0.2", "just-debounce-it": "~3.2.0", - "masto": "~5.1.0", + "masto": "~5.1.1", "mem": "~9.0.2", "preact": "~10.11.3", "preact-router": "~4.1.0", @@ -24,7 +25,7 @@ "swiped-events": "~1.1.7", "toastify-js": "~1.12.0", "use-resize-observer": "~9.1.0", - "valtio": "~1.8.0" + "valtio": "~1.8.2" }, "devDependencies": { "@preact/preset-vite": "~2.5.0", @@ -33,10 +34,11 @@ "postcss": "~8.4.20", "postcss-dark-theme-class": "~0.7.3", "twitter-text": "~3.1.0", - "vite": "~4.0.3", + "vite": "~4.0.4", "vite-plugin-html-config": "~1.0.11", "vite-plugin-html-env": "~1.2.7", - "vite-plugin-pwa": "~0.14.0", + "vite-plugin-pwa": "~0.14.1", + "vite-plugin-remove-console": "~1.3.0", "workbox-cacheable-response": "~6.5.4", "workbox-expiration": "~6.5.4", "workbox-routing": "~6.5.4", @@ -311,7 +313,7 @@ "version": "7.18.6", "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.18.6.tgz", "integrity": "sha512-0NFvs3VkuSYbFi1x2Vd6tKrywq+z/cLeYC/RJNFrIX/30Bf5aiGYbtvGXolEktzJH8o5E5KJ3tT+nkxuuZFVlA==", - "devOptional": true, + "dev": true, "dependencies": { "@babel/types": "^7.18.6" }, @@ -433,7 +435,7 @@ "version": "7.19.4", "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.19.4.tgz", "integrity": "sha512-nHtDoQcuqFmwYNYPz3Rah5ph2p8PFeFCsZk9A/48dPc/rGocJ5J3hAAZ7pb76VWX3fZKu+uEr/FhH5jLx7umrw==", - "devOptional": true, + "dev": true, "engines": { "node": ">=6.9.0" } @@ -442,7 +444,7 @@ "version": "7.19.1", "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz", "integrity": "sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w==", - "devOptional": true, + "dev": true, "engines": { "node": ">=6.9.0" } @@ -1694,7 +1696,7 @@ "version": "7.20.5", "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.20.5.tgz", "integrity": "sha512-c9fst/h2/dcF7H+MJKZ2T0KjEQ8hY/BNnDk/H3XY8C4Aw/eWQXWn/lWntHF9ooUBnGmEvbfGrTgLWc+um0YDUg==", - "devOptional": true, + "dev": true, "dependencies": { "@babel/helper-string-parser": "^7.19.4", "@babel/helper-validator-identifier": "^7.19.1", @@ -2061,11 +2063,6 @@ "resolved": "https://registry.npmjs.org/@github/combobox-nav/-/combobox-nav-2.1.5.tgz", "integrity": "sha512-dmG1PuppNKHnBBEcfylWDwj9SSxd/E/qd8mC1G/klQC3s7ps5q6JZ034mwkkG0LKfI+Y+UgEua/ROD776N400w==" }, - "node_modules/@github/relative-time-element": { - "version": "4.1.5", - "resolved": "https://registry.npmjs.org/@github/relative-time-element/-/relative-time-element-4.1.5.tgz", - "integrity": "sha512-WAf1EQV5Sn6jGuAIQur/ztKlEV9R+VHDNwqEbeaOb6s9fiwM5z7+ujlWNZtgFkDp3lF0H8D/f0vdiPlfHz0ZTQ==" - }, "node_modules/@github/text-expander-element": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/@github/text-expander-element/-/text-expander-element-2.3.0.tgz", @@ -3000,6 +2997,19 @@ "node": ">=8" } }, + "node_modules/dayjs": { + "version": "1.11.7", + "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.7.tgz", + "integrity": "sha512-+Yw9U6YO5TQohxLcIkrXBeY73WP3ejHWVvx8XCk3gxvQDCTEmS48ZrSZCKciI7Bhl/uCMyxYtE9UqRILmFphkQ==" + }, + "node_modules/dayjs-twitter": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/dayjs-twitter/-/dayjs-twitter-0.5.0.tgz", + "integrity": "sha512-SZ7qEUISstBLUXdlGAbLrwr6zfRM9kaCfbq4uVTerM/HXzuHiiGzzUqAJVhxt+3tf69E+ocmQdP6YYpOINv05w==", + "dependencies": { + "duration-js": "^4.0.0" + } + }, "node_modules/debug": { "version": "4.3.4", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", @@ -3059,6 +3069,11 @@ "tslib": "^2.0.3" } }, + "node_modules/duration-js": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/duration-js/-/duration-js-4.0.0.tgz", + "integrity": "sha512-qoXjOsH97r+NrOa6sK5V2cwBOouVG/LI9jwgwKvjVkyqGpZ72yilWjjzFJYPqqbvNZDwpRMaLEUFE+PTefvOEA==" + }, "node_modules/ejs": { "version": "3.1.8", "resolved": "https://registry.npmjs.org/ejs/-/ejs-3.1.8.tgz", @@ -3140,7 +3155,7 @@ "version": "0.16.7", "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.16.7.tgz", "integrity": "sha512-P6OBFYFSQOGzfApqCeYKqfKRRbCIRsdppTXFo4aAvtiW3o8TTyiIplBvHJI171saPAiy3WlawJHCveJVIOIx1A==", - "devOptional": true, + "dev": true, "hasInstallScript": true, "bin": { "esbuild": "bin/esbuild" @@ -3368,7 +3383,7 @@ "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", - "devOptional": true + "dev": true }, "node_modules/function.prototype.name": { "version": "1.1.5", @@ -3505,7 +3520,7 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", - "devOptional": true, + "dev": true, "dependencies": { "function-bind": "^1.1.1" }, @@ -3678,7 +3693,7 @@ "version": "2.11.0", "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.11.0.tgz", "integrity": "sha512-RRjxlvLDkD1YJwDbroBHMb+cukurkDWNyHx7D3oNB5x9rb5ogcksMC5wHCadcXoo67gVr/+3GFySh3134zi6rw==", - "devOptional": true, + "dev": true, "dependencies": { "has": "^1.0.3" }, @@ -4153,9 +4168,9 @@ } }, "node_modules/masto": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/masto/-/masto-5.1.0.tgz", - "integrity": "sha512-/Rvi44BKv9AGGv08Oo63dA2WHE3kwCUtNb1/W0brK9alLaCSboOwTjoWtK46ovjmsm8TugNtKqj2lscxwcFhDQ==", + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/masto/-/masto-5.1.1.tgz", + "integrity": "sha512-IvfdpCiayM4tM58aTf/tfkSq0MGW1kKEAwJvgVRbzmwlE4PBt1WnGvZXQg6CiLkcKBMTQaDjLR0sBaGmPrVGCQ==", "dependencies": { "@mastojs/ponyfills": "^1.0.4", "change-case": "^4.1.2", @@ -4274,7 +4289,7 @@ "version": "3.3.4", "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.4.tgz", "integrity": "sha512-MqBkQh/OHTS2egovRtLk45wEyNXwF+cokD+1YPf9u5VfJiRdAiRwB2froX5Co9Rh20xs4siNPm8naNotSD6RBw==", - "devOptional": true, + "dev": true, "bin": { "nanoid": "bin/nanoid.cjs" }, @@ -4437,13 +4452,13 @@ "version": "1.0.7", "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", - "devOptional": true + "dev": true }, "node_modules/picocolors": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", - "devOptional": true + "dev": true }, "node_modules/picomatch": { "version": "2.3.1", @@ -4461,7 +4476,7 @@ "version": "8.4.20", "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.20.tgz", "integrity": "sha512-6Q04AXR1212bXr5fh03u8aAwbLxAQNGQ/Q1LNa0VfOI06ZAlhPHtQvE4OIdpj4kLThXilalPnmDSOD65DcHt+g==", - "devOptional": true, + "dev": true, "funding": [ { "type": "opencollective", @@ -4549,9 +4564,9 @@ } }, "node_modules/proxy-compare": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/proxy-compare/-/proxy-compare-2.3.0.tgz", - "integrity": "sha512-c3L2CcAi7f7pvlD0D7xsF+2CQIW8C3HaYx2Pfgq8eA4HAl3GAH6/dVYsyBbYF/0XJs2ziGLrzmz5fmzPm6A0pQ==" + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/proxy-compare/-/proxy-compare-2.4.0.tgz", + "integrity": "sha512-FD8KmQUQD6Mfpd0hywCOzcon/dbkFP8XBd9F1ycbKtvVsfv6TsFUKJ2eC0Iz2y+KzlkdT1Z8SY6ZSgm07zOyqg==" }, "node_modules/punycode": { "version": "2.1.1", @@ -4739,7 +4754,7 @@ "version": "1.22.1", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.1.tgz", "integrity": "sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw==", - "devOptional": true, + "dev": true, "dependencies": { "is-core-module": "^2.9.0", "path-parse": "^1.0.7", @@ -4766,7 +4781,7 @@ "version": "3.7.4", "resolved": "https://registry.npmjs.org/rollup/-/rollup-3.7.4.tgz", "integrity": "sha512-jN9rx3k5pfg9H9al0r0y1EYKSeiRANZRYX32SuNXAnKzh6cVyf4LZVto1KAuDnbHT03E1CpsgqDKaqQ8FZtgxw==", - "devOptional": true, + "dev": true, "bin": { "rollup": "dist/bin/rollup" }, @@ -4908,7 +4923,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz", "integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==", - "devOptional": true, + "dev": true, "engines": { "node": ">=0.10.0" } @@ -5044,7 +5059,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", - "devOptional": true, + "dev": true, "engines": { "node": ">= 0.4" }, @@ -5106,7 +5121,7 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", "integrity": "sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==", - "devOptional": true, + "dev": true, "engines": { "node": ">=4" } @@ -5336,50 +5351,30 @@ } }, "node_modules/valtio": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/valtio/-/valtio-1.8.0.tgz", - "integrity": "sha512-lNw7wM0Qb9iBzXMju+XCn+UiIlf5uCe5pcI8XRqcvxEZ/mnRXyKXoOodPDKB8cIAVekA3Q3zWA7rboCdS4ea7g==", + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/valtio/-/valtio-1.8.2.tgz", + "integrity": "sha512-ypFWPi3aY04tojWAFPbTYBDw5iFaCDbKAJ2XqhmY2XOSorNtaCZJNg++FSssv8gMJwmPXfrU/RjncQtsoOHbUg==", "dependencies": { - "proxy-compare": "2.3.0", + "proxy-compare": "2.4.0", "use-sync-external-store": "1.2.0" }, "engines": { "node": ">=12.7.0" }, "peerDependencies": { - "@babel/helper-module-imports": ">=7.12", - "@babel/types": ">=7.13", - "aslemammad-vite-plugin-macro": ">=1.0.0-alpha.1", - "babel-plugin-macros": ">=3.0", - "react": ">=16.8", - "vite": ">=2.8.6" + "react": ">=16.8" }, "peerDependenciesMeta": { - "@babel/helper-module-imports": { - "optional": true - }, - "@babel/types": { - "optional": true - }, - "aslemammad-vite-plugin-macro": { - "optional": true - }, - "babel-plugin-macros": { - "optional": true - }, "react": { "optional": true - }, - "vite": { - "optional": true } } }, "node_modules/vite": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/vite/-/vite-4.0.3.tgz", - "integrity": "sha512-HvuNv1RdE7deIfQb8mPk51UKjqptO/4RXZ5yXSAvurd5xOckwS/gg8h9Tky3uSbnjYTgUm0hVCet1cyhKd73ZA==", - "devOptional": true, + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/vite/-/vite-4.0.4.tgz", + "integrity": "sha512-xevPU7M8FU0i/80DMR+YhgrzR5KS2ORy1B4xcX/cXLsvnUWvfHuqMmVU6N0YiJ4JWGRJJsLCgjEzKjG9/GKoSw==", + "dev": true, "dependencies": { "esbuild": "^0.16.3", "postcss": "^8.4.20", @@ -5449,9 +5444,9 @@ } }, "node_modules/vite-plugin-pwa": { - "version": "0.14.0", - "resolved": "https://registry.npmjs.org/vite-plugin-pwa/-/vite-plugin-pwa-0.14.0.tgz", - "integrity": "sha512-3wZx47PLWTckOQhc8Y6YZjAbNZ89Ovh4TdCT97MGhgl7aFd2LUekVnAmIgFwgMqyxzJ93nmkPF/ALpEW/i2qCg==", + "version": "0.14.1", + "resolved": "https://registry.npmjs.org/vite-plugin-pwa/-/vite-plugin-pwa-0.14.1.tgz", + "integrity": "sha512-5zx7yhQ8RTLwV71+GA9YsQQ63ALKG8XXIMqRJDdZkR8ZYftFcRgnzM7wOWmQZ/DATspyhPih5wCdcZnAIsM+mA==", "dev": true, "dependencies": { "@rollup/plugin-replace": "^5.0.1", @@ -5471,6 +5466,12 @@ "workbox-window": "^6.5.4" } }, + "node_modules/vite-plugin-remove-console": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/vite-plugin-remove-console/-/vite-plugin-remove-console-1.3.0.tgz", + "integrity": "sha512-5a/OLYB6yNRHMuHj9rBQRYMQ1NBKffxA8BaD77urUBLcGOWMHFHALjh6C26wZfZd41KytSwLp6DhvNKU78mNJg==", + "dev": true + }, "node_modules/webidl-conversions": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-4.0.2.tgz", @@ -6068,7 +6069,7 @@ "version": "7.18.6", "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.18.6.tgz", "integrity": "sha512-0NFvs3VkuSYbFi1x2Vd6tKrywq+z/cLeYC/RJNFrIX/30Bf5aiGYbtvGXolEktzJH8o5E5KJ3tT+nkxuuZFVlA==", - "devOptional": true, + "dev": true, "requires": { "@babel/types": "^7.18.6" } @@ -6160,13 +6161,13 @@ "version": "7.19.4", "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.19.4.tgz", "integrity": "sha512-nHtDoQcuqFmwYNYPz3Rah5ph2p8PFeFCsZk9A/48dPc/rGocJ5J3hAAZ7pb76VWX3fZKu+uEr/FhH5jLx7umrw==", - "devOptional": true + "dev": true }, "@babel/helper-validator-identifier": { "version": "7.19.1", "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz", "integrity": "sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w==", - "devOptional": true + "dev": true }, "@babel/helper-validator-option": { "version": "7.18.6", @@ -7010,7 +7011,7 @@ "version": "7.20.5", "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.20.5.tgz", "integrity": "sha512-c9fst/h2/dcF7H+MJKZ2T0KjEQ8hY/BNnDk/H3XY8C4Aw/eWQXWn/lWntHF9ooUBnGmEvbfGrTgLWc+um0YDUg==", - "devOptional": true, + "dev": true, "requires": { "@babel/helper-string-parser": "^7.19.4", "@babel/helper-validator-identifier": "^7.19.1", @@ -7176,11 +7177,6 @@ "resolved": "https://registry.npmjs.org/@github/combobox-nav/-/combobox-nav-2.1.5.tgz", "integrity": "sha512-dmG1PuppNKHnBBEcfylWDwj9SSxd/E/qd8mC1G/klQC3s7ps5q6JZ034mwkkG0LKfI+Y+UgEua/ROD776N400w==" }, - "@github/relative-time-element": { - "version": "4.1.5", - "resolved": "https://registry.npmjs.org/@github/relative-time-element/-/relative-time-element-4.1.5.tgz", - "integrity": "sha512-WAf1EQV5Sn6jGuAIQur/ztKlEV9R+VHDNwqEbeaOb6s9fiwM5z7+ujlWNZtgFkDp3lF0H8D/f0vdiPlfHz0ZTQ==" - }, "@github/text-expander-element": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/@github/text-expander-element/-/text-expander-element-2.3.0.tgz", @@ -7918,6 +7914,19 @@ "integrity": "sha512-v1plID3y9r/lPhviJ1wrXpLeyUIGAZ2SHNYTEapm7/8A9nLPoyvVp3RK/EPFqn5kEznyWgYZNsRtYYIWbuG8KA==", "dev": true }, + "dayjs": { + "version": "1.11.7", + "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.7.tgz", + "integrity": "sha512-+Yw9U6YO5TQohxLcIkrXBeY73WP3ejHWVvx8XCk3gxvQDCTEmS48ZrSZCKciI7Bhl/uCMyxYtE9UqRILmFphkQ==" + }, + "dayjs-twitter": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/dayjs-twitter/-/dayjs-twitter-0.5.0.tgz", + "integrity": "sha512-SZ7qEUISstBLUXdlGAbLrwr6zfRM9kaCfbq4uVTerM/HXzuHiiGzzUqAJVhxt+3tf69E+ocmQdP6YYpOINv05w==", + "requires": { + "duration-js": "^4.0.0" + } + }, "debug": { "version": "4.3.4", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", @@ -7957,6 +7966,11 @@ "tslib": "^2.0.3" } }, + "duration-js": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/duration-js/-/duration-js-4.0.0.tgz", + "integrity": "sha512-qoXjOsH97r+NrOa6sK5V2cwBOouVG/LI9jwgwKvjVkyqGpZ72yilWjjzFJYPqqbvNZDwpRMaLEUFE+PTefvOEA==" + }, "ejs": { "version": "3.1.8", "resolved": "https://registry.npmjs.org/ejs/-/ejs-3.1.8.tgz", @@ -8020,7 +8034,7 @@ "version": "0.16.7", "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.16.7.tgz", "integrity": "sha512-P6OBFYFSQOGzfApqCeYKqfKRRbCIRsdppTXFo4aAvtiW3o8TTyiIplBvHJI171saPAiy3WlawJHCveJVIOIx1A==", - "devOptional": true, + "dev": true, "requires": { "@esbuild/android-arm": "0.16.7", "@esbuild/android-arm64": "0.16.7", @@ -8202,7 +8216,7 @@ "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", - "devOptional": true + "dev": true }, "function.prototype.name": { "version": "1.1.5", @@ -8303,7 +8317,7 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", - "devOptional": true, + "dev": true, "requires": { "function-bind": "^1.1.1" } @@ -8431,7 +8445,7 @@ "version": "2.11.0", "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.11.0.tgz", "integrity": "sha512-RRjxlvLDkD1YJwDbroBHMb+cukurkDWNyHx7D3oNB5x9rb5ogcksMC5wHCadcXoo67gVr/+3GFySh3134zi6rw==", - "devOptional": true, + "dev": true, "requires": { "has": "^1.0.3" } @@ -8777,9 +8791,9 @@ } }, "masto": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/masto/-/masto-5.1.0.tgz", - "integrity": "sha512-/Rvi44BKv9AGGv08Oo63dA2WHE3kwCUtNb1/W0brK9alLaCSboOwTjoWtK46ovjmsm8TugNtKqj2lscxwcFhDQ==", + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/masto/-/masto-5.1.1.tgz", + "integrity": "sha512-IvfdpCiayM4tM58aTf/tfkSq0MGW1kKEAwJvgVRbzmwlE4PBt1WnGvZXQg6CiLkcKBMTQaDjLR0sBaGmPrVGCQ==", "requires": { "@mastojs/ponyfills": "^1.0.4", "change-case": "^4.1.2", @@ -8867,7 +8881,7 @@ "version": "3.3.4", "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.4.tgz", "integrity": "sha512-MqBkQh/OHTS2egovRtLk45wEyNXwF+cokD+1YPf9u5VfJiRdAiRwB2froX5Co9Rh20xs4siNPm8naNotSD6RBw==", - "devOptional": true + "dev": true }, "no-case": { "version": "3.0.4", @@ -8994,13 +9008,13 @@ "version": "1.0.7", "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", - "devOptional": true + "dev": true }, "picocolors": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", - "devOptional": true + "dev": true }, "picomatch": { "version": "2.3.1", @@ -9012,7 +9026,7 @@ "version": "8.4.20", "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.20.tgz", "integrity": "sha512-6Q04AXR1212bXr5fh03u8aAwbLxAQNGQ/Q1LNa0VfOI06ZAlhPHtQvE4OIdpj4kLThXilalPnmDSOD65DcHt+g==", - "devOptional": true, + "dev": true, "requires": { "nanoid": "^3.3.4", "picocolors": "^1.0.0", @@ -9057,9 +9071,9 @@ "dev": true }, "proxy-compare": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/proxy-compare/-/proxy-compare-2.3.0.tgz", - "integrity": "sha512-c3L2CcAi7f7pvlD0D7xsF+2CQIW8C3HaYx2Pfgq8eA4HAl3GAH6/dVYsyBbYF/0XJs2ziGLrzmz5fmzPm6A0pQ==" + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/proxy-compare/-/proxy-compare-2.4.0.tgz", + "integrity": "sha512-FD8KmQUQD6Mfpd0hywCOzcon/dbkFP8XBd9F1ycbKtvVsfv6TsFUKJ2eC0Iz2y+KzlkdT1Z8SY6ZSgm07zOyqg==" }, "punycode": { "version": "2.1.1", @@ -9200,7 +9214,7 @@ "version": "1.22.1", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.1.tgz", "integrity": "sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw==", - "devOptional": true, + "dev": true, "requires": { "is-core-module": "^2.9.0", "path-parse": "^1.0.7", @@ -9217,7 +9231,7 @@ "version": "3.7.4", "resolved": "https://registry.npmjs.org/rollup/-/rollup-3.7.4.tgz", "integrity": "sha512-jN9rx3k5pfg9H9al0r0y1EYKSeiRANZRYX32SuNXAnKzh6cVyf4LZVto1KAuDnbHT03E1CpsgqDKaqQ8FZtgxw==", - "devOptional": true, + "dev": true, "requires": { "fsevents": "~2.3.2" } @@ -9312,7 +9326,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz", "integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==", - "devOptional": true + "dev": true }, "source-map-support": { "version": "0.5.21", @@ -9415,7 +9429,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", - "devOptional": true + "dev": true }, "swiped-events": { "version": "1.1.7", @@ -9456,7 +9470,7 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", "integrity": "sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==", - "devOptional": true + "dev": true }, "to-regex-range": { "version": "5.0.1", @@ -9629,19 +9643,19 @@ "requires": {} }, "valtio": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/valtio/-/valtio-1.8.0.tgz", - "integrity": "sha512-lNw7wM0Qb9iBzXMju+XCn+UiIlf5uCe5pcI8XRqcvxEZ/mnRXyKXoOodPDKB8cIAVekA3Q3zWA7rboCdS4ea7g==", + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/valtio/-/valtio-1.8.2.tgz", + "integrity": "sha512-ypFWPi3aY04tojWAFPbTYBDw5iFaCDbKAJ2XqhmY2XOSorNtaCZJNg++FSssv8gMJwmPXfrU/RjncQtsoOHbUg==", "requires": { - "proxy-compare": "2.3.0", + "proxy-compare": "2.4.0", "use-sync-external-store": "1.2.0" } }, "vite": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/vite/-/vite-4.0.3.tgz", - "integrity": "sha512-HvuNv1RdE7deIfQb8mPk51UKjqptO/4RXZ5yXSAvurd5xOckwS/gg8h9Tky3uSbnjYTgUm0hVCet1cyhKd73ZA==", - "devOptional": true, + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/vite/-/vite-4.0.4.tgz", + "integrity": "sha512-xevPU7M8FU0i/80DMR+YhgrzR5KS2ORy1B4xcX/cXLsvnUWvfHuqMmVU6N0YiJ4JWGRJJsLCgjEzKjG9/GKoSw==", + "dev": true, "requires": { "esbuild": "^0.16.3", "fsevents": "~2.3.2", @@ -9665,9 +9679,9 @@ "requires": {} }, "vite-plugin-pwa": { - "version": "0.14.0", - "resolved": "https://registry.npmjs.org/vite-plugin-pwa/-/vite-plugin-pwa-0.14.0.tgz", - "integrity": "sha512-3wZx47PLWTckOQhc8Y6YZjAbNZ89Ovh4TdCT97MGhgl7aFd2LUekVnAmIgFwgMqyxzJ93nmkPF/ALpEW/i2qCg==", + "version": "0.14.1", + "resolved": "https://registry.npmjs.org/vite-plugin-pwa/-/vite-plugin-pwa-0.14.1.tgz", + "integrity": "sha512-5zx7yhQ8RTLwV71+GA9YsQQ63ALKG8XXIMqRJDdZkR8ZYftFcRgnzM7wOWmQZ/DATspyhPih5wCdcZnAIsM+mA==", "dev": true, "requires": { "@rollup/plugin-replace": "^5.0.1", @@ -9679,6 +9693,12 @@ "workbox-window": "^6.5.4" } }, + "vite-plugin-remove-console": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/vite-plugin-remove-console/-/vite-plugin-remove-console-1.3.0.tgz", + "integrity": "sha512-5a/OLYB6yNRHMuHj9rBQRYMQ1NBKffxA8BaD77urUBLcGOWMHFHALjh6C26wZfZd41KytSwLp6DhvNKU78mNJg==", + "dev": true + }, "webidl-conversions": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-4.0.2.tgz", diff --git a/package.json b/package.json index dbde5c5c..4d4ecf31 100644 --- a/package.json +++ b/package.json @@ -7,16 +7,17 @@ "build": "vite build", "preview": "vite preview", "fetch-instances": "env $(cat .env.dev | grep -v \"#\" | xargs) node scripts/fetch-instances-list.js", - "source-map-explorer": "npx source-map-explorer dist/assets/*.js" + "sourcemap": "npx source-map-explorer dist/assets/*.js" }, "dependencies": { - "@github/relative-time-element": "~4.1.5", "@github/text-expander-element": "~2.3.0", + "dayjs": "~1.11.7", + "dayjs-twitter": "~0.5.0", "fast-blurhash": "~1.1.2", "history": "~5.3.0", "iconify-icon": "~1.0.2", "just-debounce-it": "~3.2.0", - "masto": "~5.1.0", + "masto": "~5.1.1", "mem": "~9.0.2", "preact": "~10.11.3", "preact-router": "~4.1.0", @@ -26,7 +27,7 @@ "swiped-events": "~1.1.7", "toastify-js": "~1.12.0", "use-resize-observer": "~9.1.0", - "valtio": "~1.8.0" + "valtio": "~1.8.2" }, "devDependencies": { "@preact/preset-vite": "~2.5.0", @@ -35,10 +36,11 @@ "postcss": "~8.4.20", "postcss-dark-theme-class": "~0.7.3", "twitter-text": "~3.1.0", - "vite": "~4.0.3", + "vite": "~4.0.4", "vite-plugin-html-config": "~1.0.11", "vite-plugin-html-env": "~1.2.7", - "vite-plugin-pwa": "~0.14.0", + "vite-plugin-pwa": "~0.14.1", + "vite-plugin-remove-console": "~1.3.0", "workbox-cacheable-response": "~6.5.4", "workbox-expiration": "~6.5.4", "workbox-routing": "~6.5.4", diff --git a/public/sw.js b/public/sw.js index 44af1ed5..8bf163f7 100644 --- a/public/sw.js +++ b/public/sw.js @@ -3,6 +3,8 @@ import { ExpirationPlugin } from 'workbox-expiration'; import { RegExpRoute, registerRoute, Route } from 'workbox-routing'; import { CacheFirst, StaleWhileRevalidate } from 'workbox-strategies'; +self.__WB_DISABLE_DEV_LOGS = true; + const imageRoute = new Route( ({ request, sameOrigin }) => { const isRemote = !sameOrigin; @@ -44,20 +46,20 @@ const apiExtendedRoute = new RegExpRoute( ); registerRoute(apiExtendedRoute); -// Not caching API requests, doesn't seem to be necessary fo now -// -// const apiRoute = new RegExpRoute( -// /^https?:\/\/[^\/]+\/api\//, -// new StaleWhileRevalidate({ -// cacheName: 'api', -// plugins: [ -// new ExpirationPlugin({ -// maxAgeSeconds: 60, // 1 minute -// }), -// new CacheableResponsePlugin({ -// statuses: [0, 200], -// }), -// ], -// }), -// ); -// registerRoute(apiRoute); +const apiRoute = new RegExpRoute( + // Matches: + // - statuses/:id/context - some contexts are really huge + /^https?:\/\/[^\/]+\/api\/v\d+\/(statuses\/\d+\/context)/, + new StaleWhileRevalidate({ + cacheName: 'api', + plugins: [ + new ExpirationPlugin({ + maxAgeSeconds: 5 * 60, // 5 minutes + }), + new CacheableResponsePlugin({ + statuses: [0, 200], + }), + ], + }), +); +registerRoute(apiRoute); diff --git a/scripts/fetch-instances-list.js b/scripts/fetch-instances-list.js index 7b39126c..f90a2fb7 100644 --- a/scripts/fetch-instances-list.js +++ b/scripts/fetch-instances-list.js @@ -3,7 +3,8 @@ import fs from 'fs'; const { INSTANCES_SOCIAL_SECRET_TOKEN } = process.env; const params = new URLSearchParams({ - count: 200, + count: 0, + min_users: 1_000, sort_by: 'active_users', sort_order: 'desc', }); diff --git a/src/app.css b/src/app.css index f3817a1d..0e50fd3b 100644 --- a/src/app.css +++ b/src/app.css @@ -90,6 +90,13 @@ a.mention span { grid-template-columns: 1fr 1fr 1fr; align-items: center; user-select: none; + transition: transform 0.5s ease-in-out; + user-select: none; +} +.deck header[hidden] { + transform: translateY(-100%); + pointer-events: none; + user-select: none; } .deck header > .header-side:last-of-type { text-align: right; @@ -348,8 +355,10 @@ a.mention span { display: block; text-decoration-line: none; color: inherit; + user-select: none; transition: background-color 0.2s ease-out; -webkit-tap-highlight-color: transparent; + animation: appear 0.2s ease-out; } .status-link:is(:hover, :focus) { background-color: var(--link-bg-hover-color); @@ -357,7 +366,6 @@ a.mention span { } .status-link:active { filter: brightness(0.95); - transform: translateY(0.5px); } .ui-state { @@ -374,18 +382,17 @@ a.mention span { z-index: 1000; display: flex; background-color: var(--backdrop-color); + animation: appear 0.2s ease-out; } .deck-backdrop > a { flex-grow: 1; - backdrop-filter: saturate(0.75); + /* backdrop-filter: saturate(0.75); */ } @keyframes slide-in { 0% { - opacity: 0.5; transform: translate3d(100%, 0, 0); } 100% { - opacity: 1; transform: translate3d(0, 0, 0); } } @@ -402,7 +409,6 @@ a.mention span { .decks { flex-grow: 1; - transition: transform 0.5s var(--timing-function); } .deck-close { @@ -436,7 +442,7 @@ a.mention span { } .updates-button { position: absolute; - z-index: 1; + z-index: 2; animation: fade-from-top 2s ease-out; left: 50%; margin-top: 8px; @@ -602,7 +608,18 @@ button.carousel-dot[disabled].active { z-index: 1; box-shadow: 0 3px 8px -1px var(--bg-faded-blur-color), 0 10px 36px -4px var(--button-bg-blur-color); - transition: background-color 0.2s ease-in-out; + transition: all 0.3s ease-in-out; +} +#compose-button[hidden] { + transform: translateY(200%); + pointer-events: none; + user-select: none; +} +#compose-button .icon { + transition: transform 0.3s ease-in-out; +} +#compose-button[hidden] .icon { + transform: rotate(90deg); } #compose-button:is(:hover, :focus) { background-color: var(--button-bg-color); @@ -610,7 +627,6 @@ button.carousel-dot[disabled].active { } #compose-button:active { filter: brightness(0.75); - transform: translateY(1px); } #compose-button .icon { filter: drop-shadow(0 1px 2px var(--button-bg-color)); @@ -637,6 +653,10 @@ button.carousel-dot[disabled].active { padding: 16px 16px 8px; padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); + user-select: none; +} +.sheet header :is(h1, h2, h3) { + margin: 0; } .sheet main { overflow: auto; @@ -800,6 +820,14 @@ meter.donut:is(.danger, .explode):after { filter: brightness(0.8); } +/* AVATARS STACK */ + +.avatars-stack { + display: flex; + flex-wrap: wrap; + gap: 4px; +} + @media (min-width: 40em) { html, body { @@ -808,7 +836,11 @@ meter.donut:is(.danger, .explode):after { #app { display: flex; } + .decks { + transition: transform 0.4s var(--timing-function); + } .decks:has(~ .deck-backdrop) { + transition: transform 0.4s ease-out; transform: translate3d(-5vw, 0, 0); } .deck-backdrop .deck { diff --git a/src/app.jsx b/src/app.jsx index c8cccc91..903f8d3c 100644 --- a/src/app.jsx +++ b/src/app.jsx @@ -82,7 +82,7 @@ function App() { let account = accounts.find((a) => a.info.id === mastoAccount.id); if (account) { account.info = mastoAccount; - account.instanceURL = instanceURL; + account.instanceURL = instanceURL.toLowerCase(); account.accessToken = accessToken; } else { account = { @@ -166,7 +166,7 @@ function App() { console.log(info); const { uri, domain } = info; const instances = store.local.getJSON('instances') || {}; - instances[domain || uri] = info; + instances[(domain || uri).toLowerCase()] = info; store.local.setJSON('instances', instances); })(); }); @@ -177,31 +177,12 @@ function App() { return ( <> {isLoggedIn && currentDeck && ( - <> - -