diff --git a/package-lock.json b/package-lock.json index 70826ae7..34a390f7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "cinny", - "version": "4.9.1", + "version": "4.10.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "cinny", - "version": "4.9.1", + "version": "4.10.0", "license": "AGPL-3.0-only", "dependencies": { "@atlaskit/pragmatic-drag-and-drop": "1.1.6", @@ -16,7 +16,6 @@ "@tanstack/react-query": "5.24.1", "@tanstack/react-query-devtools": "5.24.1", "@tanstack/react-virtual": "3.2.0", - "@tippyjs/react": "4.2.6", "@vanilla-extract/css": "1.9.3", "@vanilla-extract/recipes": "0.3.0", "@vanilla-extract/vite-plugin": "3.7.1", @@ -32,10 +31,8 @@ "emojibase": "15.3.1", "emojibase-data": "15.3.2", "file-saver": "2.0.5", - "flux": "4.0.3", "focus-trap-react": "10.0.2", "folds": "2.2.0", - "formik": "2.4.6", "html-dom-parser": "4.0.0", "html-react-parser": "4.2.0", "i18next": "23.12.2", @@ -50,17 +47,14 @@ "millify": "6.1.0", "pdfjs-dist": "4.2.67", "prismjs": "1.30.0", - "prop-types": "15.8.1", "react": "18.2.0", "react-aria": "3.29.1", - "react-autosize-textarea": "7.1.0", "react-blurhash": "0.2.0", "react-colorful": "5.6.1", "react-dom": "18.2.0", "react-error-boundary": "4.0.13", "react-google-recaptcha": "2.1.0", "react-i18next": "15.0.0", - "react-modal": "3.16.1", "react-range": "1.8.14", "react-router-dom": "6.20.0", "sanitize-html": "2.12.1", @@ -68,7 +62,6 @@ "slate-dom": "0.112.2", "slate-history": "0.110.3", "slate-react": "0.112.1", - "tippy.js": "6.3.7", "ua-parser-js": "1.0.35" }, "devDependencies": { @@ -97,7 +90,6 @@ "eslint-plugin-react": "7.31.11", "eslint-plugin-react-hooks": "4.6.0", "prettier": "2.8.1", - "sass": "1.56.2", "typescript": "4.9.4", "vite": "5.4.19", "vite-plugin-pwa": "0.20.5", @@ -2313,15 +2305,6 @@ "node": ">= 8" } }, - "node_modules/@popperjs/core": { - "version": "2.11.8", - "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.8.tgz", - "integrity": "sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A==", - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/popperjs" - } - }, "node_modules/@react-aria/breadcrumbs": { "version": "3.5.20", "resolved": "https://registry.npmjs.org/@react-aria/breadcrumbs/-/breadcrumbs-3.5.20.tgz", @@ -4524,18 +4507,6 @@ "url": "https://github.com/sponsors/tannerlinsley" } }, - "node_modules/@tippyjs/react": { - "version": "4.2.6", - "resolved": "https://registry.npmjs.org/@tippyjs/react/-/react-4.2.6.tgz", - "integrity": "sha512-91RicDR+H7oDSyPycI13q3b7o4O60wa2oRbjlz2fyRLmHImc4vyDwuUP8NtZaN0VARJY5hybvDYrFzhY9+Lbyw==", - "dependencies": { - "tippy.js": "^6.3.1" - }, - "peerDependencies": { - "react": ">=16.8", - "react-dom": ">=16.8" - } - }, "node_modules/@types/babel__core": { "version": "7.20.5", "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.5.tgz", @@ -4601,15 +4572,6 @@ "integrity": "sha512-zv9kNf3keYegP5oThGLaPk8E081DFDuwfqjtiTzm6PoxChdJ1raSuADf2YGCVIyrSynLrgc8JWv296s7Q7pQSQ==", "dev": true }, - "node_modules/@types/hoist-non-react-statics": { - "version": "3.3.6", - "resolved": "https://registry.npmjs.org/@types/hoist-non-react-statics/-/hoist-non-react-statics-3.3.6.tgz", - "integrity": "sha512-lPByRJUer/iN/xa4qpyL0qmL11DqNW81iU/IG1S3uvRUq4oKagz8VCxZjiWkumgt66YT3vOdDgZ0o32sGKtCEw==", - "dependencies": { - "@types/react": "*", - "hoist-non-react-statics": "^3.3.0" - } - }, "node_modules/@types/is-hotkey": { "version": "0.1.10", "resolved": "https://registry.npmjs.org/@types/is-hotkey/-/is-hotkey-0.1.10.tgz", @@ -4643,12 +4605,14 @@ "node_modules/@types/prop-types": { "version": "15.7.14", "resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.14.tgz", - "integrity": "sha512-gNMvNH49DJ7OJYv+KAKn0Xp45p8PLl6zo2YnvDIbTd4J6MER2BmWN49TG7n9LvkyihINxeKW8+3bfS2yDC9dzQ==" + "integrity": "sha512-gNMvNH49DJ7OJYv+KAKn0Xp45p8PLl6zo2YnvDIbTd4J6MER2BmWN49TG7n9LvkyihINxeKW8+3bfS2yDC9dzQ==", + "dev": true }, "node_modules/@types/react": { "version": "18.2.39", "resolved": "https://registry.npmjs.org/@types/react/-/react-18.2.39.tgz", "integrity": "sha512-Oiw+ppED6IremMInLV4HXGbfbG6GyziY3kqAwJYOR0PNbkYDmLWQA3a95EhdSmamsvbkJN96ZNN+YD+fGjzSBA==", + "dev": true, "dependencies": { "@types/prop-types": "*", "@types/scheduler": "*", @@ -4697,7 +4661,8 @@ "node_modules/@types/scheduler": { "version": "0.23.0", "resolved": "https://registry.npmjs.org/@types/scheduler/-/scheduler-0.23.0.tgz", - "integrity": "sha512-YIoDCTH3Af6XM5VuwGG/QL/CJqga1Zm3NkU3HZ4ZHK2fRMPYP1VczsTUqtsf43PH/iJNVlPHAo2oWX7BSdB2Hw==" + "integrity": "sha512-YIoDCTH3Af6XM5VuwGG/QL/CJqga1Zm3NkU3HZ4ZHK2fRMPYP1VczsTUqtsf43PH/iJNVlPHAo2oWX7BSdB2Hw==", + "dev": true }, "node_modules/@types/semver": { "version": "7.5.8", @@ -5320,11 +5285,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/asap": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz", - "integrity": "sha512-BSHWgDSAiKs50o2Re8ppvp3seVHXSRM44cdSsT9FfNEUUZLOGWVCsiWaRPWM1Znn+mqZ1OfVZ3z3DWEzSp7hRA==" - }, "node_modules/ast-types-flow": { "version": "0.0.7", "resolved": "https://registry.npmjs.org/ast-types-flow/-/ast-types-flow-0.0.7.tgz", @@ -5346,11 +5306,6 @@ "node": ">= 4.0.0" } }, - "node_modules/autosize": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/autosize/-/autosize-4.0.4.tgz", - "integrity": "sha512-5yxLQ22O0fCRGoxGfeLSNt3J8LB1v+umtpMnPW6XjkTWXKoN0AmXAIhelJcDtFT/Y/wYWmfE+oqU10Q0b8FhaQ==" - }, "node_modules/available-typed-arrays": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz", @@ -5830,11 +5785,6 @@ "integrity": "sha512-VRhuHOLoKYOy4UbilLbUzbYg93XLjv2PncJC50EuTWPA3gaja1UjBsUP/D/9/juV3vQFr6XBEzn9KCAHdUvOHw==", "license": "MIT" }, - "node_modules/computed-style": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/computed-style/-/computed-style-0.1.4.tgz", - "integrity": "sha512-WpAmaKbMNmS3OProfHIdJiNleNJdgUrJfbKArXua28QF7+0CoZjlLn0lp6vlc+dl5r2/X9GQiQRQQU4BzSa69w==" - }, "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -5896,14 +5846,6 @@ "url": "https://opencollective.com/core-js" } }, - "node_modules/cross-fetch": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-3.2.0.tgz", - "integrity": "sha512-Q+xVJLoGOeIMXZmbUK4HYk+69cQH6LudR0Vu/pRm2YlU/hDV9CiS0gKUMaWY5f2NeUH9C1nV3bsTlCo0FsTV1Q==", - "dependencies": { - "node-fetch": "^2.7.0" - } - }, "node_modules/cross-spawn": { "version": "7.0.6", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", @@ -7019,11 +6961,6 @@ "node": ">=0.8.x" } }, - "node_modules/exenv": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/exenv/-/exenv-1.2.2.tgz", - "integrity": "sha512-Z+ktTxTwv9ILfgKCk32OX3n/doe+OcLTRtqK9pcL+JsP3J1/VW8Uvl4ZjLlKqeW4rzK4oesDOGMEMRIZqtP4Iw==" - }, "node_modules/fast-deep-equal": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", @@ -7095,33 +7032,6 @@ "reusify": "^1.0.4" } }, - "node_modules/fbemitter": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/fbemitter/-/fbemitter-3.0.0.tgz", - "integrity": "sha512-KWKaceCwKQU0+HPoop6gn4eOHk50bBv/VxjJtGMfwmJt3D29JpN4H4eisCtIPA+a8GVBam+ldMMpMjJUvpDyHw==", - "dependencies": { - "fbjs": "^3.0.0" - } - }, - "node_modules/fbjs": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/fbjs/-/fbjs-3.0.5.tgz", - "integrity": "sha512-ztsSx77JBtkuMrEypfhgc3cI0+0h+svqeie7xHbh1k/IKdcydnvadp/mUaGgjAOXQmQSxsqgaRhS3q9fy+1kxg==", - "dependencies": { - "cross-fetch": "^3.1.5", - "fbjs-css-vars": "^1.0.0", - "loose-envify": "^1.0.0", - "object-assign": "^4.1.0", - "promise": "^7.1.1", - "setimmediate": "^1.0.5", - "ua-parser-js": "^1.0.35" - } - }, - "node_modules/fbjs-css-vars": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/fbjs-css-vars/-/fbjs-css-vars-1.0.2.tgz", - "integrity": "sha512-b2XGFAFdWZWg0phtAWLHCk836A1Xann+I+Dgd3Gk64MHKZO44FfoD1KxyvbSh0qZsIoXQGGlVztIY+oitJPpRQ==" - }, "node_modules/fdir": { "version": "6.4.3", "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.4.3.tgz", @@ -7230,18 +7140,6 @@ "integrity": "sha512-AiwGJM8YcNOaobumgtng+6NHuOqC3A7MixFeDafM3X9cIUM+xUXoS5Vfgf+OihAYe20fxqNM9yPBXJzRtZ/4eA==", "dev": true }, - "node_modules/flux": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/flux/-/flux-4.0.3.tgz", - "integrity": "sha512-yKAbrp7JhZhj6uiT1FTuVMlIAT1J4jqEyBpFApi1kxpGZCvacMVc/t1pMQyotqHhAgvoE3bNvAykhCo2CLjnYw==", - "dependencies": { - "fbemitter": "^3.0.0", - "fbjs": "^3.0.1" - }, - "peerDependencies": { - "react": "^15.0.2 || ^16.0.0 || ^17.0.0" - } - }, "node_modules/focus-trap": { "version": "7.6.4", "resolved": "https://registry.npmjs.org/focus-trap/-/focus-trap-7.6.4.tgz", @@ -7286,38 +7184,6 @@ "is-callable": "^1.1.3" } }, - "node_modules/formik": { - "version": "2.4.6", - "resolved": "https://registry.npmjs.org/formik/-/formik-2.4.6.tgz", - "integrity": "sha512-A+2EI7U7aG296q2TLGvNapDNTZp1khVt5Vk0Q/fyfSROss0V/V6+txt2aJnwEos44IxTCW/LYAi/zgWzlevj+g==", - "funding": [ - { - "type": "individual", - "url": "https://opencollective.com/formik" - } - ], - "dependencies": { - "@types/hoist-non-react-statics": "^3.3.1", - "deepmerge": "^2.1.1", - "hoist-non-react-statics": "^3.3.0", - "lodash": "^4.17.21", - "lodash-es": "^4.17.21", - "react-fast-compare": "^2.0.1", - "tiny-warning": "^1.0.2", - "tslib": "^2.0.0" - }, - "peerDependencies": { - "react": ">=16.8.0" - } - }, - "node_modules/formik/node_modules/deepmerge": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-2.2.1.tgz", - "integrity": "sha512-R9hc1Xa/NOBi9WRVUWg19rl1UB7Tt4kuPd+thNJgFZoxXsTz7ncaPaeIm+40oSGuP33DfMb4sZt1QIGiJzC4EA==", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/fs-extra": { "version": "11.3.0", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.3.0.tgz", @@ -7896,12 +7762,6 @@ "url": "https://opencollective.com/immer" } }, - "node_modules/immutable": { - "version": "4.3.7", - "resolved": "https://registry.npmjs.org/immutable/-/immutable-4.3.7.tgz", - "integrity": "sha512-1hqclzwYwjRDFLjcFxOM5AYkkG0rpFPpr1RLPMEuGczoS7YA8gLhy8SWXYRAA/XwfEHpfo3cw5JGioS32fnMRw==", - "dev": true - }, "node_modules/import-fresh": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", @@ -8636,17 +8496,6 @@ "node": ">=10" } }, - "node_modules/line-height": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/line-height/-/line-height-0.3.1.tgz", - "integrity": "sha512-YExecgqPwnp5gplD2+Y8e8A5+jKpr25+DzMbFdI1/1UAr0FJrTFv4VkHLf8/6B590i1wUPJWMKKldkd/bdQ//w==", - "dependencies": { - "computed-style": "~0.1.3" - }, - "engines": { - "node": ">= 4.0.0" - } - }, "node_modules/linkify-react": { "version": "4.1.3", "resolved": "https://registry.npmjs.org/linkify-react/-/linkify-react-4.1.3.tgz", @@ -8680,11 +8529,6 @@ "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" }, - "node_modules/lodash-es": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash-es/-/lodash-es-4.17.21.tgz", - "integrity": "sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==" - }, "node_modules/lodash.debounce": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz", @@ -9541,14 +9385,6 @@ "node": ">=6" } }, - "node_modules/promise": { - "version": "7.3.1", - "resolved": "https://registry.npmjs.org/promise/-/promise-7.3.1.tgz", - "integrity": "sha512-nolQXZ/4L+bP/UGlkfaIujX9BKxGwmQ9OT4mOt5yvy8iK1h3wqTEJCijzGANTCCl9nWjY41juyAn2K3Q1hLLTg==", - "dependencies": { - "asap": "~2.0.3" - } - }, "node_modules/prop-types": { "version": "15.8.1", "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz", @@ -9672,20 +9508,6 @@ "react": ">=16.4.1" } }, - "node_modules/react-autosize-textarea": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/react-autosize-textarea/-/react-autosize-textarea-7.1.0.tgz", - "integrity": "sha512-BHpjCDkuOlllZn3nLazY2F8oYO1tS2jHnWhcjTWQdcKiiMU6gHLNt/fzmqMSyerR0eTdKtfSIqtSeTtghNwS+g==", - "dependencies": { - "autosize": "^4.0.2", - "line-height": "^0.3.1", - "prop-types": "^15.5.6" - }, - "peerDependencies": { - "react": "^0.14.0 || ^15.0.0 || ^16.0.0", - "react-dom": "^0.14.0 || ^15.0.0 || ^16.0.0" - } - }, "node_modules/react-blurhash": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/react-blurhash/-/react-blurhash-0.2.0.tgz", @@ -9728,11 +9550,6 @@ "react": ">=16.13.1" } }, - "node_modules/react-fast-compare": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/react-fast-compare/-/react-fast-compare-2.0.4.tgz", - "integrity": "sha512-suNP+J1VU1MWFKcyt7RtjiSWUjvidmQSlqu+eHslq+342xCbGTYmC0mEhPCOHxlW0CywylOC1u2DFAT+bv4dBw==" - }, "node_modules/react-google-recaptcha": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/react-google-recaptcha/-/react-google-recaptcha-2.1.0.tgz", @@ -9771,29 +9588,6 @@ "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" }, - "node_modules/react-lifecycles-compat": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/react-lifecycles-compat/-/react-lifecycles-compat-3.0.4.tgz", - "integrity": "sha512-fBASbA6LnOU9dOU2eW7aQ8xmYBSXUIWr+UmF9b1efZBazGNO+rcXT/icdKnYm2pTwcRylVUYwW7H1PHfLekVzA==" - }, - "node_modules/react-modal": { - "version": "3.16.1", - "resolved": "https://registry.npmjs.org/react-modal/-/react-modal-3.16.1.tgz", - "integrity": "sha512-VStHgI3BVcGo7OXczvnJN7yT2TWHJPDXZWyI/a0ssFNhGZWsPmB8cF0z33ewDXq4VfYMO1vXgiv/g8Nj9NDyWg==", - "dependencies": { - "exenv": "^1.2.0", - "prop-types": "^15.7.2", - "react-lifecycles-compat": "^3.0.0", - "warning": "^4.0.3" - }, - "engines": { - "node": ">=8" - }, - "peerDependencies": { - "react": "^0.14.0 || ^15.0.0 || ^16 || ^17 || ^18", - "react-dom": "^0.14.0 || ^15.0.0 || ^16 || ^17 || ^18" - } - }, "node_modules/react-property": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/react-property/-/react-property-2.0.0.tgz", @@ -10252,23 +10046,6 @@ "postcss": "^8.3.11" } }, - "node_modules/sass": { - "version": "1.56.2", - "resolved": "https://registry.npmjs.org/sass/-/sass-1.56.2.tgz", - "integrity": "sha512-ciEJhnyCRwzlBCB+h5cCPM6ie/6f8HrhZMQOf5vlU60Y1bI1rx5Zb0vlDZvaycHsg/MqFfF1Eq2eokAa32iw8w==", - "dev": true, - "dependencies": { - "chokidar": ">=3.0.0 <4.0.0", - "immutable": "^4.0.0", - "source-map-js": ">=0.6.2 <2.0.0" - }, - "bin": { - "sass": "sass.js" - }, - "engines": { - "node": ">=12.0.0" - } - }, "node_modules/scheduler": { "version": "0.23.2", "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.23.2.tgz", @@ -10368,11 +10145,6 @@ "node": ">= 0.4" } }, - "node_modules/setimmediate": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", - "integrity": "sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA==" - }, "node_modules/shebang-command": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", @@ -10969,14 +10741,6 @@ "node": ">=12.0.0" } }, - "node_modules/tippy.js": { - "version": "6.3.7", - "resolved": "https://registry.npmjs.org/tippy.js/-/tippy.js-6.3.7.tgz", - "integrity": "sha512-E1d3oP2emgJ9dRQZdf3Kkn0qJgI6ZLpyS5z6ZkY1DF3kaQaBsGZsndEpHwx+eC+tYM41HaSNvNtLx8tU57FzTQ==", - "dependencies": { - "@popperjs/core": "^2.9.0" - } - }, "node_modules/to-regex-range": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", @@ -11891,14 +11655,6 @@ "node": ">=0.10.0" } }, - "node_modules/warning": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/warning/-/warning-4.0.3.tgz", - "integrity": "sha512-rpJyN222KWIvHJ/F53XSZv0Zl/accqHR8et1kpaMTD/fLCRxtV8iX8czMzY7sVZupTI3zcUTg8eycS2kNF9l6w==", - "dependencies": { - "loose-envify": "^1.0.0" - } - }, "node_modules/webidl-conversions": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", diff --git a/package.json b/package.json index f1816cdd..0c06993e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cinny", - "version": "4.9.1", + "version": "4.10.0", "description": "Yet another matrix client", "main": "index.js", "type": "module", @@ -27,7 +27,6 @@ "@tanstack/react-query": "5.24.1", "@tanstack/react-query-devtools": "5.24.1", "@tanstack/react-virtual": "3.2.0", - "@tippyjs/react": "4.2.6", "@vanilla-extract/css": "1.9.3", "@vanilla-extract/recipes": "0.3.0", "@vanilla-extract/vite-plugin": "3.7.1", @@ -43,10 +42,8 @@ "emojibase": "15.3.1", "emojibase-data": "15.3.2", "file-saver": "2.0.5", - "flux": "4.0.3", "focus-trap-react": "10.0.2", "folds": "2.2.0", - "formik": "2.4.6", "html-dom-parser": "4.0.0", "html-react-parser": "4.2.0", "i18next": "23.12.2", @@ -61,17 +58,14 @@ "millify": "6.1.0", "pdfjs-dist": "4.2.67", "prismjs": "1.30.0", - "prop-types": "15.8.1", "react": "18.2.0", "react-aria": "3.29.1", - "react-autosize-textarea": "7.1.0", "react-blurhash": "0.2.0", "react-colorful": "5.6.1", "react-dom": "18.2.0", "react-error-boundary": "4.0.13", "react-google-recaptcha": "2.1.0", "react-i18next": "15.0.0", - "react-modal": "3.16.1", "react-range": "1.8.14", "react-router-dom": "6.20.0", "sanitize-html": "2.12.1", @@ -79,7 +73,6 @@ "slate-dom": "0.112.2", "slate-history": "0.110.3", "slate-react": "0.112.1", - "tippy.js": "6.3.7", "ua-parser-js": "1.0.35" }, "devDependencies": { @@ -108,7 +101,6 @@ "eslint-plugin-react": "7.31.11", "eslint-plugin-react-hooks": "4.6.0", "prettier": "2.8.1", - "sass": "1.56.2", "typescript": "4.9.4", "vite": "5.4.19", "vite-plugin-pwa": "0.20.5", diff --git a/public/res/ic/filled/category.svg b/public/res/ic/filled/category.svg deleted file mode 100644 index 87b2588d..00000000 --- a/public/res/ic/filled/category.svg +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/public/res/ic/filled/pin.svg b/public/res/ic/filled/pin.svg deleted file mode 100644 index 6a701474..00000000 --- a/public/res/ic/filled/pin.svg +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - diff --git a/public/res/ic/filled/star.svg b/public/res/ic/filled/star.svg deleted file mode 100644 index 378c891e..00000000 --- a/public/res/ic/filled/star.svg +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - diff --git a/public/res/ic/outlined/add-pin.svg b/public/res/ic/outlined/add-pin.svg deleted file mode 100644 index 9634bede..00000000 --- a/public/res/ic/outlined/add-pin.svg +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - diff --git a/public/res/ic/outlined/add-user.svg b/public/res/ic/outlined/add-user.svg deleted file mode 100644 index c3803d80..00000000 --- a/public/res/ic/outlined/add-user.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - diff --git a/public/res/ic/outlined/ball.svg b/public/res/ic/outlined/ball.svg deleted file mode 100644 index d4b89ff5..00000000 --- a/public/res/ic/outlined/ball.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - diff --git a/public/res/ic/outlined/bell-off.svg b/public/res/ic/outlined/bell-off.svg deleted file mode 100644 index 79ce8a33..00000000 --- a/public/res/ic/outlined/bell-off.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - diff --git a/public/res/ic/outlined/bell-ping.svg b/public/res/ic/outlined/bell-ping.svg deleted file mode 100644 index 3431bea1..00000000 --- a/public/res/ic/outlined/bell-ping.svg +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - diff --git a/public/res/ic/outlined/bell-ring.svg b/public/res/ic/outlined/bell-ring.svg deleted file mode 100644 index 57fc2679..00000000 --- a/public/res/ic/outlined/bell-ring.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - diff --git a/public/res/ic/outlined/bell.svg b/public/res/ic/outlined/bell.svg deleted file mode 100644 index 43d470b5..00000000 --- a/public/res/ic/outlined/bell.svg +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - diff --git a/public/res/ic/outlined/bin.svg b/public/res/ic/outlined/bin.svg deleted file mode 100644 index 984be625..00000000 --- a/public/res/ic/outlined/bin.svg +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/public/res/ic/outlined/bulb.svg b/public/res/ic/outlined/bulb.svg deleted file mode 100644 index 00e80886..00000000 --- a/public/res/ic/outlined/bulb.svg +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - diff --git a/public/res/ic/outlined/category.svg b/public/res/ic/outlined/category.svg deleted file mode 100644 index c7c33b38..00000000 --- a/public/res/ic/outlined/category.svg +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - diff --git a/public/res/ic/outlined/check.svg b/public/res/ic/outlined/check.svg deleted file mode 100644 index 72a18327..00000000 --- a/public/res/ic/outlined/check.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - diff --git a/public/res/ic/outlined/chevron-bottom.svg b/public/res/ic/outlined/chevron-bottom.svg deleted file mode 100644 index 5562b7aa..00000000 --- a/public/res/ic/outlined/chevron-bottom.svg +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - diff --git a/public/res/ic/outlined/chevron-left.svg b/public/res/ic/outlined/chevron-left.svg deleted file mode 100644 index ba9e12cc..00000000 --- a/public/res/ic/outlined/chevron-left.svg +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - diff --git a/public/res/ic/outlined/chevron-right.svg b/public/res/ic/outlined/chevron-right.svg deleted file mode 100644 index 7f6a806e..00000000 --- a/public/res/ic/outlined/chevron-right.svg +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - diff --git a/public/res/ic/outlined/chevron-top.svg b/public/res/ic/outlined/chevron-top.svg deleted file mode 100644 index f5948fe9..00000000 --- a/public/res/ic/outlined/chevron-top.svg +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - diff --git a/public/res/ic/outlined/circle-plus.svg b/public/res/ic/outlined/circle-plus.svg deleted file mode 100644 index 41690a08..00000000 --- a/public/res/ic/outlined/circle-plus.svg +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - diff --git a/public/res/ic/outlined/cmd.svg b/public/res/ic/outlined/cmd.svg deleted file mode 100644 index 75ae0d98..00000000 --- a/public/res/ic/outlined/cmd.svg +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - diff --git a/public/res/ic/outlined/coin.svg b/public/res/ic/outlined/coin.svg deleted file mode 100644 index 025424e8..00000000 --- a/public/res/ic/outlined/coin.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - diff --git a/public/res/ic/outlined/cross.svg b/public/res/ic/outlined/cross.svg deleted file mode 100644 index 0acda884..00000000 --- a/public/res/ic/outlined/cross.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - diff --git a/public/res/ic/outlined/cup.svg b/public/res/ic/outlined/cup.svg deleted file mode 100644 index 8921e2c9..00000000 --- a/public/res/ic/outlined/cup.svg +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - diff --git a/public/res/ic/outlined/dog.svg b/public/res/ic/outlined/dog.svg deleted file mode 100644 index 3b252956..00000000 --- a/public/res/ic/outlined/dog.svg +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - diff --git a/public/res/ic/outlined/download.svg b/public/res/ic/outlined/download.svg deleted file mode 100644 index 677014f3..00000000 --- a/public/res/ic/outlined/download.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - diff --git a/public/res/ic/outlined/emoji-add.svg b/public/res/ic/outlined/emoji-add.svg deleted file mode 100644 index c4cacef2..00000000 --- a/public/res/ic/outlined/emoji-add.svg +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - diff --git a/public/res/ic/outlined/emoji.svg b/public/res/ic/outlined/emoji.svg deleted file mode 100644 index 0daac879..00000000 --- a/public/res/ic/outlined/emoji.svg +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - diff --git a/public/res/ic/outlined/explore.svg b/public/res/ic/outlined/explore.svg deleted file mode 100644 index 7cc2a479..00000000 --- a/public/res/ic/outlined/explore.svg +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - diff --git a/public/res/ic/outlined/external.svg b/public/res/ic/outlined/external.svg deleted file mode 100644 index adade1bd..00000000 --- a/public/res/ic/outlined/external.svg +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/public/res/ic/outlined/eye-blind.svg b/public/res/ic/outlined/eye-blind.svg deleted file mode 100644 index fbc8e2ae..00000000 --- a/public/res/ic/outlined/eye-blind.svg +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/public/res/ic/outlined/eye.svg b/public/res/ic/outlined/eye.svg deleted file mode 100644 index 1ce868bf..00000000 --- a/public/res/ic/outlined/eye.svg +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/public/res/ic/outlined/file.svg b/public/res/ic/outlined/file.svg deleted file mode 100644 index d6a2a27a..00000000 --- a/public/res/ic/outlined/file.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - diff --git a/public/res/ic/outlined/flag.svg b/public/res/ic/outlined/flag.svg deleted file mode 100644 index 8fce98d6..00000000 --- a/public/res/ic/outlined/flag.svg +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - diff --git a/public/res/ic/outlined/hash-globe.svg b/public/res/ic/outlined/hash-globe.svg deleted file mode 100644 index ce3df083..00000000 --- a/public/res/ic/outlined/hash-globe.svg +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - diff --git a/public/res/ic/outlined/hash-lock.svg b/public/res/ic/outlined/hash-lock.svg deleted file mode 100644 index ae263ced..00000000 --- a/public/res/ic/outlined/hash-lock.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - diff --git a/public/res/ic/outlined/hash-plus.svg b/public/res/ic/outlined/hash-plus.svg deleted file mode 100644 index 69737fd5..00000000 --- a/public/res/ic/outlined/hash-plus.svg +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - diff --git a/public/res/ic/outlined/hash-search.svg b/public/res/ic/outlined/hash-search.svg deleted file mode 100644 index f135e898..00000000 --- a/public/res/ic/outlined/hash-search.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - diff --git a/public/res/ic/outlined/hash-shield.svg b/public/res/ic/outlined/hash-shield.svg deleted file mode 100644 index dfd344b1..00000000 --- a/public/res/ic/outlined/hash-shield.svg +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - diff --git a/public/res/ic/outlined/hash.svg b/public/res/ic/outlined/hash.svg deleted file mode 100644 index dcb8b964..00000000 --- a/public/res/ic/outlined/hash.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - diff --git a/public/res/ic/outlined/heart.svg b/public/res/ic/outlined/heart.svg deleted file mode 100644 index c5b940b6..00000000 --- a/public/res/ic/outlined/heart.svg +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - diff --git a/public/res/ic/outlined/home.svg b/public/res/ic/outlined/home.svg deleted file mode 100644 index 3c7a02df..00000000 --- a/public/res/ic/outlined/home.svg +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - diff --git a/public/res/ic/outlined/horizontal-menu.svg b/public/res/ic/outlined/horizontal-menu.svg deleted file mode 100644 index a19b3c35..00000000 --- a/public/res/ic/outlined/horizontal-menu.svg +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - diff --git a/public/res/ic/outlined/inbox.svg b/public/res/ic/outlined/inbox.svg deleted file mode 100644 index 65435876..00000000 --- a/public/res/ic/outlined/inbox.svg +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - diff --git a/public/res/ic/outlined/info.svg b/public/res/ic/outlined/info.svg deleted file mode 100644 index 30a57887..00000000 --- a/public/res/ic/outlined/info.svg +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - diff --git a/public/res/ic/outlined/invite-arrow.svg b/public/res/ic/outlined/invite-arrow.svg deleted file mode 100644 index 370bf8e8..00000000 --- a/public/res/ic/outlined/invite-arrow.svg +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - diff --git a/public/res/ic/outlined/invite-cancel-arrow.svg b/public/res/ic/outlined/invite-cancel-arrow.svg deleted file mode 100644 index 795a773a..00000000 --- a/public/res/ic/outlined/invite-cancel-arrow.svg +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - diff --git a/public/res/ic/outlined/invite.svg b/public/res/ic/outlined/invite.svg deleted file mode 100644 index 3896e15e..00000000 --- a/public/res/ic/outlined/invite.svg +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - diff --git a/public/res/ic/outlined/join-arrow.svg b/public/res/ic/outlined/join-arrow.svg deleted file mode 100644 index 90cfa651..00000000 --- a/public/res/ic/outlined/join-arrow.svg +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - diff --git a/public/res/ic/outlined/leave-arrow.svg b/public/res/ic/outlined/leave-arrow.svg deleted file mode 100644 index a51ac1d1..00000000 --- a/public/res/ic/outlined/leave-arrow.svg +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - diff --git a/public/res/ic/outlined/lock.svg b/public/res/ic/outlined/lock.svg deleted file mode 100644 index 77021f0f..00000000 --- a/public/res/ic/outlined/lock.svg +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - diff --git a/public/res/ic/outlined/markdown.svg b/public/res/ic/outlined/markdown.svg deleted file mode 100644 index 775afbfb..00000000 --- a/public/res/ic/outlined/markdown.svg +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - diff --git a/public/res/ic/outlined/message-unread.svg b/public/res/ic/outlined/message-unread.svg deleted file mode 100644 index fc5e9ff0..00000000 --- a/public/res/ic/outlined/message-unread.svg +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - diff --git a/public/res/ic/outlined/message.svg b/public/res/ic/outlined/message.svg deleted file mode 100644 index d36e9a30..00000000 --- a/public/res/ic/outlined/message.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - diff --git a/public/res/ic/outlined/pause.svg b/public/res/ic/outlined/pause.svg deleted file mode 100644 index c312613b..00000000 --- a/public/res/ic/outlined/pause.svg +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - - - diff --git a/public/res/ic/outlined/peace.svg b/public/res/ic/outlined/peace.svg deleted file mode 100644 index 8a7c81a3..00000000 --- a/public/res/ic/outlined/peace.svg +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - diff --git a/public/res/ic/outlined/pencil.svg b/public/res/ic/outlined/pencil.svg deleted file mode 100644 index 1b8ac24a..00000000 --- a/public/res/ic/outlined/pencil.svg +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - diff --git a/public/res/ic/outlined/photo.svg b/public/res/ic/outlined/photo.svg deleted file mode 100644 index af01a330..00000000 --- a/public/res/ic/outlined/photo.svg +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - diff --git a/public/res/ic/outlined/pin.svg b/public/res/ic/outlined/pin.svg deleted file mode 100644 index 211242cd..00000000 --- a/public/res/ic/outlined/pin.svg +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - diff --git a/public/res/ic/outlined/play.svg b/public/res/ic/outlined/play.svg deleted file mode 100644 index 87b3a8f6..00000000 --- a/public/res/ic/outlined/play.svg +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - diff --git a/public/res/ic/outlined/plus.svg b/public/res/ic/outlined/plus.svg deleted file mode 100644 index ce37594e..00000000 --- a/public/res/ic/outlined/plus.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - diff --git a/public/res/ic/outlined/power.svg b/public/res/ic/outlined/power.svg deleted file mode 100644 index 8aeb6db8..00000000 --- a/public/res/ic/outlined/power.svg +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - diff --git a/public/res/ic/outlined/recent-clock.svg b/public/res/ic/outlined/recent-clock.svg deleted file mode 100644 index 30b10d59..00000000 --- a/public/res/ic/outlined/recent-clock.svg +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - diff --git a/public/res/ic/outlined/reply-arrow.svg b/public/res/ic/outlined/reply-arrow.svg deleted file mode 100644 index 3cda01cd..00000000 --- a/public/res/ic/outlined/reply-arrow.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - diff --git a/public/res/ic/outlined/search.svg b/public/res/ic/outlined/search.svg deleted file mode 100644 index 75dd6320..00000000 --- a/public/res/ic/outlined/search.svg +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - diff --git a/public/res/ic/outlined/send.svg b/public/res/ic/outlined/send.svg deleted file mode 100644 index aa487132..00000000 --- a/public/res/ic/outlined/send.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - diff --git a/public/res/ic/outlined/settings.svg b/public/res/ic/outlined/settings.svg deleted file mode 100644 index ee640b39..00000000 --- a/public/res/ic/outlined/settings.svg +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - diff --git a/public/res/ic/outlined/shield-empty.svg b/public/res/ic/outlined/shield-empty.svg deleted file mode 100644 index 6bc9d304..00000000 --- a/public/res/ic/outlined/shield-empty.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - diff --git a/public/res/ic/outlined/shield-user.svg b/public/res/ic/outlined/shield-user.svg deleted file mode 100644 index bd5f07c5..00000000 --- a/public/res/ic/outlined/shield-user.svg +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - diff --git a/public/res/ic/outlined/shield.svg b/public/res/ic/outlined/shield.svg deleted file mode 100644 index 9bb46fa1..00000000 --- a/public/res/ic/outlined/shield.svg +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - diff --git a/public/res/ic/outlined/space-globe.svg b/public/res/ic/outlined/space-globe.svg deleted file mode 100644 index 63d71f1d..00000000 --- a/public/res/ic/outlined/space-globe.svg +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - diff --git a/public/res/ic/outlined/space-lock.svg b/public/res/ic/outlined/space-lock.svg deleted file mode 100644 index b15705ca..00000000 --- a/public/res/ic/outlined/space-lock.svg +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - diff --git a/public/res/ic/outlined/space-plus.svg b/public/res/ic/outlined/space-plus.svg deleted file mode 100644 index 4d69a1ef..00000000 --- a/public/res/ic/outlined/space-plus.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - diff --git a/public/res/ic/outlined/space.svg b/public/res/ic/outlined/space.svg deleted file mode 100644 index a4b54b3e..00000000 --- a/public/res/ic/outlined/space.svg +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - diff --git a/public/res/ic/outlined/star.svg b/public/res/ic/outlined/star.svg deleted file mode 100644 index 290f159a..00000000 --- a/public/res/ic/outlined/star.svg +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - diff --git a/public/res/ic/outlined/sticker.svg b/public/res/ic/outlined/sticker.svg deleted file mode 100644 index bc486e5e..00000000 --- a/public/res/ic/outlined/sticker.svg +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/public/res/ic/outlined/sun.svg b/public/res/ic/outlined/sun.svg deleted file mode 100644 index d8ed06fd..00000000 --- a/public/res/ic/outlined/sun.svg +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/public/res/ic/outlined/tick-mark.svg b/public/res/ic/outlined/tick-mark.svg deleted file mode 100644 index 8e76ed55..00000000 --- a/public/res/ic/outlined/tick-mark.svg +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - diff --git a/public/res/ic/outlined/user.svg b/public/res/ic/outlined/user.svg deleted file mode 100644 index 6756a1b2..00000000 --- a/public/res/ic/outlined/user.svg +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - diff --git a/public/res/ic/outlined/vertical-menu.svg b/public/res/ic/outlined/vertical-menu.svg deleted file mode 100644 index ec5c544c..00000000 --- a/public/res/ic/outlined/vertical-menu.svg +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - diff --git a/public/res/ic/outlined/vlc.svg b/public/res/ic/outlined/vlc.svg deleted file mode 100644 index 8a2b844f..00000000 --- a/public/res/ic/outlined/vlc.svg +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - diff --git a/public/res/ic/outlined/volume-full.svg b/public/res/ic/outlined/volume-full.svg deleted file mode 100644 index 20419e72..00000000 --- a/public/res/ic/outlined/volume-full.svg +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - diff --git a/public/res/ic/outlined/volume-mute.svg b/public/res/ic/outlined/volume-mute.svg deleted file mode 100644 index beb06771..00000000 --- a/public/res/ic/outlined/volume-mute.svg +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - diff --git a/src/app/atoms/avatar/Avatar.jsx b/src/app/atoms/avatar/Avatar.jsx deleted file mode 100644 index 27bf7c90..00000000 --- a/src/app/atoms/avatar/Avatar.jsx +++ /dev/null @@ -1,69 +0,0 @@ -import React from 'react'; -import PropTypes from 'prop-types'; -import './Avatar.scss'; - -import Text from '../text/Text'; -import RawIcon from '../system-icons/RawIcon'; - -import ImageBrokenSVG from '../../../../public/res/svg/image-broken.svg'; -import { avatarInitials } from '../../../util/common'; - -const Avatar = React.forwardRef(({ text, bgColor, iconSrc, iconColor, imageSrc, size }, ref) => { - let textSize = 's1'; - if (size === 'large') textSize = 'h1'; - if (size === 'small') textSize = 'b1'; - if (size === 'extra-small') textSize = 'b3'; - - return ( -
- {imageSrc !== null ? ( - { - e.target.style.backgroundColor = 'transparent'; - }} - onError={(e) => { - e.target.src = ImageBrokenSVG; - }} - alt="" - /> - ) : ( - - {iconSrc !== null ? ( - - ) : ( - text !== null && ( - - {avatarInitials(text)} - - ) - )} - - )} -
- ); -}); - -Avatar.defaultProps = { - text: null, - bgColor: 'transparent', - iconSrc: null, - iconColor: null, - imageSrc: null, - size: 'normal', -}; - -Avatar.propTypes = { - text: PropTypes.string, - bgColor: PropTypes.string, - iconSrc: PropTypes.string, - iconColor: PropTypes.string, - imageSrc: PropTypes.string, - size: PropTypes.oneOf(['large', 'normal', 'small', 'extra-small']), -}; - -export default Avatar; diff --git a/src/app/atoms/avatar/Avatar.scss b/src/app/atoms/avatar/Avatar.scss deleted file mode 100644 index ea69c9e8..00000000 --- a/src/app/atoms/avatar/Avatar.scss +++ /dev/null @@ -1,56 +0,0 @@ -@use '../../partials/flex'; - -.avatar-container { - display: inline-flex; - width: 42px; - height: 42px; - border-radius: var(--bo-radius); - position: relative; - - &__large { - width: var(--av-large); - height: var(--av-large); - } - &__normal { - width: var(--av-normal); - height: var(--av-normal); - } - - &__small { - width: var(--av-small); - height: var(--av-small); - } - - &__extra-small { - width: var(--av-extra-small); - height: var(--av-extra-small); - } - - > img { - width: 100%; - height: 100%; - object-fit: cover; - border-radius: inherit; - background-color: var(--bg-surface-hover); - } - - .avatar__border { - @extend .cp-fx__row--c-c; - - position: absolute; - top: 0; - left: 0; - - width: 100%; - height: 100%; - border-radius: inherit; - - .text { - color: white; - } - &--active { - @extend .avatar__border; - box-shadow: var(--bs-surface-border); - } - } -} \ No newline at end of file diff --git a/src/app/atoms/avatar/render.js b/src/app/atoms/avatar/render.js deleted file mode 100644 index e8cf1a66..00000000 --- a/src/app/atoms/avatar/render.js +++ /dev/null @@ -1,57 +0,0 @@ -import { avatarInitials, cssVar } from '../../../util/common'; - -// renders the avatar and returns it as an URL -export default async function renderAvatar({ - text, bgColor, imageSrc, size, borderRadius, scale, -}) { - try { - const canvas = document.createElement('canvas'); - canvas.width = size * scale; - canvas.height = size * scale; - - const ctx = canvas.getContext('2d'); - - ctx.scale(scale, scale); - - // rounded corners - ctx.beginPath(); - ctx.moveTo(size, size); - ctx.arcTo(0, size, 0, 0, borderRadius); - ctx.arcTo(0, 0, size, 0, borderRadius); - ctx.arcTo(size, 0, size, size, borderRadius); - ctx.arcTo(size, size, 0, size, borderRadius); - - if (imageSrc) { - // clip corners of image - ctx.closePath(); - ctx.clip(); - - const img = new Image(); - img.crossOrigin = 'anonymous'; - const promise = new Promise((resolve, reject) => { - img.onerror = reject; - img.onload = resolve; - }); - img.src = imageSrc; - await promise; - - ctx.drawImage(img, 0, 0, size, size); - } else { - // colored background - ctx.fillStyle = cssVar(bgColor); - ctx.fill(); - - // centered letter - ctx.fillStyle = '#fff'; - ctx.font = `${cssVar('--fs-s1')} ${cssVar('--font-primary')}`; - ctx.textBaseline = 'middle'; - ctx.textAlign = 'center'; - ctx.fillText(avatarInitials(text), size / 2, size / 2); - } - - return canvas.toDataURL(); - } catch (e) { - console.error(e); - return imageSrc; - } -} diff --git a/src/app/atoms/badge/NotificationBadge.jsx b/src/app/atoms/badge/NotificationBadge.jsx deleted file mode 100644 index 12c1bd44..00000000 --- a/src/app/atoms/badge/NotificationBadge.jsx +++ /dev/null @@ -1,29 +0,0 @@ -import React from 'react'; -import PropTypes from 'prop-types'; -import './NotificationBadge.scss'; - -import Text from '../text/Text'; - -function NotificationBadge({ alert, content }) { - const notificationClass = alert ? ' notification-badge--alert' : ''; - return ( -
- {content !== null && {content}} -
- ); -} - -NotificationBadge.defaultProps = { - alert: false, - content: null, -}; - -NotificationBadge.propTypes = { - alert: PropTypes.bool, - content: PropTypes.oneOfType([ - PropTypes.string, - PropTypes.number, - ]), -}; - -export default NotificationBadge; diff --git a/src/app/atoms/badge/NotificationBadge.scss b/src/app/atoms/badge/NotificationBadge.scss deleted file mode 100644 index f5cfa73f..00000000 --- a/src/app/atoms/badge/NotificationBadge.scss +++ /dev/null @@ -1,21 +0,0 @@ -.notification-badge { - min-width: 16px; - min-height: 8px; - padding: 0 var(--sp-ultra-tight); - background-color: var(--bg-badge); - border-radius: var(--bo-radius); - - .text { - color: var(--tc-badge); - text-align: center; - } - - &--alert { - background-color: var(--bg-positive); - } - - &:empty { - min-width: 8px; - margin: 0 var(--sp-ultra-tight); - } -} \ No newline at end of file diff --git a/src/app/atoms/button/Button.jsx b/src/app/atoms/button/Button.jsx deleted file mode 100644 index 1c1c950c..00000000 --- a/src/app/atoms/button/Button.jsx +++ /dev/null @@ -1,53 +0,0 @@ -import React from 'react'; -import PropTypes from 'prop-types'; -import './Button.scss'; - -import Text from '../text/Text'; -import RawIcon from '../system-icons/RawIcon'; -import { blurOnBubbling } from './script'; - -const Button = React.forwardRef(({ - id, className, variant, iconSrc, - type, onClick, children, disabled, -}, ref) => { - const iconClass = (iconSrc === null) ? '' : `btn-${variant}--icon`; - return ( - - ); -}); - -Button.defaultProps = { - id: '', - className: null, - variant: 'surface', - iconSrc: null, - type: 'button', - onClick: null, - disabled: false, -}; - -Button.propTypes = { - id: PropTypes.string, - className: PropTypes.string, - variant: PropTypes.oneOf(['surface', 'primary', 'positive', 'caution', 'danger']), - iconSrc: PropTypes.string, - type: PropTypes.oneOf(['button', 'submit', 'reset']), - onClick: PropTypes.func, - children: PropTypes.node.isRequired, - disabled: PropTypes.bool, -}; - -export default Button; diff --git a/src/app/atoms/button/Button.scss b/src/app/atoms/button/Button.scss deleted file mode 100644 index e1a01bb0..00000000 --- a/src/app/atoms/button/Button.scss +++ /dev/null @@ -1,81 +0,0 @@ -@use 'state'; -@use '../../partials/dir'; -@use '../../partials/text'; - -.btn-surface, -.btn-primary, -.btn-positive, -.btn-caution, -.btn-danger { - display: inline-flex; - align-items: center; - justify-content: center; - - min-width: 80px; - padding: var(--sp-extra-tight) var(--sp-normal); - background-color: transparent; - border: none; - border-radius: var(--bo-radius); - cursor: pointer; - @include state.disabled; - - & .text { - @extend .cp-txt__ellipsis; - } - - &--icon { - @include dir.side(padding, var(--sp-tight), var(--sp-loose)); - - } - .ic-raw { - @include dir.side(margin, 0, var(--sp-extra-tight)); - flex-shrink: 0; - } -} - -@mixin color($textColor, $iconColor) { - .text { - color: $textColor; - } - .ic-raw { - background-color: $iconColor; - } -} - - -.btn-surface { - box-shadow: var(--bs-surface-border); - @include color(var(--tc-surface-high), var(--ic-surface-normal)); - @include state.hover(var(--bg-surface-hover)); - @include state.focus(var(--bs-surface-outline)); - @include state.active(var(--bg-surface-active)); -} - -.btn-primary { - background-color: var(--bg-primary); - @include color(var(--tc-primary-high), var(--ic-primary-normal)); - @include state.hover(var(--bg-primary-hover)); - @include state.focus(var(--bs-primary-outline)); - @include state.active(var(--bg-primary-active)); -} -.btn-positive { - box-shadow: var(--bs-positive-border); - @include color(var(--tc-positive-high), var(--ic-positive-normal)); - @include state.hover(var(--bg-positive-hover)); - @include state.focus(var(--bs-positive-outline)); - @include state.active(var(--bg-positive-active)); -} -.btn-caution { - box-shadow: var(--bs-caution-border); - @include color(var(--tc-caution-high), var(--ic-caution-normal)); - @include state.hover(var(--bg-caution-hover)); - @include state.focus(var(--bs-caution-outline)); - @include state.active(var(--bg-caution-active)); -} -.btn-danger { - box-shadow: var(--bs-danger-border); - @include color(var(--tc-danger-high), var(--ic-danger-normal)); - @include state.hover(var(--bg-danger-hover)); - @include state.focus(var(--bs-danger-outline)); - @include state.active(var(--bg-danger-active)); -} \ No newline at end of file diff --git a/src/app/atoms/button/Checkbox.jsx b/src/app/atoms/button/Checkbox.jsx deleted file mode 100644 index 7fcea3b5..00000000 --- a/src/app/atoms/button/Checkbox.jsx +++ /dev/null @@ -1,39 +0,0 @@ -import React from 'react'; -import PropTypes from 'prop-types'; -import './Checkbox.scss'; - -function Checkbox({ - variant, isActive, onToggle, - disabled, tabIndex, -}) { - const className = `checkbox checkbox-${variant}${isActive ? ' checkbox--active' : ''}`; - if (onToggle === null) return ; - return ( - // eslint-disable-next-line jsx-a11y/control-has-associated-label - - ); - if (tooltip === null) return btn; - return ( - {tooltip}} - > - {btn} - - ); -}); - -IconButton.defaultProps = { - variant: 'surface', - size: 'normal', - type: 'button', - tooltip: null, - tooltipPlacement: 'top', - onClick: null, - tabIndex: 0, - disabled: false, - isImage: false, - className: '', -}; - -IconButton.propTypes = { - variant: PropTypes.oneOf(['surface', 'primary', 'positive', 'caution', 'danger']), - size: PropTypes.oneOf(['normal', 'small', 'extra-small']), - type: PropTypes.oneOf(['button', 'submit', 'reset']), - tooltip: PropTypes.string, - tooltipPlacement: PropTypes.oneOf(['top', 'right', 'bottom', 'left']), - src: PropTypes.string.isRequired, - onClick: PropTypes.func, - tabIndex: PropTypes.number, - disabled: PropTypes.bool, - isImage: PropTypes.bool, - className: PropTypes.string, -}; - -export default IconButton; diff --git a/src/app/atoms/button/IconButton.scss b/src/app/atoms/button/IconButton.scss deleted file mode 100644 index aa6480c0..00000000 --- a/src/app/atoms/button/IconButton.scss +++ /dev/null @@ -1,56 +0,0 @@ -@use 'state'; - -.ic-btn { - padding: var(--sp-extra-tight); - border: none; - border-radius: var(--bo-radius); - background-color: transparent; - font-size: 0; - line-height: 0; - cursor: pointer; - @include state.disabled; -} - -@mixin color($color) { - .ic-raw { - background-color: $color; - } -} -@mixin focus($color) { - &:focus { - outline: none; - background-color: $color; - } -} - -.ic-btn-surface { - @include color(var(--ic-surface-normal)); - @include state.hover(var(--bg-surface-hover)); - @include focus(var(--bg-surface-hover)); - @include state.active(var(--bg-surface-active)); -} -.ic-btn-primary { - @include color(var(--ic-primary-normal)); - @include state.hover(var(--bg-primary-hover)); - @include focus(var(--bg-primary-hover)); - @include state.active(var(--bg-primary-active)); - background-color: var(--bg-primary); -} -.ic-btn-positive { - @include color(var(--ic-positive-normal)); - @include state.hover(var(--bg-positive-hover)); - @include focus(var(--bg-positive-hover)); - @include state.active(var(--bg-positive-active)); -} -.ic-btn-caution { - @include color(var(--ic-caution-normal)); - @include state.hover(var(--bg-caution-hover)); - @include focus(var(--bg-caution-hover)); - @include state.active(var(--bg-caution-active)); -} -.ic-btn-danger { - @include color(var(--ic-danger-normal)); - @include state.hover(var(--bg-danger-hover)); - @include focus(var(--bg-danger-hover)); - @include state.active(var(--bg-danger-active)); -} \ No newline at end of file diff --git a/src/app/atoms/button/RadioButton.jsx b/src/app/atoms/button/RadioButton.jsx deleted file mode 100644 index 35b68baf..00000000 --- a/src/app/atoms/button/RadioButton.jsx +++ /dev/null @@ -1,30 +0,0 @@ -import React from 'react'; -import PropTypes from 'prop-types'; -import './RadioButton.scss'; - -function RadioButton({ isActive, onToggle, disabled }) { - if (onToggle === null) return ; - return ( - // eslint-disable-next-line jsx-a11y/control-has-associated-label - - ); -} - -Chip.propTypes = { - iconSrc: PropTypes.string, - iconColor: PropTypes.string, - text: PropTypes.string, - children: PropTypes.element, - onClick: PropTypes.func, -}; - -Chip.defaultProps = { - iconSrc: null, - iconColor: null, - text: null, - children: null, - onClick: null, -}; - -export default Chip; diff --git a/src/app/atoms/chip/Chip.scss b/src/app/atoms/chip/Chip.scss deleted file mode 100644 index 7396b0dc..00000000 --- a/src/app/atoms/chip/Chip.scss +++ /dev/null @@ -1,31 +0,0 @@ -@use '../../partials/dir'; - -.chip { - padding: var(--sp-ultra-tight) var(--sp-extra-tight); - - display: inline-flex; - flex-direction: row; - align-items: center; - - background: var(--bg-surface-low); - border-radius: var(--bo-radius); - box-shadow: var(--bs-surface-border); - cursor: pointer; - - @media (hover: hover) { - &:hover { - background-color: var(--bg-surface-hover); - } - } - - & > .text { - flex: 1; - color: var(--tc-surface-high); - } - - & > .ic-raw { - width: 16px; - height: 16px; - @include dir.side(margin, 0, var(--sp-ultra-tight)); - } -} \ No newline at end of file diff --git a/src/app/atoms/context-menu/ContextMenu.jsx b/src/app/atoms/context-menu/ContextMenu.jsx deleted file mode 100644 index 7d1acd44..00000000 --- a/src/app/atoms/context-menu/ContextMenu.jsx +++ /dev/null @@ -1,115 +0,0 @@ -import React, { useState, useEffect } from 'react'; -import PropTypes from 'prop-types'; -import './ContextMenu.scss'; - -import Tippy from '@tippyjs/react'; -import 'tippy.js/animations/scale-extreme.css'; - -import Text from '../text/Text'; -import Button from '../button/Button'; -import ScrollView from '../scroll/ScrollView'; - -function ContextMenu({ - content, placement, maxWidth, render, afterToggle, -}) { - const [isVisible, setVisibility] = useState(false); - const showMenu = () => setVisibility(true); - const hideMenu = () => setVisibility(false); - - useEffect(() => { - if (afterToggle !== null) afterToggle(isVisible); - }, [isVisible]); - - return ( - {typeof content === 'function' ? content(hideMenu) : content}} - placement={placement} - interactive - arrow={false} - maxWidth={maxWidth} - duration={200} - > - {render(isVisible ? hideMenu : showMenu)} - - ); -} - -ContextMenu.defaultProps = { - maxWidth: 'unset', - placement: 'right', - afterToggle: null, -}; - -ContextMenu.propTypes = { - content: PropTypes.oneOfType([ - PropTypes.node, - PropTypes.func, - ]).isRequired, - placement: PropTypes.oneOf(['top', 'right', 'bottom', 'left']), - maxWidth: PropTypes.oneOfType([ - PropTypes.string, - PropTypes.number, - ]), - render: PropTypes.func.isRequired, - afterToggle: PropTypes.func, -}; - -function MenuHeader({ children }) { - return ( -
- { children } -
- ); -} - -MenuHeader.propTypes = { - children: PropTypes.node.isRequired, -}; - -function MenuItem({ - variant, iconSrc, type, - onClick, children, disabled, -}) { - return ( -
- -
- ); -} - -MenuItem.defaultProps = { - variant: 'surface', - iconSrc: null, - type: 'button', - disabled: false, - onClick: null, -}; - -MenuItem.propTypes = { - variant: PropTypes.oneOf(['surface', 'positive', 'caution', 'danger']), - iconSrc: PropTypes.string, - type: PropTypes.oneOf(['button', 'submit']), - onClick: PropTypes.func, - children: PropTypes.node.isRequired, - disabled: PropTypes.bool, -}; - -function MenuBorder() { - return
; -} - -export { - ContextMenu as default, MenuHeader, MenuItem, MenuBorder, -}; diff --git a/src/app/atoms/context-menu/ContextMenu.scss b/src/app/atoms/context-menu/ContextMenu.scss deleted file mode 100644 index 2df9f0a4..00000000 --- a/src/app/atoms/context-menu/ContextMenu.scss +++ /dev/null @@ -1,81 +0,0 @@ -@use '../../partials/flex'; -@use '../../partials/text'; -@use '../../partials/dir'; - -.context-menu { - background-color: var(--bg-surface); - box-shadow: var(--bs-popup); - border-radius: var(--bo-radius); - overflow: hidden; - - &:focus { - outline: none; - } - & .tippy-content > div > .scrollbar { - max-height: 90vh; - } -} - -.context-menu__click-wrapper { - display: inline-flex; - - &:focus { - outline: none; - } -} - -.context-menu__header { - height: 34px; - padding: 0 var(--sp-normal); - margin-bottom: var(--sp-ultra-tight); - display: flex; - align-items: center; - border-bottom: 1px solid var(--bg-surface-border); - - .text { - @extend .cp-txt__ellipsis; - color: var(--tc-surface-low); - } - - &:not(:first-child) { - margin-top: var(--sp-extra-tight); - border-top: 1px solid var(--bg-surface-border); - } -} - -.context-menu__item { - display: flex; - button[class^="btn"] { - @extend .cp-fx__item-one; - justify-content: flex-start; - border-radius: 0; - box-shadow: none; - white-space: nowrap; - padding: var(--sp-extra-tight) var(--sp-normal); - - & > .ic-raw { - @include dir.side(margin, 0, var(--sp-tight)); - } - - // if item doesn't have icon - .text:first-child { - @include dir.side( - margin, - calc(var(--ic-small) + var(--sp-tight)), - 0 - ); - } - } - .btn-surface:focus { - background-color: var(--bg-surface-hover); - } - .btn-positive:focus { - background-color: var(--bg-positive-hover); - } - .btn-caution:focus { - background-color: var(--bg-caution-hover); - } - .btn-danger:focus { - background-color: var(--bg-danger-hover); - } -} \ No newline at end of file diff --git a/src/app/atoms/context-menu/ReusableContextMenu.jsx b/src/app/atoms/context-menu/ReusableContextMenu.jsx deleted file mode 100644 index 59bdb142..00000000 --- a/src/app/atoms/context-menu/ReusableContextMenu.jsx +++ /dev/null @@ -1,87 +0,0 @@ -import React, { useState, useEffect, useRef } from 'react'; - -import cons from '../../../client/state/cons'; -import navigation from '../../../client/state/navigation'; - -import ContextMenu from './ContextMenu'; - -let key = null; -function ReusableContextMenu() { - const [data, setData] = useState(null); - const openerRef = useRef(null); - - const closeMenu = () => { - key = null; - if (data) openerRef.current.click(); - }; - - useEffect(() => { - if (data) { - const { cords } = data; - openerRef.current.style.transform = `translate(${cords.x}px, ${cords.y}px)`; - openerRef.current.style.width = `${cords.width}px`; - openerRef.current.style.height = `${cords.height}px`; - openerRef.current.click(); - } - const handleContextMenuOpen = (placement, cords, render, afterClose) => { - if (key) { - closeMenu(); - return; - } - setData({ - placement, cords, render, afterClose, - }); - }; - navigation.on(cons.events.navigation.REUSABLE_CONTEXT_MENU_OPENED, handleContextMenuOpen); - return () => { - navigation.removeListener( - cons.events.navigation.REUSABLE_CONTEXT_MENU_OPENED, - handleContextMenuOpen, - ); - }; - }, [data]); - - const handleAfterToggle = (isVisible) => { - if (isVisible) { - key = Math.random(); - return; - } - data?.afterClose?.(); - if (setData) setData(null); - - if (key === null) return; - const copyKey = key; - setTimeout(() => { - if (key === copyKey) key = null; - }, 200); - }; - - return ( - ( - - )} - /> - ); -} - -export default ReusableContextMenu; diff --git a/src/app/atoms/divider/Divider.jsx b/src/app/atoms/divider/Divider.jsx deleted file mode 100644 index 76721241..00000000 --- a/src/app/atoms/divider/Divider.jsx +++ /dev/null @@ -1,28 +0,0 @@ -import React from 'react'; -import PropTypes from 'prop-types'; -import './Divider.scss'; - -import Text from '../text/Text'; - -function Divider({ text, variant, align }) { - const dividerClass = ` divider--${variant} divider--${align}`; - return ( -
- {text !== null && {text}} -
- ); -} - -Divider.defaultProps = { - text: null, - variant: 'surface', - align: 'center', -}; - -Divider.propTypes = { - text: PropTypes.string, - variant: PropTypes.oneOf(['surface', 'primary', 'positive', 'caution', 'danger']), - align: PropTypes.oneOf(['left', 'center', 'right']), -}; - -export default Divider; diff --git a/src/app/atoms/divider/Divider.scss b/src/app/atoms/divider/Divider.scss deleted file mode 100644 index 0f013ff0..00000000 --- a/src/app/atoms/divider/Divider.scss +++ /dev/null @@ -1,68 +0,0 @@ -.divider-line { - content: ''; - display: inline-block; - flex: 1; - border-bottom: 1px solid var(--local-divider-color); - opacity: var(--local-divider-opacity); -} - -.divider { - display: flex; - align-items: center; - - &--center::before, - &--right::before { - @extend .divider-line; - } - &--center::after, - &--left::after { - @extend .divider-line; - } - - &__text { - padding: 2px var(--sp-extra-tight); - border-radius: calc(var(--bo-radius) / 2); - } -} - -.divider--surface { - --local-divider-color: var(--bg-divider); - --local-divider-opacity: 1; - - .divider__text { - color: var(--tc-surface-low); - border: 1px solid var(--bg-divider); - } -} -.divider--primary { - --local-divider-color: var(--bg-primary); - --local-divider-opacity: .8; - .divider__text { - color: var(--tc-primary-high); - background-color: var(--bg-primary); - } -} -.divider--positive { - --local-divider-color: var(--bg-positive); - --local-divider-opacity: .8; - .divider__text { - color: var(--bg-surface); - background-color: var(--bg-positive); - } -} -.divider--danger { - --local-divider-color: var(--bg-danger); - --local-divider-opacity: .8; - .divider__text { - color: var(--bg-surface); - background-color: var(--bg-danger); - } -} -.divider--caution { - --local-divider-color: var(--bg-caution); - --local-divider-opacity: .8; - .divider__text { - color: var(--bg-surface); - background-color: var(--bg-caution); - } -} diff --git a/src/app/atoms/header/Header.jsx b/src/app/atoms/header/Header.jsx deleted file mode 100644 index 3c81e423..00000000 --- a/src/app/atoms/header/Header.jsx +++ /dev/null @@ -1,29 +0,0 @@ -import React from 'react'; -import PropTypes from 'prop-types'; -import './Header.scss'; - -function Header({ children }) { - return ( -
- {children} -
- ); -} - -Header.propTypes = { - children: PropTypes.node.isRequired, -}; - -function TitleWrapper({ children }) { - return ( -
- {children} -
- ); -} - -TitleWrapper.propTypes = { - children: PropTypes.node.isRequired, -}; - -export { Header as default, TitleWrapper }; diff --git a/src/app/atoms/header/Header.scss b/src/app/atoms/header/Header.scss deleted file mode 100644 index 9e45f824..00000000 --- a/src/app/atoms/header/Header.scss +++ /dev/null @@ -1,43 +0,0 @@ -@use '../../partials/text'; -@use '../../partials/dir'; - -.header { - @include dir.side(padding, var(--sp-normal), var(--sp-extra-tight)); - width: 100%; - height: var(--header-height); - border-bottom: 1px solid var(--bg-surface-border); - display: flex; - align-items: center; - - &__title-wrapper { - flex: 1; - min-width: 0; - display: flex; - align-items: center; - margin: 0 var(--sp-tight); - - &:first-child { - @include dir.side(margin, 0, var(--sp-tight)); - } - - & > .text:first-child { - @extend .cp-txt__ellipsis; - min-width: 0; - } - & > .text-b3{ - flex: 1; - min-width: 0; - - margin-top: var(--sp-ultra-tight); - @include dir.side(margin, var(--sp-tight), 0); - @include dir.side(padding, var(--sp-tight), 0); - @include dir.side(border, 1px solid var(--bg-surface-border), none); - - max-height: calc(2 * var(--lh-b3)); - overflow: hidden; - -webkit-box-orient: vertical; - -webkit-line-clamp: 2; - display: -webkit-box; - } - } -} \ No newline at end of file diff --git a/src/app/atoms/input/Input.jsx b/src/app/atoms/input/Input.jsx deleted file mode 100644 index 96c94967..00000000 --- a/src/app/atoms/input/Input.jsx +++ /dev/null @@ -1,97 +0,0 @@ -import React from 'react'; -import PropTypes from 'prop-types'; -import './Input.scss'; - -import TextareaAutosize from 'react-autosize-textarea'; - -function Input({ - id, label, name, value, placeholder, - required, type, onChange, forwardRef, - resizable, minHeight, onResize, state, - onKeyDown, disabled, autoFocus, -}) { - return ( -
- { label !== '' && } - { resizable - ? ( - - ) : ( - - )} -
- ); -} - -Input.defaultProps = { - id: null, - name: '', - label: '', - value: '', - placeholder: '', - type: 'text', - required: false, - onChange: null, - forwardRef: null, - resizable: false, - minHeight: 46, - onResize: null, - state: 'normal', - onKeyDown: null, - disabled: false, - autoFocus: false, -}; - -Input.propTypes = { - id: PropTypes.string, - name: PropTypes.string, - label: PropTypes.string, - value: PropTypes.string, - placeholder: PropTypes.string, - required: PropTypes.bool, - type: PropTypes.string, - onChange: PropTypes.func, - forwardRef: PropTypes.shape({}), - resizable: PropTypes.bool, - minHeight: PropTypes.number, - onResize: PropTypes.func, - state: PropTypes.oneOf(['normal', 'success', 'error']), - onKeyDown: PropTypes.func, - disabled: PropTypes.bool, - autoFocus: PropTypes.bool, -}; - -export default Input; diff --git a/src/app/atoms/input/Input.scss b/src/app/atoms/input/Input.scss deleted file mode 100644 index 40fe43ec..00000000 --- a/src/app/atoms/input/Input.scss +++ /dev/null @@ -1,52 +0,0 @@ -@use '../../atoms/scroll/scrollbar'; - -.input { - display: block; - width: 100%; - min-width: 0px; - margin: 0; - padding: var(--sp-tight) var(--sp-normal); - background-color: var(--bg-surface-low); - color: var(--tc-surface-normal); - box-shadow: none; - border-radius: var(--bo-radius); - border: 1px solid var(--bg-surface-border); - font-size: var(--fs-b2); - letter-spacing: var(--ls-b2); - line-height: var(--lh-b2); - - :disabled { - opacity: 0.4; - cursor: no-drop; - } - - &__label { - display: inline-block; - margin-bottom: var(--sp-ultra-tight); - color: var(--tc-surface-low); - } - - &--resizable { - resize: vertical !important; - overflow-y: auto !important; - @include scrollbar.scroll; - @include scrollbar.scroll__v; - @include scrollbar.scroll--auto-hide; - } - &--success { - border: 1px solid var(--bg-positive); - box-shadow: none !important; - } - &--error { - border: 1px solid var(--bg-danger); - box-shadow: none !important; - } - - &:focus { - outline: none; - box-shadow: var(--bs-primary-border); - } - &::placeholder { - color: var(--tc-surface-low) - } -} \ No newline at end of file diff --git a/src/app/atoms/modal/RawModal.jsx b/src/app/atoms/modal/RawModal.jsx deleted file mode 100644 index 450be0e0..00000000 --- a/src/app/atoms/modal/RawModal.jsx +++ /dev/null @@ -1,73 +0,0 @@ -import React, { useEffect } from 'react'; -import PropTypes from 'prop-types'; -import './RawModal.scss'; - -import Modal from 'react-modal'; - -import navigation from '../../../client/state/navigation'; - -Modal.setAppElement('#root'); - -function RawModal({ - className, overlayClassName, - isOpen, size, onAfterOpen, onAfterClose, - onRequestClose, closeFromOutside, children, -}) { - let modalClass = (className !== null) ? `${className} ` : ''; - switch (size) { - case 'large': - modalClass += 'raw-modal__large '; - break; - case 'medium': - modalClass += 'raw-modal__medium '; - break; - case 'small': - default: - modalClass += 'raw-modal__small '; - } - - useEffect(() => { - navigation.setIsRawModalVisible(isOpen); - }, [isOpen]); - - const modalOverlayClass = (overlayClassName !== null) ? `${overlayClassName} ` : ''; - return ( - - {children} - - ); -} - -RawModal.defaultProps = { - className: null, - overlayClassName: null, - size: 'small', - onAfterOpen: null, - onAfterClose: null, - onRequestClose: null, - closeFromOutside: true, -}; - -RawModal.propTypes = { - className: PropTypes.string, - overlayClassName: PropTypes.string, - isOpen: PropTypes.bool.isRequired, - size: PropTypes.oneOf(['large', 'medium', 'small']), - onAfterOpen: PropTypes.func, - onAfterClose: PropTypes.func, - onRequestClose: PropTypes.func, - closeFromOutside: PropTypes.bool, - children: PropTypes.node.isRequired, -}; - -export default RawModal; diff --git a/src/app/atoms/modal/RawModal.scss b/src/app/atoms/modal/RawModal.scss deleted file mode 100644 index d612a4bc..00000000 --- a/src/app/atoms/modal/RawModal.scss +++ /dev/null @@ -1,66 +0,0 @@ -.raw-modal { - --small-modal-width: 525px; - --medium-modal-width: 712px; - --large-modal-width: 1024px; - - position: relative; - width: 100%; - max-height: 100%; - border-radius: var(--bo-radius); - box-shadow: var(--bs-popup); - outline: none; - overflow: hidden; - - &__small { - max-width: var(--small-modal-width); - } - &__medium { - max-width: var(--medium-modal-width); - } - &__large { - max-width: var(--large-modal-width); - } - - &__overlay { - position: fixed; - top: 0; - left: 0; - z-index: 999; - - display: flex; - justify-content: center; - align-items: center; - - padding: var(--sp-normal); - width: 100%; - height: 100%; - background-color: var(--bg-overlay); - } -} - -.ReactModal__Overlay { - animation: raw-modal--overlay 150ms; -} - -.ReactModal__Content { - animation: raw-modal--content 150ms; -} - -@keyframes raw-modal--content { - 0% { - transform: translateY(100px); - opacity: .5; - } - 100% { - transform: translateY(0); - opacity: 1; - } -} -@keyframes raw-modal--overlay { - 0% { - opacity: 0; - } - 100% { - opacity: 1; - } -} diff --git a/src/app/atoms/scroll/ScrollView.jsx b/src/app/atoms/scroll/ScrollView.jsx deleted file mode 100644 index 26c0c83a..00000000 --- a/src/app/atoms/scroll/ScrollView.jsx +++ /dev/null @@ -1,37 +0,0 @@ -import React from 'react'; -import PropTypes from 'prop-types'; -import './ScrollView.scss'; - -const ScrollView = React.forwardRef(({ - horizontal, vertical, autoHide, invisible, onScroll, children, -}, ref) => { - let scrollbarClasses = ''; - if (horizontal) scrollbarClasses += ' scrollbar__h'; - if (vertical) scrollbarClasses += ' scrollbar__v'; - if (autoHide) scrollbarClasses += ' scrollbar--auto-hide'; - if (invisible) scrollbarClasses += ' scrollbar--invisible'; - return ( -
- {children} -
- ); -}); - -ScrollView.defaultProps = { - horizontal: false, - vertical: true, - autoHide: false, - invisible: false, - onScroll: null, -}; - -ScrollView.propTypes = { - horizontal: PropTypes.bool, - vertical: PropTypes.bool, - autoHide: PropTypes.bool, - invisible: PropTypes.bool, - onScroll: PropTypes.func, - children: PropTypes.node.isRequired, -}; - -export default ScrollView; diff --git a/src/app/atoms/scroll/ScrollView.scss b/src/app/atoms/scroll/ScrollView.scss deleted file mode 100644 index 251037e1..00000000 --- a/src/app/atoms/scroll/ScrollView.scss +++ /dev/null @@ -1,31 +0,0 @@ -@use '../../partials/dir'; -@use '_scrollbar'; - -@mixin paddingForSafari($padding) { - @media not all and (min-resolution:.001dpcm) { - @include dir.side(padding, 0, $padding); - } -} - -.scrollbar { - width: 100%; - height: 100%; - @include scrollbar.scroll; - @include paddingForSafari(var(--sp-extra-tight)); - - &__h { - @include scrollbar.scroll__h; - } - - &__v { - @include scrollbar.scroll__v; - } - - &--auto-hide { - @include scrollbar.scroll--auto-hide; - } - &--invisible { - @include scrollbar.scroll--invisible; - @include paddingForSafari(0); - } -} \ No newline at end of file diff --git a/src/app/atoms/scroll/_scrollbar.scss b/src/app/atoms/scroll/_scrollbar.scss deleted file mode 100644 index 78ec75ad..00000000 --- a/src/app/atoms/scroll/_scrollbar.scss +++ /dev/null @@ -1,65 +0,0 @@ -.firefox-scrollbar { - scrollbar-width: thin; - scrollbar-color: var(--bg-surface-hover) transparent; - &--transparent { - scrollbar-color: transparent transparent; - } -} -.webkit-scrollbar { - &::-webkit-scrollbar { - width: 8px; - height: 8px; - } -} -.webkit-scrollbar-track { - &::-webkit-scrollbar-track { - background-color: transparent; - } -} -.webkit-scrollbar-thumb { - &::-webkit-scrollbar-thumb { - background-color: var(--bg-surface-hover); - } - &::-webkit-scrollbar-thumb:hover { - background-color: var(--bg-surface-active); - } - &--transparent { - &::-webkit-scrollbar-thumb { - background-color: transparent; - } - } -} - -@mixin scroll { - overflow: hidden; - // Below code stop scroll when x-scrollable content come in timeline - // overscroll-behavior: none; - @extend .firefox-scrollbar; - @extend .webkit-scrollbar; - @extend .webkit-scrollbar-track; - @extend .webkit-scrollbar-thumb; -} - -@mixin scroll__h { - overflow-x: scroll; -} -@mixin scroll__v { - overflow-y: scroll; -} -@mixin scroll--auto-hide { - @extend .firefox-scrollbar--transparent; - @extend .webkit-scrollbar-thumb--transparent; - - &:hover { - @extend .firefox-scrollbar; - @extend .webkit-scrollbar-thumb; - } -} -@mixin scroll--invisible { - -ms-overflow-style: none; - scrollbar-width: none; - - &::-webkit-scrollbar { - display: none; - } -} \ No newline at end of file diff --git a/src/app/atoms/segmented-controls/SegmentedControls.jsx b/src/app/atoms/segmented-controls/SegmentedControls.jsx deleted file mode 100644 index 1d54dd06..00000000 --- a/src/app/atoms/segmented-controls/SegmentedControls.jsx +++ /dev/null @@ -1,55 +0,0 @@ -import React, { useState, useEffect } from 'react'; -import PropTypes from 'prop-types'; -import './SegmentedControls.scss'; - -import { blurOnBubbling } from '../button/script'; - -import Text from '../text/Text'; -import RawIcon from '../system-icons/RawIcon'; - -function SegmentedControls({ - selected, segments, onSelect, -}) { - const [select, setSelect] = useState(selected); - - function selectSegment(segmentIndex) { - setSelect(segmentIndex); - onSelect(segmentIndex); - } - - useEffect(() => { - setSelect(selected); - }, [selected]); - - return ( -
- { - segments.map((segment, index) => ( - - )) - } -
- ); -} - -SegmentedControls.propTypes = { - selected: PropTypes.number.isRequired, - segments: PropTypes.arrayOf(PropTypes.shape({ - iconSrc: PropTypes.string, - text: PropTypes.string, - })).isRequired, - onSelect: PropTypes.func.isRequired, -}; - -export default SegmentedControls; diff --git a/src/app/atoms/segmented-controls/SegmentedControls.scss b/src/app/atoms/segmented-controls/SegmentedControls.scss deleted file mode 100644 index fb1fd987..00000000 --- a/src/app/atoms/segmented-controls/SegmentedControls.scss +++ /dev/null @@ -1,57 +0,0 @@ -@use '../button/state'; -@use '../../partials/dir'; - -.segmented-controls { - background-color: var(--bg-surface-low); - border-radius: var(--bo-radius); - border: 1px solid var(--bg-surface-border); - - display: inline-flex; - overflow: hidden; -} - -.segment-btn { - padding: var(--sp-extra-tight) 0; - cursor: pointer; - @include state.hover(var(--bg-surface-hover)); - @include state.active(var(--bg-surface-active)); - - &__base { - padding: 0 var(--sp-normal); - display: flex; - align-items: center; - justify-content: center; - @include dir.side(border, 1px solid var(--bg-surface-border), none); - - & .text:nth-child(2) { - margin: 0 var(--sp-extra-tight); - } - } - &:first-child &__base { - border: none; - } - - &--active { - background-color: var(--bg-surface); - border: 1px solid var(--bg-surface-border); - border-width: 0 1px 0 1px; - - & .segment-btn__base, - & + .segment-btn .segment-btn__base { - border: none; - } - &:first-child{ - border-left: none; - } - &:last-child { - border-right: none; - } - [dir=rtl] & { - border-left: 1px solid var(--bg-surface-border); - border-right: 1px solid var(--bg-surface-border); - - &:first-child { border-right: none;} - &:last-child { border-left: none;} - } - } -} \ No newline at end of file diff --git a/src/app/atoms/spinner/Spinner.jsx b/src/app/atoms/spinner/Spinner.jsx deleted file mode 100644 index 61c9747e..00000000 --- a/src/app/atoms/spinner/Spinner.jsx +++ /dev/null @@ -1,19 +0,0 @@ -import React from 'react'; -import PropTypes from 'prop-types'; -import './Spinner.scss'; - -function Spinner({ size }) { - return ( -
- ); -} - -Spinner.defaultProps = { - size: 'normal', -}; - -Spinner.propTypes = { - size: PropTypes.oneOf(['normal', 'small']), -}; - -export default Spinner; diff --git a/src/app/atoms/spinner/Spinner.scss b/src/app/atoms/spinner/Spinner.scss deleted file mode 100644 index 73fbf676..00000000 --- a/src/app/atoms/spinner/Spinner.scss +++ /dev/null @@ -1,22 +0,0 @@ -.donut-spinner { - display: inline-block; - border: 4px solid var(--bg-surface-border); - border-left-color: var(--tc-surface-normal); - border-radius: 50%; - animation: donut-spin 1.2s cubic-bezier(0.73, 0.32, 0.67, 0.86) infinite; - - &--normal { - width: 40px; - height: 40px; - } - &--small { - width: 28px; - height: 28px; - } -} - -@keyframes donut-spin { - to { - transform: rotate(1turn); - } -} \ No newline at end of file diff --git a/src/app/atoms/system-icons/RawIcon.jsx b/src/app/atoms/system-icons/RawIcon.jsx deleted file mode 100644 index a6697f4f..00000000 --- a/src/app/atoms/system-icons/RawIcon.jsx +++ /dev/null @@ -1,32 +0,0 @@ -import React from 'react'; -import PropTypes from 'prop-types'; -import './RawIcon.scss'; - -function RawIcon({ color, size, src, isImage }) { - const style = {}; - if (color !== null) style.backgroundColor = color; - if (isImage) { - style.backgroundColor = 'transparent'; - style.backgroundImage = `url("${src}")`; - } else { - style.WebkitMaskImage = `url("${src}")`; - style.maskImage = `url("${src}")`; - } - - return ; -} - -RawIcon.defaultProps = { - color: null, - size: 'normal', - isImage: false, -}; - -RawIcon.propTypes = { - color: PropTypes.string, - size: PropTypes.oneOf(['large', 'normal', 'small', 'extra-small']), - src: PropTypes.string.isRequired, - isImage: PropTypes.bool, -}; - -export default RawIcon; diff --git a/src/app/atoms/system-icons/RawIcon.scss b/src/app/atoms/system-icons/RawIcon.scss deleted file mode 100644 index 56fc9b3c..00000000 --- a/src/app/atoms/system-icons/RawIcon.scss +++ /dev/null @@ -1,28 +0,0 @@ -@mixin icSize($size) { - width: $size; - height: $size; -} - -.ic-raw { - display: inline-block; - -webkit-mask-repeat: no-repeat; - mask-repeat: no-repeat; - -webkit-mask-size: cover; - mask-size: cover; - background-color: var(--ic-surface-normal); - - background-size: cover; - background-repeat: no-repeat; -} -.ic-raw-large { - @include icSize(var(--ic-large)); -} -.ic-raw-normal { - @include icSize(var(--ic-normal)); -} -.ic-raw-small { - @include icSize(var(--ic-small)); -} -.ic-raw-extra-small { - @include icSize(var(--ic-extra-small)); -} \ No newline at end of file diff --git a/src/app/atoms/tabs/Tabs.jsx b/src/app/atoms/tabs/Tabs.jsx deleted file mode 100644 index bcdc8ef7..00000000 --- a/src/app/atoms/tabs/Tabs.jsx +++ /dev/null @@ -1,88 +0,0 @@ -import React, { useState } from 'react'; -import PropTypes from 'prop-types'; -import './Tabs.scss'; - -import Button from '../button/Button'; -import ScrollView from '../scroll/ScrollView'; - -function TabItem({ - selected, iconSrc, - onClick, children, disabled, -}) { - const isSelected = selected ? 'tab-item--selected' : ''; - - return ( - - ); -} - -TabItem.defaultProps = { - selected: false, - iconSrc: null, - onClick: null, - disabled: false, -}; - -TabItem.propTypes = { - selected: PropTypes.bool, - iconSrc: PropTypes.string, - onClick: PropTypes.func, - children: PropTypes.node.isRequired, - disabled: PropTypes.bool, -}; - -function Tabs({ items, defaultSelected, onSelect }) { - const [selectedItem, setSelectedItem] = useState(items[defaultSelected]); - - const handleTabSelection = (item, index, target) => { - if (selectedItem === item) return; - target.scrollIntoView({ behavior: 'smooth', block: 'nearest', inline: 'center' }); - setSelectedItem(item); - onSelect(item, index); - }; - - return ( -
- -
- {items.map((item, index) => ( - handleTabSelection(item, index, e.currentTarget)} - > - {item.text} - - ))} -
-
-
- ); -} - -Tabs.defaultProps = { - defaultSelected: 0, -}; - -Tabs.propTypes = { - items: PropTypes.arrayOf( - PropTypes.shape({ - iconSrc: PropTypes.string, - text: PropTypes.string, - disabled: PropTypes.bool, - }), - ).isRequired, - defaultSelected: PropTypes.number, - onSelect: PropTypes.func.isRequired, -}; - -export default Tabs; diff --git a/src/app/atoms/tabs/Tabs.scss b/src/app/atoms/tabs/Tabs.scss deleted file mode 100644 index 39ddddec..00000000 --- a/src/app/atoms/tabs/Tabs.scss +++ /dev/null @@ -1,45 +0,0 @@ -@use '../../partials/dir'; - -.tabs { - height: var(--header-height); - box-shadow: inset 0 -1px 0 var(--bg-surface-border); - - &__content { - min-width: 100%; - height: 100%; - display: flex; - } -} - -.tab-item { - flex-shrink: 0; - - @include dir.side(padding, var(--sp-normal), 24px); - border-radius: 0; - height: 100%; - box-shadow: none; - border-radius: var(--bo-radius) var(--bo-radius) 0 0; - - &:focus, - &:active { - background-color: var(--bg-surface-active); - box-shadow: none; - } - - &--selected { - --bs-tab-selected: inset 0 -2px 0 var(--tc-surface-high); - box-shadow: var(--bs-tab-selected); - - & .ic-raw { - background-color: var(--ic-surface-high); - } - & .text { - font-weight: var(--fw-medium); - } - &:focus, - &:active { - background-color: var(--bg-surface-active); - box-shadow: var(--bs-tab-selected); - } - } -} \ No newline at end of file diff --git a/src/app/atoms/text/Text.jsx b/src/app/atoms/text/Text.jsx deleted file mode 100644 index 3f507ee3..00000000 --- a/src/app/atoms/text/Text.jsx +++ /dev/null @@ -1,42 +0,0 @@ -import React from 'react'; -import PropTypes from 'prop-types'; -import './Text.scss'; - -function Text({ - className, style, variant, weight, - primary, span, children, -}) { - const classes = []; - if (className) classes.push(className); - - classes.push(`text text-${variant} text-${weight}`); - if (primary) classes.push('font-primary'); - - const textClass = classes.join(' '); - if (span) return { children }; - if (variant === 'h1') return

{ children }

; - if (variant === 'h2') return

{ children }

; - if (variant === 's1') return

{ children }

; - return

{ children }

; -} - -Text.defaultProps = { - className: null, - style: null, - variant: 'b1', - weight: 'normal', - primary: false, - span: false, -}; - -Text.propTypes = { - className: PropTypes.string, - style: PropTypes.shape({}), - variant: PropTypes.oneOf(['h1', 'h2', 's1', 'b1', 'b2', 'b3']), - weight: PropTypes.oneOf(['light', 'normal', 'medium', 'bold']), - primary: PropTypes.bool, - span: PropTypes.bool, - children: PropTypes.node.isRequired, -}; - -export default Text; diff --git a/src/app/atoms/text/Text.scss b/src/app/atoms/text/Text.scss deleted file mode 100644 index 256bf6ea..00000000 --- a/src/app/atoms/text/Text.scss +++ /dev/null @@ -1,61 +0,0 @@ -@mixin font($type) { - font-size: var(--fs-#{$type}); - letter-spacing: var(--ls-#{$type}); - line-height: var(--lh-#{$type}); - - & img.emoji, - & img[data-mx-emoticon] { - height: calc(var(--lh-#{$type}) - .25rem); - } -} - -.text { - margin: 0; - padding: 0; - color: var(--tc-surface-high); - - & img.emoji, - & img[data-mx-emoticon] { - margin: 0 !important; - margin-right: 2px !important; - padding: 0 !important; - position: relative; - top: -.1rem; - vertical-align: middle; - } -} - -.text-light { - font-weight: var(--fw-light); -} -.text-normal { - font-weight: var(--fw-normal); -} -.text-medium { - font-weight: var(--fw-medium); -} -.text-bold { - font-weight: var(--fw-bold); -} - -.text-h1 { - @include font(h1); -} -.text-h2 { - @include font(h2); -} -.text-s1 { - @include font(s1); -} -.text-b1 { - @include font(b1); - color: var(--tc-surface-normal); -} -.text-b2 { - @include font(b2); - color: var(--tc-surface-normal); -} -.text-b3 { - @include font(b3); - color: var(--tc-surface-low); -} \ No newline at end of file diff --git a/src/app/atoms/time/Time.jsx b/src/app/atoms/time/Time.jsx deleted file mode 100644 index d7bbe439..00000000 --- a/src/app/atoms/time/Time.jsx +++ /dev/null @@ -1,63 +0,0 @@ -import React from 'react'; -import PropTypes from 'prop-types'; - -import dateFormat from 'dateformat'; -import { isInSameDay } from '../../../util/common'; - -/** - * Renders a formatted timestamp. - * - * Displays the time in hour:minute format if the message is from today or yesterday, unless `fullTime` is true. - * For older messages, it shows the date and time. - * - * @param {number} timestamp - The timestamp to display. - * @param {boolean} [fullTime=false] - If true, always show the full date and time. - * @param {boolean} hour24Clock - Whether to use 24-hour time format. - * @param {string} dateFormatString - Format string for the date part. - * @returns {JSX.Element} A
} diff --git a/src/app/pages/client/direct/Direct.tsx b/src/app/pages/client/direct/Direct.tsx index 51de3946..04edf109 100644 --- a/src/app/pages/client/direct/Direct.tsx +++ b/src/app/pages/client/direct/Direct.tsx @@ -42,7 +42,7 @@ import { useDirectRooms } from './useDirectRooms'; import { PageNav, PageNavContent, PageNavHeader } from '../../../components/page'; import { useClosedNavCategoriesAtom } from '../../../state/hooks/closedNavCategories'; import { useRoomsUnread } from '../../../state/hooks/unread'; -import { markAsRead } from '../../../../client/action/notifications'; +import { markAsRead } from '../../../utils/notifications'; import { stopPropagation } from '../../../utils/keyboard'; import { useSetting } from '../../../state/hooks/settings'; import { settingsAtom } from '../../../state/settings'; diff --git a/src/app/pages/client/home/Home.tsx b/src/app/pages/client/home/Home.tsx index 2597bb73..d87db963 100644 --- a/src/app/pages/client/home/Home.tsx +++ b/src/app/pages/client/home/Home.tsx @@ -53,7 +53,7 @@ import { useCategoryHandler } from '../../../hooks/useCategoryHandler'; import { useNavToActivePathMapper } from '../../../hooks/useNavToActivePathMapper'; import { PageNav, PageNavHeader, PageNavContent } from '../../../components/page'; import { useRoomsUnread } from '../../../state/hooks/unread'; -import { markAsRead } from '../../../../client/action/notifications'; +import { markAsRead } from '../../../utils/notifications'; import { useClosedNavCategoriesAtom } from '../../../state/hooks/closedNavCategories'; import { stopPropagation } from '../../../utils/keyboard'; import { useSetting } from '../../../state/hooks/settings'; diff --git a/src/app/pages/client/inbox/Notifications.tsx b/src/app/pages/client/inbox/Notifications.tsx index afdfec6d..4cc94d91 100644 --- a/src/app/pages/client/inbox/Notifications.tsx +++ b/src/app/pages/client/inbox/Notifications.tsx @@ -73,7 +73,7 @@ import * as customHtmlCss from '../../../styles/CustomHtml.css'; import { useRoomNavigate } from '../../../hooks/useRoomNavigate'; import { useRoomUnread } from '../../../state/hooks/unread'; import { roomToUnreadAtom } from '../../../state/room/roomToUnread'; -import { markAsRead } from '../../../../client/action/notifications'; +import { markAsRead } from '../../../utils/notifications'; import { ContainerColor } from '../../../styles/ContainerColor.css'; import { VirtualTile } from '../../../components/virtualizer'; import { UserAvatar } from '../../../components/user-avatar'; diff --git a/src/app/pages/client/sidebar/DirectTab.tsx b/src/app/pages/client/sidebar/DirectTab.tsx index bd8090d3..dcd44e2f 100644 --- a/src/app/pages/client/sidebar/DirectTab.tsx +++ b/src/app/pages/client/sidebar/DirectTab.tsx @@ -21,7 +21,7 @@ import { UnreadBadge } from '../../../components/unread-badge'; import { ScreenSize, useScreenSizeContext } from '../../../hooks/useScreenSize'; import { useNavToActivePathAtom } from '../../../state/hooks/navToActivePath'; import { useDirectRooms } from '../direct/useDirectRooms'; -import { markAsRead } from '../../../../client/action/notifications'; +import { markAsRead } from '../../../utils/notifications'; import { stopPropagation } from '../../../utils/keyboard'; import { settingsAtom } from '../../../state/settings'; import { useSetting } from '../../../state/hooks/settings'; diff --git a/src/app/pages/client/sidebar/HomeTab.tsx b/src/app/pages/client/sidebar/HomeTab.tsx index c8a80280..778b729e 100644 --- a/src/app/pages/client/sidebar/HomeTab.tsx +++ b/src/app/pages/client/sidebar/HomeTab.tsx @@ -22,7 +22,7 @@ import { UnreadBadge } from '../../../components/unread-badge'; import { ScreenSize, useScreenSizeContext } from '../../../hooks/useScreenSize'; import { useNavToActivePathAtom } from '../../../state/hooks/navToActivePath'; import { useHomeRooms } from '../home/useHomeRooms'; -import { markAsRead } from '../../../../client/action/notifications'; +import { markAsRead } from '../../../utils/notifications'; import { stopPropagation } from '../../../utils/keyboard'; import { useSetting } from '../../../state/hooks/settings'; import { settingsAtom } from '../../../state/settings'; diff --git a/src/app/pages/client/sidebar/SpaceTabs.tsx b/src/app/pages/client/sidebar/SpaceTabs.tsx index c06fab92..6fc528a1 100644 --- a/src/app/pages/client/sidebar/SpaceTabs.tsx +++ b/src/app/pages/client/sidebar/SpaceTabs.tsx @@ -80,7 +80,7 @@ import { useOpenedSidebarFolderAtom } from '../../../state/hooks/openedSidebarFo import { usePowerLevels } from '../../../hooks/usePowerLevels'; import { useRoomsUnread } from '../../../state/hooks/unread'; import { roomToUnreadAtom } from '../../../state/room/roomToUnread'; -import { markAsRead } from '../../../../client/action/notifications'; +import { markAsRead } from '../../../utils/notifications'; import { copyToClipboard } from '../../../utils/dom'; import { stopPropagation } from '../../../utils/keyboard'; import { getMatrixToRoom } from '../../../plugins/matrix-to'; diff --git a/src/app/pages/client/space/Space.tsx b/src/app/pages/client/space/Space.tsx index fba3de50..3f60d2a9 100644 --- a/src/app/pages/client/space/Space.tsx +++ b/src/app/pages/client/space/Space.tsx @@ -59,7 +59,7 @@ import { PageNav, PageNavContent, PageNavHeader } from '../../../components/page import { usePowerLevels } from '../../../hooks/usePowerLevels'; import { useRecursiveChildScopeFactory, useSpaceChildren } from '../../../state/hooks/roomList'; import { roomToParentsAtom } from '../../../state/room/roomToParents'; -import { markAsRead } from '../../../../client/action/notifications'; +import { markAsRead } from '../../../utils/notifications'; import { useRoomsUnread } from '../../../state/hooks/unread'; import { UseStateProvider } from '../../../components/UseStateProvider'; import { LeaveSpacePrompt } from '../../../components/leave-space-prompt'; @@ -271,7 +271,7 @@ function SpaceHeader() { {joinRules?.join_rule !== JoinRule.Public && } - + diff --git a/src/app/partials/_dir.scss b/src/app/partials/_dir.scss deleted file mode 100644 index b5d4a696..00000000 --- a/src/app/partials/_dir.scss +++ /dev/null @@ -1,26 +0,0 @@ -/* -* NOTICE: only use this -* when sides are un-even -* if they are even just use $property: 0 $spacing; -*/ - -@mixin side($property, $left, $right) { - #{$property}: { - left: $left; - right: $right; - }; - - [dir=rtl] & { - #{$property}: { - left: $right; - right: $left; - }; - } -} - -@mixin prop($property, $ltr, $rtl) { - #{$property}: $ltr; - [dir=rtl] & { - #{$property}: $rtl; - } -} \ No newline at end of file diff --git a/src/app/partials/_flex.scss b/src/app/partials/_flex.scss deleted file mode 100644 index 950cd1ed..00000000 --- a/src/app/partials/_flex.scss +++ /dev/null @@ -1,58 +0,0 @@ -._s-c { - justify-content: flex-start; - align-items: center; -} -._c-c { - justify-content: center; - align-items: center; -} -._e-c { - justify-content: flex-end; - align-items: center; -} - -.cp-fx__row { - display: flex; - flex-direction: row; -} - -.cp-fx__column { - display: flex; - flex-direction: column; -} - -.cp-fx__row--s-c { - @extend .cp-fx__row; - @extend ._s-c; -} - -.cp-fx__row--c-c { - @extend .cp-fx__row; - @extend ._c-c; -} - -.cp-fx__row--e-c { - @extend .cp-fx__row; - @extend ._e-c; -} - -.cp-fx__column--s-c { - @extend .cp-fx__column; - @extend ._s-c; -} - -.cp-fx__column--c-c { - @extend .cp-fx__column; - @extend ._c-c; -} - -.cp-fx__column--e-c { - @extend .cp-fx__column; - @extend ._e-c; -} - -.cp-fx__item-one { - flex: 1; - min-width: 0; - min-height: 0; -} diff --git a/src/app/partials/_screen.scss b/src/app/partials/_screen.scss deleted file mode 100644 index 99a0907b..00000000 --- a/src/app/partials/_screen.scss +++ /dev/null @@ -1,28 +0,0 @@ - -$breakpoint-tablet: 1124px; -$breakpoint-mobile: 750px; - -@mixin smallerThan($deviceBreakpoint) { - @if $deviceBreakpoint==mobileBreakpoint { - @media screen and (max-width: $breakpoint-mobile) { - @content; - } - } - @else if $deviceBreakpoint==tabletBreakpoint { - @media screen and (max-width: $breakpoint-tablet) { - @content; - } - } -} - -@mixin biggerThan($deviceBreakpoint) { - @if $deviceBreakpoint==mobileBreakpoint { - @media screen and (min-width: $breakpoint-mobile) { - @content; - } - } @else if $deviceBreakpoint==tabletBreakpoint { - @media screen and (min-width: $breakpoint-tablet) { - @content; - } - } -} diff --git a/src/app/partials/_text.scss b/src/app/partials/_text.scss deleted file mode 100644 index ab5e2805..00000000 --- a/src/app/partials/_text.scss +++ /dev/null @@ -1,5 +0,0 @@ -.cp-txt__ellipsis { - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; -} \ No newline at end of file diff --git a/src/app/state/sessions.ts b/src/app/state/sessions.ts index 85bcd10e..a9c34ce9 100644 --- a/src/app/state/sessions.ts +++ b/src/app/state/sessions.ts @@ -1,9 +1,9 @@ -import { atom } from 'jotai'; -import { - atomWithLocalStorage, - getLocalStorageItem, - setLocalStorageItem, -} from './utils/atomWithLocalStorage'; +// import { atom } from 'jotai'; +// import { +// atomWithLocalStorage, +// getLocalStorageItem, +// setLocalStorageItem, +// } from './utils/atomWithLocalStorage'; export type Session = { baseUrl: string; @@ -24,18 +24,29 @@ export type SessionStoreName = { /** * Migration code for old session */ -const FALLBACK_STORE_NAME: SessionStoreName = { - sync: 'web-sync-store', - crypto: 'crypto-store', -} as const; +// const FALLBACK_STORE_NAME: SessionStoreName = { +// sync: 'web-sync-store', +// crypto: 'crypto-store', +// } as const; -const removeFallbackSession = () => { +export function setFallbackSession( + accessToken: string, + deviceId: string, + userId: string, + baseUrl: string +) { + localStorage.setItem('cinny_access_token', accessToken); + localStorage.setItem('cinny_device_id', deviceId); + localStorage.setItem('cinny_user_id', userId); + localStorage.setItem('cinny_hs_base_url', baseUrl); +} +export const removeFallbackSession = () => { localStorage.removeItem('cinny_hs_base_url'); localStorage.removeItem('cinny_user_id'); localStorage.removeItem('cinny_device_id'); localStorage.removeItem('cinny_access_token'); }; -const getFallbackSession = (): Session | undefined => { +export const getFallbackSession = (): Session | undefined => { const baseUrl = localStorage.getItem('cinny_hs_base_url'); const userId = localStorage.getItem('cinny_user_id'); const deviceId = localStorage.getItem('cinny_device_id'); @@ -59,71 +70,71 @@ const getFallbackSession = (): Session | undefined => { * End of migration code for old session */ -export const getSessionStoreName = (session: Session): SessionStoreName => { - if (session.fallbackSdkStores) { - return FALLBACK_STORE_NAME; - } +// export const getSessionStoreName = (session: Session): SessionStoreName => { +// if (session.fallbackSdkStores) { +// return FALLBACK_STORE_NAME; +// } - return { - sync: `sync${session.userId}`, - crypto: `crypto${session.userId}`, - }; -}; +// return { +// sync: `sync${session.userId}`, +// crypto: `crypto${session.userId}`, +// }; +// }; -export const MATRIX_SESSIONS_KEY = 'matrixSessions'; -const baseSessionsAtom = atomWithLocalStorage( - MATRIX_SESSIONS_KEY, - (key) => { - const defaultSessions: Sessions = []; - const sessions = getLocalStorageItem(key, defaultSessions); +// export const MATRIX_SESSIONS_KEY = 'matrixSessions'; +// const baseSessionsAtom = atomWithLocalStorage( +// MATRIX_SESSIONS_KEY, +// (key) => { +// const defaultSessions: Sessions = []; +// const sessions = getLocalStorageItem(key, defaultSessions); - // Before multi account support session was stored - // as multiple item in local storage. - // So we need these migration code. - const fallbackSession = getFallbackSession(); - if (fallbackSession) { - removeFallbackSession(); - sessions.push(fallbackSession); - setLocalStorageItem(key, sessions); - } - return sessions; - }, - (key, value) => { - setLocalStorageItem(key, value); - } -); +// // Before multi account support session was stored +// // as multiple item in local storage. +// // So we need these migration code. +// const fallbackSession = getFallbackSession(); +// if (fallbackSession) { +// removeFallbackSession(); +// sessions.push(fallbackSession); +// setLocalStorageItem(key, sessions); +// } +// return sessions; +// }, +// (key, value) => { +// setLocalStorageItem(key, value); +// } +// ); -export type SessionsAction = - | { - type: 'PUT'; - session: Session; - } - | { - type: 'DELETE'; - session: Session; - }; +// export type SessionsAction = +// | { +// type: 'PUT'; +// session: Session; +// } +// | { +// type: 'DELETE'; +// session: Session; +// }; -export const sessionsAtom = atom( - (get) => get(baseSessionsAtom), - (get, set, action) => { - if (action.type === 'PUT') { - const sessions = [...get(baseSessionsAtom)]; - const sessionIndex = sessions.findIndex( - (session) => session.userId === action.session.userId - ); - if (sessionIndex === -1) { - sessions.push(action.session); - } else { - sessions.splice(sessionIndex, 1, action.session); - } - set(baseSessionsAtom, sessions); - return; - } - if (action.type === 'DELETE') { - const sessions = get(baseSessionsAtom).filter( - (session) => session.userId !== action.session.userId - ); - set(baseSessionsAtom, sessions); - } - } -); +// export const sessionsAtom = atom( +// (get) => get(baseSessionsAtom), +// (get, set, action) => { +// if (action.type === 'PUT') { +// const sessions = [...get(baseSessionsAtom)]; +// const sessionIndex = sessions.findIndex( +// (session) => session.userId === action.session.userId +// ); +// if (sessionIndex === -1) { +// sessions.push(action.session); +// } else { +// sessions.splice(sessionIndex, 1, action.session); +// } +// set(baseSessionsAtom, sessions); +// return; +// } +// if (action.type === 'DELETE') { +// const sessions = get(baseSessionsAtom).filter( +// (session) => session.userId !== action.session.userId +// ); +// set(baseSessionsAtom, sessions); +// } +// } +// ); diff --git a/src/client/action/notifications.ts b/src/app/utils/notifications.ts similarity index 100% rename from src/client/action/notifications.ts rename to src/app/utils/notifications.ts diff --git a/src/client/action/auth.ts b/src/client/action/auth.ts deleted file mode 100644 index dbe9baac..00000000 --- a/src/client/action/auth.ts +++ /dev/null @@ -1,13 +0,0 @@ -import cons from '../state/cons'; - -export function updateLocalStore( - accessToken: string, - deviceId: string, - userId: string, - baseUrl: string -) { - localStorage.setItem(cons.secretKey.ACCESS_TOKEN, accessToken); - localStorage.setItem(cons.secretKey.DEVICE_ID, deviceId); - localStorage.setItem(cons.secretKey.USER_ID, userId); - localStorage.setItem(cons.secretKey.BASE_URL, baseUrl); -} diff --git a/src/client/action/navigation.js b/src/client/action/navigation.js deleted file mode 100644 index b7c5ae38..00000000 --- a/src/client/action/navigation.js +++ /dev/null @@ -1,70 +0,0 @@ -import appDispatcher from '../dispatcher'; -import cons from '../state/cons'; - - -export function openSpaceAddExisting(roomId, spaces = false) { - appDispatcher.dispatch({ - type: cons.actions.navigation.OPEN_SPACE_ADDEXISTING, - roomId, - spaces, - }); -} - - -export function openCreateRoom(isSpace = false, parentId = null) { - appDispatcher.dispatch({ - type: cons.actions.navigation.OPEN_CREATE_ROOM, - isSpace, - parentId, - }); -} - -export function openJoinAlias(term) { - appDispatcher.dispatch({ - type: cons.actions.navigation.OPEN_JOIN_ALIAS, - term, - }); -} - -export function openInviteUser(roomId, searchTerm) { - appDispatcher.dispatch({ - type: cons.actions.navigation.OPEN_INVITE_USER, - roomId, - searchTerm, - }); -} - -export function openProfileViewer(userId, roomId) { - appDispatcher.dispatch({ - type: cons.actions.navigation.OPEN_PROFILE_VIEWER, - userId, - roomId, - }); -} - -export function openSearch(term) { - appDispatcher.dispatch({ - type: cons.actions.navigation.OPEN_SEARCH, - term, - }); -} - -export function openReusableContextMenu(placement, cords, render, afterClose) { - appDispatcher.dispatch({ - type: cons.actions.navigation.OPEN_REUSABLE_CONTEXT_MENU, - placement, - cords, - render, - afterClose, - }); -} - -export function openReusableDialog(title, render, afterClose) { - appDispatcher.dispatch({ - type: cons.actions.navigation.OPEN_REUSABLE_DIALOG, - title, - render, - afterClose, - }); -} - diff --git a/src/client/action/room.js b/src/client/action/room.js deleted file mode 100644 index e39aeed8..00000000 --- a/src/client/action/room.js +++ /dev/null @@ -1,279 +0,0 @@ -import { EventTimeline } from 'matrix-js-sdk'; -import { getIdServer } from '../../util/matrixUtil'; - -/** - * https://github.com/matrix-org/matrix-react-sdk/blob/1e6c6e9d800890c732d60429449bc280de01a647/src/Rooms.js#L73 - * @param {MatrixClient} mx Matrix client - * @param {string} roomId Id of room to add - * @param {string} userId User id to which dm || undefined to remove - * @returns {Promise} A promise - */ -function addRoomToMDirect(mx, roomId, userId) { - const mDirectsEvent = mx.getAccountData('m.direct'); - let userIdToRoomIds = {}; - - if (typeof mDirectsEvent !== 'undefined') userIdToRoomIds = structuredClone(mDirectsEvent.getContent()); - - // remove it from the lists of any others users - // (it can only be a DM room for one person) - Object.keys(userIdToRoomIds).forEach((thisUserId) => { - const roomIds = userIdToRoomIds[thisUserId]; - - if (thisUserId !== userId) { - const indexOfRoomId = roomIds.indexOf(roomId); - if (indexOfRoomId > -1) { - roomIds.splice(indexOfRoomId, 1); - } - } - }); - - // now add it, if it's not already there - if (userId) { - const roomIds = userIdToRoomIds[userId] || []; - if (roomIds.indexOf(roomId) === -1) { - roomIds.push(roomId); - } - userIdToRoomIds[userId] = roomIds; - } - - return mx.setAccountData('m.direct', userIdToRoomIds); -} - -/** - * Given a room, estimate which of its members is likely to - * be the target if the room were a DM room and return that user. - * https://github.com/matrix-org/matrix-react-sdk/blob/1e6c6e9d800890c732d60429449bc280de01a647/src/Rooms.js#L117 - * - * @param {Object} room Target room - * @param {string} myUserId User ID of the current user - * @returns {string} User ID of the user that the room is probably a DM with - */ -function guessDMRoomTargetId(room, myUserId) { - let oldestMemberTs; - let oldestMember; - - // Pick the joined user who's been here longest (and isn't us), - room.getJoinedMembers().forEach((member) => { - if (member.userId === myUserId) return; - - if (typeof oldestMemberTs === 'undefined' || (member.events.member && member.events.member.getTs() < oldestMemberTs)) { - oldestMember = member; - oldestMemberTs = member.events.member.getTs(); - } - }); - if (oldestMember) return oldestMember.userId; - - // if there are no joined members other than us, use the oldest member - room.getLiveTimeline().getState(EventTimeline.FORWARDS)?.getMembers().forEach((member) => { - if (member.userId === myUserId) return; - - if (typeof oldestMemberTs === 'undefined' || (member.events.member && member.events.member.getTs() < oldestMemberTs)) { - oldestMember = member; - oldestMemberTs = member.events.member.getTs(); - } - }); - - if (typeof oldestMember === 'undefined') return myUserId; - return oldestMember.userId; -} - -function convertToDm(mx, roomId) { - const room = mx.getRoom(roomId); - return addRoomToMDirect(mx, roomId, guessDMRoomTargetId(room, mx.getUserId())); -} - -function convertToRoom(mx, roomId) { - return addRoomToMDirect(mx, roomId, undefined); -} - -/** - * @param {MatrixClient} mx - * @param {string} roomId - * @param {boolean} isDM - * @param {string[]} via - */ -async function join(mx, roomIdOrAlias, isDM = false, via = undefined) { - try { - const resultRoom = await mx.joinRoom(roomIdOrAlias, { viaServers: via }); - - if (isDM) { - const targetUserId = guessDMRoomTargetId(mx.getRoom(resultRoom.roomId), mx.getUserId()); - await addRoomToMDirect(mx, resultRoom.roomId, targetUserId); - } - return resultRoom.roomId; - } catch (e) { - throw new Error(e); - } -} - -async function create(mx, options, isDM = false) { - try { - const result = await mx.createRoom(options); - if (isDM && typeof options.invite?.[0] === 'string') { - await addRoomToMDirect(mx, result.room_id, options.invite[0]); - } - return result; - } catch (e) { - const errcodes = ['M_UNKNOWN', 'M_BAD_JSON', 'M_ROOM_IN_USE', 'M_INVALID_ROOM_STATE', 'M_UNSUPPORTED_ROOM_VERSION']; - if (errcodes.includes(e.errcode)) { - throw new Error(e); - } - throw new Error('Something went wrong!'); - } -} - -async function createDM(mx, userIdOrIds, isEncrypted = true) { - const options = { - is_direct: true, - invite: Array.isArray(userIdOrIds) ? userIdOrIds : [userIdOrIds], - visibility: 'private', - preset: 'trusted_private_chat', - initial_state: [], - }; - if (isEncrypted) { - options.initial_state.push({ - type: 'm.room.encryption', - state_key: '', - content: { - algorithm: 'm.megolm.v1.aes-sha2', - }, - }); - } - - const result = await create(mx, options, true); - return result; -} - -async function createRoom(mx, opts) { - // joinRule: 'public' | 'invite' | 'restricted' - const { name, topic, joinRule } = opts; - const alias = opts.alias ?? undefined; - const parentId = opts.parentId ?? undefined; - const isSpace = opts.isSpace ?? false; - const isEncrypted = opts.isEncrypted ?? false; - const powerLevel = opts.powerLevel ?? undefined; - const blockFederation = opts.blockFederation ?? false; - - const visibility = joinRule === 'public' ? 'public' : 'private'; - const options = { - creation_content: undefined, - name, - topic, - visibility, - room_alias_name: alias, - initial_state: [], - power_level_content_override: undefined, - }; - if (isSpace) { - options.creation_content = { type: 'm.space' }; - } - if (blockFederation) { - options.creation_content = { 'm.federate': false }; - } - if (isEncrypted) { - options.initial_state.push({ - type: 'm.room.encryption', - state_key: '', - content: { - algorithm: 'm.megolm.v1.aes-sha2', - }, - }); - } - if (powerLevel) { - options.power_level_content_override = { - users: { - [mx.getUserId()]: powerLevel, - }, - }; - } - if (parentId) { - options.initial_state.push({ - type: 'm.space.parent', - state_key: parentId, - content: { - canonical: true, - via: [getIdServer(mx.getUserId())], - }, - }); - } - if (parentId && joinRule === 'restricted') { - const caps = await mx.getCapabilities(); - if (caps['m.room_versions'].available?.['9'] !== 'stable') { - throw new Error("ERROR: The server doesn't support restricted rooms"); - } - if (Number(caps['m.room_versions'].default) < 9) { - options.room_version = '9'; - } - options.initial_state.push({ - type: 'm.room.join_rules', - content: { - join_rule: 'restricted', - allow: [{ - type: 'm.room_membership', - room_id: parentId, - }], - }, - }); - } - - const result = await create(mx, options); - - if (parentId) { - await mx.sendStateEvent(parentId, 'm.space.child', { - auto_join: false, - suggested: false, - via: [getIdServer(mx.getUserId())], - }, result.room_id); - } - - return result; -} - -async function ignore(mx, userIds) { - - let ignoredUsers = mx.getIgnoredUsers().concat(userIds); - ignoredUsers = [...new Set(ignoredUsers)]; - await mx.setIgnoredUsers(ignoredUsers); -} - -async function unignore(mx, userIds) { - const ignoredUsers = mx.getIgnoredUsers(); - await mx.setIgnoredUsers(ignoredUsers.filter((id) => !userIds.includes(id))); -} - -async function setPowerLevel(mx, roomId, userId, powerLevel) { - const result = await mx.setPowerLevel(roomId, userId, powerLevel); - return result; -} - -async function setMyRoomNick(mx, roomId, nick) { - const room = mx.getRoom(roomId); - const mEvent = room.getLiveTimeline().getState(EventTimeline.FORWARDS).getStateEvents('m.room.member', mx.getUserId()); - const content = mEvent?.getContent(); - if (!content) return; - await mx.sendStateEvent(roomId, 'm.room.member', { - ...content, - displayname: nick, - }, mx.getUserId()); -} - -async function setMyRoomAvatar(mx, roomId, mxc) { - const room = mx.getRoom(roomId); - const mEvent = room.getLiveTimeline().getState(EventTimeline.FORWARDS).getStateEvents('m.room.member', mx.getUserId()); - const content = mEvent?.getContent(); - if (!content) return; - await mx.sendStateEvent(roomId, 'm.room.member', { - ...content, - avatar_url: mxc, - }, mx.getUserId()); -} - -export { - convertToDm, - convertToRoom, - join, - createDM, createRoom, - ignore, unignore, - setPowerLevel, - setMyRoomNick, setMyRoomAvatar, -}; diff --git a/src/client/dispatcher.js b/src/client/dispatcher.js deleted file mode 100644 index 12a48721..00000000 --- a/src/client/dispatcher.js +++ /dev/null @@ -1,4 +0,0 @@ -import { Dispatcher } from 'flux'; - -const appDispatcher = new Dispatcher(); -export default appDispatcher; diff --git a/src/client/initMatrix.ts b/src/client/initMatrix.ts index b80a080f..487c3f13 100644 --- a/src/client/initMatrix.ts +++ b/src/client/initMatrix.ts @@ -1,6 +1,6 @@ import { createClient, MatrixClient, IndexedDBStore, IndexedDBCryptoStore } from 'matrix-js-sdk'; -import { cryptoCallbacks } from './state/secretStorageKeys'; +import { cryptoCallbacks } from './secretStorageKeys'; import { clearNavToActivePathStore } from '../app/state/navToActivePath'; type Session = { diff --git a/src/client/state/secretStorageKeys.js b/src/client/secretStorageKeys.js similarity index 83% rename from src/client/state/secretStorageKeys.js rename to src/client/secretStorageKeys.js index 7439e7a5..78c0cb4c 100644 --- a/src/client/state/secretStorageKeys.js +++ b/src/client/secretStorageKeys.js @@ -7,18 +7,14 @@ export function storePrivateKey(keyId, privateKey) { secretStorageKeys.set(keyId, privateKey); } -export function hasPrivateKey(keyId) { +function hasPrivateKey(keyId) { return secretStorageKeys.get(keyId) instanceof Uint8Array; } -export function getPrivateKey(keyId) { +function getPrivateKey(keyId) { return secretStorageKeys.get(keyId); } -export function deletePrivateKey(keyId) { - delete secretStorageKeys.delete(keyId); -} - export function clearSecretStorageKeys() { secretStorageKeys.clear(); } diff --git a/src/client/state/auth.ts b/src/client/state/auth.ts deleted file mode 100644 index 9536a927..00000000 --- a/src/client/state/auth.ts +++ /dev/null @@ -1,12 +0,0 @@ -import cons from './cons'; - -const isAuthenticated = () => localStorage.getItem(cons.secretKey.ACCESS_TOKEN) !== null; - -const getSecret = () => ({ - accessToken: localStorage.getItem(cons.secretKey.ACCESS_TOKEN), - deviceId: localStorage.getItem(cons.secretKey.DEVICE_ID), - userId: localStorage.getItem(cons.secretKey.USER_ID), - baseUrl: localStorage.getItem(cons.secretKey.BASE_URL), -}); - -export { isAuthenticated, getSecret }; diff --git a/src/client/state/cons.js b/src/client/state/cons.js deleted file mode 100644 index 6f4fabe4..00000000 --- a/src/client/state/cons.js +++ /dev/null @@ -1,42 +0,0 @@ -const cons = { - version: '4.9.1', - secretKey: { - ACCESS_TOKEN: 'cinny_access_token', - DEVICE_ID: 'cinny_device_id', - USER_ID: 'cinny_user_id', - BASE_URL: 'cinny_hs_base_url', - }, - status: { - PRE_FLIGHT: 'pre-flight', - IN_FLIGHT: 'in-flight', - SUCCESS: 'success', - ERROR: 'error', - }, - actions: { - navigation: { - OPEN_SPACE_ADDEXISTING: 'OPEN_SPACE_ADDEXISTING', - OPEN_CREATE_ROOM: 'OPEN_CREATE_ROOM', - OPEN_JOIN_ALIAS: 'OPEN_JOIN_ALIAS', - OPEN_INVITE_USER: 'OPEN_INVITE_USER', - OPEN_PROFILE_VIEWER: 'OPEN_PROFILE_VIEWER', - OPEN_SEARCH: 'OPEN_SEARCH', - OPEN_REUSABLE_CONTEXT_MENU: 'OPEN_REUSABLE_CONTEXT_MENU', - OPEN_REUSABLE_DIALOG: 'OPEN_REUSABLE_DIALOG', - }, - }, - events: { - navigation: { - SPACE_ADDEXISTING_OPENED: 'SPACE_ADDEXISTING_OPENED', - CREATE_ROOM_OPENED: 'CREATE_ROOM_OPENED', - JOIN_ALIAS_OPENED: 'JOIN_ALIAS_OPENED', - INVITE_USER_OPENED: 'INVITE_USER_OPENED', - SEARCH_OPENED: 'SEARCH_OPENED', - REUSABLE_CONTEXT_MENU_OPENED: 'REUSABLE_CONTEXT_MENU_OPENED', - REUSABLE_DIALOG_OPENED: 'REUSABLE_DIALOG_OPENED', - }, - }, -}; - -Object.freeze(cons); - -export default cons; diff --git a/src/client/state/navigation.js b/src/client/state/navigation.js deleted file mode 100644 index 743d0199..00000000 --- a/src/client/state/navigation.js +++ /dev/null @@ -1,75 +0,0 @@ -import EventEmitter from 'events'; -import appDispatcher from '../dispatcher'; -import cons from './cons'; - -class Navigation extends EventEmitter { - constructor() { - super(); - this.rawModelStack = []; - } - - get isRawModalVisible() { - return this.rawModelStack.length > 0; - } - - setIsRawModalVisible(visible) { - if (visible) this.rawModelStack.push(true); - else this.rawModelStack.pop(); - } - - navigate(action) { - const actions = { - [cons.actions.navigation.OPEN_SPACE_ADDEXISTING]: () => { - this.emit(cons.events.navigation.SPACE_ADDEXISTING_OPENED, action.roomId, action.spaces); - }, - [cons.actions.navigation.OPEN_CREATE_ROOM]: () => { - this.emit( - cons.events.navigation.CREATE_ROOM_OPENED, - action.isSpace, - action.parentId, - ); - }, - [cons.actions.navigation.OPEN_JOIN_ALIAS]: () => { - this.emit( - cons.events.navigation.JOIN_ALIAS_OPENED, - action.term, - ); - }, - [cons.actions.navigation.OPEN_INVITE_USER]: () => { - this.emit(cons.events.navigation.INVITE_USER_OPENED, action.roomId, action.searchTerm); - }, - [cons.actions.navigation.OPEN_PROFILE_VIEWER]: () => { - this.emit(cons.events.navigation.PROFILE_VIEWER_OPENED, action.userId, action.roomId); - }, - [cons.actions.navigation.OPEN_SEARCH]: () => { - this.emit( - cons.events.navigation.SEARCH_OPENED, - action.term, - ); - }, - [cons.actions.navigation.OPEN_REUSABLE_CONTEXT_MENU]: () => { - this.emit( - cons.events.navigation.REUSABLE_CONTEXT_MENU_OPENED, - action.placement, - action.cords, - action.render, - action.afterClose, - ); - }, - [cons.actions.navigation.OPEN_REUSABLE_DIALOG]: () => { - this.emit( - cons.events.navigation.REUSABLE_DIALOG_OPENED, - action.title, - action.render, - action.afterClose, - ); - }, - }; - actions[action.type]?.(); - } -} - -const navigation = new Navigation(); -appDispatcher.register(navigation.navigate.bind(navigation)); - -export default navigation; diff --git a/src/index.css b/src/index.css new file mode 100644 index 00000000..ca28536d --- /dev/null +++ b/src/index.css @@ -0,0 +1,131 @@ +@font-face { + font-family: Twemoji; + src: url('../public/font/Twemoji.Mozilla.v15.1.0.woff2'), + url('../public/font/Twemoji.Mozilla.v15.1.0.ttf'); + font-display: swap; +} + +:root { + --tc-link: hsl(213deg 100% 45%); + + /* user mxid colors */ + --mx-uc-1: hsl(208, 100%, 45%); + --mx-uc-2: hsl(302, 100%, 30%); + --mx-uc-3: hsl(163, 100%, 30%); + --mx-uc-4: hsl(343, 100%, 45%); + --mx-uc-5: hsl(24, 100%, 45%); + --mx-uc-6: hsl(181, 100%, 30%); + --mx-uc-7: hsl(242, 100%, 45%); + --mx-uc-8: hsl(94, 100%, 35%); + + --font-emoji: 'Twemoji_DISABLED'; + --font-secondary: 'InterVariable', var(--font-emoji), sans-serif; +} + +.dark-theme, +.butter-theme { + --tc-link: hsl(213deg 100% 80%); + + --mx-uc-1: hsl(208, 100%, 75%); + --mx-uc-2: hsl(301, 100%, 80%); + --mx-uc-3: hsl(163, 100%, 70%); + --mx-uc-4: hsl(343, 100%, 75%); + --mx-uc-5: hsl(24, 100%, 70%); + --mx-uc-6: hsl(181, 100%, 60%); + --mx-uc-7: hsl(243, 100%, 80%); + --mx-uc-8: hsl(94, 100%, 80%); + + --font-secondary: 'InterVariable', var(--font-emoji), sans-serif; +} + +html { + height: 100%; + overflow: hidden; +} + +body { + margin: 0; + padding: 0; + height: 100%; + font-family: var(--font-secondary); + font-size: 16px; + font-weight: 400; + + /*Why font-variant-ligatures => https://github.com/rsms/inter/issues/222 */ + font-variant-ligatures: no-contextual; +} +#root { + width: 100%; + height: 100%; + display: flex; + flex-direction: column; +} + +*, +*::before, +*::after { + box-sizing: border-box; + -webkit-tap-highlight-color: rgba(0, 0, 0, 0); + -webkit-tap-highlight-color: transparent; +} +a { + color: var(--tc-link); + text-decoration: none; +} +a:hover { + text-decoration: underline; +} + +[data-mx-spoiler][aria-pressed='true'] a { + color: transparent; + pointer-events: none; +} + +b { + font-weight: 500; +} +label { + margin: 0; + padding: 0; +} +button, +textarea { + margin: 0; + padding: 0; + background-color: transparent; + color: inherit; + font-family: inherit; + font-size: inherit; + font-weight: inherit; + line-height: inherit; + letter-spacing: inherit; + border: none; +} +button { + max-width: 100%; + text-transform: none; + text-align: inherit; + overflow: visible; + -webkit-appearance: button; +} +textarea, +input, +input[type], +input[type='text'], +input[type='username'], +input[type='password'], +input[type='email'], +input[type='checkbox'] { + -webkit-appearance: none; + -moz-appearance: none; + appearance: none; +} + +textarea { + color: inherit; + word-spacing: inherit; +} + +audio:not([controls]) { + display: none !important; +} diff --git a/src/index.scss b/src/index.scss deleted file mode 100644 index 14bf4749..00000000 --- a/src/index.scss +++ /dev/null @@ -1,522 +0,0 @@ -@use './app/partials/screen'; - -@font-face { - font-family: Twemoji; - src: url('../public/font/Twemoji.Mozilla.v15.1.0.woff2'), - url('../public/font/Twemoji.Mozilla.v15.1.0.ttf'); - font-display: swap; -} - -:root { - /* background color | --bg-[background type]: value */ - --bg-surface: #ffffff; - --bg-surface-transparent: #ffffff00; - --bg-surface-low: #f6f6f6; - --bg-surface-low-transparent: #f6f6f600; - --bg-surface-extra-low: #f6f6f6; - --bg-surface-extra-low-transparent: #f6f6f600; - --bg-surface-hover: rgba(0, 0, 0, 3%); - --bg-surface-active: rgba(0, 0, 0, 5%); - --bg-surface-border: rgba(0, 0, 0, 6%); - - --bg-primary: rgb(18, 69, 168); - --bg-primary-hover: rgba(18, 69, 168, 80%); - --bg-primary-active: rgba(18, 69, 168, 70%); - --bg-primary-border: rgba(18, 69, 168, 38%); - - --bg-positive: rgb(1, 115, 67); - --bg-positive-hover: rgba(1, 115, 67, 8%); - --bg-positive-active: rgba(1, 115, 67, 15%); - --bg-positive-border: rgba(1, 115, 67, 40%); - - --bg-caution: rgb(134, 67, 0); - --bg-caution-hover: rgba(134, 67, 0, 8%); - --bg-caution-active: rgba(134, 67, 0, 15%); - --bg-caution-border: rgba(134, 67, 0, 40%); - - --bg-danger: rgb(157, 15, 15); - --bg-danger-hover: rgba(157, 15, 15, 5%); - --bg-danger-active: rgba(157, 15, 15, 10%); - --bg-danger-border: rgba(157, 15, 15, 20%); - - --bg-tooltip: #353535; - --bg-badge: #989898; - --bg-ping: hsla(137deg, 100%, 68%, 40%); - --bg-ping-hover: hsla(137deg, 100%, 68%, 50%); - --bg-divider: hsla(0, 0%, 0%, 0.1); - - /* text color | --tc-[background type]-[priority]: value */ - --tc-surface-high: #000000; - --tc-surface-normal: rgba(0, 0, 0, 78%); - --tc-surface-normal-low: rgba(0, 0, 0, 60%); - --tc-surface-low: rgba(0, 0, 0, 48%); - - --tc-primary-high: #ffffff; - --tc-primary-normal: rgba(255, 255, 255, 68%); - --tc-primary-low: rgba(255, 255, 255, 40%); - - --tc-positive-high: var(--bg-positive); - --tc-positive-normal: rgb(1, 115, 67, 80%); - --tc-positive-low: rgb(1, 115, 67, 60%); - - --tc-caution-high: var(--bg-caution); - --tc-caution-normal: rgb(134, 67, 0, 80%); - --tc-caution-low: rgb(134, 67, 0, 60%); - - --tc-danger-high: var(--bg-danger); - --tc-danger-normal: rgba(157, 15, 15, 88%); - --tc-danger-low: rgba(157, 15, 15, 60%); - - --tc-code: #e62498; - --tc-link: hsl(213deg 100% 45%); - --tc-tooltip: white; - --tc-badge: white; - - /* system icons | --ic-[background type]-[priority]: value */ - --ic-surface-high: #272727; - --ic-surface-normal: #626262; - --ic-surface-low: #7c7c7c; - --ic-primary-high: #ffffff; - --ic-primary-normal: #ffffff; - --ic-positive-high: rgba(1, 115, 67); - --ic-positive-normal: rgba(1, 115, 67, 80%); - --ic-caution-high: rgba(134, 67, 0); - --ic-caution-normal: rgba(134, 67, 0, 80%); - --ic-danger-high: rgba(157, 15, 15); - --ic-danger-normal: rgba(157, 15, 15, 0.7); - - /* user mxid colors */ - --mx-uc-1: hsl(208, 100%, 45%); - --mx-uc-2: hsl(302, 100%, 30%); - --mx-uc-3: hsl(163, 100%, 30%); - --mx-uc-4: hsl(343, 100%, 45%); - --mx-uc-5: hsl(24, 100%, 45%); - --mx-uc-6: hsl(181, 100%, 30%); - --mx-uc-7: hsl(242, 100%, 45%); - --mx-uc-8: hsl(94, 100%, 35%); - - /* system icon size | -ic-[size]: value */ - --ic-large: 38px; - --ic-normal: 24px; - --ic-small: 20px; - --ic-extra-small: 18px; - - /* avatar size */ - --av-large: 80px; - --av-normal: 42px; - --av-small: 36px; - --av-extra-small: 24px; - - /* shadow and overlay */ - --bg-overlay: rgba(0, 0, 0, 20%); - --bg-overlay-low: rgba(0, 0, 0, 50%); - - --bs-popup: 0 0 16px rgba(0, 0, 0, 10%); - - --bs-surface-border: inset 0 0 0 1px var(--bg-surface-border); - --bs-surface-outline: 0 0 0 2px var(--bg-surface-border); - - --bs-primary-border: inset 0 0 0 1px var(--bg-primary-border); - --bs-primary-outline: 0 0 0 2px var(--bg-primary-border); - - --bs-positive-border: inset 0 0 0 1px var(--bg-positive-border); - --bs-positive-outline: 0 0 0 2px var(--bg-positive-border); - - --bs-caution-border: inset 0 0 0 1px var(--bg-caution-border); - --bs-caution-outline: 0 0 0 2px var(--bg-caution-border); - - --bs-danger-border: inset 0 0 0 1px var(--bg-danger-border); - --bs-danger-outline: 0 0 0 2px var(--bg-danger-border); - - /* border */ - --bo-radius: 8px; - - /* font styles: font-size, letter-spacing, line-hight */ - --fs-h1: 36px; - --ls-h1: -1.5px; - --lh-h1: 38px; - - --fs-h2: 24px; - --ls-h2: -0.5px; - --lh-h2: 30px; - - --fs-s1: 18px; - --ls-s1: -0.2px; - --lh-s1: 24px; - - --fs-b1: 16px; - --ls-b1: 0.1px; - --lh-b1: 24px; - - --fs-b2: 14px; - --ls-b2: 0.2px; - --lh-b2: 20px; - - --fs-b3: 12px; - --ls-b3: 0px; - --lh-b3: 16px; - - /* font-weight */ - --fw-light: 300; - --fw-normal: 420; - --fw-medium: 500; - --fw-bold: 700; - - /* spacing | --sp-[space]: value */ - --sp-none: 0px; - --sp-ultra-tight: 4px; - --sp-extra-tight: 8px; - --sp-tight: 12px; - --sp-normal: 16px; - --sp-loose: 20px; - --sp-extra-loose: 32px; - - /* other */ - --border-width: 1px; - --header-height: 54px; - --navigation-sidebar-width: calc(64px + var(--border-width)); - --navigation-drawer-width: calc(280px + var(--border-width)); - --navigation-width: calc(var(--navigation-sidebar-width) + var(--navigation-drawer-width)); - --people-drawer-width: calc(268px - var(--border-width)); - - --popup-window-drawer-width: 280px; - - @include screen.smallerThan(tabletBreakpoint) { - --navigation-drawer-width: calc(240px + var(--border-width)); - --people-drawer-width: calc(256px - var(--border-width)); - --popup-window-drawer-width: 240px; - } - - /* transition curves */ - --fluid-push: cubic-bezier(0, 0.8, 0.67, 0.97); - --fluid-slide-down: cubic-bezier(0.02, 0.82, 0.4, 0.96); - --fluid-slide-up: cubic-bezier(0.13, 0.56, 0.25, 0.99); - - --font-emoji: 'Twemoji_DISABLED'; - --font-primary: 'InterVariable', var(--font-emoji), sans-serif; - --font-secondary: 'InterVariable', var(--font-emoji), sans-serif; -} - -.silver-theme { - /* background color | --bg-[background type]: value */ - --bg-surface: hsl(0, 0%, 95%); - --bg-surface-transparent: hsla(0, 0%, 95%, 0); - --bg-surface-low: hsl(0, 0%, 91%); - --bg-surface-low-transparent: hsla(0, 0%, 91%, 0); - --bg-surface-extra-low: hsl(0, 0%, 91%); - --bg-surface-extra-low-transparent: hsla(0, 0%, 91%, 0); -} - -.dark-theme, -.butter-theme { - /* background color | --bg-[background type]: value */ - --bg-surface: #262626; - --bg-surface-transparent: #26262600; - --bg-surface-low: #1a1a1a; - --bg-surface-low-transparent: #1a1a1a00; - --bg-surface-extra-low: #1a1a1a; - --bg-surface-extra-low-transparent: #1a1a1a00; - --bg-surface-hover: #333333; - --bg-surface-active: #404040; - --bg-surface-border: #404040; - - --bg-primary: rgb(189, 182, 236); - --bg-primary-hover: rgba(189, 182, 236, 0.8); - --bg-primary-active: rgba(189, 182, 236, 70%); - --bg-primary-border: rgba(189, 182, 236, 38%); - - --bg-positive: rgb(133, 224, 186); - --bg-positive-hover: rgba(133, 224, 186, 8%); - --bg-positive-active: rgba(133, 224, 186, 15%); - --bg-positive-border: rgba(133, 224, 186, 40%); - - --bg-caution: rgb(227, 186, 145); - --bg-caution-hover: rgba(227, 186, 145, 8%); - --bg-caution-active: rgba(227, 186, 145, 15%); - --bg-caution-border: rgba(227, 186, 145, 40%); - - --bg-danger: rgb(230, 157, 157); - --bg-danger-hover: rgba(230, 157, 157, 5%); - --bg-danger-active: rgba(230, 157, 157, 10%); - --bg-danger-border: rgba(230, 157, 157, 20%); - - --bg-tooltip: #000; - --bg-badge: hsl(0, 0%, 75%); - --bg-ping: hsla(137deg, 100%, 38%, 40%); - --bg-ping-hover: hsla(137deg, 100%, 38%, 50%); - --bg-divider: hsla(0, 0%, 100%, 0.1); - - /* text color | --tc-[background type]-[priority]: value */ - --tc-surface-high: rgba(255, 255, 255, 98%); - --tc-surface-normal: rgba(255, 255, 255, 94%); - --tc-surface-normal-low: rgba(255, 255, 255, 60%); - --tc-surface-low: rgba(255, 255, 255, 58%); - - --tc-primary-high: rgb(44, 40, 67); - --tc-primary-normal: rgba(44, 40, 67, 0.68); - --tc-primary-low: rgba(44, 40, 67, 0.4); - - --tc-positive-high: var(--bg-positive); - --tc-positive-normal: rgb(133, 224, 186, 80%); - --tc-positive-low: rgb(133, 224, 186, 60%); - - --tc-caution-high: var(--bg-caution); - --tc-caution-normal: rgb(227, 186, 145, 80%); - --tc-caution-low: rgb(227, 186, 145, 60%); - - --tc-danger-high: var(--bg-danger); - --tc-danger-normal: rgba(230, 157, 157, 88%); - --tc-danger-low: rgba(230, 157, 157, 60%); - - --tc-code: #e565b1; - --tc-link: hsl(213deg 100% 80%); - --tc-badge: black; - - /* system icons | --ic-[background type]-[priority]: value */ - --ic-surface-high: rgb(255, 255, 255); - --ic-surface-normal: rgba(255, 255, 255, 84%); - --ic-surface-low: rgba(255, 255, 255, 64%); - --ic-primary-high: var(--tc-primary-high); - --ic-primary-normal: var(--tc-primary-high); - --ic-primary-low: var(--tc-primary-high); - --ic-positive-high: rgba(133, 224, 186); - --ic-positive-normal: rgba(133, 224, 186, 80%); - --ic-caution-high: rgba(227, 186, 145); - --ic-caution-normal: rgba(227, 186, 145, 80%); - --ic-danger-high: rgba(230, 157, 157); - --ic-danger-normal: rgba(230, 157, 157, 0.7); - - --mx-uc-1: hsl(208, 100%, 75%); - --mx-uc-2: hsl(301, 100%, 80%); - --mx-uc-3: hsl(163, 100%, 70%); - --mx-uc-4: hsl(343, 100%, 75%); - --mx-uc-5: hsl(24, 100%, 70%); - --mx-uc-6: hsl(181, 100%, 60%); - --mx-uc-7: hsl(243, 100%, 80%); - --mx-uc-8: hsl(94, 100%, 80%); - - /* shadow and overlay */ - --bg-overlay: rgba(0, 0, 0, 60%); - --bg-overlay-low: rgba(0, 0, 0, 80%); - - --bs-popup: 0 0 16px rgba(0, 0, 0, 25%); - - --bs-surface-border: inset 0 0 0 1px var(--bg-surface-border); - --bs-surface-outline: 0 0 0 2px var(--bg-surface-border); - - --bs-primary-border: inset 0 0 0 1px var(--bg-primary-border); - --bs-primary-outline: 0 0 0 2px var(--bg-primary-border); - - /* font styles: font-size, letter-spacing, line-hight */ - --fs-h1: 35.6px; - - --fs-h2: 23.6px; - - --fs-s1: 17.6px; - - --fs-b1: 14.6px; - --ls-b1: 0.14px; - - --fs-b2: 13.2px; - - --fs-b3: 11.2px; - - /* override normal font weight for dark mode */ - --fw-normal: 350; - --fw-medium: 450; - --fw-bold: 550; - - --font-secondary: 'InterVariable', var(--font-emoji), sans-serif; -} - -.butter-theme { - /* background color | --bg-[background type]: value */ - --bg-surface: #262621; - --bg-surface-transparent: #26262100; - --bg-surface-low: #1a1916; - --bg-surface-low-transparent: #1a191600; - --bg-surface-extra-low: #1a1916; - --bg-surface-extra-low-transparent: #1a1916; - --bg-surface-hover: #33322c; - --bg-surface-active: #403f38; - --bg-surface-border: #403f38; - - --bg-badge: #c4c1ab; - - /* text color | --tc-[background type]-[priority]: value */ - --tc-surface-high: rgb(255, 251, 222); - --tc-surface-normal: rgba(255, 251, 222, 94%); - --tc-surface-normal-low: rgba(255, 251, 222, 60%); - --tc-surface-low: rgba(255, 251, 222, 58%); - - /* system icons | --ic-[background type]-[priority]: value */ - --ic-surface-high: rgb(255, 251, 222); - --ic-surface-normal: rgba(255, 251, 222, 84%); - --ic-surface-low: rgba(255, 251, 222, 64%); -} - -.font-primary { - font-family: var(--font-primary); - - /* override font styles for primary font */ - --fs-h1: 36px; - --ls-h1: -1.5px; - --lh-h1: 38px; - - --fs-h2: 24px; - --ls-h2: -0.5px; - --lh-h2: 30px; - - --fs-s1: 18px; - --ls-s1: -0.2px; - --lh-s1: 24px; - - --fs-b1: 16px; - --ls-b1: 0.1px; - --lh-b1: 24px; - - --fs-b2: 14px; - --ls-b2: 0.2px; - --lh-b2: 20px; - - --fs-b3: 12px; - --ls-b3: 0px; - --lh-b3: 16px; - - --fw-light: 300; - --fw-normal: 400; - --fw-medium: 500; - --fw-bold: 600; -} - -html { - height: 100%; - overflow: hidden; -} - -body { - margin: 0; - padding: 0; - height: 100%; - font-family: var(--font-secondary); - font-size: 16px; - font-weight: var(--fw-normal); - background-color: var(--bg-surface-low); - - /*Why font-variant-ligatures => https://github.com/rsms/inter/issues/222 */ - font-variant-ligatures: no-contextual; -} -#root { - width: 100%; - height: 100%; - display: flex; - flex-direction: column; -} - -*, -*::before, -*::after { - box-sizing: border-box; - -webkit-tap-highlight-color: rgba(0, 0, 0, 0); - -webkit-tap-highlight-color: transparent; -} -a { - color: var(--tc-link); - text-decoration: none; - &:hover { - text-decoration: underline; - } -} - -[data-mx-spoiler][aria-pressed='true'] a { - color: transparent; - pointer-events: none; -} - -b { - font-weight: var(--fw-medium); -} -label { - margin: 0; - padding: 0; -} -button, -textarea { - margin: 0; - padding: 0; - background-color: transparent; - color: inherit; - font-family: inherit; - font-size: inherit; - font-weight: inherit; - line-height: inherit; - letter-spacing: inherit; - border: none; -} -button { - max-width: 100%; - text-transform: none; - text-align: inherit; - overflow: visible; - -webkit-appearance: button; -} -textarea, -input, -input[type], -input[type='text'], -input[type='username'], -input[type='password'], -input[type='email'], -input[type='checkbox'] { - -webkit-appearance: none; - -moz-appearance: none; - appearance: none; -} -input[type='checkbox'] { - margin: 0; - padding: 0; - width: 20px; - height: 20px; - border-radius: calc(var(--bo-radius) / 2); - box-shadow: var(--bs-primary-border); - background-color: var(--bg-surface); - cursor: pointer; - @extend .flex--center; - - &:checked { - background-color: var(--bg-primary); - &::before { - content: ''; - display: inline-block; - width: 12px; - height: 6px; - border: 6px solid white; - border-width: 0 0 3px 3px; - transform: rotateZ(-45deg) translate(1px, -1px); - } - } -} - -textarea { - color: inherit; - word-spacing: inherit; -} -.noselect { - -webkit-touch-callout: none; /* iOS Safari */ - -webkit-user-select: none; /* Safari */ - -khtml-user-select: none; /* Konqueror HTML */ - -moz-user-select: none; /* Old versions of Firefox */ - -ms-user-select: none; /* Internet Explorer/Edge */ - user-select: none; /* Non-prefixed version, currently - supported by Chrome, Edge, Opera and Firefox */ -} - -audio:not([controls]) { - display: none !important; -} - -.flex--center { - display: flex; - justify-content: center; - align-items: center; -} diff --git a/src/index.tsx b/src/index.tsx index 402a4c1b..ddfd30b4 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -8,7 +8,7 @@ import { configClass, varsClass } from 'folds'; enableMapSet(); -import './index.scss'; +import './index.css'; import { trimTrailingSlash } from './app/utils/common'; import App from './app/pages/App'; diff --git a/src/util/AsyncSearch.js b/src/util/AsyncSearch.js deleted file mode 100644 index d0a2130e..00000000 --- a/src/util/AsyncSearch.js +++ /dev/null @@ -1,135 +0,0 @@ -import EventEmitter from 'events'; - -class AsyncSearch extends EventEmitter { - constructor() { - super(); - - this._reset(); - - this.RESULT_SENT = 'RESULT_SENT'; - } - - _reset() { - this.dataList = null; - this.term = null; - this.searchKeys = null; - this.isContain = false; - this.isCaseSensitive = false; - this.normalizeUnicode = true; - this.ignoreWhitespace = true; - this.limit = null; - this.findingList = []; - - this.searchUptoIndex = 0; - this.sessionStartTimestamp = 0; - } - - _softReset() { - this.term = null; - this.findingList = []; - this.searchUptoIndex = 0; - this.sessionStartTimestamp = 0; - } - - /** - * Setup the search. - * opts.keys are required when dataList items are object. - * - * @param {[string | object]} dataList - A list to search in - * @param {object} opts - Options - * @param {string | [string]} [opts.keys=null] - * @param {boolean} [opts.isContain=false] - Add finding to result if it contain search term - * @param {boolean} [opts.isCaseSensitive=false] - * @param {boolean} [opts.normalizeUnicode=true] - * @param {boolean} [opts.ignoreWhitespace=true] - * @param {number} [opts.limit=null] - Stop search after limit - */ - setup(dataList, opts) { - this._reset(); - this.dataList = dataList; - this.searchKeys = opts?.keys || null; - this.isContain = opts?.isContain || false; - this.isCaseSensitive = opts?.isCaseSensitive || false; - this.normalizeUnicode = opts?.normalizeUnicode || true; - this.ignoreWhitespace = opts?.ignoreWhitespace || true; - this.limit = opts?.limit || null; - } - - search(term) { - this._softReset(); - - this.term = this._normalize(term); - if (this.term === '') { - this._sendFindings(); - return; - } - - this._find(this.sessionStartTimestamp, 0); - } - - _find(sessionTimestamp, lastFindingCount) { - if (sessionTimestamp !== this.sessionStartTimestamp) return; - this.sessionStartTimestamp = window.performance.now(); - - for ( - let searchIndex = this.searchUptoIndex; - searchIndex < this.dataList.length; - searchIndex += 1 - ) { - if (this._match(this.dataList[searchIndex])) { - this.findingList.push(this.dataList[searchIndex]); - if (typeof this.limit === 'number' && this.findingList.length >= this.limit) break; - } - - const calcFinishTime = window.performance.now(); - if (calcFinishTime - this.sessionStartTimestamp > 8) { - const thisFindingCount = this.findingList.length; - const thisSessionTimestamp = this.sessionStartTimestamp; - if (lastFindingCount !== thisFindingCount) this._sendFindings(); - - this.searchUptoIndex = searchIndex + 1; - setTimeout(() => this._find(thisSessionTimestamp, thisFindingCount)); - return; - } - } - - if (lastFindingCount !== this.findingList.length - || lastFindingCount === 0) this._sendFindings(); - this._softReset(); - } - - _match(item) { - if (typeof item === 'string') { - return this._compare(item); - } - if (typeof item === 'object') { - if (Array.isArray(this.searchKeys)) { - return !!this.searchKeys.find((key) => this._compare(item[key])); - } - if (typeof this.searchKeys === 'string') { - return this._compare(item[this.searchKeys]); - } - } - return false; - } - - _compare(item) { - if (typeof item !== 'string') return false; - const myItem = this._normalize(item); - if (this.isContain) return myItem.indexOf(this.term) !== -1; - return myItem.startsWith(this.term); - } - - _normalize(item) { - let myItem = item.normalize(this.normalizeUnicode ? 'NFKC' : 'NFC'); - if (!this.isCaseSensitive) myItem = myItem.toLocaleLowerCase(); - if (this.ignoreWhitespace) myItem = myItem.replace(/\s/g, ''); - return myItem; - } - - _sendFindings() { - this.emit(this.RESULT_SENT, this.findingList, this.term); - } -} - -export default AsyncSearch; diff --git a/src/util/common.js b/src/util/common.js deleted file mode 100644 index 2affe27d..00000000 --- a/src/util/common.js +++ /dev/null @@ -1,230 +0,0 @@ -/* eslint-disable max-classes-per-file */ -export function bytesToSize(bytes) { - const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB']; - if (bytes === 0) return 'n/a'; - const i = parseInt(Math.floor(Math.log(bytes) / Math.log(1024)), 10); - if (i === 0) return `${bytes} ${sizes[i]}`; - return `${(bytes / (1024 ** i)).toFixed(1)} ${sizes[i]}`; -} - -export function diffMinutes(dt2, dt1) { - let diff = (dt2.getTime() - dt1.getTime()) / 1000; - diff /= 60; - return Math.abs(Math.round(diff)); -} - -export function isInSameDay(dt2, dt1) { - return ( - dt2.getFullYear() === dt1.getFullYear() - && dt2.getMonth() === dt1.getMonth() - && dt2.getDate() === dt1.getDate() - ); -} - -/** - * @param {Event} ev - * @param {string} [targetSelector] element selector for Element.matches([selector]) - */ -export function getEventCords(ev, targetSelector) { - let boxInfo; - - const path = ev.nativeEvent.composedPath(); - const target = targetSelector - ? path.find((element) => element.matches?.(targetSelector)) - : null; - if (target) { - boxInfo = target.getBoundingClientRect(); - } else { - boxInfo = ev.target.getBoundingClientRect(); - } - - return { - x: boxInfo.x, - y: boxInfo.y, - width: boxInfo.width, - height: boxInfo.height, - detail: ev.detail, - }; -} - -export function abbreviateNumber(number) { - if (number > 99) return '99+'; - return number; -} - -export class Debounce { - constructor() { - this.timeoutId = null; - } - - /** - * @param {function} func - callback function - * @param {number} wait - wait in milliseconds to call func - * @returns {func} debounceCallback - to pass arguments to func callback - */ - _(func, wait) { - const that = this; - return function debounceCallback(...args) { - clearTimeout(that.timeoutId); - that.timeoutId = setTimeout(() => { - func.apply(this, args); - that.timeoutId = null; - }, wait); - }; - } -} - -export class Throttle { - constructor() { - this.timeoutId = null; - } - - /** - * @param {function} func - callback function - * @param {number} wait - wait in milliseconds to call func - * @returns {function} throttleCallback - to pass arguments to func callback - */ - _(func, wait) { - const that = this; - return function throttleCallback(...args) { - if (that.timeoutId !== null) return; - that.timeoutId = setTimeout(() => { - func.apply(this, args); - that.timeoutId = null; - }, wait); - }; - } -} - -export function getUrlPrams(paramName) { - const queryString = window.location.search; - const urlParams = new URLSearchParams(queryString); - return urlParams.get(paramName); -} - -export function getScrollInfo(target) { - const scroll = {}; - scroll.top = Math.round(target.scrollTop); - scroll.height = Math.round(target.scrollHeight); - scroll.viewHeight = Math.round(target.offsetHeight); - scroll.isScrollable = scroll.height > scroll.viewHeight; - return scroll; -} - -export function avatarInitials(text) { - return [...text][0]; -} - -export function cssVar(name) { - return getComputedStyle(document.body).getPropertyValue(name); -} - -export function setFavicon(url) { - const favicon = document.querySelector('#favicon'); - if (!favicon) return; - favicon.setAttribute('href', url); -} - -export function copyToClipboard(text) { - if (navigator.clipboard) { - navigator.clipboard.writeText(text); - } else { - const host = document.body; - const copyInput = document.createElement('input'); - copyInput.style.position = 'fixed'; - copyInput.style.opacity = '0'; - copyInput.value = text; - host.append(copyInput); - - copyInput.select(); - copyInput.setSelectionRange(0, 99999); - document.execCommand('Copy'); - copyInput.remove(); - } -} - -export function suffixRename(name, validator) { - let suffix = 2; - let newName = name; - do { - newName = name + suffix; - suffix += 1; - } while (validator(newName)); - - return newName; -} - -export function getImageDimension(file) { - return new Promise((resolve) => { - const img = new Image(); - img.onload = async () => { - resolve({ - w: img.width, - h: img.height, - }); - URL.revokeObjectURL(img.src); - }; - img.src = URL.createObjectURL(file); - }); -} - -export function scaleDownImage(imageFile, width, height) { - return new Promise((resolve) => { - const imgURL = URL.createObjectURL(imageFile); - const img = new Image(); - - img.onload = () => { - let newWidth = img.width; - let newHeight = img.height; - if (newHeight <= height && newWidth <= width) { - resolve(imageFile); - } - - if (newHeight > height) { - newWidth = Math.floor(newWidth * (height / newHeight)); - newHeight = height; - } - if (newWidth > width) { - newHeight = Math.floor(newHeight * (width / newWidth)); - newWidth = width; - } - - const canvas = document.createElement('canvas'); - canvas.width = newWidth; - canvas.height = newHeight; - const ctx = canvas.getContext('2d'); - ctx.drawImage(img, 0, 0, newWidth, newHeight); - - canvas.toBlob((thumbnail) => { - URL.revokeObjectURL(imgURL); - resolve(thumbnail); - }, imageFile.type); - }; - - img.src = imgURL; - }); -} - -/** - * @param {sigil} string sigil to search for (for example '@', '#' or '$') - * @param {flags} string regex flags - * @param {prefix} string prefix appended at the beginning of the regex - * @returns {RegExp} - */ -export function idRegex(sigil, flags, prefix) { - const servername = '(?:[a-zA-Z0-9-.]*[a-zA-Z0-9]+|\\[\\S+?\\])(?::\\d+)?'; - return new RegExp(`${prefix}(${sigil}\\S+:${servername})`, flags); -} - -const matrixToRegex = /^https?:\/\/matrix.to\/#\/(\S+:\S+)/; -/** - * Parses a matrix.to URL into an matrix id. - * This function can later be extended to support matrix: URIs - * @param {string} uri The URI to parse - * @returns {string|null} The id or null if the URI does not match - */ -export function parseIdUri(uri) { - const res = decodeURIComponent(uri).match(matrixToRegex); - if (!res) return null; - return res[1]; -} diff --git a/src/util/matrixUtil.js b/src/util/matrixUtil.js deleted file mode 100644 index 19688a2b..00000000 --- a/src/util/matrixUtil.js +++ /dev/null @@ -1,113 +0,0 @@ -import HashIC from '../../public/res/ic/outlined/hash.svg'; -import HashGlobeIC from '../../public/res/ic/outlined/hash-globe.svg'; -import HashLockIC from '../../public/res/ic/outlined/hash-lock.svg'; -import SpaceIC from '../../public/res/ic/outlined/space.svg'; -import SpaceGlobeIC from '../../public/res/ic/outlined/space-globe.svg'; -import SpaceLockIC from '../../public/res/ic/outlined/space-lock.svg'; - -const WELL_KNOWN_URI = '/.well-known/matrix/client'; - -export async function getBaseUrl(servername) { - let protocol = 'https://'; - if (servername.match(/^https?:\/\//) !== null) protocol = ''; - const serverDiscoveryUrl = `${protocol}${servername}${WELL_KNOWN_URI}`; - try { - const result = await (await fetch(serverDiscoveryUrl, { method: 'GET' })).json(); - - const baseUrl = result?.['m.homeserver']?.base_url; - if (baseUrl === undefined) throw new Error(); - return baseUrl; - } catch (e) { - return `${protocol}${servername}`; - } -} - -export function getUsername(mx, userId) { - const user = mx.getUser(userId); - if (user === null) return userId; - let username = user.displayName; - if (typeof username === 'undefined') { - username = userId; - } - return username; -} - -export function getUsernameOfRoomMember(roomMember) { - return roomMember.name || roomMember.userId; -} - -export async function isRoomAliasAvailable(mx, alias) { - try { - const result = await mx.getRoomIdForAlias(alias); - if (result.room_id) return false; - return false; - } catch (e) { - if (e.errcode === 'M_NOT_FOUND') return true; - return false; - } -} - -export function getPowerLabel(powerLevel) { - if (powerLevel > 9000) return 'Goku'; - if (powerLevel > 100) return 'Founder'; - if (powerLevel === 100) return 'Admin'; - if (powerLevel >= 50) return 'Mod'; - return null; -} - -export function parseReply(rawBody) { - if (rawBody?.indexOf('>') !== 0) return null; - let body = rawBody.slice(rawBody.indexOf('<') + 1); - const user = body.slice(0, body.indexOf('>')); - - body = body.slice(body.indexOf('>') + 2); - const replyBody = body.slice(0, body.indexOf('\n\n')); - body = body.slice(body.indexOf('\n\n') + 2); - - if (user === '') return null; - - const isUserId = user.match(/^@.+:.+/); - - return { - userId: isUserId ? user : null, - displayName: isUserId ? null : user, - replyBody, - body, - }; -} - -export function trimHTMLReply(html) { - if (!html) return html; - const suffix = ''; - const i = html.indexOf(suffix); - if (i < 0) { - return html; - } - return html.slice(i + suffix.length); -} - -export function joinRuleToIconSrc(joinRule, isSpace) { - return ({ - restricted: () => (isSpace ? SpaceIC : HashIC), - knock: () => (isSpace ? SpaceLockIC : HashLockIC), - invite: () => (isSpace ? SpaceLockIC : HashLockIC), - public: () => (isSpace ? SpaceGlobeIC : HashGlobeIC), - }[joinRule]?.() || null); -} - -export function getIdServer(userId) { - const idParts = userId.split(':'); - return idParts[1]; -} - -export async function hasDevices(mx, userId) { - try { - const usersDeviceMap = await mx.getCrypto()?.getUserDeviceInfo([userId, mx.getUserId()], true); - - return Array.from(usersDeviceMap.values()) - .every((deviceIdToDevices) => deviceIdToDevices.size > 0); - } catch (e) { - console.error("Error determining if it's possible to encrypt to all users: ", e); - return false; - } -} diff --git a/src/util/sort.js b/src/util/sort.js deleted file mode 100644 index cc73cf57..00000000 --- a/src/util/sort.js +++ /dev/null @@ -1,20 +0,0 @@ -export function memberByAtoZ(m1, m2) { - const aName = m1.name; - const bName = m2.name; - - if (aName.toLowerCase() < bName.toLowerCase()) { - return -1; - } - if (aName.toLowerCase() > bName.toLowerCase()) { - return 1; - } - return 0; -} -export function memberByPowerLevel(m1, m2) { - const pl1 = m1.powerLevel; - const pl2 = m2.powerLevel; - - if (pl1 > pl2) return -1; - if (pl1 < pl2) return 1; - return 0; -}